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_generic_icon_name:
11436  * @type: a content type string
11437  *
11438  * Gets the generic icon name for a content type.
11439  *
11440  * See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
11441  * specification for more on the generic icon name.
11442  *
11443  * Returns: (allow-none): the registered generic icon name for the given @type, or %NULL if unknown. Free with g_free()
11444  * Since: 2.34
11445  */
11446
11447
11448 /**
11449  * g_content_type_get_icon:
11450  * @type: a content type string
11451  *
11452  * Gets the icon for a content type.
11453  *
11454  * Returns: (transfer full): #GIcon corresponding to the content type. Free the returned object with g_object_unref()
11455  */
11456
11457
11458 /**
11459  * g_content_type_get_mime_type:
11460  * @type: a content type string
11461  *
11462  * Gets the mime type for the content type, if one is registered.
11463  *
11464  * Returns: (allow-none): the registered mime type for the given @type, or %NULL if unknown.
11465  */
11466
11467
11468 /**
11469  * g_content_type_get_symbolic_icon:
11470  * @type: a content type string
11471  *
11472  * Gets the symbolic icon for a content type.
11473  *
11474  * Returns: (transfer full): symbolic #GIcon corresponding to the content type. Free the returned object with g_object_unref()
11475  * Since: 2.34
11476  */
11477
11478
11479 /**
11480  * g_content_type_guess:
11481  * @filename: (allow-none): a string, or %NULL
11482  * @data: (allow-none) (array length=data_size): a stream of data, or %NULL
11483  * @data_size: the size of @data
11484  * @result_uncertain: (allow-none) (out): return location for the certainty of the result, or %NULL
11485  *
11486  * Guesses the content type based on example data. If the function is
11487  * uncertain, @result_uncertain will be set to %TRUE. Either @filename
11488  * or @data may be %NULL, in which case the guess will be based solely
11489  * on the other argument.
11490  *
11491  * Returns: a string indicating a guessed content type for the given data. Free with g_free()
11492  */
11493
11494
11495 /**
11496  * g_content_type_guess_for_tree:
11497  * @root: the root of the tree to guess a type for
11498  *
11499  * Tries to guess the type of the tree with root @root, by
11500  * looking at the files it contains. The result is an array
11501  * of content types, with the best guess coming first.
11502  *
11503  * The types returned all have the form x-content/foo, e.g.
11504  * x-content/audio-cdda (for audio CDs) or x-content/image-dcf
11505  * (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
11506  * specification for more on x-content types.
11507  *
11508  * This function is useful in the implementation of
11509  * g_mount_guess_content_type().
11510  *
11511  * Returns: (transfer full) (array zero-terminated=1): an %NULL-terminated array of zero or more content types. Free with g_strfreev()
11512  * Since: 2.18
11513  */
11514
11515
11516 /**
11517  * g_content_type_is_a:
11518  * @type: a content type string
11519  * @supertype: a content type string
11520  *
11521  * Determines if @type is a subset of @supertype.
11522  *
11523  * Returns: %TRUE if @type is a kind of @supertype, %FALSE otherwise.
11524  */
11525
11526
11527 /**
11528  * g_content_type_is_unknown:
11529  * @type: a content type string
11530  *
11531  * Checks if the content type is the generic "unknown" type.
11532  * On UNIX this is the "application/octet-stream" mimetype,
11533  * while on win32 it is "*".
11534  *
11535  * Returns: %TRUE if the type is the unknown type.
11536  */
11537
11538
11539 /**
11540  * g_content_types_get_registered:
11541  *
11542  * Gets a list of strings containing all the registered content types
11543  * known to the system. The list and its data should be freed using
11544  * <programlisting>
11545  * g_list_free_full (list, g_free);
11546  * </programlisting>
11547  *
11548  * Returns: (element-type utf8) (transfer full): #GList of the registered content types
11549  */
11550
11551
11552 /**
11553  * g_converter_convert:
11554  * @converter: a #GConverter.
11555  * @inbuf: (array length=inbuf_size) (element-type guint8): the buffer containing the data to convert.
11556  * @inbuf_size: the number of bytes in @inbuf
11557  * @outbuf: a buffer to write converted data in.
11558  * @outbuf_size: the number of bytes in @outbuf, must be at least one
11559  * @flags: a #GConverterFlags controlling the conversion details
11560  * @bytes_read: (out): will be set to the number of bytes read from @inbuf on success
11561  * @bytes_written: (out): will be set to the number of bytes written to @outbuf on success
11562  * @error: location to store the error occurring, or %NULL to ignore
11563  *
11564  * This is the main operation used when converting data. It is to be called
11565  * multiple times in a loop, and each time it will do some work, i.e.
11566  * producing some output (in @outbuf) or consuming some input (from @inbuf) or
11567  * both. If its not possible to do any work an error is returned.
11568  *
11569  * Note that a single call may not consume all input (or any input at all).
11570  * Also a call may produce output even if given no input, due to state stored
11571  * in the converter producing output.
11572  *
11573  * If any data was either produced or consumed, and then an error happens, then
11574  * only the successful conversion is reported and the error is returned on the
11575  * next call.
11576  *
11577  * A full conversion loop involves calling this method repeatedly, each time
11578  * giving it new input and space output space. When there is no more input
11579  * data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
11580  * The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
11581  * each time until all data is consumed and all output is produced, then
11582  * %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
11583  * may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
11584  * in a decompression converter where the end of data is detectable from the
11585  * data (and there might even be other data after the end of the compressed data).
11586  *
11587  * When some data has successfully been converted @bytes_read and is set to
11588  * the number of bytes read from @inbuf, and @bytes_written is set to indicate
11589  * how many bytes was written to @outbuf. If there are more data to output
11590  * or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
11591  * %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
11592  * then %G_CONVERTER_FINISHED is returned.
11593  *
11594  * On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
11595  * Some errors need special handling:
11596  *
11597  * %G_IO_ERROR_NO_SPACE is returned if there is not enough space
11598  * to write the resulting converted data, the application should
11599  * call the function again with a larger @outbuf to continue.
11600  *
11601  * %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
11602  * input to fully determine what the conversion should produce,
11603  * and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
11604  * example with an incomplete multibyte sequence when converting text,
11605  * or when a regexp matches up to the end of the input (and may match
11606  * further input). It may also happen when @inbuf_size is zero and
11607  * there is no more data to produce.
11608  *
11609  * When this happens the application should read more input and then
11610  * call the function again. If further input shows that there is no
11611  * more data call the function again with the same data but with
11612  * the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
11613  * to finish as e.g. in the regexp match case (or, to fail again with
11614  * %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
11615  * input is actually partial).
11616  *
11617  * After g_converter_convert() has returned %G_CONVERTER_FINISHED the
11618  * converter object is in an invalid state where its not allowed
11619  * to call g_converter_convert() anymore. At this time you can only
11620  * free the object or call g_converter_reset() to reset it to the
11621  * initial state.
11622  *
11623  * If the flag %G_CONVERTER_FLUSH is set then conversion is modified
11624  * to try to write out all internal state to the output. The application
11625  * has to call the function multiple times with the flag set, and when
11626  * the available input has been consumed and all internal state has
11627  * been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
11628  * really at the end) is returned instead of %G_CONVERTER_CONVERTED.
11629  * This is somewhat similar to what happens at the end of the input stream,
11630  * but done in the middle of the data.
11631  *
11632  * This has different meanings for different conversions. For instance
11633  * in a compression converter it would mean that we flush all the
11634  * compression state into output such that if you uncompress the
11635  * compressed data you get back all the input data. Doing this may
11636  * make the final file larger due to padding though. Another example
11637  * is a regexp conversion, where if you at the end of the flushed data
11638  * have a match, but there is also a potential longer match. In the
11639  * non-flushed case we would ask for more input, but when flushing we
11640  * treat this as the end of input and do the match.
11641  *
11642  * Flushing is not always possible (like if a charset converter flushes
11643  * at a partial multibyte sequence). Converters are supposed to try
11644  * to produce as much output as possible and then return an error
11645  * (typically %G_IO_ERROR_PARTIAL_INPUT).
11646  *
11647  * Returns: a #GConverterResult, %G_CONVERTER_ERROR on error.
11648  * Since: 2.24
11649  */
11650
11651
11652 /**
11653  * g_converter_input_stream_get_converter:
11654  * @converter_stream: a #GConverterInputStream
11655  *
11656  * Gets the #GConverter that is used by @converter_stream.
11657  *
11658  * Returns: (transfer none): the converter of the converter input stream
11659  * Since: 2.24
11660  */
11661
11662
11663 /**
11664  * g_converter_input_stream_new:
11665  * @base_stream: a #GInputStream
11666  * @converter: a #GConverter
11667  *
11668  * Creates a new converter input stream for the @base_stream.
11669  *
11670  * Returns: a new #GInputStream.
11671  */
11672
11673
11674 /**
11675  * g_converter_output_stream_get_converter:
11676  * @converter_stream: a #GConverterOutputStream
11677  *
11678  * Gets the #GConverter that is used by @converter_stream.
11679  *
11680  * Returns: (transfer none): the converter of the converter output stream
11681  * Since: 2.24
11682  */
11683
11684
11685 /**
11686  * g_converter_output_stream_new:
11687  * @base_stream: a #GOutputStream
11688  * @converter: a #GConverter
11689  *
11690  * Creates a new converter output stream for the @base_stream.
11691  *
11692  * Returns: a new #GOutputStream.
11693  */
11694
11695
11696 /**
11697  * g_converter_reset:
11698  * @converter: a #GConverter.
11699  *
11700  * Resets all internal state in the converter, making it behave
11701  * as if it was just created. If the converter has any internal
11702  * state that would produce output then that output is lost.
11703  *
11704  * Since: 2.24
11705  */
11706
11707
11708 /**
11709  * g_credentials_get_native: (skip)
11710  * @credentials: A #GCredentials.
11711  * @native_type: The type of native credentials to get.
11712  *
11713  * Gets a pointer to native credentials of type @native_type from
11714  * @credentials.
11715  *
11716  * It is a programming error (which will cause an warning to be
11717  * logged) to use this method if there is no #GCredentials support for
11718  * the OS or if @native_type isn't supported by the OS.
11719  *
11720  * 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.
11721  * Since: 2.26
11722  */
11723
11724
11725 /**
11726  * g_credentials_get_unix_user:
11727  * @credentials: A #GCredentials
11728  * @error: Return location for error or %NULL.
11729  *
11730  * Tries to get the UNIX user identifier from @credentials. This
11731  * method is only available on UNIX platforms.
11732  *
11733  * This operation can fail if #GCredentials is not supported on the
11734  * OS or if the native credentials type does not contain information
11735  * about the UNIX user.
11736  *
11737  * Returns: The UNIX user identifier or -1 if @error is set.
11738  * Since: 2.26
11739  */
11740
11741
11742 /**
11743  * g_credentials_is_same_user:
11744  * @credentials: A #GCredentials.
11745  * @other_credentials: A #GCredentials.
11746  * @error: Return location for error or %NULL.
11747  *
11748  * Checks if @credentials and @other_credentials is the same user.
11749  *
11750  * This operation can fail if #GCredentials is not supported on the
11751  * the OS.
11752  *
11753  * Returns: %TRUE if @credentials and @other_credentials has the same user, %FALSE otherwise or if @error is set.
11754  * Since: 2.26
11755  */
11756
11757
11758 /**
11759  * g_credentials_new:
11760  *
11761  * Creates a new #GCredentials object with credentials matching the
11762  * the current process.
11763  *
11764  * Returns: A #GCredentials. Free with g_object_unref().
11765  * Since: 2.26
11766  */
11767
11768
11769 /**
11770  * g_credentials_set_native:
11771  * @credentials: A #GCredentials.
11772  * @native_type: The type of native credentials to set.
11773  * @native: A pointer to native credentials.
11774  *
11775  * Copies the native credentials of type @native_type from @native
11776  * into @credentials.
11777  *
11778  * It is a programming error (which will cause an warning to be
11779  * logged) to use this method if there is no #GCredentials support for
11780  * the OS or if @native_type isn't supported by the OS.
11781  *
11782  * Since: 2.26
11783  */
11784
11785
11786 /**
11787  * g_credentials_set_unix_user:
11788  * @credentials: A #GCredentials.
11789  * @uid: The UNIX user identifier to set.
11790  * @error: Return location for error or %NULL.
11791  *
11792  * Tries to set the UNIX user identifier on @credentials. This method
11793  * is only available on UNIX platforms.
11794  *
11795  * This operation can fail if #GCredentials is not supported on the
11796  * OS or if the native credentials type does not contain information
11797  * about the UNIX user.
11798  *
11799  * Returns: %TRUE if @uid was set, %FALSE if error is set.
11800  * Since: 2.26
11801  */
11802
11803
11804 /**
11805  * g_credentials_to_string:
11806  * @credentials: A #GCredentials object.
11807  *
11808  * Creates a human-readable textual representation of @credentials
11809  * that can be used in logging and debug messages. The format of the
11810  * returned string may change in future GLib release.
11811  *
11812  * Returns: A string that should be freed with g_free().
11813  * Since: 2.26
11814  */
11815
11816
11817 /**
11818  * g_data_input_stream_get_byte_order:
11819  * @stream: a given #GDataInputStream.
11820  *
11821  * Gets the byte order for the data input stream.
11822  *
11823  * Returns: the @stream's current #GDataStreamByteOrder.
11824  */
11825
11826
11827 /**
11828  * g_data_input_stream_get_newline_type:
11829  * @stream: a given #GDataInputStream.
11830  *
11831  * Gets the current newline type for the @stream.
11832  *
11833  * Returns: #GDataStreamNewlineType for the given @stream.
11834  */
11835
11836
11837 /**
11838  * g_data_input_stream_new:
11839  * @base_stream: a #GInputStream.
11840  *
11841  * Creates a new data input stream for the @base_stream.
11842  *
11843  * Returns: a new #GDataInputStream.
11844  */
11845
11846
11847 /**
11848  * g_data_input_stream_read_byte:
11849  * @stream: a given #GDataInputStream.
11850  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11851  * @error: #GError for error reporting.
11852  *
11853  * Reads an unsigned 8-bit/1-byte value from @stream.
11854  *
11855  * Returns: an unsigned 8-bit/1-byte value read from the @stream or %0 if an error occurred.
11856  */
11857
11858
11859 /**
11860  * g_data_input_stream_read_int16:
11861  * @stream: a given #GDataInputStream.
11862  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11863  * @error: #GError for error reporting.
11864  *
11865  * Reads a 16-bit/2-byte value from @stream.
11866  *
11867  * In order to get the correct byte order for this read operation,
11868  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11869  *
11870  * Returns: a signed 16-bit/2-byte value read from @stream or %0 if an error occurred.
11871  */
11872
11873
11874 /**
11875  * g_data_input_stream_read_int32:
11876  * @stream: a given #GDataInputStream.
11877  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11878  * @error: #GError for error reporting.
11879  *
11880  * Reads a signed 32-bit/4-byte value from @stream.
11881  *
11882  * In order to get the correct byte order for this read operation,
11883  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11884  *
11885  * If @cancellable is not %NULL, then the operation can be cancelled by
11886  * triggering the cancellable object from another thread. If the operation
11887  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11888  *
11889  * Returns: a signed 32-bit/4-byte value read from the @stream or %0 if an error occurred.
11890  */
11891
11892
11893 /**
11894  * g_data_input_stream_read_int64:
11895  * @stream: a given #GDataInputStream.
11896  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11897  * @error: #GError for error reporting.
11898  *
11899  * Reads a 64-bit/8-byte value from @stream.
11900  *
11901  * In order to get the correct byte order for this read operation,
11902  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11903  *
11904  * If @cancellable is not %NULL, then the operation can be cancelled by
11905  * triggering the cancellable object from another thread. If the operation
11906  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11907  *
11908  * Returns: a signed 64-bit/8-byte value read from @stream or %0 if an error occurred.
11909  */
11910
11911
11912 /**
11913  * g_data_input_stream_read_line:
11914  * @stream: a given #GDataInputStream.
11915  * @length: (out): a #gsize to get the length of the data read in.
11916  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11917  * @error: #GError for error reporting.
11918  *
11919  * Reads a line from the data input stream.  Note that no encoding
11920  * checks or conversion is performed; the input is not guaranteed to
11921  * be UTF-8, and may in fact have embedded NUL characters.
11922  *
11923  * If @cancellable is not %NULL, then the operation can be cancelled by
11924  * triggering the cancellable object from another thread. If the operation
11925  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11926  *
11927  * 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.
11928  */
11929
11930
11931 /**
11932  * g_data_input_stream_read_line_async:
11933  * @stream: a given #GDataInputStream.
11934  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11935  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11936  * @callback: (scope async): callback to call when the request is satisfied.
11937  * @user_data: (closure): the data to pass to callback function.
11938  *
11939  * The asynchronous version of g_data_input_stream_read_line().  It is
11940  * an error to have two outstanding calls to this function.
11941  *
11942  * When the operation is finished, @callback will be called. You
11943  * can then call g_data_input_stream_read_line_finish() to get
11944  * the result of the operation.
11945  *
11946  * Since: 2.20
11947  */
11948
11949
11950 /**
11951  * g_data_input_stream_read_line_finish:
11952  * @stream: a given #GDataInputStream.
11953  * @result: the #GAsyncResult that was provided to the callback.
11954  * @length: (out): a #gsize to get the length of the data read in.
11955  * @error: #GError for error reporting.
11956  *
11957  * Finish an asynchronous call started by
11958  * g_data_input_stream_read_line_async().  Note the warning about
11959  * string encoding in g_data_input_stream_read_line() applies here as
11960  * well.
11961  *
11962  * 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.
11963  * Since: 2.20
11964  */
11965
11966
11967 /**
11968  * g_data_input_stream_read_line_finish_utf8:
11969  * @stream: a given #GDataInputStream.
11970  * @result: the #GAsyncResult that was provided to the callback.
11971  * @length: (out): a #gsize to get the length of the data read in.
11972  * @error: #GError for error reporting.
11973  *
11974  * Finish an asynchronous call started by
11975  * g_data_input_stream_read_line_async().
11976  *
11977  * 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.
11978  * Since: 2.30
11979  */
11980
11981
11982 /**
11983  * g_data_input_stream_read_line_utf8:
11984  * @stream: a given #GDataInputStream.
11985  * @length: (out): a #gsize to get the length of the data read in.
11986  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11987  * @error: #GError for error reporting.
11988  *
11989  * Reads a UTF-8 encoded line from the data input stream.
11990  *
11991  * If @cancellable is not %NULL, then the operation can be cancelled by
11992  * triggering the cancellable object from another thread. If the operation
11993  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11994  *
11995  * 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.
11996  * Since: 2.30
11997  */
11998
11999
12000 /**
12001  * g_data_input_stream_read_uint16:
12002  * @stream: a given #GDataInputStream.
12003  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12004  * @error: #GError for error reporting.
12005  *
12006  * Reads an unsigned 16-bit/2-byte value from @stream.
12007  *
12008  * In order to get the correct byte order for this read operation,
12009  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12010  *
12011  * Returns: an unsigned 16-bit/2-byte value read from the @stream or %0 if an error occurred.
12012  */
12013
12014
12015 /**
12016  * g_data_input_stream_read_uint32:
12017  * @stream: a given #GDataInputStream.
12018  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12019  * @error: #GError for error reporting.
12020  *
12021  * Reads an unsigned 32-bit/4-byte value from @stream.
12022  *
12023  * In order to get the correct byte order for this read operation,
12024  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
12025  *
12026  * If @cancellable is not %NULL, then the operation can be cancelled by
12027  * triggering the cancellable object from another thread. If the operation
12028  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12029  *
12030  * Returns: an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred.
12031  */
12032
12033
12034 /**
12035  * g_data_input_stream_read_uint64:
12036  * @stream: a given #GDataInputStream.
12037  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12038  * @error: #GError for error reporting.
12039  *
12040  * Reads an unsigned 64-bit/8-byte value from @stream.
12041  *
12042  * In order to get the correct byte order for this read operation,
12043  * see g_data_input_stream_get_byte_order().
12044  *
12045  * If @cancellable is not %NULL, then the operation can be cancelled by
12046  * triggering the cancellable object from another thread. If the operation
12047  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12048  *
12049  * Returns: an unsigned 64-bit/8-byte read from @stream or %0 if an error occurred.
12050  */
12051
12052
12053 /**
12054  * g_data_input_stream_read_until:
12055  * @stream: a given #GDataInputStream.
12056  * @stop_chars: characters to terminate the read.
12057  * @length: (out): a #gsize to get the length of the data read in.
12058  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12059  * @error: #GError for error reporting.
12060  *
12061  * Reads a string from the data input stream, up to the first
12062  * occurrence of any of the stop characters.
12063  *
12064  * Note that, in contrast to g_data_input_stream_read_until_async(),
12065  * this function consumes the stop character that it finds.
12066  *
12067  * Don't use this function in new code.  Its functionality is
12068  * inconsistent with g_data_input_stream_read_until_async().  Both
12069  * functions will be marked as deprecated in a future release.  Use
12070  * g_data_input_stream_read_upto() instead, but note that that function
12071  * does not consume the stop character.
12072  *
12073  * 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.
12074  */
12075
12076
12077 /**
12078  * g_data_input_stream_read_until_async:
12079  * @stream: a given #GDataInputStream.
12080  * @stop_chars: characters to terminate the read.
12081  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12082  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12083  * @callback: (scope async): callback to call when the request is satisfied.
12084  * @user_data: (closure): the data to pass to callback function.
12085  *
12086  * The asynchronous version of g_data_input_stream_read_until().
12087  * It is an error to have two outstanding calls to this function.
12088  *
12089  * Note that, in contrast to g_data_input_stream_read_until(),
12090  * this function does not consume the stop character that it finds.  You
12091  * must read it for yourself.
12092  *
12093  * When the operation is finished, @callback will be called. You
12094  * can then call g_data_input_stream_read_until_finish() to get
12095  * the result of the operation.
12096  *
12097  * Don't use this function in new code.  Its functionality is
12098  * inconsistent with g_data_input_stream_read_until().  Both functions
12099  * will be marked as deprecated in a future release.  Use
12100  * g_data_input_stream_read_upto_async() instead.
12101  *
12102  * Since: 2.20
12103  */
12104
12105
12106 /**
12107  * g_data_input_stream_read_until_finish:
12108  * @stream: a given #GDataInputStream.
12109  * @result: the #GAsyncResult that was provided to the callback.
12110  * @length: (out): a #gsize to get the length of the data read in.
12111  * @error: #GError for error reporting.
12112  *
12113  * Finish an asynchronous call started by
12114  * g_data_input_stream_read_until_async().
12115  *
12116  * Since: 2.20
12117  * 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.
12118  */
12119
12120
12121 /**
12122  * g_data_input_stream_read_upto:
12123  * @stream: a #GDataInputStream
12124  * @stop_chars: characters to terminate the read
12125  * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12126  * @length: (out): a #gsize to get the length of the data read in
12127  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12128  * @error: #GError for error reporting
12129  *
12130  * Reads a string from the data input stream, up to the first
12131  * occurrence of any of the stop characters.
12132  *
12133  * In contrast to g_data_input_stream_read_until(), this function
12134  * does <emphasis>not</emphasis> consume the stop character. You have
12135  * to use g_data_input_stream_read_byte() to get it before calling
12136  * g_data_input_stream_read_upto() again.
12137  *
12138  * Note that @stop_chars may contain '\0' if @stop_chars_len is
12139  * specified.
12140  *
12141  * 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
12142  * Since: 2.26
12143  */
12144
12145
12146 /**
12147  * g_data_input_stream_read_upto_async:
12148  * @stream: a #GDataInputStream
12149  * @stop_chars: characters to terminate the read
12150  * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
12151  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
12152  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
12153  * @callback: (scope async): callback to call when the request is satisfied
12154  * @user_data: (closure): the data to pass to callback function
12155  *
12156  * The asynchronous version of g_data_input_stream_read_upto().
12157  * It is an error to have two outstanding calls to this function.
12158  *
12159  * In contrast to g_data_input_stream_read_until(), this function
12160  * does <emphasis>not</emphasis> consume the stop character. You have
12161  * to use g_data_input_stream_read_byte() to get it before calling
12162  * g_data_input_stream_read_upto() again.
12163  *
12164  * Note that @stop_chars may contain '\0' if @stop_chars_len is
12165  * specified.
12166  *
12167  * When the operation is finished, @callback will be called. You
12168  * can then call g_data_input_stream_read_upto_finish() to get
12169  * the result of the operation.
12170  *
12171  * Since: 2.26
12172  */
12173
12174
12175 /**
12176  * g_data_input_stream_read_upto_finish:
12177  * @stream: a #GDataInputStream
12178  * @result: the #GAsyncResult that was provided to the callback
12179  * @length: (out): a #gsize to get the length of the data read in
12180  * @error: #GError for error reporting
12181  *
12182  * Finish an asynchronous call started by
12183  * g_data_input_stream_read_upto_async().
12184  *
12185  * Note that this function does <emphasis>not</emphasis> consume the
12186  * stop character. You have to use g_data_input_stream_read_byte() to
12187  * get it before calling g_data_input_stream_read_upto_async() again.
12188  *
12189  * 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.
12190  * Since: 2.24
12191  */
12192
12193
12194 /**
12195  * g_data_input_stream_set_byte_order:
12196  * @stream: a given #GDataInputStream.
12197  * @order: a #GDataStreamByteOrder to set.
12198  *
12199  * This function sets the byte order for the given @stream. All subsequent
12200  * reads from the @stream will be read in the given @order.
12201  */
12202
12203
12204 /**
12205  * g_data_input_stream_set_newline_type:
12206  * @stream: a #GDataInputStream.
12207  * @type: the type of new line return as #GDataStreamNewlineType.
12208  *
12209  * Sets the newline type for the @stream.
12210  *
12211  * Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
12212  * chunk ends in "CR" we must read an additional byte to know if this is "CR" or
12213  * "CR LF", and this might block if there is no more data available.
12214  */
12215
12216
12217 /**
12218  * g_data_output_stream_get_byte_order:
12219  * @stream: a #GDataOutputStream.
12220  *
12221  * Gets the byte order for the stream.
12222  *
12223  * Returns: the #GDataStreamByteOrder for the @stream.
12224  */
12225
12226
12227 /**
12228  * g_data_output_stream_new:
12229  * @base_stream: a #GOutputStream.
12230  *
12231  * Creates a new data output stream for @base_stream.
12232  *
12233  * Returns: #GDataOutputStream.
12234  */
12235
12236
12237 /**
12238  * g_data_output_stream_put_byte:
12239  * @stream: a #GDataOutputStream.
12240  * @data: a #guchar.
12241  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12242  * @error: a #GError, %NULL to ignore.
12243  *
12244  * Puts a byte into the output stream.
12245  *
12246  * Returns: %TRUE if @data was successfully added to the @stream.
12247  */
12248
12249
12250 /**
12251  * g_data_output_stream_put_int16:
12252  * @stream: a #GDataOutputStream.
12253  * @data: a #gint16.
12254  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12255  * @error: a #GError, %NULL to ignore.
12256  *
12257  * Puts a signed 16-bit integer into the output stream.
12258  *
12259  * Returns: %TRUE if @data was successfully added to the @stream.
12260  */
12261
12262
12263 /**
12264  * g_data_output_stream_put_int32:
12265  * @stream: a #GDataOutputStream.
12266  * @data: a #gint32.
12267  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12268  * @error: a #GError, %NULL to ignore.
12269  *
12270  * Puts a signed 32-bit integer into the output stream.
12271  *
12272  * Returns: %TRUE if @data was successfully added to the @stream.
12273  */
12274
12275
12276 /**
12277  * g_data_output_stream_put_int64:
12278  * @stream: a #GDataOutputStream.
12279  * @data: a #gint64.
12280  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12281  * @error: a #GError, %NULL to ignore.
12282  *
12283  * Puts a signed 64-bit integer into the stream.
12284  *
12285  * Returns: %TRUE if @data was successfully added to the @stream.
12286  */
12287
12288
12289 /**
12290  * g_data_output_stream_put_string:
12291  * @stream: a #GDataOutputStream.
12292  * @str: a string.
12293  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12294  * @error: a #GError, %NULL to ignore.
12295  *
12296  * Puts a string into the output stream.
12297  *
12298  * Returns: %TRUE if @string was successfully added to the @stream.
12299  */
12300
12301
12302 /**
12303  * g_data_output_stream_put_uint16:
12304  * @stream: a #GDataOutputStream.
12305  * @data: a #guint16.
12306  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12307  * @error: a #GError, %NULL to ignore.
12308  *
12309  * Puts an unsigned 16-bit integer into the output stream.
12310  *
12311  * Returns: %TRUE if @data was successfully added to the @stream.
12312  */
12313
12314
12315 /**
12316  * g_data_output_stream_put_uint32:
12317  * @stream: a #GDataOutputStream.
12318  * @data: a #guint32.
12319  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12320  * @error: a #GError, %NULL to ignore.
12321  *
12322  * Puts an unsigned 32-bit integer into the stream.
12323  *
12324  * Returns: %TRUE if @data was successfully added to the @stream.
12325  */
12326
12327
12328 /**
12329  * g_data_output_stream_put_uint64:
12330  * @stream: a #GDataOutputStream.
12331  * @data: a #guint64.
12332  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
12333  * @error: a #GError, %NULL to ignore.
12334  *
12335  * Puts an unsigned 64-bit integer into the stream.
12336  *
12337  * Returns: %TRUE if @data was successfully added to the @stream.
12338  */
12339
12340
12341 /**
12342  * g_data_output_stream_set_byte_order:
12343  * @stream: a #GDataOutputStream.
12344  * @order: a %GDataStreamByteOrder.
12345  *
12346  * Sets the byte order of the data output stream to @order.
12347  */
12348
12349
12350 /**
12351  * g_dbus_action_group_get:
12352  * @connection: A #GDBusConnection
12353  * @bus_name: the bus name which exports the action group
12354  * @object_path: the object path at which the action group is exported
12355  *
12356  * Obtains a #GDBusActionGroup for the action group which is exported at
12357  * the given @bus_name and @object_path.
12358  *
12359  * The thread default main context is taken at the time of this call.
12360  * All signals on the menu model (and any linked models) are reported
12361  * with respect to this context.  All calls on the returned menu model
12362  * (and linked models) must also originate from this same context, with
12363  * the thread default main context unchanged.
12364  *
12365  * This call is non-blocking.  The returned action group may or may not
12366  * already be filled in.  The correct thing to do is connect the signals
12367  * for the action group to monitor for changes and then to call
12368  * g_action_group_list_actions() to get the initial list.
12369  *
12370  * Returns: (transfer full): a #GDBusActionGroup
12371  * Since: 2.32
12372  */
12373
12374
12375 /**
12376  * g_dbus_address_get_for_bus_sync:
12377  * @bus_type: A #GBusType.
12378  * @cancellable: (allow-none): A #GCancellable or %NULL.
12379  * @error: Return location for error or %NULL.
12380  *
12381  * Synchronously looks up the D-Bus address for the well-known message
12382  * bus instance specified by @bus_type. This may involve using various
12383  * platform specific mechanisms.
12384  *
12385  * Returns: A valid D-Bus address string for @bus_type or %NULL if @error is set.
12386  * Since: 2.26
12387  */
12388
12389
12390 /**
12391  * g_dbus_address_get_stream:
12392  * @address: A valid D-Bus address.
12393  * @cancellable: (allow-none): A #GCancellable or %NULL.
12394  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12395  * @user_data: Data to pass to @callback.
12396  *
12397  * Asynchronously connects to an endpoint specified by @address and
12398  * sets up the connection so it is in a state to run the client-side
12399  * of the D-Bus authentication conversation.
12400  *
12401  * When the operation is finished, @callback will be invoked. You can
12402  * then call g_dbus_address_get_stream_finish() to get the result of
12403  * the operation.
12404  *
12405  * This is an asynchronous failable function. See
12406  * g_dbus_address_get_stream_sync() for the synchronous version.
12407  *
12408  * Since: 2.26
12409  */
12410
12411
12412 /**
12413  * g_dbus_address_get_stream_finish:
12414  * @res: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
12415  * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12416  * @error: Return location for error or %NULL.
12417  *
12418  * Finishes an operation started with g_dbus_address_get_stream().
12419  *
12420  * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12421  * Since: 2.26
12422  */
12423
12424
12425 /**
12426  * g_dbus_address_get_stream_sync:
12427  * @address: A valid D-Bus address.
12428  * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
12429  * @cancellable: (allow-none): A #GCancellable or %NULL.
12430  * @error: Return location for error or %NULL.
12431  *
12432  * Synchronously connects to an endpoint specified by @address and
12433  * sets up the connection so it is in a state to run the client-side
12434  * of the D-Bus authentication conversation.
12435  *
12436  * This is a synchronous failable function. See
12437  * g_dbus_address_get_stream() for the asynchronous version.
12438  *
12439  * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
12440  * Since: 2.26
12441  */
12442
12443
12444 /**
12445  * g_dbus_annotation_info_lookup:
12446  * @annotations: (array zero-terminated=1) (allow-none): A %NULL-terminated array of annotations or %NULL.
12447  * @name: The name of the annotation to look up.
12448  *
12449  * Looks up the value of an annotation.
12450  *
12451  * This cost of this function is O(n) in number of annotations.
12452  *
12453  * Returns: The value or %NULL if not found. Do not free, it is owned by @annotations.
12454  * Since: 2.26
12455  */
12456
12457
12458 /**
12459  * g_dbus_annotation_info_ref:
12460  * @info: A #GDBusNodeInfo
12461  *
12462  * If @info is statically allocated does nothing. Otherwise increases
12463  * the reference count.
12464  *
12465  * Returns: The same @info.
12466  * Since: 2.26
12467  */
12468
12469
12470 /**
12471  * g_dbus_annotation_info_unref:
12472  * @info: A #GDBusAnnotationInfo.
12473  *
12474  * If @info is statically allocated, does nothing. Otherwise decreases
12475  * the reference count of @info. When its reference count drops to 0,
12476  * the memory used is freed.
12477  *
12478  * Since: 2.26
12479  */
12480
12481
12482 /**
12483  * g_dbus_arg_info_ref:
12484  * @info: A #GDBusArgInfo
12485  *
12486  * If @info is statically allocated does nothing. Otherwise increases
12487  * the reference count.
12488  *
12489  * Returns: The same @info.
12490  * Since: 2.26
12491  */
12492
12493
12494 /**
12495  * g_dbus_arg_info_unref:
12496  * @info: A #GDBusArgInfo.
12497  *
12498  * If @info is statically allocated, does nothing. Otherwise decreases
12499  * the reference count of @info. When its reference count drops to 0,
12500  * the memory used is freed.
12501  *
12502  * Since: 2.26
12503  */
12504
12505
12506 /**
12507  * g_dbus_auth_observer_allow_mechanism:
12508  * @observer: A #GDBusAuthObserver.
12509  * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
12510  *
12511  * Emits the #GDBusAuthObserver::allow-mechanism signal on @observer.
12512  *
12513  * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
12514  * Since: 2.34
12515  */
12516
12517
12518 /**
12519  * g_dbus_auth_observer_authorize_authenticated_peer:
12520  * @observer: A #GDBusAuthObserver.
12521  * @stream: A #GIOStream for the #GDBusConnection.
12522  * @credentials: (allow-none): Credentials received from the peer or %NULL.
12523  *
12524  * Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
12525  *
12526  * Returns: %TRUE if the peer is authorized, %FALSE if not.
12527  * Since: 2.26
12528  */
12529
12530
12531 /**
12532  * g_dbus_auth_observer_new:
12533  *
12534  * Creates a new #GDBusAuthObserver object.
12535  *
12536  * Returns: A #GDBusAuthObserver. Free with g_object_unref().
12537  * Since: 2.26
12538  */
12539
12540
12541 /**
12542  * g_dbus_connection_add_filter:
12543  * @connection: A #GDBusConnection.
12544  * @filter_function: A filter function.
12545  * @user_data: User data to pass to @filter_function.
12546  * @user_data_free_func: Function to free @user_data with when filter is removed or %NULL.
12547  *
12548  * Adds a message filter. Filters are handlers that are run on all
12549  * incoming and outgoing messages, prior to standard dispatch. Filters
12550  * are run in the order that they were added.  The same handler can be
12551  * added as a filter more than once, in which case it will be run more
12552  * than once.  Filters added during a filter callback won't be run on
12553  * the message being processed. Filter functions are allowed to modify
12554  * and even drop messages.
12555  *
12556  * Note that filters are run in a dedicated message handling thread so
12557  * they can't block and, generally, can't do anything but signal a
12558  * worker thread. Also note that filters are rarely needed - use API
12559  * such as g_dbus_connection_send_message_with_reply(),
12560  * g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
12561  *
12562  * If a filter consumes an incoming message the message is not
12563  * dispatched anywhere else - not even the standard dispatch machinery
12564  * (that API such as g_dbus_connection_signal_subscribe() and
12565  * g_dbus_connection_send_message_with_reply() relies on) will see the
12566  * message. Similary, if a filter consumes an outgoing message, the
12567  * message will not be sent to the other peer.
12568  *
12569  * Returns: A filter identifier that can be used with g_dbus_connection_remove_filter().
12570  * Since: 2.26
12571  */
12572
12573
12574 /**
12575  * g_dbus_connection_call:
12576  * @connection: A #GDBusConnection.
12577  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12578  * @object_path: Path of remote object.
12579  * @interface_name: D-Bus interface to invoke method on.
12580  * @method_name: The name of the method to invoke.
12581  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12582  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12583  * @flags: Flags from the #GDBusCallFlags enumeration.
12584  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12585  * @cancellable: (allow-none): A #GCancellable or %NULL.
12586  * @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.
12587  * @user_data: The data to pass to @callback.
12588  *
12589  * Asynchronously invokes the @method_name method on the
12590  * @interface_name D-Bus interface on the remote object at
12591  * @object_path owned by @bus_name.
12592  *
12593  * If @connection is closed then the operation will fail with
12594  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
12595  * fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
12596  * not compatible with the D-Bus protocol, the operation fails with
12597  * %G_IO_ERROR_INVALID_ARGUMENT.
12598  *
12599  * If @reply_type is non-%NULL then the reply will be checked for having this type and an
12600  * error will be raised if it does not match.  Said another way, if you give a @reply_type
12601  * then any non-%NULL return value will be of this type.
12602  *
12603  * If the @parameters #GVariant is floating, it is consumed. This allows
12604  * convenient 'inline' use of g_variant_new(), e.g.:
12605  * |[
12606  *  g_dbus_connection_call (connection,
12607  *                          "org.freedesktop.StringThings",
12608  *                          "/org/freedesktop/StringThings",
12609  *                          "org.freedesktop.StringThings",
12610  *                          "TwoStrings",
12611  *                          g_variant_new ("(ss)",
12612  *                                         "Thing One",
12613  *                                         "Thing Two"),
12614  *                          NULL,
12615  *                          G_DBUS_CALL_FLAGS_NONE,
12616  *                          -1,
12617  *                          NULL,
12618  *                          (GAsyncReadyCallback) two_strings_done,
12619  *                          NULL);
12620  * ]|
12621  *
12622  * This is an asynchronous method. When the operation is finished, @callback will be invoked
12623  * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
12624  * of the thread you are calling this method from. You can then call
12625  * g_dbus_connection_call_finish() to get the result of the operation.
12626  * See g_dbus_connection_call_sync() for the synchronous version of this
12627  * function.
12628  *
12629  * If @callback is %NULL then the D-Bus method call message will be sent with
12630  * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
12631  *
12632  * Since: 2.26
12633  */
12634
12635
12636 /**
12637  * g_dbus_connection_call_finish:
12638  * @connection: A #GDBusConnection.
12639  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
12640  * @error: Return location for error or %NULL.
12641  *
12642  * Finishes an operation started with g_dbus_connection_call().
12643  *
12644  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12645  * Since: 2.26
12646  */
12647
12648
12649 /**
12650  * g_dbus_connection_call_sync:
12651  * @connection: A #GDBusConnection.
12652  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12653  * @object_path: Path of remote object.
12654  * @interface_name: D-Bus interface to invoke method on.
12655  * @method_name: The name of the method to invoke.
12656  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12657  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12658  * @flags: Flags from the #GDBusCallFlags enumeration.
12659  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12660  * @cancellable: (allow-none): A #GCancellable or %NULL.
12661  * @error: Return location for error or %NULL.
12662  *
12663  * Synchronously invokes the @method_name method on the
12664  * @interface_name D-Bus interface on the remote object at
12665  * @object_path owned by @bus_name.
12666  *
12667  * If @connection is closed then the operation will fail with
12668  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
12669  * operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
12670  * contains a value not compatible with the D-Bus protocol, the operation
12671  * fails with %G_IO_ERROR_INVALID_ARGUMENT.
12672  *
12673  * If @reply_type is non-%NULL then the reply will be checked for having
12674  * this type and an error will be raised if it does not match.  Said
12675  * another way, if you give a @reply_type then any non-%NULL return
12676  * value will be of this type.
12677  *
12678  * If the @parameters #GVariant is floating, it is consumed.
12679  * This allows convenient 'inline' use of g_variant_new(), e.g.:
12680  * |[
12681  *  g_dbus_connection_call_sync (connection,
12682  *                               "org.freedesktop.StringThings",
12683  *                               "/org/freedesktop/StringThings",
12684  *                               "org.freedesktop.StringThings",
12685  *                               "TwoStrings",
12686  *                               g_variant_new ("(ss)",
12687  *                                              "Thing One",
12688  *                                              "Thing Two"),
12689  *                               NULL,
12690  *                               G_DBUS_CALL_FLAGS_NONE,
12691  *                               -1,
12692  *                               NULL,
12693  *                               &amp;error);
12694  * ]|
12695  *
12696  * The calling thread is blocked until a reply is received. See
12697  * g_dbus_connection_call() for the asynchronous version of
12698  * this method.
12699  *
12700  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12701  * Since: 2.26
12702  */
12703
12704
12705 /**
12706  * g_dbus_connection_call_with_unix_fd_list:
12707  * @connection: A #GDBusConnection.
12708  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12709  * @object_path: Path of remote object.
12710  * @interface_name: D-Bus interface to invoke method on.
12711  * @method_name: The name of the method to invoke.
12712  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12713  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12714  * @flags: Flags from the #GDBusCallFlags enumeration.
12715  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12716  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12717  * @cancellable: (allow-none): A #GCancellable or %NULL.
12718  * @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.
12719  * @user_data: The data to pass to @callback.
12720  *
12721  * Like g_dbus_connection_call() but also takes a #GUnixFDList object.
12722  *
12723  * This method is only available on UNIX.
12724  *
12725  * Since: 2.30
12726  */
12727
12728
12729 /**
12730  * g_dbus_connection_call_with_unix_fd_list_finish:
12731  * @connection: A #GDBusConnection.
12732  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12733  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
12734  * @error: Return location for error or %NULL.
12735  *
12736  * Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
12737  *
12738  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12739  * Since: 2.30
12740  */
12741
12742
12743 /**
12744  * g_dbus_connection_call_with_unix_fd_list_sync:
12745  * @connection: A #GDBusConnection.
12746  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12747  * @object_path: Path of remote object.
12748  * @interface_name: D-Bus interface to invoke method on.
12749  * @method_name: The name of the method to invoke.
12750  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12751  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12752  * @flags: Flags from the #GDBusCallFlags enumeration.
12753  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12754  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12755  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12756  * @cancellable: (allow-none): A #GCancellable or %NULL.
12757  * @error: Return location for error or %NULL.
12758  *
12759  * Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
12760  *
12761  * This method is only available on UNIX.
12762  *
12763  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12764  * Since: 2.30
12765  */
12766
12767
12768 /**
12769  * g_dbus_connection_close:
12770  * @connection: A #GDBusConnection.
12771  * @cancellable: (allow-none): A #GCancellable or %NULL.
12772  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12773  * @user_data: The data to pass to @callback.
12774  *
12775  * Closes @connection. Note that this never causes the process to
12776  * exit (this might only happen if the other end of a shared message
12777  * bus connection disconnects, see #GDBusConnection:exit-on-close).
12778  *
12779  * Once the connection is closed, operations such as sending a message
12780  * will return with the error %G_IO_ERROR_CLOSED. Closing a connection
12781  * will not automatically flush the connection so queued messages may
12782  * be lost. Use g_dbus_connection_flush() if you need such guarantees.
12783  *
12784  * If @connection is already closed, this method fails with
12785  * %G_IO_ERROR_CLOSED.
12786  *
12787  * When @connection has been closed, the #GDBusConnection::closed
12788  * signal is emitted in the <link
12789  * linkend="g-main-context-push-thread-default">thread-default main
12790  * loop</link> of the thread that @connection was constructed in.
12791  *
12792  * This is an asynchronous method. When the operation is finished,
12793  * @callback will be invoked in the <link
12794  * linkend="g-main-context-push-thread-default">thread-default main
12795  * loop</link> of the thread you are calling this method from. You can
12796  * then call g_dbus_connection_close_finish() to get the result of the
12797  * operation.  See g_dbus_connection_close_sync() for the synchronous
12798  * version.
12799  *
12800  * Since: 2.26
12801  */
12802
12803
12804 /**
12805  * g_dbus_connection_close_finish:
12806  * @connection: A #GDBusConnection.
12807  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
12808  * @error: Return location for error or %NULL.
12809  *
12810  * Finishes an operation started with g_dbus_connection_close().
12811  *
12812  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12813  * Since: 2.26
12814  */
12815
12816
12817 /**
12818  * g_dbus_connection_close_sync:
12819  * @connection: A #GDBusConnection.
12820  * @cancellable: (allow-none): A #GCancellable or %NULL.
12821  * @error: Return location for error or %NULL.
12822  *
12823  * Synchronously closees @connection. The calling thread is blocked
12824  * until this is done. See g_dbus_connection_close() for the
12825  * asynchronous version of this method and more details about what it
12826  * does.
12827  *
12828  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12829  * Since: 2.26
12830  */
12831
12832
12833 /**
12834  * g_dbus_connection_emit_signal:
12835  * @connection: A #GDBusConnection.
12836  * @destination_bus_name: (allow-none): The unique bus name for the destination for the signal or %NULL to emit to all listeners.
12837  * @object_path: Path of remote object.
12838  * @interface_name: D-Bus interface to emit a signal on.
12839  * @signal_name: The name of the signal to emit.
12840  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
12841  * @error: Return location for error or %NULL.
12842  *
12843  * Emits a signal.
12844  *
12845  * If the parameters GVariant is floating, it is consumed.
12846  *
12847  * This can only fail if @parameters is not compatible with the D-Bus protocol.
12848  *
12849  * Returns: %TRUE unless @error is set.
12850  * Since: 2.26
12851  */
12852
12853
12854 /**
12855  * g_dbus_connection_export_action_group:
12856  * @connection: a #GDBusConnection
12857  * @object_path: a D-Bus object path
12858  * @action_group: a #GActionGroup
12859  * @error: a pointer to a %NULL #GError, or %NULL
12860  *
12861  * Exports @action_group on @connection at @object_path.
12862  *
12863  * The implemented D-Bus API should be considered private.  It is
12864  * subject to change in the future.
12865  *
12866  * A given object path can only have one action group exported on it.
12867  * If this constraint is violated, the export will fail and 0 will be
12868  * returned (with @error set accordingly).
12869  *
12870  * You can unexport the action group using
12871  * g_dbus_connection_unexport_action_group() with the return value of
12872  * this function.
12873  *
12874  * The thread default main context is taken at the time of this call.
12875  * All incoming action activations and state change requests are
12876  * reported from this context.  Any changes on the action group that
12877  * cause it to emit signals must also come from this same context.
12878  * Since incoming action activations and state change requests are
12879  * rather likely to cause changes on the action group, this effectively
12880  * limits a given action group to being exported from only one main
12881  * context.
12882  *
12883  * Returns: the ID of the export (never zero), or 0 in case of failure
12884  * Since: 2.32
12885  */
12886
12887
12888 /**
12889  * g_dbus_connection_export_menu_model:
12890  * @connection: a #GDBusConnection
12891  * @object_path: a D-Bus object path
12892  * @menu: a #GMenuModel
12893  * @error: return location for an error, or %NULL
12894  *
12895  * Exports @menu on @connection at @object_path.
12896  *
12897  * The implemented D-Bus API should be considered private.
12898  * It is subject to change in the future.
12899  *
12900  * An object path can only have one action group exported on it. If this
12901  * constraint is violated, the export will fail and 0 will be
12902  * returned (with @error set accordingly).
12903  *
12904  * You can unexport the menu model using
12905  * g_dbus_connection_unexport_menu_model() with the return value of
12906  * this function.
12907  *
12908  * Returns: the ID of the export (never zero), or 0 in case of failure
12909  * Since: 2.32
12910  */
12911
12912
12913 /**
12914  * g_dbus_connection_flush:
12915  * @connection: A #GDBusConnection.
12916  * @cancellable: (allow-none): A #GCancellable or %NULL.
12917  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12918  * @user_data: The data to pass to @callback.
12919  *
12920  * Asynchronously flushes @connection, that is, writes all queued
12921  * outgoing message to the transport and then flushes the transport
12922  * (using g_output_stream_flush_async()). This is useful in programs
12923  * that wants to emit a D-Bus signal and then exit
12924  * immediately. Without flushing the connection, there is no guarantee
12925  * that the message has been sent to the networking buffers in the OS
12926  * kernel.
12927  *
12928  * This is an asynchronous method. When the operation is finished,
12929  * @callback will be invoked in the <link
12930  * linkend="g-main-context-push-thread-default">thread-default main
12931  * loop</link> of the thread you are calling this method from. You can
12932  * then call g_dbus_connection_flush_finish() to get the result of the
12933  * operation.  See g_dbus_connection_flush_sync() for the synchronous
12934  * version.
12935  *
12936  * Since: 2.26
12937  */
12938
12939
12940 /**
12941  * g_dbus_connection_flush_finish:
12942  * @connection: A #GDBusConnection.
12943  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
12944  * @error: Return location for error or %NULL.
12945  *
12946  * Finishes an operation started with g_dbus_connection_flush().
12947  *
12948  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12949  * Since: 2.26
12950  */
12951
12952
12953 /**
12954  * g_dbus_connection_flush_sync:
12955  * @connection: A #GDBusConnection.
12956  * @cancellable: (allow-none): A #GCancellable or %NULL.
12957  * @error: Return location for error or %NULL.
12958  *
12959  * Synchronously flushes @connection. The calling thread is blocked
12960  * until this is done. See g_dbus_connection_flush() for the
12961  * asynchronous version of this method and more details about what it
12962  * does.
12963  *
12964  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12965  * Since: 2.26
12966  */
12967
12968
12969 /**
12970  * g_dbus_connection_get_capabilities:
12971  * @connection: A #GDBusConnection.
12972  *
12973  * Gets the capabilities negotiated with the remote peer
12974  *
12975  * Returns: Zero or more flags from the #GDBusCapabilityFlags enumeration.
12976  * Since: 2.26
12977  */
12978
12979
12980 /**
12981  * g_dbus_connection_get_exit_on_close:
12982  * @connection: A #GDBusConnection.
12983  *
12984  * Gets whether the process is terminated when @connection is
12985  * closed by the remote peer. See
12986  * #GDBusConnection:exit-on-close for more details.
12987  *
12988  * Returns: Whether the process is terminated when @connection is closed by the remote peer.
12989  * Since: 2.26
12990  */
12991
12992
12993 /**
12994  * g_dbus_connection_get_guid:
12995  * @connection: A #GDBusConnection.
12996  *
12997  * The GUID of the peer performing the role of server when
12998  * authenticating. See #GDBusConnection:guid for more details.
12999  *
13000  * Returns: The GUID. Do not free this string, it is owned by @connection.
13001  * Since: 2.26
13002  */
13003
13004
13005 /**
13006  * g_dbus_connection_get_last_serial:
13007  * @connection: A #GDBusConnection.
13008  *
13009  * Retrieves the last serial number assigned to a #GDBusMessage on
13010  * the current thread. This includes messages sent via both low-level
13011  * API such as g_dbus_connection_send_message() as well as
13012  * high-level API such as g_dbus_connection_emit_signal(),
13013  * g_dbus_connection_call() or g_dbus_proxy_call().
13014  *
13015  * Returns: the last used serial or zero when no message has been sent within the current thread.
13016  * Since: 2.34
13017  */
13018
13019
13020 /**
13021  * g_dbus_connection_get_peer_credentials:
13022  * @connection: A #GDBusConnection.
13023  *
13024  * Gets the credentials of the authenticated peer. This will always
13025  * return %NULL unless @connection acted as a server
13026  * (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
13027  * when set up and the client passed credentials as part of the
13028  * authentication process.
13029  *
13030  * In a message bus setup, the message bus is always the server and
13031  * each application is a client. So this method will always return
13032  * %NULL for message bus clients.
13033  *
13034  * Returns: (transfer none): A #GCredentials or %NULL if not available. Do not free this object, it is owned by @connection.
13035  * Since: 2.26
13036  */
13037
13038
13039 /**
13040  * g_dbus_connection_get_stream:
13041  * @connection: a #GDBusConnection
13042  *
13043  * Gets the underlying stream used for IO.
13044  *
13045  * While the #GDBusConnection is active, it will interact with this
13046  * stream from a worker thread, so it is not safe to interact with
13047  * the stream directly.
13048  *
13049  * Returns: (transfer none): the stream used for IO
13050  * Since: 2.26
13051  */
13052
13053
13054 /**
13055  * g_dbus_connection_get_unique_name:
13056  * @connection: A #GDBusConnection.
13057  *
13058  * Gets the unique name of @connection as assigned by the message
13059  * bus. This can also be used to figure out if @connection is a
13060  * message bus connection.
13061  *
13062  * Returns: The unique name or %NULL if @connection is not a message bus connection. Do not free this string, it is owned by @connection.
13063  * Since: 2.26
13064  */
13065
13066
13067 /**
13068  * g_dbus_connection_is_closed:
13069  * @connection: A #GDBusConnection.
13070  *
13071  * Gets whether @connection is closed.
13072  *
13073  * Returns: %TRUE if the connection is closed, %FALSE otherwise.
13074  * Since: 2.26
13075  */
13076
13077
13078 /**
13079  * g_dbus_connection_new:
13080  * @stream: A #GIOStream.
13081  * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
13082  * @flags: Flags describing how to make the connection.
13083  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13084  * @cancellable: (allow-none): A #GCancellable or %NULL.
13085  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13086  * @user_data: The data to pass to @callback.
13087  *
13088  * Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
13089  * with the end represented by @stream.
13090  *
13091  * If @stream is a #GSocketConnection, then the corresponding #GSocket
13092  * will be put into non-blocking mode.
13093  *
13094  * The D-Bus connection will interact with @stream from a worker thread.
13095  * As a result, the caller should not interact with @stream after this
13096  * method has been called, except by calling g_object_unref() on it.
13097  *
13098  * If @observer is not %NULL it may be used to control the
13099  * authentication process.
13100  *
13101  * When the operation is finished, @callback will be invoked. You can
13102  * then call g_dbus_connection_new_finish() to get the result of the
13103  * operation.
13104  *
13105  * This is a asynchronous failable constructor. See
13106  * g_dbus_connection_new_sync() for the synchronous
13107  * version.
13108  *
13109  * Since: 2.26
13110  */
13111
13112
13113 /**
13114  * g_dbus_connection_new_finish:
13115  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13116  * @error: Return location for error or %NULL.
13117  *
13118  * Finishes an operation started with g_dbus_connection_new().
13119  *
13120  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13121  * Since: 2.26
13122  */
13123
13124
13125 /**
13126  * g_dbus_connection_new_for_address:
13127  * @address: A D-Bus address.
13128  * @flags: Flags describing how to make the connection.
13129  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13130  * @cancellable: (allow-none): A #GCancellable or %NULL.
13131  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13132  * @user_data: The data to pass to @callback.
13133  *
13134  * Asynchronously connects and sets up a D-Bus client connection for
13135  * exchanging D-Bus messages with an endpoint specified by @address
13136  * which must be in the D-Bus address format.
13137  *
13138  * This constructor can only be used to initiate client-side
13139  * connections - use g_dbus_connection_new() if you need to act as the
13140  * server. In particular, @flags cannot contain the
13141  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13142  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13143  *
13144  * When the operation is finished, @callback will be invoked. You can
13145  * then call g_dbus_connection_new_finish() to get the result of the
13146  * operation.
13147  *
13148  * If @observer is not %NULL it may be used to control the
13149  * authentication process.
13150  *
13151  * This is a asynchronous failable constructor. See
13152  * g_dbus_connection_new_for_address_sync() for the synchronous
13153  * version.
13154  *
13155  * Since: 2.26
13156  */
13157
13158
13159 /**
13160  * g_dbus_connection_new_for_address_finish:
13161  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
13162  * @error: Return location for error or %NULL.
13163  *
13164  * Finishes an operation started with g_dbus_connection_new_for_address().
13165  *
13166  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13167  * Since: 2.26
13168  */
13169
13170
13171 /**
13172  * g_dbus_connection_new_for_address_sync:
13173  * @address: A D-Bus address.
13174  * @flags: Flags describing how to make the connection.
13175  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13176  * @cancellable: (allow-none): A #GCancellable or %NULL.
13177  * @error: Return location for error or %NULL.
13178  *
13179  * Synchronously connects and sets up a D-Bus client connection for
13180  * exchanging D-Bus messages with an endpoint specified by @address
13181  * which must be in the D-Bus address format.
13182  *
13183  * This constructor can only be used to initiate client-side
13184  * connections - use g_dbus_connection_new_sync() if you need to act
13185  * as the server. In particular, @flags cannot contain the
13186  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
13187  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
13188  *
13189  * This is a synchronous failable constructor. See
13190  * g_dbus_connection_new_for_address() for the asynchronous version.
13191  *
13192  * If @observer is not %NULL it may be used to control the
13193  * authentication process.
13194  *
13195  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13196  * Since: 2.26
13197  */
13198
13199
13200 /**
13201  * g_dbus_connection_new_sync:
13202  * @stream: A #GIOStream.
13203  * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
13204  * @flags: Flags describing how to make the connection.
13205  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
13206  * @cancellable: (allow-none): A #GCancellable or %NULL.
13207  * @error: Return location for error or %NULL.
13208  *
13209  * Synchronously sets up a D-Bus connection for exchanging D-Bus messages
13210  * with the end represented by @stream.
13211  *
13212  * If @stream is a #GSocketConnection, then the corresponding #GSocket
13213  * will be put into non-blocking mode.
13214  *
13215  * The D-Bus connection will interact with @stream from a worker thread.
13216  * As a result, the caller should not interact with @stream after this
13217  * method has been called, except by calling g_object_unref() on it.
13218  *
13219  * If @observer is not %NULL it may be used to control the
13220  * authentication process.
13221  *
13222  * This is a synchronous failable constructor. See
13223  * g_dbus_connection_new() for the asynchronous version.
13224  *
13225  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
13226  * Since: 2.26
13227  */
13228
13229
13230 /**
13231  * g_dbus_connection_register_object:
13232  * @connection: A #GDBusConnection.
13233  * @object_path: The object path to register at.
13234  * @interface_info: Introspection data for the interface.
13235  * @vtable: (allow-none): A #GDBusInterfaceVTable to call into or %NULL.
13236  * @user_data: (allow-none): Data to pass to functions in @vtable.
13237  * @user_data_free_func: Function to call when the object path is unregistered.
13238  * @error: Return location for error or %NULL.
13239  *
13240  * Registers callbacks for exported objects at @object_path with the
13241  * D-Bus interface that is described in @interface_info.
13242  *
13243  * Calls to functions in @vtable (and @user_data_free_func) will
13244  * happen in the <link linkend="g-main-context-push-thread-default">thread-default main
13245  * loop</link> of the thread you are calling this method from.
13246  *
13247  * Note that all #GVariant values passed to functions in @vtable will match
13248  * the signature given in @interface_info - if a remote caller passes
13249  * incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
13250  * is returned to the remote caller.
13251  *
13252  * Additionally, if the remote caller attempts to invoke methods or
13253  * access properties not mentioned in @interface_info the
13254  * <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
13255  * <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
13256  * are returned to the caller.
13257  *
13258  * It is considered a programming error if the
13259  * #GDBusInterfaceGetPropertyFunc function in @vtable returns a
13260  * #GVariant of incorrect type.
13261  *
13262  * If an existing callback is already registered at @object_path and
13263  * @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
13264  *
13265  * GDBus automatically implements the standard D-Bus interfaces
13266  * org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
13267  * and org.freedesktop.Peer, so you don't have to implement those for
13268  * the objects you export. You <emphasis>can</emphasis> implement
13269  * org.freedesktop.DBus.Properties yourself, e.g. to handle getting
13270  * and setting of properties asynchronously.
13271  *
13272  * Note that the reference count on @interface_info will be
13273  * incremented by 1 (unless allocated statically, e.g. if the
13274  * reference count is -1, see g_dbus_interface_info_ref()) for as long
13275  * as the object is exported. Also note that @vtable will be copied.
13276  *
13277  * See <xref linkend="gdbus-server"/> for an example of how to use this method.
13278  *
13279  * Returns: 0 if @error is set, otherwise a registration id (never 0) that can be used with g_dbus_connection_unregister_object() .
13280  * Since: 2.26
13281  */
13282
13283
13284 /**
13285  * g_dbus_connection_register_subtree:
13286  * @connection: A #GDBusConnection.
13287  * @object_path: The object path to register the subtree at.
13288  * @vtable: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
13289  * @flags: Flags used to fine tune the behavior of the subtree.
13290  * @user_data: Data to pass to functions in @vtable.
13291  * @user_data_free_func: Function to call when the subtree is unregistered.
13292  * @error: Return location for error or %NULL.
13293  *
13294  * Registers a whole subtree of <quote>dynamic</quote> objects.
13295  *
13296  * The @enumerate and @introspection functions in @vtable are used to
13297  * convey, to remote callers, what nodes exist in the subtree rooted
13298  * by @object_path.
13299  *
13300  * When handling remote calls into any node in the subtree, first the
13301  * @enumerate function is used to check if the node exists. If the node exists
13302  * or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
13303  * the @introspection function is used to check if the node supports the
13304  * requested method. If so, the @dispatch function is used to determine
13305  * where to dispatch the call. The collected #GDBusInterfaceVTable and
13306  * #gpointer will be used to call into the interface vtable for processing
13307  * the request.
13308  *
13309  * All calls into user-provided code will be invoked in the <link
13310  * linkend="g-main-context-push-thread-default">thread-default main
13311  * loop</link> of the thread you are calling this method from.
13312  *
13313  * If an existing subtree is already registered at @object_path or
13314  * then @error is set to #G_IO_ERROR_EXISTS.
13315  *
13316  * Note that it is valid to register regular objects (using
13317  * g_dbus_connection_register_object()) in a subtree registered with
13318  * g_dbus_connection_register_subtree() - if so, the subtree handler
13319  * is tried as the last resort. One way to think about a subtree
13320  * handler is to consider it a <quote>fallback handler</quote>
13321  * for object paths not registered via g_dbus_connection_register_object()
13322  * or other bindings.
13323  *
13324  * Note that @vtable will be copied so you cannot change it after
13325  * registration.
13326  *
13327  * See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
13328  *
13329  * Returns: 0 if @error is set, otherwise a subtree registration id (never 0) that can be used with g_dbus_connection_unregister_subtree() .
13330  * Since: 2.26
13331  */
13332
13333
13334 /**
13335  * g_dbus_connection_remove_filter:
13336  * @connection: a #GDBusConnection
13337  * @filter_id: an identifier obtained from g_dbus_connection_add_filter()
13338  *
13339  * Removes a filter.
13340  *
13341  * Since: 2.26
13342  */
13343
13344
13345 /**
13346  * g_dbus_connection_send_message:
13347  * @connection: A #GDBusConnection.
13348  * @message: A #GDBusMessage
13349  * @flags: Flags affecting how the message is sent.
13350  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13351  * @error: Return location for error or %NULL.
13352  *
13353  * Asynchronously sends @message to the peer represented by @connection.
13354  *
13355  * Unless @flags contain the
13356  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13357  * will be assigned by @connection and set on @message via
13358  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13359  * serial number used will be written to this location prior to
13360  * submitting the message to the underlying transport.
13361  *
13362  * If @connection is closed then the operation will fail with
13363  * %G_IO_ERROR_CLOSED. If @message is not well-formed,
13364  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13365  *
13366  * See <xref linkend="gdbus-server"/> and <xref
13367  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13368  * low-level API to send and receive UNIX file descriptors.
13369  *
13370  * Note that @message must be unlocked, unless @flags contain the
13371  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13372  *
13373  * Returns: %TRUE if the message was well-formed and queued for transmission, %FALSE if @error is set.
13374  * Since: 2.26
13375  */
13376
13377
13378 /**
13379  * g_dbus_connection_send_message_with_reply:
13380  * @connection: A #GDBusConnection.
13381  * @message: A #GDBusMessage.
13382  * @flags: Flags affecting how the message is sent.
13383  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13384  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13385  * @cancellable: (allow-none): A #GCancellable or %NULL.
13386  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
13387  * @user_data: The data to pass to @callback.
13388  *
13389  * Asynchronously sends @message to the peer represented by @connection.
13390  *
13391  * Unless @flags contain the
13392  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13393  * will be assigned by @connection and set on @message via
13394  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13395  * serial number used will be written to this location prior to
13396  * submitting the message to the underlying transport.
13397  *
13398  * If @connection is closed then the operation will fail with
13399  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13400  * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13401  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13402  *
13403  * This is an asynchronous method. When the operation is finished, @callback will be invoked
13404  * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
13405  * of the thread you are calling this method from. You can then call
13406  * g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
13407  * See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
13408  *
13409  * Note that @message must be unlocked, unless @flags contain the
13410  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13411  *
13412  * See <xref linkend="gdbus-server"/> and <xref
13413  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13414  * low-level API to send and receive UNIX file descriptors.
13415  *
13416  * Since: 2.26
13417  */
13418
13419
13420 /**
13421  * g_dbus_connection_send_message_with_reply_finish:
13422  * @connection: a #GDBusConnection
13423  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
13424  * @error: Return location for error or %NULL.
13425  *
13426  * Finishes an operation started with g_dbus_connection_send_message_with_reply().
13427  *
13428  * Note that @error is only set if a local in-process error
13429  * occurred. That is to say that the returned #GDBusMessage object may
13430  * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
13431  * g_dbus_message_to_gerror() to transcode this to a #GError.
13432  *
13433  * See <xref linkend="gdbus-server"/> and <xref
13434  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13435  * low-level API to send and receive UNIX file descriptors.
13436  *
13437  * Returns: (transfer full): A locked #GDBusMessage or %NULL if @error is set.
13438  * Since: 2.26
13439  */
13440
13441
13442 /**
13443  * g_dbus_connection_send_message_with_reply_sync:
13444  * @connection: A #GDBusConnection.
13445  * @message: A #GDBusMessage.
13446  * @flags: Flags affecting how the message is sent.
13447  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
13448  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
13449  * @cancellable: (allow-none): A #GCancellable or %NULL.
13450  * @error: Return location for error or %NULL.
13451  *
13452  * Synchronously sends @message to the peer represented by @connection
13453  * and blocks the calling thread until a reply is received or the
13454  * timeout is reached. See g_dbus_connection_send_message_with_reply()
13455  * for the asynchronous version of this method.
13456  *
13457  * Unless @flags contain the
13458  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
13459  * will be assigned by @connection and set on @message via
13460  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
13461  * serial number used will be written to this location prior to
13462  * submitting the message to the underlying transport.
13463  *
13464  * If @connection is closed then the operation will fail with
13465  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
13466  * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
13467  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
13468  *
13469  * Note that @error is only set if a local in-process error
13470  * occurred. That is to say that the returned #GDBusMessage object may
13471  * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
13472  * g_dbus_message_to_gerror() to transcode this to a #GError.
13473  *
13474  * See <xref linkend="gdbus-server"/> and <xref
13475  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13476  * low-level API to send and receive UNIX file descriptors.
13477  *
13478  * Note that @message must be unlocked, unless @flags contain the
13479  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
13480  *
13481  * Returns: (transfer full): A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
13482  * Since: 2.26
13483  */
13484
13485
13486 /**
13487  * g_dbus_connection_set_exit_on_close:
13488  * @connection: A #GDBusConnection.
13489  * @exit_on_close: Whether the process should be terminated when @connection is closed by the remote peer.
13490  *
13491  * Sets whether the process should be terminated when @connection is
13492  * closed by the remote peer. See #GDBusConnection:exit-on-close for
13493  * more details.
13494  *
13495  * Note that this function should be used with care. Most modern UNIX
13496  * desktops tie the notion of a user session the session bus, and expect
13497  * all of a users applications to quit when their bus connection goes away.
13498  * If you are setting @exit_on_close to %FALSE for the shared session
13499  * bus connection, you should make sure that your application exits
13500  * when the user session ends.
13501  *
13502  * Since: 2.26
13503  */
13504
13505
13506 /**
13507  * g_dbus_connection_signal_subscribe:
13508  * @connection: A #GDBusConnection.
13509  * @sender: (allow-none): Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
13510  * @interface_name: (allow-none): D-Bus interface name to match on or %NULL to match on all interfaces.
13511  * @member: (allow-none): D-Bus signal name to match on or %NULL to match on all signals.
13512  * @object_path: (allow-none): Object path to match on or %NULL to match on all object paths.
13513  * @arg0: (allow-none): Contents of first string argument to match on or %NULL to match on all kinds of arguments.
13514  * @flags: Flags describing how to subscribe to the signal (currently unused).
13515  * @callback: Callback to invoke when there is a signal matching the requested data.
13516  * @user_data: User data to pass to @callback.
13517  * @user_data_free_func: (allow-none): Function to free @user_data with when subscription is removed or %NULL.
13518  *
13519  * Subscribes to signals on @connection and invokes @callback with a
13520  * whenever the signal is received. Note that @callback
13521  * will be invoked in the <link
13522  * linkend="g-main-context-push-thread-default">thread-default main
13523  * loop</link> of the thread you are calling this method from.
13524  *
13525  * If @connection is not a message bus connection, @sender must be
13526  * %NULL.
13527  *
13528  * If @sender is a well-known name note that @callback is invoked with
13529  * the unique name for the owner of @sender, not the well-known name
13530  * as one would expect. This is because the message bus rewrites the
13531  * name. As such, to avoid certain race conditions, users should be
13532  * tracking the name owner of the well-known name and use that when
13533  * processing the received signal.
13534  *
13535  * Returns: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
13536  * Since: 2.26
13537  */
13538
13539
13540 /**
13541  * g_dbus_connection_signal_unsubscribe:
13542  * @connection: A #GDBusConnection.
13543  * @subscription_id: A subscription id obtained from g_dbus_connection_signal_subscribe().
13544  *
13545  * Unsubscribes from signals.
13546  *
13547  * Since: 2.26
13548  */
13549
13550
13551 /**
13552  * g_dbus_connection_start_message_processing:
13553  * @connection: A #GDBusConnection.
13554  *
13555  * If @connection was created with
13556  * %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
13557  * starts processing messages. Does nothing on if @connection wasn't
13558  * created with this flag or if the method has already been called.
13559  *
13560  * Since: 2.26
13561  */
13562
13563
13564 /**
13565  * g_dbus_connection_unexport_action_group:
13566  * @connection: a #GDBusConnection
13567  * @export_id: the ID from g_dbus_connection_export_action_group()
13568  *
13569  * Reverses the effect of a previous call to
13570  * g_dbus_connection_export_action_group().
13571  *
13572  * It is an error to call this function with an ID that wasn't returned
13573  * from g_dbus_connection_export_action_group() or to call it with the
13574  * same ID more than once.
13575  *
13576  * Since: 2.32
13577  */
13578
13579
13580 /**
13581  * g_dbus_connection_unexport_menu_model:
13582  * @connection: a #GDBusConnection
13583  * @export_id: the ID from g_dbus_connection_export_menu_model()
13584  *
13585  * Reverses the effect of a previous call to
13586  * g_dbus_connection_export_menu_model().
13587  *
13588  * It is an error to call this function with an ID that wasn't returned
13589  * from g_dbus_connection_export_menu_model() or to call it with the
13590  * same ID more than once.
13591  *
13592  * Since: 2.32
13593  */
13594
13595
13596 /**
13597  * g_dbus_connection_unregister_object:
13598  * @connection: A #GDBusConnection.
13599  * @registration_id: A registration id obtained from g_dbus_connection_register_object().
13600  *
13601  * Unregisters an object.
13602  *
13603  * Returns: %TRUE if the object was unregistered, %FALSE otherwise.
13604  * Since: 2.26
13605  */
13606
13607
13608 /**
13609  * g_dbus_connection_unregister_subtree:
13610  * @connection: A #GDBusConnection.
13611  * @registration_id: A subtree registration id obtained from g_dbus_connection_register_subtree().
13612  *
13613  * Unregisters a subtree.
13614  *
13615  * Returns: %TRUE if the subtree was unregistered, %FALSE otherwise.
13616  * Since: 2.26
13617  */
13618
13619
13620 /**
13621  * g_dbus_error_encode_gerror:
13622  * @error: A #GError.
13623  *
13624  * Creates a D-Bus error name to use for @error. If @error matches
13625  * a registered error (cf. g_dbus_error_register_error()), the corresponding
13626  * D-Bus error name will be returned.
13627  *
13628  * Otherwise the a name of the form
13629  * <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
13630  * will be used. This allows other GDBus applications to map the error
13631  * on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
13632  *
13633  * This function is typically only used in object mappings to put a
13634  * #GError on the wire. Regular applications should not use it.
13635  *
13636  * Returns: A D-Bus error name (never %NULL). Free with g_free().
13637  * Since: 2.26
13638  */
13639
13640
13641 /**
13642  * g_dbus_error_get_remote_error:
13643  * @error: A #GError.
13644  *
13645  * Gets the D-Bus error name used for @error, if any.
13646  *
13647  * This function is guaranteed to return a D-Bus error name for all
13648  * #GError<!-- -->s returned from functions handling remote method
13649  * calls (e.g. g_dbus_connection_call_finish()) unless
13650  * g_dbus_error_strip_remote_error() has been used on @error.
13651  *
13652  * Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
13653  * Since: 2.26
13654  */
13655
13656
13657 /**
13658  * g_dbus_error_is_remote_error:
13659  * @error: A #GError.
13660  *
13661  * Checks if @error represents an error received via D-Bus from a remote peer. If so,
13662  * use g_dbus_error_get_remote_error() to get the name of the error.
13663  *
13664  * Returns: %TRUE if @error represents an error from a remote peer, %FALSE otherwise.
13665  * Since: 2.26
13666  */
13667
13668
13669 /**
13670  * g_dbus_error_new_for_dbus_error:
13671  * @dbus_error_name: D-Bus error name.
13672  * @dbus_error_message: D-Bus error message.
13673  *
13674  * Creates a #GError based on the contents of @dbus_error_name and
13675  * @dbus_error_message.
13676  *
13677  * Errors registered with g_dbus_error_register_error() will be looked
13678  * up using @dbus_error_name and if a match is found, the error domain
13679  * and code is used. Applications can use g_dbus_error_get_remote_error()
13680  * to recover @dbus_error_name.
13681  *
13682  * If a match against a registered error is not found and the D-Bus
13683  * error name is in a form as returned by g_dbus_error_encode_gerror()
13684  * the error domain and code encoded in the name is used to
13685  * create the #GError. Also, @dbus_error_name is added to the error message
13686  * such that it can be recovered with g_dbus_error_get_remote_error().
13687  *
13688  * Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
13689  * in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
13690  * added to the error message such that it can be recovered with
13691  * g_dbus_error_get_remote_error().
13692  *
13693  * In all three cases, @dbus_error_name can always be recovered from the
13694  * returned #GError using the g_dbus_error_get_remote_error() function
13695  * (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
13696  *
13697  * This function is typically only used in object mappings to prepare
13698  * #GError instances for applications. Regular applications should not use
13699  * it.
13700  *
13701  * Returns: An allocated #GError. Free with g_error_free().
13702  * Since: 2.26
13703  */
13704
13705
13706 /**
13707  * g_dbus_error_register_error:
13708  * @error_domain: A #GQuark for a error domain.
13709  * @error_code: An error code.
13710  * @dbus_error_name: A D-Bus error name.
13711  *
13712  * Creates an association to map between @dbus_error_name and
13713  * #GError<!-- -->s specified by @error_domain and @error_code.
13714  *
13715  * This is typically done in the routine that returns the #GQuark for
13716  * an error domain.
13717  *
13718  * Returns: %TRUE if the association was created, %FALSE if it already exists.
13719  * Since: 2.26
13720  */
13721
13722
13723 /**
13724  * g_dbus_error_register_error_domain:
13725  * @error_domain_quark_name: The error domain name.
13726  * @quark_volatile: A pointer where to store the #GQuark.
13727  * @entries: A pointer to @num_entries #GDBusErrorEntry struct items.
13728  * @num_entries: Number of items to register.
13729  *
13730  * Helper function for associating a #GError error domain with D-Bus error names.
13731  *
13732  * Since: 2.26
13733  */
13734
13735
13736 /**
13737  * g_dbus_error_set_dbus_error:
13738  * @error: A pointer to a #GError or %NULL.
13739  * @dbus_error_name: D-Bus error name.
13740  * @dbus_error_message: D-Bus error message.
13741  * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13742  * @...: Arguments for @format.
13743  *
13744  * Does nothing if @error is %NULL. Otherwise sets *@error to
13745  * a new #GError created with g_dbus_error_new_for_dbus_error()
13746  * with @dbus_error_message prepend with @format (unless %NULL).
13747  *
13748  * Since: 2.26
13749  */
13750
13751
13752 /**
13753  * g_dbus_error_set_dbus_error_valist:
13754  * @error: A pointer to a #GError or %NULL.
13755  * @dbus_error_name: D-Bus error name.
13756  * @dbus_error_message: D-Bus error message.
13757  * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13758  * @var_args: Arguments for @format.
13759  *
13760  * Like g_dbus_error_set_dbus_error() but intended for language bindings.
13761  *
13762  * Since: 2.26
13763  */
13764
13765
13766 /**
13767  * g_dbus_error_strip_remote_error:
13768  * @error: A #GError.
13769  *
13770  * Looks for extra information in the error message used to recover
13771  * the D-Bus error name and strips it if found. If stripped, the
13772  * message field in @error will correspond exactly to what was
13773  * received on the wire.
13774  *
13775  * This is typically used when presenting errors to the end user.
13776  *
13777  * Returns: %TRUE if information was stripped, %FALSE otherwise.
13778  * Since: 2.26
13779  */
13780
13781
13782 /**
13783  * g_dbus_error_unregister_error:
13784  * @error_domain: A #GQuark for a error domain.
13785  * @error_code: An error code.
13786  * @dbus_error_name: A D-Bus error name.
13787  *
13788  * Destroys an association previously set up with g_dbus_error_register_error().
13789  *
13790  * Returns: %TRUE if the association was destroyed, %FALSE if it wasn't found.
13791  * Since: 2.26
13792  */
13793
13794
13795 /**
13796  * g_dbus_generate_guid:
13797  *
13798  * Generate a D-Bus GUID that can be used with
13799  * e.g. g_dbus_connection_new().
13800  *
13801  * See the D-Bus specification regarding what strings are valid D-Bus
13802  * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
13803  *
13804  * Returns: A valid D-Bus GUID. Free with g_free().
13805  * Since: 2.26
13806  */
13807
13808
13809 /**
13810  * g_dbus_gvalue_to_gvariant:
13811  * @gvalue: A #GValue to convert to a #GVariant.
13812  * @type: A #GVariantType.
13813  *
13814  * Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
13815  *
13816  * The conversion is using the following rules:
13817  * <table frame='all'>
13818  *   <title>#GValue / #GVariant conversion rules</title>
13819  *   <tgroup cols='2' align='left' colsep='1' rowsep='1'>
13820  *     <thead>
13821  *       <row>
13822  *         <entry>If the #GType for @gvalue is...</entry>
13823  *         <entry>... then @type must be</entry>
13824  *       </row>
13825  *     </thead>
13826  *     <tbody>
13827  *       <row>
13828  *         <entry>#G_TYPE_STRING</entry>
13829  *         <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>
13830  *       </row>
13831  *       <row>
13832  *         <entry>#G_TYPE_STRV</entry>
13833  *         <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>
13834  *       </row>
13835  *       <row>
13836  *         <entry>#G_TYPE_BOOLEAN</entry>
13837  *         <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
13838  *       </row>
13839  *       <row>
13840  *         <entry>#G_TYPE_UCHAR</entry>
13841  *         <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
13842  *       </row>
13843  *       <row>
13844  *         <entry>#G_TYPE_INT</entry>
13845  *         <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
13846  *       </row>
13847  *       <row>
13848  *         <entry>#G_TYPE_UINT</entry>
13849  *         <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
13850  *       </row>
13851  *       <row>
13852  *         <entry>#G_TYPE_INT64</entry>
13853  *         <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
13854  *       </row>
13855  *       <row>
13856  *         <entry>#G_TYPE_UINT64</entry>
13857  *         <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
13858  *       </row>
13859  *       <row>
13860  *         <entry>#G_TYPE_DOUBLE</entry>
13861  *         <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
13862  *       </row>
13863  *       <row>
13864  *         <entry>#G_TYPE_VARIANT</entry>
13865  *         <entry>Any #GVariantType</entry>
13866  *       </row>
13867  *     </tbody>
13868  *   </tgroup>
13869  * </table>
13870  * This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
13871  * is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
13872  * also fail for any #GType (including e.g. #G_TYPE_OBJECT and
13873  * #G_TYPE_BOXED derived-types) not in the table above.
13874  *
13875  * Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
13876  * %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
13877  * %NULL) for @type is returned (e.g. 0 for scalar types, the empty
13878  * string for string types, <literal>'/'</literal> for object path
13879  * types, the empty array for any array type and so on).
13880  *
13881  * See the g_dbus_gvariant_to_gvalue() function for how to convert a
13882  * #GVariant to a #GValue.
13883  *
13884  * Returns: A #GVariant (never floating) of #GVariantType @type holding the data from @gvalue or %NULL in case of failure. Free with g_variant_unref().
13885  * Since: 2.30
13886  */
13887
13888
13889 /**
13890  * g_dbus_gvariant_to_gvalue:
13891  * @value: A #GVariant.
13892  * @out_gvalue: (out): Return location pointing to a zero-filled (uninitialized) #GValue.
13893  *
13894  * Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
13895  *
13896  * The rules specified in the g_dbus_gvalue_to_gvariant() function are
13897  * used - this function is essentially its reverse form.
13898  *
13899  * The conversion never fails - a valid #GValue is always returned in
13900  * @out_gvalue.
13901  *
13902  * Since: 2.30
13903  */
13904
13905
13906 /**
13907  * g_dbus_interface_dup_object:
13908  * @interface_: An exported D-Bus interface.
13909  *
13910  * Gets the #GDBusObject that @interface_ belongs to, if any.
13911  *
13912  * Returns: (transfer full): A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
13913  * Since: 2.32
13914  * Rename to: g_dbus_interface_get_object
13915  */
13916
13917
13918 /**
13919  * g_dbus_interface_get_info:
13920  * @interface_: An exported D-Bus interface.
13921  *
13922  * Gets D-Bus introspection information for the D-Bus interface
13923  * implemented by @interface_.
13924  *
13925  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
13926  * Since: 2.30
13927  */
13928
13929
13930 /**
13931  * g_dbus_interface_get_object: (skip)
13932  * @interface_: An exported D-Bus interface.
13933  *
13934  * Gets the #GDBusObject that @interface_ belongs to, if any.
13935  *
13936  * <warning>It is not safe to use the returned object if @interface_
13937  * or the returned object is being used from other threads. See
13938  * g_dbus_interface_dup_object() for a thread-safe
13939  * alternative.</warning>
13940  *
13941  * Returns: (transfer none): A #GDBusObject or %NULL. The returned reference belongs to @interface_ and should not be freed.
13942  * Since: 2.30
13943  */
13944
13945
13946 /**
13947  * g_dbus_interface_info_cache_build:
13948  * @info: A #GDBusInterfaceInfo.
13949  *
13950  * Builds a lookup-cache to speed up
13951  * g_dbus_interface_info_lookup_method(),
13952  * g_dbus_interface_info_lookup_signal() and
13953  * g_dbus_interface_info_lookup_property().
13954  *
13955  * If this has already been called with @info, the existing cache is
13956  * used and its use count is increased.
13957  *
13958  * Note that @info cannot be modified until
13959  * g_dbus_interface_info_cache_release() is called.
13960  *
13961  * Since: 2.30
13962  */
13963
13964
13965 /**
13966  * g_dbus_interface_info_cache_release:
13967  * @info: A GDBusInterfaceInfo
13968  *
13969  * Decrements the usage count for the cache for @info built by
13970  * g_dbus_interface_info_cache_build() (if any) and frees the
13971  * resources used by the cache if the usage count drops to zero.
13972  *
13973  * Since: 2.30
13974  */
13975
13976
13977 /**
13978  * g_dbus_interface_info_generate_xml:
13979  * @info: A #GDBusNodeInfo
13980  * @indent: Indentation level.
13981  * @string_builder: (out): A #GString to to append XML data to.
13982  *
13983  * Appends an XML representation of @info (and its children) to @string_builder.
13984  *
13985  * This function is typically used for generating introspection XML
13986  * documents at run-time for handling the
13987  * <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
13988  * method.
13989  *
13990  * Since: 2.26
13991  */
13992
13993
13994 /**
13995  * g_dbus_interface_info_lookup_method:
13996  * @info: A #GDBusInterfaceInfo.
13997  * @name: A D-Bus method name (typically in CamelCase)
13998  *
13999  * Looks up information about a method.
14000  *
14001  * This cost of this function is O(n) in number of methods unless
14002  * g_dbus_interface_info_cache_build() has been used on @info.
14003  *
14004  * Returns: (transfer none): A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
14005  * Since: 2.26
14006  */
14007
14008
14009 /**
14010  * g_dbus_interface_info_lookup_property:
14011  * @info: A #GDBusInterfaceInfo.
14012  * @name: A D-Bus property name (typically in CamelCase).
14013  *
14014  * Looks up information about a property.
14015  *
14016  * This cost of this function is O(n) in number of properties unless
14017  * g_dbus_interface_info_cache_build() has been used on @info.
14018  *
14019  * Returns: (transfer none): A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
14020  * Since: 2.26
14021  */
14022
14023
14024 /**
14025  * g_dbus_interface_info_lookup_signal:
14026  * @info: A #GDBusInterfaceInfo.
14027  * @name: A D-Bus signal name (typically in CamelCase)
14028  *
14029  * Looks up information about a signal.
14030  *
14031  * This cost of this function is O(n) in number of signals unless
14032  * g_dbus_interface_info_cache_build() has been used on @info.
14033  *
14034  * Returns: (transfer none): A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
14035  * Since: 2.26
14036  */
14037
14038
14039 /**
14040  * g_dbus_interface_info_ref:
14041  * @info: A #GDBusInterfaceInfo
14042  *
14043  * If @info is statically allocated does nothing. Otherwise increases
14044  * the reference count.
14045  *
14046  * Returns: The same @info.
14047  * Since: 2.26
14048  */
14049
14050
14051 /**
14052  * g_dbus_interface_info_unref:
14053  * @info: A #GDBusInterfaceInfo.
14054  *
14055  * If @info is statically allocated, does nothing. Otherwise decreases
14056  * the reference count of @info. When its reference count drops to 0,
14057  * the memory used is freed.
14058  *
14059  * Since: 2.26
14060  */
14061
14062
14063 /**
14064  * g_dbus_interface_set_object:
14065  * @interface_: An exported D-Bus interface.
14066  * @object: (allow-none): A #GDBusObject or %NULL.
14067  *
14068  * Sets the #GDBusObject for @interface_ to @object.
14069  *
14070  * Note that @interface_ will hold a weak reference to @object.
14071  *
14072  * Since: 2.30
14073  */
14074
14075
14076 /**
14077  * g_dbus_interface_skeleton_export:
14078  * @interface_: The D-Bus interface to export.
14079  * @connection: A #GDBusConnection to export @interface_ on.
14080  * @object_path: The path to export the interface at.
14081  * @error: Return location for error or %NULL.
14082  *
14083  * Exports @interface_ at @object_path on @connection.
14084  *
14085  * This can be called multiple times to export the same @interface_
14086  * onto multiple connections however the @object_path provided must be
14087  * the same for all connections.
14088  *
14089  * Use g_dbus_interface_skeleton_unexport() to unexport the object.
14090  *
14091  * Returns: %TRUE if the interface was exported on @connection, otherwise %FALSE with @error set.
14092  * Since: 2.30
14093  */
14094
14095
14096 /**
14097  * g_dbus_interface_skeleton_flush:
14098  * @interface_: A #GDBusInterfaceSkeleton.
14099  *
14100  * If @interface_ has outstanding changes, request for these changes to be
14101  * emitted immediately.
14102  *
14103  * For example, an exported D-Bus interface may queue up property
14104  * changes and emit the
14105  * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
14106  * signal later (e.g. in an idle handler). This technique is useful
14107  * for collapsing multiple property changes into one.
14108  *
14109  * Since: 2.30
14110  */
14111
14112
14113 /**
14114  * g_dbus_interface_skeleton_get_connection:
14115  * @interface_: A #GDBusInterfaceSkeleton.
14116  *
14117  * Gets the first connection that @interface_ is exported on, if any.
14118  *
14119  * Returns: (transfer none): A #GDBusConnection or %NULL if @interface_ is not exported anywhere. Do not free, the object belongs to @interface_.
14120  * Since: 2.30
14121  */
14122
14123
14124 /**
14125  * g_dbus_interface_skeleton_get_connections:
14126  * @interface_: A #GDBusInterfaceSkeleton.
14127  *
14128  * Gets a list of the connections that @interface_ is exported on.
14129  *
14130  * 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().
14131  * Since: 2.32
14132  */
14133
14134
14135 /**
14136  * g_dbus_interface_skeleton_get_flags:
14137  * @interface_: A #GDBusInterfaceSkeleton.
14138  *
14139  * Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
14140  * of @interface_
14141  *
14142  * Returns: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
14143  * Since: 2.30
14144  */
14145
14146
14147 /**
14148  * g_dbus_interface_skeleton_get_info:
14149  * @interface_: A #GDBusInterfaceSkeleton.
14150  *
14151  * Gets D-Bus introspection information for the D-Bus interface
14152  * implemented by @interface_.
14153  *
14154  * Returns: (transfer none): A #GDBusInterfaceInfo (never %NULL). Do not free.
14155  * Since: 2.30
14156  */
14157
14158
14159 /**
14160  * g_dbus_interface_skeleton_get_object_path:
14161  * @interface_: A #GDBusInterfaceSkeleton.
14162  *
14163  * Gets the object path that @interface_ is exported on, if any.
14164  *
14165  * Returns: A string owned by @interface_ or %NULL if @interface_ is not exported anywhere. Do not free, the string belongs to @interface_.
14166  * Since: 2.30
14167  */
14168
14169
14170 /**
14171  * g_dbus_interface_skeleton_get_properties:
14172  * @interface_: A #GDBusInterfaceSkeleton.
14173  *
14174  * Gets all D-Bus properties for @interface_.
14175  *
14176  * Returns: (transfer full): A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
14177  * Since: 2.30
14178  */
14179
14180
14181 /**
14182  * g_dbus_interface_skeleton_get_vtable: (skip)
14183  * @interface_: A #GDBusInterfaceSkeleton.
14184  *
14185  * Gets the interface vtable for the D-Bus interface implemented by
14186  * @interface_. The returned function pointers should expect @interface_
14187  * itself to be passed as @user_data.
14188  *
14189  * Returns: A #GDBusInterfaceVTable (never %NULL).
14190  * Since: 2.30
14191  */
14192
14193
14194 /**
14195  * g_dbus_interface_skeleton_has_connection:
14196  * @interface_: A #GDBusInterfaceSkeleton.
14197  * @connection: A #GDBusConnection.
14198  *
14199  * Checks if @interface_ is export on @connection.
14200  *
14201  * Returns: %TRUE if @interface_ is exported on @connection, %FALSE otherwise.
14202  * Since: 2.32
14203  */
14204
14205
14206 /**
14207  * g_dbus_interface_skeleton_set_flags:
14208  * @interface_: A #GDBusInterfaceSkeleton.
14209  * @flags: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
14210  *
14211  * Sets flags describing what the behavior of @skeleton should be.
14212  *
14213  * Since: 2.30
14214  */
14215
14216
14217 /**
14218  * g_dbus_interface_skeleton_unexport:
14219  * @interface_: A #GDBusInterfaceSkeleton.
14220  *
14221  * Stops exporting @interface_ on all connections it is exported on.
14222  *
14223  * To unexport @interface_ from only a single connection, use
14224  * g_dbus_interface_skeleton_unexport_from_connection()
14225  *
14226  * Since: 2.30
14227  */
14228
14229
14230 /**
14231  * g_dbus_interface_skeleton_unexport_from_connection:
14232  * @interface_: A #GDBusInterfaceSkeleton.
14233  * @connection: A #GDBusConnection.
14234  *
14235  * Stops exporting @interface_ on @connection.
14236  *
14237  * To stop exporting on all connections the interface is exported on,
14238  * use g_dbus_interface_skeleton_unexport().
14239  *
14240  * Since: 2.32
14241  */
14242
14243
14244 /**
14245  * g_dbus_is_address:
14246  * @string: A string.
14247  *
14248  * Checks if @string is a D-Bus address.
14249  *
14250  * This doesn't check if @string is actually supported by #GDBusServer
14251  * or #GDBusConnection - use g_dbus_is_supported_address() to do more
14252  * checks.
14253  *
14254  * Returns: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
14255  * Since: 2.26
14256  */
14257
14258
14259 /**
14260  * g_dbus_is_guid:
14261  * @string: The string to check.
14262  *
14263  * Checks if @string is a D-Bus GUID.
14264  *
14265  * See the D-Bus specification regarding what strings are valid D-Bus
14266  * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
14267  *
14268  * Returns: %TRUE if @string is a guid, %FALSE otherwise.
14269  * Since: 2.26
14270  */
14271
14272
14273 /**
14274  * g_dbus_is_interface_name:
14275  * @string: The string to check.
14276  *
14277  * Checks if @string is a valid D-Bus interface name.
14278  *
14279  * Returns: %TRUE if valid, %FALSE otherwise.
14280  * Since: 2.26
14281  */
14282
14283
14284 /**
14285  * g_dbus_is_member_name:
14286  * @string: The string to check.
14287  *
14288  * Checks if @string is a valid D-Bus member (e.g. signal or method) name.
14289  *
14290  * Returns: %TRUE if valid, %FALSE otherwise.
14291  * Since: 2.26
14292  */
14293
14294
14295 /**
14296  * g_dbus_is_name:
14297  * @string: The string to check.
14298  *
14299  * Checks if @string is a valid D-Bus bus name (either unique or well-known).
14300  *
14301  * Returns: %TRUE if valid, %FALSE otherwise.
14302  * Since: 2.26
14303  */
14304
14305
14306 /**
14307  * g_dbus_is_supported_address:
14308  * @string: A string.
14309  * @error: Return location for error or %NULL.
14310  *
14311  * Like g_dbus_is_address() but also checks if the library suppors the
14312  * transports in @string and that key/value pairs for each transport
14313  * are valid.
14314  *
14315  * Returns: %TRUE if @string is a valid D-Bus address that is supported by this library, %FALSE if @error is set.
14316  * Since: 2.26
14317  */
14318
14319
14320 /**
14321  * g_dbus_is_unique_name:
14322  * @string: The string to check.
14323  *
14324  * Checks if @string is a valid D-Bus unique bus name.
14325  *
14326  * Returns: %TRUE if valid, %FALSE otherwise.
14327  * Since: 2.26
14328  */
14329
14330
14331 /**
14332  * g_dbus_menu_model_get:
14333  * @connection: a #GDBusConnection
14334  * @bus_name: the bus name which exports the menu model
14335  * @object_path: the object path at which the menu model is exported
14336  *
14337  * Obtains a #GDBusMenuModel for the menu model which is exported
14338  * at the given @bus_name and @object_path.
14339  *
14340  * The thread default main context is taken at the time of this call.
14341  * All signals on the menu model (and any linked models) are reported
14342  * with respect to this context.  All calls on the returned menu model
14343  * (and linked models) must also originate from this same context, with
14344  * the thread default main context unchanged.
14345  *
14346  * Returns: (transfer full): a #GDBusMenuModel object. Free with g_object_unref().
14347  * Since: 2.32
14348  */
14349
14350
14351 /**
14352  * g_dbus_message_bytes_needed:
14353  * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14354  * @blob_len: The length of @blob (must be at least 16).
14355  * @error: Return location for error or %NULL.
14356  *
14357  * Utility function to calculate how many bytes are needed to
14358  * completely deserialize the D-Bus message stored at @blob.
14359  *
14360  * 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).
14361  * Since: 2.26
14362  */
14363
14364
14365 /**
14366  * g_dbus_message_copy:
14367  * @message: A #GDBusMessage.
14368  * @error: Return location for error or %NULL.
14369  *
14370  * Copies @message. The copy is a deep copy and the returned
14371  * #GDBusMessage is completely identical except that it is guaranteed
14372  * to not be locked.
14373  *
14374  * This operation can fail if e.g. @message contains file descriptors
14375  * and the per-process or system-wide open files limit is reached.
14376  *
14377  * Returns: (transfer full): A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14378  * Since: 2.26
14379  */
14380
14381
14382 /**
14383  * g_dbus_message_get_arg0:
14384  * @message: A #GDBusMessage.
14385  *
14386  * Convenience to get the first item in the body of @message.
14387  *
14388  * Returns: The string item or %NULL if the first item in the body of @message is not a string.
14389  * Since: 2.26
14390  */
14391
14392
14393 /**
14394  * g_dbus_message_get_body:
14395  * @message: A #GDBusMessage.
14396  *
14397  * Gets the body of a message.
14398  *
14399  * Returns: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
14400  * Since: 2.26
14401  */
14402
14403
14404 /**
14405  * g_dbus_message_get_byte_order:
14406  * @message: A #GDBusMessage.
14407  *
14408  * Gets the byte order of @message.
14409  *
14410  * Returns: The byte order.
14411  */
14412
14413
14414 /**
14415  * g_dbus_message_get_destination:
14416  * @message: A #GDBusMessage.
14417  *
14418  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14419  *
14420  * Returns: The value.
14421  * Since: 2.26
14422  */
14423
14424
14425 /**
14426  * g_dbus_message_get_error_name:
14427  * @message: A #GDBusMessage.
14428  *
14429  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14430  *
14431  * Returns: The value.
14432  * Since: 2.26
14433  */
14434
14435
14436 /**
14437  * g_dbus_message_get_flags:
14438  * @message: A #GDBusMessage.
14439  *
14440  * Gets the flags for @message.
14441  *
14442  * Returns: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14443  * Since: 2.26
14444  */
14445
14446
14447 /**
14448  * g_dbus_message_get_header:
14449  * @message: A #GDBusMessage.
14450  * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14451  *
14452  * Gets a header field on @message.
14453  *
14454  * Returns: A #GVariant with the value if the header was found, %NULL otherwise. Do not free, it is owned by @message.
14455  * Since: 2.26
14456  */
14457
14458
14459 /**
14460  * g_dbus_message_get_header_fields:
14461  * @message: A #GDBusMessage.
14462  *
14463  * Gets an array of all header fields on @message that are set.
14464  *
14465  * 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().
14466  * Since: 2.26
14467  */
14468
14469
14470 /**
14471  * g_dbus_message_get_interface:
14472  * @message: A #GDBusMessage.
14473  *
14474  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14475  *
14476  * Returns: The value.
14477  * Since: 2.26
14478  */
14479
14480
14481 /**
14482  * g_dbus_message_get_locked:
14483  * @message: A #GDBusMessage.
14484  *
14485  * Checks whether @message is locked. To monitor changes to this
14486  * value, conncet to the #GObject::notify signal to listen for changes
14487  * on the #GDBusMessage:locked property.
14488  *
14489  * Returns: %TRUE if @message is locked, %FALSE otherwise.
14490  * Since: 2.26
14491  */
14492
14493
14494 /**
14495  * g_dbus_message_get_member:
14496  * @message: A #GDBusMessage.
14497  *
14498  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14499  *
14500  * Returns: The value.
14501  * Since: 2.26
14502  */
14503
14504
14505 /**
14506  * g_dbus_message_get_message_type:
14507  * @message: A #GDBusMessage.
14508  *
14509  * Gets the type of @message.
14510  *
14511  * Returns: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14512  * Since: 2.26
14513  */
14514
14515
14516 /**
14517  * g_dbus_message_get_num_unix_fds:
14518  * @message: A #GDBusMessage.
14519  *
14520  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14521  *
14522  * Returns: The value.
14523  * Since: 2.26
14524  */
14525
14526
14527 /**
14528  * g_dbus_message_get_path:
14529  * @message: A #GDBusMessage.
14530  *
14531  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14532  *
14533  * Returns: The value.
14534  * Since: 2.26
14535  */
14536
14537
14538 /**
14539  * g_dbus_message_get_reply_serial:
14540  * @message: A #GDBusMessage.
14541  *
14542  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14543  *
14544  * Returns: The value.
14545  * Since: 2.26
14546  */
14547
14548
14549 /**
14550  * g_dbus_message_get_sender:
14551  * @message: A #GDBusMessage.
14552  *
14553  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14554  *
14555  * Returns: The value.
14556  * Since: 2.26
14557  */
14558
14559
14560 /**
14561  * g_dbus_message_get_serial:
14562  * @message: A #GDBusMessage.
14563  *
14564  * Gets the serial for @message.
14565  *
14566  * Returns: A #guint32.
14567  * Since: 2.26
14568  */
14569
14570
14571 /**
14572  * g_dbus_message_get_signature:
14573  * @message: A #GDBusMessage.
14574  *
14575  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14576  *
14577  * Returns: The value.
14578  * Since: 2.26
14579  */
14580
14581
14582 /**
14583  * g_dbus_message_get_unix_fd_list:
14584  * @message: A #GDBusMessage.
14585  *
14586  * Gets the UNIX file descriptors associated with @message, if any.
14587  *
14588  * This method is only available on UNIX.
14589  *
14590  * Returns: (transfer none): A #GUnixFDList or %NULL if no file descriptors are associated. Do not free, this object is owned by @message.
14591  * Since: 2.26
14592  */
14593
14594
14595 /**
14596  * g_dbus_message_lock:
14597  * @message: A #GDBusMessage.
14598  *
14599  * If @message is locked, does nothing. Otherwise locks the message.
14600  *
14601  * Since: 2.26
14602  */
14603
14604
14605 /**
14606  * g_dbus_message_new:
14607  *
14608  * Creates a new empty #GDBusMessage.
14609  *
14610  * Returns: A #GDBusMessage. Free with g_object_unref().
14611  * Since: 2.26
14612  */
14613
14614
14615 /**
14616  * g_dbus_message_new_from_blob:
14617  * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
14618  * @blob_len: The length of @blob.
14619  * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14620  * @error: Return location for error or %NULL.
14621  *
14622  * Creates a new #GDBusMessage from the data stored at @blob. The byte
14623  * order that the message was in can be retrieved using
14624  * g_dbus_message_get_byte_order().
14625  *
14626  * Returns: A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
14627  * Since: 2.26
14628  */
14629
14630
14631 /**
14632  * g_dbus_message_new_method_call:
14633  * @name: (allow-none): A valid D-Bus name or %NULL.
14634  * @path: A valid object path.
14635  * @interface_: (allow-none): A valid D-Bus interface name or %NULL.
14636  * @method: A valid method name.
14637  *
14638  * Creates a new #GDBusMessage for a method call.
14639  *
14640  * Returns: A #GDBusMessage. Free with g_object_unref().
14641  * Since: 2.26
14642  */
14643
14644
14645 /**
14646  * g_dbus_message_new_method_error:
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_format: The D-Bus error message in a printf() format.
14650  * @...: Arguments for @error_message_format.
14651  *
14652  * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14653  *
14654  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14655  * Since: 2.26
14656  */
14657
14658
14659 /**
14660  * g_dbus_message_new_method_error_literal:
14661  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14662  * @error_name: A valid D-Bus error name.
14663  * @error_message: The D-Bus error message.
14664  *
14665  * Creates a new #GDBusMessage that is an error reply to @method_call_message.
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_error_valist:
14674  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14675  * @error_name: A valid D-Bus error name.
14676  * @error_message_format: The D-Bus error message in a printf() format.
14677  * @var_args: Arguments for @error_message_format.
14678  *
14679  * Like g_dbus_message_new_method_error() but intended for language bindings.
14680  *
14681  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14682  * Since: 2.26
14683  */
14684
14685
14686 /**
14687  * g_dbus_message_new_method_reply:
14688  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14689  *
14690  * Creates a new #GDBusMessage that is a reply to @method_call_message.
14691  *
14692  * Returns: (transfer full): #GDBusMessage. Free with g_object_unref().
14693  * Since: 2.26
14694  */
14695
14696
14697 /**
14698  * g_dbus_message_new_signal:
14699  * @path: A valid object path.
14700  * @interface_: A valid D-Bus interface name.
14701  * @signal: A valid signal name.
14702  *
14703  * Creates a new #GDBusMessage for a signal emission.
14704  *
14705  * Returns: A #GDBusMessage. Free with g_object_unref().
14706  * Since: 2.26
14707  */
14708
14709
14710 /**
14711  * g_dbus_message_print:
14712  * @message: A #GDBusMessage.
14713  * @indent: Indentation level.
14714  *
14715  * Produces a human-readable multi-line description of @message.
14716  *
14717  * The contents of the description has no ABI guarantees, the contents
14718  * and formatting is subject to change at any time. Typical output
14719  * looks something like this:
14720  * <programlisting>
14721  * Type&colon;    method-call
14722  * Flags&colon;   none
14723  * Version&colon; 0
14724  * Serial&colon;  4
14725  * Headers&colon;
14726  *   path -> objectpath '/org/gtk/GDBus/TestObject'
14727  *   interface -> 'org.gtk.GDBus.TestInterface'
14728  *   member -> 'GimmeStdout'
14729  *   destination -> ':1.146'
14730  * Body&colon; ()
14731  * UNIX File Descriptors:
14732  *   (none)
14733  * </programlisting>
14734  * or
14735  * <programlisting>
14736  * Type&colon;    method-return
14737  * Flags&colon;   no-reply-expected
14738  * Version&colon; 0
14739  * Serial&colon;  477
14740  * Headers&colon;
14741  *   reply-serial -> uint32 4
14742  *   destination -> ':1.159'
14743  *   sender -> ':1.146'
14744  *   num-unix-fds -> uint32 1
14745  * Body&colon; ()
14746  * UNIX File Descriptors&colon;
14747  *   fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
14748  * </programlisting>
14749  *
14750  * Returns: A string that should be freed with g_free().
14751  * Since: 2.26
14752  */
14753
14754
14755 /**
14756  * g_dbus_message_set_body:
14757  * @message: A #GDBusMessage.
14758  * @body: Either %NULL or a #GVariant that is a tuple.
14759  *
14760  * Sets the body @message. As a side-effect the
14761  * %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
14762  * type string of @body (or cleared if @body is %NULL).
14763  *
14764  * If @body is floating, @message assumes ownership of @body.
14765  *
14766  * Since: 2.26
14767  */
14768
14769
14770 /**
14771  * g_dbus_message_set_byte_order:
14772  * @message: A #GDBusMessage.
14773  * @byte_order: The byte order.
14774  *
14775  * Sets the byte order of @message.
14776  */
14777
14778
14779 /**
14780  * g_dbus_message_set_destination:
14781  * @message: A #GDBusMessage.
14782  * @value: The value to set.
14783  *
14784  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14785  *
14786  * Since: 2.26
14787  */
14788
14789
14790 /**
14791  * g_dbus_message_set_error_name:
14792  * @message: A #GDBusMessage.
14793  * @value: The value to set.
14794  *
14795  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14796  *
14797  * Since: 2.26
14798  */
14799
14800
14801 /**
14802  * g_dbus_message_set_flags:
14803  * @message: A #GDBusMessage.
14804  * @flags: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14805  *
14806  * Sets the flags to set on @message.
14807  *
14808  * Since: 2.26
14809  */
14810
14811
14812 /**
14813  * g_dbus_message_set_header:
14814  * @message: A #GDBusMessage.
14815  * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14816  * @value: (allow-none): A #GVariant to set the header field or %NULL to clear the header field.
14817  *
14818  * Sets a header field on @message.
14819  *
14820  * If @value is floating, @message assumes ownership of @value.
14821  *
14822  * Since: 2.26
14823  */
14824
14825
14826 /**
14827  * g_dbus_message_set_interface:
14828  * @message: A #GDBusMessage.
14829  * @value: The value to set.
14830  *
14831  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14832  *
14833  * Since: 2.26
14834  */
14835
14836
14837 /**
14838  * g_dbus_message_set_member:
14839  * @message: A #GDBusMessage.
14840  * @value: The value to set.
14841  *
14842  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14843  *
14844  * Since: 2.26
14845  */
14846
14847
14848 /**
14849  * g_dbus_message_set_message_type:
14850  * @message: A #GDBusMessage.
14851  * @type: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14852  *
14853  * Sets @message to be of @type.
14854  *
14855  * Since: 2.26
14856  */
14857
14858
14859 /**
14860  * g_dbus_message_set_num_unix_fds:
14861  * @message: A #GDBusMessage.
14862  * @value: The value to set.
14863  *
14864  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14865  *
14866  * Since: 2.26
14867  */
14868
14869
14870 /**
14871  * g_dbus_message_set_path:
14872  * @message: A #GDBusMessage.
14873  * @value: The value to set.
14874  *
14875  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14876  *
14877  * Since: 2.26
14878  */
14879
14880
14881 /**
14882  * g_dbus_message_set_reply_serial:
14883  * @message: A #GDBusMessage.
14884  * @value: The value to set.
14885  *
14886  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14887  *
14888  * Since: 2.26
14889  */
14890
14891
14892 /**
14893  * g_dbus_message_set_sender:
14894  * @message: A #GDBusMessage.
14895  * @value: The value to set.
14896  *
14897  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14898  *
14899  * Since: 2.26
14900  */
14901
14902
14903 /**
14904  * g_dbus_message_set_serial:
14905  * @message: A #GDBusMessage.
14906  * @serial: A #guint32.
14907  *
14908  * Sets the serial for @message.
14909  *
14910  * Since: 2.26
14911  */
14912
14913
14914 /**
14915  * g_dbus_message_set_signature:
14916  * @message: A #GDBusMessage.
14917  * @value: The value to set.
14918  *
14919  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14920  *
14921  * Since: 2.26
14922  */
14923
14924
14925 /**
14926  * g_dbus_message_set_unix_fd_list:
14927  * @message: A #GDBusMessage.
14928  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
14929  *
14930  * Sets the UNIX file descriptors associated with @message. As a
14931  * side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
14932  * field is set to the number of fds in @fd_list (or cleared if
14933  * @fd_list is %NULL).
14934  *
14935  * This method is only available on UNIX.
14936  *
14937  * Since: 2.26
14938  */
14939
14940
14941 /**
14942  * g_dbus_message_to_blob:
14943  * @message: A #GDBusMessage.
14944  * @out_size: Return location for size of generated blob.
14945  * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14946  * @error: Return location for error.
14947  *
14948  * Serializes @message to a blob. The byte order returned by
14949  * g_dbus_message_get_byte_order() will be used.
14950  *
14951  * 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().
14952  * Since: 2.26
14953  */
14954
14955
14956 /**
14957  * g_dbus_message_to_gerror:
14958  * @message: A #GDBusMessage.
14959  * @error: The #GError to set.
14960  *
14961  * If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
14962  * nothing and returns %FALSE.
14963  *
14964  * Otherwise this method encodes the error in @message as a #GError
14965  * using g_dbus_error_set_dbus_error() using the information in the
14966  * %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
14967  * well as the first string item in @message's body.
14968  *
14969  * Returns: %TRUE if @error was set, %FALSE otherwise.
14970  * Since: 2.26
14971  */
14972
14973
14974 /**
14975  * g_dbus_method_info_ref:
14976  * @info: A #GDBusMethodInfo
14977  *
14978  * If @info is statically allocated does nothing. Otherwise increases
14979  * the reference count.
14980  *
14981  * Returns: The same @info.
14982  * Since: 2.26
14983  */
14984
14985
14986 /**
14987  * g_dbus_method_info_unref:
14988  * @info: A #GDBusMethodInfo.
14989  *
14990  * If @info is statically allocated, does nothing. Otherwise decreases
14991  * the reference count of @info. When its reference count drops to 0,
14992  * the memory used is freed.
14993  *
14994  * Since: 2.26
14995  */
14996
14997
14998 /**
14999  * g_dbus_method_invocation_get_connection:
15000  * @invocation: A #GDBusMethodInvocation.
15001  *
15002  * Gets the #GDBusConnection the method was invoked on.
15003  *
15004  * Returns: (transfer none): A #GDBusConnection. Do not free, it is owned by @invocation.
15005  * Since: 2.26
15006  */
15007
15008
15009 /**
15010  * g_dbus_method_invocation_get_interface_name:
15011  * @invocation: A #GDBusMethodInvocation.
15012  *
15013  * Gets the name of the D-Bus interface the method was invoked on.
15014  *
15015  * Returns: A string. Do not free, it is owned by @invocation.
15016  * Since: 2.26
15017  */
15018
15019
15020 /**
15021  * g_dbus_method_invocation_get_message:
15022  * @invocation: A #GDBusMethodInvocation.
15023  *
15024  * Gets the #GDBusMessage for the method invocation. This is useful if
15025  * you need to use low-level protocol features, such as UNIX file
15026  * descriptor passing, that cannot be properly expressed in the
15027  * #GVariant API.
15028  *
15029  * See <xref linkend="gdbus-server"/> and <xref
15030  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
15031  * low-level API to send and receive UNIX file descriptors.
15032  *
15033  * Returns: (transfer none): #GDBusMessage. Do not free, it is owned by @invocation.
15034  * Since: 2.26
15035  */
15036
15037
15038 /**
15039  * g_dbus_method_invocation_get_method_info:
15040  * @invocation: A #GDBusMethodInvocation.
15041  *
15042  * Gets information about the method call, if any.
15043  *
15044  * Returns: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
15045  * Since: 2.26
15046  */
15047
15048
15049 /**
15050  * g_dbus_method_invocation_get_method_name:
15051  * @invocation: A #GDBusMethodInvocation.
15052  *
15053  * Gets the name of the method that was invoked.
15054  *
15055  * Returns: A string. Do not free, it is owned by @invocation.
15056  * Since: 2.26
15057  */
15058
15059
15060 /**
15061  * g_dbus_method_invocation_get_object_path:
15062  * @invocation: A #GDBusMethodInvocation.
15063  *
15064  * Gets the object path the method was invoked on.
15065  *
15066  * Returns: A string. Do not free, it is owned by @invocation.
15067  * Since: 2.26
15068  */
15069
15070
15071 /**
15072  * g_dbus_method_invocation_get_parameters:
15073  * @invocation: A #GDBusMethodInvocation.
15074  *
15075  * Gets the parameters of the method invocation. If there are no input
15076  * parameters then this will return a GVariant with 0 children rather than NULL.
15077  *
15078  * Returns: (transfer none): A #GVariant tuple. Do not unref this because it is owned by @invocation.
15079  * Since: 2.26
15080  */
15081
15082
15083 /**
15084  * g_dbus_method_invocation_get_sender:
15085  * @invocation: A #GDBusMethodInvocation.
15086  *
15087  * Gets the bus name that invoked the method.
15088  *
15089  * Returns: A string. Do not free, it is owned by @invocation.
15090  * Since: 2.26
15091  */
15092
15093
15094 /**
15095  * g_dbus_method_invocation_get_user_data: (skip)
15096  * @invocation: A #GDBusMethodInvocation.
15097  *
15098  * Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
15099  *
15100  * Returns: A #gpointer.
15101  * Since: 2.26
15102  */
15103
15104
15105 /**
15106  * g_dbus_method_invocation_return_dbus_error:
15107  * @invocation: (transfer full): A #GDBusMethodInvocation.
15108  * @error_name: A valid D-Bus error name.
15109  * @error_message: A valid D-Bus error message.
15110  *
15111  * Finishes handling a D-Bus method call by returning an error.
15112  *
15113  * This method will free @invocation, you cannot use it afterwards.
15114  *
15115  * Since: 2.26
15116  */
15117
15118
15119 /**
15120  * g_dbus_method_invocation_return_error:
15121  * @invocation: (transfer full): A #GDBusMethodInvocation.
15122  * @domain: A #GQuark for the #GError error domain.
15123  * @code: The error code.
15124  * @format: printf()-style format.
15125  * @...: Parameters for @format.
15126  *
15127  * Finishes handling a D-Bus method call by returning an error.
15128  *
15129  * See g_dbus_error_encode_gerror() for details about what error name
15130  * will be returned on the wire. In a nutshell, if the given error is
15131  * registered using g_dbus_error_register_error() the name given
15132  * during registration is used. Otherwise, a name of the form
15133  * <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
15134  * used. This provides transparent mapping of #GError between
15135  * applications using GDBus.
15136  *
15137  * If you are writing an application intended to be portable,
15138  * <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
15139  * or use g_dbus_method_invocation_return_dbus_error().
15140  *
15141  * This method will free @invocation, you cannot use it afterwards.
15142  *
15143  * Since: 2.26
15144  */
15145
15146
15147 /**
15148  * g_dbus_method_invocation_return_error_literal:
15149  * @invocation: (transfer full): A #GDBusMethodInvocation.
15150  * @domain: A #GQuark for the #GError error domain.
15151  * @code: The error code.
15152  * @message: The error message.
15153  *
15154  * Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
15155  *
15156  * This method will free @invocation, you cannot use it afterwards.
15157  *
15158  * Since: 2.26
15159  */
15160
15161
15162 /**
15163  * g_dbus_method_invocation_return_error_valist:
15164  * @invocation: (transfer full): A #GDBusMethodInvocation.
15165  * @domain: A #GQuark for the #GError error domain.
15166  * @code: The error code.
15167  * @format: printf()-style format.
15168  * @var_args: #va_list of parameters for @format.
15169  *
15170  * Like g_dbus_method_invocation_return_error() but intended for
15171  * language bindings.
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_gerror:
15181  * @invocation: (transfer full): A #GDBusMethodInvocation.
15182  * @error: A #GError.
15183  *
15184  * Like g_dbus_method_invocation_return_error() but takes a #GError
15185  * instead of the error domain, error code and message.
15186  *
15187  * This method will free @invocation, you cannot use it afterwards.
15188  *
15189  * Since: 2.26
15190  */
15191
15192
15193 /**
15194  * g_dbus_method_invocation_return_value:
15195  * @invocation: (transfer full): A #GDBusMethodInvocation.
15196  * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15197  *
15198  * Finishes handling a D-Bus method call by returning @parameters.
15199  * If the @parameters GVariant is floating, it is consumed.
15200  *
15201  * It is an error if @parameters is not of the right format.
15202  *
15203  * This method will free @invocation, you cannot use it afterwards.
15204  *
15205  * Since: 2.26
15206  */
15207
15208
15209 /**
15210  * g_dbus_method_invocation_return_value_with_unix_fd_list:
15211  * @invocation: (transfer full): A #GDBusMethodInvocation.
15212  * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
15213  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15214  *
15215  * Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
15216  *
15217  * This method is only available on UNIX.
15218  *
15219  * This method will free @invocation, you cannot use it afterwards.
15220  *
15221  * Since: 2.30
15222  */
15223
15224
15225 /**
15226  * g_dbus_method_invocation_take_error: (skip)
15227  * @invocation: (transfer full): A #GDBusMethodInvocation.
15228  * @error: (transfer full): A #GError.
15229  *
15230  * Like g_dbus_method_invocation_return_gerror() but takes ownership
15231  * of @error so the caller does not need to free it.
15232  *
15233  * This method will free @invocation, you cannot use it afterwards.
15234  *
15235  * Since: 2.30
15236  */
15237
15238
15239 /**
15240  * g_dbus_node_info_generate_xml:
15241  * @info: A #GDBusNodeInfo.
15242  * @indent: Indentation level.
15243  * @string_builder: (out): A #GString to to append XML data to.
15244  *
15245  * Appends an XML representation of @info (and its children) to @string_builder.
15246  *
15247  * This function is typically used for generating introspection XML documents at run-time for
15248  * handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
15249  *
15250  * Since: 2.26
15251  */
15252
15253
15254 /**
15255  * g_dbus_node_info_lookup_interface:
15256  * @info: A #GDBusNodeInfo.
15257  * @name: A D-Bus interface name.
15258  *
15259  * Looks up information about an interface.
15260  *
15261  * This cost of this function is O(n) in number of interfaces.
15262  *
15263  * Returns: (transfer none): A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
15264  * Since: 2.26
15265  */
15266
15267
15268 /**
15269  * g_dbus_node_info_new_for_xml:
15270  * @xml_data: Valid D-Bus introspection XML.
15271  * @error: Return location for error.
15272  *
15273  * Parses @xml_data and returns a #GDBusNodeInfo representing the data.
15274  *
15275  * The introspection XML must contain exactly one top-level
15276  * <tag class="starttag">node</tag> element.
15277  *
15278  * Note that this routine is using a
15279  * <link linkend="glib-Simple-XML-Subset-Parser.description">GMarkup</link>-based
15280  * parser that only accepts a subset of valid XML documents.
15281  *
15282  * Returns: A #GDBusNodeInfo structure or %NULL if @error is set. Free with g_dbus_node_info_unref().
15283  * Since: 2.26
15284  */
15285
15286
15287 /**
15288  * g_dbus_node_info_ref:
15289  * @info: A #GDBusNodeInfo
15290  *
15291  * If @info is statically allocated does nothing. Otherwise increases
15292  * the reference count.
15293  *
15294  * Returns: The same @info.
15295  * Since: 2.26
15296  */
15297
15298
15299 /**
15300  * g_dbus_node_info_unref:
15301  * @info: A #GDBusNodeInfo.
15302  *
15303  * If @info is statically allocated, does nothing. Otherwise decreases
15304  * the reference count of @info. When its reference count drops to 0,
15305  * the memory used is freed.
15306  *
15307  * Since: 2.26
15308  */
15309
15310
15311 /**
15312  * g_dbus_object_get_interface:
15313  * @object: A #GDBusObject.
15314  * @interface_name: A D-Bus interface name.
15315  *
15316  * Gets the D-Bus interface with name @interface_name associated with
15317  * @object, if any.
15318  *
15319  * Returns: (transfer full): %NULL if not found, otherwise a #GDBusInterface that must be freed with g_object_unref().
15320  * Since: 2.30
15321  */
15322
15323
15324 /**
15325  * g_dbus_object_get_interfaces:
15326  * @object: A #GDBusObject.
15327  *
15328  * Gets the D-Bus interfaces associated with @object.
15329  *
15330  * 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().
15331  * Since: 2.30
15332  */
15333
15334
15335 /**
15336  * g_dbus_object_get_object_path:
15337  * @object: A #GDBusObject.
15338  *
15339  * Gets the object path for @object.
15340  *
15341  * Returns: A string owned by @object. Do not free.
15342  * Since: 2.30
15343  */
15344
15345
15346 /**
15347  * g_dbus_object_manager_client_get_connection:
15348  * @manager: A #GDBusObjectManagerClient
15349  *
15350  * Gets the #GDBusConnection used by @manager.
15351  *
15352  * Returns: (transfer none): A #GDBusConnection object. Do not free, the object belongs to @manager.
15353  * Since: 2.30
15354  */
15355
15356
15357 /**
15358  * g_dbus_object_manager_client_get_flags:
15359  * @manager: A #GDBusObjectManagerClient
15360  *
15361  * Gets the flags that @manager was constructed with.
15362  *
15363  * Returns: Zero of more flags from the #GDBusObjectManagerClientFlags enumeration.
15364  * Since: 2.30
15365  */
15366
15367
15368 /**
15369  * g_dbus_object_manager_client_get_name:
15370  * @manager: A #GDBusObjectManagerClient
15371  *
15372  * Gets the name that @manager is for.
15373  *
15374  * Returns: A unique or well-known name. Do not free, the string belongs to @manager.
15375  * Since: 2.30
15376  */
15377
15378
15379 /**
15380  * g_dbus_object_manager_client_get_name_owner:
15381  * @manager: A #GDBusObjectManagerClient.
15382  *
15383  * The unique name that owns the name that @manager is for or %NULL if
15384  * no-one currently owns that name. You can connect to the
15385  * #GObject::notify signal to track changes to the
15386  * #GDBusObjectManagerClient:name-owner property.
15387  *
15388  * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15389  * Since: 2.30
15390  */
15391
15392
15393 /**
15394  * g_dbus_object_manager_client_new:
15395  * @connection: A #GDBusConnection.
15396  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15397  * @name: The owner of the control object (unique or well-known name).
15398  * @object_path: The object path of the control object.
15399  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15400  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15401  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15402  * @cancellable: (allow-none): A #GCancellable or %NULL
15403  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15404  * @user_data: The data to pass to @callback.
15405  *
15406  * Asynchronously creates a new #GDBusObjectManagerClient object.
15407  *
15408  * This is an asynchronous failable constructor. When the result is
15409  * ready, @callback will be invoked in the
15410  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15411  * of the thread you are calling this method from. You can
15412  * then call g_dbus_object_manager_client_new_finish() to get the result. See
15413  * g_dbus_object_manager_client_new_sync() for the synchronous version.
15414  *
15415  * Since: 2.30
15416  */
15417
15418
15419 /**
15420  * g_dbus_object_manager_client_new_finish:
15421  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
15422  * @error: Return location for error or %NULL.
15423  *
15424  * Finishes an operation started with g_dbus_object_manager_client_new().
15425  *
15426  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15427  * Since: 2.30
15428  */
15429
15430
15431 /**
15432  * g_dbus_object_manager_client_new_for_bus:
15433  * @bus_type: A #GBusType.
15434  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15435  * @name: The owner of the control object (unique or well-known name).
15436  * @object_path: The object path of the control object.
15437  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15438  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15439  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15440  * @cancellable: (allow-none): A #GCancellable or %NULL
15441  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
15442  * @user_data: The data to pass to @callback.
15443  *
15444  * Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
15445  * #GDBusConnection.
15446  *
15447  * This is an asynchronous failable constructor. When the result is
15448  * ready, @callback will be invoked in the
15449  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15450  * of the thread you are calling this method from. You can
15451  * then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
15452  * g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
15453  *
15454  * Since: 2.30
15455  */
15456
15457
15458 /**
15459  * g_dbus_object_manager_client_new_for_bus_finish:
15460  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
15461  * @error: Return location for error or %NULL.
15462  *
15463  * Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
15464  *
15465  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15466  * Since: 2.30
15467  */
15468
15469
15470 /**
15471  * g_dbus_object_manager_client_new_for_bus_sync:
15472  * @bus_type: A #GBusType.
15473  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15474  * @name: The owner of the control object (unique or well-known name).
15475  * @object_path: The object path of the control object.
15476  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15477  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15478  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15479  * @cancellable: (allow-none): A #GCancellable or %NULL
15480  * @error: Return location for error or %NULL.
15481  *
15482  * Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
15483  * of a #GDBusConnection.
15484  *
15485  * This is a synchronous failable constructor - the calling thread is
15486  * blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
15487  * for the asynchronous version.
15488  *
15489  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15490  * Since: 2.30
15491  */
15492
15493
15494 /**
15495  * g_dbus_object_manager_client_new_sync:
15496  * @connection: A #GDBusConnection.
15497  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
15498  * @name: The owner of the control object (unique or well-known name).
15499  * @object_path: The object path of the control object.
15500  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
15501  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
15502  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
15503  * @cancellable: (allow-none): A #GCancellable or %NULL
15504  * @error: Return location for error or %NULL.
15505  *
15506  * Creates a new #GDBusObjectManagerClient object.
15507  *
15508  * This is a synchronous failable constructor - the calling thread is
15509  * blocked until a reply is received. See g_dbus_object_manager_client_new()
15510  * for the asynchronous version.
15511  *
15512  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
15513  * Since: 2.30
15514  */
15515
15516
15517 /**
15518  * g_dbus_object_manager_get_interface:
15519  * @manager: A #GDBusObjectManager.
15520  * @object_path: Object path to lookup.
15521  * @interface_name: D-Bus interface name to lookup.
15522  *
15523  * Gets the interface proxy for @interface_name at @object_path, if
15524  * any.
15525  *
15526  * Returns: (transfer full): A #GDBusInterface instance or %NULL. Free with g_object_unref().
15527  * Since: 2.30
15528  */
15529
15530
15531 /**
15532  * g_dbus_object_manager_get_object:
15533  * @manager: A #GDBusObjectManager.
15534  * @object_path: Object path to lookup.
15535  *
15536  * Gets the #GDBusObjectProxy at @object_path, if any.
15537  *
15538  * Returns: (transfer full): A #GDBusObject or %NULL. Free with g_object_unref().
15539  * Since: 2.30
15540  */
15541
15542
15543 /**
15544  * g_dbus_object_manager_get_object_path:
15545  * @manager: A #GDBusObjectManager.
15546  *
15547  * Gets the object path that @manager is for.
15548  *
15549  * Returns: A string owned by @manager. Do not free.
15550  * Since: 2.30
15551  */
15552
15553
15554 /**
15555  * g_dbus_object_manager_get_objects:
15556  * @manager: A #GDBusObjectManager.
15557  *
15558  * Gets all #GDBusObject objects known to @manager.
15559  *
15560  * 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().
15561  * Since: 2.30
15562  */
15563
15564
15565 /**
15566  * g_dbus_object_manager_server_export:
15567  * @manager: A #GDBusObjectManagerServer.
15568  * @object: A #GDBusObjectSkeleton.
15569  *
15570  * Exports @object on @manager.
15571  *
15572  * If there is already a #GDBusObject exported at the object path,
15573  * then the old object is removed.
15574  *
15575  * The object path for @object must be in the hierarchy rooted by the
15576  * object path for @manager.
15577  *
15578  * Note that @manager will take a reference on @object for as long as
15579  * it is exported.
15580  *
15581  * Since: 2.30
15582  */
15583
15584
15585 /**
15586  * g_dbus_object_manager_server_export_uniquely:
15587  * @manager: A #GDBusObjectManagerServer.
15588  * @object: An object.
15589  *
15590  * Like g_dbus_object_manager_server_export() but appends a string of
15591  * the form <literal>_N</literal> (with N being a natural number) to
15592  * @object<!-- -->'s object path if an object with the given path
15593  * already exists. As such, the #GDBusObjectProxy:g-object-path property
15594  * of @object may be modified.
15595  *
15596  * Since: 2.30
15597  */
15598
15599
15600 /**
15601  * g_dbus_object_manager_server_get_connection:
15602  * @manager: A #GDBusObjectManagerServer
15603  *
15604  * Gets the #GDBusConnection used by @manager.
15605  *
15606  * 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().
15607  * Since: 2.30
15608  */
15609
15610
15611 /**
15612  * g_dbus_object_manager_server_is_exported:
15613  * @manager: A #GDBusObjectManagerServer.
15614  * @object: An object.
15615  *
15616  * Returns whether @object is currently exported on @manager.
15617  *
15618  * Returns: %TRUE if @object is exported
15619  * Since: 2.34
15620  */
15621
15622
15623 /**
15624  * g_dbus_object_manager_server_new:
15625  * @object_path: The object path to export the manager object at.
15626  *
15627  * Creates a new #GDBusObjectManagerServer object.
15628  *
15629  * The returned server isn't yet exported on any connection. To do so,
15630  * use g_dbus_object_manager_server_set_connection(). Normally you
15631  * want to export all of your objects before doing so to avoid <ulink
15632  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
15633  * signals being emitted.
15634  *
15635  * Returns: A #GDBusObjectManagerServer object. Free with g_object_unref().
15636  * Since: 2.30
15637  */
15638
15639
15640 /**
15641  * g_dbus_object_manager_server_set_connection:
15642  * @manager: A #GDBusObjectManagerServer.
15643  * @connection: (allow-none): A #GDBusConnection or %NULL.
15644  *
15645  * Exports all objects managed by @manager on @connection. If
15646  * @connection is %NULL, stops exporting objects.
15647  */
15648
15649
15650 /**
15651  * g_dbus_object_manager_server_unexport:
15652  * @manager: A #GDBusObjectManagerServer.
15653  * @object_path: An object path.
15654  *
15655  * If @manager has an object at @path, removes the object. Otherwise
15656  * does nothing.
15657  *
15658  * Note that @object_path must be in the hierarchy rooted by the
15659  * object path for @manager.
15660  *
15661  * Returns: %TRUE if object at @object_path was removed, %FALSE otherwise.
15662  * Since: 2.30
15663  */
15664
15665
15666 /**
15667  * g_dbus_object_proxy_get_connection:
15668  * @proxy: a #GDBusObjectProxy
15669  *
15670  * Gets the connection that @proxy is for.
15671  *
15672  * Returns: (transfer none): A #GDBusConnection. Do not free, the object is owned by @proxy.
15673  * Since: 2.30
15674  */
15675
15676
15677 /**
15678  * g_dbus_object_proxy_new:
15679  * @connection: a #GDBusConnection
15680  * @object_path: the object path
15681  *
15682  * Creates a new #GDBusObjectProxy for the given connection and
15683  * object path.
15684  *
15685  * Returns: a new #GDBusObjectProxy
15686  * Since: 2.30
15687  */
15688
15689
15690 /**
15691  * g_dbus_object_skeleton_add_interface:
15692  * @object: A #GDBusObjectSkeleton.
15693  * @interface_: A #GDBusInterfaceSkeleton.
15694  *
15695  * Adds @interface_ to @object.
15696  *
15697  * If @object already contains a #GDBusInterfaceSkeleton with the same
15698  * interface name, it is removed before @interface_ is added.
15699  *
15700  * Note that @object takes its own reference on @interface_ and holds
15701  * it until removed.
15702  *
15703  * Since: 2.30
15704  */
15705
15706
15707 /**
15708  * g_dbus_object_skeleton_flush:
15709  * @object: A #GDBusObjectSkeleton.
15710  *
15711  * This method simply calls g_dbus_interface_skeleton_flush() on all
15712  * interfaces belonging to @object. See that method for when flushing
15713  * is useful.
15714  *
15715  * Since: 2.30
15716  */
15717
15718
15719 /**
15720  * g_dbus_object_skeleton_new:
15721  * @object_path: An object path.
15722  *
15723  * Creates a new #GDBusObjectSkeleton.
15724  *
15725  * Returns: A #GDBusObjectSkeleton. Free with g_object_unref().
15726  * Since: 2.30
15727  */
15728
15729
15730 /**
15731  * g_dbus_object_skeleton_remove_interface:
15732  * @object: A #GDBusObjectSkeleton.
15733  * @interface_: A #GDBusInterfaceSkeleton.
15734  *
15735  * Removes @interface_ from @object.
15736  *
15737  * Since: 2.30
15738  */
15739
15740
15741 /**
15742  * g_dbus_object_skeleton_remove_interface_by_name:
15743  * @object: A #GDBusObjectSkeleton.
15744  * @interface_name: A D-Bus interface name.
15745  *
15746  * Removes the #GDBusInterface with @interface_name from @object.
15747  *
15748  * If no D-Bus interface of the given interface exists, this function
15749  * does nothing.
15750  *
15751  * Since: 2.30
15752  */
15753
15754
15755 /**
15756  * g_dbus_object_skeleton_set_object_path:
15757  * @object: A #GDBusObjectSkeleton.
15758  * @object_path: A valid D-Bus object path.
15759  *
15760  * Sets the object path for @object.
15761  *
15762  * Since: 2.30
15763  */
15764
15765
15766 /**
15767  * g_dbus_property_info_ref:
15768  * @info: A #GDBusPropertyInfo
15769  *
15770  * If @info is statically allocated does nothing. Otherwise increases
15771  * the reference count.
15772  *
15773  * Returns: The same @info.
15774  * Since: 2.26
15775  */
15776
15777
15778 /**
15779  * g_dbus_property_info_unref:
15780  * @info: A #GDBusPropertyInfo.
15781  *
15782  * If @info is statically allocated, does nothing. Otherwise decreases
15783  * the reference count of @info. When its reference count drops to 0,
15784  * the memory used is freed.
15785  *
15786  * Since: 2.26
15787  */
15788
15789
15790 /**
15791  * g_dbus_proxy_call:
15792  * @proxy: A #GDBusProxy.
15793  * @method_name: Name of method to invoke.
15794  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15795  * @flags: Flags from the #GDBusCallFlags enumeration.
15796  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15797  * @cancellable: (allow-none): A #GCancellable or %NULL.
15798  * @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.
15799  * @user_data: The data to pass to @callback.
15800  *
15801  * Asynchronously invokes the @method_name method on @proxy.
15802  *
15803  * If @method_name contains any dots, then @name is split into interface and
15804  * method name parts. This allows using @proxy for invoking methods on
15805  * other interfaces.
15806  *
15807  * If the #GDBusConnection associated with @proxy is closed then
15808  * the operation will fail with %G_IO_ERROR_CLOSED. If
15809  * @cancellable is canceled, the operation will fail with
15810  * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15811  * compatible with the D-Bus protocol, the operation fails with
15812  * %G_IO_ERROR_INVALID_ARGUMENT.
15813  *
15814  * If the @parameters #GVariant is floating, it is consumed. This allows
15815  * convenient 'inline' use of g_variant_new(), e.g.:
15816  * |[
15817  *  g_dbus_proxy_call (proxy,
15818  *                     "TwoStrings",
15819  *                     g_variant_new ("(ss)",
15820  *                                    "Thing One",
15821  *                                    "Thing Two"),
15822  *                     G_DBUS_CALL_FLAGS_NONE,
15823  *                     -1,
15824  *                     NULL,
15825  *                     (GAsyncReadyCallback) two_strings_done,
15826  *                     &amp;data);
15827  * ]|
15828  *
15829  * If @proxy has an expected interface (see
15830  * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15831  * then the return value is checked against the return type.
15832  *
15833  * This is an asynchronous method. When the operation is finished,
15834  * @callback will be invoked in the
15835  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15836  * of the thread you are calling this method from.
15837  * You can then call g_dbus_proxy_call_finish() to get the result of
15838  * the operation. See g_dbus_proxy_call_sync() for the synchronous
15839  * version of this method.
15840  *
15841  * If @callback is %NULL then the D-Bus method call message will be sent with
15842  * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
15843  *
15844  * Since: 2.26
15845  */
15846
15847
15848 /**
15849  * g_dbus_proxy_call_finish:
15850  * @proxy: A #GDBusProxy.
15851  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
15852  * @error: Return location for error or %NULL.
15853  *
15854  * Finishes an operation started with g_dbus_proxy_call().
15855  *
15856  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15857  * Since: 2.26
15858  */
15859
15860
15861 /**
15862  * g_dbus_proxy_call_sync:
15863  * @proxy: A #GDBusProxy.
15864  * @method_name: Name of method to invoke.
15865  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15866  * @flags: Flags from the #GDBusCallFlags enumeration.
15867  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15868  * @cancellable: (allow-none): A #GCancellable or %NULL.
15869  * @error: Return location for error or %NULL.
15870  *
15871  * Synchronously invokes the @method_name method on @proxy.
15872  *
15873  * If @method_name contains any dots, then @name is split into interface and
15874  * method name parts. This allows using @proxy for invoking methods on
15875  * other interfaces.
15876  *
15877  * If the #GDBusConnection associated with @proxy is disconnected then
15878  * the operation will fail with %G_IO_ERROR_CLOSED. If
15879  * @cancellable is canceled, the operation will fail with
15880  * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15881  * compatible with the D-Bus protocol, the operation fails with
15882  * %G_IO_ERROR_INVALID_ARGUMENT.
15883  *
15884  * If the @parameters #GVariant is floating, it is consumed. This allows
15885  * convenient 'inline' use of g_variant_new(), e.g.:
15886  * |[
15887  *  g_dbus_proxy_call_sync (proxy,
15888  *                          "TwoStrings",
15889  *                          g_variant_new ("(ss)",
15890  *                                         "Thing One",
15891  *                                         "Thing Two"),
15892  *                          G_DBUS_CALL_FLAGS_NONE,
15893  *                          -1,
15894  *                          NULL,
15895  *                          &amp;error);
15896  * ]|
15897  *
15898  * The calling thread is blocked until a reply is received. See
15899  * g_dbus_proxy_call() for the asynchronous version of this
15900  * method.
15901  *
15902  * If @proxy has an expected interface (see
15903  * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15904  * then the return value is checked against the return type.
15905  *
15906  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15907  * Since: 2.26
15908  */
15909
15910
15911 /**
15912  * g_dbus_proxy_call_with_unix_fd_list:
15913  * @proxy: A #GDBusProxy.
15914  * @method_name: Name of method to invoke.
15915  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15916  * @flags: Flags from the #GDBusCallFlags enumeration.
15917  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15918  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15919  * @cancellable: (allow-none): A #GCancellable or %NULL.
15920  * @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.
15921  * @user_data: The data to pass to @callback.
15922  *
15923  * Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
15924  *
15925  * This method is only available on UNIX.
15926  *
15927  * Since: 2.30
15928  */
15929
15930
15931 /**
15932  * g_dbus_proxy_call_with_unix_fd_list_finish:
15933  * @proxy: A #GDBusProxy.
15934  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15935  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
15936  * @error: Return location for error or %NULL.
15937  *
15938  * Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
15939  *
15940  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15941  * Since: 2.30
15942  */
15943
15944
15945 /**
15946  * g_dbus_proxy_call_with_unix_fd_list_sync:
15947  * @proxy: A #GDBusProxy.
15948  * @method_name: Name of method to invoke.
15949  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15950  * @flags: Flags from the #GDBusCallFlags enumeration.
15951  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15952  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15953  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15954  * @cancellable: (allow-none): A #GCancellable or %NULL.
15955  * @error: Return location for error or %NULL.
15956  *
15957  * Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
15958  *
15959  * This method is only available on UNIX.
15960  *
15961  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15962  * Since: 2.30
15963  */
15964
15965
15966 /**
15967  * g_dbus_proxy_get_cached_property:
15968  * @proxy: A #GDBusProxy.
15969  * @property_name: Property name.
15970  *
15971  * Looks up the value for a property from the cache. This call does no
15972  * blocking IO.
15973  *
15974  * If @proxy has an expected interface (see
15975  * #GDBusProxy:g-interface-info) and @property_name is referenced by
15976  * it, then @value is checked against the type of the property.
15977  *
15978  * 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().
15979  * Since: 2.26
15980  */
15981
15982
15983 /**
15984  * g_dbus_proxy_get_cached_property_names:
15985  * @proxy: A #GDBusProxy.
15986  *
15987  * Gets the names of all cached properties on @proxy.
15988  *
15989  * Returns: (transfer full): A %NULL-terminated array of strings or %NULL if @proxy has no cached properties. Free the returned array with g_strfreev().
15990  * Since: 2.26
15991  */
15992
15993
15994 /**
15995  * g_dbus_proxy_get_connection:
15996  * @proxy: A #GDBusProxy.
15997  *
15998  * Gets the connection @proxy is for.
15999  *
16000  * Returns: (transfer none): A #GDBusConnection owned by @proxy. Do not free.
16001  * Since: 2.26
16002  */
16003
16004
16005 /**
16006  * g_dbus_proxy_get_default_timeout:
16007  * @proxy: A #GDBusProxy.
16008  *
16009  * Gets the timeout to use if -1 (specifying default timeout) is
16010  * passed as @timeout_msec in the g_dbus_proxy_call() and
16011  * g_dbus_proxy_call_sync() functions.
16012  *
16013  * See the #GDBusProxy:g-default-timeout property for more details.
16014  *
16015  * Returns: Timeout to use for @proxy.
16016  * Since: 2.26
16017  */
16018
16019
16020 /**
16021  * g_dbus_proxy_get_flags:
16022  * @proxy: A #GDBusProxy.
16023  *
16024  * Gets the flags that @proxy was constructed with.
16025  *
16026  * Returns: Flags from the #GDBusProxyFlags enumeration.
16027  * Since: 2.26
16028  */
16029
16030
16031 /**
16032  * g_dbus_proxy_get_interface_info:
16033  * @proxy: A #GDBusProxy
16034  *
16035  * Returns the #GDBusInterfaceInfo, if any, specifying the interface
16036  * that @proxy conforms to. See the #GDBusProxy:g-interface-info
16037  * property for more details.
16038  *
16039  * Returns: A #GDBusInterfaceInfo or %NULL. Do not unref the returned object, it is owned by @proxy.
16040  * Since: 2.26
16041  */
16042
16043
16044 /**
16045  * g_dbus_proxy_get_interface_name:
16046  * @proxy: A #GDBusProxy.
16047  *
16048  * Gets the D-Bus interface name @proxy is for.
16049  *
16050  * Returns: A string owned by @proxy. Do not free.
16051  * Since: 2.26
16052  */
16053
16054
16055 /**
16056  * g_dbus_proxy_get_name:
16057  * @proxy: A #GDBusProxy.
16058  *
16059  * Gets the name that @proxy was constructed for.
16060  *
16061  * Returns: A string owned by @proxy. Do not free.
16062  * Since: 2.26
16063  */
16064
16065
16066 /**
16067  * g_dbus_proxy_get_name_owner:
16068  * @proxy: A #GDBusProxy.
16069  *
16070  * The unique name that owns the name that @proxy is for or %NULL if
16071  * no-one currently owns that name. You may connect to the
16072  * #GObject::notify signal to track changes to the
16073  * #GDBusProxy:g-name-owner property.
16074  *
16075  * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
16076  * Since: 2.26
16077  */
16078
16079
16080 /**
16081  * g_dbus_proxy_get_object_path:
16082  * @proxy: A #GDBusProxy.
16083  *
16084  * Gets the object path @proxy is for.
16085  *
16086  * Returns: A string owned by @proxy. Do not free.
16087  * Since: 2.26
16088  */
16089
16090
16091 /**
16092  * g_dbus_proxy_new:
16093  * @connection: A #GDBusConnection.
16094  * @flags: Flags used when constructing the proxy.
16095  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16096  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16097  * @object_path: An object path.
16098  * @interface_name: A D-Bus interface name.
16099  * @cancellable: (allow-none): A #GCancellable or %NULL.
16100  * @callback: Callback function to invoke when the proxy is ready.
16101  * @user_data: User data to pass to @callback.
16102  *
16103  * Creates a proxy for accessing @interface_name on the remote object
16104  * at @object_path owned by @name at @connection and asynchronously
16105  * loads D-Bus properties unless the
16106  * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
16107  * the #GDBusProxy::g-properties-changed signal to get notified about
16108  * property changes.
16109  *
16110  * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16111  * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16112  * to handle signals from the remote object.
16113  *
16114  * If @name is a well-known name and the
16115  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16116  * owner currently exists, the message bus will be requested to launch
16117  * a name owner for the name.
16118  *
16119  * This is a failable asynchronous constructor - when the proxy is
16120  * ready, @callback will be invoked and you can use
16121  * g_dbus_proxy_new_finish() to get the result.
16122  *
16123  * See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
16124  *
16125  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16126  *
16127  * Since: 2.26
16128  */
16129
16130
16131 /**
16132  * g_dbus_proxy_new_finish:
16133  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
16134  * @error: Return location for error or %NULL.
16135  *
16136  * Finishes creating a #GDBusProxy.
16137  *
16138  * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16139  * Since: 2.26
16140  */
16141
16142
16143 /**
16144  * g_dbus_proxy_new_for_bus:
16145  * @bus_type: A #GBusType.
16146  * @flags: Flags used when constructing the proxy.
16147  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16148  * @name: A bus name (well-known or unique).
16149  * @object_path: An object path.
16150  * @interface_name: A D-Bus interface name.
16151  * @cancellable: (allow-none): A #GCancellable or %NULL.
16152  * @callback: Callback function to invoke when the proxy is ready.
16153  * @user_data: User data to pass to @callback.
16154  *
16155  * Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
16156  *
16157  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16158  *
16159  * Since: 2.26
16160  */
16161
16162
16163 /**
16164  * g_dbus_proxy_new_for_bus_finish:
16165  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
16166  * @error: Return location for error or %NULL.
16167  *
16168  * Finishes creating a #GDBusProxy.
16169  *
16170  * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
16171  * Since: 2.26
16172  */
16173
16174
16175 /**
16176  * g_dbus_proxy_new_for_bus_sync:
16177  * @bus_type: A #GBusType.
16178  * @flags: Flags used when constructing the proxy.
16179  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16180  * @name: A bus name (well-known or unique).
16181  * @object_path: An object path.
16182  * @interface_name: A D-Bus interface name.
16183  * @cancellable: (allow-none): A #GCancellable or %NULL.
16184  * @error: Return location for error or %NULL.
16185  *
16186  * Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
16187  *
16188  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16189  *
16190  * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16191  * Since: 2.26
16192  */
16193
16194
16195 /**
16196  * g_dbus_proxy_new_sync:
16197  * @connection: A #GDBusConnection.
16198  * @flags: Flags used when constructing the proxy.
16199  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
16200  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
16201  * @object_path: An object path.
16202  * @interface_name: A D-Bus interface name.
16203  * @cancellable: (allow-none): A #GCancellable or %NULL.
16204  * @error: (allow-none): Return location for error or %NULL.
16205  *
16206  * Creates a proxy for accessing @interface_name on the remote object
16207  * at @object_path owned by @name at @connection and synchronously
16208  * loads D-Bus properties unless the
16209  * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
16210  *
16211  * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
16212  * match rules for signals. Connect to the #GDBusProxy::g-signal signal
16213  * to handle signals from the remote object.
16214  *
16215  * If @name is a well-known name and the
16216  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
16217  * owner currently exists, the message bus will be requested to launch
16218  * a name owner for the name.
16219  *
16220  * This is a synchronous failable constructor. See g_dbus_proxy_new()
16221  * and g_dbus_proxy_new_finish() for the asynchronous version.
16222  *
16223  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
16224  *
16225  * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
16226  * Since: 2.26
16227  */
16228
16229
16230 /**
16231  * g_dbus_proxy_set_cached_property:
16232  * @proxy: A #GDBusProxy
16233  * @property_name: Property name.
16234  * @value: (allow-none): Value for the property or %NULL to remove it from the cache.
16235  *
16236  * If @value is not %NULL, sets the cached value for the property with
16237  * name @property_name to the value in @value.
16238  *
16239  * If @value is %NULL, then the cached value is removed from the
16240  * property cache.
16241  *
16242  * If @proxy has an expected interface (see
16243  * #GDBusProxy:g-interface-info) and @property_name is referenced by
16244  * it, then @value is checked against the type of the property.
16245  *
16246  * If the @value #GVariant is floating, it is consumed. This allows
16247  * convenient 'inline' use of g_variant_new(), e.g.
16248  * |[
16249  *  g_dbus_proxy_set_cached_property (proxy,
16250  *                                    "SomeProperty",
16251  *                                    g_variant_new ("(si)",
16252  *                                                  "A String",
16253  *                                                  42));
16254  * ]|
16255  *
16256  * Normally you will not need to use this method since @proxy is
16257  * tracking changes using the
16258  * <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
16259  * D-Bus signal. However, for performance reasons an object may decide
16260  * to not use this signal for some properties and instead use a
16261  * proprietary out-of-band mechanism to transmit changes.
16262  *
16263  * As a concrete example, consider an object with a property
16264  * <literal>ChatroomParticipants</literal> which is an array of
16265  * strings. Instead of transmitting the same (long) array every time
16266  * the property changes, it is more efficient to only transmit the
16267  * delta using e.g. signals <literal>ChatroomParticipantJoined(String
16268  * name)</literal> and <literal>ChatroomParticipantParted(String
16269  * name)</literal>.
16270  *
16271  * Since: 2.26
16272  */
16273
16274
16275 /**
16276  * g_dbus_proxy_set_default_timeout:
16277  * @proxy: A #GDBusProxy.
16278  * @timeout_msec: Timeout in milliseconds.
16279  *
16280  * Sets the timeout to use if -1 (specifying default timeout) is
16281  * passed as @timeout_msec in the g_dbus_proxy_call() and
16282  * g_dbus_proxy_call_sync() functions.
16283  *
16284  * See the #GDBusProxy:g-default-timeout property for more details.
16285  *
16286  * Since: 2.26
16287  */
16288
16289
16290 /**
16291  * g_dbus_proxy_set_interface_info:
16292  * @proxy: A #GDBusProxy
16293  * @info: (allow-none): Minimum interface this proxy conforms to or %NULL to unset.
16294  *
16295  * Ensure that interactions with @proxy conform to the given
16296  * interface. See the #GDBusProxy:g-interface-info property for more
16297  * details.
16298  *
16299  * Since: 2.26
16300  */
16301
16302
16303 /**
16304  * g_dbus_server_get_client_address:
16305  * @server: A #GDBusServer.
16306  *
16307  * Gets a D-Bus address string that can be used by clients to connect
16308  * to @server.
16309  *
16310  * Returns: A D-Bus address string. Do not free, the string is owned by @server.
16311  * Since: 2.26
16312  */
16313
16314
16315 /**
16316  * g_dbus_server_get_flags:
16317  * @server: A #GDBusServer.
16318  *
16319  * Gets the flags for @server.
16320  *
16321  * Returns: A set of flags from the #GDBusServerFlags enumeration.
16322  * Since: 2.26
16323  */
16324
16325
16326 /**
16327  * g_dbus_server_get_guid:
16328  * @server: A #GDBusServer.
16329  *
16330  * Gets the GUID for @server.
16331  *
16332  * Returns: A D-Bus GUID. Do not free this string, it is owned by @server.
16333  * Since: 2.26
16334  */
16335
16336
16337 /**
16338  * g_dbus_server_is_active:
16339  * @server: A #GDBusServer.
16340  *
16341  * Gets whether @server is active.
16342  *
16343  * Returns: %TRUE if server is active, %FALSE otherwise.
16344  * Since: 2.26
16345  */
16346
16347
16348 /**
16349  * g_dbus_server_new_sync:
16350  * @address: A D-Bus address.
16351  * @flags: Flags from the #GDBusServerFlags enumeration.
16352  * @guid: A D-Bus GUID.
16353  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
16354  * @cancellable: (allow-none): A #GCancellable or %NULL.
16355  * @error: Return location for server or %NULL.
16356  *
16357  * Creates a new D-Bus server that listens on the first address in
16358  * @address that works.
16359  *
16360  * Once constructed, you can use g_dbus_server_get_client_address() to
16361  * get a D-Bus address string that clients can use to connect.
16362  *
16363  * Connect to the #GDBusServer::new-connection signal to handle
16364  * incoming connections.
16365  *
16366  * The returned #GDBusServer isn't active - you have to start it with
16367  * g_dbus_server_start().
16368  *
16369  * See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
16370  * be used.
16371  *
16372  * This is a synchronous failable constructor. See
16373  * g_dbus_server_new() for the asynchronous version.
16374  *
16375  * Returns: A #GDBusServer or %NULL if @error is set. Free with g_object_unref().
16376  * Since: 2.26
16377  */
16378
16379
16380 /**
16381  * g_dbus_server_start:
16382  * @server: A #GDBusServer.
16383  *
16384  * Starts @server.
16385  *
16386  * Since: 2.26
16387  */
16388
16389
16390 /**
16391  * g_dbus_server_stop:
16392  * @server: A #GDBusServer.
16393  *
16394  * Stops @server.
16395  *
16396  * Since: 2.26
16397  */
16398
16399
16400 /**
16401  * g_dbus_signal_info_ref:
16402  * @info: A #GDBusSignalInfo
16403  *
16404  * If @info is statically allocated does nothing. Otherwise increases
16405  * the reference count.
16406  *
16407  * Returns: The same @info.
16408  * Since: 2.26
16409  */
16410
16411
16412 /**
16413  * g_dbus_signal_info_unref:
16414  * @info: A #GDBusSignalInfo.
16415  *
16416  * If @info is statically allocated, does nothing. Otherwise decreases
16417  * the reference count of @info. When its reference count drops to 0,
16418  * the memory used is freed.
16419  *
16420  * Since: 2.26
16421  */
16422
16423
16424 /**
16425  * g_desktop_app_info_get_categories:
16426  * @info: a #GDesktopAppInfo
16427  *
16428  * Gets the categories from the desktop file.
16429  *
16430  * Returns: The unparsed Categories key from the desktop file; i.e. no attempt is made to split it by ';' or validate it.
16431  */
16432
16433
16434 /**
16435  * g_desktop_app_info_get_filename:
16436  * @info: a #GDesktopAppInfo
16437  *
16438  * When @info was created from a known filename, return it.  In some
16439  * situations such as the #GDesktopAppInfo returned from
16440  * g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
16441  *
16442  * Returns: The full path to the file for @info, or %NULL if not known.
16443  * Since: 2.24
16444  */
16445
16446
16447 /**
16448  * g_desktop_app_info_get_generic_name:
16449  * @info: a #GDesktopAppInfo
16450  *
16451  * Gets the generic name from the destkop file.
16452  *
16453  * Returns: The value of the GenericName key
16454  */
16455
16456
16457 /**
16458  * g_desktop_app_info_get_is_hidden:
16459  * @info: a #GDesktopAppInfo.
16460  *
16461  * A desktop file is hidden if the Hidden key in it is
16462  * set to True.
16463  *
16464  * Returns: %TRUE if hidden, %FALSE otherwise.
16465  */
16466
16467
16468 /**
16469  * g_desktop_app_info_get_keywords:
16470  * @info: a #GDesktopAppInfo
16471  *
16472  * Gets the keywords from the desktop file.
16473  *
16474  * Returns: (transfer none): The value of the Keywords key
16475  * Since: 2.32
16476  */
16477
16478
16479 /**
16480  * g_desktop_app_info_get_nodisplay:
16481  * @info: a #GDesktopAppInfo
16482  *
16483  * Gets the value of the NoDisplay key, which helps determine if the
16484  * application info should be shown in menus. See
16485  * #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
16486  *
16487  * Returns: The value of the NoDisplay key
16488  * Since: 2.30
16489  */
16490
16491
16492 /**
16493  * g_desktop_app_info_get_show_in:
16494  * @info: a #GDesktopAppInfo
16495  * @desktop_env: a string specifying a desktop name
16496  *
16497  * Checks if the application info should be shown in menus that list available
16498  * applications for a specific name of the desktop, based on the
16499  * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
16500  *
16501  * If @desktop_env is %NULL, then the name of the desktop set with
16502  * g_desktop_app_info_set_desktop_env() is used.
16503  *
16504  * Note that g_app_info_should_show() for @info will include this check (with
16505  * %NULL for @desktop_env) as well as additional checks.
16506  *
16507  * Returns: %TRUE if the @info should be shown in @desktop_env according to the <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE otherwise.
16508  * Since: 2.30
16509  */
16510
16511
16512 /**
16513  * g_desktop_app_info_get_startup_wm_class:
16514  * @app_info: a #GDesktopAppInfo that supports startup notify
16515  *
16516  * Retrieves the StartupWMClass field from @app_info. This represents the
16517  * WM_CLASS property of the main window of the application, if launched through
16518  * @app_info.
16519  *
16520  * Returns: (transfer none): the startup WM class, or %NULL if none is set in the desktop file.
16521  * Since: 2.34
16522  */
16523
16524
16525 /**
16526  * g_desktop_app_info_launch_uris_as_manager:
16527  * @appinfo: a #GDesktopAppInfo
16528  * @uris: (element-type utf8): List of URIs
16529  * @launch_context: a #GAppLaunchContext
16530  * @spawn_flags: #GSpawnFlags, used for each process
16531  * @user_setup: (scope call): a #GSpawnChildSetupFunc, used once for each process.
16532  * @user_setup_data: (closure user_setup): User data for @user_setup
16533  * @pid_callback: (scope call): Callback for child processes
16534  * @pid_callback_data: (closure pid_callback): User data for @callback
16535  * @error: return location for a #GError, or %NULL
16536  *
16537  * This function performs the equivalent of g_app_info_launch_uris(),
16538  * but is intended primarily for operating system components that
16539  * launch applications.  Ordinary applications should use
16540  * g_app_info_launch_uris().
16541  *
16542  * In contrast to g_app_info_launch_uris(), all processes created will
16543  * always be run directly as children as if by the UNIX fork()/exec()
16544  * calls.
16545  *
16546  * This guarantee allows additional control over the exact environment
16547  * of the child processes, which is provided via a setup function
16548  * @user_setup, as well as the process identifier of each child process
16549  * via @pid_callback. See g_spawn_async() for more information about the
16550  * semantics of the @user_setup function.
16551  *
16552  * Returns: %TRUE on successful launch, %FALSE otherwise.
16553  */
16554
16555
16556 /**
16557  * g_desktop_app_info_lookup_get_default_for_uri_scheme:
16558  * @lookup: a #GDesktopAppInfoLookup
16559  * @uri_scheme: a string containing a URI scheme.
16560  *
16561  * Gets the default application for launching applications
16562  * using this URI scheme for a particular GDesktopAppInfoLookup
16563  * implementation.
16564  *
16565  * The GDesktopAppInfoLookup interface and this function is used
16566  * to implement g_app_info_get_default_for_uri_scheme() backends
16567  * in a GIO module. There is no reason for applications to use it
16568  * directly. Applications should use g_app_info_get_default_for_uri_scheme().
16569  *
16570  * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
16571  * Deprecated: The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
16572  */
16573
16574
16575 /**
16576  * g_desktop_app_info_new:
16577  * @desktop_id: the desktop file id
16578  *
16579  * Creates a new #GDesktopAppInfo based on a desktop file id.
16580  *
16581  * A desktop file id is the basename of the desktop file, including the
16582  * .desktop extension. GIO is looking for a desktop file with this name
16583  * in the <filename>applications</filename> subdirectories of the XDG data
16584  * directories (i.e. the directories specified in the
16585  * <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
16586  * variables). GIO also supports the prefix-to-subdirectory mapping that is
16587  * described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
16588  * (i.e. a desktop id of kde-foo.desktop will match
16589  * <filename>/usr/share/applications/kde/foo.desktop</filename>).
16590  *
16591  * Returns: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
16592  */
16593
16594
16595 /**
16596  * g_desktop_app_info_new_from_filename:
16597  * @filename: the path of a desktop file, in the GLib filename encoding
16598  *
16599  * Creates a new #GDesktopAppInfo.
16600  *
16601  * Returns: a new #GDesktopAppInfo or %NULL on error.
16602  */
16603
16604
16605 /**
16606  * g_desktop_app_info_new_from_keyfile:
16607  * @key_file: an opened #GKeyFile
16608  *
16609  * Creates a new #GDesktopAppInfo.
16610  *
16611  * Returns: a new #GDesktopAppInfo or %NULL on error.
16612  * Since: 2.18
16613  */
16614
16615
16616 /**
16617  * g_desktop_app_info_set_desktop_env:
16618  * @desktop_env: a string specifying what desktop this is
16619  *
16620  * Sets the name of the desktop that the application is running in.
16621  * This is used by g_app_info_should_show() and
16622  * g_desktop_app_info_get_show_in() to evaluate the
16623  * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
16624  * desktop entry fields.
16625  *
16626  * The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
16627  * Menu specification</ulink> recognizes the following:
16628  * <simplelist>
16629  *   <member>GNOME</member>
16630  *   <member>KDE</member>
16631  *   <member>ROX</member>
16632  *   <member>XFCE</member>
16633  *   <member>LXDE</member>
16634  *   <member>Unity</member>
16635  *   <member>Old</member>
16636  * </simplelist>
16637  *
16638  * Should be called only once; subsequent calls are ignored.
16639  */
16640
16641
16642 /**
16643  * g_drive_can_eject:
16644  * @drive: a #GDrive.
16645  *
16646  * Checks if a drive can be ejected.
16647  *
16648  * Returns: %TRUE if the @drive can be ejected, %FALSE otherwise.
16649  */
16650
16651
16652 /**
16653  * g_drive_can_poll_for_media:
16654  * @drive: a #GDrive.
16655  *
16656  * Checks if a drive can be polled for media changes.
16657  *
16658  * Returns: %TRUE if the @drive can be polled for media changes, %FALSE otherwise.
16659  */
16660
16661
16662 /**
16663  * g_drive_can_start:
16664  * @drive: a #GDrive.
16665  *
16666  * Checks if a drive can be started.
16667  *
16668  * Returns: %TRUE if the @drive can be started, %FALSE otherwise.
16669  * Since: 2.22
16670  */
16671
16672
16673 /**
16674  * g_drive_can_start_degraded:
16675  * @drive: a #GDrive.
16676  *
16677  * Checks if a drive can be started degraded.
16678  *
16679  * Returns: %TRUE if the @drive can be started degraded, %FALSE otherwise.
16680  * Since: 2.22
16681  */
16682
16683
16684 /**
16685  * g_drive_can_stop:
16686  * @drive: a #GDrive.
16687  *
16688  * Checks if a drive can be stopped.
16689  *
16690  * Returns: %TRUE if the @drive can be stopped, %FALSE otherwise.
16691  * Since: 2.22
16692  */
16693
16694
16695 /**
16696  * g_drive_eject:
16697  * @drive: a #GDrive.
16698  * @flags: flags affecting the unmount if required for eject
16699  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16700  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16701  * @user_data: user data to pass to @callback
16702  *
16703  * Asynchronously ejects a drive.
16704  *
16705  * When the operation is finished, @callback will be called.
16706  * You can then call g_drive_eject_finish() to obtain the
16707  * result of the operation.
16708  *
16709  * Deprecated: 2.22: Use g_drive_eject_with_operation() instead.
16710  */
16711
16712
16713 /**
16714  * g_drive_eject_finish:
16715  * @drive: a #GDrive.
16716  * @result: a #GAsyncResult.
16717  * @error: a #GError, or %NULL
16718  *
16719  * Finishes ejecting a drive.
16720  *
16721  * Returns: %TRUE if the drive has been ejected successfully, %FALSE otherwise.
16722  * Deprecated: 2.22: Use g_drive_eject_with_operation_finish() instead.
16723  */
16724
16725
16726 /**
16727  * g_drive_eject_with_operation:
16728  * @drive: a #GDrive.
16729  * @flags: flags affecting the unmount if required for eject
16730  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16731  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16732  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16733  * @user_data: user data passed to @callback.
16734  *
16735  * Ejects a drive. This is an asynchronous operation, and is
16736  * finished by calling g_drive_eject_with_operation_finish() with the @drive
16737  * and #GAsyncResult data returned in the @callback.
16738  *
16739  * Since: 2.22
16740  */
16741
16742
16743 /**
16744  * g_drive_eject_with_operation_finish:
16745  * @drive: a #GDrive.
16746  * @result: a #GAsyncResult.
16747  * @error: a #GError location to store the error occurring, or %NULL to ignore.
16748  *
16749  * Finishes ejecting a drive. If any errors occurred during the operation,
16750  * @error will be set to contain the errors and %FALSE will be returned.
16751  *
16752  * Returns: %TRUE if the drive was successfully ejected. %FALSE otherwise.
16753  * Since: 2.22
16754  */
16755
16756
16757 /**
16758  * g_drive_enumerate_identifiers:
16759  * @drive: a #GDrive
16760  *
16761  * Gets the kinds of identifiers that @drive has.
16762  * Use g_drive_get_identifier() to obtain the identifiers
16763  * themselves.
16764  *
16765  * Returns: (transfer full) (array zero-terminated=1): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
16766  */
16767
16768
16769 /**
16770  * g_drive_get_icon:
16771  * @drive: a #GDrive.
16772  *
16773  * Gets the icon for @drive.
16774  *
16775  * Returns: (transfer full): #GIcon for the @drive. Free the returned object with g_object_unref().
16776  */
16777
16778
16779 /**
16780  * g_drive_get_identifier:
16781  * @drive: a #GDrive
16782  * @kind: the kind of identifier to return
16783  *
16784  * Gets the identifier of the given kind for @drive.
16785  *
16786  * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GDrive doesn't have this kind of identifier.
16787  */
16788
16789
16790 /**
16791  * g_drive_get_name:
16792  * @drive: a #GDrive.
16793  *
16794  * Gets the name of @drive.
16795  *
16796  * Returns: a string containing @drive's name. The returned string should be freed when no longer needed.
16797  */
16798
16799
16800 /**
16801  * g_drive_get_sort_key:
16802  * @drive: A #GDrive.
16803  *
16804  * Gets the sort key for @drive, if any.
16805  *
16806  * Returns: Sorting key for @drive or %NULL if no such key is available.
16807  * Since: 2.32
16808  */
16809
16810
16811 /**
16812  * g_drive_get_start_stop_type:
16813  * @drive: a #GDrive.
16814  *
16815  * Gets a hint about how a drive can be started/stopped.
16816  *
16817  * Returns: A value from the #GDriveStartStopType enumeration.
16818  * Since: 2.22
16819  */
16820
16821
16822 /**
16823  * g_drive_get_symbolic_icon:
16824  * @drive: a #GDrive.
16825  *
16826  * Gets the icon for @drive.
16827  *
16828  * Returns: (transfer full): symbolic #GIcon for the @drive. Free the returned object with g_object_unref().
16829  * Since: 2.34
16830  */
16831
16832
16833 /**
16834  * g_drive_get_volumes:
16835  * @drive: a #GDrive.
16836  *
16837  * Get a list of mountable volumes for @drive.
16838  *
16839  * The returned list should be freed with g_list_free(), after
16840  * its elements have been unreffed with g_object_unref().
16841  *
16842  * Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive.
16843  */
16844
16845
16846 /**
16847  * g_drive_has_media:
16848  * @drive: a #GDrive.
16849  *
16850  * Checks if the @drive has media. Note that the OS may not be polling
16851  * the drive for media changes; see g_drive_is_media_check_automatic()
16852  * for more details.
16853  *
16854  * Returns: %TRUE if @drive has media, %FALSE otherwise.
16855  */
16856
16857
16858 /**
16859  * g_drive_has_volumes:
16860  * @drive: a #GDrive.
16861  *
16862  * Check if @drive has any mountable volumes.
16863  *
16864  * Returns: %TRUE if the @drive contains volumes, %FALSE otherwise.
16865  */
16866
16867
16868 /**
16869  * g_drive_is_media_check_automatic:
16870  * @drive: a #GDrive.
16871  *
16872  * Checks if @drive is capabable of automatically detecting media changes.
16873  *
16874  * Returns: %TRUE if the @drive is capabable of automatically detecting media changes, %FALSE otherwise.
16875  */
16876
16877
16878 /**
16879  * g_drive_is_media_removable:
16880  * @drive: a #GDrive.
16881  *
16882  * Checks if the @drive supports removable media.
16883  *
16884  * Returns: %TRUE if @drive supports removable media, %FALSE otherwise.
16885  */
16886
16887
16888 /**
16889  * g_drive_poll_for_media:
16890  * @drive: a #GDrive.
16891  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16892  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16893  * @user_data: user data to pass to @callback
16894  *
16895  * Asynchronously polls @drive to see if media has been inserted or removed.
16896  *
16897  * When the operation is finished, @callback will be called.
16898  * You can then call g_drive_poll_for_media_finish() to obtain the
16899  * result of the operation.
16900  */
16901
16902
16903 /**
16904  * g_drive_poll_for_media_finish:
16905  * @drive: a #GDrive.
16906  * @result: a #GAsyncResult.
16907  * @error: a #GError, or %NULL
16908  *
16909  * Finishes an operation started with g_drive_poll_for_media() on a drive.
16910  *
16911  * Returns: %TRUE if the drive has been poll_for_mediaed successfully, %FALSE otherwise.
16912  */
16913
16914
16915 /**
16916  * g_drive_start:
16917  * @drive: a #GDrive.
16918  * @flags: flags affecting the start operation.
16919  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16920  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16921  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16922  * @user_data: user data to pass to @callback
16923  *
16924  * Asynchronously starts a drive.
16925  *
16926  * When the operation is finished, @callback will be called.
16927  * You can then call g_drive_start_finish() to obtain the
16928  * result of the operation.
16929  *
16930  * Since: 2.22
16931  */
16932
16933
16934 /**
16935  * g_drive_start_finish:
16936  * @drive: a #GDrive.
16937  * @result: a #GAsyncResult.
16938  * @error: a #GError, or %NULL
16939  *
16940  * Finishes starting a drive.
16941  *
16942  * Returns: %TRUE if the drive has been started successfully, %FALSE otherwise.
16943  * Since: 2.22
16944  */
16945
16946
16947 /**
16948  * g_drive_stop:
16949  * @drive: a #GDrive.
16950  * @flags: flags affecting the unmount if required for stopping.
16951  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16952  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16953  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16954  * @user_data: user data to pass to @callback
16955  *
16956  * Asynchronously stops a drive.
16957  *
16958  * When the operation is finished, @callback will be called.
16959  * You can then call g_drive_stop_finish() to obtain the
16960  * result of the operation.
16961  *
16962  * Since: 2.22
16963  */
16964
16965
16966 /**
16967  * g_drive_stop_finish:
16968  * @drive: a #GDrive.
16969  * @result: a #GAsyncResult.
16970  * @error: a #GError, or %NULL
16971  *
16972  * Finishes stopping a drive.
16973  *
16974  * Returns: %TRUE if the drive has been stopped successfully, %FALSE otherwise.
16975  * Since: 2.22
16976  */
16977
16978
16979 /**
16980  * g_emblem_get_icon:
16981  * @emblem: a #GEmblem from which the icon should be extracted.
16982  *
16983  * Gives back the icon from @emblem.
16984  *
16985  * Returns: (transfer none): a #GIcon. The returned object belongs to the emblem and should not be modified or freed.
16986  * Since: 2.18
16987  */
16988
16989
16990 /**
16991  * g_emblem_get_origin:
16992  * @emblem: a #GEmblem
16993  *
16994  * Gets the origin of the emblem.
16995  *
16996  * Returns: (transfer none): the origin of the emblem
16997  * Since: 2.18
16998  */
16999
17000
17001 /**
17002  * g_emblem_new:
17003  * @icon: a GIcon containing the icon.
17004  *
17005  * Creates a new emblem for @icon.
17006  *
17007  * Returns: a new #GEmblem.
17008  * Since: 2.18
17009  */
17010
17011
17012 /**
17013  * g_emblem_new_with_origin:
17014  * @icon: a GIcon containing the icon.
17015  * @origin: a GEmblemOrigin enum defining the emblem's origin
17016  *
17017  * Creates a new emblem for @icon.
17018  *
17019  * Returns: a new #GEmblem.
17020  * Since: 2.18
17021  */
17022
17023
17024 /**
17025  * g_emblemed_icon_add_emblem:
17026  * @emblemed: a #GEmblemedIcon
17027  * @emblem: a #GEmblem
17028  *
17029  * Adds @emblem to the #GList of #GEmblem <!-- -->s.
17030  *
17031  * Since: 2.18
17032  */
17033
17034
17035 /**
17036  * g_emblemed_icon_clear_emblems:
17037  * @emblemed: a #GEmblemedIcon
17038  *
17039  * Removes all the emblems from @icon.
17040  *
17041  * Since: 2.28
17042  */
17043
17044
17045 /**
17046  * g_emblemed_icon_get_emblems:
17047  * @emblemed: a #GEmblemedIcon
17048  *
17049  * Gets the list of emblems for the @icon.
17050  *
17051  * Returns: (element-type Gio.Emblem) (transfer none): a #GList of #GEmblem <!-- -->s that is owned by @emblemed
17052  * Since: 2.18
17053  */
17054
17055
17056 /**
17057  * g_emblemed_icon_get_icon:
17058  * @emblemed: a #GEmblemedIcon
17059  *
17060  * Gets the main icon for @emblemed.
17061  *
17062  * Returns: (transfer none): a #GIcon that is owned by @emblemed
17063  * Since: 2.18
17064  */
17065
17066
17067 /**
17068  * g_emblemed_icon_new:
17069  * @icon: a #GIcon
17070  * @emblem: (allow-none): a #GEmblem, or %NULL
17071  *
17072  * Creates a new emblemed icon for @icon with the emblem @emblem.
17073  *
17074  * Returns: (transfer full) (type GEmblemedIcon): a new #GIcon
17075  * Since: 2.18
17076  */
17077
17078
17079 /**
17080  * g_file_append_to:
17081  * @file: input #GFile
17082  * @flags: a set of #GFileCreateFlags
17083  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17084  * @error: a #GError, or %NULL
17085  *
17086  * Gets an output stream for appending data to the file.
17087  * If the file doesn't already exist it is created.
17088  *
17089  * By default files created are generally readable by everyone,
17090  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17091  * will be made readable only to the current user, to the level that
17092  * is supported on the target filesystem.
17093  *
17094  * If @cancellable is not %NULL, then the operation can be cancelled
17095  * by triggering the cancellable object from another thread. If the
17096  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17097  * returned.
17098  *
17099  * Some file systems don't allow all file names, and may return an
17100  * %G_IO_ERROR_INVALID_FILENAME error. If the file is a directory the
17101  * %G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are
17102  * possible too, and depend on what kind of filesystem the file is on.
17103  *
17104  * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
17105  */
17106
17107
17108 /**
17109  * g_file_append_to_async:
17110  * @file: input #GFile
17111  * @flags: a set of #GFileCreateFlags
17112  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17113  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17114  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17115  * @user_data: (closure): the data to pass to callback function
17116  *
17117  * Asynchronously opens @file for appending.
17118  *
17119  * For more details, see g_file_append_to() which is
17120  * the synchronous version of this call.
17121  *
17122  * When the operation is finished, @callback will be called.
17123  * You can then call g_file_append_to_finish() to get the result
17124  * of the operation.
17125  */
17126
17127
17128 /**
17129  * g_file_append_to_finish:
17130  * @file: input #GFile
17131  * @res: #GAsyncResult
17132  * @error: a #GError, or %NULL
17133  *
17134  * Finishes an asynchronous file append operation started with
17135  * g_file_append_to_async().
17136  *
17137  * Returns: (transfer full): a valid #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17138  */
17139
17140
17141 /**
17142  * g_file_attribute_info_list_add:
17143  * @list: a #GFileAttributeInfoList.
17144  * @name: the name of the attribute to add.
17145  * @type: the #GFileAttributeType for the attribute.
17146  * @flags: #GFileAttributeInfoFlags for the attribute.
17147  *
17148  * Adds a new attribute with @name to the @list, setting
17149  * its @type and @flags.
17150  */
17151
17152
17153 /**
17154  * g_file_attribute_info_list_dup:
17155  * @list: a #GFileAttributeInfoList to duplicate.
17156  *
17157  * Makes a duplicate of a file attribute info list.
17158  *
17159  * Returns: a copy of the given @list.
17160  */
17161
17162
17163 /**
17164  * g_file_attribute_info_list_lookup:
17165  * @list: a #GFileAttributeInfoList.
17166  * @name: the name of the attribute to lookup.
17167  *
17168  * Gets the file attribute with the name @name from @list.
17169  *
17170  * Returns: a #GFileAttributeInfo for the @name, or %NULL if an attribute isn't found.
17171  */
17172
17173
17174 /**
17175  * g_file_attribute_info_list_new:
17176  *
17177  * Creates a new file attribute info list.
17178  *
17179  * Returns: a #GFileAttributeInfoList.
17180  */
17181
17182
17183 /**
17184  * g_file_attribute_info_list_ref:
17185  * @list: a #GFileAttributeInfoList to reference.
17186  *
17187  * References a file attribute info list.
17188  *
17189  * Returns: #GFileAttributeInfoList or %NULL on error.
17190  */
17191
17192
17193 /**
17194  * g_file_attribute_info_list_unref:
17195  * @list: The #GFileAttributeInfoList to unreference.
17196  *
17197  * Removes a reference from the given @list. If the reference count
17198  * falls to zero, the @list is deleted.
17199  */
17200
17201
17202 /**
17203  * g_file_attribute_matcher_enumerate_namespace:
17204  * @matcher: a #GFileAttributeMatcher.
17205  * @ns: a string containing a file attribute namespace.
17206  *
17207  * Checks if the matcher will match all of the keys in a given namespace.
17208  * This will always return %TRUE if a wildcard character is in use (e.g. if
17209  * matcher was created with "standard::*" and @ns is "standard", or if matcher was created
17210  * using "*" and namespace is anything.)
17211  *
17212  * TODO: this is awkwardly worded.
17213  *
17214  * Returns: %TRUE if the matcher matches all of the entries in the given @ns, %FALSE otherwise.
17215  */
17216
17217
17218 /**
17219  * g_file_attribute_matcher_enumerate_next:
17220  * @matcher: a #GFileAttributeMatcher.
17221  *
17222  * Gets the next matched attribute from a #GFileAttributeMatcher.
17223  *
17224  * Returns: a string containing the next attribute or %NULL if no more attribute exist.
17225  */
17226
17227
17228 /**
17229  * g_file_attribute_matcher_matches:
17230  * @matcher: a #GFileAttributeMatcher.
17231  * @attribute: a file attribute key.
17232  *
17233  * Checks if an attribute will be matched by an attribute matcher. If
17234  * the matcher was created with the "*" matching string, this function
17235  * will always return %TRUE.
17236  *
17237  * Returns: %TRUE if @attribute matches @matcher. %FALSE otherwise.
17238  */
17239
17240
17241 /**
17242  * g_file_attribute_matcher_matches_only:
17243  * @matcher: a #GFileAttributeMatcher.
17244  * @attribute: a file attribute key.
17245  *
17246  * Checks if a attribute matcher only matches a given attribute. Always
17247  * returns %FALSE if "*" was used when creating the matcher.
17248  *
17249  * Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
17250  */
17251
17252
17253 /**
17254  * g_file_attribute_matcher_new:
17255  * @attributes: an attribute string to match.
17256  *
17257  * Creates a new file attribute matcher, which matches attributes
17258  * against a given string. #GFileAttributeMatcher<!-- -->s are reference
17259  * counted structures, and are created with a reference count of 1. If
17260  * the number of references falls to 0, the #GFileAttributeMatcher is
17261  * automatically destroyed.
17262  *
17263  * The @attribute string should be formatted with specific keys separated
17264  * from namespaces with a double colon. Several "namespace::key" strings may be
17265  * concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
17266  * The wildcard "*" may be used to match all keys and namespaces, or
17267  * "namespace::*" will match all keys in a given namespace.
17268  *
17269  * Examples of strings to use:
17270  * <table>
17271  * <title>File Attribute Matcher strings and results</title>
17272  * <tgroup cols='2' align='left'><thead>
17273  * <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
17274  * <tbody>
17275  * <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
17276  * <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
17277  * <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
17278  * all keys in the unix namespace.</entry></row>
17279  * </tbody></tgroup>
17280  * </table>
17281  *
17282  * Returns: a #GFileAttributeMatcher.
17283  */
17284
17285
17286 /**
17287  * g_file_attribute_matcher_ref:
17288  * @matcher: a #GFileAttributeMatcher.
17289  *
17290  * References a file attribute matcher.
17291  *
17292  * Returns: a #GFileAttributeMatcher.
17293  */
17294
17295
17296 /**
17297  * g_file_attribute_matcher_subtract:
17298  * @matcher: Matcher to subtract from
17299  * @subtract: The matcher to subtract
17300  *
17301  * Subtracts all attributes of @subtract from @matcher and returns
17302  * a matcher that supports those attributes.
17303  *
17304  * Note that currently it is not possible to remove a single
17305  * attribute when the @matcher matches the whole namespace - or remove
17306  * a namespace or attribute when the matcher matches everything. This
17307  * is a limitation of the current implementation, but may be fixed
17308  * in the future.
17309  *
17310  * Returns: A file attribute matcher matching all attributes of @matcher that are not matched by @subtract
17311  */
17312
17313
17314 /**
17315  * g_file_attribute_matcher_to_string:
17316  * @matcher: (allow-none): a #GFileAttributeMatcher.
17317  *
17318  * Prints what the matcher is matching against. The format will be
17319  * equal to the format passed to g_file_attribute_matcher_new().
17320  * The output however, might not be identical, as the matcher may
17321  * decide to use a different order or omit needless parts.
17322  *
17323  * Returns: a string describing the attributes the matcher matches against or %NULL if @matcher was %NULL.
17324  * Since: 2.32
17325  */
17326
17327
17328 /**
17329  * g_file_attribute_matcher_unref:
17330  * @matcher: a #GFileAttributeMatcher.
17331  *
17332  * Unreferences @matcher. If the reference count falls below 1,
17333  * the @matcher is automatically freed.
17334  */
17335
17336
17337 /**
17338  * g_file_copy:
17339  * @source: input #GFile
17340  * @destination: destination #GFile
17341  * @flags: set of #GFileCopyFlags
17342  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17343  * @progress_callback: (allow-none) (scope call): function to callback with progress information, or %NULL if progress information is not needed
17344  * @progress_callback_data: (closure): user data to pass to @progress_callback
17345  * @error: #GError to set on error, or %NULL
17346  *
17347  * Copies the file @source to the location specified by @destination.
17348  * Can not handle recursive copies of directories.
17349  *
17350  * If the flag #G_FILE_COPY_OVERWRITE is specified an already
17351  * existing @destination file is overwritten.
17352  *
17353  * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
17354  * will be copied as symlinks, otherwise the target of the
17355  * @source symlink will be copied.
17356  *
17357  * If @cancellable is not %NULL, then the operation can be cancelled by
17358  * triggering the cancellable object from another thread. If the operation
17359  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17360  *
17361  * If @progress_callback is not %NULL, then the operation can be monitored
17362  * by setting this to a #GFileProgressCallback function.
17363  * @progress_callback_data will be passed to this function. It is guaranteed
17364  * that this callback will be called after all data has been transferred with
17365  * the total number of bytes copied during the operation.
17366  *
17367  * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND error
17368  * is returned, independent on the status of the @destination.
17369  *
17370  * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then
17371  * the error %G_IO_ERROR_EXISTS is returned.
17372  *
17373  * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
17374  * error is returned. If trying to overwrite a directory with a directory the
17375  * %G_IO_ERROR_WOULD_MERGE error is returned.
17376  *
17377  * If the source is a directory and the target does not exist, or
17378  * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
17379  * %G_IO_ERROR_WOULD_RECURSE error is returned.
17380  *
17381  * If you are interested in copying the #GFile object itself (not the on-disk
17382  * file), see g_file_dup().
17383  *
17384  * Returns: %TRUE on success, %FALSE otherwise.
17385  */
17386
17387
17388 /**
17389  * g_file_copy_async: (skip)
17390  * @source: input #GFile
17391  * @destination: destination #GFile
17392  * @flags: set of #GFileCopyFlags
17393  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17394  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17395  * @progress_callback: (allow-none): function to callback with progress information, or %NULL if progress information is not needed
17396  * @progress_callback_data: (closure): user data to pass to @progress_callback
17397  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17398  * @user_data: the data to pass to callback function
17399  *
17400  * Copies the file @source to the location specified by @destination
17401  * asynchronously. For details of the behaviour, see g_file_copy().
17402  *
17403  * If @progress_callback is not %NULL, then that function that will be called
17404  * just like in g_file_copy(), however the callback will run in the main loop,
17405  * not in the thread that is doing the I/O operation.
17406  *
17407  * When the operation is finished, @callback will be called. You can then call
17408  * g_file_copy_finish() to get the result of the operation.
17409  */
17410
17411
17412 /**
17413  * g_file_copy_attributes:
17414  * @source: a #GFile with attributes
17415  * @destination: a #GFile to copy attributes to
17416  * @flags: a set of #GFileCopyFlags
17417  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17418  * @error: a #GError, %NULL to ignore
17419  *
17420  * Copies the file attributes from @source to @destination.
17421  *
17422  * Normally only a subset of the file attributes are copied,
17423  * those that are copies in a normal file copy operation
17424  * (which for instance does not include e.g. owner). However
17425  * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
17426  * all the metadata that is possible to copy is copied. This
17427  * is useful when implementing move by copy + delete source.
17428  *
17429  * Returns: %TRUE if the attributes were copied successfully, %FALSE otherwise.
17430  */
17431
17432
17433 /**
17434  * g_file_copy_finish:
17435  * @file: input #GFile
17436  * @res: a #GAsyncResult
17437  * @error: a #GError, or %NULL
17438  *
17439  * Finishes copying the file started with g_file_copy_async().
17440  *
17441  * Returns: a %TRUE on success, %FALSE on error.
17442  */
17443
17444
17445 /**
17446  * g_file_create:
17447  * @file: input #GFile
17448  * @flags: a set of #GFileCreateFlags
17449  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17450  * @error: a #GError, or %NULL
17451  *
17452  * Creates a new file and returns an output stream for writing to it.
17453  * The file must not already exist.
17454  *
17455  * By default files created are generally readable by everyone,
17456  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17457  * will be made readable only to the current user, to the level
17458  * that is supported on the target filesystem.
17459  *
17460  * If @cancellable is not %NULL, then the operation can be cancelled
17461  * by triggering the cancellable object from another thread. If the
17462  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17463  * returned.
17464  *
17465  * If a file or directory with this name already exists the
17466  * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
17467  * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
17468  * error, and if the name is to long %G_IO_ERROR_FILENAME_TOO_LONG will
17469  * be returned. Other errors are possible too, and depend on what kind
17470  * of filesystem the file is on.
17471  *
17472  * Returns: (transfer full): a #GFileOutputStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
17473  */
17474
17475
17476 /**
17477  * g_file_create_async:
17478  * @file: input #GFile
17479  * @flags: a set of #GFileCreateFlags
17480  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17481  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17482  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17483  * @user_data: (closure): the data to pass to callback function
17484  *
17485  * Asynchronously creates a new file and returns an output stream
17486  * for writing to it. The file must not already exist.
17487  *
17488  * For more details, see g_file_create() which is
17489  * the synchronous version of this call.
17490  *
17491  * When the operation is finished, @callback will be called.
17492  * You can then call g_file_create_finish() to get the result
17493  * of the operation.
17494  */
17495
17496
17497 /**
17498  * g_file_create_finish:
17499  * @file: input #GFile
17500  * @res: a #GAsyncResult
17501  * @error: a #GError, or %NULL
17502  *
17503  * Finishes an asynchronous file create operation started with
17504  * g_file_create_async().
17505  *
17506  * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
17507  */
17508
17509
17510 /**
17511  * g_file_create_readwrite:
17512  * @file: a #GFile
17513  * @flags: a set of #GFileCreateFlags
17514  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17515  * @error: return location for a #GError, or %NULL
17516  *
17517  * Creates a new file and returns a stream for reading and
17518  * writing to it. The file must not already exist.
17519  *
17520  * By default files created are generally readable by everyone,
17521  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
17522  * will be made readable only to the current user, to the level
17523  * that is supported on the target filesystem.
17524  *
17525  * If @cancellable is not %NULL, then the operation can be cancelled
17526  * by triggering the cancellable object from another thread. If the
17527  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17528  * returned.
17529  *
17530  * If a file or directory with this name already exists, the
17531  * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
17532  * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
17533  * error, and if the name is too long, %G_IO_ERROR_FILENAME_TOO_LONG
17534  * will be returned. Other errors are possible too, and depend on what
17535  * kind of filesystem the file is on.
17536  *
17537  * Note that in many non-local file cases read and write streams are
17538  * not supported, so make sure you really need to do read and write
17539  * streaming, rather than just opening for reading or writing.
17540  *
17541  * Returns: (transfer full): a #GFileIOStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
17542  * Since: 2.22
17543  */
17544
17545
17546 /**
17547  * g_file_create_readwrite_async:
17548  * @file: input #GFile
17549  * @flags: a set of #GFileCreateFlags
17550  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17551  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17552  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17553  * @user_data: (closure): the data to pass to callback function
17554  *
17555  * Asynchronously creates a new file and returns a stream
17556  * for reading and writing to it. The file must not already exist.
17557  *
17558  * For more details, see g_file_create_readwrite() which is
17559  * the synchronous version of this call.
17560  *
17561  * When the operation is finished, @callback will be called.
17562  * You can then call g_file_create_readwrite_finish() to get
17563  * the result of the operation.
17564  *
17565  * Since: 2.22
17566  */
17567
17568
17569 /**
17570  * g_file_create_readwrite_finish:
17571  * @file: input #GFile
17572  * @res: a #GAsyncResult
17573  * @error: a #GError, or %NULL
17574  *
17575  * Finishes an asynchronous file create operation started with
17576  * g_file_create_readwrite_async().
17577  *
17578  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
17579  * Since: 2.22
17580  */
17581
17582
17583 /**
17584  * g_file_delete:
17585  * @file: input #GFile
17586  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17587  * @error: a #GError, or %NULL
17588  *
17589  * Deletes a file. If the @file is a directory, it will only be
17590  * deleted if it is empty. This has the same semantics as g_unlink().
17591  *
17592  * If @cancellable is not %NULL, then the operation can be cancelled by
17593  * triggering the cancellable object from another thread. If the operation
17594  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17595  *
17596  * Virtual: delete_file
17597  * Returns: %TRUE if the file was deleted. %FALSE otherwise.
17598  */
17599
17600
17601 /**
17602  * g_file_delete_async:
17603  * @file: input #GFile
17604  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17605  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17606  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17607  * @user_data: the data to pass to callback function
17608  *
17609  * Asynchronously delete a file. If the @file is a directory, it will
17610  * only be deleted if it is empty.  This has the same semantics as
17611  * g_unlink().
17612  *
17613  * Virtual: delete_file_async
17614  * Since: 2.34
17615  */
17616
17617
17618 /**
17619  * g_file_delete_finish:
17620  * @file: input #GFile
17621  * @res: a #GAsyncResult
17622  * @error: a #GError, or %NULL
17623  *
17624  * Finishes deleting a file started with g_file_delete_async().
17625  *
17626  * Virtual: delete_file_finish
17627  * Since: 2.34
17628  */
17629
17630
17631 /**
17632  * g_file_descriptor_based_get_fd:
17633  * @fd_based: a #GFileDescriptorBased.
17634  *
17635  * Gets the underlying file descriptor.
17636  *
17637  * Returns: The file descriptor
17638  * Since: 2.24
17639  */
17640
17641
17642 /**
17643  * g_file_dup:
17644  * @file: input #GFile
17645  *
17646  * Duplicates a #GFile handle. This operation does not duplicate
17647  * the actual file or directory represented by the #GFile; see
17648  * g_file_copy() if attempting to copy a file.
17649  *
17650  * This call does no blocking I/O.
17651  *
17652  * Returns: (transfer full): a new #GFile that is a duplicate of the given #GFile.
17653  */
17654
17655
17656 /**
17657  * g_file_eject_mountable:
17658  * @file: input #GFile
17659  * @flags: flags affecting the operation
17660  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17661  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
17662  * @user_data: (closure): the data to pass to callback function
17663  *
17664  * Starts an asynchronous eject on a mountable.
17665  * When this operation has completed, @callback will be called with
17666  * @user_user data, and the operation can be finalized with
17667  * g_file_eject_mountable_finish().
17668  *
17669  * If @cancellable is not %NULL, then the operation can be cancelled by
17670  * triggering the cancellable object from another thread. If the operation
17671  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17672  *
17673  * Deprecated: 2.22: Use g_file_eject_mountable_with_operation() instead.
17674  */
17675
17676
17677 /**
17678  * g_file_eject_mountable_finish:
17679  * @file: input #GFile
17680  * @result: a #GAsyncResult
17681  * @error: a #GError, or %NULL
17682  *
17683  * Finishes an asynchronous eject operation started by
17684  * g_file_eject_mountable().
17685  *
17686  * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17687  * Deprecated: 2.22: Use g_file_eject_mountable_with_operation_finish() instead.
17688  */
17689
17690
17691 /**
17692  * g_file_eject_mountable_with_operation:
17693  * @file: input #GFile
17694  * @flags: flags affecting the operation
17695  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
17696  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17697  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
17698  * @user_data: (closure): the data to pass to callback function
17699  *
17700  * Starts an asynchronous eject on a mountable.
17701  * When this operation has completed, @callback will be called with
17702  * @user_user data, and the operation can be finalized with
17703  * g_file_eject_mountable_with_operation_finish().
17704  *
17705  * If @cancellable is not %NULL, then the operation can be cancelled by
17706  * triggering the cancellable object from another thread. If the operation
17707  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17708  *
17709  * Since: 2.22
17710  */
17711
17712
17713 /**
17714  * g_file_eject_mountable_with_operation_finish:
17715  * @file: input #GFile
17716  * @result: a #GAsyncResult
17717  * @error: a #GError, or %NULL
17718  *
17719  * Finishes an asynchronous eject operation started by
17720  * g_file_eject_mountable_with_operation().
17721  *
17722  * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17723  * Since: 2.22
17724  */
17725
17726
17727 /**
17728  * g_file_enumerate_children:
17729  * @file: input #GFile
17730  * @attributes: an attribute query string
17731  * @flags: a set of #GFileQueryInfoFlags
17732  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17733  * @error: #GError for error reporting
17734  *
17735  * Gets the requested information about the files in a directory.
17736  * The result is a #GFileEnumerator object that will give out
17737  * #GFileInfo objects for all the files in the directory.
17738  *
17739  * The @attributes value is a string that specifies the file
17740  * attributes that should be gathered. It is not an error if
17741  * it's not possible to read a particular requested attribute
17742  * from a file - it just won't be set. @attributes should
17743  * be a comma-separated list of attributes or attribute wildcards.
17744  * The wildcard "*" means all attributes, and a wildcard like
17745  * "standard::*" means all attributes in the standard namespace.
17746  * An example attribute query be "standard::*,owner::user".
17747  * The standard attributes are available as defines, like
17748  * #G_FILE_ATTRIBUTE_STANDARD_NAME.
17749  *
17750  * If @cancellable is not %NULL, then the operation can be cancelled
17751  * by triggering the cancellable object from another thread. If the
17752  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17753  * returned.
17754  *
17755  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
17756  * be returned. If the file is not a directory, the %G_FILE_ERROR_NOTDIR
17757  * error will be returned. Other errors are possible too.
17758  *
17759  * Returns: (transfer full): A #GFileEnumerator if successful, %NULL on error. Free the returned object with g_object_unref().
17760  */
17761
17762
17763 /**
17764  * g_file_enumerate_children_async:
17765  * @file: input #GFile
17766  * @attributes: an attribute query string
17767  * @flags: a set of #GFileQueryInfoFlags
17768  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17769  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17770  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17771  * @user_data: (closure): the data to pass to callback function
17772  *
17773  * Asynchronously gets the requested information about the files
17774  * in a directory. The result is a #GFileEnumerator object that will
17775  * give out #GFileInfo objects for all the files in the directory.
17776  *
17777  * For more details, see g_file_enumerate_children() which is
17778  * the synchronous version of this call.
17779  *
17780  * When the operation is finished, @callback will be called. You can
17781  * then call g_file_enumerate_children_finish() to get the result of
17782  * the operation.
17783  */
17784
17785
17786 /**
17787  * g_file_enumerate_children_finish:
17788  * @file: input #GFile
17789  * @res: a #GAsyncResult
17790  * @error: a #GError
17791  *
17792  * Finishes an async enumerate children operation.
17793  * See g_file_enumerate_children_async().
17794  *
17795  * Returns: (transfer full): a #GFileEnumerator or %NULL if an error occurred. Free the returned object with g_object_unref().
17796  */
17797
17798
17799 /**
17800  * g_file_enumerator_close:
17801  * @enumerator: a #GFileEnumerator.
17802  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17803  * @error: location to store the error occurring, or %NULL to ignore
17804  *
17805  * Releases all resources used by this enumerator, making the
17806  * enumerator return %G_IO_ERROR_CLOSED on all calls.
17807  *
17808  * This will be automatically called when the last reference
17809  * is dropped, but you might want to call this function to make
17810  * sure resources are released as early as possible.
17811  *
17812  * Returns: #TRUE on success or #FALSE on error.
17813  */
17814
17815
17816 /**
17817  * g_file_enumerator_close_async:
17818  * @enumerator: a #GFileEnumerator.
17819  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17820  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17821  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17822  * @user_data: (closure): the data to pass to callback function
17823  *
17824  * Asynchronously closes the file enumerator.
17825  *
17826  * If @cancellable is not %NULL, then the operation can be cancelled by
17827  * triggering the cancellable object from another thread. If the operation
17828  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
17829  * g_file_enumerator_close_finish().
17830  */
17831
17832
17833 /**
17834  * g_file_enumerator_close_finish:
17835  * @enumerator: a #GFileEnumerator.
17836  * @result: a #GAsyncResult.
17837  * @error: a #GError location to store the error occurring, or %NULL to ignore.
17838  *
17839  * Finishes closing a file enumerator, started from g_file_enumerator_close_async().
17840  *
17841  * If the file enumerator was already closed when g_file_enumerator_close_async()
17842  * was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
17843  * return %FALSE. If the file enumerator had pending operation when the close
17844  * operation was started, then this function will report %G_IO_ERROR_PENDING, and
17845  * return %FALSE.  If @cancellable was not %NULL, then the operation may have been
17846  * cancelled by triggering the cancellable object from another thread. If the operation
17847  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
17848  * returned.
17849  *
17850  * Returns: %TRUE if the close operation has finished successfully.
17851  */
17852
17853
17854 /**
17855  * g_file_enumerator_get_container:
17856  * @enumerator: a #GFileEnumerator
17857  *
17858  * Get the #GFile container which is being enumerated.
17859  *
17860  * Returns: (transfer none): the #GFile which is being enumerated.
17861  * Since: 2.18
17862  */
17863
17864
17865 /**
17866  * g_file_enumerator_has_pending:
17867  * @enumerator: a #GFileEnumerator.
17868  *
17869  * Checks if the file enumerator has pending operations.
17870  *
17871  * Returns: %TRUE if the @enumerator has pending operations.
17872  */
17873
17874
17875 /**
17876  * g_file_enumerator_is_closed:
17877  * @enumerator: a #GFileEnumerator.
17878  *
17879  * Checks if the file enumerator has been closed.
17880  *
17881  * Returns: %TRUE if the @enumerator is closed.
17882  */
17883
17884
17885 /**
17886  * g_file_enumerator_next_file:
17887  * @enumerator: a #GFileEnumerator.
17888  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17889  * @error: location to store the error occurring, or %NULL to ignore
17890  *
17891  * Returns information for the next file in the enumerated object.
17892  * Will block until the information is available. The #GFileInfo
17893  * returned from this function will contain attributes that match the
17894  * attribute string that was passed when the #GFileEnumerator was created.
17895  *
17896  * On error, returns %NULL and sets @error to the error. If the
17897  * enumerator is at the end, %NULL will be returned and @error will
17898  * be unset.
17899  *
17900  * 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.
17901  */
17902
17903
17904 /**
17905  * g_file_enumerator_next_files_async:
17906  * @enumerator: a #GFileEnumerator.
17907  * @num_files: the number of file info objects to request
17908  * @io_priority: the <link linkend="gioscheduler">io priority</link> of the request.
17909  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17910  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17911  * @user_data: (closure): the data to pass to callback function
17912  *
17913  * Request information for a number of files from the enumerator asynchronously.
17914  * When all i/o for the operation is finished the @callback will be called with
17915  * the requested information.
17916  *
17917  * The callback can be called with less than @num_files files in case of error
17918  * or at the end of the enumerator. In case of a partial error the callback will
17919  * be called with any succeeding items and no error, and on the next request the
17920  * error will be reported. If a request is cancelled the callback will be called
17921  * with %G_IO_ERROR_CANCELLED.
17922  *
17923  * During an async request no other sync and async calls are allowed, and will
17924  * result in %G_IO_ERROR_PENDING errors.
17925  *
17926  * Any outstanding i/o request with higher priority (lower numerical value) will
17927  * be executed before an outstanding request with lower priority. Default
17928  * priority is %G_PRIORITY_DEFAULT.
17929  */
17930
17931
17932 /**
17933  * g_file_enumerator_next_files_finish:
17934  * @enumerator: a #GFileEnumerator.
17935  * @result: a #GAsyncResult.
17936  * @error: a #GError location to store the error occurring, or %NULL to ignore.
17937  *
17938  * Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
17939  *
17940  * 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.
17941  */
17942
17943
17944 /**
17945  * g_file_enumerator_set_pending:
17946  * @enumerator: a #GFileEnumerator.
17947  * @pending: a boolean value.
17948  *
17949  * Sets the file enumerator as having pending operations.
17950  */
17951
17952
17953 /**
17954  * g_file_equal:
17955  * @file1: the first #GFile
17956  * @file2: the second #GFile
17957  *
17958  * Checks equality of two given #GFiles.
17959  *
17960  * Note that two #GFiles that differ can still refer to the same
17961  * file on the filesystem due to various forms of filename
17962  * aliasing.
17963  *
17964  * This call does no blocking I/O.
17965  *
17966  * Returns: %TRUE if @file1 and @file2 are equal. %FALSE if either is not a #GFile.
17967  */
17968
17969
17970 /**
17971  * g_file_find_enclosing_mount:
17972  * @file: input #GFile
17973  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17974  * @error: a #GError
17975  *
17976  * Gets a #GMount for the #GFile.
17977  *
17978  * If the #GFileIface for @file does not have a mount (e.g.
17979  * possibly a remote share), @error will be set to %G_IO_ERROR_NOT_FOUND
17980  * and %NULL will be returned.
17981  *
17982  * If @cancellable is not %NULL, then the operation can be cancelled by
17983  * triggering the cancellable object from another thread. If the operation
17984  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17985  *
17986  * Returns: (transfer full): a #GMount where the @file is located or %NULL on error. Free the returned object with g_object_unref().
17987  */
17988
17989
17990 /**
17991  * g_file_find_enclosing_mount_async:
17992  * @file: a #GFile
17993  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17994  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17995  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17996  * @user_data: (closure): the data to pass to callback function
17997  *
17998  * Asynchronously gets the mount for the file.
17999  *
18000  * For more details, see g_file_find_enclosing_mount() which is
18001  * the synchronous version of this call.
18002  *
18003  * When the operation is finished, @callback will be called.
18004  * You can then call g_file_find_enclosing_mount_finish() to
18005  * get the result of the operation.
18006  */
18007
18008
18009 /**
18010  * g_file_find_enclosing_mount_finish:
18011  * @file: a #GFile
18012  * @res: a #GAsyncResult
18013  * @error: a #GError
18014  *
18015  * Finishes an asynchronous find mount request.
18016  * See g_file_find_enclosing_mount_async().
18017  *
18018  * Returns: (transfer full): #GMount for given @file or %NULL on error. Free the returned object with g_object_unref().
18019  */
18020
18021
18022 /**
18023  * g_file_get_basename:
18024  * @file: input #GFile
18025  *
18026  * Gets the base name (the last component of the path) for a given #GFile.
18027  *
18028  * If called for the top level of a system (such as the filesystem root
18029  * or a uri like sftp://host/) it will return a single directory separator
18030  * (and on Windows, possibly a drive letter).
18031  *
18032  * The base name is a byte string (not UTF-8). It has no defined encoding
18033  * or rules other than it may not contain zero bytes.  If you want to use
18034  * filenames in a user interface you should use the display name that you
18035  * can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
18036  * attribute with g_file_query_info().
18037  *
18038  * This call does no blocking I/O.
18039  *
18040  * 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.
18041  */
18042
18043
18044 /**
18045  * g_file_get_child:
18046  * @file: input #GFile
18047  * @name: string containing the child's basename
18048  *
18049  * Gets a child of @file with basename equal to @name.
18050  *
18051  * Note that the file with that specific name might not exist, but
18052  * you can still have a #GFile that points to it. You can use this
18053  * for instance to create that file.
18054  *
18055  * This call does no blocking I/O.
18056  *
18057  * Returns: (transfer full): a #GFile to a child specified by @name. Free the returned object with g_object_unref().
18058  */
18059
18060
18061 /**
18062  * g_file_get_child_for_display_name:
18063  * @file: input #GFile
18064  * @display_name: string to a possible child
18065  * @error: return location for an error
18066  *
18067  * Gets the child of @file for a given @display_name (i.e. a UTF-8
18068  * version of the name). If this function fails, it returns %NULL
18069  * and @error will be set. This is very useful when constructing a
18070  * #GFile for a new file and the user entered the filename in the
18071  * user interface, for instance when you select a directory and
18072  * type a filename in the file selector.
18073  *
18074  * This call does no blocking I/O.
18075  *
18076  * 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().
18077  */
18078
18079
18080 /**
18081  * g_file_get_parent:
18082  * @file: input #GFile
18083  *
18084  * Gets the parent directory for the @file.
18085  * If the @file represents the root directory of the
18086  * file system, then %NULL will be returned.
18087  *
18088  * This call does no blocking I/O.
18089  *
18090  * 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().
18091  */
18092
18093
18094 /**
18095  * g_file_get_parse_name:
18096  * @file: input #GFile
18097  *
18098  * Gets the parse name of the @file.
18099  * A parse name is a UTF-8 string that describes the
18100  * file such that one can get the #GFile back using
18101  * g_file_parse_name().
18102  *
18103  * This is generally used to show the #GFile as a nice
18104  * full-pathname kind of string in a user interface,
18105  * like in a location entry.
18106  *
18107  * For local files with names that can safely be converted
18108  * to UTF-8 the pathname is used, otherwise the IRI is used
18109  * (a form of URI that allows UTF-8 characters unescaped).
18110  *
18111  * This call does no blocking I/O.
18112  *
18113  * Returns: a string containing the #GFile's parse name. The returned string should be freed with g_free() when no longer needed.
18114  */
18115
18116
18117 /**
18118  * g_file_get_path:
18119  * @file: input #GFile
18120  *
18121  * Gets the local pathname for #GFile, if one exists.
18122  *
18123  * This call does no blocking I/O.
18124  *
18125  * 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.
18126  */
18127
18128
18129 /**
18130  * g_file_get_relative_path:
18131  * @parent: input #GFile
18132  * @descendant: input #GFile
18133  *
18134  * Gets the path for @descendant relative to @parent.
18135  *
18136  * This call does no blocking I/O.
18137  *
18138  * 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.
18139  */
18140
18141
18142 /**
18143  * g_file_get_uri:
18144  * @file: input #GFile
18145  *
18146  * Gets the URI for the @file.
18147  *
18148  * This call does no blocking I/O.
18149  *
18150  * Returns: a string containing the #GFile's URI. The returned string should be freed with g_free() when no longer needed.
18151  */
18152
18153
18154 /**
18155  * g_file_get_uri_scheme:
18156  * @file: input #GFile
18157  *
18158  * Gets the URI scheme for a #GFile.
18159  * RFC 3986 decodes the scheme as:
18160  * <programlisting>
18161  * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
18162  * </programlisting>
18163  * Common schemes include "file", "http", "ftp", etc.
18164  *
18165  * This call does no blocking I/O.
18166  *
18167  * Returns: a string containing the URI scheme for the given #GFile. The returned string should be freed with g_free() when no longer needed.
18168  */
18169
18170
18171 /**
18172  * g_file_has_parent:
18173  * @file: input #GFile
18174  * @parent: (allow-none): the parent to check for, or %NULL
18175  *
18176  * Checks if @file has a parent, and optionally, if it is @parent.
18177  *
18178  * If @parent is %NULL then this function returns %TRUE if @file has any
18179  * parent at all.  If @parent is non-%NULL then %TRUE is only returned
18180  * if @file is a child of @parent.
18181  *
18182  * Returns: %TRUE if @file is a child of @parent (or any parent in the case that @parent is %NULL).
18183  * Since: 2.24
18184  */
18185
18186
18187 /**
18188  * g_file_has_prefix:
18189  * @file: input #GFile
18190  * @prefix: input #GFile
18191  *
18192  * Checks whether @file has the prefix specified by @prefix.
18193  *
18194  * In other words, if the names of initial elements of @file's
18195  * pathname match @prefix. Only full pathname elements are matched,
18196  * so a path like /foo is not considered a prefix of /foobar, only
18197  * of /foo/bar.
18198  *
18199  * This call does no I/O, as it works purely on names. As such it can
18200  * sometimes return %FALSE even if @file is inside a @prefix (from a
18201  * filesystem point of view), because the prefix of @file is an alias
18202  * of @prefix.
18203  *
18204  * Virtual: prefix_matches
18205  * Returns: %TRUE if the @files's parent, grandparent, etc is @prefix, %FALSE otherwise.
18206  */
18207
18208
18209 /**
18210  * g_file_has_uri_scheme:
18211  * @file: input #GFile
18212  * @uri_scheme: a string containing a URI scheme
18213  *
18214  * Checks to see if a #GFile has a given URI scheme.
18215  *
18216  * This call does no blocking I/O.
18217  *
18218  * Returns: %TRUE if #GFile's backend supports the given URI scheme, %FALSE if URI scheme is %NULL, not supported, or #GFile is invalid.
18219  */
18220
18221
18222 /**
18223  * g_file_hash:
18224  * @file: (type GFile): #gconstpointer to a #GFile
18225  *
18226  * Creates a hash value for a #GFile.
18227  *
18228  * This call does no blocking I/O.
18229  *
18230  * Virtual: hash
18231  * 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.
18232  */
18233
18234
18235 /**
18236  * g_file_icon_get_file:
18237  * @icon: a #GIcon.
18238  *
18239  * Gets the #GFile associated with the given @icon.
18240  *
18241  * Returns: (transfer none): a #GFile, or %NULL.
18242  */
18243
18244
18245 /**
18246  * g_file_icon_new:
18247  * @file: a #GFile.
18248  *
18249  * Creates a new icon for a file.
18250  *
18251  * Returns: (transfer full) (type GFileIcon): a #GIcon for the given @file, or %NULL on error.
18252  */
18253
18254
18255 /**
18256  * g_file_info_clear_status:
18257  * @info: a #GFileInfo.
18258  *
18259  * Clears the status information from @info.
18260  */
18261
18262
18263 /**
18264  * g_file_info_copy_into:
18265  * @src_info: source to copy attributes from.
18266  * @dest_info: destination to copy attributes to.
18267  *
18268  * Copies all of the <link linkend="gio-GFileAttribute">GFileAttribute</link>s
18269  * from @src_info to @dest_info.
18270  */
18271
18272
18273 /**
18274  * g_file_info_dup:
18275  * @other: a #GFileInfo.
18276  *
18277  * Duplicates a file info structure.
18278  *
18279  * Returns: (transfer full): a duplicate #GFileInfo of @other.
18280  */
18281
18282
18283 /**
18284  * g_file_info_get_attribute_as_string:
18285  * @info: a #GFileInfo.
18286  * @attribute: a file attribute key.
18287  *
18288  * Gets the value of a attribute, formated as a string.
18289  * This escapes things as needed to make the string valid
18290  * utf8.
18291  *
18292  * Returns: a UTF-8 string associated with the given @attribute. When you're done with the string it must be freed with g_free().
18293  */
18294
18295
18296 /**
18297  * g_file_info_get_attribute_boolean:
18298  * @info: a #GFileInfo.
18299  * @attribute: a file attribute key.
18300  *
18301  * Gets the value of a boolean attribute. If the attribute does not
18302  * contain a boolean value, %FALSE will be returned.
18303  *
18304  * Returns: the boolean value contained within the attribute.
18305  */
18306
18307
18308 /**
18309  * g_file_info_get_attribute_byte_string:
18310  * @info: a #GFileInfo.
18311  * @attribute: a file attribute key.
18312  *
18313  * Gets the value of a byte string attribute. If the attribute does
18314  * not contain a byte string, %NULL will be returned.
18315  *
18316  * Returns: the contents of the @attribute value as a byte string, or %NULL otherwise.
18317  */
18318
18319
18320 /**
18321  * g_file_info_get_attribute_data:
18322  * @info: a #GFileInfo
18323  * @attribute: a file attribute key
18324  * @type: (out) (allow-none): return location for the attribute type, or %NULL
18325  * @value_pp: (out) (allow-none): return location for the attribute value, or %NULL
18326  * @status: (out) (allow-none): return location for the attribute status, or %NULL
18327  *
18328  * Gets the attribute type, value and status for an attribute key.
18329  *
18330  * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
18331  */
18332
18333
18334 /**
18335  * g_file_info_get_attribute_int32:
18336  * @info: a #GFileInfo.
18337  * @attribute: a file attribute key.
18338  *
18339  * Gets a signed 32-bit integer contained within the attribute. If the
18340  * attribute does not contain a signed 32-bit integer, or is invalid,
18341  * 0 will be returned.
18342  *
18343  * Returns: a signed 32-bit integer from the attribute.
18344  */
18345
18346
18347 /**
18348  * g_file_info_get_attribute_int64:
18349  * @info: a #GFileInfo.
18350  * @attribute: a file attribute key.
18351  *
18352  * Gets a signed 64-bit integer contained within the attribute. If the
18353  * attribute does not contain an signed 64-bit integer, or is invalid,
18354  * 0 will be returned.
18355  *
18356  * Returns: a signed 64-bit integer from the attribute.
18357  */
18358
18359
18360 /**
18361  * g_file_info_get_attribute_object:
18362  * @info: a #GFileInfo.
18363  * @attribute: a file attribute key.
18364  *
18365  * Gets the value of a #GObject attribute. If the attribute does
18366  * not contain a #GObject, %NULL will be returned.
18367  *
18368  * Returns: (transfer none): a #GObject associated with the given @attribute, or %NULL otherwise.
18369  */
18370
18371
18372 /**
18373  * g_file_info_get_attribute_status:
18374  * @info: a #GFileInfo
18375  * @attribute: a file attribute key
18376  *
18377  * Gets the attribute status for an attribute key.
18378  *
18379  * Returns: a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
18380  */
18381
18382
18383 /**
18384  * g_file_info_get_attribute_string:
18385  * @info: a #GFileInfo.
18386  * @attribute: a file attribute key.
18387  *
18388  * Gets the value of a string attribute. If the attribute does
18389  * not contain a string, %NULL will be returned.
18390  *
18391  * Returns: the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
18392  */
18393
18394
18395 /**
18396  * g_file_info_get_attribute_stringv:
18397  * @info: a #GFileInfo.
18398  * @attribute: a file attribute key.
18399  *
18400  * Gets the value of a stringv attribute. If the attribute does
18401  * not contain a stringv, %NULL will be returned.
18402  *
18403  * Returns: (transfer none): the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
18404  * Since: 2.22
18405  */
18406
18407
18408 /**
18409  * g_file_info_get_attribute_type:
18410  * @info: a #GFileInfo.
18411  * @attribute: a file attribute key.
18412  *
18413  * Gets the attribute type for an attribute key.
18414  *
18415  * Returns: a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
18416  */
18417
18418
18419 /**
18420  * g_file_info_get_attribute_uint32:
18421  * @info: a #GFileInfo.
18422  * @attribute: a file attribute key.
18423  *
18424  * Gets an unsigned 32-bit integer contained within the attribute. If the
18425  * attribute does not contain an unsigned 32-bit integer, or is invalid,
18426  * 0 will be returned.
18427  *
18428  * Returns: an unsigned 32-bit integer from the attribute.
18429  */
18430
18431
18432 /**
18433  * g_file_info_get_attribute_uint64:
18434  * @info: a #GFileInfo.
18435  * @attribute: a file attribute key.
18436  *
18437  * Gets a unsigned 64-bit integer contained within the attribute. If the
18438  * attribute does not contain an unsigned 64-bit integer, or is invalid,
18439  * 0 will be returned.
18440  *
18441  * Returns: a unsigned 64-bit integer from the attribute.
18442  */
18443
18444
18445 /**
18446  * g_file_info_get_content_type:
18447  * @info: a #GFileInfo.
18448  *
18449  * Gets the file's content type.
18450  *
18451  * Returns: a string containing the file's content type.
18452  */
18453
18454
18455 /**
18456  * g_file_info_get_display_name:
18457  * @info: a #GFileInfo.
18458  *
18459  * Gets a display name for a file.
18460  *
18461  * Returns: a string containing the display name.
18462  */
18463
18464
18465 /**
18466  * g_file_info_get_edit_name:
18467  * @info: a #GFileInfo.
18468  *
18469  * Gets the edit name for a file.
18470  *
18471  * Returns: a string containing the edit name.
18472  */
18473
18474
18475 /**
18476  * g_file_info_get_etag:
18477  * @info: a #GFileInfo.
18478  *
18479  * Gets the <link linkend="gfile-etag">entity tag</link> for a given
18480  * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
18481  *
18482  * Returns: a string containing the value of the "etag:value" attribute.
18483  */
18484
18485
18486 /**
18487  * g_file_info_get_file_type:
18488  * @info: a #GFileInfo.
18489  *
18490  * Gets a file's type (whether it is a regular file, symlink, etc).
18491  * This is different from the file's content type, see g_file_info_get_content_type().
18492  *
18493  * Returns: a #GFileType for the given file.
18494  */
18495
18496
18497 /**
18498  * g_file_info_get_icon:
18499  * @info: a #GFileInfo.
18500  *
18501  * Gets the icon for a file.
18502  *
18503  * Returns: (transfer none): #GIcon for the given @info.
18504  */
18505
18506
18507 /**
18508  * g_file_info_get_is_backup:
18509  * @info: a #GFileInfo.
18510  *
18511  * Checks if a file is a backup file.
18512  *
18513  * Returns: %TRUE if file is a backup file, %FALSE otherwise.
18514  */
18515
18516
18517 /**
18518  * g_file_info_get_is_hidden:
18519  * @info: a #GFileInfo.
18520  *
18521  * Checks if a file is hidden.
18522  *
18523  * Returns: %TRUE if the file is a hidden file, %FALSE otherwise.
18524  */
18525
18526
18527 /**
18528  * g_file_info_get_is_symlink:
18529  * @info: a #GFileInfo.
18530  *
18531  * Checks if a file is a symlink.
18532  *
18533  * Returns: %TRUE if the given @info is a symlink.
18534  */
18535
18536
18537 /**
18538  * g_file_info_get_modification_time:
18539  * @info: a #GFileInfo.
18540  * @result: (out caller-allocates): a #GTimeVal.
18541  *
18542  * Gets the modification time of the current @info and sets it
18543  * in @result.
18544  */
18545
18546
18547 /**
18548  * g_file_info_get_name:
18549  * @info: a #GFileInfo.
18550  *
18551  * Gets the name for a file.
18552  *
18553  * Returns: a string containing the file name.
18554  */
18555
18556
18557 /**
18558  * g_file_info_get_size:
18559  * @info: a #GFileInfo.
18560  *
18561  * Gets the file's size.
18562  *
18563  * Returns: a #goffset containing the file's size.
18564  */
18565
18566
18567 /**
18568  * g_file_info_get_sort_order:
18569  * @info: a #GFileInfo.
18570  *
18571  * Gets the value of the sort_order attribute from the #GFileInfo.
18572  * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18573  *
18574  * Returns: a #gint32 containing the value of the "standard::sort_order" attribute.
18575  */
18576
18577
18578 /**
18579  * g_file_info_get_symbolic_icon:
18580  * @info: a #GFileInfo.
18581  *
18582  * Gets the symbolic icon for a file.
18583  *
18584  * Returns: (transfer none): #GIcon for the given @info.
18585  * Since: 2.34
18586  */
18587
18588
18589 /**
18590  * g_file_info_get_symlink_target:
18591  * @info: a #GFileInfo.
18592  *
18593  * Gets the symlink target for a given #GFileInfo.
18594  *
18595  * Returns: a string containing the symlink target.
18596  */
18597
18598
18599 /**
18600  * g_file_info_has_attribute:
18601  * @info: a #GFileInfo.
18602  * @attribute: a file attribute key.
18603  *
18604  * Checks if a file info structure has an attribute named @attribute.
18605  *
18606  * Returns: %TRUE if @Ginfo has an attribute named @attribute, %FALSE otherwise.
18607  */
18608
18609
18610 /**
18611  * g_file_info_has_namespace:
18612  * @info: a #GFileInfo.
18613  * @name_space: a file attribute namespace.
18614  *
18615  * Checks if a file info structure has an attribute in the
18616  * specified @name_space.
18617  *
18618  * Returns: %TRUE if @Ginfo has an attribute in @name_space, %FALSE otherwise.
18619  * Since: 2.22
18620  */
18621
18622
18623 /**
18624  * g_file_info_list_attributes:
18625  * @info: a #GFileInfo.
18626  * @name_space: a file attribute key's namespace.
18627  *
18628  * Lists the file info structure's attributes.
18629  *
18630  * 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.
18631  */
18632
18633
18634 /**
18635  * g_file_info_new:
18636  *
18637  * Creates a new file info structure.
18638  *
18639  * Returns: a #GFileInfo.
18640  */
18641
18642
18643 /**
18644  * g_file_info_remove_attribute:
18645  * @info: a #GFileInfo.
18646  * @attribute: a file attribute key.
18647  *
18648  * Removes all cases of @attribute from @info if it exists.
18649  */
18650
18651
18652 /**
18653  * g_file_info_set_attribute:
18654  * @info: a #GFileInfo.
18655  * @attribute: a file attribute key.
18656  * @type: a #GFileAttributeType
18657  * @value_p: pointer to the value
18658  *
18659  * Sets the @attribute to contain the given value, if possible. To unset the
18660  * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
18661  */
18662
18663
18664 /**
18665  * g_file_info_set_attribute_boolean:
18666  * @info: a #GFileInfo.
18667  * @attribute: a file attribute key.
18668  * @attr_value: a boolean value.
18669  *
18670  * Sets the @attribute to contain the given @attr_value,
18671  * if possible.
18672  */
18673
18674
18675 /**
18676  * g_file_info_set_attribute_byte_string:
18677  * @info: a #GFileInfo.
18678  * @attribute: a file attribute key.
18679  * @attr_value: a byte string.
18680  *
18681  * Sets the @attribute to contain the given @attr_value,
18682  * if possible.
18683  */
18684
18685
18686 /**
18687  * g_file_info_set_attribute_int32:
18688  * @info: a #GFileInfo.
18689  * @attribute: a file attribute key.
18690  * @attr_value: a signed 32-bit integer
18691  *
18692  * Sets the @attribute to contain the given @attr_value,
18693  * if possible.
18694  */
18695
18696
18697 /**
18698  * g_file_info_set_attribute_int64:
18699  * @info: a #GFileInfo.
18700  * @attribute: attribute name to set.
18701  * @attr_value: int64 value to set attribute to.
18702  *
18703  * Sets the @attribute to contain the given @attr_value,
18704  * if possible.
18705  */
18706
18707
18708 /**
18709  * g_file_info_set_attribute_mask:
18710  * @info: a #GFileInfo.
18711  * @mask: a #GFileAttributeMatcher.
18712  *
18713  * Sets @mask on @info to match specific attribute types.
18714  */
18715
18716
18717 /**
18718  * g_file_info_set_attribute_object:
18719  * @info: a #GFileInfo.
18720  * @attribute: a file attribute key.
18721  * @attr_value: a #GObject.
18722  *
18723  * Sets the @attribute to contain the given @attr_value,
18724  * if possible.
18725  */
18726
18727
18728 /**
18729  * g_file_info_set_attribute_status:
18730  * @info: a #GFileInfo
18731  * @attribute: a file attribute key
18732  * @status: a #GFileAttributeStatus
18733  *
18734  * Sets the attribute status for an attribute key. This is only
18735  * needed by external code that implement g_file_set_attributes_from_info()
18736  * or similar functions.
18737  *
18738  * The attribute must exist in @info for this to work. Otherwise %FALSE
18739  * is returned and @info is unchanged.
18740  *
18741  * Returns: %TRUE if the status was changed, %FALSE if the key was not set.
18742  * Since: 2.22
18743  */
18744
18745
18746 /**
18747  * g_file_info_set_attribute_string:
18748  * @info: a #GFileInfo.
18749  * @attribute: a file attribute key.
18750  * @attr_value: a UTF-8 string.
18751  *
18752  * Sets the @attribute to contain the given @attr_value,
18753  * if possible.
18754  */
18755
18756
18757 /**
18758  * g_file_info_set_attribute_stringv:
18759  * @info: a #GFileInfo.
18760  * @attribute: a file attribute key
18761  * @attr_value: (array) (element-type utf8): a %NULL terminated array of UTF-8 strings.
18762  *
18763  * Sets the @attribute to contain the given @attr_value,
18764  * if possible.
18765  *
18766  * Sinze: 2.22
18767  */
18768
18769
18770 /**
18771  * g_file_info_set_attribute_uint32:
18772  * @info: a #GFileInfo.
18773  * @attribute: a file attribute key.
18774  * @attr_value: an unsigned 32-bit integer.
18775  *
18776  * Sets the @attribute to contain the given @attr_value,
18777  * if possible.
18778  */
18779
18780
18781 /**
18782  * g_file_info_set_attribute_uint64:
18783  * @info: a #GFileInfo.
18784  * @attribute: a file attribute key.
18785  * @attr_value: an unsigned 64-bit integer.
18786  *
18787  * Sets the @attribute to contain the given @attr_value,
18788  * if possible.
18789  */
18790
18791
18792 /**
18793  * g_file_info_set_content_type:
18794  * @info: a #GFileInfo.
18795  * @content_type: a content type. See <link linkend="gio-GContentType">GContentType</link>.
18796  *
18797  * Sets the content type attribute for a given #GFileInfo.
18798  * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
18799  */
18800
18801
18802 /**
18803  * g_file_info_set_display_name:
18804  * @info: a #GFileInfo.
18805  * @display_name: a string containing a display name.
18806  *
18807  * Sets the display name for the current #GFileInfo.
18808  * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
18809  */
18810
18811
18812 /**
18813  * g_file_info_set_edit_name:
18814  * @info: a #GFileInfo.
18815  * @edit_name: a string containing an edit name.
18816  *
18817  * Sets the edit name for the current file.
18818  * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
18819  */
18820
18821
18822 /**
18823  * g_file_info_set_file_type:
18824  * @info: a #GFileInfo.
18825  * @type: a #GFileType.
18826  *
18827  * Sets the file type in a #GFileInfo to @type.
18828  * See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
18829  */
18830
18831
18832 /**
18833  * g_file_info_set_icon:
18834  * @info: a #GFileInfo.
18835  * @icon: a #GIcon.
18836  *
18837  * Sets the icon for a given #GFileInfo.
18838  * See %G_FILE_ATTRIBUTE_STANDARD_ICON.
18839  */
18840
18841
18842 /**
18843  * g_file_info_set_is_hidden:
18844  * @info: a #GFileInfo.
18845  * @is_hidden: a #gboolean.
18846  *
18847  * Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
18848  * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
18849  */
18850
18851
18852 /**
18853  * g_file_info_set_is_symlink:
18854  * @info: a #GFileInfo.
18855  * @is_symlink: a #gboolean.
18856  *
18857  * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
18858  * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
18859  */
18860
18861
18862 /**
18863  * g_file_info_set_modification_time:
18864  * @info: a #GFileInfo.
18865  * @mtime: a #GTimeVal.
18866  *
18867  * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
18868  * info to the given time value.
18869  */
18870
18871
18872 /**
18873  * g_file_info_set_name:
18874  * @info: a #GFileInfo.
18875  * @name: a string containing a name.
18876  *
18877  * Sets the name attribute for the current #GFileInfo.
18878  * See %G_FILE_ATTRIBUTE_STANDARD_NAME.
18879  */
18880
18881
18882 /**
18883  * g_file_info_set_size:
18884  * @info: a #GFileInfo.
18885  * @size: a #goffset containing the file's size.
18886  *
18887  * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
18888  * to the given size.
18889  */
18890
18891
18892 /**
18893  * g_file_info_set_sort_order:
18894  * @info: a #GFileInfo.
18895  * @sort_order: a sort order integer.
18896  *
18897  * Sets the sort order attribute in the file info structure. See
18898  * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18899  */
18900
18901
18902 /**
18903  * g_file_info_set_symbolic_icon:
18904  * @info: a #GFileInfo.
18905  * @icon: a #GIcon.
18906  *
18907  * Sets the symbolic icon for a given #GFileInfo.
18908  * See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
18909  *
18910  * Since: 2.34
18911  */
18912
18913
18914 /**
18915  * g_file_info_set_symlink_target:
18916  * @info: a #GFileInfo.
18917  * @symlink_target: a static string containing a path to a symlink target.
18918  *
18919  * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
18920  * to the given symlink target.
18921  */
18922
18923
18924 /**
18925  * g_file_info_unset_attribute_mask:
18926  * @info: #GFileInfo.
18927  *
18928  * Unsets a mask set by g_file_info_set_attribute_mask(), if one
18929  * is set.
18930  */
18931
18932
18933 /**
18934  * g_file_input_stream_query_info:
18935  * @stream: a #GFileInputStream.
18936  * @attributes: a file attribute query string.
18937  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18938  * @error: a #GError location to store the error occurring, or %NULL to ignore.
18939  *
18940  * Queries a file input stream the given @attributes. This function blocks
18941  * while querying the stream. For the asynchronous (non-blocking) version
18942  * of this function, see g_file_input_stream_query_info_async(). While the
18943  * stream is blocked, the stream will set the pending flag internally, and
18944  * any other operations on the stream will fail with %G_IO_ERROR_PENDING.
18945  *
18946  * Returns: (transfer full): a #GFileInfo, or %NULL on error.
18947  */
18948
18949
18950 /**
18951  * g_file_input_stream_query_info_async:
18952  * @stream: a #GFileInputStream.
18953  * @attributes: a file attribute query string.
18954  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18955  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18956  * @callback: (scope async): callback to call when the request is satisfied
18957  * @user_data: (closure): the data to pass to callback function
18958  *
18959  * Queries the stream information asynchronously.
18960  * When the operation is finished @callback will be called.
18961  * You can then call g_file_input_stream_query_info_finish()
18962  * to get the result of the operation.
18963  *
18964  * For the synchronous version of this function,
18965  * see g_file_input_stream_query_info().
18966  *
18967  * If @cancellable is not %NULL, then the operation can be cancelled by
18968  * triggering the cancellable object from another thread. If the operation
18969  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set
18970  */
18971
18972
18973 /**
18974  * g_file_input_stream_query_info_finish:
18975  * @stream: a #GFileInputStream.
18976  * @result: a #GAsyncResult.
18977  * @error: a #GError location to store the error occurring, or %NULL to ignore.
18978  *
18979  * Finishes an asynchronous info query operation.
18980  *
18981  * Returns: (transfer full): #GFileInfo.
18982  */
18983
18984
18985 /**
18986  * g_file_io_stream_get_etag:
18987  * @stream: a #GFileIOStream.
18988  *
18989  * Gets the entity tag for the file when it has been written.
18990  * This must be called after the stream has been written
18991  * and closed, as the etag can change while writing.
18992  *
18993  * Returns: the entity tag for the stream.
18994  * Since: 2.22
18995  */
18996
18997
18998 /**
18999  * g_file_io_stream_query_info:
19000  * @stream: a #GFileIOStream.
19001  * @attributes: a file attribute query string.
19002  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19003  * @error: a #GError, %NULL to ignore.
19004  *
19005  * Queries a file io stream for the given @attributes.
19006  * This function blocks while querying the stream. For the asynchronous
19007  * version of this function, see g_file_io_stream_query_info_async().
19008  * While the stream is blocked, the stream will set the pending flag
19009  * internally, and any other operations on the stream will fail with
19010  * %G_IO_ERROR_PENDING.
19011  *
19012  * Can fail if the stream was already closed (with @error being set to
19013  * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19014  * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19015  * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
19016  * all cases of failure, %NULL will be returned.
19017  *
19018  * If @cancellable is not %NULL, then the operation can be cancelled by
19019  * triggering the cancellable object from another thread. If the operation
19020  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19021  * be returned.
19022  *
19023  * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19024  * Since: 2.22
19025  */
19026
19027
19028 /**
19029  * g_file_io_stream_query_info_async:
19030  * @stream: a #GFileIOStream.
19031  * @attributes: a file attribute query string.
19032  * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19033  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19034  * @callback: (scope async): callback to call when the request is satisfied
19035  * @user_data: (closure): the data to pass to callback function
19036  *
19037  * Asynchronously queries the @stream for a #GFileInfo. When completed,
19038  * @callback will be called with a #GAsyncResult which can be used to
19039  * finish the operation with g_file_io_stream_query_info_finish().
19040  *
19041  * For the synchronous version of this function, see
19042  * g_file_io_stream_query_info().
19043  *
19044  * Since: 2.22
19045  */
19046
19047
19048 /**
19049  * g_file_io_stream_query_info_finish:
19050  * @stream: a #GFileIOStream.
19051  * @result: a #GAsyncResult.
19052  * @error: a #GError, %NULL to ignore.
19053  *
19054  * Finalizes the asynchronous query started
19055  * by g_file_io_stream_query_info_async().
19056  *
19057  * Returns: (transfer full): A #GFileInfo for the finished query.
19058  * Since: 2.22
19059  */
19060
19061
19062 /**
19063  * g_file_is_native:
19064  * @file: input #GFile
19065  *
19066  * Checks to see if a file is native to the platform.
19067  *
19068  * A native file s one expressed in the platform-native filename format,
19069  * e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
19070  * as it might be on a locally mounted remote filesystem.
19071  *
19072  * On some systems non-native files may be available using the native
19073  * filesystem via a userspace filesystem (FUSE), in these cases this call
19074  * will return %FALSE, but g_file_get_path() will still return a native path.
19075  *
19076  * This call does no blocking I/O.
19077  *
19078  * Returns: %TRUE if @file is native
19079  */
19080
19081
19082 /**
19083  * g_file_load_contents:
19084  * @file: input #GFile
19085  * @cancellable: optional #GCancellable object, %NULL to ignore
19086  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19087  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19088  * @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
19089  * @error: a #GError, or %NULL
19090  *
19091  * Loads the content of the file into memory. The data is always
19092  * zero-terminated, but this is not included in the resultant @length.
19093  * The returned @content should be freed with g_free() when no longer
19094  * needed.
19095  *
19096  * If @cancellable is not %NULL, then the operation can be cancelled by
19097  * triggering the cancellable object from another thread. If the operation
19098  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19099  *
19100  * Returns: %TRUE if the @file's contents were successfully loaded. %FALSE if there were errors.
19101  */
19102
19103
19104 /**
19105  * g_file_load_contents_async:
19106  * @file: input #GFile
19107  * @cancellable: optional #GCancellable object, %NULL to ignore
19108  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19109  * @user_data: the data to pass to callback function
19110  *
19111  * Starts an asynchronous load of the @file's contents.
19112  *
19113  * For more details, see g_file_load_contents() which is
19114  * the synchronous version of this call.
19115  *
19116  * When the load operation has completed, @callback will be called
19117  * with @user data. To finish the operation, call
19118  * g_file_load_contents_finish() with the #GAsyncResult returned by
19119  * the @callback.
19120  *
19121  * If @cancellable is not %NULL, then the operation can be cancelled by
19122  * triggering the cancellable object from another thread. If the operation
19123  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19124  */
19125
19126
19127 /**
19128  * g_file_load_contents_finish:
19129  * @file: input #GFile
19130  * @res: a #GAsyncResult
19131  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19132  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19133  * @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
19134  * @error: a #GError, or %NULL
19135  *
19136  * Finishes an asynchronous load of the @file's contents.
19137  * The contents are placed in @contents, and @length is set to the
19138  * size of the @contents string. The @content should be freed with
19139  * g_free() when no longer needed. If @etag_out is present, it will be
19140  * set to the new entity tag for the @file.
19141  *
19142  * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19143  */
19144
19145
19146 /**
19147  * g_file_load_partial_contents_async: (skip)
19148  * @file: input #GFile
19149  * @cancellable: optional #GCancellable object, %NULL to ignore
19150  * @read_more_callback: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read
19151  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19152  * @user_data: the data to pass to the callback functions
19153  *
19154  * Reads the partial contents of a file. A #GFileReadMoreCallback should
19155  * be used to stop reading from the file when appropriate, else this
19156  * function will behave exactly as g_file_load_contents_async(). This
19157  * operation can be finished by g_file_load_partial_contents_finish().
19158  *
19159  * Users of this function should be aware that @user_data is passed to
19160  * both the @read_more_callback and the @callback.
19161  *
19162  * If @cancellable is not %NULL, then the operation can be cancelled by
19163  * triggering the cancellable object from another thread. If the operation
19164  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19165  */
19166
19167
19168 /**
19169  * g_file_load_partial_contents_finish:
19170  * @file: input #GFile
19171  * @res: a #GAsyncResult
19172  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
19173  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
19174  * @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
19175  * @error: a #GError, or %NULL
19176  *
19177  * Finishes an asynchronous partial load operation that was started
19178  * with g_file_load_partial_contents_async(). The data is always
19179  * zero-terminated, but this is not included in the resultant @length.
19180  * The returned @content should be freed with g_free() when no longer
19181  * needed.
19182  *
19183  * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
19184  */
19185
19186
19187 /**
19188  * g_file_make_directory:
19189  * @file: input #GFile
19190  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19191  * @error: a #GError, or %NULL
19192  *
19193  * Creates a directory. Note that this will only create a child directory
19194  * of the immediate parent directory of the path or URI given by the #GFile.
19195  * To recursively create directories, see g_file_make_directory_with_parents().
19196  * This function will fail if the parent directory does not exist, setting
19197  * @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support
19198  * creating directories, this function will fail, setting @error to
19199  * %G_IO_ERROR_NOT_SUPPORTED.
19200  *
19201  * For a local #GFile the newly created directory will have the default
19202  * (current) ownership and permissions of the current process.
19203  *
19204  * If @cancellable is not %NULL, then the operation can be cancelled by
19205  * triggering the cancellable object from another thread. If the operation
19206  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19207  *
19208  * Returns: %TRUE on successful creation, %FALSE otherwise.
19209  */
19210
19211
19212 /**
19213  * g_file_make_directory_with_parents:
19214  * @file: input #GFile
19215  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19216  * @error: a #GError, or %NULL
19217  *
19218  * Creates a directory and any parent directories that may not
19219  * exist similar to 'mkdir -p'. If the file system does not support
19220  * creating directories, this function will fail, setting @error to
19221  * %G_IO_ERROR_NOT_SUPPORTED. If the directory itself already exists,
19222  * this function will fail setting @error to %G_IO_ERROR_EXISTS, unlike
19223  * the similar g_mkdir_with_parents().
19224  *
19225  * For a local #GFile the newly created directories will have the default
19226  * (current) ownership and permissions of the current process.
19227  *
19228  * If @cancellable is not %NULL, then the operation can be cancelled by
19229  * triggering the cancellable object from another thread. If the operation
19230  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19231  *
19232  * Returns: %TRUE if all directories have been successfully created, %FALSE otherwise.
19233  * Since: 2.18
19234  */
19235
19236
19237 /**
19238  * g_file_make_symbolic_link:
19239  * @file: a #GFile with the name of the symlink to create
19240  * @symlink_value: a string with the path for the target of the new symlink
19241  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19242  * @error: a #GError
19243  *
19244  * Creates a symbolic link named @file which contains the string
19245  * @symlink_value.
19246  *
19247  * If @cancellable is not %NULL, then the operation can be cancelled by
19248  * triggering the cancellable object from another thread. If the operation
19249  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19250  *
19251  * Returns: %TRUE on the creation of a new symlink, %FALSE otherwise.
19252  */
19253
19254
19255 /**
19256  * g_file_monitor:
19257  * @file: input #GFile
19258  * @flags: a set of #GFileMonitorFlags
19259  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19260  * @error: a #GError, or %NULL
19261  *
19262  * Obtains a file or directory monitor for the given file,
19263  * depending on the type of the file.
19264  *
19265  * If @cancellable is not %NULL, then the operation can be cancelled by
19266  * triggering the cancellable object from another thread. If the operation
19267  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19268  *
19269  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19270  * Since: 2.18
19271  */
19272
19273
19274 /**
19275  * g_file_monitor_cancel:
19276  * @monitor: a #GFileMonitor.
19277  *
19278  * Cancels a file monitor.
19279  *
19280  * Returns: %TRUE if monitor was cancelled.
19281  */
19282
19283
19284 /**
19285  * g_file_monitor_directory:
19286  * @file: input #GFile
19287  * @flags: a set of #GFileMonitorFlags
19288  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19289  * @error: a #GError, or %NULL
19290  *
19291  * Obtains a directory monitor for the given file.
19292  * This may fail if directory monitoring is not supported.
19293  *
19294  * If @cancellable is not %NULL, then the operation can be cancelled by
19295  * triggering the cancellable object from another thread. If the operation
19296  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19297  *
19298  * Virtual: monitor_dir
19299  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19300  */
19301
19302
19303 /**
19304  * g_file_monitor_emit_event:
19305  * @monitor: a #GFileMonitor.
19306  * @child: a #GFile.
19307  * @other_file: a #GFile.
19308  * @event_type: a set of #GFileMonitorEvent flags.
19309  *
19310  * Emits the #GFileMonitor::changed signal if a change
19311  * has taken place. Should be called from file monitor
19312  * implementations only.
19313  *
19314  * The signal will be emitted from an idle handler (in the <link
19315  * linkend="g-main-context-push-thread-default">thread-default main
19316  * context</link>).
19317  */
19318
19319
19320 /**
19321  * g_file_monitor_file:
19322  * @file: input #GFile
19323  * @flags: a set of #GFileMonitorFlags
19324  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19325  * @error: a #GError, or %NULL
19326  *
19327  * Obtains a file monitor for the given file. If no file notification
19328  * mechanism exists, then regular polling of the file is used.
19329  *
19330  * If @cancellable is not %NULL, then the operation can be cancelled by
19331  * triggering the cancellable object from another thread. If the operation
19332  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19333  *
19334  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19335  */
19336
19337
19338 /**
19339  * g_file_monitor_is_cancelled:
19340  * @monitor: a #GFileMonitor
19341  *
19342  * Returns whether the monitor is canceled.
19343  *
19344  * Returns: %TRUE if monitor is canceled. %FALSE otherwise.
19345  */
19346
19347
19348 /**
19349  * g_file_monitor_set_rate_limit:
19350  * @monitor: a #GFileMonitor.
19351  * @limit_msecs: a non-negative integer with the limit in milliseconds to poll for changes
19352  *
19353  * Sets the rate limit to which the @monitor will report
19354  * consecutive change events to the same file.
19355  */
19356
19357
19358 /**
19359  * g_file_mount_enclosing_volume:
19360  * @location: input #GFile
19361  * @flags: flags affecting the operation
19362  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction
19363  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19364  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19365  * @user_data: the data to pass to callback function
19366  *
19367  * Starts a @mount_operation, mounting the volume that contains
19368  * the file @location.
19369  *
19370  * When this operation has completed, @callback will be called with
19371  * @user_user data, and the operation can be finalized with
19372  * g_file_mount_enclosing_volume_finish().
19373  *
19374  * If @cancellable is not %NULL, then the operation can be cancelled by
19375  * triggering the cancellable object from another thread. If the operation
19376  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19377  */
19378
19379
19380 /**
19381  * g_file_mount_enclosing_volume_finish:
19382  * @location: input #GFile
19383  * @result: a #GAsyncResult
19384  * @error: a #GError, or %NULL
19385  *
19386  * Finishes a mount operation started by g_file_mount_enclosing_volume().
19387  *
19388  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
19389  */
19390
19391
19392 /**
19393  * g_file_mount_mountable:
19394  * @file: input #GFile
19395  * @flags: flags affecting the operation
19396  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
19397  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19398  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19399  * @user_data: (closure): the data to pass to callback function
19400  *
19401  * Mounts a file of type G_FILE_TYPE_MOUNTABLE.
19402  * Using @mount_operation, you can request callbacks when, for instance,
19403  * passwords are needed during authentication.
19404  *
19405  * If @cancellable is not %NULL, then the operation can be cancelled by
19406  * triggering the cancellable object from another thread. If the operation
19407  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19408  *
19409  * When the operation is finished, @callback will be called.
19410  * You can then call g_file_mount_mountable_finish() to get
19411  * the result of the operation.
19412  */
19413
19414
19415 /**
19416  * g_file_mount_mountable_finish:
19417  * @file: input #GFile
19418  * @result: a #GAsyncResult
19419  * @error: a #GError, or %NULL
19420  *
19421  * Finishes a mount operation. See g_file_mount_mountable() for details.
19422  *
19423  * Finish an asynchronous mount operation that was started
19424  * with g_file_mount_mountable().
19425  *
19426  * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
19427  */
19428
19429
19430 /**
19431  * g_file_move:
19432  * @source: #GFile pointing to the source location
19433  * @destination: #GFile pointing to the destination location
19434  * @flags: set of #GFileCopyFlags
19435  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19436  * @progress_callback: (allow-none) (scope call): #GFileProgressCallback function for updates
19437  * @progress_callback_data: (closure): gpointer to user data for the callback function
19438  * @error: #GError for returning error conditions, or %NULL
19439  *
19440  * Tries to move the file or directory @source to the location specified
19441  * by @destination. If native move operations are supported then this is
19442  * used, otherwise a copy + delete fallback is used. The native
19443  * implementation may support moving directories (for instance on moves
19444  * inside the same filesystem), but the fallback code does not.
19445  *
19446  * If the flag #G_FILE_COPY_OVERWRITE is specified an already
19447  * existing @destination file is overwritten.
19448  *
19449  * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
19450  * will be copied as symlinks, otherwise the target of the
19451  * @source symlink will be copied.
19452  *
19453  * If @cancellable is not %NULL, then the operation can be cancelled by
19454  * triggering the cancellable object from another thread. If the operation
19455  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19456  *
19457  * If @progress_callback is not %NULL, then the operation can be monitored
19458  * by setting this to a #GFileProgressCallback function.
19459  * @progress_callback_data will be passed to this function. It is
19460  * guaranteed that this callback will be called after all data has been
19461  * transferred with the total number of bytes copied during the operation.
19462  *
19463  * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND
19464  * error is returned, independent on the status of the @destination.
19465  *
19466  * If #G_FILE_COPY_OVERWRITE is not specified and the target exists,
19467  * then the error %G_IO_ERROR_EXISTS is returned.
19468  *
19469  * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
19470  * error is returned. If trying to overwrite a directory with a directory the
19471  * %G_IO_ERROR_WOULD_MERGE error is returned.
19472  *
19473  * If the source is a directory and the target does not exist, or
19474  * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then
19475  * the %G_IO_ERROR_WOULD_RECURSE error may be returned (if the native
19476  * move operation isn't available).
19477  *
19478  * Returns: %TRUE on successful move, %FALSE otherwise.
19479  */
19480
19481
19482 /**
19483  * g_file_new_for_commandline_arg:
19484  * @arg: a command line string
19485  *
19486  * Creates a #GFile with the given argument from the command line.
19487  * The value of @arg can be either a URI, an absolute path or a
19488  * relative path resolved relative to the current working directory.
19489  * This operation never fails, but the returned object might not
19490  * support any I/O operation if @arg points to a malformed path.
19491  *
19492  * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19493  */
19494
19495
19496 /**
19497  * g_file_new_for_path:
19498  * @path: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
19499  *
19500  * Constructs a #GFile for a given path. This operation never
19501  * fails, but the returned object might not support any I/O
19502  * operation if @path is malformed.
19503  *
19504  * Returns: (transfer full): a new #GFile for the given @path. Free the returned object with g_object_unref().
19505  */
19506
19507
19508 /**
19509  * g_file_new_for_uri:
19510  * @uri: a UTF-8 string containing a URI
19511  *
19512  * Constructs a #GFile for a given URI. This operation never
19513  * fails, but the returned object might not support any I/O
19514  * operation if @uri is malformed or if the uri type is
19515  * not supported.
19516  *
19517  * Returns: (transfer full): a new #GFile for the given @uri. Free the returned object with g_object_unref().
19518  */
19519
19520
19521 /**
19522  * g_file_new_tmp:
19523  * @tmpl: (type filename) (allow-none): Template for the file name, as in g_file_open_tmp(), or %NULL for a default template
19524  * @iostream: (out): on return, a #GFileIOStream for the created file
19525  * @error: a #GError, or %NULL
19526  *
19527  * Opens a file in the preferred directory for temporary files (as
19528  * returned by g_get_tmp_dir()) and returns a #GFile and
19529  * #GFileIOStream pointing to it.
19530  *
19531  * @tmpl should be a string in the GLib file name encoding
19532  * containing a sequence of six 'X' characters, and containing no
19533  * directory components. If it is %NULL, a default template is used.
19534  *
19535  * Unlike the other #GFile constructors, this will return %NULL if
19536  * a temporary file could not be created.
19537  *
19538  * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19539  * Since: 2.32
19540  */
19541
19542
19543 /**
19544  * g_file_open_readwrite:
19545  * @file: #GFile to open
19546  * @cancellable: (allow-none): a #GCancellable
19547  * @error: a #GError, or %NULL
19548  *
19549  * Opens an existing file for reading and writing. The result is
19550  * a #GFileIOStream that can be used to read and write the contents
19551  * of the file.
19552  *
19553  * If @cancellable is not %NULL, then the operation can be cancelled
19554  * by triggering the cancellable object from another thread. If the
19555  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19556  * returned.
19557  *
19558  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
19559  * be returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
19560  * error will be returned. Other errors are possible too, and depend on
19561  * what kind of filesystem the file is on. Note that in many non-local
19562  * file cases read and write streams are not supported, so make sure you
19563  * really need to do read and write streaming, rather than just opening
19564  * for reading or writing.
19565  *
19566  * Returns: (transfer full): #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19567  * Since: 2.22
19568  */
19569
19570
19571 /**
19572  * g_file_open_readwrite_async:
19573  * @file: input #GFile
19574  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19575  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19576  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19577  * @user_data: (closure): the data to pass to callback function
19578  *
19579  * Asynchronously opens @file for reading and writing.
19580  *
19581  * For more details, see g_file_open_readwrite() which is
19582  * the synchronous version of this call.
19583  *
19584  * When the operation is finished, @callback will be called.
19585  * You can then call g_file_open_readwrite_finish() to get
19586  * the result of the operation.
19587  *
19588  * Since: 2.22
19589  */
19590
19591
19592 /**
19593  * g_file_open_readwrite_finish:
19594  * @file: input #GFile
19595  * @res: a #GAsyncResult
19596  * @error: a #GError, or %NULL
19597  *
19598  * Finishes an asynchronous file read operation started with
19599  * g_file_open_readwrite_async().
19600  *
19601  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19602  * Since: 2.22
19603  */
19604
19605
19606 /**
19607  * g_file_output_stream_get_etag:
19608  * @stream: a #GFileOutputStream.
19609  *
19610  * Gets the entity tag for the file when it has been written.
19611  * This must be called after the stream has been written
19612  * and closed, as the etag can change while writing.
19613  *
19614  * Returns: the entity tag for the stream.
19615  */
19616
19617
19618 /**
19619  * g_file_output_stream_query_info:
19620  * @stream: a #GFileOutputStream.
19621  * @attributes: a file attribute query string.
19622  * @cancellable: optional #GCancellable object, %NULL to ignore.
19623  * @error: a #GError, %NULL to ignore.
19624  *
19625  * Queries a file output stream for the given @attributes.
19626  * This function blocks while querying the stream. For the asynchronous
19627  * version of this function, see g_file_output_stream_query_info_async().
19628  * While the stream is blocked, the stream will set the pending flag
19629  * internally, and any other operations on the stream will fail with
19630  * %G_IO_ERROR_PENDING.
19631  *
19632  * Can fail if the stream was already closed (with @error being set to
19633  * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19634  * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19635  * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
19636  * all cases of failure, %NULL will be returned.
19637  *
19638  * If @cancellable is not %NULL, then the operation can be cancelled by
19639  * triggering the cancellable object from another thread. If the operation
19640  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19641  * be returned.
19642  *
19643  * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19644  */
19645
19646
19647 /**
19648  * g_file_output_stream_query_info_async:
19649  * @stream: a #GFileOutputStream.
19650  * @attributes: a file attribute query string.
19651  * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19652  * @cancellable: optional #GCancellable object, %NULL to ignore.
19653  * @callback: callback to call when the request is satisfied
19654  * @user_data: the data to pass to callback function
19655  *
19656  * Asynchronously queries the @stream for a #GFileInfo. When completed,
19657  * @callback will be called with a #GAsyncResult which can be used to
19658  * finish the operation with g_file_output_stream_query_info_finish().
19659  *
19660  * For the synchronous version of this function, see
19661  * g_file_output_stream_query_info().
19662  */
19663
19664
19665 /**
19666  * g_file_output_stream_query_info_finish:
19667  * @stream: a #GFileOutputStream.
19668  * @result: a #GAsyncResult.
19669  * @error: a #GError, %NULL to ignore.
19670  *
19671  * Finalizes the asynchronous query started
19672  * by g_file_output_stream_query_info_async().
19673  *
19674  * Returns: (transfer full): A #GFileInfo for the finished query.
19675  */
19676
19677
19678 /**
19679  * g_file_parse_name:
19680  * @parse_name: a file name or path to be parsed
19681  *
19682  * Constructs a #GFile with the given @parse_name (i.e. something
19683  * given by g_file_get_parse_name()). This operation never fails,
19684  * but the returned object might not support any I/O operation if
19685  * the @parse_name cannot be parsed.
19686  *
19687  * Returns: (transfer full): a new #GFile.
19688  */
19689
19690
19691 /**
19692  * g_file_poll_mountable:
19693  * @file: input #GFile
19694  * @cancellable: optional #GCancellable object, %NULL to ignore
19695  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19696  * @user_data: the data to pass to callback function
19697  *
19698  * Polls a file of type #G_FILE_TYPE_MOUNTABLE.
19699  *
19700  * If @cancellable is not %NULL, then the operation can be cancelled by
19701  * triggering the cancellable object from another thread. If the operation
19702  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19703  *
19704  * When the operation is finished, @callback will be called.
19705  * You can then call g_file_mount_mountable_finish() to get
19706  * the result of the operation.
19707  *
19708  * Since: 2.22
19709  */
19710
19711
19712 /**
19713  * g_file_poll_mountable_finish:
19714  * @file: input #GFile
19715  * @result: a #GAsyncResult
19716  * @error: a #GError, or %NULL
19717  *
19718  * Finishes a poll operation. See g_file_poll_mountable() for details.
19719  *
19720  * Finish an asynchronous poll operation that was polled
19721  * with g_file_poll_mountable().
19722  *
19723  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
19724  * Since: 2.22
19725  */
19726
19727
19728 /**
19729  * g_file_query_default_handler:
19730  * @file: a #GFile to open
19731  * @cancellable: optional #GCancellable object, %NULL to ignore
19732  * @error: a #GError, or %NULL
19733  *
19734  * Returns the #GAppInfo that is registered as the default
19735  * application to handle the file specified by @file.
19736  *
19737  * If @cancellable is not %NULL, then the operation can be cancelled by
19738  * triggering the cancellable object from another thread. If the operation
19739  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19740  *
19741  * 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()
19742  */
19743
19744
19745 /**
19746  * g_file_query_exists:
19747  * @file: input #GFile
19748  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19749  *
19750  * Utility function to check if a particular file exists. This is
19751  * implemented using g_file_query_info() and as such does blocking I/O.
19752  *
19753  * Note that in many cases it is racy to first check for file existence
19754  * and then execute something based on the outcome of that, because the
19755  * file might have been created or removed in between the operations. The
19756  * general approach to handling that is to not check, but just do the
19757  * operation and handle the errors as they come.
19758  *
19759  * As an example of race-free checking, take the case of reading a file,
19760  * and if it doesn't exist, creating it. There are two racy versions: read
19761  * it, and on error create it; and: check if it exists, if not create it.
19762  * These can both result in two processes creating the file (with perhaps
19763  * a partially written file as the result). The correct approach is to
19764  * always try to create the file with g_file_create() which will either
19765  * atomically create the file or fail with a %G_IO_ERROR_EXISTS error.
19766  *
19767  * However, in many cases an existence check is useful in a user interface,
19768  * for instance to make a menu item sensitive/insensitive, so that you don't
19769  * have to fool users that something is possible and then just show an error
19770  * dialog. If you do this, you should make sure to also handle the errors
19771  * that can happen due to races when you execute the operation.
19772  *
19773  * Returns: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
19774  */
19775
19776
19777 /**
19778  * g_file_query_file_type:
19779  * @file: input #GFile
19780  * @flags: a set of #GFileQueryInfoFlags passed to g_file_query_info()
19781  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19782  *
19783  * Utility function to inspect the #GFileType of a file. This is
19784  * implemented using g_file_query_info() and as such does blocking I/O.
19785  *
19786  * The primary use case of this method is to check if a file is
19787  * a regular file, directory, or symlink.
19788  *
19789  * Returns: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file does not exist
19790  * Since: 2.18
19791  */
19792
19793
19794 /**
19795  * g_file_query_filesystem_info:
19796  * @file: input #GFile
19797  * @attributes: an attribute query string
19798  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19799  * @error: a #GError
19800  *
19801  * Similar to g_file_query_info(), but obtains information
19802  * about the filesystem the @file is on, rather than the file itself.
19803  * For instance the amount of space available and the type of
19804  * the filesystem.
19805  *
19806  * The @attributes value is a string that specifies the attributes
19807  * that should be gathered. It is not an error if it's not possible
19808  * to read a particular requested attribute from a file - it just
19809  * won't be set. @attributes should be a comma-separated list of
19810  * attributes or attribute wildcards. The wildcard "*" means all
19811  * attributes, and a wildcard like "filesystem::*" means all attributes
19812  * in the filesystem namespace. The standard namespace for filesystem
19813  * attributes is "filesystem". Common attributes of interest are
19814  * #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem
19815  * in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available),
19816  * and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
19817  *
19818  * If @cancellable is not %NULL, then the operation can be cancelled
19819  * by triggering the cancellable object from another thread. If the
19820  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19821  * returned.
19822  *
19823  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
19824  * be returned. Other errors are possible too, and depend on what
19825  * kind of filesystem the file is on.
19826  *
19827  * Returns: (transfer full): a #GFileInfo or %NULL if there was an error. Free the returned object with g_object_unref().
19828  */
19829
19830
19831 /**
19832  * g_file_query_filesystem_info_async:
19833  * @file: input #GFile
19834  * @attributes: an attribute query string
19835  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19836  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19837  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19838  * @user_data: (closure): the data to pass to callback function
19839  *
19840  * Asynchronously gets the requested information about the filesystem
19841  * that the specified @file is on. The result is a #GFileInfo object
19842  * that contains key-value attributes (such as type or size for the
19843  * file).
19844  *
19845  * For more details, see g_file_query_filesystem_info() which is the
19846  * synchronous version of this call.
19847  *
19848  * When the operation is finished, @callback will be called. You can
19849  * then call g_file_query_info_finish() to get the result of the
19850  * operation.
19851  */
19852
19853
19854 /**
19855  * g_file_query_filesystem_info_finish:
19856  * @file: input #GFile
19857  * @res: a #GAsyncResult
19858  * @error: a #GError
19859  *
19860  * Finishes an asynchronous filesystem info query.
19861  * See g_file_query_filesystem_info_async().
19862  *
19863  * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19864  */
19865
19866
19867 /**
19868  * g_file_query_info:
19869  * @file: input #GFile
19870  * @attributes: an attribute query string
19871  * @flags: a set of #GFileQueryInfoFlags
19872  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19873  * @error: a #GError
19874  *
19875  * Gets the requested information about specified @file.
19876  * The result is a #GFileInfo object that contains key-value
19877  * attributes (such as the type or size of the file).
19878  *
19879  * The @attributes value is a string that specifies the file
19880  * attributes that should be gathered. It is not an error if
19881  * it's not possible to read a particular requested attribute
19882  * from a file - it just won't be set. @attributes should be a
19883  * comma-separated list of attributes or attribute wildcards.
19884  * The wildcard "*" means all attributes, and a wildcard like
19885  * "standard::*" means all attributes in the standard namespace.
19886  * An example attribute query be "standard::*,owner::user".
19887  * The standard attributes are available as defines, like
19888  * #G_FILE_ATTRIBUTE_STANDARD_NAME.
19889  *
19890  * If @cancellable is not %NULL, then the operation can be cancelled
19891  * by triggering the cancellable object from another thread. If the
19892  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19893  * returned.
19894  *
19895  * For symlinks, normally the information about the target of the
19896  * symlink is returned, rather than information about the symlink
19897  * itself. However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS
19898  * in @flags the information about the symlink itself will be returned.
19899  * Also, for symlinks that point to non-existing files the information
19900  * about the symlink itself will be returned.
19901  *
19902  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
19903  * returned. Other errors are possible too, and depend on what kind of
19904  * filesystem the file is on.
19905  *
19906  * Returns: (transfer full): a #GFileInfo for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19907  */
19908
19909
19910 /**
19911  * g_file_query_info_async:
19912  * @file: input #GFile
19913  * @attributes: an attribute query string
19914  * @flags: a set of #GFileQueryInfoFlags
19915  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19916  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19917  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19918  * @user_data: (closure): the data to pass to callback function
19919  *
19920  * Asynchronously gets the requested information about specified @file.
19921  * The result is a #GFileInfo object that contains key-value attributes
19922  * (such as type or size for the file).
19923  *
19924  * For more details, see g_file_query_info() which is the synchronous
19925  * version of this call.
19926  *
19927  * When the operation is finished, @callback will be called. You can
19928  * then call g_file_query_info_finish() to get the result of the operation.
19929  */
19930
19931
19932 /**
19933  * g_file_query_info_finish:
19934  * @file: input #GFile
19935  * @res: a #GAsyncResult
19936  * @error: a #GError
19937  *
19938  * Finishes an asynchronous file info query.
19939  * See g_file_query_info_async().
19940  *
19941  * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19942  */
19943
19944
19945 /**
19946  * g_file_query_settable_attributes:
19947  * @file: input #GFile
19948  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19949  * @error: a #GError, or %NULL
19950  *
19951  * Obtain the list of settable attributes for the file.
19952  *
19953  * Returns the type and full attribute name of all the attributes
19954  * that can be set on this file. This doesn't mean setting it will
19955  * always succeed though, you might get an access failure, or some
19956  * specific file may not support a specific attribute.
19957  *
19958  * If @cancellable is not %NULL, then the operation can be cancelled by
19959  * triggering the cancellable object from another thread. If the operation
19960  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19961  *
19962  * Returns: a #GFileAttributeInfoList describing the settable attributes. When you are done with it, release it with g_file_attribute_info_list_unref()
19963  */
19964
19965
19966 /**
19967  * g_file_query_writable_namespaces:
19968  * @file: input #GFile
19969  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19970  * @error: a #GError, or %NULL
19971  *
19972  * Obtain the list of attribute namespaces where new attributes
19973  * can be created by a user. An example of this is extended
19974  * attributes (in the "xattr" namespace).
19975  *
19976  * If @cancellable is not %NULL, then the operation can be cancelled by
19977  * triggering the cancellable object from another thread. If the operation
19978  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19979  *
19980  * Returns: a #GFileAttributeInfoList describing the writable namespaces. When you are done with it, release it with g_file_attribute_info_list_unref()
19981  */
19982
19983
19984 /**
19985  * g_file_read:
19986  * @file: #GFile to read
19987  * @cancellable: (allow-none): a #GCancellable
19988  * @error: a #GError, or %NULL
19989  *
19990  * Opens a file for reading. The result is a #GFileInputStream that
19991  * can be used to read the contents of the file.
19992  *
19993  * If @cancellable is not %NULL, then the operation can be cancelled by
19994  * triggering the cancellable object from another thread. If the operation
19995  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19996  *
19997  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
19998  * returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
19999  * error will be returned. Other errors are possible too, and depend
20000  * on what kind of filesystem the file is on.
20001  *
20002  * Virtual: read_fn
20003  * Returns: (transfer full): #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
20004  */
20005
20006
20007 /**
20008  * g_file_read_async:
20009  * @file: input #GFile
20010  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20011  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20012  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20013  * @user_data: (closure): the data to pass to callback function
20014  *
20015  * Asynchronously opens @file for reading.
20016  *
20017  * For more details, see g_file_read() which is
20018  * the synchronous version of this call.
20019  *
20020  * When the operation is finished, @callback will be called.
20021  * You can then call g_file_read_finish() to get the result
20022  * of the operation.
20023  */
20024
20025
20026 /**
20027  * g_file_read_finish:
20028  * @file: input #GFile
20029  * @res: a #GAsyncResult
20030  * @error: a #GError, or %NULL
20031  *
20032  * Finishes an asynchronous file read operation started with
20033  * g_file_read_async().
20034  *
20035  * Returns: (transfer full): a #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
20036  */
20037
20038
20039 /**
20040  * g_file_replace:
20041  * @file: input #GFile
20042  * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20043  * @make_backup: %TRUE if a backup should be created
20044  * @flags: a set of #GFileCreateFlags
20045  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20046  * @error: a #GError, or %NULL
20047  *
20048  * Returns an output stream for overwriting the file, possibly
20049  * creating a backup copy of the file first. If the file doesn't exist,
20050  * it will be created.
20051  *
20052  * This will try to replace the file in the safest way possible so
20053  * that any errors during the writing will not affect an already
20054  * existing copy of the file. For instance, for local files it
20055  * may write to a temporary file and then atomically rename over
20056  * the destination when the stream is closed.
20057  *
20058  * By default files created are generally readable by everyone,
20059  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
20060  * will be made readable only to the current user, to the level that
20061  * is supported on the target filesystem.
20062  *
20063  * If @cancellable is not %NULL, then the operation can be cancelled
20064  * by triggering the cancellable object from another thread. If the
20065  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
20066  * returned.
20067  *
20068  * If you pass in a non-%NULL @etag value, then this value is
20069  * compared to the current entity tag of the file, and if they differ
20070  * an %G_IO_ERROR_WRONG_ETAG error is returned. This generally means
20071  * that the file has been changed since you last read it. You can get
20072  * the new etag from g_file_output_stream_get_etag() after you've
20073  * finished writing and closed the #GFileOutputStream. When you load
20074  * a new file you can use g_file_input_stream_query_info() to get
20075  * the etag of the file.
20076  *
20077  * If @make_backup is %TRUE, this function will attempt to make a
20078  * backup of the current file before overwriting it. If this fails
20079  * a %G_IO_ERROR_CANT_CREATE_BACKUP error will be returned. If you
20080  * want to replace anyway, try again with @make_backup set to %FALSE.
20081  *
20082  * If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will
20083  * be returned, and if the file is some other form of non-regular file
20084  * then a %G_IO_ERROR_NOT_REGULAR_FILE error will be returned. Some
20085  * file systems don't allow all file names, and may return an
20086  * %G_IO_ERROR_INVALID_FILENAME error, and if the name is to long
20087  * %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are
20088  * possible too, and depend on what kind of filesystem the file is on.
20089  *
20090  * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
20091  */
20092
20093
20094 /**
20095  * g_file_replace_async:
20096  * @file: input #GFile
20097  * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20098  * @make_backup: %TRUE if a backup should be created
20099  * @flags: a set of #GFileCreateFlags
20100  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20101  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20102  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20103  * @user_data: (closure): the data to pass to callback function
20104  *
20105  * Asynchronously overwrites the file, replacing the contents,
20106  * possibly creating a backup copy of the file first.
20107  *
20108  * For more details, see g_file_replace() which is
20109  * the synchronous version of this call.
20110  *
20111  * When the operation is finished, @callback will be called.
20112  * You can then call g_file_replace_finish() to get the result
20113  * of the operation.
20114  */
20115
20116
20117 /**
20118  * g_file_replace_contents:
20119  * @file: input #GFile
20120  * @contents: (element-type guint8) (array length=length): a string containing the new contents for @file
20121  * @length: the length of @contents in bytes
20122  * @etag: (allow-none): the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
20123  * @make_backup: %TRUE if a backup should be created
20124  * @flags: a set of #GFileCreateFlags
20125  * @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
20126  * @cancellable: optional #GCancellable object, %NULL to ignore
20127  * @error: a #GError, or %NULL
20128  *
20129  * Replaces the contents of @file with @contents of @length bytes.
20130  *
20131  * If @etag is specified (not %NULL), any existing file must have that etag,
20132  * or the error %G_IO_ERROR_WRONG_ETAG will be returned.
20133  *
20134  * If @make_backup is %TRUE, this function will attempt to make a backup
20135  * of @file.
20136  *
20137  * If @cancellable is not %NULL, then the operation can be cancelled by
20138  * triggering the cancellable object from another thread. If the operation
20139  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20140  *
20141  * The returned @new_etag can be used to verify that the file hasn't
20142  * changed the next time it is saved over.
20143  *
20144  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
20145  */
20146
20147
20148 /**
20149  * g_file_replace_contents_async:
20150  * @file: input #GFile
20151  * @contents: (element-type guint8) (array length=length): string of contents to replace the file with
20152  * @length: the length of @contents in bytes
20153  * @etag: (allow-none): a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
20154  * @make_backup: %TRUE if a backup should be created
20155  * @flags: a set of #GFileCreateFlags
20156  * @cancellable: optional #GCancellable object, %NULL to ignore
20157  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
20158  * @user_data: the data to pass to callback function
20159  *
20160  * Starts an asynchronous replacement of @file with the given
20161  * @contents of @length bytes. @etag will replace the document's
20162  * current entity tag.
20163  *
20164  * When this operation has completed, @callback will be called with
20165  * @user_user data, and the operation can be finalized with
20166  * g_file_replace_contents_finish().
20167  *
20168  * If @cancellable is not %NULL, then the operation can be cancelled by
20169  * triggering the cancellable object from another thread. If the operation
20170  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20171  *
20172  * If @make_backup is %TRUE, this function will attempt to
20173  * make a backup of @file.
20174  */
20175
20176
20177 /**
20178  * g_file_replace_contents_finish:
20179  * @file: input #GFile
20180  * @res: a #GAsyncResult
20181  * @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
20182  * @error: a #GError, or %NULL
20183  *
20184  * Finishes an asynchronous replace of the given @file. See
20185  * g_file_replace_contents_async(). Sets @new_etag to the new entity
20186  * tag for the document, if present.
20187  *
20188  * Returns: %TRUE on success, %FALSE on failure.
20189  */
20190
20191
20192 /**
20193  * g_file_replace_finish:
20194  * @file: input #GFile
20195  * @res: a #GAsyncResult
20196  * @error: a #GError, or %NULL
20197  *
20198  * Finishes an asynchronous file replace operation started with
20199  * g_file_replace_async().
20200  *
20201  * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
20202  */
20203
20204
20205 /**
20206  * g_file_replace_readwrite:
20207  * @file: a #GFile
20208  * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
20209  * @make_backup: %TRUE if a backup should be created
20210  * @flags: a set of #GFileCreateFlags
20211  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20212  * @error: return location for a #GError, or %NULL
20213  *
20214  * Returns an output stream for overwriting the file in readwrite mode,
20215  * possibly creating a backup copy of the file first. If the file doesn't
20216  * exist, it will be created.
20217  *
20218  * For details about the behaviour, see g_file_replace() which does the
20219  * same thing but returns an output stream only.
20220  *
20221  * Note that in many non-local file cases read and write streams are not
20222  * supported, so make sure you really need to do read and write streaming,
20223  * rather than just opening for reading or writing.
20224  *
20225  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
20226  * Since: 2.22
20227  */
20228
20229
20230 /**
20231  * g_file_replace_readwrite_async:
20232  * @file: input #GFile
20233  * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
20234  * @make_backup: %TRUE if a backup should be created
20235  * @flags: a set of #GFileCreateFlags
20236  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20237  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20238  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20239  * @user_data: (closure): the data to pass to callback function
20240  *
20241  * Asynchronously overwrites the file in read-write mode,
20242  * replacing the contents, possibly creating a backup copy
20243  * of the file first.
20244  *
20245  * For more details, see g_file_replace_readwrite() which is
20246  * the synchronous version of this call.
20247  *
20248  * When the operation is finished, @callback will be called.
20249  * You can then call g_file_replace_readwrite_finish() to get
20250  * the result of the operation.
20251  *
20252  * Since: 2.22
20253  */
20254
20255
20256 /**
20257  * g_file_replace_readwrite_finish:
20258  * @file: input #GFile
20259  * @res: a #GAsyncResult
20260  * @error: a #GError, or %NULL
20261  *
20262  * Finishes an asynchronous file replace operation started with
20263  * g_file_replace_readwrite_async().
20264  *
20265  * Returns: (transfer full): a #GFileIOStream, or %NULL on error. Free the returned object with g_object_unref().
20266  * Since: 2.22
20267  */
20268
20269
20270 /**
20271  * g_file_resolve_relative_path:
20272  * @file: input #GFile
20273  * @relative_path: a given relative path string
20274  *
20275  * Resolves a relative path for @file to an absolute path.
20276  *
20277  * This call does no blocking I/O.
20278  *
20279  * 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().
20280  */
20281
20282
20283 /**
20284  * g_file_set_attribute:
20285  * @file: input #GFile
20286  * @attribute: a string containing the attribute's name
20287  * @type: The type of the attribute
20288  * @value_p: (allow-none): a pointer to the value (or the pointer itself if the type is a pointer type)
20289  * @flags: a set of #GFileQueryInfoFlags
20290  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20291  * @error: a #GError, or %NULL
20292  *
20293  * Sets an attribute in the file with attribute name @attribute to @value.
20294  *
20295  * Some attributes can be unset by setting @attribute to
20296  * %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
20297  *
20298  * If @cancellable is not %NULL, then the operation can be cancelled by
20299  * triggering the cancellable object from another thread. If the operation
20300  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20301  *
20302  * Returns: %TRUE if the attribute was set, %FALSE otherwise.
20303  */
20304
20305
20306 /**
20307  * g_file_set_attribute_byte_string:
20308  * @file: input #GFile
20309  * @attribute: a string containing the attribute's name
20310  * @value: a string containing the attribute's new value
20311  * @flags: a #GFileQueryInfoFlags
20312  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20313  * @error: a #GError, or %NULL
20314  *
20315  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
20316  * If @attribute is of a different type, this operation will fail,
20317  * returning %FALSE.
20318  *
20319  * If @cancellable is not %NULL, then the operation can be cancelled by
20320  * triggering the cancellable object from another thread. If the operation
20321  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20322  *
20323  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20324  */
20325
20326
20327 /**
20328  * g_file_set_attribute_int32:
20329  * @file: input #GFile
20330  * @attribute: a string containing the attribute's name
20331  * @value: a #gint32 containing the attribute's new value
20332  * @flags: a #GFileQueryInfoFlags
20333  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20334  * @error: a #GError, or %NULL
20335  *
20336  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
20337  * If @attribute is of a different type, this operation will fail.
20338  *
20339  * If @cancellable is not %NULL, then the operation can be cancelled by
20340  * triggering the cancellable object from another thread. If the operation
20341  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20342  *
20343  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20344  */
20345
20346
20347 /**
20348  * g_file_set_attribute_int64:
20349  * @file: input #GFile
20350  * @attribute: a string containing the attribute's name
20351  * @value: a #guint64 containing the attribute's new value
20352  * @flags: a #GFileQueryInfoFlags
20353  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20354  * @error: a #GError, or %NULL
20355  *
20356  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
20357  * If @attribute is of a different type, this operation will fail.
20358  *
20359  * If @cancellable is not %NULL, then the operation can be cancelled by
20360  * triggering the cancellable object from another thread. If the operation
20361  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20362  *
20363  * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20364  */
20365
20366
20367 /**
20368  * g_file_set_attribute_string:
20369  * @file: input #GFile
20370  * @attribute: a string containing the attribute's name
20371  * @value: a string containing the attribute's value
20372  * @flags: #GFileQueryInfoFlags
20373  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20374  * @error: a #GError, or %NULL
20375  *
20376  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
20377  * If @attribute is of a different type, this operation will fail.
20378  *
20379  * If @cancellable is not %NULL, then the operation can be cancelled by
20380  * triggering the cancellable object from another thread. If the operation
20381  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20382  *
20383  * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
20384  */
20385
20386
20387 /**
20388  * g_file_set_attribute_uint32:
20389  * @file: input #GFile
20390  * @attribute: a string containing the attribute's name
20391  * @value: a #guint32 containing the attribute's new value
20392  * @flags: a #GFileQueryInfoFlags
20393  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20394  * @error: a #GError, or %NULL
20395  *
20396  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
20397  * If @attribute is of a different type, this operation will fail.
20398  *
20399  * If @cancellable is not %NULL, then the operation can be cancelled by
20400  * triggering the cancellable object from another thread. If the operation
20401  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20402  *
20403  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20404  */
20405
20406
20407 /**
20408  * g_file_set_attribute_uint64:
20409  * @file: input #GFile
20410  * @attribute: a string containing the attribute's name
20411  * @value: a #guint64 containing the attribute's new value
20412  * @flags: a #GFileQueryInfoFlags
20413  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20414  * @error: a #GError, or %NULL
20415  *
20416  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
20417  * If @attribute is of a different type, this operation will fail.
20418  *
20419  * If @cancellable is not %NULL, then the operation can be cancelled by
20420  * triggering the cancellable object from another thread. If the operation
20421  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20422  *
20423  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
20424  */
20425
20426
20427 /**
20428  * g_file_set_attributes_async:
20429  * @file: input #GFile
20430  * @info: a #GFileInfo
20431  * @flags: a #GFileQueryInfoFlags
20432  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20433  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20434  * @callback: (scope async): a #GAsyncReadyCallback
20435  * @user_data: (closure): a #gpointer
20436  *
20437  * Asynchronously sets the attributes of @file with @info.
20438  *
20439  * For more details, see g_file_set_attributes_from_info(),
20440  * which is the synchronous version of this call.
20441  *
20442  * When the operation is finished, @callback will be called.
20443  * You can then call g_file_set_attributes_finish() to get
20444  * the result of the operation.
20445  */
20446
20447
20448 /**
20449  * g_file_set_attributes_finish:
20450  * @file: input #GFile
20451  * @result: a #GAsyncResult
20452  * @info: (out) (transfer full): a #GFileInfo
20453  * @error: a #GError, or %NULL
20454  *
20455  * Finishes setting an attribute started in g_file_set_attributes_async().
20456  *
20457  * Returns: %TRUE if the attributes were set correctly, %FALSE otherwise.
20458  */
20459
20460
20461 /**
20462  * g_file_set_attributes_from_info:
20463  * @file: input #GFile
20464  * @info: a #GFileInfo
20465  * @flags: #GFileQueryInfoFlags
20466  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20467  * @error: a #GError, or %NULL
20468  *
20469  * Tries to set all attributes in the #GFileInfo on the target
20470  * values, not stopping on the first error.
20471  *
20472  * If there is any error during this operation then @error will
20473  * be set to the first error. Error on particular fields are flagged
20474  * by setting the "status" field in the attribute value to
20475  * %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can
20476  * also detect further errors.
20477  *
20478  * If @cancellable is not %NULL, then the operation can be cancelled by
20479  * triggering the cancellable object from another thread. If the operation
20480  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20481  *
20482  * Returns: %TRUE if there was any error, %FALSE otherwise.
20483  */
20484
20485
20486 /**
20487  * g_file_set_display_name:
20488  * @file: input #GFile
20489  * @display_name: a string
20490  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20491  * @error: a #GError, or %NULL
20492  *
20493  * Renames @file to the specified display name.
20494  *
20495  * The display name is converted from UTF-8 to the correct encoding
20496  * for the target filesystem if possible and the @file is renamed to this.
20497  *
20498  * If you want to implement a rename operation in the user interface the
20499  * edit name (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the
20500  * initial value in the rename widget, and then the result after editing
20501  * should be passed to g_file_set_display_name().
20502  *
20503  * On success the resulting converted filename is returned.
20504  *
20505  * If @cancellable is not %NULL, then the operation can be cancelled by
20506  * triggering the cancellable object from another thread. If the operation
20507  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20508  *
20509  * 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().
20510  */
20511
20512
20513 /**
20514  * g_file_set_display_name_async:
20515  * @file: input #GFile
20516  * @display_name: a string
20517  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
20518  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20519  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20520  * @user_data: (closure): the data to pass to callback function
20521  *
20522  * Asynchronously sets the display name for a given #GFile.
20523  *
20524  * For more details, see g_file_set_display_name() which is
20525  * the synchronous version of this call.
20526  *
20527  * When the operation is finished, @callback will be called.
20528  * You can then call g_file_set_display_name_finish() to get
20529  * the result of the operation.
20530  */
20531
20532
20533 /**
20534  * g_file_set_display_name_finish:
20535  * @file: input #GFile
20536  * @res: a #GAsyncResult
20537  * @error: a #GError, or %NULL
20538  *
20539  * Finishes setting a display name started with
20540  * g_file_set_display_name_async().
20541  *
20542  * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
20543  */
20544
20545
20546 /**
20547  * g_file_start_mountable:
20548  * @file: input #GFile
20549  * @flags: flags affecting the operation
20550  * @start_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
20551  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20552  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20553  * @user_data: the data to pass to callback function
20554  *
20555  * Starts a file of type #G_FILE_TYPE_MOUNTABLE.
20556  * Using @start_operation, you can request callbacks when, for instance,
20557  * passwords are needed during authentication.
20558  *
20559  * If @cancellable is not %NULL, then the operation can be cancelled by
20560  * triggering the cancellable object from another thread. If the operation
20561  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20562  *
20563  * When the operation is finished, @callback will be called.
20564  * You can then call g_file_mount_mountable_finish() to get
20565  * the result of the operation.
20566  *
20567  * Since: 2.22
20568  */
20569
20570
20571 /**
20572  * g_file_start_mountable_finish:
20573  * @file: input #GFile
20574  * @result: a #GAsyncResult
20575  * @error: a #GError, or %NULL
20576  *
20577  * Finishes a start operation. See g_file_start_mountable() for details.
20578  *
20579  * Finish an asynchronous start operation that was started
20580  * with g_file_start_mountable().
20581  *
20582  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20583  * Since: 2.22
20584  */
20585
20586
20587 /**
20588  * g_file_stop_mountable:
20589  * @file: input #GFile
20590  * @flags: flags affecting the operation
20591  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
20592  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20593  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20594  * @user_data: the data to pass to callback function
20595  *
20596  * Stops a file of type #G_FILE_TYPE_MOUNTABLE.
20597  *
20598  * If @cancellable is not %NULL, then the operation can be cancelled by
20599  * triggering the cancellable object from another thread. If the operation
20600  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20601  *
20602  * When the operation is finished, @callback will be called.
20603  * You can then call g_file_stop_mountable_finish() to get
20604  * the result of the operation.
20605  *
20606  * Since: 2.22
20607  */
20608
20609
20610 /**
20611  * g_file_stop_mountable_finish:
20612  * @file: input #GFile
20613  * @result: a #GAsyncResult
20614  * @error: a #GError, or %NULL
20615  *
20616  * Finishes an stop operation, see g_file_stop_mountable() for details.
20617  *
20618  * Finish an asynchronous stop operation that was started
20619  * with g_file_stop_mountable().
20620  *
20621  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20622  * Since: 2.22
20623  */
20624
20625
20626 /**
20627  * g_file_supports_thread_contexts:
20628  * @file: a #GFile
20629  *
20630  * Checks if @file supports <link
20631  * linkend="g-main-context-push-thread-default-context">thread-default
20632  * contexts</link>. If this returns %FALSE, you cannot perform
20633  * asynchronous operations on @file in a thread that has a
20634  * thread-default context.
20635  *
20636  * Returns: Whether or not @file supports thread-default contexts.
20637  * Since: 2.22
20638  */
20639
20640
20641 /**
20642  * g_file_trash:
20643  * @file: #GFile to send to trash
20644  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20645  * @error: a #GError, or %NULL
20646  *
20647  * Sends @file to the "Trashcan", if possible. This is similar to
20648  * deleting it, but the user can recover it before emptying the trashcan.
20649  * Not all file systems support trashing, so this call can return the
20650  * %G_IO_ERROR_NOT_SUPPORTED error.
20651  *
20652  * If @cancellable is not %NULL, then the operation can be cancelled by
20653  * triggering the cancellable object from another thread. If the operation
20654  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20655  *
20656  * Returns: %TRUE on successful trash, %FALSE otherwise.
20657  */
20658
20659
20660 /**
20661  * g_file_unmount_mountable:
20662  * @file: input #GFile
20663  * @flags: flags affecting the operation
20664  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20665  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20666  * @user_data: (closure): the data to pass to callback function
20667  *
20668  * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
20669  *
20670  * If @cancellable is not %NULL, then the operation can be cancelled by
20671  * triggering the cancellable object from another thread. If the operation
20672  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20673  *
20674  * When the operation is finished, @callback will be called.
20675  * You can then call g_file_unmount_mountable_finish() to get
20676  * the result of the operation.
20677  *
20678  * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation() instead.
20679  */
20680
20681
20682 /**
20683  * g_file_unmount_mountable_finish:
20684  * @file: input #GFile
20685  * @result: a #GAsyncResult
20686  * @error: a #GError, or %NULL
20687  *
20688  * Finishes an unmount operation, see g_file_unmount_mountable() for details.
20689  *
20690  * Finish an asynchronous unmount operation that was started
20691  * with g_file_unmount_mountable().
20692  *
20693  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20694  * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation_finish() instead.
20695  */
20696
20697
20698 /**
20699  * g_file_unmount_mountable_with_operation:
20700  * @file: input #GFile
20701  * @flags: flags affecting the operation
20702  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
20703  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20704  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20705  * @user_data: (closure): the data to pass to callback function
20706  *
20707  * Unmounts a file of type #G_FILE_TYPE_MOUNTABLE.
20708  *
20709  * If @cancellable is not %NULL, then the operation can be cancelled by
20710  * triggering the cancellable object from another thread. If the operation
20711  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20712  *
20713  * When the operation is finished, @callback will be called.
20714  * You can then call g_file_unmount_mountable_finish() to get
20715  * the result of the operation.
20716  *
20717  * Since: 2.22
20718  */
20719
20720
20721 /**
20722  * g_file_unmount_mountable_with_operation_finish:
20723  * @file: input #GFile
20724  * @result: a #GAsyncResult
20725  * @error: a #GError, or %NULL
20726  *
20727  * Finishes an unmount operation,
20728  * see g_file_unmount_mountable_with_operation() for details.
20729  *
20730  * Finish an asynchronous unmount operation that was started
20731  * with g_file_unmount_mountable_with_operation().
20732  *
20733  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20734  * Since: 2.22
20735  */
20736
20737
20738 /**
20739  * g_filename_completer_get_completion_suffix:
20740  * @completer: the filename completer.
20741  * @initial_text: text to be completed.
20742  *
20743  * Obtains a completion for @initial_text from @completer.
20744  *
20745  * 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.
20746  */
20747
20748
20749 /**
20750  * g_filename_completer_get_completions:
20751  * @completer: the filename completer.
20752  * @initial_text: text to be completed.
20753  *
20754  * Gets an array of completion strings for a given initial text.
20755  *
20756  * 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.
20757  */
20758
20759
20760 /**
20761  * g_filename_completer_new:
20762  *
20763  * Creates a new filename completer.
20764  *
20765  * Returns: a #GFilenameCompleter.
20766  */
20767
20768
20769 /**
20770  * g_filename_completer_set_dirs_only:
20771  * @completer: the filename completer.
20772  * @dirs_only: a #gboolean.
20773  *
20774  * If @dirs_only is %TRUE, @completer will only
20775  * complete directory names, and not file names.
20776  */
20777
20778
20779 /**
20780  * g_filter_input_stream_get_base_stream:
20781  * @stream: a #GFilterInputStream.
20782  *
20783  * Gets the base stream for the filter stream.
20784  *
20785  * Returns: (transfer none): a #GInputStream.
20786  */
20787
20788
20789 /**
20790  * g_filter_input_stream_get_close_base_stream:
20791  * @stream: a #GFilterInputStream.
20792  *
20793  * Returns whether the base stream will be closed when @stream is
20794  * closed.
20795  *
20796  * Returns: %TRUE if the base stream will be closed.
20797  */
20798
20799
20800 /**
20801  * g_filter_input_stream_set_close_base_stream:
20802  * @stream: a #GFilterInputStream.
20803  * @close_base: %TRUE to close the base stream.
20804  *
20805  * Sets whether the base stream will be closed when @stream is closed.
20806  */
20807
20808
20809 /**
20810  * g_filter_output_stream_get_base_stream:
20811  * @stream: a #GFilterOutputStream.
20812  *
20813  * Gets the base stream for the filter stream.
20814  *
20815  * Returns: (transfer none): a #GOutputStream.
20816  */
20817
20818
20819 /**
20820  * g_filter_output_stream_get_close_base_stream:
20821  * @stream: a #GFilterOutputStream.
20822  *
20823  * Returns whether the base stream will be closed when @stream is
20824  * closed.
20825  *
20826  * Returns: %TRUE if the base stream will be closed.
20827  */
20828
20829
20830 /**
20831  * g_filter_output_stream_set_close_base_stream:
20832  * @stream: a #GFilterOutputStream.
20833  * @close_base: %TRUE to close the base stream.
20834  *
20835  * Sets whether the base stream will be closed when @stream is closed.
20836  */
20837
20838
20839 /**
20840  * g_icon_equal:
20841  * @icon1: (allow-none): pointer to the first #GIcon.
20842  * @icon2: (allow-none): pointer to the second #GIcon.
20843  *
20844  * Checks if two icons are equal.
20845  *
20846  * Returns: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
20847  */
20848
20849
20850 /**
20851  * g_icon_hash:
20852  * @icon: #gconstpointer to an icon object.
20853  *
20854  * Gets a hash for an icon.
20855  *
20856  * Virtual: hash
20857  * Returns: a #guint containing a hash for the @icon, suitable for use in a #GHashTable or similar data structure.
20858  */
20859
20860
20861 /**
20862  * g_icon_new_for_string:
20863  * @str: A string obtained via g_icon_to_string().
20864  * @error: Return location for error.
20865  *
20866  * Generate a #GIcon instance from @str. This function can fail if
20867  * @str is not valid - see g_icon_to_string() for discussion.
20868  *
20869  * If your application or library provides one or more #GIcon
20870  * implementations you need to ensure that each #GType is registered
20871  * with the type system prior to calling g_icon_new_for_string().
20872  *
20873  * Returns: (transfer full): An object implementing the #GIcon interface or %NULL if @error is set.
20874  * Since: 2.20
20875  */
20876
20877
20878 /**
20879  * g_icon_to_string:
20880  * @icon: a #GIcon.
20881  *
20882  * Generates a textual representation of @icon that can be used for
20883  * serialization such as when passing @icon to a different process or
20884  * saving it to persistent storage. Use g_icon_new_for_string() to
20885  * get @icon back from the returned string.
20886  *
20887  * The encoding of the returned string is proprietary to #GIcon except
20888  * in the following two cases
20889  *
20890  * <itemizedlist>
20891  * <listitem><para>
20892  *     If @icon is a #GFileIcon, the returned string is a native path
20893  *     (such as <literal>/path/to/my icon.png</literal>) without escaping
20894  *     if the #GFile for @icon is a native file.  If the file is not
20895  *     native, the returned string is the result of g_file_get_uri()
20896  *     (such as <literal>sftp://path/to/my&percnt;20icon.png</literal>).
20897  * </para></listitem>
20898  * <listitem><para>
20899  *    If @icon is a #GThemedIcon with exactly one name, the encoding is
20900  *    simply the name (such as <literal>network-server</literal>).
20901  * </para></listitem>
20902  * </itemizedlist>
20903  *
20904  * Virtual: to_tokens
20905  * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't be serialized. Use g_free() to free.
20906  * Since: 2.20
20907  */
20908
20909
20910 /**
20911  * g_inet_address_equal:
20912  * @address: A #GInetAddress.
20913  * @other_address: Another #GInetAddress.
20914  *
20915  * Checks if two #GInetAddress instances are equal, e.g. the same address.
20916  *
20917  * Returns: %TRUE if @address and @other_address are equal, %FALSE otherwise.
20918  * Since: 2.30
20919  */
20920
20921
20922 /**
20923  * g_inet_address_get_family:
20924  * @address: a #GInetAddress
20925  *
20926  * Gets @address's family
20927  *
20928  * Returns: @address's family
20929  * Since: 2.22
20930  */
20931
20932
20933 /**
20934  * g_inet_address_get_is_any:
20935  * @address: a #GInetAddress
20936  *
20937  * Tests whether @address is the "any" address for its family.
20938  *
20939  * Returns: %TRUE if @address is the "any" address for its family.
20940  * Since: 2.22
20941  */
20942
20943
20944 /**
20945  * g_inet_address_get_is_link_local:
20946  * @address: a #GInetAddress
20947  *
20948  * Tests whether @address is a link-local address (that is, if it
20949  * identifies a host on a local network that is not connected to the
20950  * Internet).
20951  *
20952  * Returns: %TRUE if @address is a link-local address.
20953  * Since: 2.22
20954  */
20955
20956
20957 /**
20958  * g_inet_address_get_is_loopback:
20959  * @address: a #GInetAddress
20960  *
20961  * Tests whether @address is the loopback address for its family.
20962  *
20963  * Returns: %TRUE if @address is the loopback address for its family.
20964  * Since: 2.22
20965  */
20966
20967
20968 /**
20969  * g_inet_address_get_is_mc_global:
20970  * @address: a #GInetAddress
20971  *
20972  * Tests whether @address is a global multicast address.
20973  *
20974  * Returns: %TRUE if @address is a global multicast address.
20975  * Since: 2.22
20976  */
20977
20978
20979 /**
20980  * g_inet_address_get_is_mc_link_local:
20981  * @address: a #GInetAddress
20982  *
20983  * Tests whether @address is a link-local multicast address.
20984  *
20985  * Returns: %TRUE if @address is a link-local multicast address.
20986  * Since: 2.22
20987  */
20988
20989
20990 /**
20991  * g_inet_address_get_is_mc_node_local:
20992  * @address: a #GInetAddress
20993  *
20994  * Tests whether @address is a node-local multicast address.
20995  *
20996  * Returns: %TRUE if @address is a node-local multicast address.
20997  * Since: 2.22
20998  */
20999
21000
21001 /**
21002  * g_inet_address_get_is_mc_org_local:
21003  * @address: a #GInetAddress
21004  *
21005  * Tests whether @address is an organization-local multicast address.
21006  *
21007  * Returns: %TRUE if @address is an organization-local multicast address.
21008  * Since: 2.22
21009  */
21010
21011
21012 /**
21013  * g_inet_address_get_is_mc_site_local:
21014  * @address: a #GInetAddress
21015  *
21016  * Tests whether @address is a site-local multicast address.
21017  *
21018  * Returns: %TRUE if @address is a site-local multicast address.
21019  * Since: 2.22
21020  */
21021
21022
21023 /**
21024  * g_inet_address_get_is_multicast:
21025  * @address: a #GInetAddress
21026  *
21027  * Tests whether @address is a multicast address.
21028  *
21029  * Returns: %TRUE if @address is a multicast address.
21030  * Since: 2.22
21031  */
21032
21033
21034 /**
21035  * g_inet_address_get_is_site_local:
21036  * @address: a #GInetAddress
21037  *
21038  * Tests whether @address is a site-local address such as 10.0.0.1
21039  * (that is, the address identifies a host on a local network that can
21040  * not be reached directly from the Internet, but which may have
21041  * outgoing Internet connectivity via a NAT or firewall).
21042  *
21043  * Returns: %TRUE if @address is a site-local address.
21044  * Since: 2.22
21045  */
21046
21047
21048 /**
21049  * g_inet_address_get_native_size:
21050  * @address: a #GInetAddress
21051  *
21052  * Gets the size of the native raw binary address for @address. This
21053  * is the size of the data that you get from g_inet_address_to_bytes().
21054  *
21055  * Returns: the number of bytes used for the native version of @address.
21056  * Since: 2.22
21057  */
21058
21059
21060 /**
21061  * g_inet_address_mask_equal:
21062  * @mask: a #GInetAddressMask
21063  * @mask2: another #GInetAddressMask
21064  *
21065  * Tests if @mask and @mask2 are the same mask.
21066  *
21067  * Returns: whether @mask and @mask2 are the same mask
21068  * Since: 2.32
21069  */
21070
21071
21072 /**
21073  * g_inet_address_mask_get_address:
21074  * @mask: a #GInetAddressMask
21075  *
21076  * Gets @mask's base address
21077  *
21078  * Returns: (transfer none): @mask's base address
21079  * Since: 2.32
21080  */
21081
21082
21083 /**
21084  * g_inet_address_mask_get_family:
21085  * @mask: a #GInetAddressMask
21086  *
21087  * Gets the #GSocketFamily of @mask's address
21088  *
21089  * Returns: the #GSocketFamily of @mask's address
21090  * Since: 2.32
21091  */
21092
21093
21094 /**
21095  * g_inet_address_mask_get_length:
21096  * @mask: a #GInetAddressMask
21097  *
21098  * Gets @mask's length
21099  *
21100  * Returns: @mask's length
21101  * Since: 2.32
21102  */
21103
21104
21105 /**
21106  * g_inet_address_mask_matches:
21107  * @mask: a #GInetAddressMask
21108  * @address: a #GInetAddress
21109  *
21110  * Tests if @address falls within the range described by @mask.
21111  *
21112  * Returns: whether @address falls within the range described by @mask.
21113  * Since: 2.32
21114  */
21115
21116
21117 /**
21118  * g_inet_address_mask_new:
21119  * @addr: a #GInetAddress
21120  * @length: number of bits of @addr to use
21121  * @error: return location for #GError, or %NULL
21122  *
21123  * Creates a new #GInetAddressMask representing all addresses whose
21124  * first @length bits match @addr.
21125  *
21126  * Returns: a new #GInetAddressMask, or %NULL on error
21127  * Since: 2.32
21128  */
21129
21130
21131 /**
21132  * g_inet_address_mask_new_from_string:
21133  * @mask_string: an IP address or address/length string
21134  * @error: return location for #GError, or %NULL
21135  *
21136  * Parses @mask_string as an IP address and (optional) length, and
21137  * creates a new #GInetAddressMask. The length, if present, is
21138  * delimited by a "/". If it is not present, then the length is
21139  * assumed to be the full length of the address.
21140  *
21141  * Returns: a new #GInetAddressMask corresponding to @string, or %NULL on error.
21142  * Since: 2.32
21143  */
21144
21145
21146 /**
21147  * g_inet_address_mask_to_string:
21148  * @mask: a #GInetAddressMask
21149  *
21150  * Converts @mask back to its corresponding string form.
21151  *
21152  * Returns: a string corresponding to @mask.
21153  * Since: 2.32
21154  */
21155
21156
21157 /**
21158  * g_inet_address_new_any:
21159  * @family: the address family
21160  *
21161  * Creates a #GInetAddress for the "any" address (unassigned/"don't
21162  * care") for @family.
21163  *
21164  * Returns: a new #GInetAddress corresponding to the "any" address for @family.
21165  * Since: 2.22
21166  */
21167
21168
21169 /**
21170  * g_inet_address_new_from_bytes:
21171  * @bytes: (array) (element-type guint8): raw address data
21172  * @family: the address family of @bytes
21173  *
21174  * Creates a new #GInetAddress from the given @family and @bytes.
21175  * @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for
21176  * %G_SOCKET_FAMILY_IPV6.
21177  *
21178  * Returns: a new #GInetAddress corresponding to @family and @bytes.
21179  * Since: 2.22
21180  */
21181
21182
21183 /**
21184  * g_inet_address_new_from_string:
21185  * @string: a string representation of an IP address
21186  *
21187  * Parses @string as an IP address and creates a new #GInetAddress.
21188  *
21189  * Returns: a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed.
21190  * Since: 2.22
21191  */
21192
21193
21194 /**
21195  * g_inet_address_new_loopback:
21196  * @family: the address family
21197  *
21198  * Creates a #GInetAddress for the loopback address for @family.
21199  *
21200  * Returns: a new #GInetAddress corresponding to the loopback address for @family.
21201  * Since: 2.22
21202  */
21203
21204
21205 /**
21206  * g_inet_address_to_bytes: (skip)
21207  * @address: a #GInetAddress
21208  *
21209  * Gets the raw binary address data from @address.
21210  *
21211  * 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().
21212  * Since: 2.22
21213  */
21214
21215
21216 /**
21217  * g_inet_address_to_string:
21218  * @address: a #GInetAddress
21219  *
21220  * Converts @address to string form.
21221  *
21222  * Returns: a representation of @address as a string, which should be freed after use.
21223  * Since: 2.22
21224  */
21225
21226
21227 /**
21228  * g_inet_socket_address_get_address:
21229  * @address: a #GInetSocketAddress
21230  *
21231  * Gets @address's #GInetAddress.
21232  *
21233  * Returns: (transfer none): the #GInetAddress for @address, which must be g_object_ref()'d if it will be stored
21234  * Since: 2.22
21235  */
21236
21237
21238 /**
21239  * g_inet_socket_address_get_flowinfo:
21240  * @address: a %G_SOCKET_FAMILY_IPV6 #GInetSocketAddress
21241  *
21242  * Gets the <literal>sin6_flowinfo</literal> field from @address,
21243  * which must be an IPv6 address.
21244  *
21245  * Returns: the flowinfo field
21246  * Since: 2.32
21247  */
21248
21249
21250 /**
21251  * g_inet_socket_address_get_port:
21252  * @address: a #GInetSocketAddress
21253  *
21254  * Gets @address's port.
21255  *
21256  * Returns: the port for @address
21257  * Since: 2.22
21258  */
21259
21260
21261 /**
21262  * g_inet_socket_address_get_scope_id:
21263  * @address: a %G_SOCKET_FAMILY_IPV6 #GInetAddress
21264  *
21265  * Gets the <literal>sin6_scope_id</literal> field from @address,
21266  * which must be an IPv6 address.
21267  *
21268  * Returns: the scope id field
21269  * Since: 2.32
21270  */
21271
21272
21273 /**
21274  * g_inet_socket_address_new:
21275  * @address: a #GInetAddress
21276  * @port: a port number
21277  *
21278  * Creates a new #GInetSocketAddress for @address and @port.
21279  *
21280  * Returns: a new #GInetSocketAddress
21281  * Since: 2.22
21282  */
21283
21284
21285 /**
21286  * g_initable_init:
21287  * @initable: a #GInitable.
21288  * @cancellable: optional #GCancellable object, %NULL to ignore.
21289  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21290  *
21291  * Initializes the object implementing the interface.
21292  *
21293  * The object must be initialized before any real use after initial
21294  * construction, either with this function or g_async_initable_init_async().
21295  *
21296  * Implementations may also support cancellation. If @cancellable is not %NULL,
21297  * then initialization can be cancelled by triggering the cancellable object
21298  * from another thread. If the operation was cancelled, the error
21299  * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
21300  * the object doesn't support cancellable initialization the error
21301  * %G_IO_ERROR_NOT_SUPPORTED will be returned.
21302  *
21303  * If the object is not initialized, or initialization returns with an
21304  * error, then all operations on the object except g_object_ref() and
21305  * g_object_unref() are considered to be invalid, and have undefined
21306  * behaviour. See the <xref linkend="ginitable"/> section introduction
21307  * for more details.
21308  *
21309  * Implementations of this method must be idempotent, i.e. multiple calls
21310  * to this function with the same argument should return the same results.
21311  * Only the first call initializes the object, further calls return the result
21312  * of the first call. This is so that it's safe to implement the singleton
21313  * pattern in the GObject constructor function.
21314  *
21315  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
21316  * Since: 2.22
21317  */
21318
21319
21320 /**
21321  * g_initable_new:
21322  * @object_type: a #GType supporting #GInitable.
21323  * @cancellable: optional #GCancellable object, %NULL to ignore.
21324  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21325  * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
21326  * @...: the value if the first property, followed by and other property value pairs, and ended by %NULL.
21327  *
21328  * Helper function for constructing #GInitable object. This is
21329  * similar to g_object_new() but also initializes the object
21330  * and returns %NULL, setting an error on failure.
21331  *
21332  * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21333  * Since: 2.22
21334  */
21335
21336
21337 /**
21338  * g_initable_new_valist:
21339  * @object_type: a #GType supporting #GInitable.
21340  * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
21341  * @var_args: The var args list generated from @first_property_name.
21342  * @cancellable: optional #GCancellable object, %NULL to ignore.
21343  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21344  *
21345  * Helper function for constructing #GInitable object. This is
21346  * similar to g_object_new_valist() but also initializes the object
21347  * and returns %NULL, setting an error on failure.
21348  *
21349  * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21350  * Since: 2.22
21351  */
21352
21353
21354 /**
21355  * g_initable_newv:
21356  * @object_type: a #GType supporting #GInitable.
21357  * @n_parameters: the number of parameters in @parameters
21358  * @parameters: (array length=n_parameters): the parameters to use to construct the object
21359  * @cancellable: optional #GCancellable object, %NULL to ignore.
21360  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21361  *
21362  * Helper function for constructing #GInitable object. This is
21363  * similar to g_object_newv() but also initializes the object
21364  * and returns %NULL, setting an error on failure.
21365  *
21366  * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
21367  * Since: 2.22
21368  */
21369
21370
21371 /**
21372  * g_input_stream_clear_pending:
21373  * @stream: input stream
21374  *
21375  * Clears the pending flag on @stream.
21376  */
21377
21378
21379 /**
21380  * g_input_stream_close:
21381  * @stream: A #GInputStream.
21382  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21383  * @error: location to store the error occurring, or %NULL to ignore
21384  *
21385  * Closes the stream, releasing resources related to it.
21386  *
21387  * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
21388  * Closing a stream multiple times will not return an error.
21389  *
21390  * Streams will be automatically closed when the last reference
21391  * is dropped, but you might want to call this function to make sure
21392  * resources are released as early as possible.
21393  *
21394  * Some streams might keep the backing store of the stream (e.g. a file descriptor)
21395  * open after the stream is closed. See the documentation for the individual
21396  * stream for details.
21397  *
21398  * On failure the first error that happened will be reported, but the close
21399  * operation will finish as much as possible. A stream that failed to
21400  * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
21401  * is important to check and report the error to the user.
21402  *
21403  * If @cancellable is not %NULL, then the operation can be cancelled by
21404  * triggering the cancellable object from another thread. If the operation
21405  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21406  * Cancelling a close will still leave the stream closed, but some streams
21407  * can use a faster close that doesn't block to e.g. check errors.
21408  *
21409  * Returns: %TRUE on success, %FALSE on failure
21410  */
21411
21412
21413 /**
21414  * g_input_stream_close_async:
21415  * @stream: A #GInputStream.
21416  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21417  * @cancellable: (allow-none): optional cancellable object
21418  * @callback: (scope async): callback to call when the request is satisfied
21419  * @user_data: (closure): the data to pass to callback function
21420  *
21421  * Requests an asynchronous closes of the stream, releasing resources related to it.
21422  * When the operation is finished @callback will be called.
21423  * You can then call g_input_stream_close_finish() to get the result of the
21424  * operation.
21425  *
21426  * For behaviour details see g_input_stream_close().
21427  *
21428  * The asyncronous methods have a default fallback that uses threads to implement
21429  * asynchronicity, so they are optional for inheriting classes. However, if you
21430  * override one you must override all.
21431  */
21432
21433
21434 /**
21435  * g_input_stream_close_finish:
21436  * @stream: a #GInputStream.
21437  * @result: a #GAsyncResult.
21438  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21439  *
21440  * Finishes closing a stream asynchronously, started from g_input_stream_close_async().
21441  *
21442  * Returns: %TRUE if the stream was closed successfully.
21443  */
21444
21445
21446 /**
21447  * g_input_stream_has_pending:
21448  * @stream: input stream.
21449  *
21450  * Checks if an input stream has pending actions.
21451  *
21452  * Returns: %TRUE if @stream has pending actions.
21453  */
21454
21455
21456 /**
21457  * g_input_stream_is_closed:
21458  * @stream: input stream.
21459  *
21460  * Checks if an input stream is closed.
21461  *
21462  * Returns: %TRUE if the stream is closed.
21463  */
21464
21465
21466 /**
21467  * g_input_stream_read:
21468  * @stream: a #GInputStream.
21469  * @buffer: a buffer to read data into (which should be at least count bytes long).
21470  * @count: the number of bytes that will be read from the stream
21471  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21472  * @error: location to store the error occurring, or %NULL to ignore
21473  *
21474  * Tries to read @count bytes from the stream into the buffer starting at
21475  * @buffer. Will block during this read.
21476  *
21477  * If count is zero returns zero and does nothing. A value of @count
21478  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21479  *
21480  * On success, the number of bytes read into the buffer is returned.
21481  * It is not an error if this is not the same as the requested size, as it
21482  * can happen e.g. near the end of a file. Zero is returned on end of file
21483  * (or if @count is zero),  but never otherwise.
21484  *
21485  * If @cancellable is not %NULL, then the operation can be cancelled by
21486  * triggering the cancellable object from another thread. If the operation
21487  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21488  * operation was partially finished when the operation was cancelled the
21489  * partial result will be returned, without an error.
21490  *
21491  * On error -1 is returned and @error is set accordingly.
21492  *
21493  * Returns: Number of bytes read, or -1 on error, or 0 on end of file.
21494  */
21495
21496
21497 /**
21498  * g_input_stream_read_all:
21499  * @stream: a #GInputStream.
21500  * @buffer: a buffer to read data into (which should be at least count bytes long).
21501  * @count: the number of bytes that will be read from the stream
21502  * @bytes_read: (out): location to store the number of bytes that was read from the stream
21503  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21504  * @error: location to store the error occurring, or %NULL to ignore
21505  *
21506  * Tries to read @count bytes from the stream into the buffer starting at
21507  * @buffer. Will block during this read.
21508  *
21509  * This function is similar to g_input_stream_read(), except it tries to
21510  * read as many bytes as requested, only stopping on an error or end of stream.
21511  *
21512  * On a successful read of @count bytes, or if we reached the end of the
21513  * stream,  %TRUE is returned, and @bytes_read is set to the number of bytes
21514  * read into @buffer.
21515  *
21516  * If there is an error during the operation %FALSE is returned and @error
21517  * is set to indicate the error status, @bytes_read is updated to contain
21518  * the number of bytes read into @buffer before the error occurred.
21519  *
21520  * Returns: %TRUE on success, %FALSE if there was an error
21521  */
21522
21523
21524 /**
21525  * g_input_stream_read_async:
21526  * @stream: A #GInputStream.
21527  * @buffer: a buffer to read data into (which should be at least count bytes long).
21528  * @count: the number of bytes that will be read from the stream
21529  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21530  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21531  * @callback: (scope async): callback to call when the request is satisfied
21532  * @user_data: (closure): the data to pass to callback function
21533  *
21534  * Request an asynchronous read of @count bytes from the stream into the buffer
21535  * starting at @buffer. When the operation is finished @callback will be called.
21536  * You can then call g_input_stream_read_finish() to get the result of the
21537  * operation.
21538  *
21539  * During an async request no other sync and async calls are allowed on @stream, and will
21540  * result in %G_IO_ERROR_PENDING errors.
21541  *
21542  * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21543  *
21544  * On success, the number of bytes read into the buffer will be passed to the
21545  * callback. It is not an error if this is not the same as the requested size, as it
21546  * can happen e.g. near the end of a file, but generally we try to read
21547  * as many bytes as requested. Zero is returned on end of file
21548  * (or if @count is zero),  but never otherwise.
21549  *
21550  * Any outstanding i/o request with higher priority (lower numerical value) will
21551  * be executed before an outstanding request with lower priority. Default
21552  * priority is %G_PRIORITY_DEFAULT.
21553  *
21554  * The asyncronous methods have a default fallback that uses threads to implement
21555  * asynchronicity, so they are optional for inheriting classes. However, if you
21556  * override one you must override all.
21557  */
21558
21559
21560 /**
21561  * g_input_stream_read_bytes:
21562  * @stream: a #GInputStream.
21563  * @count: maximum number of bytes that will be read from the stream. Common values include 4096 and 8192.
21564  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21565  * @error: location to store the error occurring, or %NULL to ignore
21566  *
21567  * Like g_input_stream_read(), this tries to read @count bytes from
21568  * the stream in a blocking fashion. However, rather than reading into
21569  * a user-supplied buffer, this will create a new #GBytes containing
21570  * the data that was read. This may be easier to use from language
21571  * bindings.
21572  *
21573  * If count is zero, returns a zero-length #GBytes and does nothing. A
21574  * value of @count larger than %G_MAXSSIZE will cause a
21575  * %G_IO_ERROR_INVALID_ARGUMENT error.
21576  *
21577  * On success, a new #GBytes is returned. It is not an error if the
21578  * size of this object is not the same as the requested size, as it
21579  * can happen e.g. near the end of a file. A zero-length #GBytes is
21580  * returned on end of file (or if @count is zero), but never
21581  * otherwise.
21582  *
21583  * If @cancellable is not %NULL, then the operation can be cancelled by
21584  * triggering the cancellable object from another thread. If the operation
21585  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21586  * operation was partially finished when the operation was cancelled the
21587  * partial result will be returned, without an error.
21588  *
21589  * On error %NULL is returned and @error is set accordingly.
21590  *
21591  * Returns: a new #GBytes, or %NULL on error
21592  */
21593
21594
21595 /**
21596  * g_input_stream_read_bytes_async:
21597  * @stream: A #GInputStream.
21598  * @count: the number of bytes that will be read from the stream
21599  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21600  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21601  * @callback: (scope async): callback to call when the request is satisfied
21602  * @user_data: (closure): the data to pass to callback function
21603  *
21604  * Request an asynchronous read of @count bytes from the stream into a
21605  * new #GBytes. When the operation is finished @callback will be
21606  * called. You can then call g_input_stream_read_bytes_finish() to get the
21607  * result of the operation.
21608  *
21609  * During an async request no other sync and async calls are allowed
21610  * on @stream, and will result in %G_IO_ERROR_PENDING errors.
21611  *
21612  * A value of @count larger than %G_MAXSSIZE will cause a
21613  * %G_IO_ERROR_INVALID_ARGUMENT error.
21614  *
21615  * On success, the new #GBytes will be passed to the callback. It is
21616  * not an error if this is smaller than the requested size, as it can
21617  * happen e.g. near the end of a file, but generally we try to read as
21618  * many bytes as requested. Zero is returned on end of file (or if
21619  * @count is zero), but never otherwise.
21620  *
21621  * Any outstanding I/O request with higher priority (lower numerical
21622  * value) will be executed before an outstanding request with lower
21623  * priority. Default priority is %G_PRIORITY_DEFAULT.
21624  */
21625
21626
21627 /**
21628  * g_input_stream_read_bytes_finish:
21629  * @stream: a #GInputStream.
21630  * @result: a #GAsyncResult.
21631  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21632  *
21633  * Finishes an asynchronous stream read-into-#GBytes operation.
21634  *
21635  * Returns: the newly-allocated #GBytes, or %NULL on error
21636  */
21637
21638
21639 /**
21640  * g_input_stream_read_finish:
21641  * @stream: a #GInputStream.
21642  * @result: a #GAsyncResult.
21643  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21644  *
21645  * Finishes an asynchronous stream read operation.
21646  *
21647  * Returns: number of bytes read in, or -1 on error, or 0 on end of file.
21648  */
21649
21650
21651 /**
21652  * g_input_stream_set_pending:
21653  * @stream: input stream
21654  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21655  *
21656  * Sets @stream to have actions pending. If the pending flag is
21657  * already set or @stream is closed, it will return %FALSE and set
21658  * @error.
21659  *
21660  * Returns: %TRUE if pending was previously unset and is now set.
21661  */
21662
21663
21664 /**
21665  * g_input_stream_skip:
21666  * @stream: a #GInputStream.
21667  * @count: the number of bytes that will be skipped from the stream
21668  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21669  * @error: location to store the error occurring, or %NULL to ignore
21670  *
21671  * Tries to skip @count bytes from the stream. Will block during the operation.
21672  *
21673  * This is identical to g_input_stream_read(), from a behaviour standpoint,
21674  * but the bytes that are skipped are not returned to the user. Some
21675  * streams have an implementation that is more efficient than reading the data.
21676  *
21677  * This function is optional for inherited classes, as the default implementation
21678  * emulates it using read.
21679  *
21680  * If @cancellable is not %NULL, then the operation can be cancelled by
21681  * triggering the cancellable object from another thread. If the operation
21682  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21683  * operation was partially finished when the operation was cancelled the
21684  * partial result will be returned, without an error.
21685  *
21686  * Returns: Number of bytes skipped, or -1 on error
21687  */
21688
21689
21690 /**
21691  * g_input_stream_skip_async:
21692  * @stream: A #GInputStream.
21693  * @count: the number of bytes that will be skipped from the stream
21694  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21695  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21696  * @callback: (scope async): callback to call when the request is satisfied
21697  * @user_data: (closure): the data to pass to callback function
21698  *
21699  * Request an asynchronous skip of @count bytes from the stream.
21700  * When the operation is finished @callback will be called.
21701  * You can then call g_input_stream_skip_finish() to get the result
21702  * of the operation.
21703  *
21704  * During an async request no other sync and async calls are allowed,
21705  * and will result in %G_IO_ERROR_PENDING errors.
21706  *
21707  * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21708  *
21709  * On success, the number of bytes skipped will be passed to the callback.
21710  * It is not an error if this is not the same as the requested size, as it
21711  * can happen e.g. near the end of a file, but generally we try to skip
21712  * as many bytes as requested. Zero is returned on end of file
21713  * (or if @count is zero), but never otherwise.
21714  *
21715  * Any outstanding i/o request with higher priority (lower numerical value)
21716  * will be executed before an outstanding request with lower priority.
21717  * Default priority is %G_PRIORITY_DEFAULT.
21718  *
21719  * The asynchronous methods have a default fallback that uses threads to
21720  * implement asynchronicity, so they are optional for inheriting classes.
21721  * However, if you override one, you must override all.
21722  */
21723
21724
21725 /**
21726  * g_input_stream_skip_finish:
21727  * @stream: a #GInputStream.
21728  * @result: a #GAsyncResult.
21729  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21730  *
21731  * Finishes a stream skip operation.
21732  *
21733  * Returns: the size of the bytes skipped, or %-1 on error.
21734  */
21735
21736
21737 /**
21738  * g_io_error_from_errno:
21739  * @err_no: Error number as defined in errno.h.
21740  *
21741  * Converts errno.h error codes into GIO error codes.
21742  *
21743  * Returns: #GIOErrorEnum value for the given errno.h error number.
21744  */
21745
21746
21747 /**
21748  * g_io_error_from_win32_error:
21749  * @error_code: Windows error number.
21750  *
21751  * Converts some common error codes into GIO error codes. The
21752  * fallback value G_IO_ERROR_FAILED is returned for error codes not
21753  * handled.
21754  *
21755  * Returns: #GIOErrorEnum value for the given error number.
21756  * Since: 2.26
21757  */
21758
21759
21760 /**
21761  * g_io_error_quark:
21762  *
21763  * Gets the GIO Error Quark.
21764  *
21765  * Returns: a #GQuark.
21766  */
21767
21768
21769 /**
21770  * g_io_extension_get_name:
21771  * @extension: a #GIOExtension
21772  *
21773  * Gets the name under which @extension was registered.
21774  *
21775  * Note that the same type may be registered as extension
21776  * for multiple extension points, under different names.
21777  *
21778  * Returns: the name of @extension.
21779  */
21780
21781
21782 /**
21783  * g_io_extension_get_priority:
21784  * @extension: a #GIOExtension
21785  *
21786  * Gets the priority with which @extension was registered.
21787  *
21788  * Returns: the priority of @extension
21789  */
21790
21791
21792 /**
21793  * g_io_extension_get_type:
21794  * @extension: a #GIOExtension
21795  *
21796  * Gets the type associated with @extension.
21797  *
21798  * Returns: the type of @extension
21799  */
21800
21801
21802 /**
21803  * g_io_extension_point_get_extension_by_name:
21804  * @extension_point: a #GIOExtensionPoint
21805  * @name: the name of the extension to get
21806  *
21807  * Finds a #GIOExtension for an extension point by name.
21808  *
21809  * Returns: (transfer none): the #GIOExtension for @extension_point that has the given name, or %NULL if there is no extension with that name
21810  */
21811
21812
21813 /**
21814  * g_io_extension_point_get_extensions:
21815  * @extension_point: a #GIOExtensionPoint
21816  *
21817  * Gets a list of all extensions that implement this extension point.
21818  * The list is sorted by priority, beginning with the highest priority.
21819  *
21820  * Returns: (element-type GIOExtension) (transfer none): a #GList of #GIOExtension<!-- -->s. The list is owned by GIO and should not be modified.
21821  */
21822
21823
21824 /**
21825  * g_io_extension_point_get_required_type:
21826  * @extension_point: a #GIOExtensionPoint
21827  *
21828  * Gets the required type for @extension_point.
21829  *
21830  * Returns: the #GType that all implementations must have, or #G_TYPE_INVALID if the extension point has no required type
21831  */
21832
21833
21834 /**
21835  * g_io_extension_point_implement:
21836  * @extension_point_name: the name of the extension point
21837  * @type: the #GType to register as extension
21838  * @extension_name: the name for the extension
21839  * @priority: the priority for the extension
21840  *
21841  * Registers @type as extension for the extension point with name
21842  * @extension_point_name.
21843  *
21844  * If @type has already been registered as an extension for this
21845  * extension point, the existing #GIOExtension object is returned.
21846  *
21847  * Returns: (transfer none): a #GIOExtension object for #GType
21848  */
21849
21850
21851 /**
21852  * g_io_extension_point_lookup:
21853  * @name: the name of the extension point
21854  *
21855  * Looks up an existing extension point.
21856  *
21857  * Returns: (transfer none): the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name.
21858  */
21859
21860
21861 /**
21862  * g_io_extension_point_register:
21863  * @name: The name of the extension point
21864  *
21865  * Registers an extension point.
21866  *
21867  * Returns: (transfer none): the new #GIOExtensionPoint. This object is owned by GIO and should not be freed.
21868  */
21869
21870
21871 /**
21872  * g_io_extension_point_set_required_type:
21873  * @extension_point: a #GIOExtensionPoint
21874  * @type: the #GType to require
21875  *
21876  * Sets the required type for @extension_point to @type.
21877  * All implementations must henceforth have this type.
21878  */
21879
21880
21881 /**
21882  * g_io_extension_ref_class:
21883  * @extension: a #GIOExtension
21884  *
21885  * Gets a reference to the class for the type that is
21886  * associated with @extension.
21887  *
21888  * Returns: (transfer full): the #GTypeClass for the type of @extension
21889  */
21890
21891
21892 /**
21893  * g_io_module_new:
21894  * @filename: filename of the shared library module.
21895  *
21896  * Creates a new GIOModule that will load the specific
21897  * shared library when in use.
21898  *
21899  * Returns: a #GIOModule from given @filename, or %NULL on error.
21900  */
21901
21902
21903 /**
21904  * g_io_module_scope_block:
21905  * @scope: a module loading scope
21906  * @basename: the basename to block
21907  *
21908  * Block modules with the given @basename from being loaded when
21909  * this scope is used with g_io_modules_scan_all_in_directory_with_scope()
21910  * or g_io_modules_load_all_in_directory_with_scope().
21911  *
21912  * Since: 2.30
21913  */
21914
21915
21916 /**
21917  * g_io_module_scope_free:
21918  * @scope: a module loading scope
21919  *
21920  * Free a module scope.
21921  *
21922  * Since: 2.30
21923  */
21924
21925
21926 /**
21927  * g_io_module_scope_new:
21928  * @flags: flags for the new scope
21929  *
21930  * Create a new scope for loading of IO modules. A scope can be used for
21931  * blocking duplicate modules, or blocking a module you don't want to load.
21932  *
21933  * Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules
21934  * which have the same base name as a module that has already been seen
21935  * in this scope.
21936  *
21937  * Returns: (transfer full): the new module scope
21938  * Since: 2.30
21939  */
21940
21941
21942 /**
21943  * g_io_modules_load_all_in_directory:
21944  * @dirname: pathname for a directory containing modules to load.
21945  *
21946  * Loads all the modules in the specified directory.
21947  *
21948  * If don't require all modules to be initialized (and thus registering
21949  * all gtypes) then you can use g_io_modules_scan_all_in_directory()
21950  * which allows delayed/lazy loading of modules.
21951  *
21952  * 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().
21953  */
21954
21955
21956 /**
21957  * g_io_modules_load_all_in_directory_with_scope:
21958  * @dirname: pathname for a directory containing modules to load.
21959  * @scope: a scope to use when scanning the modules.
21960  *
21961  * Loads all the modules in the specified directory.
21962  *
21963  * If don't require all modules to be initialized (and thus registering
21964  * all gtypes) then you can use g_io_modules_scan_all_in_directory()
21965  * which allows delayed/lazy loading of modules.
21966  *
21967  * 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().
21968  * Since: 2.30
21969  */
21970
21971
21972 /**
21973  * g_io_modules_scan_all_in_directory:
21974  * @dirname: pathname for a directory containing modules to scan.
21975  *
21976  * Scans all the modules in the specified directory, ensuring that
21977  * any extension point implemented by a module is registered.
21978  *
21979  * This may not actually load and initialize all the types in each
21980  * module, some modules may be lazily loaded and initialized when
21981  * an extension point it implementes is used with e.g.
21982  * g_io_extension_point_get_extensions() or
21983  * g_io_extension_point_get_extension_by_name().
21984  *
21985  * If you need to guarantee that all types are loaded in all the modules,
21986  * use g_io_modules_load_all_in_directory().
21987  *
21988  * Since: 2.24
21989  */
21990
21991
21992 /**
21993  * g_io_modules_scan_all_in_directory_with_scope:
21994  * @dirname: pathname for a directory containing modules to scan.
21995  * @scope: a scope to use when scanning the modules
21996  *
21997  * Scans all the modules in the specified directory, ensuring that
21998  * any extension point implemented by a module is registered.
21999  *
22000  * This may not actually load and initialize all the types in each
22001  * module, some modules may be lazily loaded and initialized when
22002  * an extension point it implementes is used with e.g.
22003  * g_io_extension_point_get_extensions() or
22004  * g_io_extension_point_get_extension_by_name().
22005  *
22006  * If you need to guarantee that all types are loaded in all the modules,
22007  * use g_io_modules_load_all_in_directory().
22008  *
22009  * Since: 2.30
22010  */
22011
22012
22013 /**
22014  * g_io_scheduler_cancel_all_jobs:
22015  *
22016  * Cancels all cancellable I/O jobs.
22017  *
22018  * A job is cancellable if a #GCancellable was passed into
22019  * g_io_scheduler_push_job().
22020  */
22021
22022
22023 /**
22024  * g_io_scheduler_job_send_to_mainloop:
22025  * @job: a #GIOSchedulerJob
22026  * @func: a #GSourceFunc callback that will be called in the original thread
22027  * @user_data: data to pass to @func
22028  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22029  *
22030  * Used from an I/O job to send a callback to be run in the thread
22031  * that the job was started from, waiting for the result (and thus
22032  * blocking the I/O job).
22033  *
22034  * Returns: The return value of @func
22035  */
22036
22037
22038 /**
22039  * g_io_scheduler_job_send_to_mainloop_async:
22040  * @job: a #GIOSchedulerJob
22041  * @func: a #GSourceFunc callback that will be called in the original thread
22042  * @user_data: data to pass to @func
22043  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22044  *
22045  * Used from an I/O job to send a callback to be run asynchronously in
22046  * the thread that the job was started from. The callback will be run
22047  * when the main loop is available, but at that time the I/O job might
22048  * have finished. The return value from the callback is ignored.
22049  *
22050  * Note that if you are passing the @user_data from g_io_scheduler_push_job()
22051  * on to this function you have to ensure that it is not freed before
22052  * @func is called, either by passing %NULL as @notify to
22053  * g_io_scheduler_push_job() or by using refcounting for @user_data.
22054  */
22055
22056
22057 /**
22058  * g_io_scheduler_push_job:
22059  * @job_func: a #GIOSchedulerJobFunc.
22060  * @user_data: data to pass to @job_func
22061  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
22062  * @io_priority: the <link linkend="gioscheduler">I/O priority</link> of the request.
22063  * @cancellable: optional #GCancellable object, %NULL to ignore.
22064  *
22065  * Schedules the I/O job to run in another thread.
22066  *
22067  * @notify will be called on @user_data after @job_func has returned,
22068  * regardless whether the job was cancelled or has run to completion.
22069  *
22070  * If @cancellable is not %NULL, it can be used to cancel the I/O job
22071  * by calling g_cancellable_cancel() or by calling
22072  * g_io_scheduler_cancel_all_jobs().
22073  */
22074
22075
22076 /**
22077  * g_io_stream_clear_pending:
22078  * @stream: a #GIOStream
22079  *
22080  * Clears the pending flag on @stream.
22081  *
22082  * Since: 2.22
22083  */
22084
22085
22086 /**
22087  * g_io_stream_close:
22088  * @stream: a #GIOStream
22089  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
22090  * @error: location to store the error occurring, or %NULL to ignore
22091  *
22092  * Closes the stream, releasing resources related to it. This will also
22093  * closes the individual input and output streams, if they are not already
22094  * closed.
22095  *
22096  * Once the stream is closed, all other operations will return
22097  * %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
22098  * return an error.
22099  *
22100  * Closing a stream will automatically flush any outstanding buffers
22101  * in the stream.
22102  *
22103  * Streams will be automatically closed when the last reference
22104  * is dropped, but you might want to call this function to make sure
22105  * resources are released as early as possible.
22106  *
22107  * Some streams might keep the backing store of the stream (e.g. a file
22108  * descriptor) open after the stream is closed. See the documentation for
22109  * the individual stream for details.
22110  *
22111  * On failure the first error that happened will be reported, but the
22112  * close operation will finish as much as possible. A stream that failed
22113  * to close will still return %G_IO_ERROR_CLOSED for all operations.
22114  * Still, it is important to check and report the error to the user,
22115  * otherwise there might be a loss of data as all data might not be written.
22116  *
22117  * If @cancellable is not NULL, then the operation can be cancelled by
22118  * triggering the cancellable object from another thread. If the operation
22119  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
22120  * Cancelling a close will still leave the stream closed, but some streams
22121  * can use a faster close that doesn't block to e.g. check errors.
22122  *
22123  * The default implementation of this method just calls close on the
22124  * individual input/output streams.
22125  *
22126  * Returns: %TRUE on success, %FALSE on failure
22127  * Since: 2.22
22128  */
22129
22130
22131 /**
22132  * g_io_stream_close_async:
22133  * @stream: a #GIOStream
22134  * @io_priority: the io priority of the request
22135  * @cancellable: (allow-none): optional cancellable object
22136  * @callback: (scope async): callback to call when the request is satisfied
22137  * @user_data: (closure): the data to pass to callback function
22138  *
22139  * Requests an asynchronous close of the stream, releasing resources
22140  * related to it. When the operation is finished @callback will be
22141  * called. You can then call g_io_stream_close_finish() to get
22142  * the result of the operation.
22143  *
22144  * For behaviour details see g_io_stream_close().
22145  *
22146  * The asynchronous methods have a default fallback that uses threads
22147  * to implement asynchronicity, so they are optional for inheriting
22148  * classes. However, if you override one you must override all.
22149  *
22150  * Since: 2.22
22151  */
22152
22153
22154 /**
22155  * g_io_stream_close_finish:
22156  * @stream: a #GIOStream
22157  * @result: a #GAsyncResult
22158  * @error: a #GError location to store the error occurring, or %NULL to ignore
22159  *
22160  * Closes a stream.
22161  *
22162  * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
22163  * Since: 2.22
22164  */
22165
22166
22167 /**
22168  * g_io_stream_get_input_stream:
22169  * @stream: a #GIOStream
22170  *
22171  * Gets the input stream for this object. This is used
22172  * for reading.
22173  *
22174  * Returns: (transfer none): a #GInputStream, owned by the #GIOStream. Do not free.
22175  * Since: 2.22
22176  */
22177
22178
22179 /**
22180  * g_io_stream_get_output_stream:
22181  * @stream: a #GIOStream
22182  *
22183  * Gets the output stream for this object. This is used for
22184  * writing.
22185  *
22186  * Returns: (transfer none): a #GOutputStream, owned by the #GIOStream. Do not free.
22187  * Since: 2.22
22188  */
22189
22190
22191 /**
22192  * g_io_stream_has_pending:
22193  * @stream: a #GIOStream
22194  *
22195  * Checks if a stream has pending actions.
22196  *
22197  * Returns: %TRUE if @stream has pending actions.
22198  * Since: 2.22
22199  */
22200
22201
22202 /**
22203  * g_io_stream_is_closed:
22204  * @stream: a #GIOStream
22205  *
22206  * Checks if a stream is closed.
22207  *
22208  * Returns: %TRUE if the stream is closed.
22209  * Since: 2.22
22210  */
22211
22212
22213 /**
22214  * g_io_stream_set_pending:
22215  * @stream: a #GIOStream
22216  * @error: a #GError location to store the error occurring, or %NULL to ignore
22217  *
22218  * Sets @stream to have actions pending. If the pending flag is
22219  * already set or @stream is closed, it will return %FALSE and set
22220  * @error.
22221  *
22222  * Returns: %TRUE if pending was previously unset and is now set.
22223  * Since: 2.22
22224  */
22225
22226
22227 /**
22228  * g_io_stream_splice_async:
22229  * @stream1: a #GIOStream.
22230  * @stream2: a #GIOStream.
22231  * @flags: a set of #GIOStreamSpliceFlags.
22232  * @io_priority: the io priority of the request.
22233  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22234  * @callback: (scope async): a #GAsyncReadyCallback.
22235  * @user_data: (closure): user data passed to @callback.
22236  *
22237  * Asyncronously splice the output stream of @stream1 to the input stream of
22238  * @stream2, and splice the output stream of @stream2 to the input stream of
22239  * @stream1.
22240  *
22241  * When the operation is finished @callback will be called.
22242  * You can then call g_io_stream_splice_finish() to get the
22243  * result of the operation.
22244  *
22245  * Since: 2.28
22246  */
22247
22248
22249 /**
22250  * g_io_stream_splice_finish:
22251  * @result: a #GAsyncResult.
22252  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22253  *
22254  * Finishes an asynchronous io stream splice operation.
22255  *
22256  * Returns: %TRUE on success, %FALSE otherwise.
22257  * Since: 2.28
22258  */
22259
22260
22261 /**
22262  * g_keyfile_settings_backend_new:
22263  * @filename: the filename of the keyfile
22264  * @root_path: the path under which all settings keys appear
22265  * @root_group: (allow-none): the group name corresponding to @root_path, or %NULL
22266  *
22267  * Creates a keyfile-backed #GSettingsBackend.
22268  *
22269  * The filename of the keyfile to use is given by @filename.
22270  *
22271  * All settings read to or written from the backend must fall under the
22272  * path given in @root_path (which must start and end with a slash and
22273  * not contain two consecutive slashes).  @root_path may be "/".
22274  *
22275  * If @root_group is non-%NULL then it specifies the name of the keyfile
22276  * group used for keys that are written directly below @root_path.  For
22277  * example, if @root_path is "/apps/example/" and @root_group is
22278  * "toplevel", then settings the key "/apps/example/enabled" to a value
22279  * of %TRUE will cause the following to appear in the keyfile:
22280  *
22281  * |[
22282  *   [toplevel]
22283  *   enabled=true
22284  * ]|
22285  *
22286  * If @root_group is %NULL then it is not permitted to store keys
22287  * directly below the @root_path.
22288  *
22289  * For keys not stored directly below @root_path (ie: in a sub-path),
22290  * the name of the subpath (with the final slash stripped) is used as
22291  * the name of the keyfile group.  To continue the example, if
22292  * "/apps/example/profiles/default/font-size" were set to
22293  * 12 then the following would appear in the keyfile:
22294  *
22295  * |[
22296  *   [profiles/default]
22297  *   font-size=12
22298  * ]|
22299  *
22300  * The backend will refuse writes (and return writability as being
22301  * %FALSE) for keys outside of @root_path and, in the event that
22302  * @root_group is %NULL, also for keys directly under @root_path.
22303  * Writes will also be refused if the backend detects that it has the
22304  * inability to rewrite the keyfile (ie: the containing directory is not
22305  * writable).
22306  *
22307  * There is no checking done for your key namespace clashing with the
22308  * syntax of the key file format.  For example, if you have '[' or ']'
22309  * characters in your path names or '=' in your key names you may be in
22310  * trouble.
22311  *
22312  * Returns: (transfer full): a keyfile-backed #GSettingsBackend
22313  */
22314
22315
22316 /**
22317  * g_loadable_icon_load:
22318  * @icon: a #GLoadableIcon.
22319  * @size: an integer.
22320  * @type: (out) (allow-none): a location to store the type of the loaded icon, %NULL to ignore.
22321  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22322  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22323  *
22324  * Loads a loadable icon. For the asynchronous version of this function,
22325  * see g_loadable_icon_load_async().
22326  *
22327  * Returns: (transfer full): a #GInputStream to read the icon from.
22328  */
22329
22330
22331 /**
22332  * g_loadable_icon_load_async:
22333  * @icon: a #GLoadableIcon.
22334  * @size: an integer.
22335  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22336  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
22337  * @user_data: (closure): the data to pass to callback function
22338  *
22339  * Loads an icon asynchronously. To finish this function, see
22340  * g_loadable_icon_load_finish(). For the synchronous, blocking
22341  * version of this function, see g_loadable_icon_load().
22342  */
22343
22344
22345 /**
22346  * g_loadable_icon_load_finish:
22347  * @icon: a #GLoadableIcon.
22348  * @res: a #GAsyncResult.
22349  * @type: a location to store the type of the loaded icon, %NULL to ignore.
22350  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22351  *
22352  * Finishes an asynchronous icon load started in g_loadable_icon_load_async().
22353  *
22354  * Returns: (transfer full): a #GInputStream to read the icon from.
22355  */
22356
22357
22358 /**
22359  * g_local_vfs_new:
22360  *
22361  * Returns a new #GVfs handle for a local vfs.
22362  *
22363  * Returns: a new #GVfs handle.
22364  */
22365
22366
22367 /**
22368  * g_memory_input_stream_add_bytes:
22369  * @stream: a #GMemoryInputStream
22370  * @bytes: input data
22371  *
22372  * Appends @bytes to data that can be read from the input stream.
22373  *
22374  * Since: 2.34
22375  */
22376
22377
22378 /**
22379  * g_memory_input_stream_add_data:
22380  * @stream: a #GMemoryInputStream
22381  * @data: (array length=len) (element-type guint8) (transfer full): input data
22382  * @len: length of the data, may be -1 if @data is a nul-terminated string
22383  * @destroy: (allow-none): function that is called to free @data, or %NULL
22384  *
22385  * Appends @data to data that can be read from the input stream
22386  */
22387
22388
22389 /**
22390  * g_memory_input_stream_new:
22391  *
22392  * Creates a new empty #GMemoryInputStream.
22393  *
22394  * Returns: a new #GInputStream
22395  */
22396
22397
22398 /**
22399  * g_memory_input_stream_new_from_bytes:
22400  * @bytes: a #GBytes
22401  *
22402  * Creates a new #GMemoryInputStream with data from the given @bytes.
22403  *
22404  * Returns: new #GInputStream read from @bytes
22405  * Since: 2.34
22406  */
22407
22408
22409 /**
22410  * g_memory_input_stream_new_from_data:
22411  * @data: (array length=len) (element-type guint8) (transfer full): input data
22412  * @len: length of the data, may be -1 if @data is a nul-terminated string
22413  * @destroy: (allow-none): function that is called to free @data, or %NULL
22414  *
22415  * Creates a new #GMemoryInputStream with data in memory of a given size.
22416  *
22417  * Returns: new #GInputStream read from @data of @len bytes.
22418  */
22419
22420
22421 /**
22422  * g_memory_output_stream_get_data:
22423  * @ostream: a #GMemoryOutputStream
22424  *
22425  * Gets any loaded data from the @ostream.
22426  *
22427  * Note that the returned pointer may become invalid on the next
22428  * write or truncate operation on the stream.
22429  *
22430  * Returns: (transfer none): pointer to the stream's data
22431  */
22432
22433
22434 /**
22435  * g_memory_output_stream_get_data_size:
22436  * @ostream: a #GMemoryOutputStream
22437  *
22438  * Returns the number of bytes from the start up
22439  * to including the last byte written in the stream
22440  * that has not been truncated away.
22441  *
22442  * Returns: the number of bytes written to the stream
22443  * Since: 2.18
22444  */
22445
22446
22447 /**
22448  * g_memory_output_stream_get_size:
22449  * @ostream: a #GMemoryOutputStream
22450  *
22451  * Gets the size of the currently allocated data area (available from
22452  * g_memory_output_stream_get_data()). If the stream isn't
22453  * growable (no realloc was passed to g_memory_output_stream_new()) then
22454  * this is the maximum size of the stream and further writes
22455  * will return %G_IO_ERROR_NO_SPACE.
22456  *
22457  * Note that for growable streams the returned size may become invalid on
22458  * the next write or truncate operation on the stream.
22459  *
22460  * If you want the number of bytes currently written to the stream, use
22461  * g_memory_output_stream_get_data_size().
22462  *
22463  * Returns: the number of bytes allocated for the data buffer
22464  */
22465
22466
22467 /**
22468  * g_memory_output_stream_new: (skip)
22469  * @data: (allow-none): pointer to a chunk of memory to use, or %NULL
22470  * @size: the size of @data
22471  * @realloc_function: (allow-none): a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
22472  * @destroy_function: (allow-none): a function to be called on @data when the stream is finalized, or %NULL
22473  *
22474  * Creates a new #GMemoryOutputStream.
22475  *
22476  * If @data is non-%NULL, the stream  will use that for its internal storage.
22477  * If @realloc_fn is non-%NULL, it will be used for resizing the internal
22478  * storage when necessary. To construct a fixed-size output stream,
22479  * pass %NULL as @realloc_fn.
22480  *
22481  * |[
22482  * /&ast; a stream that can grow &ast;/
22483  * stream = g_memory_output_stream_new (NULL, 0, realloc, free);
22484  *
22485  * /&ast; another stream that can grow &ast;/
22486  * stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
22487  *
22488  * /&ast; a fixed-size stream &ast;/
22489  * data = malloc (200);
22490  * stream3 = g_memory_output_stream_new (data, 200, NULL, free);
22491  * ]|
22492  *
22493  * Returns: A newly created #GMemoryOutputStream object.
22494  */
22495
22496
22497 /**
22498  * g_memory_output_stream_steal_as_bytes:
22499  * @ostream: a #GMemoryOutputStream
22500  *
22501  * Returns data from the @ostream as a #GBytes. @ostream must be
22502  * closed before calling this function.
22503  *
22504  * Returns: (transfer full): the stream's data
22505  * Since: 2.34
22506  */
22507
22508
22509 /**
22510  * g_memory_output_stream_steal_data:
22511  * @ostream: a #GMemoryOutputStream
22512  *
22513  * Gets any loaded data from the @ostream. Ownership of the data
22514  * is transferred to the caller; when no longer needed it must be
22515  * freed using the free function set in @ostream's
22516  * #GMemoryOutputStream:destroy-function property.
22517  *
22518  * @ostream must be closed before calling this function.
22519  *
22520  * Returns: (transfer full): the stream's data
22521  * Since: 2.26
22522  */
22523
22524
22525 /**
22526  * g_memory_settings_backend_new:
22527  *
22528  * Creates a memory-backed #GSettingsBackend.
22529  *
22530  * This backend allows changes to settings, but does not write them
22531  * to any backing storage, so the next time you run your application,
22532  * the memory backend will start out with the default values again.
22533  *
22534  * Returns: (transfer full): a newly created #GSettingsBackend
22535  * Since: 2.28
22536  */
22537
22538
22539 /**
22540  * g_menu_append:
22541  * @menu: a #GMenu
22542  * @label: (allow-none): the section label, or %NULL
22543  * @detailed_action: (allow-none): the detailed action string, or %NULL
22544  *
22545  * Convenience function for appending a normal menu item to the end of
22546  * @menu.  Combine g_menu_item_new() and g_menu_insert_item() for a more
22547  * flexible alternative.
22548  *
22549  * Since: 2.32
22550  */
22551
22552
22553 /**
22554  * g_menu_append_item:
22555  * @menu: a #GMenu
22556  * @item: a #GMenuItem to append
22557  *
22558  * Appends @item to the end of @menu.
22559  *
22560  * See g_menu_insert_item() for more information.
22561  *
22562  * Since: 2.32
22563  */
22564
22565
22566 /**
22567  * g_menu_append_section:
22568  * @menu: a #GMenu
22569  * @label: (allow-none): the section label, or %NULL
22570  * @section: a #GMenuModel with the items of the section
22571  *
22572  * Convenience function for appending a section menu item to the end of
22573  * @menu.  Combine g_menu_item_new_section() and g_menu_insert_item() for a
22574  * more flexible alternative.
22575  *
22576  * Since: 2.32
22577  */
22578
22579
22580 /**
22581  * g_menu_append_submenu:
22582  * @menu: a #GMenu
22583  * @label: (allow-none): the section label, or %NULL
22584  * @submenu: a #GMenuModel with the items of the submenu
22585  *
22586  * Convenience function for appending a submenu menu item to the end of
22587  * @menu.  Combine g_menu_item_new_submenu() and g_menu_insert_item() for a
22588  * more flexible alternative.
22589  *
22590  * Since: 2.32
22591  */
22592
22593
22594 /**
22595  * g_menu_attribute_iter_get_name:
22596  * @iter: a #GMenuAttributeIter
22597  *
22598  * Gets the name of the attribute at the current iterator position, as
22599  * a string.
22600  *
22601  * The iterator is not advanced.
22602  *
22603  * Returns: the name of the attribute
22604  * Since: 2.32
22605  */
22606
22607
22608 /**
22609  * g_menu_attribute_iter_get_next:
22610  * @iter: a #GMenuAttributeIter
22611  * @out_name: (out) (allow-none) (transfer none): the type of the attribute
22612  * @value: (out) (allow-none) (transfer full): the attribute value
22613  *
22614  * This function combines g_menu_attribute_iter_next() with
22615  * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().
22616  *
22617  * First the iterator is advanced to the next (possibly first) attribute.
22618  * If that fails, then %FALSE is returned and there are no other
22619  * effects.
22620  *
22621  * If successful, @name and @value are set to the name and value of the
22622  * attribute that has just been advanced to.  At this point,
22623  * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will
22624  * return the same values again.
22625  *
22626  * The value returned in @name remains valid for as long as the iterator
22627  * remains at the current position.  The value returned in @value must
22628  * be unreffed using g_variant_unref() when it is no longer in use.
22629  *
22630  * Returns: %TRUE on success, or %FALSE if there is no additional attribute
22631  * Since: 2.32
22632  */
22633
22634
22635 /**
22636  * g_menu_attribute_iter_get_value:
22637  * @iter: a #GMenuAttributeIter
22638  *
22639  * Gets the value of the attribute at the current iterator position.
22640  *
22641  * The iterator is not advanced.
22642  *
22643  * Returns: (transfer full): the value of the current attribute
22644  * Since: 2.32
22645  */
22646
22647
22648 /**
22649  * g_menu_attribute_iter_next:
22650  * @iter: a #GMenuAttributeIter
22651  *
22652  * Attempts to advance the iterator to the next (possibly first)
22653  * attribute.
22654  *
22655  * %TRUE is returned on success, or %FALSE if there are no more
22656  * attributes.
22657  *
22658  * You must call this function when you first acquire the iterator
22659  * to advance it to the first attribute (and determine if the first
22660  * attribute exists at all).
22661  *
22662  * Returns: %TRUE on success, or %FALSE when there are no more attributes
22663  * Since: 2.32
22664  */
22665
22666
22667 /**
22668  * g_menu_freeze:
22669  * @menu: a #GMenu
22670  *
22671  * Marks @menu as frozen.
22672  *
22673  * After the menu is frozen, it is an error to attempt to make any
22674  * changes to it.  In effect this means that the #GMenu API must no
22675  * longer be used.
22676  *
22677  * This function causes g_menu_model_is_mutable() to begin returning
22678  * %FALSE, which has some positive performance implications.
22679  *
22680  * Since: 2.32
22681  */
22682
22683
22684 /**
22685  * g_menu_insert:
22686  * @menu: a #GMenu
22687  * @position: the position at which to insert the item
22688  * @label: (allow-none): the section label, or %NULL
22689  * @detailed_action: (allow-none): the detailed action string, or %NULL
22690  *
22691  * Convenience function for inserting a normal menu item into @menu.
22692  * Combine g_menu_item_new() and g_menu_insert_item() for a more flexible
22693  * alternative.
22694  *
22695  * Since: 2.32
22696  */
22697
22698
22699 /**
22700  * g_menu_insert_item:
22701  * @menu: a #GMenu
22702  * @position: the position at which to insert the item
22703  * @item: the #GMenuItem to insert
22704  *
22705  * Inserts @item into @menu.
22706  *
22707  * The "insertion" is actually done by copying all of the attribute and
22708  * link values of @item and using them to form a new item within @menu.
22709  * As such, @item itself is not really inserted, but rather, a menu item
22710  * that is exactly the same as the one presently described by @item.
22711  *
22712  * This means that @item is essentially useless after the insertion
22713  * occurs.  Any changes you make to it are ignored unless it is inserted
22714  * again (at which point its updated values will be copied).
22715  *
22716  * You should probably just free @item once you're done.
22717  *
22718  * There are many convenience functions to take care of common cases.
22719  * See g_menu_insert(), g_menu_insert_section() and
22720  * g_menu_insert_submenu() as well as "prepend" and "append" variants of
22721  * each of these functions.
22722  *
22723  * Since: 2.32
22724  */
22725
22726
22727 /**
22728  * g_menu_insert_section:
22729  * @menu: a #GMenu
22730  * @position: the position at which to insert the item
22731  * @label: (allow-none): the section label, or %NULL
22732  * @section: a #GMenuModel with the items of the section
22733  *
22734  * Convenience function for inserting a section menu item into @menu.
22735  * Combine g_menu_item_new_section() and g_menu_insert_item() for a more
22736  * flexible alternative.
22737  *
22738  * Since: 2.32
22739  */
22740
22741
22742 /**
22743  * g_menu_insert_submenu:
22744  * @menu: a #GMenu
22745  * @position: the position at which to insert the item
22746  * @label: (allow-none): the section label, or %NULL
22747  * @submenu: a #GMenuModel with the items of the submenu
22748  *
22749  * Convenience function for inserting a submenu menu item into @menu.
22750  * Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more
22751  * flexible alternative.
22752  *
22753  * Since: 2.32
22754  */
22755
22756
22757 /**
22758  * g_menu_item_get_attribute:
22759  * @menu_item: a #GMenuItem
22760  * @attribute: the attribute name to query
22761  * @format_string: a #GVariant format string
22762  * @...: positional parameters, as per @format_string
22763  *
22764  * Queries the named @attribute on @menu_item.
22765  *
22766  * If the attribute exists and matches the #GVariantType corresponding
22767  * to @format_string then @format_string is used to deconstruct the
22768  * value into the positional parameters and %TRUE is returned.
22769  *
22770  * If the attribute does not exist, or it does exist but has the wrong
22771  * type, then the positional parameters are ignored and %FALSE is
22772  * returned.
22773  *
22774  * Returns: %TRUE if the named attribute was found with the expected type
22775  * Since: 2.34
22776  */
22777
22778
22779 /**
22780  * g_menu_item_get_attribute_value:
22781  * @menu_item: a #GMenuItem
22782  * @attribute: the attribute name to query
22783  * @expected_type: (allow-none): the expected type of the attribute
22784  *
22785  * Queries the named @attribute on @menu_item.
22786  *
22787  * If @expected_type is specified and the attribute does not have this
22788  * type, %NULL is returned.  %NULL is also returned if the attribute
22789  * simply does not exist.
22790  *
22791  * Returns: (transfer full): the attribute value, or %NULL
22792  * Since: 2.34
22793  */
22794
22795
22796 /**
22797  * g_menu_item_get_link:
22798  * @menu_item: a #GMenuItem
22799  * @link: the link name to query
22800  *
22801  * Queries the named @link on @menu_item.
22802  *
22803  * Returns: (transfer full): the link, or %NULL
22804  * Since: 2.34
22805  */
22806
22807
22808 /**
22809  * g_menu_item_new:
22810  * @label: (allow-none): the section label, or %NULL
22811  * @detailed_action: (allow-none): the detailed action string, or %NULL
22812  *
22813  * Creates a new #GMenuItem.
22814  *
22815  * If @label is non-%NULL it is used to set the "label" attribute of the
22816  * new item.
22817  *
22818  * If @detailed_action is non-%NULL it is used to set the "action" and
22819  * possibly the "target" attribute of the new item.  See
22820  * g_menu_item_set_detailed_action() for more information.
22821  *
22822  * Returns: a new #GMenuItem
22823  * Since: 2.32
22824  */
22825
22826
22827 /**
22828  * g_menu_item_new_from_model:
22829  * @model: a #GMenuModel
22830  * @item_index: the index of an item in @model
22831  *
22832  * Creates a #GMenuItem as an exact copy of an existing menu item in a
22833  * #GMenuModel.
22834  *
22835  * @item_index must be valid (ie: be sure to call
22836  * g_menu_model_get_n_items() first).
22837  *
22838  * Returns: a new #GMenuItem.
22839  * Since: 2.34
22840  */
22841
22842
22843 /**
22844  * g_menu_item_new_section:
22845  * @label: (allow-none): the section label, or %NULL
22846  * @section: a #GMenuModel with the items of the section
22847  *
22848  * Creates a new #GMenuItem representing a section.
22849  *
22850  * This is a convenience API around g_menu_item_new() and
22851  * g_menu_item_set_section().
22852  *
22853  * The effect of having one menu appear as a section of another is
22854  * exactly as it sounds: the items from @section become a direct part of
22855  * the menu that @menu_item is added to.
22856  *
22857  * Visual separation is typically displayed between two non-empty
22858  * sections.  If @label is non-%NULL then it will be encorporated into
22859  * this visual indication.  This allows for labeled subsections of a
22860  * menu.
22861  *
22862  * As a simple example, consider a typical "Edit" menu from a simple
22863  * program.  It probably contains an "Undo" and "Redo" item, followed by
22864  * a separator, followed by "Cut", "Copy" and "Paste".
22865  *
22866  * This would be accomplished by creating three #GMenu instances.  The
22867  * first would be populated with the "Undo" and "Redo" items, and the
22868  * second with the "Cut", "Copy" and "Paste" items.  The first and
22869  * second menus would then be added as submenus of the third.  In XML
22870  * format, this would look something like the following:
22871  *
22872  * <informalexample><programlisting><![CDATA[
22873  * <menu id='edit-menu'>
22874  *   <section>
22875  *     <item label='Undo'/>
22876  *     <item label='Redo'/>
22877  *   </section>
22878  *   <section>
22879  *     <item label='Cut'/>
22880  *     <item label='Copy'/>
22881  *     <item label='Paste'/>
22882  *   </section>
22883  * </menu>
22884  * ]]></programlisting></informalexample>
22885  *
22886  * The following example is exactly equivalent.  It is more illustrative
22887  * of the exact relationship between the menus and items (keeping in
22888  * mind that the 'link' element defines a new menu that is linked to the
22889  * containing one).  The style of the second example is more verbose and
22890  * difficult to read (and therefore not recommended except for the
22891  * purpose of understanding what is really going on).
22892  *
22893  * <informalexample><programlisting><![CDATA[
22894  * <menu id='edit-menu'>
22895  *   <item>
22896  *     <link name='section'>
22897  *       <item label='Undo'/>
22898  *       <item label='Redo'/>
22899  *     </link>
22900  *   </item>
22901  *   <item>
22902  *     <link name='section'>
22903  *       <item label='Cut'/>
22904  *       <item label='Copy'/>
22905  *       <item label='Paste'/>
22906  *     </link>
22907  *   </item>
22908  * </menu>
22909  * ]]></programlisting></informalexample>
22910  *
22911  * Returns: a new #GMenuItem
22912  * Since: 2.32
22913  */
22914
22915
22916 /**
22917  * g_menu_item_new_submenu:
22918  * @label: (allow-none): the section label, or %NULL
22919  * @submenu: a #GMenuModel with the items of the submenu
22920  *
22921  * Creates a new #GMenuItem representing a submenu.
22922  *
22923  * This is a convenience API around g_menu_item_new() and
22924  * g_menu_item_set_submenu().
22925  *
22926  * Returns: a new #GMenuItem
22927  * Since: 2.32
22928  */
22929
22930
22931 /**
22932  * g_menu_item_set_action_and_target:
22933  * @menu_item: a #GMenuItem
22934  * @action: (allow-none): the name of the action for this item
22935  * @format_string: (allow-none): a GVariant format string
22936  * @...: positional parameters, as per @format_string
22937  *
22938  * Sets or unsets the "action" and "target" attributes of @menu_item.
22939  *
22940  * If @action is %NULL then both the "action" and "target" attributes
22941  * are unset (and @format_string is ignored along with the positional
22942  * parameters).
22943  *
22944  * If @action is non-%NULL then the "action" attribute is set.
22945  * @format_string is then inspected.  If it is non-%NULL then the proper
22946  * position parameters are collected to create a #GVariant instance to
22947  * use as the target value.  If it is %NULL then the positional
22948  * parameters are ignored and the "target" attribute is unset.
22949  *
22950  * See also g_menu_item_set_action_and_target_value() for an equivalent
22951  * call that directly accepts a #GVariant.  See
22952  * g_menu_item_set_detailed_action() for a more convenient version that
22953  * works with string-typed targets.
22954  *
22955  * See also g_menu_item_set_action_and_target_value() for a
22956  * description of the semantics of the action and target attributes.
22957  *
22958  * Since: 2.32
22959  */
22960
22961
22962 /**
22963  * g_menu_item_set_action_and_target_value:
22964  * @menu_item: a #GMenuItem
22965  * @action: (allow-none): the name of the action for this item
22966  * @target_value: (allow-none): a #GVariant to use as the action target
22967  *
22968  * Sets or unsets the "action" and "target" attributes of @menu_item.
22969  *
22970  * If @action is %NULL then both the "action" and "target" attributes
22971  * are unset (and @target_value is ignored).
22972  *
22973  * If @action is non-%NULL then the "action" attribute is set.  The
22974  * "target" attribute is then set to the value of @target_value if it is
22975  * non-%NULL or unset otherwise.
22976  *
22977  * Normal menu items (ie: not submenu, section or other custom item
22978  * types) are expected to have the "action" attribute set to identify
22979  * the action that they are associated with.  The state type of the
22980  * action help to determine the disposition of the menu item.  See
22981  * #GAction and #GActionGroup for an overview of actions.
22982  *
22983  * In general, clicking on the menu item will result in activation of
22984  * the named action with the "target" attribute given as the parameter
22985  * to the action invocation.  If the "target" attribute is not set then
22986  * the action is invoked with no parameter.
22987  *
22988  * If the action has no state then the menu item is usually drawn as a
22989  * plain menu item (ie: with no additional decoration).
22990  *
22991  * If the action has a boolean state then the menu item is usually drawn
22992  * as a toggle menu item (ie: with a checkmark or equivalent
22993  * indication).  The item should be marked as 'toggled' or 'checked'
22994  * when the boolean state is %TRUE.
22995  *
22996  * If the action has a string state then the menu item is usually drawn
22997  * as a radio menu item (ie: with a radio bullet or equivalent
22998  * indication).  The item should be marked as 'selected' when the string
22999  * state is equal to the value of the @target property.
23000  *
23001  * See g_menu_item_set_action_and_target() or
23002  * g_menu_item_set_detailed_action() for two equivalent calls that are
23003  * probably more convenient for most uses.
23004  *
23005  * Since: 2.32
23006  */
23007
23008
23009 /**
23010  * g_menu_item_set_attribute:
23011  * @menu_item: a #GMenuItem
23012  * @attribute: the attribute to set
23013  * @format_string: (allow-none): a #GVariant format string, or %NULL
23014  * @...: positional parameters, as per @format_string
23015  *
23016  * Sets or unsets an attribute on @menu_item.
23017  *
23018  * The attribute to set or unset is specified by @attribute. This
23019  * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23020  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23021  * attribute name.
23022  * Attribute names are restricted to lowercase characters, numbers
23023  * and '-'. Furthermore, the names must begin with a lowercase character,
23024  * must not end with a '-', and must not contain consecutive dashes.
23025  *
23026  * If @format_string is non-%NULL then the proper position parameters
23027  * are collected to create a #GVariant instance to use as the attribute
23028  * value.  If it is %NULL then the positional parameterrs are ignored
23029  * and the named attribute is unset.
23030  *
23031  * See also g_menu_item_set_attribute_value() for an equivalent call
23032  * that directly accepts a #GVariant.
23033  *
23034  * Since: 2.32
23035  */
23036
23037
23038 /**
23039  * g_menu_item_set_attribute_value:
23040  * @menu_item: a #GMenuItem
23041  * @attribute: the attribute to set
23042  * @value: (allow-none): a #GVariant to use as the value, or %NULL
23043  *
23044  * Sets or unsets an attribute on @menu_item.
23045  *
23046  * The attribute to set or unset is specified by @attribute. This
23047  * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
23048  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
23049  * attribute name.
23050  * Attribute names are restricted to lowercase characters, numbers
23051  * and '-'. Furthermore, the names must begin with a lowercase character,
23052  * must not end with a '-', and must not contain consecutive dashes.
23053  *
23054  * must consist only of lowercase
23055  * ASCII characters, digits and '-'.
23056  *
23057  * If @value is non-%NULL then it is used as the new value for the
23058  * attribute.  If @value is %NULL then the attribute is unset. If
23059  * the @value #GVariant is floating, it is consumed.
23060  *
23061  * See also g_menu_item_set_attribute() for a more convenient way to do
23062  * the same.
23063  *
23064  * Since: 2.32
23065  */
23066
23067
23068 /**
23069  * g_menu_item_set_detailed_action:
23070  * @menu_item: a #GMenuItem
23071  * @detailed_action: the "detailed" action string
23072  *
23073  * Sets the "action" and possibly the "target" attribute of @menu_item.
23074  *
23075  * If @detailed_action contains a double colon ("::") then it is used as
23076  * a separator between an action name and a target string.  In this
23077  * case, this call is equivalent to calling
23078  * g_menu_item_set_action_and_target() with the part before the "::" and
23079  * with a string-type #GVariant containing the part following the "::".
23080  *
23081  * If @detailed_action doesn't contain "::" then the action is set to
23082  * the given string (verbatim) and the target value is unset.
23083  *
23084  * See g_menu_item_set_action_and_target() or
23085  * g_menu_item_set_action_and_target_value() for more flexible (but
23086  * slightly less convenient) alternatives.
23087  *
23088  * See also g_menu_item_set_action_and_target_value() for a description of
23089  * the semantics of the action and target attributes.
23090  *
23091  * Since: 2.32
23092  */
23093
23094
23095 /**
23096  * g_menu_item_set_label:
23097  * @menu_item: a #GMenuItem
23098  * @label: (allow-none): the label to set, or %NULL to unset
23099  *
23100  * Sets or unsets the "label" attribute of @menu_item.
23101  *
23102  * If @label is non-%NULL it is used as the label for the menu item.  If
23103  * it is %NULL then the label attribute is unset.
23104  *
23105  * Since: 2.32
23106  */
23107
23108
23109 /**
23110  * g_menu_item_set_link:
23111  * @menu_item: a #GMenuItem
23112  * @link: type of link to establish or unset
23113  * @model: (allow-none): the #GMenuModel to link to (or %NULL to unset)
23114  *
23115  * Creates a link from @menu_item to @model if non-%NULL, or unsets it.
23116  *
23117  * Links are used to establish a relationship between a particular menu
23118  * item and another menu.  For example, %G_MENU_LINK_SUBMENU is used to
23119  * associate a submenu with a particular menu item, and %G_MENU_LINK_SECTION
23120  * is used to create a section. Other types of link can be used, but there
23121  * is no guarantee that clients will be able to make sense of them.
23122  * Link types are restricted to lowercase characters, numbers
23123  * and '-'. Furthermore, the names must begin with a lowercase character,
23124  * must not end with a '-', and must not contain consecutive dashes.
23125  *
23126  * Since: 2.32
23127  */
23128
23129
23130 /**
23131  * g_menu_item_set_section:
23132  * @menu_item: a #GMenuItem
23133  * @section: (allow-none): a #GMenuModel, or %NULL
23134  *
23135  * Sets or unsets the "section" link of @menu_item to @section.
23136  *
23137  * The effect of having one menu appear as a section of another is
23138  * exactly as it sounds: the items from @section become a direct part of
23139  * the menu that @menu_item is added to.  See g_menu_item_new_section()
23140  * for more information about what it means for a menu item to be a
23141  * section.
23142  *
23143  * Since: 2.32
23144  */
23145
23146
23147 /**
23148  * g_menu_item_set_submenu:
23149  * @menu_item: a #GMenuItem
23150  * @submenu: (allow-none): a #GMenuModel, or %NULL
23151  *
23152  * Sets or unsets the "submenu" link of @menu_item to @submenu.
23153  *
23154  * If @submenu is non-%NULL, it is linked to.  If it is %NULL then the
23155  * link is unset.
23156  *
23157  * The effect of having one menu appear as a submenu of another is
23158  * exactly as it sounds.
23159  *
23160  * Since: 2.32
23161  */
23162
23163
23164 /**
23165  * g_menu_link_iter_get_name:
23166  * @iter: a #GMenuLinkIter
23167  *
23168  * Gets the name of the link at the current iterator position.
23169  *
23170  * The iterator is not advanced.
23171  *
23172  * Returns: the type of the link
23173  * Since: 2.32
23174  */
23175
23176
23177 /**
23178  * g_menu_link_iter_get_next:
23179  * @iter: a #GMenuLinkIter
23180  * @out_link: (out) (allow-none) (transfer none): the name of the link
23181  * @value: (out) (allow-none) (transfer full): the linked #GMenuModel
23182  *
23183  * This function combines g_menu_link_iter_next() with
23184  * g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
23185  *
23186  * First the iterator is advanced to the next (possibly first) link.
23187  * If that fails, then %FALSE is returned and there are no other effects.
23188  *
23189  * If successful, @out_link and @value are set to the name and #GMenuModel
23190  * of the link that has just been advanced to.  At this point,
23191  * g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the
23192  * same values again.
23193  *
23194  * The value returned in @out_link remains valid for as long as the iterator
23195  * remains at the current position.  The value returned in @value must
23196  * be unreffed using g_object_unref() when it is no longer in use.
23197  *
23198  * Returns: %TRUE on success, or %FALSE if there is no additional link
23199  * Since: 2.32
23200  */
23201
23202
23203 /**
23204  * g_menu_link_iter_get_value:
23205  * @iter: a #GMenuLinkIter
23206  *
23207  * Gets the linked #GMenuModel at the current iterator position.
23208  *
23209  * The iterator is not advanced.
23210  *
23211  * Returns: (transfer full): the #GMenuModel that is linked to
23212  * Since: 2.32
23213  */
23214
23215
23216 /**
23217  * g_menu_link_iter_next:
23218  * @iter: a #GMenuLinkIter
23219  *
23220  * Attempts to advance the iterator to the next (possibly first)
23221  * link.
23222  *
23223  * %TRUE is returned on success, or %FALSE if there are no more links.
23224  *
23225  * You must call this function when you first acquire the iterator to
23226  * advance it to the first link (and determine if the first link exists
23227  * at all).
23228  *
23229  * Returns: %TRUE on success, or %FALSE when there are no more links
23230  * Since: 2.32
23231  */
23232
23233
23234 /**
23235  * g_menu_model_get_item_attribute:
23236  * @model: a #GMenuModel
23237  * @item_index: the index of the item
23238  * @attribute: the attribute to query
23239  * @format_string: a #GVariant format string
23240  * @...: positional parameters, as per @format_string
23241  *
23242  * Queries item at position @item_index in @model for the attribute
23243  * specified by @attribute.
23244  *
23245  * If the attribute exists and matches the #GVariantType corresponding
23246  * to @format_string then @format_string is used to deconstruct the
23247  * value into the positional parameters and %TRUE is returned.
23248  *
23249  * If the attribute does not exist, or it does exist but has the wrong
23250  * type, then the positional parameters are ignored and %FALSE is
23251  * returned.
23252  *
23253  * This function is a mix of g_menu_model_get_item_attribute_value() and
23254  * g_variant_get(), followed by a g_variant_unref().  As such,
23255  * @format_string must make a complete copy of the data (since the
23256  * #GVariant may go away after the call to g_variant_unref()).  In
23257  * particular, no '&amp;' characters are allowed in @format_string.
23258  *
23259  * Returns: %TRUE if the named attribute was found with the expected type
23260  * Since: 2.32
23261  */
23262
23263
23264 /**
23265  * g_menu_model_get_item_attribute_value:
23266  * @model: a #GMenuModel
23267  * @item_index: the index of the item
23268  * @attribute: the attribute to query
23269  * @expected_type: (allow-none): the expected type of the attribute, or %NULL
23270  *
23271  * Queries the item at position @item_index in @model for the attribute
23272  * specified by @attribute.
23273  *
23274  * If @expected_type is non-%NULL then it specifies the expected type of
23275  * the attribute.  If it is %NULL then any type will be accepted.
23276  *
23277  * If the attribute exists and matches @expected_type (or if the
23278  * expected type is unspecified) then the value is returned.
23279  *
23280  * If the attribute does not exist, or does not match the expected type
23281  * then %NULL is returned.
23282  *
23283  * Returns: (transfer full): the value of the attribute
23284  * Since: 2.32
23285  */
23286
23287
23288 /**
23289  * g_menu_model_get_item_link:
23290  * @model: a #GMenuModel
23291  * @item_index: the index of the item
23292  * @link: the link to query
23293  *
23294  * Queries the item at position @item_index in @model for the link
23295  * specified by @link.
23296  *
23297  * If the link exists, the linked #GMenuModel is returned.  If the link
23298  * does not exist, %NULL is returned.
23299  *
23300  * Returns: (transfer full): the linked #GMenuModel, or %NULL
23301  * Since: 2.32
23302  */
23303
23304
23305 /**
23306  * g_menu_model_get_n_items:
23307  * @model: a #GMenuModel
23308  *
23309  * Query the number of items in @model.
23310  *
23311  * Returns: the number of items
23312  * Since: 2.32
23313  */
23314
23315
23316 /**
23317  * g_menu_model_is_mutable:
23318  * @model: a #GMenuModel
23319  *
23320  * Queries if @model is mutable.
23321  *
23322  * An immutable #GMenuModel will never emit the #GMenuModel::items-changed
23323  * signal. Consumers of the model may make optimisations accordingly.
23324  *
23325  * Returns: %TRUE if the model is mutable (ie: "items-changed" may be emitted).
23326  * Since: 2.32
23327  */
23328
23329
23330 /**
23331  * g_menu_model_items_changed:
23332  * @model: a #GMenuModel
23333  * @position: the position of the change
23334  * @removed: the number of items removed
23335  * @added: the number of items added
23336  *
23337  * Requests emission of the #GMenuModel::items-changed signal on @model.
23338  *
23339  * This function should never be called except by #GMenuModel
23340  * subclasses.  Any other calls to this function will very likely lead
23341  * to a violation of the interface of the model.
23342  *
23343  * The implementation should update its internal representation of the
23344  * menu before emitting the signal.  The implementation should further
23345  * expect to receive queries about the new state of the menu (and
23346  * particularly added menu items) while signal handlers are running.
23347  *
23348  * The implementation must dispatch this call directly from a mainloop
23349  * entry and not in response to calls -- particularly those from the
23350  * #GMenuModel API.  Said another way: the menu must not change while
23351  * user code is running without returning to the mainloop.
23352  *
23353  * Since: 2.32
23354  */
23355
23356
23357 /**
23358  * g_menu_model_iterate_item_attributes:
23359  * @model: a #GMenuModel
23360  * @item_index: the index of the item
23361  *
23362  * Creates a #GMenuAttributeIter to iterate over the attributes of
23363  * the item at position @item_index in @model.
23364  *
23365  * You must free the iterator with g_object_unref() when you are done.
23366  *
23367  * Returns: (transfer full): a new #GMenuAttributeIter
23368  * Since: 2.32
23369  */
23370
23371
23372 /**
23373  * g_menu_model_iterate_item_links:
23374  * @model: a #GMenuModel
23375  * @item_index: the index of the item
23376  *
23377  * Creates a #GMenuLinkIter to iterate over the links of the item at
23378  * position @item_index in @model.
23379  *
23380  * You must free the iterator with g_object_unref() when you are done.
23381  *
23382  * Returns: (transfer full): a new #GMenuLinkIter
23383  * Since: 2.32
23384  */
23385
23386
23387 /**
23388  * g_menu_new:
23389  *
23390  * Creates a new #GMenu.
23391  *
23392  * The new menu has no items.
23393  *
23394  * Returns: a new #GMenu
23395  * Since: 2.32
23396  */
23397
23398
23399 /**
23400  * g_menu_prepend:
23401  * @menu: a #GMenu
23402  * @label: (allow-none): the section label, or %NULL
23403  * @detailed_action: (allow-none): the detailed action string, or %NULL
23404  *
23405  * Convenience function for prepending a normal menu item to the start
23406  * of @menu.  Combine g_menu_item_new() and g_menu_insert_item() for a more
23407  * flexible alternative.
23408  *
23409  * Since: 2.32
23410  */
23411
23412
23413 /**
23414  * g_menu_prepend_item:
23415  * @menu: a #GMenu
23416  * @item: a #GMenuItem to prepend
23417  *
23418  * Prepends @item to the start of @menu.
23419  *
23420  * See g_menu_insert_item() for more information.
23421  *
23422  * Since: 2.32
23423  */
23424
23425
23426 /**
23427  * g_menu_prepend_section:
23428  * @menu: a #GMenu
23429  * @label: (allow-none): the section label, or %NULL
23430  * @section: a #GMenuModel with the items of the section
23431  *
23432  * Convenience function for prepending a section menu item to the start
23433  * of @menu.  Combine g_menu_item_new_section() and g_menu_insert_item() for
23434  * a more flexible alternative.
23435  *
23436  * Since: 2.32
23437  */
23438
23439
23440 /**
23441  * g_menu_prepend_submenu:
23442  * @menu: a #GMenu
23443  * @label: (allow-none): the section label, or %NULL
23444  * @submenu: a #GMenuModel with the items of the submenu
23445  *
23446  * Convenience function for prepending a submenu menu item to the start
23447  * of @menu.  Combine g_menu_item_new_submenu() and g_menu_insert_item() for
23448  * a more flexible alternative.
23449  *
23450  * Since: 2.32
23451  */
23452
23453
23454 /**
23455  * g_menu_remove:
23456  * @menu: a #GMenu
23457  * @position: the position of the item to remove
23458  *
23459  * Removes an item from the menu.
23460  *
23461  * @position gives the index of the item to remove.
23462  *
23463  * It is an error if position is not in range the range from 0 to one
23464  * less than the number of items in the menu.
23465  *
23466  * It is not possible to remove items by identity since items are added
23467  * to the menu simply by copying their links and attributes (ie:
23468  * identity of the item itself is not preserved).
23469  *
23470  * Since: 2.32
23471  */
23472
23473
23474 /**
23475  * g_mount_can_eject:
23476  * @mount: a #GMount.
23477  *
23478  * Checks if @mount can be eject.
23479  *
23480  * Returns: %TRUE if the @mount can be ejected.
23481  */
23482
23483
23484 /**
23485  * g_mount_can_unmount:
23486  * @mount: a #GMount.
23487  *
23488  * Checks if @mount can be mounted.
23489  *
23490  * Returns: %TRUE if the @mount can be unmounted.
23491  */
23492
23493
23494 /**
23495  * g_mount_eject:
23496  * @mount: a #GMount.
23497  * @flags: flags affecting the unmount if required for eject
23498  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23499  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23500  * @user_data: user data passed to @callback.
23501  *
23502  * Ejects a mount. This is an asynchronous operation, and is
23503  * finished by calling g_mount_eject_finish() with the @mount
23504  * and #GAsyncResult data returned in the @callback.
23505  *
23506  * Deprecated: 2.22: Use g_mount_eject_with_operation() instead.
23507  */
23508
23509
23510 /**
23511  * g_mount_eject_finish:
23512  * @mount: a #GMount.
23513  * @result: a #GAsyncResult.
23514  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23515  *
23516  * Finishes ejecting a mount. If any errors occurred during the operation,
23517  * @error will be set to contain the errors and %FALSE will be returned.
23518  *
23519  * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23520  * Deprecated: 2.22: Use g_mount_eject_with_operation_finish() instead.
23521  */
23522
23523
23524 /**
23525  * g_mount_eject_with_operation:
23526  * @mount: a #GMount.
23527  * @flags: flags affecting the unmount if required for eject
23528  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23529  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23530  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23531  * @user_data: user data passed to @callback.
23532  *
23533  * Ejects a mount. This is an asynchronous operation, and is
23534  * finished by calling g_mount_eject_with_operation_finish() with the @mount
23535  * and #GAsyncResult data returned in the @callback.
23536  *
23537  * Since: 2.22
23538  */
23539
23540
23541 /**
23542  * g_mount_eject_with_operation_finish:
23543  * @mount: a #GMount.
23544  * @result: a #GAsyncResult.
23545  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23546  *
23547  * Finishes ejecting a mount. If any errors occurred during the operation,
23548  * @error will be set to contain the errors and %FALSE will be returned.
23549  *
23550  * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23551  * Since: 2.22
23552  */
23553
23554
23555 /**
23556  * g_mount_get_default_location:
23557  * @mount: a #GMount.
23558  *
23559  * Gets the default location of @mount. The default location of the given
23560  * @mount is a path that reflects the main entry point for the user (e.g.
23561  * the home directory, or the root of the volume).
23562  *
23563  * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23564  */
23565
23566
23567 /**
23568  * g_mount_get_drive:
23569  * @mount: a #GMount.
23570  *
23571  * Gets the drive for the @mount.
23572  *
23573  * This is a convenience method for getting the #GVolume and then
23574  * using that object to get the #GDrive.
23575  *
23576  * 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.
23577  */
23578
23579
23580 /**
23581  * g_mount_get_icon:
23582  * @mount: a #GMount.
23583  *
23584  * Gets the icon for @mount.
23585  *
23586  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23587  */
23588
23589
23590 /**
23591  * g_mount_get_name:
23592  * @mount: a #GMount.
23593  *
23594  * Gets the name of @mount.
23595  *
23596  * Returns: the name for the given @mount. The returned string should be freed with g_free() when no longer needed.
23597  */
23598
23599
23600 /**
23601  * g_mount_get_root:
23602  * @mount: a #GMount.
23603  *
23604  * Gets the root directory on @mount.
23605  *
23606  * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23607  */
23608
23609
23610 /**
23611  * g_mount_get_sort_key:
23612  * @mount: A #GMount.
23613  *
23614  * Gets the sort key for @mount, if any.
23615  *
23616  * Returns: Sorting key for @mount or %NULL if no such key is available.
23617  * Since: 2.32
23618  */
23619
23620
23621 /**
23622  * g_mount_get_symbolic_icon:
23623  * @mount: a #GMount.
23624  *
23625  * Gets the symbolic icon for @mount.
23626  *
23627  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23628  * Since: 2.34
23629  */
23630
23631
23632 /**
23633  * g_mount_get_uuid:
23634  * @mount: a #GMount.
23635  *
23636  * Gets the UUID for the @mount. The reference is typically based on
23637  * the file system UUID for the mount in question and should be
23638  * considered an opaque string. Returns %NULL if there is no UUID
23639  * available.
23640  *
23641  * 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.
23642  */
23643
23644
23645 /**
23646  * g_mount_get_volume:
23647  * @mount: a #GMount.
23648  *
23649  * Gets the volume for the @mount.
23650  *
23651  * 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.
23652  */
23653
23654
23655 /**
23656  * g_mount_guess_content_type:
23657  * @mount: a #GMount
23658  * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23659  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23660  * @callback: a #GAsyncReadyCallback
23661  * @user_data: user data passed to @callback
23662  *
23663  * Tries to guess the type of content stored on @mount. Returns one or
23664  * more textual identifiers of well-known content types (typically
23665  * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23666  * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23667  * specification for more on x-content types.
23668  *
23669  * This is an asynchronous operation (see
23670  * g_mount_guess_content_type_sync() for the synchronous version), and
23671  * is finished by calling g_mount_guess_content_type_finish() with the
23672  * @mount and #GAsyncResult data returned in the @callback.
23673  *
23674  * Since: 2.18
23675  */
23676
23677
23678 /**
23679  * g_mount_guess_content_type_finish:
23680  * @mount: a #GMount
23681  * @result: a #GAsyncResult
23682  * @error: a #GError location to store the error occurring, or %NULL to ignore
23683  *
23684  * Finishes guessing content types of @mount. If any errors occurred
23685  * during the operation, @error will be set to contain the errors and
23686  * %FALSE will be returned. In particular, you may get an
23687  * %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
23688  * guessing.
23689  *
23690  * 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.
23691  * Since: 2.18
23692  */
23693
23694
23695 /**
23696  * g_mount_guess_content_type_sync:
23697  * @mount: a #GMount
23698  * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23699  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23700  * @error: a #GError location to store the error occurring, or %NULL to ignore
23701  *
23702  * Tries to guess the type of content stored on @mount. Returns one or
23703  * more textual identifiers of well-known content types (typically
23704  * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23705  * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23706  * specification for more on x-content types.
23707  *
23708  * This is an synchronous operation and as such may block doing IO;
23709  * see g_mount_guess_content_type() for the asynchronous version.
23710  *
23711  * 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.
23712  * Since: 2.18
23713  */
23714
23715
23716 /**
23717  * g_mount_is_shadowed:
23718  * @mount: A #GMount.
23719  *
23720  * Determines if @mount is shadowed. Applications or libraries should
23721  * avoid displaying @mount in the user interface if it is shadowed.
23722  *
23723  * A mount is said to be shadowed if there exists one or more user
23724  * visible objects (currently #GMount objects) with a root that is
23725  * inside the root of @mount.
23726  *
23727  * One application of shadow mounts is when exposing a single file
23728  * system that is used to address several logical volumes. In this
23729  * situation, a #GVolumeMonitor implementation would create two
23730  * #GVolume objects (for example, one for the camera functionality of
23731  * the device and one for a SD card reader on the device) with
23732  * activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
23733  * and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
23734  * underlying mount (with root
23735  * <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
23736  * #GVolumeMonitor implementation would create two #GMount objects
23737  * (each with their root matching the corresponding volume activation
23738  * root) that would shadow the original mount.
23739  *
23740  * The proxy monitor in GVfs 2.26 and later, automatically creates and
23741  * manage shadow mounts (and shadows the underlying mount) if the
23742  * activation root on a #GVolume is set.
23743  *
23744  * Returns: %TRUE if @mount is shadowed.
23745  * Since: 2.20
23746  */
23747
23748
23749 /**
23750  * g_mount_operation_get_anonymous:
23751  * @op: a #GMountOperation.
23752  *
23753  * Check to see whether the mount operation is being used
23754  * for an anonymous user.
23755  *
23756  * Returns: %TRUE if mount operation is anonymous.
23757  */
23758
23759
23760 /**
23761  * g_mount_operation_get_choice:
23762  * @op: a #GMountOperation.
23763  *
23764  * Gets a choice from the mount operation.
23765  *
23766  * Returns: an integer containing an index of the user's choice from the choice's list, or %0.
23767  */
23768
23769
23770 /**
23771  * g_mount_operation_get_domain:
23772  * @op: a #GMountOperation.
23773  *
23774  * Gets the domain of the mount operation.
23775  *
23776  * Returns: a string set to the domain.
23777  */
23778
23779
23780 /**
23781  * g_mount_operation_get_password:
23782  * @op: a #GMountOperation.
23783  *
23784  * Gets a password from the mount operation.
23785  *
23786  * Returns: a string containing the password within @op.
23787  */
23788
23789
23790 /**
23791  * g_mount_operation_get_password_save:
23792  * @op: a #GMountOperation.
23793  *
23794  * Gets the state of saving passwords for the mount operation.
23795  *
23796  * Returns: a #GPasswordSave flag.
23797  */
23798
23799
23800 /**
23801  * g_mount_operation_get_username:
23802  * @op: a #GMountOperation.
23803  *
23804  * Get the user name from the mount operation.
23805  *
23806  * Returns: a string containing the user name.
23807  */
23808
23809
23810 /**
23811  * g_mount_operation_new:
23812  *
23813  * Creates a new mount operation.
23814  *
23815  * Returns: a #GMountOperation.
23816  */
23817
23818
23819 /**
23820  * g_mount_operation_reply:
23821  * @op: a #GMountOperation
23822  * @result: a #GMountOperationResult
23823  *
23824  * Emits the #GMountOperation::reply signal.
23825  */
23826
23827
23828 /**
23829  * g_mount_operation_set_anonymous:
23830  * @op: a #GMountOperation.
23831  * @anonymous: boolean value.
23832  *
23833  * Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
23834  */
23835
23836
23837 /**
23838  * g_mount_operation_set_choice:
23839  * @op: a #GMountOperation.
23840  * @choice: an integer.
23841  *
23842  * Sets a default choice for the mount operation.
23843  */
23844
23845
23846 /**
23847  * g_mount_operation_set_domain:
23848  * @op: a #GMountOperation.
23849  * @domain: the domain to set.
23850  *
23851  * Sets the mount operation's domain.
23852  */
23853
23854
23855 /**
23856  * g_mount_operation_set_password:
23857  * @op: a #GMountOperation.
23858  * @password: password to set.
23859  *
23860  * Sets the mount operation's password to @password.
23861  */
23862
23863
23864 /**
23865  * g_mount_operation_set_password_save:
23866  * @op: a #GMountOperation.
23867  * @save: a set of #GPasswordSave flags.
23868  *
23869  * Sets the state of saving passwords for the mount operation.
23870  */
23871
23872
23873 /**
23874  * g_mount_operation_set_username:
23875  * @op: a #GMountOperation.
23876  * @username: input username.
23877  *
23878  * Sets the user name within @op to @username.
23879  */
23880
23881
23882 /**
23883  * g_mount_remount:
23884  * @mount: a #GMount.
23885  * @flags: flags affecting the operation
23886  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23887  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23888  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23889  * @user_data: user data passed to @callback.
23890  *
23891  * Remounts a mount. This is an asynchronous operation, and is
23892  * finished by calling g_mount_remount_finish() with the @mount
23893  * and #GAsyncResults data returned in the @callback.
23894  *
23895  * Remounting is useful when some setting affecting the operation
23896  * of the volume has been changed, as these may need a remount to
23897  * take affect. While this is semantically equivalent with unmounting
23898  * and then remounting not all backends might need to actually be
23899  * unmounted.
23900  */
23901
23902
23903 /**
23904  * g_mount_remount_finish:
23905  * @mount: a #GMount.
23906  * @result: a #GAsyncResult.
23907  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23908  *
23909  * Finishes remounting a mount. If any errors occurred during the operation,
23910  * @error will be set to contain the errors and %FALSE will be returned.
23911  *
23912  * Returns: %TRUE if the mount was successfully remounted. %FALSE otherwise.
23913  */
23914
23915
23916 /**
23917  * g_mount_shadow:
23918  * @mount: A #GMount.
23919  *
23920  * Increments the shadow count on @mount. Usually used by
23921  * #GVolumeMonitor implementations when creating a shadow mount for
23922  * @mount, see g_mount_is_shadowed() for more information. The caller
23923  * will need to emit the #GMount::changed signal on @mount manually.
23924  *
23925  * Since: 2.20
23926  */
23927
23928
23929 /**
23930  * g_mount_unmount:
23931  * @mount: a #GMount.
23932  * @flags: flags affecting the operation
23933  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23934  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23935  * @user_data: user data passed to @callback.
23936  *
23937  * Unmounts a mount. This is an asynchronous operation, and is
23938  * finished by calling g_mount_unmount_finish() with the @mount
23939  * and #GAsyncResult data returned in the @callback.
23940  *
23941  * Deprecated: 2.22: Use g_mount_unmount_with_operation() instead.
23942  */
23943
23944
23945 /**
23946  * g_mount_unmount_finish:
23947  * @mount: a #GMount.
23948  * @result: a #GAsyncResult.
23949  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23950  *
23951  * Finishes unmounting a mount. If any errors occurred during the operation,
23952  * @error will be set to contain the errors and %FALSE will be returned.
23953  *
23954  * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
23955  * Deprecated: 2.22: Use g_mount_unmount_with_operation_finish() instead.
23956  */
23957
23958
23959 /**
23960  * g_mount_unmount_with_operation:
23961  * @mount: a #GMount.
23962  * @flags: flags affecting the operation
23963  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23964  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23965  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23966  * @user_data: user data passed to @callback.
23967  *
23968  * Unmounts a mount. This is an asynchronous operation, and is
23969  * finished by calling g_mount_unmount_with_operation_finish() with the @mount
23970  * and #GAsyncResult data returned in the @callback.
23971  *
23972  * Since: 2.22
23973  */
23974
23975
23976 /**
23977  * g_mount_unmount_with_operation_finish:
23978  * @mount: a #GMount.
23979  * @result: a #GAsyncResult.
23980  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23981  *
23982  * Finishes unmounting a mount. If any errors occurred during the operation,
23983  * @error will be set to contain the errors and %FALSE will be returned.
23984  *
23985  * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
23986  * Since: 2.22
23987  */
23988
23989
23990 /**
23991  * g_mount_unshadow:
23992  * @mount: A #GMount.
23993  *
23994  * Decrements the shadow count on @mount. Usually used by
23995  * #GVolumeMonitor implementations when destroying a shadow mount for
23996  * @mount, see g_mount_is_shadowed() for more information. The caller
23997  * will need to emit the #GMount::changed signal on @mount manually.
23998  *
23999  * Since: 2.20
24000  */
24001
24002
24003 /**
24004  * g_network_address_get_hostname:
24005  * @addr: a #GNetworkAddress
24006  *
24007  * Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
24008  * depending on what @addr was created with.
24009  *
24010  * Returns: @addr's hostname
24011  * Since: 2.22
24012  */
24013
24014
24015 /**
24016  * g_network_address_get_port:
24017  * @addr: a #GNetworkAddress
24018  *
24019  * Gets @addr's port number
24020  *
24021  * Returns: @addr's port (which may be 0)
24022  * Since: 2.22
24023  */
24024
24025
24026 /**
24027  * g_network_address_get_scheme:
24028  * @addr: a #GNetworkAddress
24029  *
24030  * Gets @addr's scheme
24031  *
24032  * Returns: @addr's scheme (%NULL if not built from URI)
24033  * Since: 2.26
24034  */
24035
24036
24037 /**
24038  * g_network_address_new:
24039  * @hostname: the hostname
24040  * @port: the port
24041  *
24042  * Creates a new #GSocketConnectable for connecting to the given
24043  * @hostname and @port.
24044  *
24045  * Returns: (transfer full) (type GNetworkAddress): the new #GNetworkAddress
24046  * Since: 2.22
24047  */
24048
24049
24050 /**
24051  * g_network_address_parse:
24052  * @host_and_port: the hostname and optionally a port
24053  * @default_port: the default port if not in @host_and_port
24054  * @error: a pointer to a #GError, or %NULL
24055  *
24056  * Creates a new #GSocketConnectable for connecting to the given
24057  * @hostname and @port. May fail and return %NULL in case
24058  * parsing @host_and_port fails.
24059  *
24060  * @host_and_port may be in any of a number of recognised formats; an IPv6
24061  * address, an IPv4 address, or a domain name (in which case a DNS
24062  * lookup is performed). Quoting with [] is supported for all address
24063  * types. A port override may be specified in the usual way with a
24064  * colon.
24065  *
24066  * If no port is specified in @host_and_port then @default_port will be
24067  * used as the port number to connect to.
24068  *
24069  * In general, @host_and_port is expected to be provided by the user
24070  * (allowing them to give the hostname, and a port overide if necessary)
24071  * and @default_port is expected to be provided by the application.
24072  *
24073  * (The port component of @host_and_port can also be specified as a
24074  * service name rather than as a numeric port, but this functionality
24075  * is deprecated, because it depends on the contents of /etc/services,
24076  * which is generally quite sparse on platforms other than Linux.)
24077  *
24078  * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24079  * Since: 2.22
24080  */
24081
24082
24083 /**
24084  * g_network_address_parse_uri:
24085  * @uri: the hostname and optionally a port
24086  * @default_port: The default port if none is found in the URI
24087  * @error: a pointer to a #GError, or %NULL
24088  *
24089  * Creates a new #GSocketConnectable for connecting to the given
24090  * @uri. May fail and return %NULL in case parsing @uri fails.
24091  *
24092  * Using this rather than g_network_address_new() or
24093  * g_network_address_parse() allows #GSocketClient to determine
24094  * when to use application-specific proxy protocols.
24095  *
24096  * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
24097  * Since: 2.26
24098  */
24099
24100
24101 /**
24102  * g_network_monitor_base_add_network:
24103  * @monitor: the #GNetworkMonitorBase
24104  * @network: a #GInetAddressMask
24105  *
24106  * Adds @network to @monitor's list of available networks.
24107  *
24108  * Since: 2.32
24109  */
24110
24111
24112 /**
24113  * g_network_monitor_base_remove_network:
24114  * @monitor: the #GNetworkMonitorBase
24115  * @network: a #GInetAddressMask
24116  *
24117  * Removes @network from @monitor's list of available networks.
24118  *
24119  * Since: 2.32
24120  */
24121
24122
24123 /**
24124  * g_network_monitor_base_set_networks:
24125  * @monitor: the #GNetworkMonitorBase
24126  * @networks: (array length=length): an array of #GInetAddressMask
24127  * @length: length of @networks
24128  *
24129  * Drops @monitor's current list of available networks and replaces
24130  * it with @networks.
24131  */
24132
24133
24134 /**
24135  * g_network_monitor_can_reach:
24136  * @monitor: a #GNetworkMonitor
24137  * @connectable: a #GSocketConnectable
24138  * @cancellable: (allow-none): a #GCancellable, or %NULL
24139  * @error: return location for a #GError, or %NULL
24140  *
24141  * Attempts to determine whether or not the host pointed to by
24142  * @connectable can be reached, without actually trying to connect to
24143  * it.
24144  *
24145  * This may return %TRUE even when #GNetworkMonitor:network-available
24146  * is %FALSE, if, for example, @monitor can determine that
24147  * @connectable refers to a host on a local network.
24148  *
24149  * If @monitor believes that an attempt to connect to @connectable
24150  * will succeed, it will return %TRUE. Otherwise, it will return
24151  * %FALSE and set @error to an appropriate error (such as
24152  * %G_IO_ERROR_HOST_UNREACHABLE).
24153  *
24154  * Note that although this does not attempt to connect to
24155  * @connectable, it may still block for a brief period of time (eg,
24156  * trying to do multicast DNS on the local network), so if you do not
24157  * want to block, you should use g_network_monitor_can_reach_async().
24158  *
24159  * Returns: %TRUE if @connectable is reachable, %FALSE if not.
24160  * Since: 2.32
24161  */
24162
24163
24164 /**
24165  * g_network_monitor_can_reach_async:
24166  * @monitor: a #GNetworkMonitor
24167  * @connectable: a #GSocketConnectable
24168  * @cancellable: (allow-none): a #GCancellable, or %NULL
24169  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24170  * @user_data: (closure): the data to pass to callback function
24171  *
24172  * Asynchronously attempts to determine whether or not the host
24173  * pointed to by @connectable can be reached, without actually
24174  * trying to connect to it.
24175  *
24176  * For more details, see g_network_monitor_can_reach().
24177  *
24178  * When the operation is finished, @callback will be called.
24179  * You can then call g_network_monitor_can_reach_finish()
24180  * to get the result of the operation.
24181  */
24182
24183
24184 /**
24185  * g_network_monitor_can_reach_finish:
24186  * @monitor: a #GNetworkMonitor
24187  * @result: a #GAsyncResult
24188  * @error: return location for errors, or %NULL
24189  *
24190  * Finishes an async network connectivity test.
24191  * See g_network_monitor_can_reach_async().
24192  *
24193  * Returns: %TRUE if network is reachable, %FALSE if not.
24194  */
24195
24196
24197 /**
24198  * g_network_monitor_get_default:
24199  *
24200  * Gets the default #GNetworkMonitor for the system.
24201  *
24202  * Returns: (transfer none): a #GNetworkMonitor
24203  * Since: 2.32
24204  */
24205
24206
24207 /**
24208  * g_network_monitor_get_network_available:
24209  * @monitor: the #GNetworkMonitor
24210  *
24211  * Checks if the network is available. "Available" here means that the
24212  * system has a default route available for at least one of IPv4 or
24213  * IPv6. It does not necessarily imply that the public Internet is
24214  * reachable. See #GNetworkMonitor:network-available for more details.
24215  *
24216  * Returns: whether the network is available
24217  * Since: 2.32
24218  */
24219
24220
24221 /**
24222  * g_network_service_get_domain:
24223  * @srv: a #GNetworkService
24224  *
24225  * Gets the domain that @srv serves. This might be either UTF-8 or
24226  * ASCII-encoded, depending on what @srv was created with.
24227  *
24228  * Returns: @srv's domain name
24229  * Since: 2.22
24230  */
24231
24232
24233 /**
24234  * g_network_service_get_protocol:
24235  * @srv: a #GNetworkService
24236  *
24237  * Gets @srv's protocol name (eg, "tcp").
24238  *
24239  * Returns: @srv's protocol name
24240  * Since: 2.22
24241  */
24242
24243
24244 /**
24245  * g_network_service_get_scheme:
24246  * @srv: a #GNetworkService
24247  *
24248  * Get's the URI scheme used to resolve proxies. By default, the service name
24249  * is used as scheme.
24250  *
24251  * Returns: @srv's scheme name
24252  * Since: 2.26
24253  */
24254
24255
24256 /**
24257  * g_network_service_get_service:
24258  * @srv: a #GNetworkService
24259  *
24260  * Gets @srv's service name (eg, "ldap").
24261  *
24262  * Returns: @srv's service name
24263  * Since: 2.22
24264  */
24265
24266
24267 /**
24268  * g_network_service_new:
24269  * @service: the service type to look up (eg, "ldap")
24270  * @protocol: the networking protocol to use for @service (eg, "tcp")
24271  * @domain: the DNS domain to look up the service in
24272  *
24273  * Creates a new #GNetworkService representing the given @service,
24274  * @protocol, and @domain. This will initially be unresolved; use the
24275  * #GSocketConnectable interface to resolve it.
24276  *
24277  * Returns: (transfer full) (type GNetworkService): a new #GNetworkService
24278  * Since: 2.22
24279  */
24280
24281
24282 /**
24283  * g_network_service_set_scheme:
24284  * @srv: a #GNetworkService
24285  * @scheme: a URI scheme
24286  *
24287  * Set's the URI scheme used to resolve proxies. By default, the service name
24288  * is used as scheme.
24289  *
24290  * Since: 2.26
24291  */
24292
24293
24294 /**
24295  * g_null_settings_backend_new:
24296  *
24297  * Creates a readonly #GSettingsBackend.
24298  *
24299  * This backend does not allow changes to settings, so all settings
24300  * will always have their default values.
24301  *
24302  * Returns: (transfer full): a newly created #GSettingsBackend
24303  * Since: 2.28
24304  */
24305
24306
24307 /**
24308  * g_output_stream_clear_pending:
24309  * @stream: output stream
24310  *
24311  * Clears the pending flag on @stream.
24312  */
24313
24314
24315 /**
24316  * g_output_stream_close:
24317  * @stream: A #GOutputStream.
24318  * @cancellable: (allow-none): optional cancellable object
24319  * @error: location to store the error occurring, or %NULL to ignore
24320  *
24321  * Closes the stream, releasing resources related to it.
24322  *
24323  * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
24324  * Closing a stream multiple times will not return an error.
24325  *
24326  * Closing a stream will automatically flush any outstanding buffers in the
24327  * stream.
24328  *
24329  * Streams will be automatically closed when the last reference
24330  * is dropped, but you might want to call this function to make sure
24331  * resources are released as early as possible.
24332  *
24333  * Some streams might keep the backing store of the stream (e.g. a file descriptor)
24334  * open after the stream is closed. See the documentation for the individual
24335  * stream for details.
24336  *
24337  * On failure the first error that happened will be reported, but the close
24338  * operation will finish as much as possible. A stream that failed to
24339  * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
24340  * is important to check and report the error to the user, otherwise
24341  * there might be a loss of data as all data might not be written.
24342  *
24343  * If @cancellable is not %NULL, then the operation can be cancelled by
24344  * triggering the cancellable object from another thread. If the operation
24345  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24346  * Cancelling a close will still leave the stream closed, but there some streams
24347  * can use a faster close that doesn't block to e.g. check errors. On
24348  * cancellation (as with any error) there is no guarantee that all written
24349  * data will reach the target.
24350  *
24351  * Returns: %TRUE on success, %FALSE on failure
24352  */
24353
24354
24355 /**
24356  * g_output_stream_close_async:
24357  * @stream: A #GOutputStream.
24358  * @io_priority: the io priority of the request.
24359  * @cancellable: (allow-none): optional cancellable object
24360  * @callback: (scope async): callback to call when the request is satisfied
24361  * @user_data: (closure): the data to pass to callback function
24362  *
24363  * Requests an asynchronous close of the stream, releasing resources
24364  * related to it. When the operation is finished @callback will be
24365  * called. You can then call g_output_stream_close_finish() to get
24366  * the result of the operation.
24367  *
24368  * For behaviour details see g_output_stream_close().
24369  *
24370  * The asyncronous methods have a default fallback that uses threads
24371  * to implement asynchronicity, so they are optional for inheriting
24372  * classes. However, if you override one you must override all.
24373  */
24374
24375
24376 /**
24377  * g_output_stream_close_finish:
24378  * @stream: a #GOutputStream.
24379  * @result: a #GAsyncResult.
24380  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24381  *
24382  * Closes an output stream.
24383  *
24384  * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
24385  */
24386
24387
24388 /**
24389  * g_output_stream_flush:
24390  * @stream: a #GOutputStream.
24391  * @cancellable: (allow-none): optional cancellable object
24392  * @error: location to store the error occurring, or %NULL to ignore
24393  *
24394  * Forces a write of all user-space buffered data for the given
24395  * @stream. Will block during the operation. Closing the stream will
24396  * implicitly cause a flush.
24397  *
24398  * This function is optional for inherited classes.
24399  *
24400  * If @cancellable is not %NULL, then the operation can be cancelled by
24401  * triggering the cancellable object from another thread. If the operation
24402  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24403  *
24404  * Returns: %TRUE on success, %FALSE on error
24405  */
24406
24407
24408 /**
24409  * g_output_stream_flush_async:
24410  * @stream: a #GOutputStream.
24411  * @io_priority: the io priority of the request.
24412  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24413  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
24414  * @user_data: (closure): the data to pass to callback function
24415  *
24416  * Forces an asynchronous write of all user-space buffered data for
24417  * the given @stream.
24418  * For behaviour details see g_output_stream_flush().
24419  *
24420  * When the operation is finished @callback will be
24421  * called. You can then call g_output_stream_flush_finish() to get the
24422  * result of the operation.
24423  */
24424
24425
24426 /**
24427  * g_output_stream_flush_finish:
24428  * @stream: a #GOutputStream.
24429  * @result: a GAsyncResult.
24430  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24431  *
24432  * Finishes flushing an output stream.
24433  *
24434  * Returns: %TRUE if flush operation succeeded, %FALSE otherwise.
24435  */
24436
24437
24438 /**
24439  * g_output_stream_has_pending:
24440  * @stream: a #GOutputStream.
24441  *
24442  * Checks if an ouput stream has pending actions.
24443  *
24444  * Returns: %TRUE if @stream has pending actions.
24445  */
24446
24447
24448 /**
24449  * g_output_stream_is_closed:
24450  * @stream: a #GOutputStream.
24451  *
24452  * Checks if an output stream has already been closed.
24453  *
24454  * Returns: %TRUE if @stream is closed. %FALSE otherwise.
24455  */
24456
24457
24458 /**
24459  * g_output_stream_is_closing:
24460  * @stream: a #GOutputStream.
24461  *
24462  * Checks if an output stream is being closed. This can be
24463  * used inside e.g. a flush implementation to see if the
24464  * flush (or other i/o operation) is called from within
24465  * the closing operation.
24466  *
24467  * Returns: %TRUE if @stream is being closed. %FALSE otherwise.
24468  * Since: 2.24
24469  */
24470
24471
24472 /**
24473  * g_output_stream_set_pending:
24474  * @stream: a #GOutputStream.
24475  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24476  *
24477  * Sets @stream to have actions pending. If the pending flag is
24478  * already set or @stream is closed, it will return %FALSE and set
24479  * @error.
24480  *
24481  * Returns: %TRUE if pending was previously unset and is now set.
24482  */
24483
24484
24485 /**
24486  * g_output_stream_splice:
24487  * @stream: a #GOutputStream.
24488  * @source: a #GInputStream.
24489  * @flags: a set of #GOutputStreamSpliceFlags.
24490  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24491  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24492  *
24493  * Splices an input stream into an output stream.
24494  *
24495  * 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.
24496  */
24497
24498
24499 /**
24500  * g_output_stream_splice_async:
24501  * @stream: a #GOutputStream.
24502  * @source: a #GInputStream.
24503  * @flags: a set of #GOutputStreamSpliceFlags.
24504  * @io_priority: the io priority of the request.
24505  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24506  * @callback: (scope async): a #GAsyncReadyCallback.
24507  * @user_data: (closure): user data passed to @callback.
24508  *
24509  * Splices a stream asynchronously.
24510  * When the operation is finished @callback will be called.
24511  * You can then call g_output_stream_splice_finish() to get the
24512  * result of the operation.
24513  *
24514  * For the synchronous, blocking version of this function, see
24515  * g_output_stream_splice().
24516  */
24517
24518
24519 /**
24520  * g_output_stream_splice_finish:
24521  * @stream: a #GOutputStream.
24522  * @result: a #GAsyncResult.
24523  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24524  *
24525  * Finishes an asynchronous stream splice operation.
24526  *
24527  * 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.
24528  */
24529
24530
24531 /**
24532  * g_output_stream_write:
24533  * @stream: a #GOutputStream.
24534  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24535  * @count: the number of bytes to write
24536  * @cancellable: (allow-none): optional cancellable object
24537  * @error: location to store the error occurring, or %NULL to ignore
24538  *
24539  * Tries to write @count bytes from @buffer into the stream. Will block
24540  * during the operation.
24541  *
24542  * If count is 0, returns 0 and does nothing. A value of @count
24543  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24544  *
24545  * On success, the number of bytes written to the stream is returned.
24546  * It is not an error if this is not the same as the requested size, as it
24547  * can happen e.g. on a partial I/O error, or if there is not enough
24548  * storage in the stream. All writes block until at least one byte
24549  * is written or an error occurs; 0 is never returned (unless
24550  * @count is 0).
24551  *
24552  * If @cancellable is not %NULL, then the operation can be cancelled by
24553  * triggering the cancellable object from another thread. If the operation
24554  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24555  * operation was partially finished when the operation was cancelled the
24556  * partial result will be returned, without an error.
24557  *
24558  * On error -1 is returned and @error is set accordingly.
24559  *
24560  * Virtual: write_fn
24561  * Returns: Number of bytes written, or -1 on error
24562  */
24563
24564
24565 /**
24566  * g_output_stream_write_all:
24567  * @stream: a #GOutputStream.
24568  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24569  * @count: the number of bytes to write
24570  * @bytes_written: (out): location to store the number of bytes that was written to the stream
24571  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24572  * @error: location to store the error occurring, or %NULL to ignore
24573  *
24574  * Tries to write @count bytes from @buffer into the stream. Will block
24575  * during the operation.
24576  *
24577  * This function is similar to g_output_stream_write(), except it tries to
24578  * write as many bytes as requested, only stopping on an error.
24579  *
24580  * On a successful write of @count bytes, %TRUE is returned, and @bytes_written
24581  * is set to @count.
24582  *
24583  * If there is an error during the operation %FALSE is returned and @error
24584  * is set to indicate the error status, @bytes_written is updated to contain
24585  * the number of bytes written into the stream before the error occurred.
24586  *
24587  * Returns: %TRUE on success, %FALSE if there was an error
24588  */
24589
24590
24591 /**
24592  * g_output_stream_write_async:
24593  * @stream: A #GOutputStream.
24594  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24595  * @count: the number of bytes to write
24596  * @io_priority: the io priority of the request.
24597  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24598  * @callback: (scope async): callback to call when the request is satisfied
24599  * @user_data: (closure): the data to pass to callback function
24600  *
24601  * Request an asynchronous write of @count bytes from @buffer into
24602  * the stream. When the operation is finished @callback will be called.
24603  * You can then call g_output_stream_write_finish() to get the result of the
24604  * operation.
24605  *
24606  * During an async request no other sync and async calls are allowed,
24607  * and will result in %G_IO_ERROR_PENDING errors.
24608  *
24609  * A value of @count larger than %G_MAXSSIZE will cause a
24610  * %G_IO_ERROR_INVALID_ARGUMENT error.
24611  *
24612  * On success, the number of bytes written will be passed to the
24613  * @callback. It is not an error if this is not the same as the
24614  * requested size, as it can happen e.g. on a partial I/O error,
24615  * but generally we try to write as many bytes as requested.
24616  *
24617  * You are guaranteed that this method will never fail with
24618  * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24619  * method will just wait until this changes.
24620  *
24621  * Any outstanding I/O request with higher priority (lower numerical
24622  * value) will be executed before an outstanding request with lower
24623  * priority. Default priority is %G_PRIORITY_DEFAULT.
24624  *
24625  * The asyncronous methods have a default fallback that uses threads
24626  * to implement asynchronicity, so they are optional for inheriting
24627  * classes. However, if you override one you must override all.
24628  *
24629  * For the synchronous, blocking version of this function, see
24630  * g_output_stream_write().
24631  */
24632
24633
24634 /**
24635  * g_output_stream_write_bytes:
24636  * @stream: a #GOutputStream.
24637  * @bytes: the #GBytes to write
24638  * @cancellable: (allow-none): optional cancellable object
24639  * @error: location to store the error occurring, or %NULL to ignore
24640  *
24641  * Tries to write the data from @bytes into the stream. Will block
24642  * during the operation.
24643  *
24644  * If @bytes is 0-length, returns 0 and does nothing. A #GBytes larger
24645  * than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24646  *
24647  * On success, the number of bytes written to the stream is returned.
24648  * It is not an error if this is not the same as the requested size, as it
24649  * can happen e.g. on a partial I/O error, or if there is not enough
24650  * storage in the stream. All writes block until at least one byte
24651  * is written or an error occurs; 0 is never returned (unless
24652  * the size of @bytes is 0).
24653  *
24654  * If @cancellable is not %NULL, then the operation can be cancelled by
24655  * triggering the cancellable object from another thread. If the operation
24656  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24657  * operation was partially finished when the operation was cancelled the
24658  * partial result will be returned, without an error.
24659  *
24660  * On error -1 is returned and @error is set accordingly.
24661  *
24662  * Returns: Number of bytes written, or -1 on error
24663  */
24664
24665
24666 /**
24667  * g_output_stream_write_bytes_async:
24668  * @stream: A #GOutputStream.
24669  * @bytes: The bytes to write
24670  * @io_priority: the io priority of the request.
24671  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24672  * @callback: (scope async): callback to call when the request is satisfied
24673  * @user_data: (closure): the data to pass to callback function
24674  *
24675  * Request an asynchronous write of the data in @bytes to the stream.
24676  * When the operation is finished @callback will be called. You can
24677  * then call g_output_stream_write_bytes_finish() to get the result of
24678  * the operation.
24679  *
24680  * During an async request no other sync and async calls are allowed,
24681  * and will result in %G_IO_ERROR_PENDING errors.
24682  *
24683  * A #GBytes larger than %G_MAXSSIZE will cause a
24684  * %G_IO_ERROR_INVALID_ARGUMENT error.
24685  *
24686  * On success, the number of bytes written will be passed to the
24687  * @callback. It is not an error if this is not the same as the
24688  * requested size, as it can happen e.g. on a partial I/O error,
24689  * but generally we try to write as many bytes as requested.
24690  *
24691  * You are guaranteed that this method will never fail with
24692  * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24693  * method will just wait until this changes.
24694  *
24695  * Any outstanding I/O request with higher priority (lower numerical
24696  * value) will be executed before an outstanding request with lower
24697  * priority. Default priority is %G_PRIORITY_DEFAULT.
24698  *
24699  * For the synchronous, blocking version of this function, see
24700  * g_output_stream_write_bytes().
24701  */
24702
24703
24704 /**
24705  * g_output_stream_write_bytes_finish:
24706  * @stream: a #GOutputStream.
24707  * @result: a #GAsyncResult.
24708  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24709  *
24710  * Finishes a stream write-from-#GBytes operation.
24711  *
24712  * Returns: a #gssize containing the number of bytes written to the stream.
24713  */
24714
24715
24716 /**
24717  * g_output_stream_write_finish:
24718  * @stream: a #GOutputStream.
24719  * @result: a #GAsyncResult.
24720  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24721  *
24722  * Finishes a stream write operation.
24723  *
24724  * Returns: a #gssize containing the number of bytes written to the stream.
24725  */
24726
24727
24728 /**
24729  * g_permission_acquire:
24730  * @permission: a #GPermission instance
24731  * @cancellable: (allow-none): a #GCancellable, or %NULL
24732  * @error: a pointer to a %NULL #GError, or %NULL
24733  *
24734  * Attempts to acquire the permission represented by @permission.
24735  *
24736  * The precise method by which this happens depends on the permission
24737  * and the underlying authentication mechanism.  A simple example is
24738  * that a dialog may appear asking the user to enter their password.
24739  *
24740  * You should check with g_permission_get_can_acquire() before calling
24741  * this function.
24742  *
24743  * If the permission is acquired then %TRUE is returned.  Otherwise,
24744  * %FALSE is returned and @error is set appropriately.
24745  *
24746  * This call is blocking, likely for a very long time (in the case that
24747  * user interaction is required).  See g_permission_acquire_async() for
24748  * the non-blocking version.
24749  *
24750  * Returns: %TRUE if the permission was successfully acquired
24751  * Since: 2.26
24752  */
24753
24754
24755 /**
24756  * g_permission_acquire_async:
24757  * @permission: a #GPermission instance
24758  * @cancellable: (allow-none): a #GCancellable, or %NULL
24759  * @callback: the #GAsyncReadyCallback to call when done
24760  * @user_data: the user data to pass to @callback
24761  *
24762  * Attempts to acquire the permission represented by @permission.
24763  *
24764  * This is the first half of the asynchronous version of
24765  * g_permission_acquire().
24766  *
24767  * Since: 2.26
24768  */
24769
24770
24771 /**
24772  * g_permission_acquire_finish:
24773  * @permission: a #GPermission instance
24774  * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24775  * @error: a pointer to a %NULL #GError, or %NULL
24776  *
24777  * Collects the result of attempting to acquire the permission
24778  * represented by @permission.
24779  *
24780  * This is the second half of the asynchronous version of
24781  * g_permission_acquire().
24782  *
24783  * Returns: %TRUE if the permission was successfully acquired
24784  * Since: 2.26
24785  */
24786
24787
24788 /**
24789  * g_permission_get_allowed:
24790  * @permission: a #GPermission instance
24791  *
24792  * Gets the value of the 'allowed' property.  This property is %TRUE if
24793  * the caller currently has permission to perform the action that
24794  * @permission represents the permission to perform.
24795  *
24796  * Returns: the value of the 'allowed' property
24797  * Since: 2.26
24798  */
24799
24800
24801 /**
24802  * g_permission_get_can_acquire:
24803  * @permission: a #GPermission instance
24804  *
24805  * Gets the value of the 'can-acquire' property.  This property is %TRUE
24806  * if it is generally possible to acquire the permission by calling
24807  * g_permission_acquire().
24808  *
24809  * Returns: the value of the 'can-acquire' property
24810  * Since: 2.26
24811  */
24812
24813
24814 /**
24815  * g_permission_get_can_release:
24816  * @permission: a #GPermission instance
24817  *
24818  * Gets the value of the 'can-release' property.  This property is %TRUE
24819  * if it is generally possible to release the permission by calling
24820  * g_permission_release().
24821  *
24822  * Returns: the value of the 'can-release' property
24823  * Since: 2.26
24824  */
24825
24826
24827 /**
24828  * g_permission_impl_update:
24829  * @permission: a #GPermission instance
24830  * @allowed: the new value for the 'allowed' property
24831  * @can_acquire: the new value for the 'can-acquire' property
24832  * @can_release: the new value for the 'can-release' property
24833  *
24834  * This function is called by the #GPermission implementation to update
24835  * the properties of the permission.  You should never call this
24836  * function except from a #GPermission implementation.
24837  *
24838  * GObject notify signals are generated, as appropriate.
24839  *
24840  * Since: 2.26
24841  */
24842
24843
24844 /**
24845  * g_permission_release:
24846  * @permission: a #GPermission instance
24847  * @cancellable: (allow-none): a #GCancellable, or %NULL
24848  * @error: a pointer to a %NULL #GError, or %NULL
24849  *
24850  * Attempts to release the permission represented by @permission.
24851  *
24852  * The precise method by which this happens depends on the permission
24853  * and the underlying authentication mechanism.  In most cases the
24854  * permission will be dropped immediately without further action.
24855  *
24856  * You should check with g_permission_get_can_release() before calling
24857  * this function.
24858  *
24859  * If the permission is released then %TRUE is returned.  Otherwise,
24860  * %FALSE is returned and @error is set appropriately.
24861  *
24862  * This call is blocking, likely for a very long time (in the case that
24863  * user interaction is required).  See g_permission_release_async() for
24864  * the non-blocking version.
24865  *
24866  * Returns: %TRUE if the permission was successfully released
24867  * Since: 2.26
24868  */
24869
24870
24871 /**
24872  * g_permission_release_async:
24873  * @permission: a #GPermission instance
24874  * @cancellable: (allow-none): a #GCancellable, or %NULL
24875  * @callback: the #GAsyncReadyCallback to call when done
24876  * @user_data: the user data to pass to @callback
24877  *
24878  * Attempts to release the permission represented by @permission.
24879  *
24880  * This is the first half of the asynchronous version of
24881  * g_permission_release().
24882  *
24883  * Since: 2.26
24884  */
24885
24886
24887 /**
24888  * g_permission_release_finish:
24889  * @permission: a #GPermission instance
24890  * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24891  * @error: a pointer to a %NULL #GError, or %NULL
24892  *
24893  * Collects the result of attempting to release the permission
24894  * represented by @permission.
24895  *
24896  * This is the second half of the asynchronous version of
24897  * g_permission_release().
24898  *
24899  * Returns: %TRUE if the permission was successfully released
24900  * Since: 2.26
24901  */
24902
24903
24904 /**
24905  * g_poll_file_monitor_new:
24906  * @file: a #GFile.
24907  *
24908  * Polls @file for changes.
24909  *
24910  * Returns: a new #GFileMonitor for the given #GFile.
24911  */
24912
24913
24914 /**
24915  * g_pollable_input_stream_can_poll:
24916  * @stream: a #GPollableInputStream.
24917  *
24918  * Checks if @stream is actually pollable. Some classes may implement
24919  * #GPollableInputStream but have only certain instances of that class
24920  * be pollable. If this method returns %FALSE, then the behavior of
24921  * other #GPollableInputStream methods is undefined.
24922  *
24923  * For any given stream, the value returned by this method is constant;
24924  * a stream cannot switch from pollable to non-pollable or vice versa.
24925  *
24926  * Returns: %TRUE if @stream is pollable, %FALSE if not.
24927  * Since: 2.28
24928  */
24929
24930
24931 /**
24932  * g_pollable_input_stream_create_source:
24933  * @stream: a #GPollableInputStream.
24934  * @cancellable: (allow-none): a #GCancellable, or %NULL
24935  *
24936  * Creates a #GSource that triggers when @stream can be read, or
24937  * @cancellable is triggered or an error occurs. The callback on the
24938  * source is of the #GPollableSourceFunc type.
24939  *
24940  * As with g_pollable_input_stream_is_readable(), it is possible that
24941  * the stream may not actually be readable even after the source
24942  * triggers, so you should use g_pollable_input_stream_read_nonblocking()
24943  * rather than g_input_stream_read() from the callback.
24944  *
24945  * Returns: (transfer full): a new #GSource
24946  * Since: 2.28
24947  */
24948
24949
24950 /**
24951  * g_pollable_input_stream_is_readable:
24952  * @stream: a #GPollableInputStream.
24953  *
24954  * Checks if @stream can be read.
24955  *
24956  * Note that some stream types may not be able to implement this 100%
24957  * reliably, and it is possible that a call to g_input_stream_read()
24958  * after this returns %TRUE would still block. To guarantee
24959  * non-blocking behavior, you should always use
24960  * g_pollable_input_stream_read_nonblocking(), which will return a
24961  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
24962  *
24963  * 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.
24964  * Since: 2.28
24965  */
24966
24967
24968 /**
24969  * g_pollable_input_stream_read_nonblocking:
24970  * @stream: a #GPollableInputStream
24971  * @buffer: a buffer to read data into (which should be at least @count bytes long).
24972  * @count: the number of bytes you want to read
24973  * @cancellable: (allow-none): a #GCancellable, or %NULL
24974  * @error: #GError for error reporting, or %NULL to ignore.
24975  *
24976  * Attempts to read up to @count bytes from @stream into @buffer, as
24977  * with g_input_stream_read(). If @stream is not currently readable,
24978  * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
24979  * use g_pollable_input_stream_create_source() to create a #GSource
24980  * that will be triggered when @stream is readable.
24981  *
24982  * Note that since this method never blocks, you cannot actually
24983  * use @cancellable to cancel it. However, it will return an error
24984  * if @cancellable has already been cancelled when you call, which
24985  * may happen if you call this method after a source triggers due
24986  * to having been cancelled.
24987  *
24988  * Virtual: read_nonblocking
24989  * Returns: the number of bytes read, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
24990  */
24991
24992
24993 /**
24994  * g_pollable_output_stream_can_poll:
24995  * @stream: a #GPollableOutputStream.
24996  *
24997  * Checks if @stream is actually pollable. Some classes may implement
24998  * #GPollableOutputStream but have only certain instances of that
24999  * class be pollable. If this method returns %FALSE, then the behavior
25000  * of other #GPollableOutputStream methods is undefined.
25001  *
25002  * For any given stream, the value returned by this method is constant;
25003  * a stream cannot switch from pollable to non-pollable or vice versa.
25004  *
25005  * Returns: %TRUE if @stream is pollable, %FALSE if not.
25006  * Since: 2.28
25007  */
25008
25009
25010 /**
25011  * g_pollable_output_stream_create_source:
25012  * @stream: a #GPollableOutputStream.
25013  * @cancellable: (allow-none): a #GCancellable, or %NULL
25014  *
25015  * Creates a #GSource that triggers when @stream can be written, or
25016  * @cancellable is triggered or an error occurs. The callback on the
25017  * source is of the #GPollableSourceFunc type.
25018  *
25019  * As with g_pollable_output_stream_is_writable(), it is possible that
25020  * the stream may not actually be writable even after the source
25021  * triggers, so you should use g_pollable_output_stream_write_nonblocking()
25022  * rather than g_output_stream_write() from the callback.
25023  *
25024  * Returns: (transfer full): a new #GSource
25025  * Since: 2.28
25026  */
25027
25028
25029 /**
25030  * g_pollable_output_stream_is_writable:
25031  * @stream: a #GPollableOutputStream.
25032  *
25033  * Checks if @stream can be written.
25034  *
25035  * Note that some stream types may not be able to implement this 100%
25036  * reliably, and it is possible that a call to g_output_stream_write()
25037  * after this returns %TRUE would still block. To guarantee
25038  * non-blocking behavior, you should always use
25039  * g_pollable_output_stream_write_nonblocking(), which will return a
25040  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
25041  *
25042  * 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.
25043  * Since: 2.28
25044  */
25045
25046
25047 /**
25048  * g_pollable_output_stream_write_nonblocking:
25049  * @stream: a #GPollableOutputStream
25050  * @buffer: (array length=count) (element-type guint8): a buffer to write data from
25051  * @count: the number of bytes you want to write
25052  * @cancellable: (allow-none): a #GCancellable, or %NULL
25053  * @error: #GError for error reporting, or %NULL to ignore.
25054  *
25055  * Attempts to write up to @count bytes from @buffer to @stream, as
25056  * with g_output_stream_write(). If @stream is not currently writable,
25057  * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
25058  * use g_pollable_output_stream_create_source() to create a #GSource
25059  * that will be triggered when @stream is writable.
25060  *
25061  * Note that since this method never blocks, you cannot actually
25062  * use @cancellable to cancel it. However, it will return an error
25063  * if @cancellable has already been cancelled when you call, which
25064  * may happen if you call this method after a source triggers due
25065  * to having been cancelled.
25066  *
25067  * Virtual: write_nonblocking
25068  * Returns: the number of bytes written, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
25069  */
25070
25071
25072 /**
25073  * g_pollable_source_new:
25074  * @pollable_stream: the stream associated with the new source
25075  *
25076  * Utility method for #GPollableInputStream and #GPollableOutputStream
25077  * implementations. Creates a new #GSource that expects a callback of
25078  * type #GPollableSourceFunc. The new source does not actually do
25079  * anything on its own; use g_source_add_child_source() to add other
25080  * sources to it to cause it to trigger.
25081  *
25082  * Returns: (transfer full): the new #GSource.
25083  * Since: 2.28
25084  */
25085
25086
25087 /**
25088  * g_pollable_source_new_full:
25089  * @pollable_stream: (type GObject): the stream associated with the new source
25090  * @child_source: (allow-none): optional child source to attach
25091  * @cancellable: (allow-none): optional #GCancellable to attach
25092  *
25093  * Utility method for #GPollableInputStream and #GPollableOutputStream
25094  * implementations. Creates a new #GSource, as with
25095  * g_pollable_source_new(), but also attaching @child_source (with a
25096  * dummy callback), and @cancellable, if they are non-%NULL.
25097  *
25098  * Returns: (transfer full): the new #GSource.
25099  * Since: 2.34
25100  */
25101
25102
25103 /**
25104  * g_pollable_stream_read:
25105  * @stream: a #GInputStream
25106  * @buffer: a buffer to read data into
25107  * @count: the number of bytes to read
25108  * @blocking: whether to do blocking I/O
25109  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25110  * @error: location to store the error occurring, or %NULL to ignore
25111  *
25112  * Tries to read from @stream, as with g_input_stream_read() (if
25113  * @blocking is %TRUE) or g_pollable_input_stream_read_nonblocking()
25114  * (if @blocking is %FALSE). This can be used to more easily share
25115  * code between blocking and non-blocking implementations of a method.
25116  *
25117  * If @blocking is %FALSE, then @stream must be a
25118  * #GPollableInputStream for which g_pollable_input_stream_can_poll()
25119  * returns %TRUE, or else the behavior is undefined. If @blocking is
25120  * %TRUE, then @stream does not need to be a #GPollableInputStream.
25121  *
25122  * Returns: the number of bytes read, or -1 on error.
25123  * Since: 2.34
25124  */
25125
25126
25127 /**
25128  * g_pollable_stream_write:
25129  * @stream: a #GOutputStream.
25130  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25131  * @count: the number of bytes to write
25132  * @blocking: whether to do blocking I/O
25133  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25134  * @error: location to store the error occurring, or %NULL to ignore
25135  *
25136  * Tries to write to @stream, as with g_output_stream_write() (if
25137  * @blocking is %TRUE) or g_pollable_output_stream_write_nonblocking()
25138  * (if @blocking is %FALSE). This can be used to more easily share
25139  * code between blocking and non-blocking implementations of a method.
25140  *
25141  * If @blocking is %FALSE, then @stream must be a
25142  * #GPollableOutputStream for which
25143  * g_pollable_output_stream_can_poll() returns %TRUE or else the
25144  * behavior is undefined. If @blocking is %TRUE, then @stream does not
25145  * need to be a #GPollableOutputStream.
25146  *
25147  * Returns: the number of bytes written, or -1 on error.
25148  * Since: 2.34
25149  */
25150
25151
25152 /**
25153  * g_pollable_stream_write_all:
25154  * @stream: a #GOutputStream.
25155  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
25156  * @count: the number of bytes to write
25157  * @blocking: whether to do blocking I/O
25158  * @bytes_written: (out): location to store the number of bytes that was written to the stream
25159  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25160  * @error: location to store the error occurring, or %NULL to ignore
25161  *
25162  * Tries to write @count bytes to @stream, as with
25163  * g_output_stream_write_all(), but using g_pollable_stream_write()
25164  * rather than g_output_stream_write().
25165  *
25166  * On a successful write of @count bytes, %TRUE is returned, and
25167  * @bytes_written is set to @count.
25168  *
25169  * If there is an error during the operation (including
25170  * %G_IO_ERROR_WOULD_BLOCK in the non-blocking case), %FALSE is
25171  * returned and @error is set to indicate the error status,
25172  * @bytes_written is updated to contain the number of bytes written
25173  * into the stream before the error occurred.
25174  *
25175  * As with g_pollable_stream_write(), if @blocking is %FALSE, then
25176  * @stream must be a #GPollableOutputStream for which
25177  * g_pollable_output_stream_can_poll() returns %TRUE or else the
25178  * behavior is undefined. If @blocking is %TRUE, then @stream does not
25179  * need to be a #GPollableOutputStream.
25180  *
25181  * Returns: %TRUE on success, %FALSE if there was an error
25182  * Since: 2.34
25183  */
25184
25185
25186 /**
25187  * g_proxy_address_get_destination_hostname:
25188  * @proxy: a #GProxyAddress
25189  *
25190  * Gets @proxy's destination hostname; that is, the name of the host
25191  * that will be connected to via the proxy, not the name of the proxy
25192  * itself.
25193  *
25194  * Returns: the @proxy's destination hostname
25195  * Since: 2.26
25196  */
25197
25198
25199 /**
25200  * g_proxy_address_get_destination_port:
25201  * @proxy: a #GProxyAddress
25202  *
25203  * Gets @proxy's destination port; that is, the port on the
25204  * destination host that will be connected to via the proxy, not the
25205  * port number of the proxy itself.
25206  *
25207  * Returns: the @proxy's destination port
25208  * Since: 2.26
25209  */
25210
25211
25212 /**
25213  * g_proxy_address_get_destination_protocol:
25214  * @proxy: a #GProxyAddress
25215  *
25216  * Gets the protocol that is being spoken to the destination
25217  * server; eg, "http" or "ftp".
25218  *
25219  * Returns: the @proxy's destination protocol
25220  * Since: 2.34
25221  */
25222
25223
25224 /**
25225  * g_proxy_address_get_password:
25226  * @proxy: a #GProxyAddress
25227  *
25228  * Gets @proxy's password.
25229  *
25230  * Returns: the @proxy's password
25231  * Since: 2.26
25232  */
25233
25234
25235 /**
25236  * g_proxy_address_get_protocol:
25237  * @proxy: a #GProxyAddress
25238  *
25239  * Gets @proxy's protocol. eg, "socks" or "http"
25240  *
25241  * Returns: the @proxy's protocol
25242  * Since: 2.26
25243  */
25244
25245
25246 /**
25247  * g_proxy_address_get_uri:
25248  * @proxy: a #GProxyAddress
25249  *
25250  * Gets the proxy URI that @proxy was constructed from.
25251  *
25252  * Returns: the @proxy's URI, or %NULL if unknown
25253  * Since: 2.34
25254  */
25255
25256
25257 /**
25258  * g_proxy_address_get_username:
25259  * @proxy: a #GProxyAddress
25260  *
25261  * Gets @proxy's username.
25262  *
25263  * Returns: the @proxy's username
25264  * Since: 2.26
25265  */
25266
25267
25268 /**
25269  * g_proxy_address_new:
25270  * @inetaddr: The proxy server #GInetAddress.
25271  * @port: The proxy server port.
25272  * @protocol: The proxy protocol to support, in lower case (e.g. socks, http).
25273  * @dest_hostname: The destination hostname the proxy should tunnel to.
25274  * @dest_port: The destination port to tunnel to.
25275  * @username: (allow-none): The username to authenticate to the proxy server (or %NULL).
25276  * @password: (allow-none): The password to authenticate to the proxy server (or %NULL).
25277  *
25278  * Creates a new #GProxyAddress for @inetaddr with @protocol that should
25279  * tunnel through @dest_hostname and @dest_port.
25280  *
25281  * (Note that this method doesn't set the #GProxyAddress:uri or
25282  * #GProxyAddress:destination-protocol fields; use g_object_new()
25283  * directly if you want to set those.)
25284  *
25285  * Returns: a new #GProxyAddress
25286  * Since: 2.26
25287  */
25288
25289
25290 /**
25291  * g_proxy_connect:
25292  * @proxy: a #GProxy
25293  * @connection: a #GIOStream
25294  * @proxy_address: a #GProxyAddress
25295  * @cancellable: (allow-none): a #GCancellable
25296  * @error: return #GError
25297  *
25298  * Given @connection to communicate with a proxy (eg, a
25299  * #GSocketConnection that is connected to the proxy server), this
25300  * does the necessary handshake to connect to @proxy_address, and if
25301  * required, wraps the #GIOStream to handle proxy payload.
25302  *
25303  * Returns: (transfer full): a #GIOStream that will replace @connection. This might be the same as @connection, in which case a reference will be added.
25304  * Since: 2.26
25305  */
25306
25307
25308 /**
25309  * g_proxy_connect_async:
25310  * @proxy: a #GProxy
25311  * @connection: a #GIOStream
25312  * @proxy_address: a #GProxyAddress
25313  * @cancellable: (allow-none): a #GCancellable
25314  * @callback: (scope async): a #GAsyncReadyCallback
25315  * @user_data: (closure): callback data
25316  *
25317  * Asynchronous version of g_proxy_connect().
25318  *
25319  * Since: 2.26
25320  */
25321
25322
25323 /**
25324  * g_proxy_connect_finish:
25325  * @proxy: a #GProxy
25326  * @result: a #GAsyncResult
25327  * @error: return #GError
25328  *
25329  * See g_proxy_connect().
25330  *
25331  * Returns: (transfer full): a #GIOStream.
25332  * Since: 2.26
25333  */
25334
25335
25336 /**
25337  * g_proxy_get_default_for_protocol:
25338  * @protocol: the proxy protocol name (e.g. http, socks, etc)
25339  *
25340  * Lookup "gio-proxy" extension point for a proxy implementation that supports
25341  * specified protocol.
25342  *
25343  * Returns: (transfer full): return a #GProxy or NULL if protocol is not supported.
25344  * Since: 2.26
25345  */
25346
25347
25348 /**
25349  * g_proxy_resolver_get_default:
25350  *
25351  * Gets the default #GProxyResolver for the system.
25352  *
25353  * Returns: (transfer none): the default #GProxyResolver.
25354  * Since: 2.26
25355  */
25356
25357
25358 /**
25359  * g_proxy_resolver_is_supported:
25360  * @resolver: a #GProxyResolver
25361  *
25362  * Checks if @resolver can be used on this system. (This is used
25363  * internally; g_proxy_resolver_get_default() will only return a proxy
25364  * resolver that returns %TRUE for this method.)
25365  *
25366  * Returns: %TRUE if @resolver is supported.
25367  * Since: 2.26
25368  */
25369
25370
25371 /**
25372  * g_proxy_resolver_lookup:
25373  * @resolver: a #GProxyResolver
25374  * @uri: a URI representing the destination to connect to
25375  * @cancellable: (allow-none): a #GCancellable, or %NULL
25376  * @error: return location for a #GError, or %NULL
25377  *
25378  * Looks into the system proxy configuration to determine what proxy,
25379  * if any, to use to connect to @uri. The returned proxy URIs are of the
25380  * form <literal>&lt;protocol&gt;://[user[:password]@]host:port</literal>
25381  * or <literal>direct://</literal>, where &lt;protocol&gt; could be
25382  * http, rtsp, socks or other proxying protocol.
25383  *
25384  * If you don't know what network protocol is being used on the
25385  * socket, you should use <literal>none</literal> as the URI protocol.
25386  * In this case, the resolver might still return a generic proxy type
25387  * (such as SOCKS), but would not return protocol-specific proxy types
25388  * (such as http).
25389  *
25390  * <literal>direct://</literal> is used when no proxy is needed.
25391  * Direct connection should not be attempted unless it is part of the
25392  * returned array of proxies.
25393  *
25394  * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25395  * Since: 2.26
25396  */
25397
25398
25399 /**
25400  * g_proxy_resolver_lookup_async:
25401  * @resolver: a #GProxyResolver
25402  * @uri: a URI representing the destination to connect to
25403  * @cancellable: (allow-none): a #GCancellable, or %NULL
25404  * @callback: (scope async): callback to call after resolution completes
25405  * @user_data: (closure): data for @callback
25406  *
25407  * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
25408  * details.
25409  *
25410  * Since: 2.26
25411  */
25412
25413
25414 /**
25415  * g_proxy_resolver_lookup_finish:
25416  * @resolver: a #GProxyResolver
25417  * @result: the result passed to your #GAsyncReadyCallback
25418  * @error: return location for a #GError, or %NULL
25419  *
25420  * Call this function to obtain the array of proxy URIs when
25421  * g_proxy_resolver_lookup_async() is complete. See
25422  * g_proxy_resolver_lookup() for more details.
25423  *
25424  * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
25425  * Since: 2.26
25426  */
25427
25428
25429 /**
25430  * g_proxy_supports_hostname:
25431  * @proxy: a #GProxy
25432  *
25433  * Some proxy protocols expect to be passed a hostname, which they
25434  * will resolve to an IP address themselves. Others, like SOCKS4, do
25435  * not allow this. This function will return %FALSE if @proxy is
25436  * implementing such a protocol. When %FALSE is returned, the caller
25437  * should resolve the destination hostname first, and then pass a
25438  * #GProxyAddress containing the stringified IP address to
25439  * g_proxy_connect() or g_proxy_connect_async().
25440  *
25441  * Returns: %TRUE if hostname resolution is supported.
25442  * Since: 2.26
25443  */
25444
25445
25446 /**
25447  * g_remote_action_group_activate_action_full:
25448  * @remote: a #GDBusActionGroup
25449  * @action_name: the name of the action to activate
25450  * @parameter: (allow-none): the optional parameter to the activation
25451  * @platform_data: the platform data to send
25452  *
25453  * Activates the remote action.
25454  *
25455  * This is the same as g_action_group_activate_action() except that it
25456  * allows for provision of "platform data" to be sent along with the
25457  * activation request.  This typically contains details such as the user
25458  * interaction timestamp or startup notification information.
25459  *
25460  * @platform_data must be non-%NULL and must have the type
25461  * %G_VARIANT_TYPE_VARDICT.  If it is floating, it will be consumed.
25462  *
25463  * Since: 2.32
25464  */
25465
25466
25467 /**
25468  * g_remote_action_group_change_action_state_full:
25469  * @remote: a #GRemoteActionGroup
25470  * @action_name: the name of the action to change the state of
25471  * @value: the new requested value for the state
25472  * @platform_data: the platform data to send
25473  *
25474  * Changes the state of a remote action.
25475  *
25476  * This is the same as g_action_group_change_action_state() except that
25477  * it allows for provision of "platform data" to be sent along with the
25478  * state change request.  This typically contains details such as the
25479  * user interaction timestamp or startup notification information.
25480  *
25481  * @platform_data must be non-%NULL and must have the type
25482  * %G_VARIANT_TYPE_VARDICT.  If it is floating, it will be consumed.
25483  *
25484  * Since: 2.32
25485  */
25486
25487
25488 /**
25489  * g_resolver_error_quark:
25490  *
25491  * Gets the #GResolver Error Quark.
25492  *
25493  * Returns: a #GQuark.
25494  * Since: 2.22
25495  */
25496
25497
25498 /**
25499  * g_resolver_free_addresses: (skip)
25500  * @addresses: a #GList of #GInetAddress
25501  *
25502  * Frees @addresses (which should be the return value from
25503  * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
25504  * (This is a convenience method; you can also simply free the results
25505  * by hand.)
25506  *
25507  * Since: 2.22
25508  */
25509
25510
25511 /**
25512  * g_resolver_free_targets: (skip)
25513  * @targets: a #GList of #GSrvTarget
25514  *
25515  * Frees @targets (which should be the return value from
25516  * g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
25517  * (This is a convenience method; you can also simply free the
25518  * results by hand.)
25519  *
25520  * Since: 2.22
25521  */
25522
25523
25524 /**
25525  * g_resolver_get_default:
25526  *
25527  * Gets the default #GResolver. You should unref it when you are done
25528  * with it. #GResolver may use its reference count as a hint about how
25529  * many threads it should allocate for concurrent DNS resolutions.
25530  *
25531  * Returns: (transfer full): the default #GResolver.
25532  * Since: 2.22
25533  */
25534
25535
25536 /**
25537  * g_resolver_lookup_by_address:
25538  * @resolver: a #GResolver
25539  * @address: the address to reverse-resolve
25540  * @cancellable: (allow-none): a #GCancellable, or %NULL
25541  * @error: return location for a #GError, or %NULL
25542  *
25543  * Synchronously reverse-resolves @address to determine its
25544  * associated hostname.
25545  *
25546  * If the DNS resolution fails, @error (if non-%NULL) will be set to
25547  * a value from #GResolverError.
25548  *
25549  * If @cancellable is non-%NULL, it can be used to cancel the
25550  * operation, in which case @error (if non-%NULL) will be set to
25551  * %G_IO_ERROR_CANCELLED.
25552  *
25553  * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25554  * Since: 2.22
25555  */
25556
25557
25558 /**
25559  * g_resolver_lookup_by_address_async:
25560  * @resolver: a #GResolver
25561  * @address: the address to reverse-resolve
25562  * @cancellable: (allow-none): a #GCancellable, or %NULL
25563  * @callback: (scope async): callback to call after resolution completes
25564  * @user_data: (closure): data for @callback
25565  *
25566  * Begins asynchronously reverse-resolving @address to determine its
25567  * associated hostname, and eventually calls @callback, which must
25568  * call g_resolver_lookup_by_address_finish() to get the final result.
25569  *
25570  * Since: 2.22
25571  */
25572
25573
25574 /**
25575  * g_resolver_lookup_by_address_finish:
25576  * @resolver: a #GResolver
25577  * @result: the result passed to your #GAsyncReadyCallback
25578  * @error: return location for a #GError, or %NULL
25579  *
25580  * Retrieves the result of a previous call to
25581  * g_resolver_lookup_by_address_async().
25582  *
25583  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25584  * a value from #GResolverError. If the operation was cancelled,
25585  * @error will be set to %G_IO_ERROR_CANCELLED.
25586  *
25587  * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25588  * Since: 2.22
25589  */
25590
25591
25592 /**
25593  * g_resolver_lookup_by_name:
25594  * @resolver: a #GResolver
25595  * @hostname: the hostname to look up
25596  * @cancellable: (allow-none): a #GCancellable, or %NULL
25597  * @error: return location for a #GError, or %NULL
25598  *
25599  * Synchronously resolves @hostname to determine its associated IP
25600  * address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
25601  * the textual form of an IP address (in which case this just becomes
25602  * a wrapper around g_inet_address_new_from_string()).
25603  *
25604  * On success, g_resolver_lookup_by_name() will return a #GList of
25605  * #GInetAddress, sorted in order of preference and guaranteed to not
25606  * contain duplicates. That is, if using the result to connect to
25607  * @hostname, you should attempt to connect to the first address
25608  * first, then the second if the first fails, etc. If you are using
25609  * the result to listen on a socket, it is appropriate to add each
25610  * result using e.g. g_socket_listener_add_address().
25611  *
25612  * If the DNS resolution fails, @error (if non-%NULL) will be set to a
25613  * value from #GResolverError.
25614  *
25615  * If @cancellable is non-%NULL, it can be used to cancel the
25616  * operation, in which case @error (if non-%NULL) will be set to
25617  * %G_IO_ERROR_CANCELLED.
25618  *
25619  * If you are planning to connect to a socket on the resolved IP
25620  * address, it may be easier to create a #GNetworkAddress and use its
25621  * #GSocketConnectable interface.
25622  *
25623  * 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.)
25624  * Since: 2.22
25625  */
25626
25627
25628 /**
25629  * g_resolver_lookup_by_name_async:
25630  * @resolver: a #GResolver
25631  * @hostname: the hostname to look up the address of
25632  * @cancellable: (allow-none): a #GCancellable, or %NULL
25633  * @callback: (scope async): callback to call after resolution completes
25634  * @user_data: (closure): data for @callback
25635  *
25636  * Begins asynchronously resolving @hostname to determine its
25637  * associated IP address(es), and eventually calls @callback, which
25638  * must call g_resolver_lookup_by_name_finish() to get the result.
25639  * See g_resolver_lookup_by_name() for more details.
25640  *
25641  * Since: 2.22
25642  */
25643
25644
25645 /**
25646  * g_resolver_lookup_by_name_finish:
25647  * @resolver: a #GResolver
25648  * @result: the result passed to your #GAsyncReadyCallback
25649  * @error: return location for a #GError, or %NULL
25650  *
25651  * Retrieves the result of a call to
25652  * g_resolver_lookup_by_name_async().
25653  *
25654  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25655  * a value from #GResolverError. If the operation was cancelled,
25656  * @error will be set to %G_IO_ERROR_CANCELLED.
25657  *
25658  * Returns: (element-type GInetAddress) (transfer full): a #GList of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name() for more details.
25659  * Since: 2.22
25660  */
25661
25662
25663 /**
25664  * g_resolver_lookup_records:
25665  * @resolver: a #GResolver
25666  * @rrname: the DNS name to lookup the record for
25667  * @record_type: the type of DNS record to lookup
25668  * @cancellable: (allow-none): a #GCancellable, or %NULL
25669  * @error: return location for a #GError, or %NULL
25670  *
25671  * Synchronously performs a DNS record lookup for the given @rrname and returns
25672  * a list of records as #GVariant tuples. See #GResolverRecordType for
25673  * information on what the records contain for each @record_type.
25674  *
25675  * If the DNS resolution fails, @error (if non-%NULL) will be set to
25676  * a value from #GResolverError.
25677  *
25678  * If @cancellable is non-%NULL, it can be used to cancel the
25679  * operation, in which case @error (if non-%NULL) will be set to
25680  * %G_IO_ERROR_CANCELLED.
25681  *
25682  * 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.)
25683  * Since: 2.34
25684  */
25685
25686
25687 /**
25688  * g_resolver_lookup_records_async:
25689  * @resolver: a #GResolver
25690  * @rrname: the DNS name to lookup the record for
25691  * @record_type: the type of DNS record to lookup
25692  * @cancellable: (allow-none): a #GCancellable, or %NULL
25693  * @callback: (scope async): callback to call after resolution completes
25694  * @user_data: (closure): data for @callback
25695  *
25696  * Begins asynchronously performing a DNS lookup for the given
25697  * @rrname, and eventually calls @callback, which must call
25698  * g_resolver_lookup_records_finish() to get the final result. See
25699  * g_resolver_lookup_records() for more details.
25700  *
25701  * Since: 2.34
25702  */
25703
25704
25705 /**
25706  * g_resolver_lookup_records_finish:
25707  * @resolver: a #GResolver
25708  * @result: the result passed to your #GAsyncReadyCallback
25709  * @error: return location for a #GError, or %NULL
25710  *
25711  * Retrieves the result of a previous call to
25712  * g_resolver_lookup_records_async(). Returns a list of records as #GVariant
25713  * tuples. See #GResolverRecordType for information on what the records contain.
25714  *
25715  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25716  * a value from #GResolverError. If the operation was cancelled,
25717  * @error will be set to %G_IO_ERROR_CANCELLED.
25718  *
25719  * 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.)
25720  * Since: 2.34
25721  */
25722
25723
25724 /**
25725  * g_resolver_lookup_service:
25726  * @resolver: a #GResolver
25727  * @service: the service type to look up (eg, "ldap")
25728  * @protocol: the networking protocol to use for @service (eg, "tcp")
25729  * @domain: the DNS domain to look up the service in
25730  * @cancellable: (allow-none): a #GCancellable, or %NULL
25731  * @error: return location for a #GError, or %NULL
25732  *
25733  * Synchronously performs a DNS SRV lookup for the given @service and
25734  * @protocol in the given @domain and returns an array of #GSrvTarget.
25735  * @domain may be an ASCII-only or UTF-8 hostname. Note also that the
25736  * @service and @protocol arguments <emphasis>do not</emphasis>
25737  * include the leading underscore that appears in the actual DNS
25738  * entry.
25739  *
25740  * On success, g_resolver_lookup_service() will return a #GList of
25741  * #GSrvTarget, sorted in order of preference. (That is, you should
25742  * attempt to connect to the first target first, then the second if
25743  * the first fails, etc.)
25744  *
25745  * If the DNS resolution fails, @error (if non-%NULL) will be set to
25746  * a value from #GResolverError.
25747  *
25748  * If @cancellable is non-%NULL, it can be used to cancel the
25749  * operation, in which case @error (if non-%NULL) will be set to
25750  * %G_IO_ERROR_CANCELLED.
25751  *
25752  * If you are planning to connect to the service, it is usually easier
25753  * to create a #GNetworkService and use its #GSocketConnectable
25754  * interface.
25755  *
25756  * 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.)
25757  * Since: 2.22
25758  */
25759
25760
25761 /**
25762  * g_resolver_lookup_service_async:
25763  * @resolver: a #GResolver
25764  * @service: the service type to look up (eg, "ldap")
25765  * @protocol: the networking protocol to use for @service (eg, "tcp")
25766  * @domain: the DNS domain to look up the service in
25767  * @cancellable: (allow-none): a #GCancellable, or %NULL
25768  * @callback: (scope async): callback to call after resolution completes
25769  * @user_data: (closure): data for @callback
25770  *
25771  * Begins asynchronously performing a DNS SRV lookup for the given
25772  * @service and @protocol in the given @domain, and eventually calls
25773  * @callback, which must call g_resolver_lookup_service_finish() to
25774  * get the final result. See g_resolver_lookup_service() for more
25775  * details.
25776  *
25777  * Since: 2.22
25778  */
25779
25780
25781 /**
25782  * g_resolver_lookup_service_finish:
25783  * @resolver: a #GResolver
25784  * @result: the result passed to your #GAsyncReadyCallback
25785  * @error: return location for a #GError, or %NULL
25786  *
25787  * Retrieves the result of a previous call to
25788  * g_resolver_lookup_service_async().
25789  *
25790  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25791  * a value from #GResolverError. If the operation was cancelled,
25792  * @error will be set to %G_IO_ERROR_CANCELLED.
25793  *
25794  * Returns: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, or %NULL on error. See g_resolver_lookup_service() for more details.
25795  * Since: 2.22
25796  */
25797
25798
25799 /**
25800  * g_resolver_set_default:
25801  * @resolver: the new default #GResolver
25802  *
25803  * Sets @resolver to be the application's default resolver (reffing
25804  * @resolver, and unreffing the previous default resolver, if any).
25805  * Future calls to g_resolver_get_default() will return this resolver.
25806  *
25807  * This can be used if an application wants to perform any sort of DNS
25808  * caching or "pinning"; it can implement its own #GResolver that
25809  * calls the original default resolver for DNS operations, and
25810  * implements its own cache policies on top of that, and then set
25811  * itself as the default resolver for all later code to use.
25812  *
25813  * Since: 2.22
25814  */
25815
25816
25817 /**
25818  * g_resource_enumerate_children:
25819  * @resource: A #GResource
25820  * @path: A pathname inside the resource
25821  * @lookup_flags: A #GResourceLookupFlags
25822  * @error: return location for a #GError, or %NULL
25823  *
25824  * Returns all the names of children at the specified @path in the resource.
25825  * The return result is a %NULL terminated list of strings which should
25826  * be released with g_strfreev().
25827  *
25828  * @lookup_flags controls the behaviour of the lookup.
25829  *
25830  * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
25831  * Since: 2.32
25832  */
25833
25834
25835 /**
25836  * g_resource_error_quark:
25837  *
25838  * Gets the #GResource Error Quark.
25839  *
25840  * Returns: a #GQuark
25841  * Since: 2.32
25842  */
25843
25844
25845 /**
25846  * g_resource_get_info:
25847  * @resource: A #GResource
25848  * @path: A pathname inside the resource
25849  * @lookup_flags: A #GResourceLookupFlags
25850  * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
25851  * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
25852  * @error: return location for a #GError, or %NULL
25853  *
25854  * Looks for a file at the specified @path in the resource and
25855  * if found returns information about it.
25856  *
25857  * @lookup_flags controls the behaviour of the lookup.
25858  *
25859  * Returns: %TRUE if the file was found. %FALSE if there were errors
25860  * Since: 2.32
25861  */
25862
25863
25864 /**
25865  * g_resource_load:
25866  * @filename: (type filename): the path of a filename to load, in the GLib filename encoding
25867  * @error: return location for a #GError, or %NULL
25868  *
25869  * Loads a binary resource bundle and creates a #GResource representation of it, allowing
25870  * you to query it for data.
25871  *
25872  * If you want to use this resource in the global resource namespace you need
25873  * to register it with g_resources_register().
25874  *
25875  * Returns: (transfer full): a new #GResource, or %NULL on error
25876  * Since: 2.32
25877  */
25878
25879
25880 /**
25881  * g_resource_lookup_data:
25882  * @resource: A #GResource
25883  * @path: A pathname inside the resource
25884  * @lookup_flags: A #GResourceLookupFlags
25885  * @error: return location for a #GError, or %NULL
25886  *
25887  * Looks for a file at the specified @path in the resource and
25888  * returns a #GBytes that lets you directly access the data in
25889  * memory.
25890  *
25891  * The data is always followed by a zero byte, so you
25892  * can safely use the data as a C string. However, that byte
25893  * is not included in the size of the GBytes.
25894  *
25895  * For uncompressed resource files this is a pointer directly into
25896  * the resource bundle, which is typically in some readonly data section
25897  * in the program binary. For compressed files we allocate memory on
25898  * the heap and automatically uncompress the data.
25899  *
25900  * @lookup_flags controls the behaviour of the lookup.
25901  *
25902  * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
25903  * Since: 2.32
25904  */
25905
25906
25907 /**
25908  * g_resource_new_from_data:
25909  * @data: A #GBytes
25910  * @error: return location for a #GError, or %NULL
25911  *
25912  * Creates a GResource from a reference to the binary resource bundle.
25913  * This will keep a reference to @data while the resource lives, so
25914  * the data should not be modified or freed.
25915  *
25916  * If you want to use this resource in the global resource namespace you need
25917  * to register it with g_resources_register().
25918  *
25919  * Returns: (transfer full): a new #GResource, or %NULL on error
25920  * Since: 2.32
25921  */
25922
25923
25924 /**
25925  * g_resource_open_stream:
25926  * @resource: A #GResource
25927  * @path: A pathname inside the resource
25928  * @lookup_flags: A #GResourceLookupFlags
25929  * @error: return location for a #GError, or %NULL
25930  *
25931  * Looks for a file at the specified @path in the resource and
25932  * returns a #GInputStream that lets you read the data.
25933  *
25934  * @lookup_flags controls the behaviour of the lookup.
25935  *
25936  * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
25937  * Since: 2.32
25938  */
25939
25940
25941 /**
25942  * g_resource_ref:
25943  * @resource: A #GResource
25944  *
25945  * Atomically increments the reference count of @array by one. This
25946  * function is MT-safe and may be called from any thread.
25947  *
25948  * Returns: The passed in #GResource
25949  * Since: 2.32
25950  */
25951
25952
25953 /**
25954  * g_resource_unref:
25955  * @resource: A #GResource
25956  *
25957  * Atomically decrements the reference count of @resource by one. If the
25958  * reference count drops to 0, all memory allocated by the array is
25959  * released. This function is MT-safe and may be called from any
25960  * thread.
25961  *
25962  * Since: 2.32
25963  */
25964
25965
25966 /**
25967  * g_resources_enumerate_children:
25968  * @path: A pathname inside the resource
25969  * @lookup_flags: A #GResourceLookupFlags
25970  * @error: return location for a #GError, or %NULL
25971  *
25972  * Returns all the names of children at the specified @path in the set of
25973  * globally registered resources.
25974  * The return result is a %NULL terminated list of strings which should
25975  * be released with g_strfreev().
25976  *
25977  * @lookup_flags controls the behaviour of the lookup.
25978  *
25979  * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
25980  * Since: 2.32
25981  */
25982
25983
25984 /**
25985  * g_resources_get_info:
25986  * @path: A pathname inside the resource
25987  * @lookup_flags: A #GResourceLookupFlags
25988  * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
25989  * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
25990  * @error: return location for a #GError, or %NULL
25991  *
25992  * Looks for a file at the specified @path in the set of
25993  * globally registered resources and if found returns information about it.
25994  *
25995  * @lookup_flags controls the behaviour of the lookup.
25996  *
25997  * Returns: %TRUE if the file was found. %FALSE if there were errors
25998  * Since: 2.32
25999  */
26000
26001
26002 /**
26003  * g_resources_lookup_data:
26004  * @path: A pathname inside the resource
26005  * @lookup_flags: A #GResourceLookupFlags
26006  * @error: return location for a #GError, or %NULL
26007  *
26008  * Looks for a file at the specified @path in the set of
26009  * globally registered resources and returns a #GBytes that
26010  * lets you directly access the data in memory.
26011  *
26012  * The data is always followed by a zero byte, so you
26013  * can safely use the data as a C string. However, that byte
26014  * is not included in the size of the GBytes.
26015  *
26016  * For uncompressed resource files this is a pointer directly into
26017  * the resource bundle, which is typically in some readonly data section
26018  * in the program binary. For compressed files we allocate memory on
26019  * the heap and automatically uncompress the data.
26020  *
26021  * @lookup_flags controls the behaviour of the lookup.
26022  *
26023  * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
26024  * Since: 2.32
26025  */
26026
26027
26028 /**
26029  * g_resources_open_stream:
26030  * @path: A pathname inside the resource
26031  * @lookup_flags: A #GResourceLookupFlags
26032  * @error: return location for a #GError, or %NULL
26033  *
26034  * Looks for a file at the specified @path in the set of
26035  * globally registered resources and returns a #GInputStream
26036  * that lets you read the data.
26037  *
26038  * @lookup_flags controls the behaviour of the lookup.
26039  *
26040  * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
26041  * Since: 2.32
26042  */
26043
26044
26045 /**
26046  * g_resources_register:
26047  * @resource: A #GResource
26048  *
26049  * Registers the resource with the process-global set of resources.
26050  * Once a resource is registered the files in it can be accessed
26051  * with the global resource lookup functions like g_resources_lookup_data().
26052  *
26053  * Since: 2.32
26054  */
26055
26056
26057 /**
26058  * g_resources_unregister:
26059  * @resource: A #GResource
26060  *
26061  * Unregisters the resource from the process-global set of resources.
26062  *
26063  * Since: 2.32
26064  */
26065
26066
26067 /**
26068  * g_seekable_can_seek:
26069  * @seekable: a #GSeekable.
26070  *
26071  * Tests if the stream supports the #GSeekableIface.
26072  *
26073  * Returns: %TRUE if @seekable can be seeked. %FALSE otherwise.
26074  */
26075
26076
26077 /**
26078  * g_seekable_can_truncate:
26079  * @seekable: a #GSeekable.
26080  *
26081  * Tests if the stream can be truncated.
26082  *
26083  * Returns: %TRUE if the stream can be truncated, %FALSE otherwise.
26084  */
26085
26086
26087 /**
26088  * g_seekable_seek:
26089  * @seekable: a #GSeekable.
26090  * @offset: a #goffset.
26091  * @type: a #GSeekType.
26092  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26093  * @error: a #GError location to store the error occurring, or %NULL to ignore.
26094  *
26095  * Seeks in the stream by the given @offset, modified by @type.
26096  *
26097  * If @cancellable is not %NULL, then the operation can be cancelled by
26098  * triggering the cancellable object from another thread. If the operation
26099  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
26100  *
26101  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26102  */
26103
26104
26105 /**
26106  * g_seekable_tell:
26107  * @seekable: a #GSeekable.
26108  *
26109  * Tells the current position within the stream.
26110  *
26111  * Returns: the offset from the beginning of the buffer.
26112  */
26113
26114
26115 /**
26116  * g_seekable_truncate:
26117  * @seekable: a #GSeekable.
26118  * @offset: a #goffset.
26119  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26120  * @error: a #GError location to store the error occurring, or %NULL to ignore.
26121  *
26122  * Truncates a stream with a given #offset.
26123  *
26124  * If @cancellable is not %NULL, then the operation can be cancelled by
26125  * triggering the cancellable object from another thread. If the operation
26126  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
26127  * operation was partially finished when the operation was cancelled the
26128  * partial result will be returned, without an error.
26129  *
26130  * Virtual: truncate_fn
26131  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
26132  */
26133
26134
26135 /**
26136  * g_settings_apply:
26137  * @settings: a #GSettings instance
26138  *
26139  * Applies any changes that have been made to the settings.  This
26140  * function does nothing unless @settings is in 'delay-apply' mode;
26141  * see g_settings_delay().  In the normal case settings are always
26142  * applied immediately.
26143  */
26144
26145
26146 /**
26147  * g_settings_backend_changed:
26148  * @backend: a #GSettingsBackend implementation
26149  * @key: the name of the key
26150  * @origin_tag: the origin tag
26151  *
26152  * Signals that a single key has possibly changed.  Backend
26153  * implementations should call this if a key has possibly changed its
26154  * value.
26155  *
26156  * @key must be a valid key (ie starting with a slash, not containing
26157  * '//', and not ending with a slash).
26158  *
26159  * The implementation must call this function during any call to
26160  * g_settings_backend_write(), before the call returns (except in the
26161  * case that no keys are actually changed and it cares to detect this
26162  * fact).  It may not rely on the existence of a mainloop for
26163  * dispatching the signal later.
26164  *
26165  * The implementation may call this function at any other time it likes
26166  * in response to other events (such as changes occurring outside of the
26167  * program).  These calls may originate from a mainloop or may originate
26168  * in response to any other action (including from calls to
26169  * g_settings_backend_write()).
26170  *
26171  * In the case that this call is in response to a call to
26172  * g_settings_backend_write() then @origin_tag must be set to the same
26173  * value that was passed to that call.
26174  *
26175  * Since: 2.26
26176  */
26177
26178
26179 /**
26180  * g_settings_backend_changed_tree:
26181  * @backend: a #GSettingsBackend implementation
26182  * @tree: a #GTree containing the changes
26183  * @origin_tag: the origin tag
26184  *
26185  * This call is a convenience wrapper.  It gets the list of changes from
26186  * @tree, computes the longest common prefix and calls
26187  * g_settings_backend_changed().
26188  *
26189  * Since: 2.26
26190  */
26191
26192
26193 /**
26194  * g_settings_backend_flatten_tree:
26195  * @tree: a #GTree containing the changes
26196  * @path: (out): the location to save the path
26197  * @keys: (out) (transfer container) (array zero-terminated=1): the location to save the relative keys
26198  * @values: (out) (allow-none) (transfer container) (array zero-terminated=1): the location to save the values, or %NULL
26199  *
26200  * Calculate the longest common prefix of all keys in a tree and write
26201  * out an array of the key names relative to that prefix and,
26202  * optionally, the value to store at each of those keys.
26203  *
26204  * You must free the value returned in @path, @keys and @values using
26205  * g_free().  You should not attempt to free or unref the contents of
26206  * @keys or @values.
26207  *
26208  * Since: 2.26
26209  */
26210
26211
26212 /**
26213  * g_settings_backend_get_default:
26214  *
26215  * Returns the default #GSettingsBackend. It is possible to override
26216  * the default by setting the <envar>GSETTINGS_BACKEND</envar>
26217  * environment variable to the name of a settings backend.
26218  *
26219  * The user gets a reference to the backend.
26220  *
26221  * Returns: (transfer full): the default #GSettingsBackend
26222  * Since: 2.28
26223  */
26224
26225
26226 /**
26227  * g_settings_backend_keys_changed:
26228  * @backend: a #GSettingsBackend implementation
26229  * @path: the path containing the changes
26230  * @items: (array zero-terminated=1): the %NULL-terminated list of changed keys
26231  * @origin_tag: the origin tag
26232  *
26233  * Signals that a list of keys have possibly changed.  Backend
26234  * implementations should call this if keys have possibly changed their
26235  * values.
26236  *
26237  * @path must be a valid path (ie starting and ending with a slash and
26238  * not containing '//').  Each string in @items must form a valid key
26239  * name when @path is prefixed to it (ie: each item must not start or
26240  * end with '/' and must not contain '//').
26241  *
26242  * The meaning of this signal is that any of the key names resulting
26243  * from the contatenation of @path with each item in @items may have
26244  * changed.
26245  *
26246  * The same rules for when notifications must occur apply as per
26247  * g_settings_backend_changed().  These two calls can be used
26248  * interchangeably if exactly one item has changed (although in that
26249  * case g_settings_backend_changed() is definitely preferred).
26250  *
26251  * For efficiency reasons, the implementation should strive for @path to
26252  * be as long as possible (ie: the longest common prefix of all of the
26253  * keys that were changed) but this is not strictly required.
26254  *
26255  * Since: 2.26
26256  */
26257
26258
26259 /**
26260  * g_settings_backend_path_changed:
26261  * @backend: a #GSettingsBackend implementation
26262  * @path: the path containing the changes
26263  * @origin_tag: the origin tag
26264  *
26265  * Signals that all keys below a given path may have possibly changed.
26266  * Backend implementations should call this if an entire path of keys
26267  * have possibly changed their values.
26268  *
26269  * @path must be a valid path (ie starting and ending with a slash and
26270  * not containing '//').
26271  *
26272  * The meaning of this signal is that any of the key which has a name
26273  * starting with @path may have changed.
26274  *
26275  * The same rules for when notifications must occur apply as per
26276  * g_settings_backend_changed().  This call might be an appropriate
26277  * reasponse to a 'reset' call but implementations are also free to
26278  * explicitly list the keys that were affected by that call if they can
26279  * easily do so.
26280  *
26281  * For efficiency reasons, the implementation should strive for @path to
26282  * be as long as possible (ie: the longest common prefix of all of the
26283  * keys that were changed) but this is not strictly required.  As an
26284  * example, if this function is called with the path of "/" then every
26285  * single key in the application will be notified of a possible change.
26286  *
26287  * Since: 2.26
26288  */
26289
26290
26291 /**
26292  * g_settings_backend_path_writable_changed:
26293  * @backend: a #GSettingsBackend implementation
26294  * @path: the name of the path
26295  *
26296  * Signals that the writability of all keys below a given path may have
26297  * 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_backend_writable_changed:
26308  * @backend: a #GSettingsBackend implementation
26309  * @key: the name of the key
26310  *
26311  * Signals that the writability of a single key has possibly changed.
26312  *
26313  * Since GSettings performs no locking operations for itself, this call
26314  * will always be made in response to external events.
26315  *
26316  * Since: 2.26
26317  */
26318
26319
26320 /**
26321  * g_settings_bind:
26322  * @settings: a #GSettings object
26323  * @key: the key to bind
26324  * @object: (type GObject.Object): a #GObject
26325  * @property: the name of the property to bind
26326  * @flags: flags for the binding
26327  *
26328  * Create a binding between the @key in the @settings object
26329  * and the property @property of @object.
26330  *
26331  * The binding uses the default GIO mapping functions to map
26332  * between the settings and property values. These functions
26333  * handle booleans, numeric types and string types in a
26334  * straightforward way. Use g_settings_bind_with_mapping() if
26335  * you need a custom mapping, or map between types that are not
26336  * supported by the default mapping functions.
26337  *
26338  * Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
26339  * function also establishes a binding between the writability of
26340  * @key and the "sensitive" property of @object (if @object has
26341  * a boolean property by that name). See g_settings_bind_writable()
26342  * for more details about writable bindings.
26343  *
26344  * Note that the lifecycle of the binding is tied to the object,
26345  * and that you can have only one binding per object property.
26346  * If you bind the same property twice on the same object, the second
26347  * binding overrides the first one.
26348  *
26349  * Since: 2.26
26350  */
26351
26352
26353 /**
26354  * g_settings_bind_with_mapping: (skip)
26355  * @settings: a #GSettings object
26356  * @key: the key to bind
26357  * @object: (type GObject.Object): a #GObject
26358  * @property: the name of the property to bind
26359  * @flags: flags for the binding
26360  * @get_mapping: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
26361  * @set_mapping: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
26362  * @user_data: data that gets passed to @get_mapping and @set_mapping
26363  * @destroy: #GDestroyNotify function for @user_data
26364  *
26365  * Create a binding between the @key in the @settings object
26366  * and the property @property of @object.
26367  *
26368  * The binding uses the provided mapping functions to map between
26369  * settings and property values.
26370  *
26371  * Note that the lifecycle of the binding is tied to the object,
26372  * and that you can have only one binding per object property.
26373  * If you bind the same property twice on the same object, the second
26374  * binding overrides the first one.
26375  *
26376  * Since: 2.26
26377  */
26378
26379
26380 /**
26381  * g_settings_bind_writable:
26382  * @settings: a #GSettings object
26383  * @key: the key to bind
26384  * @object: (type GObject.Object): a #GObject
26385  * @property: the name of a boolean property to bind
26386  * @inverted: whether to 'invert' the value
26387  *
26388  * Create a binding between the writability of @key in the
26389  * @settings object and the property @property of @object.
26390  * The property must be boolean; "sensitive" or "visible"
26391  * properties of widgets are the most likely candidates.
26392  *
26393  * Writable bindings are always uni-directional; changes of the
26394  * writability of the setting will be propagated to the object
26395  * property, not the other way.
26396  *
26397  * When the @inverted argument is %TRUE, the binding inverts the
26398  * value as it passes from the setting to the object, i.e. @property
26399  * will be set to %TRUE if the key is <emphasis>not</emphasis>
26400  * writable.
26401  *
26402  * Note that the lifecycle of the binding is tied to the object,
26403  * and that you can have only one binding per object property.
26404  * If you bind the same property twice on the same object, the second
26405  * binding overrides the first one.
26406  *
26407  * Since: 2.26
26408  */
26409
26410
26411 /**
26412  * g_settings_create_action:
26413  * @settings: a #GSettings
26414  * @key: the name of a key in @settings
26415  *
26416  * Creates a #GAction corresponding to a given #GSettings key.
26417  *
26418  * The action has the same name as the key.
26419  *
26420  * The value of the key becomes the state of the action and the action
26421  * is enabled when the key is writable.  Changing the state of the
26422  * action results in the key being written to.  Changes to the value or
26423  * writability of the key cause appropriate change notifications to be
26424  * emitted for the action.
26425  *
26426  * For boolean-valued keys, action activations take no parameter and
26427  * result in the toggling of the value.  For all other types,
26428  * activations take the new value for the key (which must have the
26429  * correct type).
26430  *
26431  * Returns: (transfer full): a new #GAction
26432  * Since: 2.32
26433  */
26434
26435
26436 /**
26437  * g_settings_delay:
26438  * @settings: a #GSettings object
26439  *
26440  * Changes the #GSettings object into 'delay-apply' mode. In this
26441  * mode, changes to @settings are not immediately propagated to the
26442  * backend, but kept locally until g_settings_apply() is called.
26443  *
26444  * Since: 2.26
26445  */
26446
26447
26448 /**
26449  * g_settings_get:
26450  * @settings: a #GSettings object
26451  * @key: the key to get the value for
26452  * @format: a #GVariant format string
26453  * @...: arguments as per @format
26454  *
26455  * Gets the value that is stored at @key in @settings.
26456  *
26457  * A convenience function that combines g_settings_get_value() with
26458  * g_variant_get().
26459  *
26460  * It is a programmer error to give a @key that isn't contained in the
26461  * schema for @settings or for the #GVariantType of @format to mismatch
26462  * the type given in the schema.
26463  *
26464  * Since: 2.26
26465  */
26466
26467
26468 /**
26469  * g_settings_get_boolean:
26470  * @settings: a #GSettings object
26471  * @key: the key to get the value for
26472  *
26473  * Gets the value that is stored at @key in @settings.
26474  *
26475  * A convenience variant of g_settings_get() for booleans.
26476  *
26477  * It is a programmer error to give a @key that isn't specified as
26478  * having a boolean type in the schema for @settings.
26479  *
26480  * Returns: a boolean
26481  * Since: 2.26
26482  */
26483
26484
26485 /**
26486  * g_settings_get_child:
26487  * @settings: a #GSettings object
26488  * @name: the name of the 'child' schema
26489  *
26490  * Creates a 'child' settings object which has a base path of
26491  * <replaceable>base-path</replaceable>/@name, where
26492  * <replaceable>base-path</replaceable> is the base path of @settings.
26493  *
26494  * The schema for the child settings object must have been declared
26495  * in the schema of @settings using a <tag class="starttag">child</tag> element.
26496  *
26497  * Returns: (transfer full): a 'child' settings object
26498  * Since: 2.26
26499  */
26500
26501
26502 /**
26503  * g_settings_get_double:
26504  * @settings: a #GSettings object
26505  * @key: the key to get the value for
26506  *
26507  * Gets the value that is stored at @key in @settings.
26508  *
26509  * A convenience variant of g_settings_get() for doubles.
26510  *
26511  * It is a programmer error to give a @key that isn't specified as
26512  * having a 'double' type in the schema for @settings.
26513  *
26514  * Returns: a double
26515  * Since: 2.26
26516  */
26517
26518
26519 /**
26520  * g_settings_get_enum:
26521  * @settings: a #GSettings object
26522  * @key: the key to get the value for
26523  *
26524  * Gets the value that is stored in @settings for @key and converts it
26525  * to the enum value that it represents.
26526  *
26527  * In order to use this function the type of the value must be a string
26528  * and it must be marked in the schema file as an enumerated type.
26529  *
26530  * It is a programmer error to give a @key that isn't contained in the
26531  * schema for @settings or is not marked as an enumerated type.
26532  *
26533  * If the value stored in the configuration database is not a valid
26534  * value for the enumerated type then this function will return the
26535  * default value.
26536  *
26537  * Returns: the enum value
26538  * Since: 2.26
26539  */
26540
26541
26542 /**
26543  * g_settings_get_flags:
26544  * @settings: a #GSettings object
26545  * @key: the key to get the value for
26546  *
26547  * Gets the value that is stored in @settings for @key and converts it
26548  * to the flags value that it represents.
26549  *
26550  * In order to use this function the type of the value must be an array
26551  * of strings and it must be marked in the schema file as an flags type.
26552  *
26553  * It is a programmer error to give a @key that isn't contained in the
26554  * schema for @settings or is not marked as a flags type.
26555  *
26556  * If the value stored in the configuration database is not a valid
26557  * value for the flags type then this function will return the default
26558  * value.
26559  *
26560  * Returns: the flags value
26561  * Since: 2.26
26562  */
26563
26564
26565 /**
26566  * g_settings_get_has_unapplied:
26567  * @settings: a #GSettings object
26568  *
26569  * Returns whether the #GSettings object has any unapplied
26570  * changes.  This can only be the case if it is in 'delayed-apply' mode.
26571  *
26572  * Returns: %TRUE if @settings has unapplied changes
26573  * Since: 2.26
26574  */
26575
26576
26577 /**
26578  * g_settings_get_int:
26579  * @settings: a #GSettings object
26580  * @key: the key to get the value for
26581  *
26582  * Gets the value that is stored at @key in @settings.
26583  *
26584  * A convenience variant of g_settings_get() for 32-bit integers.
26585  *
26586  * It is a programmer error to give a @key that isn't specified as
26587  * having a int32 type in the schema for @settings.
26588  *
26589  * Returns: an integer
26590  * Since: 2.26
26591  */
26592
26593
26594 /**
26595  * g_settings_get_mapped:
26596  * @settings: a #GSettings object
26597  * @key: the key to get the value for
26598  * @mapping: (scope call): the function to map the value in the settings database to the value used by the application
26599  * @user_data: user data for @mapping
26600  *
26601  * Gets the value that is stored at @key in @settings, subject to
26602  * application-level validation/mapping.
26603  *
26604  * You should use this function when the application needs to perform
26605  * some processing on the value of the key (for example, parsing).  The
26606  * @mapping function performs that processing.  If the function
26607  * indicates that the processing was unsuccessful (due to a parse error,
26608  * for example) then the mapping is tried again with another value.
26609  *
26610  * This allows a robust 'fall back to defaults' behaviour to be
26611  * implemented somewhat automatically.
26612  *
26613  * The first value that is tried is the user's setting for the key.  If
26614  * the mapping function fails to map this value, other values may be
26615  * tried in an unspecified order (system or site defaults, translated
26616  * schema default values, untranslated schema default values, etc).
26617  *
26618  * If the mapping function fails for all possible values, one additional
26619  * attempt is made: the mapping function is called with a %NULL value.
26620  * If the mapping function still indicates failure at this point then
26621  * the application will be aborted.
26622  *
26623  * The result parameter for the @mapping function is pointed to a
26624  * #gpointer which is initially set to %NULL.  The same pointer is given
26625  * to each invocation of @mapping.  The final value of that #gpointer is
26626  * what is returned by this function.  %NULL is valid; it is returned
26627  * just as any other value would be.
26628  *
26629  * Returns: (transfer full): the result, which may be %NULL
26630  */
26631
26632
26633 /**
26634  * g_settings_get_range:
26635  * @settings: a #GSettings
26636  * @key: the key to query the range of
26637  *
26638  * Queries the range of a key.
26639  *
26640  * This function will return a #GVariant that fully describes the range
26641  * of values that are valid for @key.
26642  *
26643  * The type of #GVariant returned is <literal>(sv)</literal>.  The
26644  * string describes the type of range restriction in effect.  The type
26645  * and meaning of the value contained in the variant depends on the
26646  * string.
26647  *
26648  * If the string is <literal>'type'</literal> then the variant contains
26649  * an empty array.  The element type of that empty array is the expected
26650  * type of value and all values of that type are valid.
26651  *
26652  * If the string is <literal>'enum'</literal> then the variant contains
26653  * an array enumerating the possible values.  Each item in the array is
26654  * a possible valid value and no other values are valid.
26655  *
26656  * If the string is <literal>'flags'</literal> then the variant contains
26657  * an array.  Each item in the array is a value that may appear zero or
26658  * one times in an array to be used as the value for this key.  For
26659  * example, if the variant contained the array <literal>['x',
26660  * 'y']</literal> then the valid values for the key would be
26661  * <literal>[]</literal>, <literal>['x']</literal>,
26662  * <literal>['y']</literal>, <literal>['x', 'y']</literal> and
26663  * <literal>['y', 'x']</literal>.
26664  *
26665  * Finally, if the string is <literal>'range'</literal> then the variant
26666  * contains a pair of like-typed values -- the minimum and maximum
26667  * permissible values for this key.
26668  *
26669  * This information should not be used by normal programs.  It is
26670  * considered to be a hint for introspection purposes.  Normal programs
26671  * should already know what is permitted by their own schema.  The
26672  * format may change in any way in the future -- but particularly, new
26673  * forms may be added to the possibilities described above.
26674  *
26675  * It is a programmer error to give a @key that isn't contained in the
26676  * schema for @settings.
26677  *
26678  * You should free the returned value with g_variant_unref() when it is
26679  * no longer needed.
26680  *
26681  * Returns: a #GVariant describing the range
26682  * Since: 2.28
26683  */
26684
26685
26686 /**
26687  * g_settings_get_string:
26688  * @settings: a #GSettings object
26689  * @key: the key to get the value for
26690  *
26691  * Gets the value that is stored at @key in @settings.
26692  *
26693  * A convenience variant of g_settings_get() for strings.
26694  *
26695  * It is a programmer error to give a @key that isn't specified as
26696  * having a string type in the schema for @settings.
26697  *
26698  * Returns: a newly-allocated string
26699  * Since: 2.26
26700  */
26701
26702
26703 /**
26704  * g_settings_get_strv:
26705  * @settings: a #GSettings object
26706  * @key: the key to get the value for
26707  *
26708  * A convenience variant of g_settings_get() for string arrays.
26709  *
26710  * It is a programmer error to give a @key that isn't specified as
26711  * having an array of strings type in the schema for @settings.
26712  *
26713  * Returns: (array zero-terminated=1) (transfer full): a newly-allocated, %NULL-terminated array of strings, the value that is stored at @key in @settings.
26714  * Since: 2.26
26715  */
26716
26717
26718 /**
26719  * g_settings_get_uint:
26720  * @settings: a #GSettings object
26721  * @key: the key to get the value for
26722  *
26723  * Gets the value that is stored at @key in @settings.
26724  *
26725  * A convenience variant of g_settings_get() for 32-bit unsigned
26726  * integers.
26727  *
26728  * It is a programmer error to give a @key that isn't specified as
26729  * having a uint32 type in the schema for @settings.
26730  *
26731  * Returns: an unsigned integer
26732  * Since: 2.30
26733  */
26734
26735
26736 /**
26737  * g_settings_get_value:
26738  * @settings: a #GSettings object
26739  * @key: the key to get the value for
26740  *
26741  * Gets the value that is stored in @settings for @key.
26742  *
26743  * It is a programmer error to give a @key that isn't contained in the
26744  * schema for @settings.
26745  *
26746  * Returns: a new #GVariant
26747  * Since: 2.26
26748  */
26749
26750
26751 /**
26752  * g_settings_is_writable:
26753  * @settings: a #GSettings object
26754  * @name: the name of a key
26755  *
26756  * Finds out if a key can be written or not
26757  *
26758  * Returns: %TRUE if the key @name is writable
26759  * Since: 2.26
26760  */
26761
26762
26763 /**
26764  * g_settings_list_children:
26765  * @settings: a #GSettings object
26766  *
26767  * Gets the list of children on @settings.
26768  *
26769  * The list is exactly the list of strings for which it is not an error
26770  * to call g_settings_get_child().
26771  *
26772  * For GSettings objects that are lists, this value can change at any
26773  * time and you should connect to the "children-changed" signal to watch
26774  * for those changes.  Note that there is a race condition here: you may
26775  * request a child after listing it only for it to have been destroyed
26776  * in the meantime.  For this reason, g_settings_get_child() may return
26777  * %NULL even for a child that was listed by this function.
26778  *
26779  * For GSettings objects that are not lists, you should probably not be
26780  * calling this function from "normal" code (since you should already
26781  * know what children are in your schema).  This function may still be
26782  * useful there for introspection reasons, however.
26783  *
26784  * You should free the return value with g_strfreev() when you are done
26785  * with it.
26786  *
26787  * Returns: (transfer full) (element-type utf8): a list of the children on @settings
26788  */
26789
26790
26791 /**
26792  * g_settings_list_keys:
26793  * @settings: a #GSettings object
26794  *
26795  * Introspects the list of keys on @settings.
26796  *
26797  * You should probably not be calling this function from "normal" code
26798  * (since you should already know what keys are in your schema).  This
26799  * function is intended for introspection reasons.
26800  *
26801  * You should free the return value with g_strfreev() when you are done
26802  * with it.
26803  *
26804  * Returns: (transfer full) (element-type utf8): a list of the keys on @settings
26805  */
26806
26807
26808 /**
26809  * g_settings_list_relocatable_schemas:
26810  *
26811  * Gets a list of the relocatable #GSettings schemas installed on the
26812  * system.  These are schemas that do not provide their own path.  It is
26813  * usual to instantiate these schemas directly, but if you want to you
26814  * can use g_settings_new_with_path() to specify the path.
26815  *
26816  * The output of this function, taken together with the output of
26817  * g_settings_list_schemas() represents the complete list of all
26818  * installed schemas.
26819  *
26820  * Returns: (element-type utf8) (transfer none): a list of relocatable #GSettings schemas that are available.  The list must not be modified or freed.
26821  * Since: 2.28
26822  */
26823
26824
26825 /**
26826  * g_settings_list_schemas:
26827  *
26828  * Gets a list of the #GSettings schemas installed on the system.  The
26829  * returned list is exactly the list of schemas for which you may call
26830  * g_settings_new() without adverse effects.
26831  *
26832  * This function does not list the schemas that do not provide their own
26833  * paths (ie: schemas for which you must use
26834  * g_settings_new_with_path()).  See
26835  * g_settings_list_relocatable_schemas() for that.
26836  *
26837  * Returns: (element-type utf8) (transfer none): a list of #GSettings schemas that are available.  The list must not be modified or freed.
26838  * Since: 2.26
26839  */
26840
26841
26842 /**
26843  * g_settings_new:
26844  * @schema_id: the id of the schema
26845  *
26846  * Creates a new #GSettings object with the schema specified by
26847  * @schema_id.
26848  *
26849  * Signals on the newly created #GSettings object will be dispatched
26850  * via the thread-default #GMainContext in effect at the time of the
26851  * call to g_settings_new().  The new #GSettings will hold a reference
26852  * on the context.  See g_main_context_push_thread_default().
26853  *
26854  * Returns: a new #GSettings object
26855  * Since: 2.26
26856  */
26857
26858
26859 /**
26860  * g_settings_new_full:
26861  * @schema: a #GSettingsSchema
26862  * @backend: (allow-none): a #GSettingsBackend
26863  * @path: (allow-none): the path to use
26864  *
26865  * Creates a new #GSettings object with a given schema, backend and
26866  * path.
26867  *
26868  * It should be extremely rare that you ever want to use this function.
26869  * It is made available for advanced use-cases (such as plugin systems
26870  * that want to provide access to schemas loaded from custom locations,
26871  * etc).
26872  *
26873  * At the most basic level, a #GSettings object is a pure composition of
26874  * 4 things: a #GSettingsSchema, a #GSettingsBackend, a path within that
26875  * backend, and a #GMainContext to which signals are dispatched.
26876  *
26877  * This constructor therefore gives you full control over constructing
26878  * #GSettings instances.  The first 4 parameters are given directly as
26879  * @schema, @backend and @path, and the main context is taken from the
26880  * thread-default (as per g_settings_new()).
26881  *
26882  * If @backend is %NULL then the default backend is used.
26883  *
26884  * If @path is %NULL then the path from the schema is used.  It is an
26885  * error f @path is %NULL and the schema has no path of its own or if
26886  * @path is non-%NULL and not equal to the path that the schema does
26887  * have.
26888  *
26889  * Returns: a new #GSettings object
26890  * Since: 2.32
26891  */
26892
26893
26894 /**
26895  * g_settings_new_with_backend:
26896  * @schema_id: the id of the schema
26897  * @backend: the #GSettingsBackend to use
26898  *
26899  * Creates a new #GSettings object with the schema specified by
26900  * @schema_id and a given #GSettingsBackend.
26901  *
26902  * Creating a #GSettings object with a different backend allows accessing
26903  * settings from a database other than the usual one. For example, it may make
26904  * sense to pass a backend corresponding to the "defaults" settings database on
26905  * the system to get a settings object that modifies the system default
26906  * settings instead of the settings for this user.
26907  *
26908  * Returns: a new #GSettings object
26909  * Since: 2.26
26910  */
26911
26912
26913 /**
26914  * g_settings_new_with_backend_and_path:
26915  * @schema_id: the id of the schema
26916  * @backend: the #GSettingsBackend to use
26917  * @path: the path to use
26918  *
26919  * Creates a new #GSettings object with the schema specified by
26920  * @schema_id and a given #GSettingsBackend and path.
26921  *
26922  * This is a mix of g_settings_new_with_backend() and
26923  * g_settings_new_with_path().
26924  *
26925  * Returns: a new #GSettings object
26926  * Since: 2.26
26927  */
26928
26929
26930 /**
26931  * g_settings_new_with_path:
26932  * @schema_id: the id of the schema
26933  * @path: the path to use
26934  *
26935  * Creates a new #GSettings object with the relocatable schema specified
26936  * by @schema_id and a given path.
26937  *
26938  * You only need to do this if you want to directly create a settings
26939  * object with a schema that doesn't have a specified path of its own.
26940  * That's quite rare.
26941  *
26942  * It is a programmer error to call this function for a schema that
26943  * has an explicitly specified path.
26944  *
26945  * Returns: a new #GSettings object
26946  * Since: 2.26
26947  */
26948
26949
26950 /**
26951  * g_settings_range_check:
26952  * @settings: a #GSettings
26953  * @key: the key to check
26954  * @value: the value to check
26955  *
26956  * Checks if the given @value is of the correct type and within the
26957  * permitted range for @key.
26958  *
26959  * This API is not intended to be used by normal programs -- they should
26960  * already know what is permitted by their own schemas.  This API is
26961  * meant to be used by programs such as editors or commandline tools.
26962  *
26963  * It is a programmer error to give a @key that isn't contained in the
26964  * schema for @settings.
26965  *
26966  * Returns: %TRUE if @value is valid for @key
26967  * Since: 2.28
26968  */
26969
26970
26971 /**
26972  * g_settings_reset:
26973  * @settings: a #GSettings object
26974  * @key: the name of a key
26975  *
26976  * Resets @key to its default value.
26977  *
26978  * This call resets the key, as much as possible, to its default value.
26979  * That might the value specified in the schema or the one set by the
26980  * administrator.
26981  */
26982
26983
26984 /**
26985  * g_settings_revert:
26986  * @settings: a #GSettings instance
26987  *
26988  * Reverts all non-applied changes to the settings.  This function
26989  * does nothing unless @settings is in 'delay-apply' mode; see
26990  * g_settings_delay().  In the normal case settings are always applied
26991  * immediately.
26992  *
26993  * Change notifications will be emitted for affected keys.
26994  */
26995
26996
26997 /**
26998  * g_settings_schema_get_id:
26999  * @schema: a #GSettingsSchema
27000  *
27001  * Get the ID of @schema.
27002  *
27003  * Returns: (transfer none): the ID
27004  */
27005
27006
27007 /**
27008  * g_settings_schema_get_path:
27009  * @schema: a #GSettingsSchema
27010  *
27011  * Gets the path associated with @schema, or %NULL.
27012  *
27013  * Schemas may be single-instance or relocatable.  Single-instance
27014  * schemas correspond to exactly one set of keys in the backend
27015  * database: those located at the path returned by this function.
27016  *
27017  * Relocatable schemas can be referenced by other schemas and can
27018  * threfore describe multiple sets of keys at different locations.  For
27019  * relocatable schemas, this function will return %NULL.
27020  *
27021  * Returns: (transfer none): the path of the schema, or %NULL
27022  * Since: 2.32
27023  */
27024
27025
27026 /**
27027  * g_settings_schema_ref:
27028  * @schema: a #GSettingsSchema
27029  *
27030  * Increase the reference count of @schema, returning a new reference.
27031  *
27032  * Returns: a new reference to @schema
27033  * Since: 2.32
27034  */
27035
27036
27037 /**
27038  * g_settings_schema_source_get_default:
27039  *
27040  * Gets the default system schema source.
27041  *
27042  * This function is not required for normal uses of #GSettings but it
27043  * may be useful to authors of plugin management systems or to those who
27044  * want to introspect the content of schemas.
27045  *
27046  * If no schemas are installed, %NULL will be returned.
27047  *
27048  * The returned source may actually consist of multiple schema sources
27049  * from different directories, depending on which directories were given
27050  * in <envar>XDG_DATA_DIRS</envar> and
27051  * <envar>GSETTINGS_SCHEMA_DIR</envar>.  For this reason, all lookups
27052  * performed against the default source should probably be done
27053  * recursively.
27054  *
27055  * Returns: (transfer none): the default schema source
27056  * Since: 2.32
27057  */
27058
27059
27060 /**
27061  * g_settings_schema_source_lookup:
27062  * @source: a #GSettingsSchemaSource
27063  * @schema_id: a schema ID
27064  * @recursive: %TRUE if the lookup should be recursive
27065  *
27066  * Looks up a schema with the identifier @schema_id in @source.
27067  *
27068  * This function is not required for normal uses of #GSettings but it
27069  * may be useful to authors of plugin management systems or to those who
27070  * want to introspect the content of schemas.
27071  *
27072  * If the schema isn't found directly in @source and @recursive is %TRUE
27073  * then the parent sources will also be checked.
27074  *
27075  * If the schema isn't found, %NULL is returned.
27076  *
27077  * Returns: (transfer full): a new #GSettingsSchema
27078  * Since: 2.32
27079  */
27080
27081
27082 /**
27083  * g_settings_schema_source_new_from_directory:
27084  * @directory: the filename of a directory
27085  * @parent: (allow-none): a #GSettingsSchemaSource, or %NULL
27086  * @trusted: %TRUE, if the directory is trusted
27087  * @error: a pointer to a #GError pointer set to %NULL, or %NULL
27088  *
27089  * Attempts to create a new schema source corresponding to the contents
27090  * of the given directory.
27091  *
27092  * This function is not required for normal uses of #GSettings but it
27093  * may be useful to authors of plugin management systems.
27094  *
27095  * The directory should contain a file called
27096  * <filename>gschemas.compiled</filename> as produced by
27097  * <command>glib-compile-schemas</command>.
27098  *
27099  * If @trusted is %TRUE then <filename>gschemas.compiled</filename> is
27100  * trusted not to be corrupted.  This assumption has a performance
27101  * advantage, but can result in crashes or inconsistent behaviour in the
27102  * case of a corrupted file.  Generally, you should set @trusted to
27103  * %TRUE for files installed by the system and to %FALSE for files in
27104  * the home directory.
27105  *
27106  * If @parent is non-%NULL then there are two effects.
27107  *
27108  * First, if g_settings_schema_source_lookup() is called with the
27109  * @recursive flag set to %TRUE and the schema can not be found in the
27110  * source, the lookup will recurse to the parent.
27111  *
27112  * Second, any references to other schemas specified within this
27113  * source (ie: <literal>child</literal> or <literal>extends</literal>)
27114  * references may be resolved from the @parent.
27115  *
27116  * For this second reason, except in very unusual situations, the
27117  * @parent should probably be given as the default schema source, as
27118  * returned by g_settings_schema_source_get_default().
27119  *
27120  * Since: 2.32
27121  */
27122
27123
27124 /**
27125  * g_settings_schema_source_ref:
27126  * @source: a #GSettingsSchemaSource
27127  *
27128  * Increase the reference count of @source, returning a new reference.
27129  *
27130  * Returns: a new reference to @source
27131  * Since: 2.32
27132  */
27133
27134
27135 /**
27136  * g_settings_schema_source_unref:
27137  * @source: a #GSettingsSchemaSource
27138  *
27139  * Decrease the reference count of @source, possibly freeing it.
27140  *
27141  * Since: 2.32
27142  */
27143
27144
27145 /**
27146  * g_settings_schema_unref:
27147  * @schema: a #GSettingsSchema
27148  *
27149  * Decrease the reference count of @schema, possibly freeing it.
27150  *
27151  * Since: 2.32
27152  */
27153
27154
27155 /**
27156  * g_settings_set:
27157  * @settings: a #GSettings object
27158  * @key: the name of the key to set
27159  * @format: a #GVariant format string
27160  * @...: arguments as per @format
27161  *
27162  * Sets @key in @settings to @value.
27163  *
27164  * A convenience function that combines g_settings_set_value() with
27165  * g_variant_new().
27166  *
27167  * It is a programmer error to give a @key that isn't contained in the
27168  * schema for @settings or for the #GVariantType of @format to mismatch
27169  * the type given in the schema.
27170  *
27171  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27172  * Since: 2.26
27173  */
27174
27175
27176 /**
27177  * g_settings_set_boolean:
27178  * @settings: a #GSettings object
27179  * @key: the name of the key to set
27180  * @value: the value to set it to
27181  *
27182  * Sets @key in @settings to @value.
27183  *
27184  * A convenience variant of g_settings_set() for booleans.
27185  *
27186  * It is a programmer error to give a @key that isn't specified as
27187  * having a boolean type in the schema for @settings.
27188  *
27189  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27190  * Since: 2.26
27191  */
27192
27193
27194 /**
27195  * g_settings_set_double:
27196  * @settings: a #GSettings object
27197  * @key: the name of the key to set
27198  * @value: the value to set it to
27199  *
27200  * Sets @key in @settings to @value.
27201  *
27202  * A convenience variant of g_settings_set() for doubles.
27203  *
27204  * It is a programmer error to give a @key that isn't specified as
27205  * having a 'double' type in the schema for @settings.
27206  *
27207  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27208  * Since: 2.26
27209  */
27210
27211
27212 /**
27213  * g_settings_set_enum:
27214  * @settings: a #GSettings object
27215  * @key: a key, within @settings
27216  * @value: an enumerated value
27217  *
27218  * Looks up the enumerated type nick for @value and writes it to @key,
27219  * within @settings.
27220  *
27221  * It is a programmer error to give a @key that isn't contained in the
27222  * schema for @settings or is not marked as an enumerated type, or for
27223  * @value not to be a valid value for the named type.
27224  *
27225  * After performing the write, accessing @key directly with
27226  * g_settings_get_string() will return the 'nick' associated with
27227  * @value.
27228  *
27229  * Returns: %TRUE, if the set succeeds
27230  */
27231
27232
27233 /**
27234  * g_settings_set_flags:
27235  * @settings: a #GSettings object
27236  * @key: a key, within @settings
27237  * @value: a flags value
27238  *
27239  * Looks up the flags type nicks for the bits specified by @value, puts
27240  * them in an array of strings and writes the array to @key, within
27241  * @settings.
27242  *
27243  * It is a programmer error to give a @key that isn't contained in the
27244  * schema for @settings or is not marked as a flags type, or for @value
27245  * to contain any bits that are not value for the named type.
27246  *
27247  * After performing the write, accessing @key directly with
27248  * g_settings_get_strv() will return an array of 'nicks'; one for each
27249  * bit in @value.
27250  *
27251  * Returns: %TRUE, if the set succeeds
27252  */
27253
27254
27255 /**
27256  * g_settings_set_int:
27257  * @settings: a #GSettings object
27258  * @key: the name of the key to set
27259  * @value: the value to set it to
27260  *
27261  * Sets @key in @settings to @value.
27262  *
27263  * A convenience variant of g_settings_set() for 32-bit integers.
27264  *
27265  * It is a programmer error to give a @key that isn't specified as
27266  * having a int32 type in the schema for @settings.
27267  *
27268  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27269  * Since: 2.26
27270  */
27271
27272
27273 /**
27274  * g_settings_set_string:
27275  * @settings: a #GSettings object
27276  * @key: the name of the key to set
27277  * @value: the value to set it to
27278  *
27279  * Sets @key in @settings to @value.
27280  *
27281  * A convenience variant of g_settings_set() for strings.
27282  *
27283  * It is a programmer error to give a @key that isn't specified as
27284  * having a string type in the schema for @settings.
27285  *
27286  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27287  * Since: 2.26
27288  */
27289
27290
27291 /**
27292  * g_settings_set_strv:
27293  * @settings: a #GSettings object
27294  * @key: the name of the key to set
27295  * @value: (allow-none) (array zero-terminated=1): the value to set it to, or %NULL
27296  *
27297  * Sets @key in @settings to @value.
27298  *
27299  * A convenience variant of g_settings_set() for string arrays.  If
27300  * @value is %NULL, then @key is set to be the empty array.
27301  *
27302  * It is a programmer error to give a @key that isn't specified as
27303  * having an array of strings type in the schema for @settings.
27304  *
27305  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27306  * Since: 2.26
27307  */
27308
27309
27310 /**
27311  * g_settings_set_uint:
27312  * @settings: a #GSettings object
27313  * @key: the name of the key to set
27314  * @value: the value to set it to
27315  *
27316  * Sets @key in @settings to @value.
27317  *
27318  * A convenience variant of g_settings_set() for 32-bit unsigned
27319  * integers.
27320  *
27321  * It is a programmer error to give a @key that isn't specified as
27322  * having a uint32 type in the schema for @settings.
27323  *
27324  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27325  * Since: 2.30
27326  */
27327
27328
27329 /**
27330  * g_settings_set_value:
27331  * @settings: a #GSettings object
27332  * @key: the name of the key to set
27333  * @value: a #GVariant of the correct type
27334  *
27335  * Sets @key in @settings to @value.
27336  *
27337  * It is a programmer error to give a @key that isn't contained in the
27338  * schema for @settings or for @value to have the incorrect type, per
27339  * the schema.
27340  *
27341  * If @value is floating then this function consumes the reference.
27342  *
27343  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
27344  * Since: 2.26
27345  */
27346
27347
27348 /**
27349  * g_settings_sync:
27350  *
27351  * Ensures that all pending operations for the given are complete for
27352  * the default backend.
27353  *
27354  * Writes made to a #GSettings are handled asynchronously.  For this
27355  * reason, it is very unlikely that the changes have it to disk by the
27356  * time g_settings_set() returns.
27357  *
27358  * This call will block until all of the writes have made it to the
27359  * backend.  Since the mainloop is not running, no change notifications
27360  * will be dispatched during this call (but some may be queued by the
27361  * time the call is done).
27362  */
27363
27364
27365 /**
27366  * g_settings_unbind:
27367  * @object: the object
27368  * @property: the property whose binding is removed
27369  *
27370  * Removes an existing binding for @property on @object.
27371  *
27372  * Note that bindings are automatically removed when the
27373  * object is finalized, so it is rarely necessary to call this
27374  * function.
27375  *
27376  * Since: 2.26
27377  */
27378
27379
27380 /**
27381  * g_simple_action_group_add_entries:
27382  * @simple: a #GSimpleActionGroup
27383  * @entries: (array length=n_entries): a pointer to the first item in an array of #GActionEntry structs
27384  * @n_entries: the length of @entries, or -1
27385  * @user_data: the user data for signal connections
27386  *
27387  * A convenience function for creating multiple #GSimpleAction instances
27388  * and adding them to the action group.
27389  *
27390  * Since: 2.30
27391  */
27392
27393
27394 /**
27395  * g_simple_action_group_insert:
27396  * @simple: a #GSimpleActionGroup
27397  * @action: a #GAction
27398  *
27399  * Adds an action to the action group.
27400  *
27401  * If the action group already contains an action with the same name as
27402  * @action then the old action is dropped from the group.
27403  *
27404  * The action group takes its own reference on @action.
27405  *
27406  * Since: 2.28
27407  */
27408
27409
27410 /**
27411  * g_simple_action_group_lookup:
27412  * @simple: a #GSimpleActionGroup
27413  * @action_name: the name of an action
27414  *
27415  * Looks up the action with the name @action_name in the group.
27416  *
27417  * If no such action exists, returns %NULL.
27418  *
27419  * Returns: (transfer none): a #GAction, or %NULL
27420  * Since: 2.28
27421  */
27422
27423
27424 /**
27425  * g_simple_action_group_new:
27426  *
27427  * Creates a new, empty, #GSimpleActionGroup.
27428  *
27429  * Returns: a new #GSimpleActionGroup
27430  * Since: 2.28
27431  */
27432
27433
27434 /**
27435  * g_simple_action_group_remove:
27436  * @simple: a #GSimpleActionGroup
27437  * @action_name: the name of the action
27438  *
27439  * Removes the named action from the action group.
27440  *
27441  * If no action of this name is in the group then nothing happens.
27442  *
27443  * Since: 2.28
27444  */
27445
27446
27447 /**
27448  * g_simple_action_new:
27449  * @name: the name of the action
27450  * @parameter_type: (allow-none): the type of parameter to the activate function
27451  *
27452  * Creates a new action.
27453  *
27454  * The created action is stateless.  See g_simple_action_new_stateful().
27455  *
27456  * Returns: a new #GSimpleAction
27457  * Since: 2.28
27458  */
27459
27460
27461 /**
27462  * g_simple_action_new_stateful:
27463  * @name: the name of the action
27464  * @parameter_type: (allow-none): the type of the parameter to the activate function
27465  * @state: the initial state of the action
27466  *
27467  * Creates a new stateful action.
27468  *
27469  * @state is the initial state of the action.  All future state values
27470  * must have the same #GVariantType as the initial state.
27471  *
27472  * If the @state GVariant is floating, it is consumed.
27473  *
27474  * Returns: a new #GSimpleAction
27475  * Since: 2.28
27476  */
27477
27478
27479 /**
27480  * g_simple_action_set_enabled:
27481  * @simple: a #GSimpleAction
27482  * @enabled: whether the action is enabled
27483  *
27484  * Sets the action as enabled or not.
27485  *
27486  * An action must be enabled in order to be activated or in order to
27487  * have its state changed from outside callers.
27488  *
27489  * This should only be called by the implementor of the action.  Users
27490  * of the action should not attempt to modify its enabled flag.
27491  *
27492  * Since: 2.28
27493  */
27494
27495
27496 /**
27497  * g_simple_action_set_state:
27498  * @simple: a #GSimpleAction
27499  * @value: the new #GVariant for the state
27500  *
27501  * Sets the state of the action.
27502  *
27503  * This directly updates the 'state' property to the given value.
27504  *
27505  * This should only be called by the implementor of the action.  Users
27506  * of the action should not attempt to directly modify the 'state'
27507  * property.  Instead, they should call g_action_change_state() to
27508  * request the change.
27509  *
27510  * Since: 2.30
27511  */
27512
27513
27514 /**
27515  * g_simple_async_report_error_in_idle: (skip)
27516  * @object: (allow-none): a #GObject, or %NULL.
27517  * @callback: a #GAsyncReadyCallback.
27518  * @user_data: user data passed to @callback.
27519  * @domain: a #GQuark containing the error domain (usually #G_IO_ERROR).
27520  * @code: a specific error code.
27521  * @format: a formatted error reporting string.
27522  * @...: a list of variables to fill in @format.
27523  *
27524  * Reports an error in an asynchronous function in an idle function by
27525  * directly setting the contents of the #GAsyncResult with the given error
27526  * information.
27527  */
27528
27529
27530 /**
27531  * g_simple_async_report_gerror_in_idle:
27532  * @object: (allow-none): a #GObject, or %NULL
27533  * @callback: (scope async): a #GAsyncReadyCallback.
27534  * @user_data: (closure): user data passed to @callback.
27535  * @error: the #GError to report
27536  *
27537  * Reports an error in an idle function. Similar to
27538  * g_simple_async_report_error_in_idle(), but takes a #GError rather
27539  * than building a new one.
27540  */
27541
27542
27543 /**
27544  * g_simple_async_report_take_gerror_in_idle: (skip)
27545  * @object: (allow-none): a #GObject, or %NULL
27546  * @callback: a #GAsyncReadyCallback.
27547  * @user_data: user data passed to @callback.
27548  * @error: the #GError to report
27549  *
27550  * Reports an error in an idle function. Similar to
27551  * g_simple_async_report_gerror_in_idle(), but takes over the caller's
27552  * ownership of @error, so the caller does not have to free it any more.
27553  *
27554  * Since: 2.28
27555  */
27556
27557
27558 /**
27559  * g_simple_async_result_complete:
27560  * @simple: a #GSimpleAsyncResult.
27561  *
27562  * Completes an asynchronous I/O job immediately. Must be called in
27563  * the thread where the asynchronous result was to be delivered, as it
27564  * invokes the callback directly. If you are in a different thread use
27565  * g_simple_async_result_complete_in_idle().
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_complete_in_idle:
27574  * @simple: a #GSimpleAsyncResult.
27575  *
27576  * Completes an asynchronous function in an idle handler in the <link
27577  * linkend="g-main-context-push-thread-default">thread-default main
27578  * loop</link> of the thread that @simple was initially created in
27579  * (and re-pushes that context around the invocation of the callback).
27580  *
27581  * Calling this function takes a reference to @simple for as long as
27582  * is needed to complete the call.
27583  */
27584
27585
27586 /**
27587  * g_simple_async_result_get_op_res_gboolean:
27588  * @simple: a #GSimpleAsyncResult.
27589  *
27590  * Gets the operation result boolean from within the asynchronous result.
27591  *
27592  * Returns: %TRUE if the operation's result was %TRUE, %FALSE if the operation's result was %FALSE.
27593  */
27594
27595
27596 /**
27597  * g_simple_async_result_get_op_res_gpointer: (skip)
27598  * @simple: a #GSimpleAsyncResult.
27599  *
27600  * Gets a pointer result as returned by the asynchronous function.
27601  *
27602  * Returns: a pointer from the result.
27603  */
27604
27605
27606 /**
27607  * g_simple_async_result_get_op_res_gssize:
27608  * @simple: a #GSimpleAsyncResult.
27609  *
27610  * Gets a gssize from the asynchronous result.
27611  *
27612  * Returns: a gssize returned from the asynchronous function.
27613  */
27614
27615
27616 /**
27617  * g_simple_async_result_get_source_tag: (skip)
27618  * @simple: a #GSimpleAsyncResult.
27619  *
27620  * Gets the source tag for the #GSimpleAsyncResult.
27621  *
27622  * Returns: a #gpointer to the source object for the #GSimpleAsyncResult.
27623  */
27624
27625
27626 /**
27627  * g_simple_async_result_is_valid:
27628  * @result: the #GAsyncResult passed to the _finish function.
27629  * @source: the #GObject passed to the _finish function.
27630  * @source_tag: the asynchronous function.
27631  *
27632  * Ensures that the data passed to the _finish function of an async
27633  * operation is consistent.  Three checks are performed.
27634  *
27635  * First, @result is checked to ensure that it is really a
27636  * #GSimpleAsyncResult.  Second, @source is checked to ensure that it
27637  * matches the source object of @result.  Third, @source_tag is
27638  * checked to ensure that it is either %NULL (as it is when the result was
27639  * created by g_simple_async_report_error_in_idle() or
27640  * g_simple_async_report_gerror_in_idle()) or equal to the
27641  * @source_tag argument given to g_simple_async_result_new() (which, by
27642  * convention, is a pointer to the _async function corresponding to the
27643  * _finish function from which this function is called).
27644  *
27645  * Returns: #TRUE if all checks passed or #FALSE if any failed.
27646  * Since: 2.20
27647  */
27648
27649
27650 /**
27651  * g_simple_async_result_new:
27652  * @source_object: (allow-none): a #GObject, or %NULL.
27653  * @callback: (scope async): a #GAsyncReadyCallback.
27654  * @user_data: (closure): user data passed to @callback.
27655  * @source_tag: the asynchronous function.
27656  *
27657  * Creates a #GSimpleAsyncResult.
27658  *
27659  * The common convention is to create the #GSimpleAsyncResult in the
27660  * function that starts the asynchronous operation and use that same
27661  * function as the @source_tag.
27662  *
27663  * If your operation supports cancellation with #GCancellable (which it
27664  * probably should) then you should provide the user's cancellable to
27665  * g_simple_async_result_set_check_cancellable() immediately after
27666  * this function returns.
27667  *
27668  * Returns: a #GSimpleAsyncResult.
27669  */
27670
27671
27672 /**
27673  * g_simple_async_result_new_error:
27674  * @source_object: (allow-none): a #GObject, or %NULL.
27675  * @callback: (scope async): a #GAsyncReadyCallback.
27676  * @user_data: (closure): user data passed to @callback.
27677  * @domain: a #GQuark.
27678  * @code: an error code.
27679  * @format: a string with format characters.
27680  * @...: a list of values to insert into @format.
27681  *
27682  * Creates a new #GSimpleAsyncResult with a set error.
27683  *
27684  * Returns: a #GSimpleAsyncResult.
27685  */
27686
27687
27688 /**
27689  * g_simple_async_result_new_from_error:
27690  * @source_object: (allow-none): a #GObject, or %NULL.
27691  * @callback: (scope async): a #GAsyncReadyCallback.
27692  * @user_data: (closure): user data passed to @callback.
27693  * @error: a #GError
27694  *
27695  * Creates a #GSimpleAsyncResult from an error condition.
27696  *
27697  * Returns: a #GSimpleAsyncResult.
27698  */
27699
27700
27701 /**
27702  * g_simple_async_result_new_take_error: (skip)
27703  * @source_object: (allow-none): a #GObject, or %NULL
27704  * @callback: (scope async): a #GAsyncReadyCallback
27705  * @user_data: (closure): user data passed to @callback
27706  * @error: a #GError
27707  *
27708  * Creates a #GSimpleAsyncResult from an error condition, and takes over the
27709  * caller's ownership of @error, so the caller does not need to free it anymore.
27710  *
27711  * Returns: a #GSimpleAsyncResult
27712  * Since: 2.28
27713  */
27714
27715
27716 /**
27717  * g_simple_async_result_propagate_error:
27718  * @simple: a #GSimpleAsyncResult.
27719  * @dest: (out): a location to propagate the error to.
27720  *
27721  * Propagates an error from within the simple asynchronous result to
27722  * a given destination.
27723  *
27724  * If the #GCancellable given to a prior call to
27725  * g_simple_async_result_set_check_cancellable() is cancelled then this
27726  * function will return %TRUE with @dest set appropriately.
27727  *
27728  * Returns: %TRUE if the error was propagated to @dest. %FALSE otherwise.
27729  */
27730
27731
27732 /**
27733  * g_simple_async_result_run_in_thread: (skip)
27734  * @simple: a #GSimpleAsyncResult.
27735  * @func: a #GSimpleAsyncThreadFunc.
27736  * @io_priority: the io priority of the request.
27737  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27738  *
27739  * Runs the asynchronous job in a separate thread and then calls
27740  * g_simple_async_result_complete_in_idle() on @simple to return
27741  * the result to the appropriate main loop.
27742  *
27743  * Calling this function takes a reference to @simple for as long as
27744  * is needed to run the job and report its completion.
27745  */
27746
27747
27748 /**
27749  * g_simple_async_result_set_check_cancellable:
27750  * @simple: a #GSimpleAsyncResult
27751  * @check_cancellable: (allow-none): a #GCancellable to check, or %NULL to unset
27752  *
27753  * Sets a #GCancellable to check before dispatching results.
27754  *
27755  * This function has one very specific purpose: the provided cancellable
27756  * is checked at the time of g_simple_async_result_propagate_error() If
27757  * it is cancelled, these functions will return an "Operation was
27758  * cancelled" error (%G_IO_ERROR_CANCELLED).
27759  *
27760  * Implementors of cancellable asynchronous functions should use this in
27761  * order to provide a guarantee to their callers that cancelling an
27762  * async operation will reliably result in an error being returned for
27763  * that operation (even if a positive result for the operation has
27764  * already been sent as an idle to the main context to be dispatched).
27765  *
27766  * The checking described above is done regardless of any call to the
27767  * unrelated g_simple_async_result_set_handle_cancellation() function.
27768  *
27769  * Since: 2.32
27770  */
27771
27772
27773 /**
27774  * g_simple_async_result_set_error: (skip)
27775  * @simple: a #GSimpleAsyncResult.
27776  * @domain: a #GQuark (usually #G_IO_ERROR).
27777  * @code: an error code.
27778  * @format: a formatted error reporting string.
27779  * @...: a list of variables to fill in @format.
27780  *
27781  * Sets an error within the asynchronous result without a #GError.
27782  */
27783
27784
27785 /**
27786  * g_simple_async_result_set_error_va: (skip)
27787  * @simple: a #GSimpleAsyncResult.
27788  * @domain: a #GQuark (usually #G_IO_ERROR).
27789  * @code: an error code.
27790  * @format: a formatted error reporting string.
27791  * @args: va_list of arguments.
27792  *
27793  * Sets an error within the asynchronous result without a #GError.
27794  * Unless writing a binding, see g_simple_async_result_set_error().
27795  */
27796
27797
27798 /**
27799  * g_simple_async_result_set_from_error:
27800  * @simple: a #GSimpleAsyncResult.
27801  * @error: #GError.
27802  *
27803  * Sets the result from a #GError.
27804  */
27805
27806
27807 /**
27808  * g_simple_async_result_set_handle_cancellation:
27809  * @simple: a #GSimpleAsyncResult.
27810  * @handle_cancellation: a #gboolean.
27811  *
27812  * Sets whether to handle cancellation within the asynchronous operation.
27813  *
27814  * This function has nothing to do with
27815  * g_simple_async_result_set_check_cancellable().  It only refers to the
27816  * #GCancellable passed to g_simple_async_result_run_in_thread().
27817  */
27818
27819
27820 /**
27821  * g_simple_async_result_set_op_res_gboolean:
27822  * @simple: a #GSimpleAsyncResult.
27823  * @op_res: a #gboolean.
27824  *
27825  * Sets the operation result to a boolean within the asynchronous result.
27826  */
27827
27828
27829 /**
27830  * g_simple_async_result_set_op_res_gpointer: (skip)
27831  * @simple: a #GSimpleAsyncResult.
27832  * @op_res: a pointer result from an asynchronous function.
27833  * @destroy_op_res: a #GDestroyNotify function.
27834  *
27835  * Sets the operation result within the asynchronous result to a pointer.
27836  */
27837
27838
27839 /**
27840  * g_simple_async_result_set_op_res_gssize:
27841  * @simple: a #GSimpleAsyncResult.
27842  * @op_res: a #gssize.
27843  *
27844  * Sets the operation result within the asynchronous result to
27845  * the given @op_res.
27846  */
27847
27848
27849 /**
27850  * g_simple_async_result_take_error: (skip)
27851  * @simple: a #GSimpleAsyncResult
27852  * @error: a #GError
27853  *
27854  * Sets the result from @error, and takes over the caller's ownership
27855  * of @error, so the caller does not need to free it any more.
27856  *
27857  * Since: 2.28
27858  */
27859
27860
27861 /**
27862  * g_simple_permission_new:
27863  * @allowed: %TRUE if the action is allowed
27864  *
27865  * Creates a new #GPermission instance that represents an action that is
27866  * either always or never allowed.
27867  *
27868  * Returns: the #GSimplePermission, as a #GPermission
27869  * Since: 2.26
27870  */
27871
27872
27873 /**
27874  * g_socket_accept:
27875  * @socket: a #GSocket.
27876  * @cancellable: (allow-none): a %GCancellable or %NULL
27877  * @error: #GError for error reporting, or %NULL to ignore.
27878  *
27879  * Accept incoming connections on a connection-based socket. This removes
27880  * the first outstanding connection request from the listening socket and
27881  * creates a #GSocket object for it.
27882  *
27883  * The @socket must be bound to a local address with g_socket_bind() and
27884  * must be listening for incoming connections (g_socket_listen()).
27885  *
27886  * If there are no outstanding connections then the operation will block
27887  * or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
27888  * To be notified of an incoming connection, wait for the %G_IO_IN condition.
27889  *
27890  * Returns: (transfer full): a new #GSocket, or %NULL on error. Free the returned object with g_object_unref().
27891  * Since: 2.22
27892  */
27893
27894
27895 /**
27896  * g_socket_address_enumerator_next:
27897  * @enumerator: a #GSocketAddressEnumerator
27898  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27899  * @error: a #GError.
27900  *
27901  * Retrieves the next #GSocketAddress from @enumerator. Note that this
27902  * may block for some amount of time. (Eg, a #GNetworkAddress may need
27903  * to do a DNS lookup before it can return an address.) Use
27904  * g_socket_address_enumerator_next_async() if you need to avoid
27905  * blocking.
27906  *
27907  * If @enumerator is expected to yield addresses, but for some reason
27908  * is unable to (eg, because of a DNS error), then the first call to
27909  * g_socket_address_enumerator_next() will return an appropriate error
27910  * in *@error. However, if the first call to
27911  * g_socket_address_enumerator_next() succeeds, then any further
27912  * internal errors (other than @cancellable being triggered) will be
27913  * ignored.
27914  *
27915  * 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.
27916  */
27917
27918
27919 /**
27920  * g_socket_address_enumerator_next_async:
27921  * @enumerator: a #GSocketAddressEnumerator
27922  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27923  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
27924  * @user_data: (closure): the data to pass to callback function
27925  *
27926  * Asynchronously retrieves the next #GSocketAddress from @enumerator
27927  * and then calls @callback, which must call
27928  * g_socket_address_enumerator_next_finish() to get the result.
27929  */
27930
27931
27932 /**
27933  * g_socket_address_enumerator_next_finish:
27934  * @enumerator: a #GSocketAddressEnumerator
27935  * @result: a #GAsyncResult
27936  * @error: a #GError
27937  *
27938  * Retrieves the result of a completed call to
27939  * g_socket_address_enumerator_next_async(). See
27940  * g_socket_address_enumerator_next() for more information about
27941  * error handling.
27942  *
27943  * 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.
27944  */
27945
27946
27947 /**
27948  * g_socket_address_get_family:
27949  * @address: a #GSocketAddress
27950  *
27951  * Gets the socket family type of @address.
27952  *
27953  * Returns: the socket family type of @address.
27954  * Since: 2.22
27955  */
27956
27957
27958 /**
27959  * g_socket_address_get_native_size:
27960  * @address: a #GSocketAddress
27961  *
27962  * Gets the size of @address's native <type>struct sockaddr</type>.
27963  * You can use this to allocate memory to pass to
27964  * g_socket_address_to_native().
27965  *
27966  * Returns: the size of the native <type>struct sockaddr</type> that @address represents
27967  * Since: 2.22
27968  */
27969
27970
27971 /**
27972  * g_socket_address_new_from_native:
27973  * @native: a pointer to a <type>struct sockaddr</type>
27974  * @len: the size of the memory location pointed to by @native
27975  *
27976  * Creates a #GSocketAddress subclass corresponding to the native
27977  * <type>struct sockaddr</type> @native.
27978  *
27979  * Returns: a new #GSocketAddress if @native could successfully be converted, otherwise %NULL.
27980  * Since: 2.22
27981  */
27982
27983
27984 /**
27985  * g_socket_address_to_native:
27986  * @address: a #GSocketAddress
27987  * @dest: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
27988  * @destlen: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
27989  * @error: #GError for error reporting, or %NULL to ignore.
27990  *
27991  * Converts a #GSocketAddress to a native <type>struct
27992  * sockaddr</type>, which can be passed to low-level functions like
27993  * connect() or bind().
27994  *
27995  * If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
27996  * returned. If the address type is not known on the system
27997  * then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
27998  *
27999  * Returns: %TRUE if @dest was filled in, %FALSE on error
28000  * Since: 2.22
28001  */
28002
28003
28004 /**
28005  * g_socket_bind:
28006  * @socket: a #GSocket.
28007  * @address: a #GSocketAddress specifying the local address.
28008  * @allow_reuse: whether to allow reusing this address
28009  * @error: #GError for error reporting, or %NULL to ignore.
28010  *
28011  * When a socket is created it is attached to an address family, but it
28012  * doesn't have an address in this family. g_socket_bind() assigns the
28013  * address (sometimes called name) of the socket.
28014  *
28015  * It is generally required to bind to a local address before you can
28016  * receive connections. (See g_socket_listen() and g_socket_accept() ).
28017  * In certain situations, you may also want to bind a socket that will be
28018  * used to initiate connections, though this is not normally required.
28019  *
28020  * @allow_reuse should be %TRUE for server sockets (sockets that you will
28021  * eventually call g_socket_accept() on), and %FALSE for client sockets.
28022  * (Specifically, if it is %TRUE, then g_socket_bind() will set the
28023  * %SO_REUSEADDR flag on the socket, allowing it to bind @address even if
28024  * that address was previously used by another socket that has not yet been
28025  * fully cleaned-up by the kernel. Failing to set this flag on a server
28026  * socket may cause the bind call to return %G_IO_ERROR_ADDRESS_IN_USE if
28027  * the server program is stopped and then immediately restarted.)
28028  *
28029  * Returns: %TRUE on success, %FALSE on error.
28030  * Since: 2.22
28031  */
28032
28033
28034 /**
28035  * g_socket_check_connect_result:
28036  * @socket: a #GSocket
28037  * @error: #GError for error reporting, or %NULL to ignore.
28038  *
28039  * Checks and resets the pending connect error for the socket.
28040  * This is used to check for errors when g_socket_connect() is
28041  * used in non-blocking mode.
28042  *
28043  * Returns: %TRUE if no error, %FALSE otherwise, setting @error to the error
28044  * Since: 2.22
28045  */
28046
28047
28048 /**
28049  * g_socket_client_add_application_proxy:
28050  * @client: a #GSocketClient
28051  * @protocol: The proxy protocol
28052  *
28053  * Enable proxy protocols to be handled by the application. When the
28054  * indicated proxy protocol is returned by the #GProxyResolver,
28055  * #GSocketClient will consider this protocol as supported but will
28056  * not try to find a #GProxy instance to handle handshaking. The
28057  * application must check for this case by calling
28058  * g_socket_connection_get_remote_address() on the returned
28059  * #GSocketConnection, and seeing if it's a #GProxyAddress of the
28060  * appropriate type, to determine whether or not it needs to handle
28061  * the proxy handshaking itself.
28062  *
28063  * This should be used for proxy protocols that are dialects of
28064  * another protocol such as HTTP proxy. It also allows cohabitation of
28065  * proxy protocols that are reused between protocols. A good example
28066  * is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
28067  * be use as generic socket proxy through the HTTP CONNECT method.
28068  *
28069  * When the proxy is detected as being an application proxy, TLS handshake
28070  * will be skipped. This is required to let the application do the proxy
28071  * specific handshake.
28072  */
28073
28074
28075 /**
28076  * g_socket_client_connect:
28077  * @client: a #GSocketClient.
28078  * @connectable: a #GSocketConnectable specifying the remote address.
28079  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28080  * @error: #GError for error reporting, or %NULL to ignore.
28081  *
28082  * Tries to resolve the @connectable and make a network connection to it.
28083  *
28084  * Upon a successful connection, a new #GSocketConnection is constructed
28085  * and returned.  The caller owns this new object and must drop their
28086  * reference to it when finished with it.
28087  *
28088  * The type of the #GSocketConnection object returned depends on the type of
28089  * the underlying socket that is used. For instance, for a TCP/IP connection
28090  * it will be a #GTcpConnection.
28091  *
28092  * The socket created will be the same family as the address that the
28093  * @connectable resolves to, unless family is set with g_socket_client_set_family()
28094  * or indirectly via g_socket_client_set_local_address(). The socket type
28095  * defaults to %G_SOCKET_TYPE_STREAM but can be set with
28096  * g_socket_client_set_socket_type().
28097  *
28098  * If a local address is specified with g_socket_client_set_local_address() the
28099  * socket will be bound to this address before connecting.
28100  *
28101  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28102  * Since: 2.22
28103  */
28104
28105
28106 /**
28107  * g_socket_client_connect_async:
28108  * @client: a #GSocketClient
28109  * @connectable: a #GSocketConnectable specifying the remote address.
28110  * @cancellable: (allow-none): a #GCancellable, or %NULL
28111  * @callback: (scope async): a #GAsyncReadyCallback
28112  * @user_data: (closure): user data for the callback
28113  *
28114  * This is the asynchronous version of g_socket_client_connect().
28115  *
28116  * When the operation is finished @callback will be
28117  * called. You can then call g_socket_client_connect_finish() to get
28118  * the result of the operation.
28119  *
28120  * Since: 2.22
28121  */
28122
28123
28124 /**
28125  * g_socket_client_connect_finish:
28126  * @client: a #GSocketClient.
28127  * @result: a #GAsyncResult.
28128  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28129  *
28130  * Finishes an async connect operation. See g_socket_client_connect_async()
28131  *
28132  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28133  * Since: 2.22
28134  */
28135
28136
28137 /**
28138  * g_socket_client_connect_to_host:
28139  * @client: a #GSocketClient
28140  * @host_and_port: the name and optionally port of the host to connect to
28141  * @default_port: the default port to connect to
28142  * @cancellable: (allow-none): a #GCancellable, or %NULL
28143  * @error: a pointer to a #GError, or %NULL
28144  *
28145  * This is a helper function for g_socket_client_connect().
28146  *
28147  * Attempts to create a TCP connection to the named host.
28148  *
28149  * @host_and_port may be in any of a number of recognized formats; an IPv6
28150  * address, an IPv4 address, or a domain name (in which case a DNS
28151  * lookup is performed).  Quoting with [] is supported for all address
28152  * types.  A port override may be specified in the usual way with a
28153  * colon.  Ports may be given as decimal numbers or symbolic names (in
28154  * which case an /etc/services lookup is performed).
28155  *
28156  * If no port override is given in @host_and_port then @default_port will be
28157  * used as the port number to connect to.
28158  *
28159  * In general, @host_and_port is expected to be provided by the user (allowing
28160  * them to give the hostname, and a port override if necessary) and
28161  * @default_port is expected to be provided by the application.
28162  *
28163  * In the case that an IP address is given, a single connection
28164  * attempt is made.  In the case that a name is given, multiple
28165  * connection attempts may be made, in turn and according to the
28166  * number of address records in DNS, until a connection succeeds.
28167  *
28168  * Upon a successful connection, a new #GSocketConnection is constructed
28169  * and returned.  The caller owns this new object and must drop their
28170  * reference to it when finished with it.
28171  *
28172  * In the event of any failure (DNS error, service not found, no hosts
28173  * connectable) %NULL is returned and @error (if non-%NULL) is set
28174  * accordingly.
28175  *
28176  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28177  * Since: 2.22
28178  */
28179
28180
28181 /**
28182  * g_socket_client_connect_to_host_async:
28183  * @client: a #GSocketClient
28184  * @host_and_port: the name and optionally the port of the host to connect to
28185  * @default_port: the default port to connect to
28186  * @cancellable: (allow-none): a #GCancellable, or %NULL
28187  * @callback: (scope async): a #GAsyncReadyCallback
28188  * @user_data: (closure): user data for the callback
28189  *
28190  * This is the asynchronous version of g_socket_client_connect_to_host().
28191  *
28192  * When the operation is finished @callback will be
28193  * called. You can then call g_socket_client_connect_to_host_finish() to get
28194  * the result of the operation.
28195  *
28196  * Since: 2.22
28197  */
28198
28199
28200 /**
28201  * g_socket_client_connect_to_host_finish:
28202  * @client: a #GSocketClient.
28203  * @result: a #GAsyncResult.
28204  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28205  *
28206  * Finishes an async connect operation. See g_socket_client_connect_to_host_async()
28207  *
28208  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28209  * Since: 2.22
28210  */
28211
28212
28213 /**
28214  * g_socket_client_connect_to_service:
28215  * @client: a #GSocketConnection
28216  * @domain: a domain name
28217  * @service: the name of the service to connect to
28218  * @cancellable: (allow-none): a #GCancellable, or %NULL
28219  * @error: a pointer to a #GError, or %NULL
28220  *
28221  * Attempts to create a TCP connection to a service.
28222  *
28223  * This call looks up the SRV record for @service at @domain for the
28224  * "tcp" protocol.  It then attempts to connect, in turn, to each of
28225  * the hosts providing the service until either a connection succeeds
28226  * or there are no hosts remaining.
28227  *
28228  * Upon a successful connection, a new #GSocketConnection is constructed
28229  * and returned.  The caller owns this new object and must drop their
28230  * reference to it when finished with it.
28231  *
28232  * In the event of any failure (DNS error, service not found, no hosts
28233  * connectable) %NULL is returned and @error (if non-%NULL) is set
28234  * accordingly.
28235  *
28236  * Returns: (transfer full): a #GSocketConnection if successful, or %NULL on error
28237  */
28238
28239
28240 /**
28241  * g_socket_client_connect_to_service_async:
28242  * @client: a #GSocketClient
28243  * @domain: a domain name
28244  * @service: the name of the service to connect to
28245  * @cancellable: (allow-none): a #GCancellable, or %NULL
28246  * @callback: (scope async): a #GAsyncReadyCallback
28247  * @user_data: (closure): user data for the callback
28248  *
28249  * This is the asynchronous version of
28250  * g_socket_client_connect_to_service().
28251  *
28252  * Since: 2.22
28253  */
28254
28255
28256 /**
28257  * g_socket_client_connect_to_service_finish:
28258  * @client: a #GSocketClient.
28259  * @result: a #GAsyncResult.
28260  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28261  *
28262  * Finishes an async connect operation. See g_socket_client_connect_to_service_async()
28263  *
28264  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28265  * Since: 2.22
28266  */
28267
28268
28269 /**
28270  * g_socket_client_connect_to_uri:
28271  * @client: a #GSocketClient
28272  * @uri: A network URI
28273  * @default_port: the default port to connect to
28274  * @cancellable: (allow-none): a #GCancellable, or %NULL
28275  * @error: a pointer to a #GError, or %NULL
28276  *
28277  * This is a helper function for g_socket_client_connect().
28278  *
28279  * Attempts to create a TCP connection with a network URI.
28280  *
28281  * @uri may be any valid URI containing an "authority" (hostname/port)
28282  * component. If a port is not specified in the URI, @default_port
28283  * will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
28284  * (#GSocketClient does not know to automatically assume TLS for
28285  * certain URI schemes.)
28286  *
28287  * Using this rather than g_socket_client_connect() or
28288  * g_socket_client_connect_to_host() allows #GSocketClient to
28289  * determine when to use application-specific proxy protocols.
28290  *
28291  * Upon a successful connection, a new #GSocketConnection is constructed
28292  * and returned.  The caller owns this new object and must drop their
28293  * reference to it when finished with it.
28294  *
28295  * In the event of any failure (DNS error, service not found, no hosts
28296  * connectable) %NULL is returned and @error (if non-%NULL) is set
28297  * accordingly.
28298  *
28299  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28300  * Since: 2.26
28301  */
28302
28303
28304 /**
28305  * g_socket_client_connect_to_uri_async:
28306  * @client: a #GSocketClient
28307  * @uri: a network uri
28308  * @default_port: the default port to connect to
28309  * @cancellable: (allow-none): a #GCancellable, or %NULL
28310  * @callback: (scope async): a #GAsyncReadyCallback
28311  * @user_data: (closure): user data for the callback
28312  *
28313  * This is the asynchronous version of g_socket_client_connect_to_uri().
28314  *
28315  * When the operation is finished @callback will be
28316  * called. You can then call g_socket_client_connect_to_uri_finish() to get
28317  * the result of the operation.
28318  *
28319  * Since: 2.26
28320  */
28321
28322
28323 /**
28324  * g_socket_client_connect_to_uri_finish:
28325  * @client: a #GSocketClient.
28326  * @result: a #GAsyncResult.
28327  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28328  *
28329  * Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
28330  *
28331  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28332  * Since: 2.26
28333  */
28334
28335
28336 /**
28337  * g_socket_client_get_enable_proxy:
28338  * @client: a #GSocketClient.
28339  *
28340  * Gets the proxy enable state; see g_socket_client_set_enable_proxy()
28341  *
28342  * Returns: whether proxying is enabled
28343  * Since: 2.26
28344  */
28345
28346
28347 /**
28348  * g_socket_client_get_family:
28349  * @client: a #GSocketClient.
28350  *
28351  * Gets the socket family of the socket client.
28352  *
28353  * See g_socket_client_set_family() for details.
28354  *
28355  * Returns: a #GSocketFamily
28356  * Since: 2.22
28357  */
28358
28359
28360 /**
28361  * g_socket_client_get_local_address:
28362  * @client: a #GSocketClient.
28363  *
28364  * Gets the local address of the socket client.
28365  *
28366  * See g_socket_client_set_local_address() for details.
28367  *
28368  * Returns: (transfer none): a #GSocketAddress or %NULL. Do not free.
28369  * Since: 2.22
28370  */
28371
28372
28373 /**
28374  * g_socket_client_get_protocol:
28375  * @client: a #GSocketClient
28376  *
28377  * Gets the protocol name type of the socket client.
28378  *
28379  * See g_socket_client_set_protocol() for details.
28380  *
28381  * Returns: a #GSocketProtocol
28382  * Since: 2.22
28383  */
28384
28385
28386 /**
28387  * g_socket_client_get_socket_type:
28388  * @client: a #GSocketClient.
28389  *
28390  * Gets the socket type of the socket client.
28391  *
28392  * See g_socket_client_set_socket_type() for details.
28393  *
28394  * Returns: a #GSocketFamily
28395  * Since: 2.22
28396  */
28397
28398
28399 /**
28400  * g_socket_client_get_timeout:
28401  * @client: a #GSocketClient
28402  *
28403  * Gets the I/O timeout time for sockets created by @client.
28404  *
28405  * See g_socket_client_set_timeout() for details.
28406  *
28407  * Returns: the timeout in seconds
28408  * Since: 2.26
28409  */
28410
28411
28412 /**
28413  * g_socket_client_get_tls:
28414  * @client: a #GSocketClient.
28415  *
28416  * Gets whether @client creates TLS connections. See
28417  * g_socket_client_set_tls() for details.
28418  *
28419  * Returns: whether @client uses TLS
28420  * Since: 2.28
28421  */
28422
28423
28424 /**
28425  * g_socket_client_get_tls_validation_flags:
28426  * @client: a #GSocketClient.
28427  *
28428  * Gets the TLS validation flags used creating TLS connections via
28429  * @client.
28430  *
28431  * Returns: the TLS validation flags
28432  * Since: 2.28
28433  */
28434
28435
28436 /**
28437  * g_socket_client_new:
28438  *
28439  * Creates a new #GSocketClient with the default options.
28440  *
28441  * Returns: a #GSocketClient. Free the returned object with g_object_unref().
28442  * Since: 2.22
28443  */
28444
28445
28446 /**
28447  * g_socket_client_set_enable_proxy:
28448  * @client: a #GSocketClient.
28449  * @enable: whether to enable proxies
28450  *
28451  * Sets whether or not @client attempts to make connections via a
28452  * proxy server. When enabled (the default), #GSocketClient will use a
28453  * #GProxyResolver to determine if a proxy protocol such as SOCKS is
28454  * needed, and automatically do the necessary proxy negotiation.
28455  *
28456  * Since: 2.26
28457  */
28458
28459
28460 /**
28461  * g_socket_client_set_family:
28462  * @client: a #GSocketClient.
28463  * @family: a #GSocketFamily
28464  *
28465  * Sets the socket family of the socket client.
28466  * If this is set to something other than %G_SOCKET_FAMILY_INVALID
28467  * then the sockets created by this object will be of the specified
28468  * family.
28469  *
28470  * This might be useful for instance if you want to force the local
28471  * connection to be an ipv4 socket, even though the address might
28472  * be an ipv6 mapped to ipv4 address.
28473  *
28474  * Since: 2.22
28475  */
28476
28477
28478 /**
28479  * g_socket_client_set_local_address:
28480  * @client: a #GSocketClient.
28481  * @address: (allow-none): a #GSocketAddress, or %NULL
28482  *
28483  * Sets the local address of the socket client.
28484  * The sockets created by this object will bound to the
28485  * specified address (if not %NULL) before connecting.
28486  *
28487  * This is useful if you want to ensure that the local
28488  * side of the connection is on a specific port, or on
28489  * a specific interface.
28490  *
28491  * Since: 2.22
28492  */
28493
28494
28495 /**
28496  * g_socket_client_set_protocol:
28497  * @client: a #GSocketClient.
28498  * @protocol: a #GSocketProtocol
28499  *
28500  * Sets the protocol of the socket client.
28501  * The sockets created by this object will use of the specified
28502  * protocol.
28503  *
28504  * If @protocol is %0 that means to use the default
28505  * protocol for the socket family and type.
28506  *
28507  * Since: 2.22
28508  */
28509
28510
28511 /**
28512  * g_socket_client_set_socket_type:
28513  * @client: a #GSocketClient.
28514  * @type: a #GSocketType
28515  *
28516  * Sets the socket type of the socket client.
28517  * The sockets created by this object will be of the specified
28518  * type.
28519  *
28520  * It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
28521  * as GSocketClient is used for connection oriented services.
28522  *
28523  * Since: 2.22
28524  */
28525
28526
28527 /**
28528  * g_socket_client_set_timeout:
28529  * @client: a #GSocketClient.
28530  * @timeout: the timeout
28531  *
28532  * Sets the I/O timeout for sockets created by @client. @timeout is a
28533  * time in seconds, or 0 for no timeout (the default).
28534  *
28535  * The timeout value affects the initial connection attempt as well,
28536  * so setting this may cause calls to g_socket_client_connect(), etc,
28537  * to fail with %G_IO_ERROR_TIMED_OUT.
28538  *
28539  * Since: 2.26
28540  */
28541
28542
28543 /**
28544  * g_socket_client_set_tls:
28545  * @client: a #GSocketClient.
28546  * @tls: whether to use TLS
28547  *
28548  * Sets whether @client creates TLS (aka SSL) connections. If @tls is
28549  * %TRUE, @client will wrap its connections in a #GTlsClientConnection
28550  * and perform a TLS handshake when connecting.
28551  *
28552  * Note that since #GSocketClient must return a #GSocketConnection,
28553  * but #GTlsClientConnection is not a #GSocketConnection, this
28554  * actually wraps the resulting #GTlsClientConnection in a
28555  * #GTcpWrapperConnection when returning it. You can use
28556  * g_tcp_wrapper_connection_get_base_io_stream() on the return value
28557  * to extract the #GTlsClientConnection.
28558  *
28559  * If you need to modify the behavior of the TLS handshake (eg, by
28560  * setting a client-side certificate to use, or connecting to the
28561  * #GTlsConnection::accept-certificate signal), you can connect to
28562  * @client's #GSocketClient::event signal and wait for it to be
28563  * emitted with %G_SOCKET_CLIENT_TLS_HANDSHAKING, which will give you
28564  * a chance to see the #GTlsClientConnection before the handshake
28565  * starts.
28566  *
28567  * Since: 2.28
28568  */
28569
28570
28571 /**
28572  * g_socket_client_set_tls_validation_flags:
28573  * @client: a #GSocketClient.
28574  * @flags: the validation flags
28575  *
28576  * Sets the TLS validation flags used when creating TLS connections
28577  * via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
28578  *
28579  * Since: 2.28
28580  */
28581
28582
28583 /**
28584  * g_socket_close:
28585  * @socket: a #GSocket
28586  * @error: #GError for error reporting, or %NULL to ignore.
28587  *
28588  * Closes the socket, shutting down any active connection.
28589  *
28590  * Closing a socket does not wait for all outstanding I/O operations
28591  * to finish, so the caller should not rely on them to be guaranteed
28592  * to complete even if the close returns with no error.
28593  *
28594  * Once the socket is closed, all other operations will return
28595  * %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
28596  * return an error.
28597  *
28598  * Sockets will be automatically closed when the last reference
28599  * is dropped, but you might want to call this function to make sure
28600  * resources are released as early as possible.
28601  *
28602  * Beware that due to the way that TCP works, it is possible for
28603  * recently-sent data to be lost if either you close a socket while the
28604  * %G_IO_IN condition is set, or else if the remote connection tries to
28605  * send something to you after you close the socket but before it has
28606  * finished reading all of the data you sent. There is no easy generic
28607  * way to avoid this problem; the easiest fix is to design the network
28608  * protocol such that the client will never send data "out of turn".
28609  * Another solution is for the server to half-close the connection by
28610  * calling g_socket_shutdown() with only the @shutdown_write flag set,
28611  * and then wait for the client to notice this and close its side of the
28612  * connection, after which the server can safely call g_socket_close().
28613  * (This is what #GTcpConnection does if you call
28614  * g_tcp_connection_set_graceful_disconnect(). But of course, this
28615  * only works if the client will close its connection after the server
28616  * does.)
28617  *
28618  * Returns: %TRUE on success, %FALSE on error
28619  * Since: 2.22
28620  */
28621
28622
28623 /**
28624  * g_socket_condition_check:
28625  * @socket: a #GSocket
28626  * @condition: a #GIOCondition mask to check
28627  *
28628  * Checks on the readiness of @socket to perform operations.
28629  * The operations specified in @condition are checked for and masked
28630  * against the currently-satisfied conditions on @socket. The result
28631  * is returned.
28632  *
28633  * Note that on Windows, it is possible for an operation to return
28634  * %G_IO_ERROR_WOULD_BLOCK even immediately after
28635  * g_socket_condition_check() has claimed that the socket is ready for
28636  * writing. Rather than calling g_socket_condition_check() and then
28637  * writing to the socket if it succeeds, it is generally better to
28638  * simply try writing to the socket right away, and try again later if
28639  * the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
28640  *
28641  * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
28642  * these conditions will always be set in the output if they are true.
28643  *
28644  * This call never blocks.
28645  *
28646  * Returns: the @GIOCondition mask of the current state
28647  * Since: 2.22
28648  */
28649
28650
28651 /**
28652  * g_socket_condition_timed_wait:
28653  * @socket: a #GSocket
28654  * @condition: a #GIOCondition mask to wait for
28655  * @timeout: the maximum time (in microseconds) to wait, or -1
28656  * @cancellable: (allow-none): a #GCancellable, or %NULL
28657  * @error: a #GError pointer, or %NULL
28658  *
28659  * Waits for up to @timeout microseconds for @condition to become true
28660  * on @socket. If the condition is met, %TRUE is returned.
28661  *
28662  * If @cancellable is cancelled before the condition is met, or if
28663  * @timeout (or the socket's #GSocket:timeout) is reached before the
28664  * condition is met, then %FALSE is returned and @error, if non-%NULL,
28665  * is set to the appropriate value (%G_IO_ERROR_CANCELLED or
28666  * %G_IO_ERROR_TIMED_OUT).
28667  *
28668  * If you don't want a timeout, use g_socket_condition_wait().
28669  * (Alternatively, you can pass -1 for @timeout.)
28670  *
28671  * Note that although @timeout is in microseconds for consistency with
28672  * other GLib APIs, this function actually only has millisecond
28673  * resolution, and the behavior is undefined if @timeout is not an
28674  * exact number of milliseconds.
28675  *
28676  * Returns: %TRUE if the condition was met, %FALSE otherwise
28677  * Since: 2.32
28678  */
28679
28680
28681 /**
28682  * g_socket_condition_wait:
28683  * @socket: a #GSocket
28684  * @condition: a #GIOCondition mask to wait for
28685  * @cancellable: (allow-none): a #GCancellable, or %NULL
28686  * @error: a #GError pointer, or %NULL
28687  *
28688  * Waits for @condition to become true on @socket. When the condition
28689  * is met, %TRUE is returned.
28690  *
28691  * If @cancellable is cancelled before the condition is met, or if the
28692  * socket has a timeout set and it is reached before the condition is
28693  * met, then %FALSE is returned and @error, if non-%NULL, is set to
28694  * the appropriate value (%G_IO_ERROR_CANCELLED or
28695  * %G_IO_ERROR_TIMED_OUT).
28696  *
28697  * See also g_socket_condition_timed_wait().
28698  *
28699  * Returns: %TRUE if the condition was met, %FALSE otherwise
28700  * Since: 2.22
28701  */
28702
28703
28704 /**
28705  * g_socket_connect:
28706  * @socket: a #GSocket.
28707  * @address: a #GSocketAddress specifying the remote address.
28708  * @cancellable: (allow-none): a %GCancellable or %NULL
28709  * @error: #GError for error reporting, or %NULL to ignore.
28710  *
28711  * Connect the socket to the specified remote address.
28712  *
28713  * For connection oriented socket this generally means we attempt to make
28714  * a connection to the @address. For a connection-less socket it sets
28715  * the default address for g_socket_send() and discards all incoming datagrams
28716  * from other sources.
28717  *
28718  * Generally connection oriented sockets can only connect once, but
28719  * connection-less sockets can connect multiple times to change the
28720  * default address.
28721  *
28722  * If the connect call needs to do network I/O it will block, unless
28723  * non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
28724  * and the user can be notified of the connection finishing by waiting
28725  * for the G_IO_OUT condition. The result of the connection must then be
28726  * checked with g_socket_check_connect_result().
28727  *
28728  * Returns: %TRUE if connected, %FALSE on error.
28729  * Since: 2.22
28730  */
28731
28732
28733 /**
28734  * g_socket_connectable_enumerate:
28735  * @connectable: a #GSocketConnectable
28736  *
28737  * Creates a #GSocketAddressEnumerator for @connectable.
28738  *
28739  * Returns: (transfer full): a new #GSocketAddressEnumerator.
28740  * Since: 2.22
28741  */
28742
28743
28744 /**
28745  * g_socket_connectable_proxy_enumerate:
28746  * @connectable: a #GSocketConnectable
28747  *
28748  * Creates a #GSocketAddressEnumerator for @connectable that will
28749  * return #GProxyAddress<!-- -->es for addresses that you must connect
28750  * to via a proxy.
28751  *
28752  * If @connectable does not implement
28753  * g_socket_connectable_proxy_enumerate(), this will fall back to
28754  * calling g_socket_connectable_enumerate().
28755  *
28756  * Returns: (transfer full): a new #GSocketAddressEnumerator.
28757  * Since: 2.26
28758  */
28759
28760
28761 /**
28762  * g_socket_connection_connect:
28763  * @connection: a #GSocketConnection
28764  * @address: a #GSocketAddress specifying the remote address.
28765  * @cancellable: (allow-none): a %GCancellable or %NULL
28766  * @error: #GError for error reporting, or %NULL to ignore.
28767  *
28768  * Connect @connection to the specified remote address.
28769  *
28770  * Returns: %TRUE if the connection succeeded, %FALSE on error
28771  * Since: 2.32
28772  */
28773
28774
28775 /**
28776  * g_socket_connection_connect_async:
28777  * @connection: a #GSocketConnection
28778  * @address: a #GSocketAddress specifying the remote address.
28779  * @cancellable: (allow-none): a %GCancellable or %NULL
28780  * @callback: (scope async): a #GAsyncReadyCallback
28781  * @user_data: (closure): user data for the callback
28782  *
28783  * Asynchronously connect @connection to the specified remote address.
28784  *
28785  * This clears the #GSocket:blocking flag on @connection's underlying
28786  * socket if it is currently set.
28787  *
28788  * Use g_socket_connection_connect_finish() to retrieve the result.
28789  *
28790  * Since: 2.32
28791  */
28792
28793
28794 /**
28795  * g_socket_connection_connect_finish:
28796  * @connection: a #GSocketConnection
28797  * @result: the #GAsyncResult
28798  * @error: #GError for error reporting, or %NULL to ignore.
28799  *
28800  * Gets the result of a g_socket_connection_connect_async() call.
28801  *
28802  * Returns: %TRUE if the connection succeeded, %FALSE on error
28803  * Since: 2.32
28804  */
28805
28806
28807 /**
28808  * g_socket_connection_factory_create_connection:
28809  * @socket: a #GSocket
28810  *
28811  * Creates a #GSocketConnection subclass of the right type for
28812  * @socket.
28813  *
28814  * Returns: (transfer full): a #GSocketConnection
28815  * Since: 2.22
28816  */
28817
28818
28819 /**
28820  * g_socket_connection_factory_lookup_type:
28821  * @family: a #GSocketFamily
28822  * @type: a #GSocketType
28823  * @protocol_id: a protocol id
28824  *
28825  * Looks up the #GType to be used when creating socket connections on
28826  * sockets with the specified @family, @type and @protocol_id.
28827  *
28828  * If no type is registered, the #GSocketConnection base type is returned.
28829  *
28830  * Returns: a #GType
28831  * Since: 2.22
28832  */
28833
28834
28835 /**
28836  * g_socket_connection_factory_register_type:
28837  * @g_type: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
28838  * @family: a #GSocketFamily
28839  * @type: a #GSocketType
28840  * @protocol: a protocol id
28841  *
28842  * Looks up the #GType to be used when creating socket connections on
28843  * sockets with the specified @family, @type and @protocol.
28844  *
28845  * If no type is registered, the #GSocketConnection base type is returned.
28846  *
28847  * Since: 2.22
28848  */
28849
28850
28851 /**
28852  * g_socket_connection_get_local_address:
28853  * @connection: a #GSocketConnection
28854  * @error: #GError for error reporting, or %NULL to ignore.
28855  *
28856  * Try to get the local address of a socket connection.
28857  *
28858  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28859  * Since: 2.22
28860  */
28861
28862
28863 /**
28864  * g_socket_connection_get_remote_address:
28865  * @connection: a #GSocketConnection
28866  * @error: #GError for error reporting, or %NULL to ignore.
28867  *
28868  * Try to get the remote address of a socket connection.
28869  *
28870  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28871  * Since: 2.22
28872  */
28873
28874
28875 /**
28876  * g_socket_connection_get_socket:
28877  * @connection: a #GSocketConnection
28878  *
28879  * Gets the underlying #GSocket object of the connection.
28880  * This can be useful if you want to do something unusual on it
28881  * not supported by the #GSocketConnection APIs.
28882  *
28883  * Returns: (transfer none): a #GSocketAddress or %NULL on error.
28884  * Since: 2.22
28885  */
28886
28887
28888 /**
28889  * g_socket_connection_is_connected:
28890  * @connection: a #GSocketConnection
28891  *
28892  * Checks if @connection is connected. This is equivalent to calling
28893  * g_socket_is_connected() on @connection's underlying #GSocket.
28894  *
28895  * Returns: whether @connection is connected
28896  * Since: 2.32
28897  */
28898
28899
28900 /**
28901  * g_socket_control_message_deserialize:
28902  * @level: a socket level
28903  * @type: a socket control message type for the given @level
28904  * @size: the size of the data in bytes
28905  * @data: (array length=size) (element-type guint8): pointer to the message data
28906  *
28907  * Tries to deserialize a socket control message of a given
28908  * @level and @type. This will ask all known (to GType) subclasses
28909  * of #GSocketControlMessage if they can understand this kind
28910  * of message and if so deserialize it into a #GSocketControlMessage.
28911  *
28912  * If there is no implementation for this kind of control message, %NULL
28913  * will be returned.
28914  *
28915  * Returns: (transfer full): the deserialized message or %NULL
28916  * Since: 2.22
28917  */
28918
28919
28920 /**
28921  * g_socket_control_message_get_level:
28922  * @message: a #GSocketControlMessage
28923  *
28924  * Returns the "level" (i.e. the originating protocol) of the control message.
28925  * This is often SOL_SOCKET.
28926  *
28927  * Returns: an integer describing the level
28928  * Since: 2.22
28929  */
28930
28931
28932 /**
28933  * g_socket_control_message_get_msg_type:
28934  * @message: a #GSocketControlMessage
28935  *
28936  * Returns the protocol specific type of the control message.
28937  * For instance, for UNIX fd passing this would be SCM_RIGHTS.
28938  *
28939  * Returns: an integer describing the type of control message
28940  * Since: 2.22
28941  */
28942
28943
28944 /**
28945  * g_socket_control_message_get_size:
28946  * @message: a #GSocketControlMessage
28947  *
28948  * Returns the space required for the control message, not including
28949  * headers or alignment.
28950  *
28951  * Returns: The number of bytes required.
28952  * Since: 2.22
28953  */
28954
28955
28956 /**
28957  * g_socket_control_message_serialize:
28958  * @message: a #GSocketControlMessage
28959  * @data: A buffer to write data to
28960  *
28961  * Converts the data in the message to bytes placed in the
28962  * message.
28963  *
28964  * @data is guaranteed to have enough space to fit the size
28965  * returned by g_socket_control_message_get_size() on this
28966  * object.
28967  *
28968  * Since: 2.22
28969  */
28970
28971
28972 /**
28973  * g_socket_create_source: (skip)
28974  * @socket: a #GSocket
28975  * @condition: a #GIOCondition mask to monitor
28976  * @cancellable: (allow-none): a %GCancellable or %NULL
28977  *
28978  * Creates a %GSource that can be attached to a %GMainContext to monitor
28979  * for the availibility of the specified @condition on the socket.
28980  *
28981  * The callback on the source is of the #GSocketSourceFunc type.
28982  *
28983  * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
28984  * these conditions will always be reported output if they are true.
28985  *
28986  * @cancellable if not %NULL can be used to cancel the source, which will
28987  * cause the source to trigger, reporting the current condition (which
28988  * is likely 0 unless cancellation happened at the same time as a
28989  * condition change). You can check for this in the callback using
28990  * g_cancellable_is_cancelled().
28991  *
28992  * If @socket has a timeout set, and it is reached before @condition
28993  * occurs, the source will then trigger anyway, reporting %G_IO_IN or
28994  * %G_IO_OUT depending on @condition. However, @socket will have been
28995  * marked as having had a timeout, and so the next #GSocket I/O method
28996  * you call will then fail with a %G_IO_ERROR_TIMED_OUT.
28997  *
28998  * Returns: (transfer full): a newly allocated %GSource, free with g_source_unref().
28999  * Since: 2.22
29000  */
29001
29002
29003 /**
29004  * g_socket_get_available_bytes:
29005  * @socket: a #GSocket
29006  *
29007  * Get the amount of data pending in the OS input buffer.
29008  *
29009  * Returns: the number of bytes that can be read from the socket without blocking or -1 on error.
29010  * Since: 2.32
29011  */
29012
29013
29014 /**
29015  * g_socket_get_blocking:
29016  * @socket: a #GSocket.
29017  *
29018  * Gets the blocking mode of the socket. For details on blocking I/O,
29019  * see g_socket_set_blocking().
29020  *
29021  * Returns: %TRUE if blocking I/O is used, %FALSE otherwise.
29022  * Since: 2.22
29023  */
29024
29025
29026 /**
29027  * g_socket_get_broadcast:
29028  * @socket: a #GSocket.
29029  *
29030  * Gets the broadcast setting on @socket; if %TRUE,
29031  * it is possible to send packets to broadcast
29032  * addresses or receive from broadcast addresses.
29033  *
29034  * Returns: the broadcast setting on @socket
29035  * Since: 2.32
29036  */
29037
29038
29039 /**
29040  * g_socket_get_credentials:
29041  * @socket: a #GSocket.
29042  * @error: #GError for error reporting, or %NULL to ignore.
29043  *
29044  * Returns the credentials of the foreign process connected to this
29045  * socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
29046  * sockets).
29047  *
29048  * If this operation isn't supported on the OS, the method fails with
29049  * the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
29050  * by reading the %SO_PEERCRED option on the underlying socket.
29051  *
29052  * Other ways to obtain credentials from a foreign peer includes the
29053  * #GUnixCredentialsMessage type and
29054  * g_unix_connection_send_credentials() /
29055  * g_unix_connection_receive_credentials() functions.
29056  *
29057  * Returns: (transfer full): %NULL if @error is set, otherwise a #GCredentials object that must be freed with g_object_unref().
29058  * Since: 2.26
29059  */
29060
29061
29062 /**
29063  * g_socket_get_family:
29064  * @socket: a #GSocket.
29065  *
29066  * Gets the socket family of the socket.
29067  *
29068  * Returns: a #GSocketFamily
29069  * Since: 2.22
29070  */
29071
29072
29073 /**
29074  * g_socket_get_fd:
29075  * @socket: a #GSocket.
29076  *
29077  * Returns the underlying OS socket object. On unix this
29078  * is a socket file descriptor, and on Windows this is
29079  * a Winsock2 SOCKET handle. This may be useful for
29080  * doing platform specific or otherwise unusual operations
29081  * on the socket.
29082  *
29083  * Returns: the file descriptor of the socket.
29084  * Since: 2.22
29085  */
29086
29087
29088 /**
29089  * g_socket_get_keepalive:
29090  * @socket: a #GSocket.
29091  *
29092  * Gets the keepalive mode of the socket. For details on this,
29093  * see g_socket_set_keepalive().
29094  *
29095  * Returns: %TRUE if keepalive is active, %FALSE otherwise.
29096  * Since: 2.22
29097  */
29098
29099
29100 /**
29101  * g_socket_get_listen_backlog:
29102  * @socket: a #GSocket.
29103  *
29104  * Gets the listen backlog setting of the socket. For details on this,
29105  * see g_socket_set_listen_backlog().
29106  *
29107  * Returns: the maximum number of pending connections.
29108  * Since: 2.22
29109  */
29110
29111
29112 /**
29113  * g_socket_get_local_address:
29114  * @socket: a #GSocket.
29115  * @error: #GError for error reporting, or %NULL to ignore.
29116  *
29117  * Try to get the local address of a bound socket. This is only
29118  * useful if the socket has been bound to a local address,
29119  * either explicitly or implicitly when connecting.
29120  *
29121  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29122  * Since: 2.22
29123  */
29124
29125
29126 /**
29127  * g_socket_get_multicast_loopback:
29128  * @socket: a #GSocket.
29129  *
29130  * Gets the multicast loopback setting on @socket; if %TRUE (the
29131  * default), outgoing multicast packets will be looped back to
29132  * multicast listeners on the same host.
29133  *
29134  * Returns: the multicast loopback setting on @socket
29135  * Since: 2.32
29136  */
29137
29138
29139 /**
29140  * g_socket_get_multicast_ttl:
29141  * @socket: a #GSocket.
29142  *
29143  * Gets the multicast time-to-live setting on @socket; see
29144  * g_socket_set_multicast_ttl() for more details.
29145  *
29146  * Returns: the multicast time-to-live setting on @socket
29147  * Since: 2.32
29148  */
29149
29150
29151 /**
29152  * g_socket_get_protocol:
29153  * @socket: a #GSocket.
29154  *
29155  * Gets the socket protocol id the socket was created with.
29156  * In case the protocol is unknown, -1 is returned.
29157  *
29158  * Returns: a protocol id, or -1 if unknown
29159  * Since: 2.22
29160  */
29161
29162
29163 /**
29164  * g_socket_get_remote_address:
29165  * @socket: a #GSocket.
29166  * @error: #GError for error reporting, or %NULL to ignore.
29167  *
29168  * Try to get the remove address of a connected socket. This is only
29169  * useful for connection oriented sockets that have been connected.
29170  *
29171  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
29172  * Since: 2.22
29173  */
29174
29175
29176 /**
29177  * g_socket_get_socket_type:
29178  * @socket: a #GSocket.
29179  *
29180  * Gets the socket type of the socket.
29181  *
29182  * Returns: a #GSocketType
29183  * Since: 2.22
29184  */
29185
29186
29187 /**
29188  * g_socket_get_timeout:
29189  * @socket: a #GSocket.
29190  *
29191  * Gets the timeout setting of the socket. For details on this, see
29192  * g_socket_set_timeout().
29193  *
29194  * Returns: the timeout in seconds
29195  * Since: 2.26
29196  */
29197
29198
29199 /**
29200  * g_socket_get_ttl:
29201  * @socket: a #GSocket.
29202  *
29203  * Gets the unicast time-to-live setting on @socket; see
29204  * g_socket_set_ttl() for more details.
29205  *
29206  * Returns: the time-to-live setting on @socket
29207  * Since: 2.32
29208  */
29209
29210
29211 /**
29212  * g_socket_is_closed:
29213  * @socket: a #GSocket
29214  *
29215  * Checks whether a socket is closed.
29216  *
29217  * Returns: %TRUE if socket is closed, %FALSE otherwise
29218  * Since: 2.22
29219  */
29220
29221
29222 /**
29223  * g_socket_is_connected:
29224  * @socket: a #GSocket.
29225  *
29226  * Check whether the socket is connected. This is only useful for
29227  * connection-oriented sockets.
29228  *
29229  * Returns: %TRUE if socket is connected, %FALSE otherwise.
29230  * Since: 2.22
29231  */
29232
29233
29234 /**
29235  * g_socket_join_multicast_group:
29236  * @socket: a #GSocket.
29237  * @group: a #GInetAddress specifying the group address to join.
29238  * @iface: (allow-none): Name of the interface to use, or %NULL
29239  * @source_specific: %TRUE if source-specific multicast should be used
29240  * @error: #GError for error reporting, or %NULL to ignore.
29241  *
29242  * Registers @socket to receive multicast messages sent to @group.
29243  * @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have
29244  * been bound to an appropriate interface and port with
29245  * g_socket_bind().
29246  *
29247  * If @iface is %NULL, the system will automatically pick an interface
29248  * to bind to based on @group.
29249  *
29250  * If @source_specific is %TRUE, source-specific multicast as defined
29251  * in RFC 4604 is used. Note that on older platforms this may fail
29252  * with a %G_IO_ERROR_NOT_SUPPORTED error.
29253  *
29254  * Returns: %TRUE on success, %FALSE on error.
29255  * Since: 2.32
29256  */
29257
29258
29259 /**
29260  * g_socket_leave_multicast_group:
29261  * @socket: a #GSocket.
29262  * @group: a #GInetAddress specifying the group address to leave.
29263  * @iface: (allow-none): Interface used
29264  * @source_specific: %TRUE if source-specific multicast was used
29265  * @error: #GError for error reporting, or %NULL to ignore.
29266  *
29267  * Removes @socket from the multicast group defined by @group, @iface,
29268  * and @source_specific (which must all have the same values they had
29269  * when you joined the group).
29270  *
29271  * @socket remains bound to its address and port, and can still receive
29272  * unicast messages after calling this.
29273  *
29274  * Returns: %TRUE on success, %FALSE on error.
29275  * Since: 2.32
29276  */
29277
29278
29279 /**
29280  * g_socket_listen:
29281  * @socket: a #GSocket.
29282  * @error: #GError for error reporting, or %NULL to ignore.
29283  *
29284  * Marks the socket as a server socket, i.e. a socket that is used
29285  * to accept incoming requests using g_socket_accept().
29286  *
29287  * Before calling this the socket must be bound to a local address using
29288  * g_socket_bind().
29289  *
29290  * To set the maximum amount of outstanding clients, use
29291  * g_socket_set_listen_backlog().
29292  *
29293  * Returns: %TRUE on success, %FALSE on error.
29294  * Since: 2.22
29295  */
29296
29297
29298 /**
29299  * g_socket_listener_accept:
29300  * @listener: a #GSocketListener
29301  * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL
29302  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29303  * @error: #GError for error reporting, or %NULL to ignore.
29304  *
29305  * Blocks waiting for a client to connect to any of the sockets added
29306  * to the listener. Returns a #GSocketConnection for the socket that was
29307  * accepted.
29308  *
29309  * If @source_object is not %NULL it will be filled out with the source
29310  * object specified when the corresponding socket or address was added
29311  * to the listener.
29312  *
29313  * If @cancellable is not %NULL, then the operation can be cancelled by
29314  * triggering the cancellable object from another thread. If the operation
29315  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29316  *
29317  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29318  * Since: 2.22
29319  */
29320
29321
29322 /**
29323  * g_socket_listener_accept_async:
29324  * @listener: a #GSocketListener
29325  * @cancellable: (allow-none): a #GCancellable, or %NULL
29326  * @callback: (scope async): a #GAsyncReadyCallback
29327  * @user_data: (closure): user data for the callback
29328  *
29329  * This is the asynchronous version of g_socket_listener_accept().
29330  *
29331  * When the operation is finished @callback will be
29332  * called. You can then call g_socket_listener_accept_socket()
29333  * to get the result of the operation.
29334  *
29335  * Since: 2.22
29336  */
29337
29338
29339 /**
29340  * g_socket_listener_accept_finish:
29341  * @listener: a #GSocketListener
29342  * @result: a #GAsyncResult.
29343  * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29344  * @error: a #GError location to store the error occurring, or %NULL to ignore.
29345  *
29346  * Finishes an async accept operation. See g_socket_listener_accept_async()
29347  *
29348  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
29349  * Since: 2.22
29350  */
29351
29352
29353 /**
29354  * g_socket_listener_accept_socket:
29355  * @listener: a #GSocketListener
29356  * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL.
29357  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29358  * @error: #GError for error reporting, or %NULL to ignore.
29359  *
29360  * Blocks waiting for a client to connect to any of the sockets added
29361  * to the listener. Returns the #GSocket that was accepted.
29362  *
29363  * If you want to accept the high-level #GSocketConnection, not a #GSocket,
29364  * which is often the case, then you should use g_socket_listener_accept()
29365  * instead.
29366  *
29367  * If @source_object is not %NULL it will be filled out with the source
29368  * object specified when the corresponding socket or address was added
29369  * to the listener.
29370  *
29371  * If @cancellable is not %NULL, then the operation can be cancelled by
29372  * triggering the cancellable object from another thread. If the operation
29373  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
29374  *
29375  * Returns: (transfer full): a #GSocket on success, %NULL on error.
29376  * Since: 2.22
29377  */
29378
29379
29380 /**
29381  * g_socket_listener_accept_socket_async:
29382  * @listener: a #GSocketListener
29383  * @cancellable: (allow-none): a #GCancellable, or %NULL
29384  * @callback: (scope async): a #GAsyncReadyCallback
29385  * @user_data: (closure): user data for the callback
29386  *
29387  * This is the asynchronous version of g_socket_listener_accept_socket().
29388  *
29389  * When the operation is finished @callback will be
29390  * called. You can then call g_socket_listener_accept_socket_finish()
29391  * to get the result of the operation.
29392  *
29393  * Since: 2.22
29394  */
29395
29396
29397 /**
29398  * g_socket_listener_accept_socket_finish:
29399  * @listener: a #GSocketListener
29400  * @result: a #GAsyncResult.
29401  * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29402  * @error: a #GError location to store the error occurring, or %NULL to ignore.
29403  *
29404  * Finishes an async accept operation. See g_socket_listener_accept_socket_async()
29405  *
29406  * Returns: (transfer full): a #GSocket on success, %NULL on error.
29407  * Since: 2.22
29408  */
29409
29410
29411 /**
29412  * g_socket_listener_add_address:
29413  * @listener: a #GSocketListener
29414  * @address: a #GSocketAddress
29415  * @type: a #GSocketType
29416  * @protocol: a #GSocketProtocol
29417  * @source_object: (allow-none): Optional #GObject identifying this source
29418  * @effective_address: (out) (allow-none): location to store the address that was bound to, or %NULL.
29419  * @error: #GError for error reporting, or %NULL to ignore.
29420  *
29421  * Creates a socket of type @type and protocol @protocol, binds
29422  * it to @address and adds it to the set of sockets we're accepting
29423  * sockets from.
29424  *
29425  * Note that adding an IPv6 address, depending on the platform,
29426  * may or may not result in a listener that also accepts IPv4
29427  * connections.  For more deterministic behavior, see
29428  * g_socket_listener_add_inet_port().
29429  *
29430  * @source_object will be passed out in the various calls
29431  * to accept to identify this particular source, which is
29432  * useful if you're listening on multiple addresses and do
29433  * different things depending on what address is connected to.
29434  *
29435  * If successful and @effective_address is non-%NULL then it will
29436  * be set to the address that the binding actually occurred at.  This
29437  * is helpful for determining the port number that was used for when
29438  * requesting a binding to port 0 (ie: "any port").  This address, if
29439  * requested, belongs to the caller and must be freed.
29440  *
29441  * Returns: %TRUE on success, %FALSE on error.
29442  * Since: 2.22
29443  */
29444
29445
29446 /**
29447  * g_socket_listener_add_any_inet_port:
29448  * @listener: a #GSocketListener
29449  * @source_object: (allow-none): Optional #GObject identifying this source
29450  * @error: a #GError location to store the error occurring, or %NULL to ignore.
29451  *
29452  * Listens for TCP connections on any available port number for both
29453  * IPv6 and IPv4 (if each is available).
29454  *
29455  * This is useful if you need to have a socket for incoming connections
29456  * but don't care about the specific port number.
29457  *
29458  * @source_object will be passed out in the various calls
29459  * to accept to identify this particular source, which is
29460  * useful if you're listening on multiple addresses and do
29461  * different things depending on what address is connected to.
29462  *
29463  * Returns: the port number, or 0 in case of failure.
29464  * Since: 2.24
29465  */
29466
29467
29468 /**
29469  * g_socket_listener_add_inet_port:
29470  * @listener: a #GSocketListener
29471  * @port: an IP port number (non-zero)
29472  * @source_object: (allow-none): Optional #GObject identifying this source
29473  * @error: #GError for error reporting, or %NULL to ignore.
29474  *
29475  * Helper function for g_socket_listener_add_address() that
29476  * creates a TCP/IP socket listening on IPv4 and IPv6 (if
29477  * supported) on the specified port on all interfaces.
29478  *
29479  * @source_object will be passed out in the various calls
29480  * to accept to identify this particular source, which is
29481  * useful if you're listening on multiple addresses and do
29482  * different things depending on what address is connected to.
29483  *
29484  * Returns: %TRUE on success, %FALSE on error.
29485  * Since: 2.22
29486  */
29487
29488
29489 /**
29490  * g_socket_listener_add_socket:
29491  * @listener: a #GSocketListener
29492  * @socket: a listening #GSocket
29493  * @source_object: (allow-none): Optional #GObject identifying this source
29494  * @error: #GError for error reporting, or %NULL to ignore.
29495  *
29496  * Adds @socket to the set of sockets that we try to accept
29497  * new clients from. The socket must be bound to a local
29498  * address and listened to.
29499  *
29500  * @source_object will be passed out in the various calls
29501  * to accept to identify this particular source, which is
29502  * useful if you're listening on multiple addresses and do
29503  * different things depending on what address is connected to.
29504  *
29505  * Returns: %TRUE on success, %FALSE on error.
29506  * Since: 2.22
29507  */
29508
29509
29510 /**
29511  * g_socket_listener_close:
29512  * @listener: a #GSocketListener
29513  *
29514  * Closes all the sockets in the listener.
29515  *
29516  * Since: 2.22
29517  */
29518
29519
29520 /**
29521  * g_socket_listener_new:
29522  *
29523  * Creates a new #GSocketListener with no sockets to listen for.
29524  * New listeners can be added with e.g. g_socket_listener_add_address()
29525  * or g_socket_listener_add_inet_port().
29526  *
29527  * Returns: a new #GSocketListener.
29528  * Since: 2.22
29529  */
29530
29531
29532 /**
29533  * g_socket_listener_set_backlog:
29534  * @listener: a #GSocketListener
29535  * @listen_backlog: an integer
29536  *
29537  * Sets the listen backlog on the sockets in the listener.
29538  *
29539  * See g_socket_set_listen_backlog() for details
29540  *
29541  * Since: 2.22
29542  */
29543
29544
29545 /**
29546  * g_socket_new:
29547  * @family: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
29548  * @type: the socket type to use.
29549  * @protocol: the id of the protocol to use, or 0 for default.
29550  * @error: #GError for error reporting, or %NULL to ignore.
29551  *
29552  * Creates a new #GSocket with the defined family, type and protocol.
29553  * If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
29554  * for the family and type is used.
29555  *
29556  * The @protocol is a family and type specific int that specifies what
29557  * kind of protocol to use. #GSocketProtocol lists several common ones.
29558  * Many families only support one protocol, and use 0 for this, others
29559  * support several and using 0 means to use the default protocol for
29560  * the family and type.
29561  *
29562  * The protocol id is passed directly to the operating
29563  * system, so you can use protocols not listed in #GSocketProtocol if you
29564  * know the protocol number used for it.
29565  *
29566  * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29567  * Since: 2.22
29568  */
29569
29570
29571 /**
29572  * g_socket_new_from_fd:
29573  * @fd: a native socket file descriptor.
29574  * @error: #GError for error reporting, or %NULL to ignore.
29575  *
29576  * Creates a new #GSocket from a native file descriptor
29577  * or winsock SOCKET handle.
29578  *
29579  * This reads all the settings from the file descriptor so that
29580  * all properties should work. Note that the file descriptor
29581  * will be set to non-blocking mode, independent on the blocking
29582  * mode of the #GSocket.
29583  *
29584  * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29585  * Since: 2.22
29586  */
29587
29588
29589 /**
29590  * g_socket_receive:
29591  * @socket: a #GSocket
29592  * @buffer: a buffer to read data into (which should be at least @size bytes long).
29593  * @size: the number of bytes you want to read from the socket
29594  * @cancellable: (allow-none): a %GCancellable or %NULL
29595  * @error: #GError for error reporting, or %NULL to ignore.
29596  *
29597  * Receive data (up to @size bytes) from a socket. This is mainly used by
29598  * connection-oriented sockets; it is identical to g_socket_receive_from()
29599  * with @address set to %NULL.
29600  *
29601  * For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
29602  * g_socket_receive() will always read either 0 or 1 complete messages from
29603  * the socket. If the received message is too large to fit in @buffer, then
29604  * the data beyond @size bytes will be discarded, without any explicit
29605  * indication that this has occurred.
29606  *
29607  * For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
29608  * number of bytes, up to @size. If more than @size bytes have been
29609  * received, the additional data will be returned in future calls to
29610  * g_socket_receive().
29611  *
29612  * If the socket is in blocking mode the call will block until there
29613  * is some data to receive, the connection is closed, or there is an
29614  * error. If there is no data available and the socket is in
29615  * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29616  * returned. To be notified when data is available, wait for the
29617  * %G_IO_IN condition.
29618  *
29619  * On error -1 is returned and @error is set accordingly.
29620  *
29621  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29622  * Since: 2.22
29623  */
29624
29625
29626 /**
29627  * g_socket_receive_from:
29628  * @socket: a #GSocket
29629  * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29630  * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
29631  * @size: the number of bytes you want to read from the socket
29632  * @cancellable: (allow-none): a %GCancellable or %NULL
29633  * @error: #GError for error reporting, or %NULL to ignore.
29634  *
29635  * Receive data (up to @size bytes) from a socket.
29636  *
29637  * If @address is non-%NULL then @address will be set equal to the
29638  * source address of the received packet.
29639  * @address is owned by the caller.
29640  *
29641  * See g_socket_receive() for additional information.
29642  *
29643  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29644  * Since: 2.22
29645  */
29646
29647
29648 /**
29649  * g_socket_receive_message:
29650  * @socket: a #GSocket
29651  * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29652  * @vectors: (array length=num_vectors): an array of #GInputVector structs
29653  * @num_vectors: the number of elements in @vectors, or -1
29654  * @messages: (array length=num_messages) (allow-none): a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
29655  * @num_messages: a pointer which will be filled with the number of elements in @messages, or %NULL
29656  * @flags: a pointer to an int containing #GSocketMsgFlags flags
29657  * @cancellable: (allow-none): a %GCancellable or %NULL
29658  * @error: a #GError pointer, or %NULL
29659  *
29660  * Receive data from a socket.  This is the most complicated and
29661  * fully-featured version of this call. For easier use, see
29662  * g_socket_receive() and g_socket_receive_from().
29663  *
29664  * If @address is non-%NULL then @address will be set equal to the
29665  * source address of the received packet.
29666  * @address is owned by the caller.
29667  *
29668  * @vector must point to an array of #GInputVector structs and
29669  * @num_vectors must be the length of this array.  These structs
29670  * describe the buffers that received data will be scattered into.
29671  * If @num_vectors is -1, then @vectors is assumed to be terminated
29672  * by a #GInputVector with a %NULL buffer pointer.
29673  *
29674  * As a special case, if @num_vectors is 0 (in which case, @vectors
29675  * may of course be %NULL), then a single byte is received and
29676  * discarded. This is to facilitate the common practice of sending a
29677  * single '\0' byte for the purposes of transferring ancillary data.
29678  *
29679  * @messages, if non-%NULL, will be set to point to a newly-allocated
29680  * array of #GSocketControlMessage instances or %NULL if no such
29681  * messages was received. These correspond to the control messages
29682  * received from the kernel, one #GSocketControlMessage per message
29683  * from the kernel. This array is %NULL-terminated and must be freed
29684  * by the caller using g_free() after calling g_object_unref() on each
29685  * element. If @messages is %NULL, any control messages received will
29686  * be discarded.
29687  *
29688  * @num_messages, if non-%NULL, will be set to the number of control
29689  * messages received.
29690  *
29691  * If both @messages and @num_messages are non-%NULL, then
29692  * @num_messages gives the number of #GSocketControlMessage instances
29693  * in @messages (ie: not including the %NULL terminator).
29694  *
29695  * @flags is an in/out parameter. The commonly available arguments
29696  * for this are available in the #GSocketMsgFlags enum, but the
29697  * values there are the same as the system values, and the flags
29698  * are passed in as-is, so you can pass in system-specific flags too
29699  * (and g_socket_receive_message() may pass system-specific flags out).
29700  *
29701  * As with g_socket_receive(), data may be discarded if @socket is
29702  * %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
29703  * provide enough buffer space to read a complete message. You can pass
29704  * %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
29705  * removing it from the receive queue, but there is no portable way to find
29706  * out the length of the message other than by reading it into a
29707  * sufficiently-large buffer.
29708  *
29709  * If the socket is in blocking mode the call will block until there
29710  * is some data to receive, the connection is closed, or there is an
29711  * error. If there is no data available and the socket is in
29712  * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29713  * returned. To be notified when data is available, wait for the
29714  * %G_IO_IN condition.
29715  *
29716  * On error -1 is returned and @error is set accordingly.
29717  *
29718  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29719  * Since: 2.22
29720  */
29721
29722
29723 /**
29724  * g_socket_receive_with_blocking:
29725  * @socket: a #GSocket
29726  * @buffer: a buffer to read data into (which should be at least @size bytes long).
29727  * @size: the number of bytes you want to read from the socket
29728  * @blocking: whether to do blocking or non-blocking I/O
29729  * @cancellable: (allow-none): a %GCancellable or %NULL
29730  * @error: #GError for error reporting, or %NULL to ignore.
29731  *
29732  * This behaves exactly the same as g_socket_receive(), except that
29733  * the choice of blocking or non-blocking behavior is determined by
29734  * the @blocking argument rather than by @socket's properties.
29735  *
29736  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29737  * Since: 2.26
29738  */
29739
29740
29741 /**
29742  * g_socket_send:
29743  * @socket: a #GSocket
29744  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29745  * @size: the number of bytes to send
29746  * @cancellable: (allow-none): a %GCancellable or %NULL
29747  * @error: #GError for error reporting, or %NULL to ignore.
29748  *
29749  * Tries to send @size bytes from @buffer on the socket. This is
29750  * mainly used by connection-oriented sockets; it is identical to
29751  * g_socket_send_to() with @address set to %NULL.
29752  *
29753  * If the socket is in blocking mode the call will block until there is
29754  * space for the data in the socket queue. If there is no space available
29755  * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
29756  * will be returned. To be notified when space is available, wait for the
29757  * %G_IO_OUT condition. Note though that you may still receive
29758  * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
29759  * notified of a %G_IO_OUT condition. (On Windows in particular, this is
29760  * very common due to the way the underlying APIs work.)
29761  *
29762  * On error -1 is returned and @error is set accordingly.
29763  *
29764  * Returns: Number of bytes written (which may be less than @size), or -1 on error
29765  * Since: 2.22
29766  */
29767
29768
29769 /**
29770  * g_socket_send_message:
29771  * @socket: a #GSocket
29772  * @address: (allow-none): a #GSocketAddress, or %NULL
29773  * @vectors: (array length=num_vectors): an array of #GOutputVector structs
29774  * @num_vectors: the number of elements in @vectors, or -1
29775  * @messages: (array length=num_messages) (allow-none): a pointer to an array of #GSocketControlMessages, or %NULL.
29776  * @num_messages: number of elements in @messages, or -1.
29777  * @flags: an int containing #GSocketMsgFlags flags
29778  * @cancellable: (allow-none): a %GCancellable or %NULL
29779  * @error: #GError for error reporting, or %NULL to ignore.
29780  *
29781  * Send data to @address on @socket.  This is the most complicated and
29782  * fully-featured version of this call. For easier use, see
29783  * g_socket_send() and g_socket_send_to().
29784  *
29785  * If @address is %NULL then the message is sent to the default receiver
29786  * (set by g_socket_connect()).
29787  *
29788  * @vectors must point to an array of #GOutputVector structs and
29789  * @num_vectors must be the length of this array. (If @num_vectors is -1,
29790  * then @vectors is assumed to be terminated by a #GOutputVector with a
29791  * %NULL buffer pointer.) The #GOutputVector structs describe the buffers
29792  * that the sent data will be gathered from. Using multiple
29793  * #GOutputVector<!-- -->s is more memory-efficient than manually copying
29794  * data from multiple sources into a single buffer, and more
29795  * network-efficient than making multiple calls to g_socket_send().
29796  *
29797  * @messages, if non-%NULL, is taken to point to an array of @num_messages
29798  * #GSocketControlMessage instances. These correspond to the control
29799  * messages to be sent on the socket.
29800  * If @num_messages is -1 then @messages is treated as a %NULL-terminated
29801  * array.
29802  *
29803  * @flags modify how the message is sent. The commonly available arguments
29804  * for this are available in the #GSocketMsgFlags enum, but the
29805  * values there are the same as the system values, and the flags
29806  * are passed in as-is, so you can pass in system-specific flags too.
29807  *
29808  * If the socket is in blocking mode the call will block until there is
29809  * space for the data in the socket queue. If there is no space available
29810  * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
29811  * will be returned. To be notified when space is available, wait for the
29812  * %G_IO_OUT condition. Note though that you may still receive
29813  * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
29814  * notified of a %G_IO_OUT condition. (On Windows in particular, this is
29815  * very common due to the way the underlying APIs work.)
29816  *
29817  * On error -1 is returned and @error is set accordingly.
29818  *
29819  * Returns: Number of bytes written (which may be less than @size), or -1 on error
29820  * Since: 2.22
29821  */
29822
29823
29824 /**
29825  * g_socket_send_to:
29826  * @socket: a #GSocket
29827  * @address: (allow-none): a #GSocketAddress, or %NULL
29828  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29829  * @size: the number of bytes to send
29830  * @cancellable: (allow-none): a %GCancellable or %NULL
29831  * @error: #GError for error reporting, or %NULL to ignore.
29832  *
29833  * Tries to send @size bytes from @buffer to @address. If @address is
29834  * %NULL then the message is sent to the default receiver (set by
29835  * g_socket_connect()).
29836  *
29837  * See g_socket_send() for additional information.
29838  *
29839  * Returns: Number of bytes written (which may be less than @size), or -1 on error
29840  * Since: 2.22
29841  */
29842
29843
29844 /**
29845  * g_socket_send_with_blocking:
29846  * @socket: a #GSocket
29847  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29848  * @size: the number of bytes to send
29849  * @blocking: whether to do blocking or non-blocking I/O
29850  * @cancellable: (allow-none): a %GCancellable or %NULL
29851  * @error: #GError for error reporting, or %NULL to ignore.
29852  *
29853  * This behaves exactly the same as g_socket_send(), except that
29854  * the choice of blocking or non-blocking behavior is determined by
29855  * the @blocking argument rather than by @socket's properties.
29856  *
29857  * Returns: Number of bytes written (which may be less than @size), or -1 on error
29858  * Since: 2.26
29859  */
29860
29861
29862 /**
29863  * g_socket_service_is_active:
29864  * @service: a #GSocketService
29865  *
29866  * Check whether the service is active or not. An active
29867  * service will accept new clients that connect, while
29868  * a non-active service will let connecting clients queue
29869  * up until the service is started.
29870  *
29871  * Returns: %TRUE if the service is active, %FALSE otherwise
29872  * Since: 2.22
29873  */
29874
29875
29876 /**
29877  * g_socket_service_new:
29878  *
29879  * Creates a new #GSocketService with no sockets to listen for.
29880  * New listeners can be added with e.g. g_socket_listener_add_address()
29881  * or g_socket_listener_add_inet_port().
29882  *
29883  * Returns: a new #GSocketService.
29884  * Since: 2.22
29885  */
29886
29887
29888 /**
29889  * g_socket_service_start:
29890  * @service: a #GSocketService
29891  *
29892  * Starts the service, i.e. start 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_service_stop:
29904  * @service: a #GSocketService
29905  *
29906  * Stops the service, i.e. stops accepting connections
29907  * from the added sockets when the mainloop runs.
29908  *
29909  * This call is thread-safe, so it may be called from a thread
29910  * handling an incoming client request.
29911  *
29912  * Since: 2.22
29913  */
29914
29915
29916 /**
29917  * g_socket_set_blocking:
29918  * @socket: a #GSocket.
29919  * @blocking: Whether to use blocking I/O or not.
29920  *
29921  * Sets the blocking mode of the socket. In blocking mode
29922  * all operations block until they succeed or there is an error. In
29923  * non-blocking mode all functions return results immediately or
29924  * with a %G_IO_ERROR_WOULD_BLOCK error.
29925  *
29926  * All sockets are created in blocking mode. However, note that the
29927  * platform level socket is always non-blocking, and blocking mode
29928  * is a GSocket level feature.
29929  *
29930  * Since: 2.22
29931  */
29932
29933
29934 /**
29935  * g_socket_set_broadcast:
29936  * @socket: a #GSocket.
29937  * @broadcast: whether @socket should allow sending to and receiving from broadcast addresses
29938  *
29939  * Sets whether @socket should allow sending to and receiving from
29940  * broadcast addresses. This is %FALSE by default.
29941  *
29942  * Since: 2.32
29943  */
29944
29945
29946 /**
29947  * g_socket_set_keepalive:
29948  * @socket: a #GSocket.
29949  * @keepalive: Value for the keepalive flag
29950  *
29951  * Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
29952  * this flag is set on a socket, the system will attempt to verify that the
29953  * remote socket endpoint is still present if a sufficiently long period of
29954  * time passes with no data being exchanged. If the system is unable to
29955  * verify the presence of the remote endpoint, it will automatically close
29956  * the connection.
29957  *
29958  * This option is only functional on certain kinds of sockets. (Notably,
29959  * %G_SOCKET_PROTOCOL_TCP sockets.)
29960  *
29961  * The exact time between pings is system- and protocol-dependent, but will
29962  * normally be at least two hours. Most commonly, you would set this flag
29963  * on a server socket if you want to allow clients to remain idle for long
29964  * periods of time, but also want to ensure that connections are eventually
29965  * garbage-collected if clients crash or become unreachable.
29966  *
29967  * Since: 2.22
29968  */
29969
29970
29971 /**
29972  * g_socket_set_listen_backlog:
29973  * @socket: a #GSocket.
29974  * @backlog: the maximum number of pending connections.
29975  *
29976  * Sets the maximum number of outstanding connections allowed
29977  * when listening on this socket. If more clients than this are
29978  * connecting to the socket and the application is not handling them
29979  * on time then the new connections will be refused.
29980  *
29981  * Note that this must be called before g_socket_listen() and has no
29982  * effect if called after that.
29983  *
29984  * Since: 2.22
29985  */
29986
29987
29988 /**
29989  * g_socket_set_multicast_loopback:
29990  * @socket: a #GSocket.
29991  * @loopback: whether @socket should receive messages sent to its multicast groups from the local host
29992  *
29993  * Sets whether outgoing multicast packets will be received by sockets
29994  * listening on that multicast address on the same host. This is %TRUE
29995  * by default.
29996  *
29997  * Since: 2.32
29998  */
29999
30000
30001 /**
30002  * g_socket_set_multicast_ttl:
30003  * @socket: a #GSocket.
30004  * @ttl: the time-to-live value for all multicast datagrams on @socket
30005  *
30006  * Sets the time-to-live for outgoing multicast datagrams on @socket.
30007  * By default, this is 1, meaning that multicast packets will not leave
30008  * the local network.
30009  *
30010  * Since: 2.32
30011  */
30012
30013
30014 /**
30015  * g_socket_set_timeout:
30016  * @socket: a #GSocket.
30017  * @timeout: the timeout for @socket, in seconds, or 0 for none
30018  *
30019  * Sets the time in seconds after which I/O operations on @socket will
30020  * time out if they have not yet completed.
30021  *
30022  * On a blocking socket, this means that any blocking #GSocket
30023  * operation will time out after @timeout seconds of inactivity,
30024  * returning %G_IO_ERROR_TIMED_OUT.
30025  *
30026  * On a non-blocking socket, calls to g_socket_condition_wait() will
30027  * also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
30028  * created with g_socket_create_source() will trigger after
30029  * @timeout seconds of inactivity, with the requested condition
30030  * set, at which point calling g_socket_receive(), g_socket_send(),
30031  * g_socket_check_connect_result(), etc, will fail with
30032  * %G_IO_ERROR_TIMED_OUT.
30033  *
30034  * If @timeout is 0 (the default), operations will never time out
30035  * on their own.
30036  *
30037  * Note that if an I/O operation is interrupted by a signal, this may
30038  * cause the timeout to be reset.
30039  *
30040  * Since: 2.26
30041  */
30042
30043
30044 /**
30045  * g_socket_set_ttl:
30046  * @socket: a #GSocket.
30047  * @ttl: the time-to-live value for all unicast packets on @socket
30048  *
30049  * Sets the time-to-live for outgoing unicast packets on @socket.
30050  * By default the platform-specific default value is used.
30051  *
30052  * Since: 2.32
30053  */
30054
30055
30056 /**
30057  * g_socket_shutdown:
30058  * @socket: a #GSocket
30059  * @shutdown_read: whether to shut down the read side
30060  * @shutdown_write: whether to shut down the write side
30061  * @error: #GError for error reporting, or %NULL to ignore.
30062  *
30063  * Shut down part of a full-duplex connection.
30064  *
30065  * If @shutdown_read is %TRUE then the receiving side of the connection
30066  * is shut down, and further reading is disallowed.
30067  *
30068  * If @shutdown_write is %TRUE then the sending side of the connection
30069  * is shut down, and further writing is disallowed.
30070  *
30071  * It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
30072  *
30073  * One example where this is used is graceful disconnect for TCP connections
30074  * where you close the sending side, then wait for the other side to close
30075  * the connection, thus ensuring that the other side saw all sent data.
30076  *
30077  * Returns: %TRUE on success, %FALSE on error
30078  * Since: 2.22
30079  */
30080
30081
30082 /**
30083  * g_socket_speaks_ipv4:
30084  * @socket: a #GSocket
30085  *
30086  * Checks if a socket is capable of speaking IPv4.
30087  *
30088  * IPv4 sockets are capable of speaking IPv4.  On some operating systems
30089  * and under some combinations of circumstances IPv6 sockets are also
30090  * capable of speaking IPv4.  See RFC 3493 section 3.7 for more
30091  * information.
30092  *
30093  * No other types of sockets are currently considered as being capable
30094  * of speaking IPv4.
30095  *
30096  * Returns: %TRUE if this socket can be used with IPv4.
30097  * Since: 2.22
30098  */
30099
30100
30101 /**
30102  * g_srv_target_copy:
30103  * @target: a #GSrvTarget
30104  *
30105  * Copies @target
30106  *
30107  * Returns: a copy of @target
30108  * Since: 2.22
30109  */
30110
30111
30112 /**
30113  * g_srv_target_free:
30114  * @target: a #GSrvTarget
30115  *
30116  * Frees @target
30117  *
30118  * Since: 2.22
30119  */
30120
30121
30122 /**
30123  * g_srv_target_get_hostname:
30124  * @target: a #GSrvTarget
30125  *
30126  * Gets @target's hostname (in ASCII form; if you are going to present
30127  * this to the user, you should use g_hostname_is_ascii_encoded() to
30128  * check if it contains encoded Unicode segments, and use
30129  * g_hostname_to_unicode() to convert it if it does.)
30130  *
30131  * Returns: @target's hostname
30132  * Since: 2.22
30133  */
30134
30135
30136 /**
30137  * g_srv_target_get_port:
30138  * @target: a #GSrvTarget
30139  *
30140  * Gets @target's port
30141  *
30142  * Returns: @target's port
30143  * Since: 2.22
30144  */
30145
30146
30147 /**
30148  * g_srv_target_get_priority:
30149  * @target: a #GSrvTarget
30150  *
30151  * Gets @target's priority. You should not need to look at this;
30152  * #GResolver already sorts the targets according to the algorithm in
30153  * RFC 2782.
30154  *
30155  * Returns: @target's priority
30156  * Since: 2.22
30157  */
30158
30159
30160 /**
30161  * g_srv_target_get_weight:
30162  * @target: a #GSrvTarget
30163  *
30164  * Gets @target's weight. You should not need to look at this;
30165  * #GResolver already sorts the targets according to the algorithm in
30166  * RFC 2782.
30167  *
30168  * Returns: @target's weight
30169  * Since: 2.22
30170  */
30171
30172
30173 /**
30174  * g_srv_target_list_sort: (skip)
30175  * @targets: a #GList of #GSrvTarget
30176  *
30177  * Sorts @targets in place according to the algorithm in RFC 2782.
30178  *
30179  * Returns: (transfer full): the head of the sorted list.
30180  * Since: 2.22
30181  */
30182
30183
30184 /**
30185  * g_srv_target_new:
30186  * @hostname: the host that the service is running on
30187  * @port: the port that the service is running on
30188  * @priority: the target's priority
30189  * @weight: the target's weight
30190  *
30191  * Creates a new #GSrvTarget with the given parameters.
30192  *
30193  * You should not need to use this; normally #GSrvTarget<!-- -->s are
30194  * created by #GResolver.
30195  *
30196  * Returns: a new #GSrvTarget.
30197  * Since: 2.22
30198  */
30199
30200
30201 /**
30202  * g_static_resource_fini:
30203  * @static_resource: pointer to a static #GStaticResource
30204  *
30205  * Finalized a GResource initialized by 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  * Since: 2.32
30212  */
30213
30214
30215 /**
30216  * g_static_resource_get_resource:
30217  * @static_resource: pointer to a static #GStaticResource
30218  *
30219  * Gets the GResource that was registered by a call to g_static_resource_init().
30220  *
30221  * This is normally used by code generated by
30222  * <link linkend="glib-compile-resources">glib-compile-resources</link>
30223  * and is not typically used by other code.
30224  *
30225  * Returns: (transfer none): a #GResource
30226  * Since: 2.32
30227  */
30228
30229
30230 /**
30231  * g_static_resource_init:
30232  * @static_resource: pointer to a static #GStaticResource
30233  *
30234  * Initializes a GResource from static data using a
30235  * GStaticResource.
30236  *
30237  * This is normally used by code generated by
30238  * <link linkend="glib-compile-resources">glib-compile-resources</link>
30239  * and is not typically used by other code.
30240  *
30241  * Since: 2.32
30242  */
30243
30244
30245 /**
30246  * g_tcp_connection_get_graceful_disconnect:
30247  * @connection: a #GTcpConnection
30248  *
30249  * Checks if graceful disconnects are used. See
30250  * g_tcp_connection_set_graceful_disconnect().
30251  *
30252  * Returns: %TRUE if graceful disconnect is used on close, %FALSE otherwise
30253  * Since: 2.22
30254  */
30255
30256
30257 /**
30258  * g_tcp_connection_set_graceful_disconnect:
30259  * @connection: a #GTcpConnection
30260  * @graceful_disconnect: Whether to do graceful disconnects or not
30261  *
30262  * This enabled graceful disconnects on close. A graceful disconnect
30263  * means that we signal the receiving end that the connection is terminated
30264  * and wait for it to close the connection before closing the connection.
30265  *
30266  * A graceful disconnect means that we can be sure that we successfully sent
30267  * all the outstanding data to the other end, or get an error reported.
30268  * However, it also means we have to wait for all the data to reach the
30269  * other side and for it to acknowledge this by closing the socket, which may
30270  * take a while. For this reason it is disabled by default.
30271  *
30272  * Since: 2.22
30273  */
30274
30275
30276 /**
30277  * g_tcp_wrapper_connection_get_base_io_stream:
30278  * @conn: a #GTcpWrapperConnection
30279  *
30280  * Get's @conn's base #GIOStream
30281  *
30282  * Returns: (transfer none): @conn's base #GIOStream
30283  */
30284
30285
30286 /**
30287  * g_tcp_wrapper_connection_new:
30288  * @base_io_stream: the #GIOStream to wrap
30289  * @socket: the #GSocket associated with @base_io_stream
30290  *
30291  * Wraps @base_io_stream and @socket together as a #GSocketConnection.
30292  *
30293  * Returns: the new #GSocketConnection.
30294  * Since: 2.28
30295  */
30296
30297
30298 /**
30299  * g_test_dbus_add_service_dir:
30300  * @self: a #GTestDBus
30301  * @path: path to a directory containing .service files
30302  *
30303  * Add a path where dbus-daemon will lookup for .services files. This can't be
30304  * called after g_test_dbus_up().
30305  */
30306
30307
30308 /**
30309  * g_test_dbus_down:
30310  * @self: a #GTestDBus
30311  *
30312  * Stop the session bus started by g_test_dbus_up().
30313  *
30314  * This will wait for the singleton returned by g_bus_get() or g_bus_get_sync()
30315  * is destroyed. This is done to ensure that the next unit test won't get a
30316  * leaked singleton from this test.
30317  */
30318
30319
30320 /**
30321  * g_test_dbus_get_bus_address:
30322  * @self: a #GTestDBus
30323  *
30324  * Get the address on which dbus-daemon is running. if g_test_dbus_up() has not
30325  * been called yet, %NULL is returned. This can be used with
30326  * g_dbus_connection_new_for_address()
30327  *
30328  * Returns: the address of the bus, or %NULL.
30329  */
30330
30331
30332 /**
30333  * g_test_dbus_get_flags:
30334  * @self: a #GTestDBus
30335  *
30336  *
30337  *
30338  * Returns: the value of #GTestDBus:flags property
30339  */
30340
30341
30342 /**
30343  * g_test_dbus_new:
30344  * @flags: a #GTestDBusFlags
30345  *
30346  * Create a new #GTestDBus object.
30347  *
30348  * Returns: (transfer full): a new #GTestDBus.
30349  */
30350
30351
30352 /**
30353  * g_test_dbus_stop:
30354  * @self: a #GTestDBus
30355  *
30356  * Stop the session bus started by g_test_dbus_up().
30357  *
30358  * Unlike g_test_dbus_down(), this won't verify the #GDBusConnection
30359  * singleton returned by g_bus_get() or g_bus_get_sync() is destroyed. Unit
30360  * tests wanting to verify behaviour after the session bus has been stopped
30361  * can use this function but should still call g_test_dbus_down() when done.
30362  */
30363
30364
30365 /**
30366  * g_test_dbus_unset:
30367  *
30368  * Unset DISPLAY and DBUS_SESSION_BUS_ADDRESS env variables to ensure the test
30369  * won't use user's session bus.
30370  *
30371  * This is useful for unit tests that want to verify behaviour when no session
30372  * bus is running. It is not necessary to call this if unit test already calls
30373  * g_test_dbus_up() before acquiring the session bus.
30374  */
30375
30376
30377 /**
30378  * g_test_dbus_up:
30379  * @self: a #GTestDBus
30380  *
30381  * Start a dbus-daemon instance and set DBUS_SESSION_BUS_ADDRESS. After this
30382  * call, it is safe for unit tests to start sending messages on the session bug.
30383  *
30384  * If this function is called from setup callback of g_test_add(),
30385  * g_test_dbus_down() must be called in its teardown callback.
30386  *
30387  * If this function is called from unit test's main(), then g_test_dbus_down()
30388  * must be called after g_test_run().
30389  */
30390
30391
30392 /**
30393  * g_themed_icon_append_name:
30394  * @icon: a #GThemedIcon
30395  * @iconname: name of icon to append to list of icons from within @icon.
30396  *
30397  * Append a name to the list of icons from within @icon.
30398  *
30399  * <note><para>
30400  * Note that doing so invalidates the hash computed by prior calls
30401  * to g_icon_hash().
30402  * </para></note>
30403  */
30404
30405
30406 /**
30407  * g_themed_icon_get_names:
30408  * @icon: a #GThemedIcon.
30409  *
30410  * Gets the names of icons from within @icon.
30411  *
30412  * Returns: (transfer none): a list of icon names.
30413  */
30414
30415
30416 /**
30417  * g_themed_icon_new:
30418  * @iconname: a string containing an icon name.
30419  *
30420  * Creates a new themed icon for @iconname.
30421  *
30422  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
30423  */
30424
30425
30426 /**
30427  * g_themed_icon_new_from_names:
30428  * @iconnames: (array length=len): an array of strings containing icon names.
30429  * @len: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
30430  *
30431  * Creates a new themed icon for @iconnames.
30432  *
30433  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon
30434  */
30435
30436
30437 /**
30438  * g_themed_icon_new_with_default_fallbacks:
30439  * @iconname: a string containing an icon name
30440  *
30441  * Creates a new themed icon for @iconname, and all the names
30442  * that can be created by shortening @iconname at '-' characters.
30443  *
30444  * In the following example, @icon1 and @icon2 are equivalent:
30445  * |[
30446  * const char *names[] = {
30447  *   "gnome-dev-cdrom-audio",
30448  *   "gnome-dev-cdrom",
30449  *   "gnome-dev",
30450  *   "gnome"
30451  * };
30452  *
30453  * icon1 = g_themed_icon_new_from_names (names, 4);
30454  * icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
30455  * ]|
30456  *
30457  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
30458  */
30459
30460
30461 /**
30462  * g_themed_icon_prepend_name:
30463  * @icon: a #GThemedIcon
30464  * @iconname: name of icon to prepend to list of icons from within @icon.
30465  *
30466  * Prepend a name to the list of icons from within @icon.
30467  *
30468  * <note><para>
30469  * Note that doing so invalidates the hash computed by prior calls
30470  * to g_icon_hash().
30471  * </para></note>
30472  *
30473  * Since: 2.18
30474  */
30475
30476
30477 /**
30478  * g_threaded_socket_service_new:
30479  * @max_threads: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
30480  *
30481  * Creates a new #GThreadedSocketService with no listeners. Listeners
30482  * must be added with one of the #GSocketListener "add" methods.
30483  *
30484  * Returns: a new #GSocketService.
30485  * Since: 2.22
30486  */
30487
30488
30489 /**
30490  * g_tls_backend_get_certificate_type:
30491  * @backend: the #GTlsBackend
30492  *
30493  * Gets the #GType of @backend's #GTlsCertificate implementation.
30494  *
30495  * Returns: the #GType of @backend's #GTlsCertificate implementation.
30496  * Since: 2.28
30497  */
30498
30499
30500 /**
30501  * g_tls_backend_get_client_connection_type:
30502  * @backend: the #GTlsBackend
30503  *
30504  * Gets the #GType of @backend's #GTlsClientConnection implementation.
30505  *
30506  * Returns: the #GType of @backend's #GTlsClientConnection implementation.
30507  * Since: 2.28
30508  */
30509
30510
30511 /**
30512  * g_tls_backend_get_default:
30513  *
30514  * Gets the default #GTlsBackend for the system.
30515  *
30516  * Returns: (transfer none): a #GTlsBackend
30517  * Since: 2.28
30518  */
30519
30520
30521 /**
30522  * g_tls_backend_get_default_database:
30523  * @backend: the #GTlsBackend
30524  *
30525  * Gets the default #GTlsDatabase used to verify TLS connections.
30526  *
30527  * Returns: (transfer full): the default database, which should be unreffed when done.
30528  * Since: 2.30
30529  */
30530
30531
30532 /**
30533  * g_tls_backend_get_file_database_type:
30534  * @backend: the #GTlsBackend
30535  *
30536  * Gets the #GType of @backend's #GTlsFileDatabase implementation.
30537  *
30538  * Returns: the #GType of backend's #GTlsFileDatabase implementation.
30539  * Since: 2.30
30540  */
30541
30542
30543 /**
30544  * g_tls_backend_get_server_connection_type:
30545  * @backend: the #GTlsBackend
30546  *
30547  * Gets the #GType of @backend's #GTlsServerConnection implementation.
30548  *
30549  * Returns: the #GType of @backend's #GTlsServerConnection implementation.
30550  * Since: 2.28
30551  */
30552
30553
30554 /**
30555  * g_tls_backend_supports_tls:
30556  * @backend: the #GTlsBackend
30557  *
30558  * Checks if TLS is supported; if this returns %FALSE for the default
30559  * #GTlsBackend, it means no "real" TLS backend is available.
30560  *
30561  * Returns: whether or not TLS is supported
30562  * Since: 2.28
30563  */
30564
30565
30566 /**
30567  * g_tls_certificate_get_issuer:
30568  * @cert: a #GTlsCertificate
30569  *
30570  * Gets the #GTlsCertificate representing @cert's issuer, if known
30571  *
30572  * Returns: (transfer none): The certificate of @cert's issuer, or %NULL if @cert is self-signed or signed with an unknown certificate.
30573  * Since: 2.28
30574  */
30575
30576
30577 /**
30578  * g_tls_certificate_is_same:
30579  * @cert_one: first certificate to compare
30580  * @cert_two: second certificate to compare
30581  *
30582  * Check if two #GTlsCertificate objects represent the same certificate.
30583  * The raw DER byte data of the two certificates are checked for equality.
30584  * This has the effect that two certificates may compare equal even if
30585  * their #GTlsCertificate:issuer, #GTlsCertificate:private-key, or
30586  * #GTlsCertificate:private-key-pem properties differ.
30587  *
30588  * Returns: whether the same or not
30589  * Since: 2.34
30590  */
30591
30592
30593 /**
30594  * g_tls_certificate_list_new_from_file:
30595  * @file: file containing PEM-encoded certificates to import
30596  * @error: #GError for error reporting, or %NULL to ignore.
30597  *
30598  * Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
30599  * data in @file. If @file cannot be read or parsed, the function will
30600  * return %NULL and set @error. If @file does not contain any
30601  * PEM-encoded certificates, this will return an empty list and not
30602  * set @error.
30603  *
30604  * 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.
30605  * Since: 2.28
30606  */
30607
30608
30609 /**
30610  * g_tls_certificate_new_from_file:
30611  * @file: file containing a PEM-encoded certificate to import
30612  * @error: #GError for error reporting, or %NULL to ignore.
30613  *
30614  * Creates a #GTlsCertificate from the PEM-encoded data in @file. If
30615  * @file cannot be read or parsed, the function will return %NULL and
30616  * set @error. Otherwise, this behaves like
30617  * g_tls_certificate_new_from_pem().
30618  *
30619  * Returns: the new certificate, or %NULL on error
30620  * Since: 2.28
30621  */
30622
30623
30624 /**
30625  * g_tls_certificate_new_from_files:
30626  * @cert_file: file containing a PEM-encoded certificate to import
30627  * @key_file: file containing a PEM-encoded private key to import
30628  * @error: #GError for error reporting, or %NULL to ignore.
30629  *
30630  * Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
30631  * and @key_file. If either file cannot be read or parsed, the
30632  * function will return %NULL and set @error. Otherwise, this behaves
30633  * like g_tls_certificate_new_from_pem().
30634  *
30635  * Returns: the new certificate, or %NULL on error
30636  * Since: 2.28
30637  */
30638
30639
30640 /**
30641  * g_tls_certificate_new_from_pem:
30642  * @data: PEM-encoded certificate data
30643  * @length: the length of @data, or -1 if it's 0-terminated.
30644  * @error: #GError for error reporting, or %NULL to ignore.
30645  *
30646  * Creates a new #GTlsCertificate from the PEM-encoded data in @data.
30647  * If @data includes both a certificate and a private key, then the
30648  * returned certificate will include the private key data as well. (See
30649  * the #GTlsCertificate:private-key-pem property for information about
30650  * supported formats.)
30651  *
30652  * If @data includes multiple certificates, only the first one will be
30653  * parsed.
30654  *
30655  * Returns: the new certificate, or %NULL if @data is invalid
30656  * Since: 2.28
30657  */
30658
30659
30660 /**
30661  * g_tls_certificate_verify:
30662  * @cert: a #GTlsCertificate
30663  * @identity: (allow-none): the expected peer identity
30664  * @trusted_ca: (allow-none): the certificate of a trusted authority
30665  *
30666  * This verifies @cert and returns a set of #GTlsCertificateFlags
30667  * indicating any problems found with it. This can be used to verify a
30668  * certificate outside the context of making a connection, or to
30669  * check a certificate against a CA that is not part of the system
30670  * CA database.
30671  *
30672  * If @identity is not %NULL, @cert's name(s) will be compared against
30673  * it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
30674  * value if it does not match. If @identity is %NULL, that bit will
30675  * never be set in the return value.
30676  *
30677  * If @trusted_ca is not %NULL, then @cert (or one of the certificates
30678  * in its chain) must be signed by it, or else
30679  * %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
30680  * @trusted_ca is %NULL, that bit will never be set in the return
30681  * value.
30682  *
30683  * (All other #GTlsCertificateFlags values will always be set or unset
30684  * as appropriate.)
30685  *
30686  * Returns: the appropriate #GTlsCertificateFlags
30687  * Since: 2.28
30688  */
30689
30690
30691 /**
30692  * g_tls_client_connection_get_accepted_cas:
30693  * @conn: the #GTlsClientConnection
30694  *
30695  * Gets the list of distinguished names of the Certificate Authorities
30696  * that the server will accept certificates from. This will be set
30697  * during the TLS handshake if the server requests a certificate.
30698  * Otherwise, it will be %NULL.
30699  *
30700  * Each item in the list is a #GByteArray which contains the complete
30701  * subject DN of the certificate authority.
30702  *
30703  * 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().
30704  * Since: 2.28
30705  */
30706
30707
30708 /**
30709  * g_tls_client_connection_get_server_identity:
30710  * @conn: the #GTlsClientConnection
30711  *
30712  * Gets @conn's expected server identity
30713  *
30714  * Returns: (transfer none): a #GSocketConnectable describing the expected server identity, or %NULL if the expected identity is not known.
30715  * Since: 2.28
30716  */
30717
30718
30719 /**
30720  * g_tls_client_connection_get_use_ssl3:
30721  * @conn: the #GTlsClientConnection
30722  *
30723  * Gets whether @conn will use SSL 3.0 rather than the
30724  * highest-supported version of TLS; see
30725  * g_tls_client_connection_set_use_ssl3().
30726  *
30727  * Returns: whether @conn will use SSL 3.0
30728  * Since: 2.28
30729  */
30730
30731
30732 /**
30733  * g_tls_client_connection_get_validation_flags:
30734  * @conn: the #GTlsClientConnection
30735  *
30736  * Gets @conn's validation flags
30737  *
30738  * Returns: the validation flags
30739  * Since: 2.28
30740  */
30741
30742
30743 /**
30744  * g_tls_client_connection_new:
30745  * @base_io_stream: the #GIOStream to wrap
30746  * @server_identity: (allow-none): the expected identity of the server
30747  * @error: #GError for error reporting, or %NULL to ignore.
30748  *
30749  * Creates a new #GTlsClientConnection wrapping @base_io_stream (which
30750  * must have pollable input and output streams) which is assumed to
30751  * communicate with the server identified by @server_identity.
30752  *
30753  * Returns: (transfer full) (type GTlsClientConnection): the new #GTlsClientConnection, or %NULL on error
30754  * Since: 2.28
30755  */
30756
30757
30758 /**
30759  * g_tls_client_connection_set_server_identity:
30760  * @conn: the #GTlsClientConnection
30761  * @identity: a #GSocketConnectable describing the expected server identity
30762  *
30763  * Sets @conn's expected server identity, which is used both to tell
30764  * servers on virtual hosts which certificate to present, and also
30765  * to let @conn know what name to look for in the certificate when
30766  * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
30767  *
30768  * Since: 2.28
30769  */
30770
30771
30772 /**
30773  * g_tls_client_connection_set_use_ssl3:
30774  * @conn: the #GTlsClientConnection
30775  * @use_ssl3: whether to use SSL 3.0
30776  *
30777  * If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
30778  * trying to properly negotiate the right version of TLS or SSL to use.
30779  * This can be used when talking to servers that do not implement the
30780  * fallbacks correctly and which will therefore fail to handshake with
30781  * a "modern" TLS handshake attempt.
30782  *
30783  * Since: 2.28
30784  */
30785
30786
30787 /**
30788  * g_tls_client_connection_set_validation_flags:
30789  * @conn: the #GTlsClientConnection
30790  * @flags: the #GTlsCertificateFlags to use
30791  *
30792  * Sets @conn's validation flags, to override the default set of
30793  * checks performed when validating a server certificate. By default,
30794  * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
30795  *
30796  * Since: 2.28
30797  */
30798
30799
30800 /**
30801  * g_tls_connection_emit_accept_certificate:
30802  * @conn: a #GTlsConnection
30803  * @peer_cert: the peer's #GTlsCertificate
30804  * @errors: the problems with @peer_cert
30805  *
30806  * Used by #GTlsConnection implementations to emit the
30807  * #GTlsConnection::accept-certificate signal.
30808  *
30809  * Returns: %TRUE if one of the signal handlers has returned %TRUE to accept @peer_cert
30810  * Since: 2.28
30811  */
30812
30813
30814 /**
30815  * g_tls_connection_get_certificate:
30816  * @conn: a #GTlsConnection
30817  *
30818  * Gets @conn's certificate, as set by
30819  * g_tls_connection_set_certificate().
30820  *
30821  * Returns: (transfer none): @conn's certificate, or %NULL
30822  * Since: 2.28
30823  */
30824
30825
30826 /**
30827  * g_tls_connection_get_database:
30828  * @conn: a #GTlsConnection
30829  *
30830  * Gets the certificate database that @conn uses to verify
30831  * peer certificates. See g_tls_connection_set_database().
30832  *
30833  * Returns: (transfer none): the certificate database that @conn uses or %NULL
30834  * Since: 2.30
30835  */
30836
30837
30838 /**
30839  * g_tls_connection_get_interaction:
30840  * @conn: a connection
30841  *
30842  * Get the object that will be used to interact with the user. It will be used
30843  * for things like prompting the user for passwords. If %NULL is returned, then
30844  * no user interaction will occur for this connection.
30845  *
30846  * Returns: (transfer none): The interaction object.
30847  * Since: 2.30
30848  */
30849
30850
30851 /**
30852  * g_tls_connection_get_peer_certificate:
30853  * @conn: a #GTlsConnection
30854  *
30855  * Gets @conn's peer's certificate after the handshake has completed.
30856  * (It is not set during the emission of
30857  * #GTlsConnection::accept-certificate.)
30858  *
30859  * Returns: (transfer none): @conn's peer's certificate, or %NULL
30860  * Since: 2.28
30861  */
30862
30863
30864 /**
30865  * g_tls_connection_get_peer_certificate_errors:
30866  * @conn: a #GTlsConnection
30867  *
30868  * Gets the errors associated with validating @conn's peer's
30869  * certificate, after the handshake has completed. (It is not set
30870  * during the emission of #GTlsConnection::accept-certificate.)
30871  *
30872  * Returns: @conn's peer's certificate errors
30873  * Since: 2.28
30874  */
30875
30876
30877 /**
30878  * g_tls_connection_get_rehandshake_mode:
30879  * @conn: a #GTlsConnection
30880  *
30881  * Gets @conn rehandshaking mode. See
30882  * g_tls_connection_set_rehandshake_mode() for details.
30883  *
30884  * Returns: @conn's rehandshaking mode
30885  * Since: 2.28
30886  */
30887
30888
30889 /**
30890  * g_tls_connection_get_require_close_notify:
30891  * @conn: a #GTlsConnection
30892  *
30893  * Tests whether or not @conn expects a proper TLS close notification
30894  * when the connection is closed. See
30895  * g_tls_connection_set_require_close_notify() for details.
30896  *
30897  * Returns: %TRUE if @conn requires a proper TLS close notification.
30898  * Since: 2.28
30899  */
30900
30901
30902 /**
30903  * g_tls_connection_get_use_system_certdb:
30904  * @conn: a #GTlsConnection
30905  *
30906  * Gets whether @conn uses the system certificate database to verify
30907  * peer certificates. See g_tls_connection_set_use_system_certdb().
30908  *
30909  * Returns: whether @conn uses the system certificate database
30910  * Deprecated: 2.30: Use g_tls_connection_get_database() instead
30911  */
30912
30913
30914 /**
30915  * g_tls_connection_handshake:
30916  * @conn: a #GTlsConnection
30917  * @cancellable: (allow-none): a #GCancellable, or %NULL
30918  * @error: a #GError, or %NULL
30919  *
30920  * Attempts a TLS handshake on @conn.
30921  *
30922  * On the client side, it is never necessary to call this method;
30923  * although the connection needs to perform a handshake after
30924  * connecting (or after sending a "STARTTLS"-type command) and may
30925  * need to rehandshake later if the server requests it,
30926  * #GTlsConnection will handle this for you automatically when you try
30927  * to send or receive data on the connection. However, you can call
30928  * g_tls_connection_handshake() manually if you want to know for sure
30929  * whether the initial handshake succeeded or failed (as opposed to
30930  * just immediately trying to write to @conn's output stream, in which
30931  * case if it fails, it may not be possible to tell if it failed
30932  * before or after completing the handshake).
30933  *
30934  * Likewise, on the server side, although a handshake is necessary at
30935  * the beginning of the communication, you do not need to call this
30936  * function explicitly unless you want clearer error reporting.
30937  * However, you may call g_tls_connection_handshake() later on to
30938  * renegotiate parameters (encryption methods, etc) with the client.
30939  *
30940  * #GTlsConnection::accept_certificate may be emitted during the
30941  * handshake.
30942  *
30943  * Returns: success or failure
30944  * Since: 2.28
30945  */
30946
30947
30948 /**
30949  * g_tls_connection_handshake_async:
30950  * @conn: a #GTlsConnection
30951  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
30952  * @cancellable: (allow-none): a #GCancellable, or %NULL
30953  * @callback: callback to call when the handshake is complete
30954  * @user_data: the data to pass to the callback function
30955  *
30956  * Asynchronously performs a TLS handshake on @conn. See
30957  * g_tls_connection_handshake() for more information.
30958  *
30959  * Since: 2.28
30960  */
30961
30962
30963 /**
30964  * g_tls_connection_handshake_finish:
30965  * @conn: a #GTlsConnection
30966  * @result: a #GAsyncResult.
30967  * @error: a #GError pointer, or %NULL
30968  *
30969  * Finish an asynchronous TLS handshake operation. See
30970  * g_tls_connection_handshake() for more information.
30971  *
30972  * Returns: %TRUE on success, %FALSE on failure, in which case @error will be set.
30973  * Since: 2.28
30974  */
30975
30976
30977 /**
30978  * g_tls_connection_set_certificate:
30979  * @conn: a #GTlsConnection
30980  * @certificate: the certificate to use for @conn
30981  *
30982  * This sets the certificate that @conn will present to its peer
30983  * during the TLS handshake. For a #GTlsServerConnection, it is
30984  * mandatory to set this, and that will normally be done at construct
30985  * time.
30986  *
30987  * For a #GTlsClientConnection, this is optional. If a handshake fails
30988  * with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
30989  * requires a certificate, and if you try connecting again, you should
30990  * call this method first. You can call
30991  * g_tls_client_connection_get_accepted_cas() on the failed connection
30992  * to get a list of Certificate Authorities that the server will
30993  * accept certificates from.
30994  *
30995  * (It is also possible that a server will allow the connection with
30996  * or without a certificate; in that case, if you don't provide a
30997  * certificate, you can tell that the server requested one by the fact
30998  * that g_tls_client_connection_get_accepted_cas() will return
30999  * non-%NULL.)
31000  *
31001  * Since: 2.28
31002  */
31003
31004
31005 /**
31006  * g_tls_connection_set_database:
31007  * @conn: a #GTlsConnection
31008  * @database: a #GTlsDatabase
31009  *
31010  * Sets the certificate database that is used to verify peer certificates.
31011  * This is set to the default database by default. See
31012  * g_tls_backend_get_default_database(). If set to %NULL, then
31013  * peer certificate validation will always set the
31014  * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
31015  * #GTlsConnection::accept-certificate will always be emitted on
31016  * client-side connections, unless that bit is not set in
31017  * #GTlsClientConnection:validation-flags).
31018  *
31019  * Since: 2.30
31020  */
31021
31022
31023 /**
31024  * g_tls_connection_set_interaction:
31025  * @conn: a connection
31026  * @interaction: (allow-none): an interaction object, or %NULL
31027  *
31028  * Set the object that will be used to interact with the user. It will be used
31029  * for things like prompting the user for passwords.
31030  *
31031  * The @interaction argument will normally be a derived subclass of
31032  * #GTlsInteraction. %NULL can also be provided if no user interaction
31033  * should occur for this connection.
31034  *
31035  * Since: 2.30
31036  */
31037
31038
31039 /**
31040  * g_tls_connection_set_rehandshake_mode:
31041  * @conn: a #GTlsConnection
31042  * @mode: the rehandshaking mode
31043  *
31044  * Sets how @conn behaves with respect to rehandshaking requests.
31045  *
31046  * %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
31047  * rehandshake after the initial handshake is complete. (For a client,
31048  * this means it will refuse rehandshake requests from the server, and
31049  * for a server, this means it will close the connection with an error
31050  * if the client attempts to rehandshake.)
31051  *
31052  * %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
31053  * rehandshake only if the other end of the connection supports the
31054  * TLS <literal>renegotiation_info</literal> extension. This is the
31055  * default behavior, but means that rehandshaking will not work
31056  * against older implementations that do not support that extension.
31057  *
31058  * %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
31059  * rehandshaking even without the
31060  * <literal>renegotiation_info</literal> extension. On the server side
31061  * in particular, this is not recommended, since it leaves the server
31062  * open to certain attacks. However, this mode is necessary if you
31063  * need to allow renegotiation with older client software.
31064  *
31065  * Since: 2.28
31066  */
31067
31068
31069 /**
31070  * g_tls_connection_set_require_close_notify:
31071  * @conn: a #GTlsConnection
31072  * @require_close_notify: whether or not to require close notification
31073  *
31074  * Sets whether or not @conn expects a proper TLS close notification
31075  * before the connection is closed. If this is %TRUE (the default),
31076  * then @conn will expect to receive a TLS close notification from its
31077  * peer before the connection is closed, and will return a
31078  * %G_TLS_ERROR_EOF error if the connection is closed without proper
31079  * notification (since this may indicate a network error, or
31080  * man-in-the-middle attack).
31081  *
31082  * In some protocols, the application will know whether or not the
31083  * connection was closed cleanly based on application-level data
31084  * (because the application-level data includes a length field, or is
31085  * somehow self-delimiting); in this case, the close notify is
31086  * redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
31087  * in TLS 1.0 it is technically an error, but often done anyway.) You
31088  * can use g_tls_connection_set_require_close_notify() to tell @conn
31089  * to allow an "unannounced" connection close, in which case the close
31090  * will show up as a 0-length read, as in a non-TLS
31091  * #GSocketConnection, and it is up to the application to check that
31092  * the data has been fully received.
31093  *
31094  * Note that this only affects the behavior when the peer closes the
31095  * connection; when the application calls g_io_stream_close() itself
31096  * on @conn, this will send a close notification regardless of the
31097  * setting of this property. If you explicitly want to do an unclean
31098  * close, you can close @conn's #GTlsConnection:base-io-stream rather
31099  * than closing @conn itself.
31100  *
31101  * Since: 2.28
31102  */
31103
31104
31105 /**
31106  * g_tls_connection_set_use_system_certdb:
31107  * @conn: a #GTlsConnection
31108  * @use_system_certdb: whether to use the system certificate database
31109  *
31110  * Sets whether @conn uses the system certificate database to verify
31111  * peer certificates. This is %TRUE by default. If set to %FALSE, then
31112  * peer certificate validation will always set the
31113  * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
31114  * #GTlsConnection::accept-certificate will always be emitted on
31115  * client-side connections, unless that bit is not set in
31116  * #GTlsClientConnection:validation-flags).
31117  *
31118  * Deprecated: 2.30: Use g_tls_connection_set_database() instead
31119  */
31120
31121
31122 /**
31123  * g_tls_database_create_certificate_handle:
31124  * @self: a #GTlsDatabase
31125  * @certificate: certificate for which to create a handle.
31126  *
31127  * Create a handle string for the certificate. The database will only be able
31128  * to create a handle for certificates that originate from the database. In
31129  * cases where the database cannot create a handle for a certificate, %NULL
31130  * will be returned.
31131  *
31132  * This handle should be stable across various instances of the application,
31133  * and between applications. If a certificate is modified in the database,
31134  * then it is not guaranteed that this handle will continue to point to it.
31135  *
31136  * Returns: (allow-none): a newly allocated string containing the handle.
31137  * Since: 2.30
31138  */
31139
31140
31141 /**
31142  * g_tls_database_lookup_certificate_for_handle:
31143  * @self: a #GTlsDatabase
31144  * @handle: a certificate handle
31145  * @interaction: (allow-none): used to interact with the user if necessary
31146  * @flags: Flags which affect the lookup.
31147  * @cancellable: (allow-none): a #GCancellable, or %NULL
31148  * @error: (allow-none): a #GError, or %NULL
31149  *
31150  * Lookup a certificate by its handle.
31151  *
31152  * The handle should have been created by calling
31153  * g_tls_database_create_certificate_handle() on a #GTlsDatabase object of
31154  * the same TLS backend. The handle is designed to remain valid across
31155  * instantiations of the database.
31156  *
31157  * If the handle is no longer valid, or does not point to a certificate in
31158  * this database, then %NULL will be returned.
31159  *
31160  * This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
31161  * the lookup operation asynchronously.
31162  *
31163  * Returns: (transfer full) (allow-none): a newly allocated #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31164  * Since: 2.30
31165  */
31166
31167
31168 /**
31169  * g_tls_database_lookup_certificate_for_handle_async:
31170  * @self: a #GTlsDatabase
31171  * @handle: a certificate handle
31172  * @interaction: (allow-none): used to interact with the user if necessary
31173  * @flags: Flags which affect the lookup.
31174  * @cancellable: (allow-none): a #GCancellable, or %NULL
31175  * @callback: callback to call when the operation completes
31176  * @user_data: the data to pass to the callback function
31177  *
31178  * Asynchronously lookup a certificate by its handle in the database. See
31179  * g_tls_database_lookup_certificate_for_handle() for more information.
31180  *
31181  * Since: 2.30
31182  */
31183
31184
31185 /**
31186  * g_tls_database_lookup_certificate_for_handle_finish:
31187  * @self: a #GTlsDatabase
31188  * @result: a #GAsyncResult.
31189  * @error: a #GError pointer, or %NULL
31190  *
31191  * Finish an asynchronous lookup of a certificate by its handle. See
31192  * g_tls_database_lookup_certificate_handle() for more information.
31193  *
31194  * If the handle is no longer valid, or does not point to a certificate in
31195  * this database, then %NULL will be returned.
31196  *
31197  * Returns: (transfer full): a newly allocated #GTlsCertificate object. Use g_object_unref() to release the certificate.
31198  * Since: 2.30
31199  */
31200
31201
31202 /**
31203  * g_tls_database_lookup_certificate_issuer:
31204  * @self: a #GTlsDatabase
31205  * @certificate: a #GTlsCertificate
31206  * @interaction: (allow-none): used to interact with the user if necessary
31207  * @flags: flags which affect the lookup operation
31208  * @cancellable: (allow-none): a #GCancellable, or %NULL
31209  * @error: (allow-none): a #GError, or %NULL
31210  *
31211  * Lookup the issuer of @certificate in the database.
31212  *
31213  * The %issuer property
31214  * of @certificate is not modified, and the two certificates are not hooked
31215  * into a chain.
31216  *
31217  * This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
31218  * the lookup operation asynchronously.
31219  *
31220  * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31221  * Since: 2.30
31222  */
31223
31224
31225 /**
31226  * g_tls_database_lookup_certificate_issuer_async:
31227  * @self: a #GTlsDatabase
31228  * @certificate: a #GTlsCertificate
31229  * @interaction: (allow-none): used to interact with the user if necessary
31230  * @flags: flags which affect the lookup operation
31231  * @cancellable: (allow-none): a #GCancellable, or %NULL
31232  * @callback: callback to call when the operation completes
31233  * @user_data: the data to pass to the callback function
31234  *
31235  * Asynchronously lookup the issuer of @certificate in the database. See
31236  * g_tls_database_lookup_certificate_issuer() for more information.
31237  *
31238  * Since: 2.30
31239  */
31240
31241
31242 /**
31243  * g_tls_database_lookup_certificate_issuer_finish:
31244  * @self: a #GTlsDatabase
31245  * @result: a #GAsyncResult.
31246  * @error: a #GError pointer, or %NULL
31247  *
31248  * Finish an asynchronous lookup issuer operation. See
31249  * g_tls_database_lookup_certificate_issuer() for more information.
31250  *
31251  * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31252  * Since: 2.30
31253  */
31254
31255
31256 /**
31257  * g_tls_database_lookup_certificates_issued_by:
31258  * @self: a #GTlsDatabase
31259  * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
31260  * @interaction: (allow-none): used to interact with the user if necessary
31261  * @flags: Flags which affect the lookup operation.
31262  * @cancellable: (allow-none): a #GCancellable, or %NULL
31263  * @error: (allow-none): a #GError, or %NULL
31264  *
31265  * Lookup certificates issued by this issuer in the database.
31266  *
31267  * This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
31268  * the lookup operation asynchronously.
31269  *
31270  * 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.
31271  * Since: 2.30
31272  */
31273
31274
31275 /**
31276  * g_tls_database_lookup_certificates_issued_by_async:
31277  * @self: a #GTlsDatabase
31278  * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
31279  * @interaction: (allow-none): used to interact with the user if necessary
31280  * @flags: Flags which affect the lookup operation.
31281  * @cancellable: (allow-none): a #GCancellable, or %NULL
31282  * @callback: callback to call when the operation completes
31283  * @user_data: the data to pass to the callback function
31284  *
31285  * Asynchronously lookup certificates issued by this issuer in the database. See
31286  * g_tls_database_lookup_certificates_issued_by() for more information.
31287  *
31288  * The database may choose to hold a reference to the issuer byte array for the duration
31289  * of of this asynchronous operation. The byte array should not be modified during
31290  * this time.
31291  *
31292  * Since: 2.30
31293  */
31294
31295
31296 /**
31297  * g_tls_database_lookup_certificates_issued_by_finish:
31298  * @self: a #GTlsDatabase
31299  * @result: a #GAsyncResult.
31300  * @error: a #GError pointer, or %NULL
31301  *
31302  * Finish an asynchronous lookup of certificates. See
31303  * g_tls_database_lookup_certificates_issued_by() for more information.
31304  *
31305  * 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.
31306  * Since: 2.30
31307  */
31308
31309
31310 /**
31311  * g_tls_database_verify_chain:
31312  * @self: a #GTlsDatabase
31313  * @chain: a #GTlsCertificate chain
31314  * @purpose: the purpose that this certificate chain will be used for.
31315  * @identity: (allow-none): the expected peer identity
31316  * @interaction: (allow-none): used to interact with the user if necessary
31317  * @flags: additional verify flags
31318  * @cancellable: (allow-none): a #GCancellable, or %NULL
31319  * @error: (allow-none): a #GError, or %NULL
31320  *
31321  * Verify's a certificate chain after looking up and adding any missing
31322  * certificates to the chain.
31323  *
31324  * @chain is a chain of #GTlsCertificate objects each pointing to the next
31325  * certificate in the chain by its %issuer property. The chain may initially
31326  * consist of one or more certificates. After the verification process is
31327  * complete, @chain may be modified by adding missing certificates, or removing
31328  * extra certificates. If a certificate anchor was found, then it is added to
31329  * the @chain.
31330  *
31331  * @purpose describes the purpose (or usage) for which the certificate
31332  * is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
31333  * which means that the certificate is being used to authenticate a server
31334  * (and we are acting as the client).
31335  *
31336  * The @identity is used to check for pinned certificates (trust exceptions)
31337  * in the database. These will override the normal verification process on a
31338  * host by host basis.
31339  *
31340  * Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
31341  * used.
31342  *
31343  * This function can block, use g_tls_database_verify_chain_async() to perform
31344  * the verification operation asynchronously.
31345  *
31346  * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
31347  * Since: 2.30
31348  */
31349
31350
31351 /**
31352  * g_tls_database_verify_chain_async:
31353  * @self: a #GTlsDatabase
31354  * @chain: a #GTlsCertificate chain
31355  * @purpose: the purpose that this certificate chain will be used for.
31356  * @identity: (allow-none): the expected peer identity
31357  * @interaction: (allow-none): used to interact with the user if necessary
31358  * @flags: additional verify flags
31359  * @cancellable: (allow-none): a #GCancellable, or %NULL
31360  * @callback: callback to call when the operation completes
31361  * @user_data: the data to pass to the callback function
31362  *
31363  * Asynchronously verify's a certificate chain after looking up and adding
31364  * any missing certificates to the chain. See g_tls_database_verify_chain()
31365  * for more information.
31366  *
31367  * Since: 2.30
31368  */
31369
31370
31371 /**
31372  * g_tls_database_verify_chain_finish:
31373  * @self: a #GTlsDatabase
31374  * @result: a #GAsyncResult.
31375  * @error: a #GError pointer, or %NULL
31376  *
31377  * Finish an asynchronous verify chain operation. See
31378  * g_tls_database_verify_chain() for more information. *
31379  *
31380  * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
31381  * Since: 2.30
31382  */
31383
31384
31385 /**
31386  * g_tls_error_quark:
31387  *
31388  * Gets the TLS error quark.
31389  *
31390  * Returns: a #GQuark.
31391  * Since: 2.28
31392  */
31393
31394
31395 /**
31396  * g_tls_file_database_new:
31397  * @anchors: filename of anchor certificate authorities.
31398  * @error: #GError for error reporting, or %NULL to ignore.
31399  *
31400  * Creates a new #GTlsFileDatabase which uses anchor certificate authorities
31401  * in @anchors to verify certificate chains.
31402  *
31403  * The certificates in @anchors must be PEM encoded.
31404  *
31405  * Returns: (transfer full) (type GTlsFileDatabase): the new #GTlsFileDatabase, or %NULL on error
31406  * Since: 2.30
31407  */
31408
31409
31410 /**
31411  * g_tls_interaction_ask_password:
31412  * @interaction: a #GTlsInteraction object
31413  * @password: a #GTlsPassword object
31414  * @cancellable: an optional #GCancellable cancellation object
31415  * @error: an optional location to place an error on failure
31416  *
31417  * Run synchronous interaction to ask the user for a password. In general,
31418  * g_tls_interaction_invoke_ask_password() should be used instead of this
31419  * function.
31420  *
31421  * Derived subclasses usually implement a password prompt, although they may
31422  * also choose to provide a password from elsewhere. The @password value will
31423  * be filled in and then @callback will be called. Alternatively the user may
31424  * abort this password request, which will usually abort the TLS connection.
31425  *
31426  * If the interaction is cancelled by the cancellation object, or by the
31427  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31428  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31429  * not support immediate cancellation.
31430  *
31431  * Returns: The status of the ask password interaction.
31432  * Since: 2.30
31433  */
31434
31435
31436 /**
31437  * g_tls_interaction_ask_password_async:
31438  * @interaction: a #GTlsInteraction object
31439  * @password: a #GTlsPassword object
31440  * @cancellable: an optional #GCancellable cancellation object
31441  * @callback: (allow-none): will be called when the interaction completes
31442  * @user_data: (allow-none): data to pass to the @callback
31443  *
31444  * Run asynchronous interaction to ask the user for a password. In general,
31445  * g_tls_interaction_invoke_ask_password() should be used instead of this
31446  * function.
31447  *
31448  * Derived subclasses usually implement a password prompt, although they may
31449  * also choose to provide a password from elsewhere. The @password value will
31450  * be filled in and then @callback will be called. Alternatively the user may
31451  * abort this password request, which will usually abort the TLS connection.
31452  *
31453  * If the interaction is cancelled by the cancellation object, or by the
31454  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31455  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31456  * not support immediate cancellation.
31457  *
31458  * Certain implementations may not support immediate cancellation.
31459  *
31460  * Since: 2.30
31461  */
31462
31463
31464 /**
31465  * g_tls_interaction_ask_password_finish:
31466  * @interaction: a #GTlsInteraction object
31467  * @result: the result passed to the callback
31468  * @error: an optional location to place an error on failure
31469  *
31470  * Complete an ask password user interaction request. This should be once
31471  * the g_tls_interaction_ask_password_async() completion callback is called.
31472  *
31473  * If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
31474  * to g_tls_interaction_ask_password() will have its password filled in.
31475  *
31476  * If the interaction is cancelled by the cancellation object, or by the
31477  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31478  * contains a %G_IO_ERROR_CANCELLED error code.
31479  *
31480  * Returns: The status of the ask password interaction.
31481  * Since: 2.30
31482  */
31483
31484
31485 /**
31486  * g_tls_interaction_invoke_ask_password:
31487  * @interaction: a #GTlsInteraction object
31488  * @password: a #GTlsPassword object
31489  * @cancellable: an optional #GCancellable cancellation object
31490  * @error: an optional location to place an error on failure
31491  *
31492  * Invoke the interaction to ask the user for a password. It invokes this
31493  * interaction in the main loop, specifically the #GMainContext returned by
31494  * g_main_context_get_thread_default() when the interaction is created. This
31495  * is called by called by #GTlsConnection or #GTlsDatabase to ask the user
31496  * for a password.
31497  *
31498  * Derived subclasses usually implement a password prompt, although they may
31499  * also choose to provide a password from elsewhere. The @password value will
31500  * be filled in and then @callback will be called. Alternatively the user may
31501  * abort this password request, which will usually abort the TLS connection.
31502  *
31503  * The implementation can either be a synchronous (eg: modal dialog) or an
31504  * asynchronous one (eg: modeless dialog). This function will take care of
31505  * calling which ever one correctly.
31506  *
31507  * If the interaction is cancelled by the cancellation object, or by the
31508  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31509  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31510  * not support immediate cancellation.
31511  *
31512  * Returns: The status of the ask password interaction.
31513  * Since: 2.30
31514  */
31515
31516
31517 /**
31518  * g_tls_password_get_description:
31519  * @password: a #GTlsPassword object
31520  *
31521  * Get a description string about what the password will be used for.
31522  *
31523  * Returns: The description of the password.
31524  * Since: 2.30
31525  */
31526
31527
31528 /**
31529  * g_tls_password_get_flags:
31530  * @password: a #GTlsPassword object
31531  *
31532  * Get flags about the password.
31533  *
31534  * Returns: The flags about the password.
31535  * Since: 2.30
31536  */
31537
31538
31539 /**
31540  * g_tls_password_get_value:
31541  * @password: a #GTlsPassword object
31542  * @length: (allow-none): location to place the length of the password.
31543  *
31544  * Get the password value. If @length is not %NULL then it will be
31545  * filled in with the length of the password value. (Note that the
31546  * password value is not nul-terminated, so you can only pass %NULL
31547  * for @length in contexts where you know the password will have a
31548  * certain fixed length.)
31549  *
31550  * Returns: The password value (owned by the password object).
31551  * Since: 2.30
31552  */
31553
31554
31555 /**
31556  * g_tls_password_get_warning:
31557  * @password: a #GTlsPassword object
31558  *
31559  * Get a user readable translated warning. Usually this warning is a
31560  * representation of the password flags returned from
31561  * g_tls_password_get_flags().
31562  *
31563  * Returns: The warning.
31564  * Since: 2.30
31565  */
31566
31567
31568 /**
31569  * g_tls_password_new:
31570  * @flags: the password flags
31571  * @description: description of what the password is for
31572  *
31573  * Create a new #GTlsPassword object.
31574  *
31575  * Returns: (transfer full): The newly allocated password object
31576  */
31577
31578
31579 /**
31580  * g_tls_password_set_description:
31581  * @password: a #GTlsPassword object
31582  * @description: The description of the password
31583  *
31584  * Set a description string about what the password will be used for.
31585  *
31586  * Since: 2.30
31587  */
31588
31589
31590 /**
31591  * g_tls_password_set_flags:
31592  * @password: a #GTlsPassword object
31593  * @flags: The flags about the password
31594  *
31595  * Set flags about the password.
31596  *
31597  * Since: 2.30
31598  */
31599
31600
31601 /**
31602  * g_tls_password_set_value:
31603  * @password: a #GTlsPassword object
31604  * @value: the new password value
31605  * @length: the length of the password, or -1
31606  *
31607  * Set the value for this password. The @value will be copied by the password
31608  * object.
31609  *
31610  * Specify the @length, for a non-nul-terminated password. Pass -1 as
31611  * @length if using a nul-terminated password, and @length will be
31612  * calculated automatically. (Note that the terminating nul is not
31613  * considered part of the password in this case.)
31614  *
31615  * Since: 2.30
31616  */
31617
31618
31619 /**
31620  * g_tls_password_set_value_full:
31621  * @password: a #GTlsPassword object
31622  * @value: the value for the password
31623  * @length: the length of the password, or -1
31624  * @destroy: (allow-none): a function to use to free the password.
31625  *
31626  * Provide the value for this password.
31627  *
31628  * The @value will be owned by the password object, and later freed using
31629  * the @destroy function callback.
31630  *
31631  * Specify the @length, for a non-nul-terminated password. Pass -1 as
31632  * @length if using a nul-terminated password, and @length will be
31633  * calculated automatically. (Note that the terminating nul is not
31634  * considered part of the password in this case.)
31635  *
31636  * Virtual: set_value
31637  * Since: 2.30
31638  */
31639
31640
31641 /**
31642  * g_tls_password_set_warning:
31643  * @password: a #GTlsPassword object
31644  * @warning: The user readable warning
31645  *
31646  * Set a user readable translated warning. Usually this warning is a
31647  * representation of the password flags returned from
31648  * g_tls_password_get_flags().
31649  *
31650  * Since: 2.30
31651  */
31652
31653
31654 /**
31655  * g_tls_server_connection_new:
31656  * @base_io_stream: the #GIOStream to wrap
31657  * @certificate: (allow-none): the default server certificate, or %NULL
31658  * @error: #GError for error reporting, or %NULL to ignore.
31659  *
31660  * Creates a new #GTlsServerConnection wrapping @base_io_stream (which
31661  * must have pollable input and output streams).
31662  *
31663  * Returns: (transfer full) (type GTlsServerConnection): the new #GTlsServerConnection, or %NULL on error
31664  * Since: 2.28
31665  */
31666
31667
31668 /**
31669  * g_unix_connection_receive_credentials:
31670  * @connection: A #GUnixConnection.
31671  * @cancellable: (allow-none): A #GCancellable or %NULL.
31672  * @error: Return location for error or %NULL.
31673  *
31674  * Receives credentials from the sending end of the connection.  The
31675  * sending end has to call g_unix_connection_send_credentials() (or
31676  * similar) for this to work.
31677  *
31678  * As well as reading the credentials this also reads (and discards) a
31679  * single byte from the stream, as this is required for credentials
31680  * passing to work on some implementations.
31681  *
31682  * Other ways to exchange credentials with a foreign peer includes the
31683  * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
31684  *
31685  * Returns: (transfer full): Received credentials on success (free with g_object_unref()), %NULL if @error is set.
31686  * Since: 2.26
31687  */
31688
31689
31690 /**
31691  * g_unix_connection_receive_credentials_async:
31692  * @connection: A #GUnixConnection.
31693  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31694  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
31695  * @user_data: (closure): the data to pass to callback function
31696  *
31697  * Asynchronously receive credentials.
31698  *
31699  * For more details, see g_unix_connection_receive_credentials() which is
31700  * the synchronous version of this call.
31701  *
31702  * When the operation is finished, @callback will be called. You can then call
31703  * g_unix_connection_receive_credentials_finish() to get the result of the operation.
31704  *
31705  * Since: 2.32
31706  */
31707
31708
31709 /**
31710  * g_unix_connection_receive_credentials_finish:
31711  * @connection: A #GUnixConnection.
31712  * @result: a #GAsyncResult.
31713  * @error: a #GError, or %NULL
31714  *
31715  * Finishes an asynchronous receive credentials operation started with
31716  * g_unix_connection_receive_credentials_async().
31717  *
31718  * Returns: (transfer full): a #GCredentials, or %NULL on error. Free the returned object with g_object_unref().
31719  * Since: 2.32
31720  */
31721
31722
31723 /**
31724  * g_unix_connection_receive_fd:
31725  * @connection: a #GUnixConnection
31726  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
31727  * @error: (allow-none): #GError for error reporting, or %NULL to ignore
31728  *
31729  * Receives a file descriptor from the sending end of the connection.
31730  * The sending end has to call g_unix_connection_send_fd() for this
31731  * to work.
31732  *
31733  * As well as reading the fd this also reads a single byte from the
31734  * stream, as this is required for fd passing to work on some
31735  * implementations.
31736  *
31737  * Returns: a file descriptor on success, -1 on error.
31738  * Since: 2.22
31739  */
31740
31741
31742 /**
31743  * g_unix_connection_send_credentials:
31744  * @connection: A #GUnixConnection.
31745  * @cancellable: (allow-none): A #GCancellable or %NULL.
31746  * @error: Return location for error or %NULL.
31747  *
31748  * Passes the credentials of the current user the receiving side
31749  * of the connection. The receiving end has to call
31750  * g_unix_connection_receive_credentials() (or similar) to accept the
31751  * credentials.
31752  *
31753  * As well as sending the credentials this also writes a single NUL
31754  * byte to the stream, as this is required for credentials passing to
31755  * work on some implementations.
31756  *
31757  * Other ways to exchange credentials with a foreign peer includes the
31758  * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
31759  *
31760  * Returns: %TRUE on success, %FALSE if @error is set.
31761  * Since: 2.26
31762  */
31763
31764
31765 /**
31766  * g_unix_connection_send_credentials_async:
31767  * @connection: A #GUnixConnection.
31768  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31769  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
31770  * @user_data: (closure): the data to pass to callback function
31771  *
31772  * Asynchronously send credentials.
31773  *
31774  * For more details, see g_unix_connection_send_credentials() which is
31775  * the synchronous version of this call.
31776  *
31777  * When the operation is finished, @callback will be called. You can then call
31778  * g_unix_connection_send_credentials_finish() to get the result of the operation.
31779  *
31780  * Since: 2.32
31781  */
31782
31783
31784 /**
31785  * g_unix_connection_send_credentials_finish:
31786  * @connection: A #GUnixConnection.
31787  * @result: a #GAsyncResult.
31788  * @error: a #GError, or %NULL
31789  *
31790  * Finishes an asynchronous send credentials operation started with
31791  * g_unix_connection_send_credentials_async().
31792  *
31793  * Returns: %TRUE if the operation was successful, otherwise %FALSE.
31794  * Since: 2.32
31795  */
31796
31797
31798 /**
31799  * g_unix_connection_send_fd:
31800  * @connection: a #GUnixConnection
31801  * @fd: a file descriptor
31802  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31803  * @error: (allow-none): #GError for error reporting, or %NULL to ignore.
31804  *
31805  * Passes a file descriptor to the receiving side of the
31806  * connection. The receiving end has to call g_unix_connection_receive_fd()
31807  * to accept the file descriptor.
31808  *
31809  * As well as sending the fd this also writes a single byte to the
31810  * stream, as this is required for fd passing to work on some
31811  * implementations.
31812  *
31813  * Returns: a %TRUE on success, %NULL on error.
31814  * Since: 2.22
31815  */
31816
31817
31818 /**
31819  * g_unix_credentials_message_get_credentials:
31820  * @message: A #GUnixCredentialsMessage.
31821  *
31822  * Gets the credentials stored in @message.
31823  *
31824  * Returns: (transfer none): A #GCredentials instance. Do not free, it is owned by @message.
31825  * Since: 2.26
31826  */
31827
31828
31829 /**
31830  * g_unix_credentials_message_is_supported:
31831  *
31832  * Checks if passing #GCredentials on a #GSocket is supported on this platform.
31833  *
31834  * Returns: %TRUE if supported, %FALSE otherwise
31835  * Since: 2.26
31836  */
31837
31838
31839 /**
31840  * g_unix_credentials_message_new:
31841  *
31842  * Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
31843  *
31844  * Returns: a new #GUnixCredentialsMessage
31845  * Since: 2.26
31846  */
31847
31848
31849 /**
31850  * g_unix_credentials_message_new_with_credentials:
31851  * @credentials: A #GCredentials object.
31852  *
31853  * Creates a new #GUnixCredentialsMessage holding @credentials.
31854  *
31855  * Returns: a new #GUnixCredentialsMessage
31856  * Since: 2.26
31857  */
31858
31859
31860 /**
31861  * g_unix_fd_list_append:
31862  * @list: a #GUnixFDList
31863  * @fd: a valid open file descriptor
31864  * @error: a #GError pointer
31865  *
31866  * Adds a file descriptor to @list.
31867  *
31868  * The file descriptor is duplicated using dup(). You keep your copy
31869  * of the descriptor and the copy contained in @list will be closed
31870  * when @list is finalized.
31871  *
31872  * A possible cause of failure is exceeding the per-process or
31873  * system-wide file descriptor limit.
31874  *
31875  * The index of the file descriptor in the list is returned.  If you use
31876  * this index with g_unix_fd_list_get() then you will receive back a
31877  * duplicated copy of the same file descriptor.
31878  *
31879  * Returns: the index of the appended fd in case of success, else -1 (and @error is set)
31880  * Since: 2.24
31881  */
31882
31883
31884 /**
31885  * g_unix_fd_list_get:
31886  * @list: a #GUnixFDList
31887  * @index_: the index into the list
31888  * @error: a #GError pointer
31889  *
31890  * Gets a file descriptor out of @list.
31891  *
31892  * @index_ specifies the index of the file descriptor to get.  It is a
31893  * programmer error for @index_ to be out of range; see
31894  * g_unix_fd_list_get_length().
31895  *
31896  * The file descriptor is duplicated using dup() and set as
31897  * close-on-exec before being returned.  You must call close() on it
31898  * when you are done.
31899  *
31900  * A possible cause of failure is exceeding the per-process or
31901  * system-wide file descriptor limit.
31902  *
31903  * Returns: the file descriptor, or -1 in case of error
31904  * Since: 2.24
31905  */
31906
31907
31908 /**
31909  * g_unix_fd_list_get_length:
31910  * @list: a #GUnixFDList
31911  *
31912  * Gets the length of @list (ie: the number of file descriptors
31913  * contained within).
31914  *
31915  * Returns: the length of @list
31916  * Since: 2.24
31917  */
31918
31919
31920 /**
31921  * g_unix_fd_list_new:
31922  *
31923  * Creates a new #GUnixFDList containing no file descriptors.
31924  *
31925  * Returns: a new #GUnixFDList
31926  * Since: 2.24
31927  */
31928
31929
31930 /**
31931  * g_unix_fd_list_new_from_array:
31932  * @fds: (array length=n_fds): the initial list of file descriptors
31933  * @n_fds: the length of #fds, or -1
31934  *
31935  * Creates a new #GUnixFDList containing the file descriptors given in
31936  * @fds.  The file descriptors become the property of the new list and
31937  * may no longer be used by the caller.  The array itself is owned by
31938  * the caller.
31939  *
31940  * Each file descriptor in the array should be set to close-on-exec.
31941  *
31942  * If @n_fds is -1 then @fds must be terminated with -1.
31943  *
31944  * Returns: a new #GUnixFDList
31945  * Since: 2.24
31946  */
31947
31948
31949 /**
31950  * g_unix_fd_list_peek_fds:
31951  * @list: a #GUnixFDList
31952  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
31953  *
31954  * Returns the array of file descriptors that is contained in this
31955  * object.
31956  *
31957  * After this call, the descriptors remain the property of @list.  The
31958  * caller must not close them and must not free the array.  The array is
31959  * valid only until @list is changed in any way.
31960  *
31961  * If @length is non-%NULL then it is set to the number of file
31962  * descriptors in the returned array. The returned array is also
31963  * terminated with -1.
31964  *
31965  * This function never returns %NULL. In case there are no file
31966  * descriptors contained in @list, an empty array is returned.
31967  *
31968  * Returns: (array length=length) (transfer none): an array of file descriptors
31969  * Since: 2.24
31970  */
31971
31972
31973 /**
31974  * g_unix_fd_list_steal_fds:
31975  * @list: a #GUnixFDList
31976  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
31977  *
31978  * Returns the array of file descriptors that is contained in this
31979  * object.
31980  *
31981  * After this call, the descriptors are no longer contained in
31982  * @list. Further calls will return an empty list (unless more
31983  * descriptors have been added).
31984  *
31985  * The return result of this function must be freed with g_free().
31986  * The caller is also responsible for closing all of the file
31987  * descriptors.  The file descriptors in the array are set to
31988  * close-on-exec.
31989  *
31990  * If @length is non-%NULL then it is set to the number of file
31991  * descriptors in the returned array. The returned array is also
31992  * terminated with -1.
31993  *
31994  * This function never returns %NULL. In case there are no file
31995  * descriptors contained in @list, an empty array is returned.
31996  *
31997  * Returns: (array length=length) (transfer full): an array of file descriptors
31998  * Since: 2.24
31999  */
32000
32001
32002 /**
32003  * g_unix_fd_message_append_fd:
32004  * @message: a #GUnixFDMessage
32005  * @fd: a valid open file descriptor
32006  * @error: a #GError pointer
32007  *
32008  * Adds a file descriptor to @message.
32009  *
32010  * The file descriptor is duplicated using dup(). You keep your copy
32011  * of the descriptor and the copy contained in @message will be closed
32012  * when @message is finalized.
32013  *
32014  * A possible cause of failure is exceeding the per-process or
32015  * system-wide file descriptor limit.
32016  *
32017  * Returns: %TRUE in case of success, else %FALSE (and @error is set)
32018  * Since: 2.22
32019  */
32020
32021
32022 /**
32023  * g_unix_fd_message_get_fd_list:
32024  * @message: a #GUnixFDMessage
32025  *
32026  * Gets the #GUnixFDList contained in @message.  This function does not
32027  * return a reference to the caller, but the returned list is valid for
32028  * the lifetime of @message.
32029  *
32030  * Returns: (transfer none): the #GUnixFDList from @message
32031  * Since: 2.24
32032  */
32033
32034
32035 /**
32036  * g_unix_fd_message_new:
32037  *
32038  * Creates a new #GUnixFDMessage containing an empty file descriptor
32039  * list.
32040  *
32041  * Returns: a new #GUnixFDMessage
32042  * Since: 2.22
32043  */
32044
32045
32046 /**
32047  * g_unix_fd_message_new_with_fd_list:
32048  * @fd_list: a #GUnixFDList
32049  *
32050  * Creates a new #GUnixFDMessage containing @list.
32051  *
32052  * Returns: a new #GUnixFDMessage
32053  * Since: 2.24
32054  */
32055
32056
32057 /**
32058  * g_unix_fd_message_steal_fds:
32059  * @message: a #GUnixFDMessage
32060  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
32061  *
32062  * Returns the array of file descriptors that is contained in this
32063  * object.
32064  *
32065  * After this call, the descriptors are no longer contained in
32066  * @message. Further calls will return an empty list (unless more
32067  * descriptors have been added).
32068  *
32069  * The return result of this function must be freed with g_free().
32070  * The caller is also responsible for closing all of the file
32071  * descriptors.
32072  *
32073  * If @length is non-%NULL then it is set to the number of file
32074  * descriptors in the returned array. The returned array is also
32075  * terminated with -1.
32076  *
32077  * This function never returns %NULL. In case there are no file
32078  * descriptors contained in @message, an empty array is returned.
32079  *
32080  * Returns: (array length=length) (transfer full): an array of file descriptors
32081  * Since: 2.22
32082  */
32083
32084
32085 /**
32086  * g_unix_input_stream_get_close_fd:
32087  * @stream: a #GUnixInputStream
32088  *
32089  * Returns whether the file descriptor of @stream will be
32090  * closed when the stream is closed.
32091  *
32092  * Returns: %TRUE if the file descriptor is closed when done
32093  * Since: 2.20
32094  */
32095
32096
32097 /**
32098  * g_unix_input_stream_get_fd:
32099  * @stream: a #GUnixInputStream
32100  *
32101  * Return the UNIX file descriptor that the stream reads from.
32102  *
32103  * Returns: The file descriptor of @stream
32104  * Since: 2.20
32105  */
32106
32107
32108 /**
32109  * g_unix_input_stream_new:
32110  * @fd: a UNIX file descriptor
32111  * @close_fd: %TRUE to close the file descriptor when done
32112  *
32113  * Creates a new #GUnixInputStream for the given @fd.
32114  *
32115  * If @close_fd is %TRUE, the file descriptor will be closed
32116  * when the stream is closed.
32117  *
32118  * Returns: a new #GUnixInputStream
32119  */
32120
32121
32122 /**
32123  * g_unix_input_stream_set_close_fd:
32124  * @stream: a #GUnixInputStream
32125  * @close_fd: %TRUE to close the file descriptor when done
32126  *
32127  * Sets whether the file descriptor of @stream shall be closed
32128  * when the stream is closed.
32129  *
32130  * Since: 2.20
32131  */
32132
32133
32134 /**
32135  * g_unix_is_mount_path_system_internal:
32136  * @mount_path: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
32137  *
32138  * Determines if @mount_path is considered an implementation of the
32139  * OS. This is primarily used for hiding mountable and mounted volumes
32140  * that only are used in the OS and has little to no relevance to the
32141  * casual user.
32142  *
32143  * Returns: %TRUE if @mount_path is considered an implementation detail of the OS.
32144  */
32145
32146
32147 /**
32148  * g_unix_mount_at: (skip)
32149  * @mount_path: path for a possible unix mount.
32150  * @time_read: (out) (allow-none): guint64 to contain a timestamp.
32151  *
32152  * Gets a #GUnixMountEntry for a given mount path. If @time_read
32153  * is set, it will be filled with a unix timestamp for checking
32154  * if the mounts have changed since with g_unix_mounts_changed_since().
32155  *
32156  * Returns: (transfer full): a #GUnixMountEntry.
32157  */
32158
32159
32160 /**
32161  * g_unix_mount_compare:
32162  * @mount1: first #GUnixMountEntry to compare.
32163  * @mount2: second #GUnixMountEntry to compare.
32164  *
32165  * Compares two unix mounts.
32166  *
32167  * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
32168  */
32169
32170
32171 /**
32172  * g_unix_mount_free:
32173  * @mount_entry: a #GUnixMountEntry.
32174  *
32175  * Frees a unix mount.
32176  */
32177
32178
32179 /**
32180  * g_unix_mount_get_device_path:
32181  * @mount_entry: a #GUnixMount.
32182  *
32183  * Gets the device path for a unix mount.
32184  *
32185  * Returns: a string containing the device path.
32186  */
32187
32188
32189 /**
32190  * g_unix_mount_get_fs_type:
32191  * @mount_entry: a #GUnixMount.
32192  *
32193  * Gets the filesystem type for the unix mount.
32194  *
32195  * Returns: a string containing the file system type.
32196  */
32197
32198
32199 /**
32200  * g_unix_mount_get_mount_path:
32201  * @mount_entry: input #GUnixMountEntry to get the mount path for.
32202  *
32203  * Gets the mount path for a unix mount.
32204  *
32205  * Returns: the mount path for @mount_entry.
32206  */
32207
32208
32209 /**
32210  * g_unix_mount_guess_can_eject:
32211  * @mount_entry: a #GUnixMountEntry
32212  *
32213  * Guesses whether a Unix mount can be ejected.
32214  *
32215  * Returns: %TRUE if @mount_entry is deemed to be ejectable.
32216  */
32217
32218
32219 /**
32220  * g_unix_mount_guess_icon:
32221  * @mount_entry: a #GUnixMountEntry
32222  *
32223  * Guesses the icon of a Unix mount.
32224  *
32225  * Returns: (transfer full): a #GIcon
32226  */
32227
32228
32229 /**
32230  * g_unix_mount_guess_name:
32231  * @mount_entry: a #GUnixMountEntry
32232  *
32233  * Guesses the name of a Unix mount.
32234  * The result is a translated string.
32235  *
32236  * Returns: A newly allocated string that must be freed with g_free()
32237  */
32238
32239
32240 /**
32241  * g_unix_mount_guess_should_display:
32242  * @mount_entry: a #GUnixMountEntry
32243  *
32244  * Guesses whether a Unix mount should be displayed in the UI.
32245  *
32246  * Returns: %TRUE if @mount_entry is deemed to be displayable.
32247  */
32248
32249
32250 /**
32251  * g_unix_mount_guess_symbolic_icon:
32252  * @mount_entry: a #GUnixMountEntry
32253  *
32254  * Guesses the symbolic icon of a Unix mount.
32255  *
32256  * Returns: (transfer full): a #GIcon
32257  * Since: 2.34
32258  */
32259
32260
32261 /**
32262  * g_unix_mount_is_readonly:
32263  * @mount_entry: a #GUnixMount.
32264  *
32265  * Checks if a unix mount is mounted read only.
32266  *
32267  * Returns: %TRUE if @mount_entry is read only.
32268  */
32269
32270
32271 /**
32272  * g_unix_mount_is_system_internal:
32273  * @mount_entry: a #GUnixMount.
32274  *
32275  * Checks if a unix mount is a system path.
32276  *
32277  * Returns: %TRUE if the unix mount is for a system path.
32278  */
32279
32280
32281 /**
32282  * g_unix_mount_monitor_new:
32283  *
32284  * Gets a new #GUnixMountMonitor. The default rate limit for which the
32285  * monitor will report consecutive changes for the mount and mount
32286  * point entry files is the default for a #GFileMonitor. Use
32287  * g_unix_mount_monitor_set_rate_limit() to change this.
32288  *
32289  * Returns: a #GUnixMountMonitor.
32290  */
32291
32292
32293 /**
32294  * g_unix_mount_monitor_set_rate_limit:
32295  * @mount_monitor: a #GUnixMountMonitor
32296  * @limit_msec: a integer with the limit in milliseconds to poll for changes.
32297  *
32298  * Sets the rate limit to which the @mount_monitor will report
32299  * consecutive change events to the mount and mount point entry files.
32300  *
32301  * Since: 2.18
32302  */
32303
32304
32305 /**
32306  * g_unix_mount_point_compare:
32307  * @mount1: a #GUnixMount.
32308  * @mount2: a #GUnixMount.
32309  *
32310  * Compares two unix mount points.
32311  *
32312  * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
32313  */
32314
32315
32316 /**
32317  * g_unix_mount_point_free:
32318  * @mount_point: unix mount point to free.
32319  *
32320  * Frees a unix mount point.
32321  */
32322
32323
32324 /**
32325  * g_unix_mount_point_get_device_path:
32326  * @mount_point: a #GUnixMountPoint.
32327  *
32328  * Gets the device path for a unix mount point.
32329  *
32330  * Returns: a string containing the device path.
32331  */
32332
32333
32334 /**
32335  * g_unix_mount_point_get_fs_type:
32336  * @mount_point: a #GUnixMountPoint.
32337  *
32338  * Gets the file system type for the mount point.
32339  *
32340  * Returns: a string containing the file system type.
32341  */
32342
32343
32344 /**
32345  * g_unix_mount_point_get_mount_path:
32346  * @mount_point: a #GUnixMountPoint.
32347  *
32348  * Gets the mount path for a unix mount point.
32349  *
32350  * Returns: a string containing the mount path.
32351  */
32352
32353
32354 /**
32355  * g_unix_mount_point_get_options:
32356  * @mount_point: a #GUnixMountPoint.
32357  *
32358  * Gets the options for the mount point.
32359  *
32360  * Returns: a string containing the options.
32361  * Since: 2.32
32362  */
32363
32364
32365 /**
32366  * g_unix_mount_point_guess_can_eject:
32367  * @mount_point: a #GUnixMountPoint
32368  *
32369  * Guesses whether a Unix mount point can be ejected.
32370  *
32371  * Returns: %TRUE if @mount_point is deemed to be ejectable.
32372  */
32373
32374
32375 /**
32376  * g_unix_mount_point_guess_icon:
32377  * @mount_point: a #GUnixMountPoint
32378  *
32379  * Guesses the icon of a Unix mount point.
32380  *
32381  * Returns: (transfer full): a #GIcon
32382  */
32383
32384
32385 /**
32386  * g_unix_mount_point_guess_name:
32387  * @mount_point: a #GUnixMountPoint
32388  *
32389  * Guesses the name of a Unix mount point.
32390  * The result is a translated string.
32391  *
32392  * Returns: A newly allocated string that must be freed with g_free()
32393  */
32394
32395
32396 /**
32397  * g_unix_mount_point_guess_symbolic_icon:
32398  *
32399  * Guesses the symbolic icon of a Unix mount point.
32400  *
32401  * Returns: (transfer full): a #GIcon
32402  * Since: 2.34
32403  */
32404
32405
32406 /**
32407  * g_unix_mount_point_is_loopback:
32408  * @mount_point: a #GUnixMountPoint.
32409  *
32410  * Checks if a unix mount point is a loopback device.
32411  *
32412  * Returns: %TRUE if the mount point is a loopback. %FALSE otherwise.
32413  */
32414
32415
32416 /**
32417  * g_unix_mount_point_is_readonly:
32418  * @mount_point: a #GUnixMountPoint.
32419  *
32420  * Checks if a unix mount point is read only.
32421  *
32422  * Returns: %TRUE if a mount point is read only.
32423  */
32424
32425
32426 /**
32427  * g_unix_mount_point_is_user_mountable:
32428  * @mount_point: a #GUnixMountPoint.
32429  *
32430  * Checks if a unix mount point is mountable by the user.
32431  *
32432  * Returns: %TRUE if the mount point is user mountable.
32433  */
32434
32435
32436 /**
32437  * g_unix_mount_points_changed_since:
32438  * @time: guint64 to contain a timestamp.
32439  *
32440  * Checks if the unix mount points have changed since a given unix time.
32441  *
32442  * Returns: %TRUE if the mount points have changed since @time.
32443  */
32444
32445
32446 /**
32447  * g_unix_mount_points_get: (skip)
32448  * @time_read: (out) (allow-none): guint64 to contain a timestamp.
32449  *
32450  * Gets a #GList of #GUnixMountPoint containing the unix mount points.
32451  * If @time_read is set, it will be filled with the mount timestamp,
32452  * allowing for checking if the mounts have changed with
32453  * g_unix_mount_points_changed_since().
32454  *
32455  * Returns: (element-type GUnixMountPoint) (transfer full): a #GList of the UNIX mountpoints.
32456  */
32457
32458
32459 /**
32460  * g_unix_mounts_changed_since:
32461  * @time: guint64 to contain a timestamp.
32462  *
32463  * Checks if the unix mounts have changed since a given unix time.
32464  *
32465  * Returns: %TRUE if the mounts have changed since @time.
32466  */
32467
32468
32469 /**
32470  * g_unix_mounts_get: (skip)
32471  * @time_read: (out) (allow-none): guint64 to contain a timestamp, or %NULL
32472  *
32473  * Gets a #GList of #GUnixMountEntry containing the unix mounts.
32474  * If @time_read is set, it will be filled with the mount
32475  * timestamp, allowing for checking if the mounts have changed
32476  * with g_unix_mounts_changed_since().
32477  *
32478  * Returns: (element-type GUnixMountEntry) (transfer full): a #GList of the UNIX mounts.
32479  */
32480
32481
32482 /**
32483  * g_unix_output_stream_get_close_fd:
32484  * @stream: a #GUnixOutputStream
32485  *
32486  * Returns whether the file descriptor of @stream will be
32487  * closed when the stream is closed.
32488  *
32489  * Returns: %TRUE if the file descriptor is closed when done
32490  * Since: 2.20
32491  */
32492
32493
32494 /**
32495  * g_unix_output_stream_get_fd:
32496  * @stream: a #GUnixOutputStream
32497  *
32498  * Return the UNIX file descriptor that the stream writes to.
32499  *
32500  * Returns: The file descriptor of @stream
32501  * Since: 2.20
32502  */
32503
32504
32505 /**
32506  * g_unix_output_stream_new:
32507  * @fd: a UNIX file descriptor
32508  * @close_fd: %TRUE to close the file descriptor when done
32509  *
32510  * Creates a new #GUnixOutputStream for the given @fd.
32511  *
32512  * If @close_fd, is %TRUE, the file descriptor will be closed when
32513  * the output stream is destroyed.
32514  *
32515  * Returns: a new #GOutputStream
32516  */
32517
32518
32519 /**
32520  * g_unix_output_stream_set_close_fd:
32521  * @stream: a #GUnixOutputStream
32522  * @close_fd: %TRUE to close the file descriptor when done
32523  *
32524  * Sets whether the file descriptor of @stream shall be closed
32525  * when the stream is closed.
32526  *
32527  * Since: 2.20
32528  */
32529
32530
32531 /**
32532  * g_unix_socket_address_abstract_names_supported:
32533  *
32534  * Checks if abstract UNIX domain socket names are supported.
32535  *
32536  * Returns: %TRUE if supported, %FALSE otherwise
32537  * Since: 2.22
32538  */
32539
32540
32541 /**
32542  * g_unix_socket_address_get_address_type:
32543  * @address: a #GInetSocketAddress
32544  *
32545  * Gets @address's type.
32546  *
32547  * Returns: a #GUnixSocketAddressType
32548  * Since: 2.26
32549  */
32550
32551
32552 /**
32553  * g_unix_socket_address_get_is_abstract:
32554  * @address: a #GInetSocketAddress
32555  *
32556  * Tests if @address is abstract.
32557  *
32558  * Returns: %TRUE if the address is abstract, %FALSE otherwise
32559  * Since: 2.22
32560  * Deprecated: Use g_unix_socket_address_get_address_type()
32561  */
32562
32563
32564 /**
32565  * g_unix_socket_address_get_path:
32566  * @address: a #GInetSocketAddress
32567  *
32568  * Gets @address's path, or for abstract sockets the "name".
32569  *
32570  * Guaranteed to be zero-terminated, but an abstract socket
32571  * may contain embedded zeros, and thus you should use
32572  * g_unix_socket_address_get_path_len() to get the true length
32573  * of this string.
32574  *
32575  * Returns: the path for @address
32576  * Since: 2.22
32577  */
32578
32579
32580 /**
32581  * g_unix_socket_address_get_path_len:
32582  * @address: a #GInetSocketAddress
32583  *
32584  * Gets the length of @address's path.
32585  *
32586  * For details, see g_unix_socket_address_get_path().
32587  *
32588  * Returns: the length of the path
32589  * Since: 2.22
32590  */
32591
32592
32593 /**
32594  * g_unix_socket_address_new:
32595  * @path: the socket path
32596  *
32597  * Creates a new #GUnixSocketAddress for @path.
32598  *
32599  * To create abstract socket addresses, on systems that support that,
32600  * use g_unix_socket_address_new_abstract().
32601  *
32602  * Returns: a new #GUnixSocketAddress
32603  * Since: 2.22
32604  */
32605
32606
32607 /**
32608  * g_unix_socket_address_new_abstract:
32609  * @path: (array length=path_len) (element-type gchar): the abstract name
32610  * @path_len: the length of @path, or -1
32611  *
32612  * Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
32613  * #GUnixSocketAddress for @path.
32614  *
32615  * Returns: a new #GUnixSocketAddress
32616  * Deprecated: Use g_unix_socket_address_new_with_type().
32617  */
32618
32619
32620 /**
32621  * g_unix_socket_address_new_with_type:
32622  * @path: (array length=path_len) (element-type gchar): the name
32623  * @path_len: the length of @path, or -1
32624  * @type: a #GUnixSocketAddressType
32625  *
32626  * Creates a new #GUnixSocketAddress of type @type with name @path.
32627  *
32628  * If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
32629  * calling g_unix_socket_address_new().
32630  *
32631  * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
32632  * bytes of @path will be copied to the socket's path, and only those
32633  * bytes will be considered part of the name. (If @path_len is -1,
32634  * then @path is assumed to be NUL-terminated.) For example, if @path
32635  * was "test", then calling g_socket_address_get_native_size() on the
32636  * returned socket would return 7 (2 bytes of overhead, 1 byte for the
32637  * abstract-socket indicator byte, and 4 bytes for the name "test").
32638  *
32639  * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
32640  * @path_len bytes of @path will be copied to the socket's path, the
32641  * rest of the path will be padded with 0 bytes, and the entire
32642  * zero-padded buffer will be considered the name. (As above, if
32643  * @path_len is -1, then @path is assumed to be NUL-terminated.) In
32644  * this case, g_socket_address_get_native_size() will always return
32645  * the full size of a <literal>struct sockaddr_un</literal>, although
32646  * g_unix_socket_address_get_path_len() will still return just the
32647  * length of @path.
32648  *
32649  * %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
32650  * %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
32651  * when connecting to a server created by another process, you must
32652  * use the appropriate type corresponding to how that process created
32653  * its listening socket.
32654  *
32655  * Returns: a new #GUnixSocketAddress
32656  * Since: 2.26
32657  */
32658
32659
32660 /**
32661  * g_vfs_get_default:
32662  *
32663  * Gets the default #GVfs for the system.
32664  *
32665  * Returns: (transfer none): a #GVfs.
32666  */
32667
32668
32669 /**
32670  * g_vfs_get_file_for_path:
32671  * @vfs: a #GVfs.
32672  * @path: a string containing a VFS path.
32673  *
32674  * Gets a #GFile for @path.
32675  *
32676  * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
32677  */
32678
32679
32680 /**
32681  * g_vfs_get_file_for_uri:
32682  * @vfs: a#GVfs.
32683  * @uri: a string containing a URI
32684  *
32685  * Gets a #GFile for @uri.
32686  *
32687  * This operation never fails, but the returned object
32688  * might not support any I/O operation if the URI
32689  * is malformed or if the URI scheme is not supported.
32690  *
32691  * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
32692  */
32693
32694
32695 /**
32696  * g_vfs_get_local:
32697  *
32698  * Gets the local #GVfs for the system.
32699  *
32700  * Returns: (transfer none): a #GVfs.
32701  */
32702
32703
32704 /**
32705  * g_vfs_get_supported_uri_schemes:
32706  * @vfs: a #GVfs.
32707  *
32708  * Gets a list of URI schemes supported by @vfs.
32709  *
32710  * Returns: (transfer none): a %NULL-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
32711  */
32712
32713
32714 /**
32715  * g_vfs_is_active:
32716  * @vfs: a #GVfs.
32717  *
32718  * Checks if the VFS is active.
32719  *
32720  * Returns: %TRUE if construction of the @vfs was successful and it is now active.
32721  */
32722
32723
32724 /**
32725  * g_vfs_parse_name:
32726  * @vfs: a #GVfs.
32727  * @parse_name: a string to be parsed by the VFS module.
32728  *
32729  * This operation never fails, but the returned object might
32730  * not support any I/O operations if the @parse_name cannot
32731  * be parsed by the #GVfs module.
32732  *
32733  * Returns: (transfer full): a #GFile for the given @parse_name. Free the returned object with g_object_unref().
32734  */
32735
32736
32737 /**
32738  * g_volume_can_eject:
32739  * @volume: a #GVolume.
32740  *
32741  * Checks if a volume can be ejected.
32742  *
32743  * Returns: %TRUE if the @volume can be ejected. %FALSE otherwise.
32744  */
32745
32746
32747 /**
32748  * g_volume_can_mount:
32749  * @volume: a #GVolume.
32750  *
32751  * Checks if a volume can be mounted.
32752  *
32753  * Returns: %TRUE if the @volume can be mounted. %FALSE otherwise.
32754  */
32755
32756
32757 /**
32758  * g_volume_eject:
32759  * @volume: a #GVolume.
32760  * @flags: flags affecting the unmount if required for eject
32761  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32762  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32763  * @user_data: user data that gets passed to @callback
32764  *
32765  * Ejects a volume. This is an asynchronous operation, and is
32766  * finished by calling g_volume_eject_finish() with the @volume
32767  * and #GAsyncResult returned in the @callback.
32768  *
32769  * Deprecated: 2.22: Use g_volume_eject_with_operation() instead.
32770  */
32771
32772
32773 /**
32774  * g_volume_eject_finish:
32775  * @volume: pointer to a #GVolume.
32776  * @result: a #GAsyncResult.
32777  * @error: a #GError location to store an error, or %NULL to ignore
32778  *
32779  * Finishes ejecting a volume. If any errors occurred during the operation,
32780  * @error will be set to contain the errors and %FALSE will be returned.
32781  *
32782  * Returns: %TRUE, %FALSE if operation failed.
32783  * Deprecated: 2.22: Use g_volume_eject_with_operation_finish() instead.
32784  */
32785
32786
32787 /**
32788  * g_volume_eject_with_operation:
32789  * @volume: a #GVolume.
32790  * @flags: flags affecting the unmount if required for eject
32791  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
32792  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32793  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32794  * @user_data: user data passed to @callback.
32795  *
32796  * Ejects a volume. This is an asynchronous operation, and is
32797  * finished by calling g_volume_eject_with_operation_finish() with the @volume
32798  * and #GAsyncResult data returned in the @callback.
32799  *
32800  * Since: 2.22
32801  */
32802
32803
32804 /**
32805  * g_volume_eject_with_operation_finish:
32806  * @volume: a #GVolume.
32807  * @result: a #GAsyncResult.
32808  * @error: a #GError location to store the error occurring, or %NULL to ignore.
32809  *
32810  * Finishes ejecting a volume. If any errors occurred during the operation,
32811  * @error will be set to contain the errors and %FALSE will be returned.
32812  *
32813  * Returns: %TRUE if the volume was successfully ejected. %FALSE otherwise.
32814  * Since: 2.22
32815  */
32816
32817
32818 /**
32819  * g_volume_enumerate_identifiers:
32820  * @volume: a #GVolume
32821  *
32822  * Gets the kinds of <link linkend="volume-identifier">identifiers</link>
32823  * that @volume has. Use g_volume_get_identifier() to obtain
32824  * the identifiers themselves.
32825  *
32826  * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
32827  */
32828
32829
32830 /**
32831  * g_volume_get_activation_root:
32832  * @volume: a #GVolume
32833  *
32834  * Gets the activation root for a #GVolume if it is known ahead of
32835  * mount time. Returns %NULL otherwise. If not %NULL and if @volume
32836  * is mounted, then the result of g_mount_get_root() on the
32837  * #GMount object obtained from g_volume_get_mount() will always
32838  * either be equal or a prefix of what this function returns. In
32839  * other words, in code
32840  *
32841  * <programlisting>
32842  *   GMount *mount;
32843  *   GFile *mount_root
32844  *   GFile *volume_activation_root;
32845  *
32846  *   mount = g_volume_get_mount (volume); /&ast; mounted, so never NULL &ast;/
32847  *   mount_root = g_mount_get_root (mount);
32848  *   volume_activation_root = g_volume_get_activation_root(volume); /&ast; assume not NULL &ast;/
32849  * </programlisting>
32850  *
32851  * then the expression
32852  *
32853  * <programlisting>
32854  *   (g_file_has_prefix (volume_activation_root, mount_root) ||
32855  *       g_file_equal (volume_activation_root, mount_root))
32856  * </programlisting>
32857  *
32858  * will always be %TRUE.
32859  *
32860  * Activation roots are typically used in #GVolumeMonitor
32861  * implementations to find the underlying mount to shadow, see
32862  * g_mount_is_shadowed() for more details.
32863  *
32864  * Returns: (transfer full): the activation root of @volume or %NULL. Use g_object_unref() to free.
32865  * Since: 2.18
32866  */
32867
32868
32869 /**
32870  * g_volume_get_drive:
32871  * @volume: a #GVolume.
32872  *
32873  * Gets the drive for the @volume.
32874  *
32875  * 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.
32876  */
32877
32878
32879 /**
32880  * g_volume_get_icon:
32881  * @volume: a #GVolume.
32882  *
32883  * Gets the icon for @volume.
32884  *
32885  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
32886  */
32887
32888
32889 /**
32890  * g_volume_get_identifier:
32891  * @volume: a #GVolume
32892  * @kind: the kind of identifier to return
32893  *
32894  * Gets the identifier of the given kind for @volume.
32895  * See the <link linkend="volume-identifier">introduction</link>
32896  * for more information about volume identifiers.
32897  *
32898  * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GVolume doesn't have this kind of identifier
32899  */
32900
32901
32902 /**
32903  * g_volume_get_mount:
32904  * @volume: a #GVolume.
32905  *
32906  * Gets the mount for the @volume.
32907  *
32908  * 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.
32909  */
32910
32911
32912 /**
32913  * g_volume_get_name:
32914  * @volume: a #GVolume.
32915  *
32916  * Gets the name of @volume.
32917  *
32918  * Returns: the name for the given @volume. The returned string should be freed with g_free() when no longer needed.
32919  */
32920
32921
32922 /**
32923  * g_volume_get_sort_key:
32924  * @volume: A #GVolume.
32925  *
32926  * Gets the sort key for @volume, if any.
32927  *
32928  * Returns: Sorting key for @volume or %NULL if no such key is available.
32929  * Since: 2.32
32930  */
32931
32932
32933 /**
32934  * g_volume_get_symbolic_icon:
32935  * @volume: a #GVolume.
32936  *
32937  * Gets the symbolic icon for @volume.
32938  *
32939  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
32940  * Since: 2.34
32941  */
32942
32943
32944 /**
32945  * g_volume_get_uuid:
32946  * @volume: a #GVolume.
32947  *
32948  * Gets the UUID for the @volume. The reference is typically based on
32949  * the file system UUID for the volume in question and should be
32950  * considered an opaque string. Returns %NULL if there is no UUID
32951  * available.
32952  *
32953  * 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.
32954  */
32955
32956
32957 /**
32958  * g_volume_monitor_adopt_orphan_mount:
32959  * @mount: a #GMount object to find a parent for
32960  *
32961  * This function should be called by any #GVolumeMonitor
32962  * implementation when a new #GMount object is created that is not
32963  * associated with a #GVolume object. It must be called just before
32964  * emitting the @mount_added signal.
32965  *
32966  * If the return value is not %NULL, the caller must associate the
32967  * returned #GVolume object with the #GMount. This involves returning
32968  * it in its g_mount_get_volume() implementation. The caller must
32969  * also listen for the "removed" signal on the returned object
32970  * and give up its reference when handling that signal
32971  *
32972  * Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
32973  * the implementor must take a reference to @mount and return it in
32974  * its g_volume_get_mount() implemented. Also, the implementor must
32975  * listen for the "unmounted" signal on @mount and give up its
32976  * reference upon handling that signal.
32977  *
32978  * There are two main use cases for this function.
32979  *
32980  * One is when implementing a user space file system driver that reads
32981  * blocks of a block device that is already represented by the native
32982  * volume monitor (for example a CD Audio file system driver). Such
32983  * a driver will generate its own #GMount object that needs to be
32984  * associated with the #GVolume object that represents the volume.
32985  *
32986  * The other is for implementing a #GVolumeMonitor whose sole purpose
32987  * is to return #GVolume objects representing entries in the users
32988  * "favorite servers" list or similar.
32989  *
32990  * Returns: (transfer full): the #GVolume object that is the parent for @mount or %NULL if no wants to adopt the #GMount.
32991  * 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.
32992  */
32993
32994
32995 /**
32996  * g_volume_monitor_get:
32997  *
32998  * Gets the volume monitor used by gio.
32999  *
33000  * Returns: (transfer full): a reference to the #GVolumeMonitor used by gio. Call g_object_unref() when done with it.
33001  */
33002
33003
33004 /**
33005  * g_volume_monitor_get_connected_drives:
33006  * @volume_monitor: a #GVolumeMonitor.
33007  *
33008  * Gets a list of drives connected to the system.
33009  *
33010  * The returned list should be freed with g_list_free(), after
33011  * its elements have been unreffed with g_object_unref().
33012  *
33013  * Returns: (element-type GDrive) (transfer full): a #GList of connected #GDrive objects.
33014  */
33015
33016
33017 /**
33018  * g_volume_monitor_get_mount_for_uuid:
33019  * @volume_monitor: a #GVolumeMonitor.
33020  * @uuid: the UUID to look for
33021  *
33022  * Finds a #GMount object by its UUID (see g_mount_get_uuid())
33023  *
33024  * Returns: (transfer full): a #GMount or %NULL if no such mount is available. Free the returned object with g_object_unref().
33025  */
33026
33027
33028 /**
33029  * g_volume_monitor_get_mounts:
33030  * @volume_monitor: a #GVolumeMonitor.
33031  *
33032  * Gets a list of the mounts on the system.
33033  *
33034  * The returned list should be freed with g_list_free(), after
33035  * its elements have been unreffed with g_object_unref().
33036  *
33037  * Returns: (element-type GMount) (transfer full): a #GList of #GMount objects.
33038  */
33039
33040
33041 /**
33042  * g_volume_monitor_get_volume_for_uuid:
33043  * @volume_monitor: a #GVolumeMonitor.
33044  * @uuid: the UUID to look for
33045  *
33046  * Finds a #GVolume object by its UUID (see g_volume_get_uuid())
33047  *
33048  * Returns: (transfer full): a #GVolume or %NULL if no such volume is available. Free the returned object with g_object_unref().
33049  */
33050
33051
33052 /**
33053  * g_volume_monitor_get_volumes:
33054  * @volume_monitor: a #GVolumeMonitor.
33055  *
33056  * Gets a list of the volumes on the system.
33057  *
33058  * The returned list should be freed with g_list_free(), after
33059  * its elements have been unreffed with g_object_unref().
33060  *
33061  * Returns: (element-type GVolume) (transfer full): a #GList of #GVolume objects.
33062  */
33063
33064
33065 /**
33066  * g_volume_mount:
33067  * @volume: a #GVolume.
33068  * @flags: flags affecting the operation
33069  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
33070  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33071  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33072  * @user_data: user data that gets passed to @callback
33073  *
33074  * Mounts a volume. This is an asynchronous operation, and is
33075  * finished by calling g_volume_mount_finish() with the @volume
33076  * and #GAsyncResult returned in the @callback.
33077  *
33078  * Virtual: mount_fn
33079  */
33080
33081
33082 /**
33083  * g_volume_mount_finish:
33084  * @volume: a #GVolume
33085  * @result: a #GAsyncResult
33086  * @error: a #GError location to store an error, or %NULL to ignore
33087  *
33088  * Finishes mounting a volume. If any errors occurred during the operation,
33089  * @error will be set to contain the errors and %FALSE will be returned.
33090  *
33091  * If the mount operation succeeded, g_volume_get_mount() on @volume
33092  * is guaranteed to return the mount right after calling this
33093  * function; there's no need to listen for the 'mount-added' signal on
33094  * #GVolumeMonitor.
33095  *
33096  * Returns: %TRUE, %FALSE if operation failed.
33097  */
33098
33099
33100 /**
33101  * g_volume_should_automount:
33102  * @volume: a #GVolume
33103  *
33104  * Returns whether the volume should be automatically mounted.
33105  *
33106  * Returns: %TRUE if the volume should be automatically mounted.
33107  */
33108
33109
33110 /**
33111  * g_win32_input_stream_get_close_handle:
33112  * @stream: a #GWin32InputStream
33113  *
33114  * Returns whether the handle of @stream will be
33115  * closed when the stream is closed.
33116  *
33117  * Returns: %TRUE if the handle is closed when done
33118  * Since: 2.26
33119  */
33120
33121
33122 /**
33123  * g_win32_input_stream_get_handle:
33124  * @stream: a #GWin32InputStream
33125  *
33126  * Return the Windows file handle that the stream reads from.
33127  *
33128  * Returns: The file handle of @stream
33129  * Since: 2.26
33130  */
33131
33132
33133 /**
33134  * g_win32_input_stream_new:
33135  * @handle: a Win32 file handle
33136  * @close_handle: %TRUE to close the handle when done
33137  *
33138  * Creates a new #GWin32InputStream for the given @handle.
33139  *
33140  * If @close_handle is %TRUE, the handle will be closed
33141  * when the stream is closed.
33142  *
33143  * Note that "handle" here means a Win32 HANDLE, not a "file descriptor"
33144  * as used in the Windows C libraries.
33145  *
33146  * Returns: a new #GWin32InputStream
33147  */
33148
33149
33150 /**
33151  * g_win32_input_stream_set_close_handle:
33152  * @stream: a #GWin32InputStream
33153  * @close_handle: %TRUE to close the handle when done
33154  *
33155  * Sets whether the handle of @stream shall be closed
33156  * when the stream is closed.
33157  *
33158  * Since: 2.26
33159  */
33160
33161
33162 /**
33163  * g_win32_output_stream_get_close_handle:
33164  * @stream: a #GWin32OutputStream
33165  *
33166  * Returns whether the handle of @stream will be closed when the
33167  * stream is closed.
33168  *
33169  * Returns: %TRUE if the handle is closed when done
33170  * Since: 2.26
33171  */
33172
33173
33174 /**
33175  * g_win32_output_stream_get_handle:
33176  * @stream: a #GWin32OutputStream
33177  *
33178  * Return the Windows handle that the stream writes to.
33179  *
33180  * Returns: The handle descriptor of @stream
33181  * Since: 2.26
33182  */
33183
33184
33185 /**
33186  * g_win32_output_stream_new:
33187  * @handle: a Win32 file handle
33188  * @close_handle: %TRUE to close the handle when done
33189  *
33190  * Creates a new #GWin32OutputStream for the given @handle.
33191  *
33192  * If @close_handle, is %TRUE, the handle will be closed when the
33193  * output stream is destroyed.
33194  *
33195  * Returns: a new #GOutputStream
33196  * Since: 2.26
33197  */
33198
33199
33200 /**
33201  * g_win32_output_stream_set_close_handle:
33202  * @stream: a #GWin32OutputStream
33203  * @close_handle: %TRUE to close the handle when done
33204  *
33205  * Sets whether the handle of @stream shall be closed when the stream
33206  * is closed.
33207  *
33208  * Since: 2.26
33209  */
33210
33211
33212 /**
33213  * g_zlib_compressor_get_file_info:
33214  * @compressor: a #GZlibCompressor
33215  *
33216  * Returns the #GZlibCompressor:file-info property.
33217  *
33218  * Returns: (transfer none): a #GFileInfo, or %NULL
33219  * Since: 2.26
33220  */
33221
33222
33223 /**
33224  * g_zlib_compressor_new:
33225  * @format: The format to use for the compressed data
33226  * @level: compression level (0-9), -1 for default
33227  *
33228  * Creates a new #GZlibCompressor.
33229  *
33230  * Returns: a new #GZlibCompressor
33231  * Since: 2.24
33232  */
33233
33234
33235 /**
33236  * g_zlib_compressor_set_file_info:
33237  * @compressor: a #GZlibCompressor
33238  * @file_info: (allow-none): a #GFileInfo
33239  *
33240  * Sets @file_info in @compressor. If non-%NULL, and @compressor's
33241  * #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
33242  * it will be used to set the file name and modification time in
33243  * the GZIP header of the compressed data.
33244  *
33245  * Note: it is an error to call this function while a compression is in
33246  * progress; it may only be called immediately after creation of @compressor,
33247  * or after resetting it with g_converter_reset().
33248  *
33249  * Since: 2.26
33250  */
33251
33252
33253 /**
33254  * g_zlib_decompressor_get_file_info:
33255  * @decompressor: a #GZlibDecompressor
33256  *
33257  * Retrieves the #GFileInfo constructed from the GZIP header data
33258  * of compressed data processed by @compressor, or %NULL if @decompressor's
33259  * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
33260  * or the header data was not fully processed yet, or it not present in the
33261  * data stream at all.
33262  *
33263  * Returns: (transfer none): a #GFileInfo, or %NULL
33264  * Since: 2.26
33265  */
33266
33267
33268 /**
33269  * g_zlib_decompressor_new:
33270  * @format: The format to use for the compressed data
33271  *
33272  * Creates a new #GZlibDecompressor.
33273  *
33274  * Returns: a new #GZlibDecompressor
33275  * Since: 2.24
33276  */
33277
33278
33279 /**
33280  * get_all_desktop_entries_for_mime_type:
33281  * @mime_type: a mime type.
33282  * @except: NULL or a strv list
33283  *
33284  * Returns all the desktop ids for @mime_type. The desktop files
33285  * are listed in an order so that default applications are listed before
33286  * non-default ones, and handlers for inherited mimetypes are listed
33287  * after the base ones.
33288  *
33289  * Optionally doesn't list the desktop ids given in the @except
33290  *
33291  * Returns: a #GList containing the desktop ids which claim to handle @mime_type.
33292  */
33293
33294
33295 /**
33296  * mime_info_cache_reload:
33297  * @dir: directory path which needs reloading.
33298  *
33299  * Reload the mime information for the @dir.
33300  */
33301
33302
33303
33304 /************************************************************/
33305 /* THIS FILE IS GENERATED DO NOT EDIT */
33306 /************************************************************/