Imported Upstream version 1.35.9
[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  * GProxyAddressEnumerator:proxy-resolver:
1901  *
1902  * The proxy resolver to use.
1903  *
1904  * Since: 2.36
1905  */
1906
1907
1908 /**
1909  * GRemoteActionGroupInterface:
1910  * @activate_action_full: the virtual function pointer for g_remote_action_group_activate_action_full()
1911  * @change_action_state_full: the virtual function pointer for g_remote_action_group_change_action_state_full()
1912  *
1913  * The virtual function table for #GRemoteActionGroup.
1914  *
1915  * Since: 2.32
1916  */
1917
1918
1919 /**
1920  * GResolver:
1921  *
1922  * The object that handles DNS resolution. Use g_resolver_get_default()
1923  * to get the default resolver.
1924  */
1925
1926
1927 /**
1928  * GResolver::reload:
1929  * @resolver: a #GResolver
1930  *
1931  * Emitted when the resolver notices that the system resolver
1932  * configuration has changed.
1933  */
1934
1935
1936 /**
1937  * GSettings::change-event:
1938  * @settings: the object on which the signal was emitted
1939  * @keys: (array length=n_keys) (element-type GQuark) (allow-none): an array of #GQuark<!-- -->s for the changed keys, or %NULL
1940  * @n_keys: the length of the @keys array, or 0
1941  *
1942  * The "change-event" signal is emitted once per change event that
1943  * affects this settings object.  You should connect to this signal
1944  * only if you are interested in viewing groups of changes before they
1945  * are split out into multiple emissions of the "changed" signal.
1946  * For most use cases it is more appropriate to use the "changed" signal.
1947  *
1948  * In the event that the change event applies to one or more specified
1949  * keys, @keys will be an array of #GQuark of length @n_keys.  In the
1950  * event that the change event applies to the #GSettings object as a
1951  * whole (ie: potentially every key has been changed) then @keys will
1952  * be %NULL and @n_keys will be 0.
1953  *
1954  * The default handler for this signal invokes the "changed" signal
1955  * for each affected key.  If any other connected handler returns
1956  * %TRUE then this default functionality will be suppressed.
1957  *
1958  * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
1959  */
1960
1961
1962 /**
1963  * GSettings::changed:
1964  * @settings: the object on which the signal was emitted
1965  * @key: the name of the key that changed
1966  *
1967  * The "changed" signal is emitted when a key has potentially changed.
1968  * You should call one of the g_settings_get() calls to check the new
1969  * value.
1970  *
1971  * This signal supports detailed connections.  You can connect to the
1972  * detailed signal "changed::x" in order to only receive callbacks
1973  * when key "x" changes.
1974  */
1975
1976
1977 /**
1978  * GSettings::writable-change-event:
1979  * @settings: the object on which the signal was emitted
1980  * @key: the quark of the key, or 0
1981  *
1982  * The "writable-change-event" signal is emitted once per writability
1983  * change event that affects this settings object.  You should connect
1984  * to this signal if you are interested in viewing groups of changes
1985  * before they are split out into multiple emissions of the
1986  * "writable-changed" signal.  For most use cases it is more
1987  * appropriate to use the "writable-changed" signal.
1988  *
1989  * In the event that the writability change applies only to a single
1990  * key, @key will be set to the #GQuark for that key.  In the event
1991  * that the writability change affects the entire settings object,
1992  * @key will be 0.
1993  *
1994  * The default handler for this signal invokes the "writable-changed"
1995  * and "changed" signals for each affected key.  This is done because
1996  * changes in writability might also imply changes in value (if for
1997  * example, a new mandatory setting is introduced).  If any other
1998  * connected handler returns %TRUE then this default functionality
1999  * will be suppressed.
2000  *
2001  * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
2002  */
2003
2004
2005 /**
2006  * GSettings::writable-changed:
2007  * @settings: the object on which the signal was emitted
2008  * @key: the key
2009  *
2010  * The "writable-changed" signal is emitted when the writability of a
2011  * key has potentially changed.  You should call
2012  * g_settings_is_writable() in order to determine the new status.
2013  *
2014  * This signal supports detailed connections.  You can connect to the
2015  * detailed signal "writable-changed::x" in order to only receive
2016  * callbacks when the writability of "x" changes.
2017  */
2018
2019
2020 /**
2021  * GSettings:context:
2022  *
2023  * The name of the context that the settings are stored in.
2024  */
2025
2026
2027 /**
2028  * GSettings:delay-apply:
2029  *
2030  * Whether the #GSettings object is in 'delay-apply' mode. See
2031  * g_settings_delay() for details.
2032  *
2033  * Since: 2.28
2034  */
2035
2036
2037 /**
2038  * GSettings:has-unapplied:
2039  *
2040  * If this property is %TRUE, the #GSettings object has outstanding
2041  * changes that will be applied when g_settings_apply() is called.
2042  */
2043
2044
2045 /**
2046  * GSettings:path:
2047  *
2048  * The path within the backend where the settings are stored.
2049  */
2050
2051
2052 /**
2053  * GSettings:schema:
2054  *
2055  * The name of the schema that describes the types of keys
2056  * for this #GSettings object.
2057  *
2058  * The type of this property is *not* #GSettingsSchema.
2059  * #GSettingsSchema has only existed since version 2.32 and
2060  * unfortunately this name was used in previous versions to refer to
2061  * the schema ID rather than the schema itself.  Take care to use the
2062  * 'settings-schema' property if you wish to pass in a
2063  * #GSettingsSchema.
2064  *
2065  * Deprecated: 2.32:Use the 'schema-id' property instead.  In a future version, this property may instead refer to a #GSettingsSchema.
2066  */
2067
2068
2069 /**
2070  * GSettings:schema-id:
2071  *
2072  * The name of the schema that describes the types of keys
2073  * for this #GSettings object.
2074  */
2075
2076
2077 /**
2078  * GSettings:settings-schema:
2079  *
2080  * The #GSettingsSchema describing the types of keys for this
2081  * #GSettings object.
2082  *
2083  * Ideally, this property would be called 'schema'.  #GSettingsSchema
2084  * has only existed since version 2.32, however, and before then the
2085  * 'schema' property was used to refer to the ID of the schema rather
2086  * than the schema itself.  Take care.
2087  */
2088
2089
2090 /**
2091  * GSettingsSchema:
2092  *
2093  * This is an opaque structure type.  You may not access it directly.
2094  *
2095  * Since: 2.32
2096  */
2097
2098
2099 /**
2100  * GSettingsSchemaSource:
2101  *
2102  * This is an opaque structure type.  You may not access it directly.
2103  *
2104  * Since: 2.32
2105  */
2106
2107
2108 /**
2109  * GSimpleAction::activate:
2110  * @simple: the #GSimpleAction
2111  * @parameter: (allow-none): the parameter to the activation
2112  *
2113  * Indicates that the action was just activated.
2114  *
2115  * @parameter will always be of the expected type.  In the event that
2116  * an incorrect type was given, no signal will be emitted.
2117  *
2118  * Since: 2.28
2119  */
2120
2121
2122 /**
2123  * GSimpleAction::change-state:
2124  * @simple: the #GSimpleAction
2125  * @value: (allow-none): the requested value for the state
2126  *
2127  * Indicates that the action just received a request to change its
2128  * state.
2129  *
2130  * @value will always be of the correct state type.  In the event that
2131  * an incorrect type was given, no signal will be emitted.
2132  *
2133  * If no handler is connected to this signal then the default
2134  * behaviour is to call g_simple_action_set_state() to set the state
2135  * to the requested value.  If you connect a signal handler then no
2136  * default action is taken.  If the state should change then you must
2137  * call g_simple_action_set_state() from the handler.
2138  *
2139  * <example>
2140  * <title>Example 'change-state' handler</title>
2141  * <programlisting>
2142  * static void
2143  * change_volume_state (GSimpleAction *action,
2144  *                      GVariant      *value,
2145  *                      gpointer       user_data)
2146  * {
2147  *   gint requested;
2148  *
2149  *   requested = g_variant_get_int32 (value);
2150  *
2151  *   // Volume only goes from 0 to 10
2152  *   if (0 <= requested && requested <= 10)
2153  *     g_simple_action_set_state (action, value);
2154  * }
2155  * </programlisting>
2156  * </example>
2157  *
2158  * The handler need not set the state to the requested value.  It
2159  * could set it to any value at all, or take some other action.
2160  *
2161  * Since: 2.30
2162  */
2163
2164
2165 /**
2166  * GSimpleAction:enabled:
2167  *
2168  * If @action is currently enabled.
2169  *
2170  * If the action is disabled then calls to g_action_activate() and
2171  * g_action_change_state() have no effect.
2172  *
2173  * Since: 2.28
2174  */
2175
2176
2177 /**
2178  * GSimpleAction:name:
2179  *
2180  * The name of the action.  This is mostly meaningful for identifying
2181  * the action once it has been added to a #GSimpleActionGroup.
2182  *
2183  * Since: 2.28
2184  */
2185
2186
2187 /**
2188  * GSimpleAction:parameter-type:
2189  *
2190  * The type of the parameter that must be given when activating the
2191  * action.
2192  *
2193  * Since: 2.28
2194  */
2195
2196
2197 /**
2198  * GSimpleAction:state:
2199  *
2200  * The state of the action, or %NULL if the action is stateless.
2201  *
2202  * Since: 2.28
2203  */
2204
2205
2206 /**
2207  * GSimpleAction:state-type:
2208  *
2209  * The #GVariantType of the state that the action has, or %NULL if the
2210  * action is stateless.
2211  *
2212  * Since: 2.28
2213  */
2214
2215
2216 /**
2217  * GSimplePermission:
2218  *
2219  * #GSimplePermission is an opaque data structure.  There are no methods
2220  * except for those defined by #GPermission.
2221  */
2222
2223
2224 /**
2225  * GSimpleProxyResolver:default-proxy:
2226  *
2227  * The default proxy URI that will be used for any URI that doesn't
2228  * match #GSimpleProxyResolver:ignore-hosts, and doesn't match any
2229  * of the schemes set with g_simple_proxy_resolver_set_uri_proxy().
2230  *
2231  * Note that as a special case, if this URI starts with
2232  * "<literal>socks://</literal>", #GSimpleProxyResolver will treat
2233  * it as referring to all three of the <literal>socks5</literal>,
2234  * <literal>socks4a</literal>, and <literal>socks4</literal> proxy
2235  * types.
2236  */
2237
2238
2239 /**
2240  * GSimpleProxyResolver:ignore-hosts:
2241  *
2242  * A list of hostnames and IP addresses that the resolver should
2243  * allow direct connections to.
2244  *
2245  * Entries can be in one of 4 formats:
2246  *
2247  * <itemizedlist>
2248  *   <listitem>
2249  *     A hostname, such as "<literal>example.com</literal>",
2250  *     "<literal>.example.com</literal>", or
2251  *     "<literal>*.example.com</literal>", any of which match
2252  *     "<literal>example.com</literal>" or any subdomain of it.
2253  *   </listitem>
2254  *   <listitem>
2255  *     An IPv4 or IPv6 address, such as
2256  *     "<literal>192.168.1.1</literal>", which matches only
2257  *     that address.
2258  *   </listitem>
2259  *   <listitem>
2260  *     A hostname or IP address followed by a port, such as
2261  *     "<literal>example.com:80</literal>", which matches whatever
2262  *     the hostname or IP address would match, but only for URLs
2263  *     with the (explicitly) indicated port. In the case of an IPv6
2264  *     address, the address part must appear in brackets:
2265  *     "<literal>[::1]:443</literal>"
2266  *   </listitem>
2267  *   <listitem>
2268  *     An IP address range, given by a base address and prefix length,
2269  *     such as "<literal>fe80::/10</literal>", which matches any
2270  *     address in that range.
2271  *   </listitem>
2272  * </itemizedlist>
2273  *
2274  * Note that when dealing with Unicode hostnames, the matching is
2275  * done against the ASCII form of the name.
2276  *
2277  * Also note that hostname exclusions apply only to connections made
2278  * to hosts identified by name, and IP address exclusions apply only
2279  * to connections made to hosts identified by address. That is, if
2280  * <literal>example.com</literal> has an address of
2281  * <literal>192.168.1.1</literal>, and the :ignore-hosts list
2282  * contains only "<literal>192.168.1.1</literal>", then a connection
2283  * to "<literal>example.com</literal>" (eg, via a #GNetworkAddress)
2284  * will use the proxy, and a connection to
2285  * "<literal>192.168.1.1</literal>" (eg, via a #GInetSocketAddress)
2286  * will not.
2287  *
2288  * These rules match the "ignore-hosts"/"noproxy" rules most
2289  * commonly used by other applications.
2290  */
2291
2292
2293 /**
2294  * GSocket:broadcast:
2295  *
2296  * Whether the socket should allow sending to and receiving from broadcast addresses.
2297  *
2298  * Since: 2.32
2299  */
2300
2301
2302 /**
2303  * GSocket:multicast-loopback:
2304  *
2305  * Whether outgoing multicast packets loop back to the local host.
2306  *
2307  * Since: 2.32
2308  */
2309
2310
2311 /**
2312  * GSocket:multicast-ttl:
2313  *
2314  * Time-to-live out outgoing multicast packets
2315  *
2316  * Since: 2.32
2317  */
2318
2319
2320 /**
2321  * GSocket:timeout:
2322  *
2323  * The timeout in seconds on socket I/O
2324  *
2325  * Since: 2.26
2326  */
2327
2328
2329 /**
2330  * GSocket:ttl:
2331  *
2332  * Time-to-live for outgoing unicast packets
2333  *
2334  * Since: 2.32
2335  */
2336
2337
2338 /**
2339  * GSocketAddress:
2340  *
2341  * A socket endpoint address, corresponding to <type>struct sockaddr</type>
2342  * or one of its subtypes.
2343  */
2344
2345
2346 /**
2347  * GSocketClient::event:
2348  * @client: the #GSocketClient
2349  * @event: the event that is occurring
2350  * @connectable: the #GSocketConnectable that @event is occurring on
2351  * @connection: the current representation of the connection
2352  *
2353  * Emitted when @client's activity on @connectable changes state.
2354  * Among other things, this can be used to provide progress
2355  * information about a network connection in the UI. The meanings of
2356  * the different @event values are as follows:
2357  *
2358  * <variablelist>
2359  *   <varlistentry>
2360  *     <term>%G_SOCKET_CLIENT_RESOLVING:</term>
2361  *     <listitem><para>
2362  *       @client is about to look up @connectable in DNS.
2363  *       @connection will be %NULL.
2364  *     </para></listitem>
2365  *   </varlistentry>
2366  *   <varlistentry>
2367  *     <term>%G_SOCKET_CLIENT_RESOLVED:</term>
2368  *     <listitem><para>
2369  *       @client has successfully resolved @connectable in DNS.
2370  *       @connection will be %NULL.
2371  *     </para></listitem>
2372  *   </varlistentry>
2373  *   <varlistentry>
2374  *     <term>%G_SOCKET_CLIENT_CONNECTING:</term>
2375  *     <listitem><para>
2376  *       @client is about to make a connection to a remote host;
2377  *       either a proxy server or the destination server itself.
2378  *       @connection is the #GSocketConnection, which is not yet
2379  *       connected.
2380  *     </para></listitem>
2381  *   </varlistentry>
2382  *   <varlistentry>
2383  *     <term>%G_SOCKET_CLIENT_CONNECTED:</term>
2384  *     <listitem><para>
2385  *       @client has successfully connected to a remote host.
2386  *       @connection is the connected #GSocketConnection.
2387  *     </para></listitem>
2388  *   </varlistentry>
2389  *   <varlistentry>
2390  *     <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATING:</term>
2391  *     <listitem><para>
2392  *       @client is about to negotiate with a proxy to get it to
2393  *       connect to @connectable. @connection is the
2394  *       #GSocketConnection to the proxy server.
2395  *     </para></listitem>
2396  *   </varlistentry>
2397  *   <varlistentry>
2398  *     <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATED:</term>
2399  *     <listitem><para>
2400  *       @client has negotiated a connection to @connectable through
2401  *       a proxy server. @connection is the stream returned from
2402  *       g_proxy_connect(), which may or may not be a
2403  *       #GSocketConnection.
2404  *     </para></listitem>
2405  *   </varlistentry>
2406  *   <varlistentry>
2407  *     <term>%G_SOCKET_CLIENT_TLS_HANDSHAKING:</term>
2408  *     <listitem><para>
2409  *       @client is about to begin a TLS handshake. @connection is a
2410  *       #GTlsClientConnection.
2411  *     </para></listitem>
2412  *   </varlistentry>
2413  *   <varlistentry>
2414  *     <term>%G_SOCKET_CLIENT_TLS_HANDSHAKED:</term>
2415  *     <listitem><para>
2416  *       @client has successfully completed the TLS handshake.
2417  *       @connection is a #GTlsClientConnection.
2418  *     </para></listitem>
2419  *   </varlistentry>
2420  *   <varlistentry>
2421  *     <term>%G_SOCKET_CLIENT_COMPLETE:</term>
2422  *     <listitem><para>
2423  *       @client has either successfully connected to @connectable
2424  *       (in which case @connection is the #GSocketConnection that
2425  *       it will be returning to the caller) or has failed (in which
2426  *       case @connection is %NULL and the client is about to return
2427  *       an error).
2428  *     </para></listitem>
2429  *   </varlistentry>
2430  * </variablelist>
2431  *
2432  * Each event except %G_SOCKET_CLIENT_COMPLETE may be emitted
2433  * multiple times (or not at all) for a given connectable (in
2434  * particular, if @client ends up attempting to connect to more than
2435  * one address). However, if @client emits the #GSocketClient::event
2436  * signal at all for a given connectable, that it will always emit
2437  * it with %G_SOCKET_CLIENT_COMPLETE when it is done.
2438  *
2439  * Note that there may be additional #GSocketClientEvent values in
2440  * the future; unrecognized @event values should be ignored.
2441  *
2442  * Since: 2.32
2443  */
2444
2445
2446 /**
2447  * GSocketClient:proxy-resolver:
2448  *
2449  * The proxy resolver to use
2450  *
2451  * Since: 2.36
2452  */
2453
2454
2455 /**
2456  * GSocketService::incoming:
2457  * @service: the #GSocketService
2458  * @connection: a new #GSocketConnection object
2459  * @source_object: (allow-none): the source_object passed to g_socket_listener_add_address()
2460  *
2461  * The ::incoming signal is emitted when a new incoming connection
2462  * to @service needs to be handled. The handler must initiate the
2463  * handling of @connection, but may not block; in essence,
2464  * asynchronous operations must be used.
2465  *
2466  * @connection will be unreffed once the signal handler returns,
2467  * so you need to ref it yourself if you are planning to use it.
2468  *
2469  * Returns: %TRUE to stop other handlers from being called
2470  * Since: 2.22
2471  */
2472
2473
2474 /**
2475  * GSrvTarget:
2476  *
2477  * A single target host/port that a network service is running on.
2478  */
2479
2480
2481 /**
2482  * GTask:
2483  *
2484  * The opaque object representing a synchronous or asynchronous task
2485  * and its result.
2486  */
2487
2488
2489 /**
2490  * GTaskThreadFunc:
2491  * @task: the #GTask
2492  * @source_object: (type GObject): @task's source object
2493  * @task_data: @task's task data
2494  * @cancellable: @task's #GCancellable, or %NULL
2495  *
2496  * The prototype for a task function to be run in a thread via
2497  * g_task_run_in_thread() or g_task_run_in_thread_sync().
2498  *
2499  * If the return-on-cancel flag is set on @task, and @cancellable gets
2500  * cancelled, then the #GTask will be completed immediately (as though
2501  * g_task_return_error_if_cancelled() had been called), without
2502  * waiting for the task function to complete. However, the task
2503  * function will continue running in its thread in the background. The
2504  * function therefore needs to be careful about how it uses
2505  * externally-visible state in this case. See
2506  * g_task_set_return_on_cancel() for more details.
2507  *
2508  * Other than in that case, @task will be completed when the
2509  * #GTaskThreadFunc returns, <emphasis>not</emphasis> when it calls
2510  * a <literal>g_task_return_</literal> function.
2511  *
2512  * Since: 2.36
2513  */
2514
2515
2516 /**
2517  * GTestDBus:
2518  *
2519  * The #GTestDBus structure contains only private data and
2520  * should only be accessed using the provided API.
2521  *
2522  * Since: 2.34
2523  */
2524
2525
2526 /**
2527  * GTestDBus:flags:
2528  *
2529  * #GTestDBusFlags specifying the behaviour of the dbus session
2530  *
2531  * Since: 2.34
2532  */
2533
2534
2535 /**
2536  * GThemedIcon:name:
2537  *
2538  * The icon name.
2539  */
2540
2541
2542 /**
2543  * GThemedIcon:names:
2544  *
2545  * A %NULL-terminated array of icon names.
2546  */
2547
2548
2549 /**
2550  * GThemedIcon:use-default-fallbacks:
2551  *
2552  * Whether to use the default fallbacks found by shortening the icon name
2553  * at '-' characters. If the "names" array has more than one element,
2554  * ignores any past the first.
2555  *
2556  * For example, if the icon name was "gnome-dev-cdrom-audio", the array
2557  * would become
2558  * |[
2559  * {
2560  *   "gnome-dev-cdrom-audio",
2561  *   "gnome-dev-cdrom",
2562  *   "gnome-dev",
2563  *   "gnome",
2564  *   NULL
2565  * };
2566  * ]|
2567  */
2568
2569
2570 /**
2571  * GThreadedSocketService::run:
2572  * @service: the #GThreadedSocketService.
2573  * @connection: a new #GSocketConnection object.
2574  * @source_object: the source_object passed to g_socket_listener_add_address().
2575  *
2576  * The ::run signal is emitted in a worker thread in response to an
2577  * incoming connection. This thread is dedicated to handling
2578  * @connection and may perform blocking IO. The signal handler need
2579  * not return until the connection is closed.
2580  *
2581  * Returns: %TRUE to stop further signal handlers from being called
2582  */
2583
2584
2585 /**
2586  * GTlsBackend:
2587  *
2588  * TLS (Transport Layer Security, aka SSL) backend. This is an
2589  * internal type used to coordinate the different classes implemented
2590  * by a TLS backend.
2591  *
2592  * Since: 2.28
2593  */
2594
2595
2596 /**
2597  * GTlsCertificate:
2598  *
2599  * Abstract base class for TLS certificate types.
2600  *
2601  * Since: 2.28
2602  */
2603
2604
2605 /**
2606  * GTlsCertificate:certificate:
2607  *
2608  * The DER (binary) encoded representation of the certificate.
2609  * This property and the #GTlsCertificate:certificate-pem property
2610  * represent the same data, just in different forms.
2611  *
2612  * Since: 2.28
2613  */
2614
2615
2616 /**
2617  * GTlsCertificate:certificate-pem:
2618  *
2619  * The PEM (ASCII) encoded representation of the certificate.
2620  * This property and the #GTlsCertificate:certificate
2621  * property represent the same data, just in different forms.
2622  *
2623  * Since: 2.28
2624  */
2625
2626
2627 /**
2628  * GTlsCertificate:issuer:
2629  *
2630  * A #GTlsCertificate representing the entity that issued this
2631  * certificate. If %NULL, this means that the certificate is either
2632  * self-signed, or else the certificate of the issuer is not
2633  * available.
2634  *
2635  * Since: 2.28
2636  */
2637
2638
2639 /**
2640  * GTlsCertificate:private-key:
2641  *
2642  * The DER (binary) encoded representation of the certificate's
2643  * private key, in either PKCS#1 format or unencrypted PKCS#8
2644  * format. This property (or the #GTlsCertificate:private-key-pem
2645  * property) can be set when constructing a key (eg, from a file),
2646  * but cannot be read.
2647  *
2648  * PKCS#8 format is supported since 2.32; earlier releases only
2649  * support PKCS#1. You can use the <literal>openssl rsa</literal>
2650  * tool to convert PKCS#8 keys to PKCS#1.
2651  *
2652  * Since: 2.28
2653  */
2654
2655
2656 /**
2657  * GTlsCertificate:private-key-pem:
2658  *
2659  * The PEM (ASCII) encoded representation of the certificate's
2660  * private key in either PKCS#1 format ("<literal>BEGIN RSA PRIVATE
2661  * KEY</literal>") or unencrypted PKCS#8 format ("<literal>BEGIN
2662  * PRIVATE KEY</literal>"). This property (or the
2663  * #GTlsCertificate:private-key property) can be set when
2664  * constructing a key (eg, from a file), but cannot be read.
2665  *
2666  * PKCS#8 format is supported since 2.32; earlier releases only
2667  * support PKCS#1. You can use the <literal>openssl rsa</literal>
2668  * tool to convert PKCS#8 keys to PKCS#1.
2669  *
2670  * Since: 2.28
2671  */
2672
2673
2674 /**
2675  * GTlsClientConnection:
2676  *
2677  * Abstract base class for the backend-specific client connection
2678  * type.
2679  *
2680  * Since: 2.28
2681  */
2682
2683
2684 /**
2685  * GTlsClientConnection:accepted-cas:
2686  *
2687  * A list of the distinguished names of the Certificate Authorities
2688  * that the server will accept client certificates signed by. If the
2689  * server requests a client certificate during the handshake, then
2690  * this property will be set after the handshake completes.
2691  *
2692  * Each item in the list is a #GByteArray which contains the complete
2693  * subject DN of the certificate authority.
2694  *
2695  * Since: 2.28
2696  */
2697
2698
2699 /**
2700  * GTlsClientConnection:server-identity:
2701  *
2702  * A #GSocketConnectable describing the identity of the server that
2703  * is expected on the other end of the connection.
2704  *
2705  * If the %G_TLS_CERTIFICATE_BAD_IDENTITY flag is set in
2706  * #GTlsClientConnection:validation-flags, this object will be used
2707  * to determine the expected identify of the remote end of the
2708  * connection; if #GTlsClientConnection:server-identity is not set,
2709  * or does not match the identity presented by the server, then the
2710  * %G_TLS_CERTIFICATE_BAD_IDENTITY validation will fail.
2711  *
2712  * In addition to its use in verifying the server certificate,
2713  * this is also used to give a hint to the server about what
2714  * certificate we expect, which is useful for servers that serve
2715  * virtual hosts.
2716  *
2717  * Since: 2.28
2718  */
2719
2720
2721 /**
2722  * GTlsClientConnection:use-ssl3:
2723  *
2724  * If %TRUE, tells the connection to use SSL 3.0 rather than trying
2725  * to negotiate the best version of TLS or SSL to use. This can be
2726  * used when talking to servers that don't implement version
2727  * negotiation correctly and therefore refuse to handshake at all with
2728  * a "modern" TLS handshake.
2729  *
2730  * Since: 2.28
2731  */
2732
2733
2734 /**
2735  * GTlsClientConnection:validation-flags:
2736  *
2737  * What steps to perform when validating a certificate received from
2738  * a server. Server certificates that fail to validate in all of the
2739  * ways indicated here will be rejected unless the application
2740  * overrides the default via #GTlsConnection::accept-certificate.
2741  *
2742  * Since: 2.28
2743  */
2744
2745
2746 /**
2747  * GTlsConnection:
2748  *
2749  * Abstract base class for the backend-specific #GTlsClientConnection
2750  * and #GTlsServerConnection types.
2751  *
2752  * Since: 2.28
2753  */
2754
2755
2756 /**
2757  * GTlsConnection::accept-certificate:
2758  * @conn: a #GTlsConnection
2759  * @peer_cert: the peer's #GTlsCertificate
2760  * @errors: the problems with @peer_cert.
2761  *
2762  * Emitted during the TLS handshake after the peer certificate has
2763  * been received. You can examine @peer_cert's certification path by
2764  * calling g_tls_certificate_get_issuer() on it.
2765  *
2766  * For a client-side connection, @peer_cert is the server's
2767  * certificate, and the signal will only be emitted if the
2768  * certificate was not acceptable according to @conn's
2769  * #GTlsClientConnection:validation_flags. If you would like the
2770  * certificate to be accepted despite @errors, return %TRUE from the
2771  * signal handler. Otherwise, if no handler accepts the certificate,
2772  * the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE.
2773  *
2774  * For a server-side connection, @peer_cert is the certificate
2775  * presented by the client, if this was requested via the server's
2776  * #GTlsServerConnection:authentication_mode. On the server side,
2777  * the signal is always emitted when the client presents a
2778  * certificate, and the certificate will only be accepted if a
2779  * handler returns %TRUE.
2780  *
2781  * Note that if this signal is emitted as part of asynchronous I/O
2782  * in the main thread, then you should not attempt to interact with
2783  * the user before returning from the signal handler. If you want to
2784  * let the user decide whether or not to accept the certificate, you
2785  * would have to return %FALSE from the signal handler on the first
2786  * attempt, and then after the connection attempt returns a
2787  * %G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if
2788  * the user decides to accept the certificate, remember that fact,
2789  * create a new connection, and return %TRUE from the signal handler
2790  * the next time.
2791  *
2792  * If you are doing I/O in another thread, you do not
2793  * need to worry about this, and can simply block in the signal
2794  * handler until the UI thread returns an answer.
2795  *
2796  * 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.
2797  * Since: 2.28
2798  */
2799
2800
2801 /**
2802  * GTlsConnection:base-io-stream:
2803  *
2804  * The #GIOStream that the connection wraps
2805  *
2806  * Since: 2.28
2807  */
2808
2809
2810 /**
2811  * GTlsConnection:certificate:
2812  *
2813  * The connection's certificate; see
2814  * g_tls_connection_set_certificate().
2815  *
2816  * Since: 2.28
2817  */
2818
2819
2820 /**
2821  * GTlsConnection:database:
2822  *
2823  * The certificate database to use when verifying this TLS connection.
2824  * If no cerificate database is set, then the default database will be
2825  * used. See g_tls_backend_get_default_database().
2826  *
2827  * Since: 2.30
2828  */
2829
2830
2831 /**
2832  * GTlsConnection:interaction:
2833  *
2834  * A #GTlsInteraction object to be used when the connection or certificate
2835  * database need to interact with the user. This will be used to prompt the
2836  * user for passwords where necessary.
2837  *
2838  * Since: 2.30
2839  */
2840
2841
2842 /**
2843  * GTlsConnection:peer-certificate:
2844  *
2845  * The connection's peer's certificate, after the TLS handshake has
2846  * completed and the certificate has been accepted. Note in
2847  * particular that this is not yet set during the emission of
2848  * #GTlsConnection::accept-certificate.
2849  *
2850  * (You can watch for a #GObject::notify signal on this property to
2851  * detect when a handshake has occurred.)
2852  *
2853  * Since: 2.28
2854  */
2855
2856
2857 /**
2858  * GTlsConnection:peer-certificate-errors:
2859  *
2860  * The errors noticed-and-ignored while verifying
2861  * #GTlsConnection:peer-certificate. Normally this should be 0, but
2862  * it may not be if #GTlsClientConnection:validation-flags is not
2863  * %G_TLS_CERTIFICATE_VALIDATE_ALL, or if
2864  * #GTlsConnection::accept-certificate overrode the default
2865  * behavior.
2866  *
2867  * Since: 2.28
2868  */
2869
2870
2871 /**
2872  * GTlsConnection:rehandshake-mode:
2873  *
2874  * The rehandshaking mode. See
2875  * g_tls_connection_set_rehandshake_mode().
2876  *
2877  * Since: 2.28
2878  */
2879
2880
2881 /**
2882  * GTlsConnection:require-close-notify:
2883  *
2884  * Whether or not proper TLS close notification is required.
2885  * See g_tls_connection_set_require_close_notify().
2886  *
2887  * Since: 2.28
2888  */
2889
2890
2891 /**
2892  * GTlsConnection:use-system-certdb:
2893  *
2894  * Whether or not the system certificate database will be used to
2895  * verify peer certificates. See
2896  * g_tls_connection_set_use_system_certdb().
2897  *
2898  * Deprecated: 2.30: Use GTlsConnection:database instead
2899  */
2900
2901
2902 /**
2903  * GTlsDatabase:
2904  *
2905  * Abstract base class for the backend-specific database types.
2906  *
2907  * Since: 2.30
2908  */
2909
2910
2911 /**
2912  * GTlsFileDatabase:
2913  *
2914  * Implemented by a #GTlsDatabase which allows you to load certificates
2915  * from a file.
2916  *
2917  * Since: 2.30
2918  */
2919
2920
2921 /**
2922  * GTlsFileDatabase:anchors:
2923  *
2924  * The path to a file containing PEM encoded certificate authority
2925  * root anchors. The certificates in this file will be treated as
2926  * root authorities for the purpose of verifying other certificates
2927  * via the g_tls_database_verify_chain() operation.
2928  *
2929  * Since: 2.30
2930  */
2931
2932
2933 /**
2934  * GTlsInteraction:
2935  *
2936  * An object representing interaction that the TLS connection and database
2937  * might have with the user.
2938  *
2939  * Since: 2.30
2940  */
2941
2942
2943 /**
2944  * GTlsInteractionClass:
2945  * @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.
2946  * @ask_password_async: ask for a password asynchronously.
2947  * @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.
2948  *
2949  * The class for #GTlsInteraction. Derived classes implement the various
2950  * virtual interaction methods to handle TLS interactions.
2951  *
2952  * Derived classes can choose to implement whichever interactions methods they'd
2953  * like to support by overriding those virtual methods in their class
2954  * initialization function. If a derived class implements an async method,
2955  * it must also implement the corresponding finish method.
2956  *
2957  * The synchronous interaction methods should implement to display modal dialogs,
2958  * and the asynchronous methods to display modeless dialogs.
2959  *
2960  * If the user cancels an interaction, then the result should be
2961  * %G_TLS_INTERACTION_FAILED and the error should be set with a domain of
2962  * %G_IO_ERROR and code of %G_IO_ERROR_CANCELLED.
2963  *
2964  * Since: 2.30
2965  */
2966
2967
2968 /**
2969  * GTlsPassword:
2970  *
2971  * An abstract interface representing a password used in TLS. Often used in
2972  * user interaction such as unlocking a key storage token.
2973  *
2974  * Since: 2.30
2975  */
2976
2977
2978 /**
2979  * GTlsServerConnection:authentication-mode:
2980  *
2981  * The #GTlsAuthenticationMode for the server. This can be changed
2982  * before calling g_tls_connection_handshake() if you want to
2983  * rehandshake with a different mode from the initial handshake.
2984  *
2985  * Since: 2.28
2986  */
2987
2988
2989 /**
2990  * GUnixCredentialsMessage:credentials:
2991  *
2992  * The credentials stored in the message.
2993  *
2994  * Since: 2.26
2995  */
2996
2997
2998 /**
2999  * GUnixInputStream:close-fd:
3000  *
3001  * Whether to close the file descriptor when the stream is closed.
3002  *
3003  * Since: 2.20
3004  */
3005
3006
3007 /**
3008  * GUnixInputStream:fd:
3009  *
3010  * The file descriptor that the stream reads from.
3011  *
3012  * Since: 2.20
3013  */
3014
3015
3016 /**
3017  * GUnixMountMonitor::mountpoints-changed:
3018  * @monitor: the object on which the signal is emitted
3019  *
3020  * Emitted when the unix mount points have changed.
3021  */
3022
3023
3024 /**
3025  * GUnixMountMonitor::mounts-changed:
3026  * @monitor: the object on which the signal is emitted
3027  *
3028  * Emitted when the unix mounts have changed.
3029  */
3030
3031
3032 /**
3033  * GUnixOutputStream:close-fd:
3034  *
3035  * Whether to close the file descriptor when the stream is closed.
3036  *
3037  * Since: 2.20
3038  */
3039
3040
3041 /**
3042  * GUnixOutputStream:fd:
3043  *
3044  * The file descriptor that the stream writes to.
3045  *
3046  * Since: 2.20
3047  */
3048
3049
3050 /**
3051  * GUnixSocketAddress:
3052  *
3053  * A UNIX-domain (local) socket address, corresponding to a
3054  * <type>struct sockaddr_un</type>.
3055  */
3056
3057
3058 /**
3059  * GUnixSocketAddress:abstract:
3060  *
3061  * Whether or not this is an abstract address
3062  *
3063  * Deprecated: Use #GUnixSocketAddress:address-type, which distinguishes between zero-padded and non-zero-padded abstract addresses.
3064  */
3065
3066
3067 /**
3068  * GVolume::changed:
3069  *
3070  * Emitted when the volume has been changed.
3071  */
3072
3073
3074 /**
3075  * GVolume::removed:
3076  *
3077  * This signal is emitted when the #GVolume have been removed. If
3078  * the recipient is holding references to the object they should
3079  * release them so the object can be finalized.
3080  */
3081
3082
3083 /**
3084  * GVolumeMonitor::drive-changed:
3085  * @volume_monitor: The volume monitor emitting the signal.
3086  * @drive: the drive that changed
3087  *
3088  * Emitted when a drive changes.
3089  */
3090
3091
3092 /**
3093  * GVolumeMonitor::drive-connected:
3094  * @volume_monitor: The volume monitor emitting the signal.
3095  * @drive: a #GDrive that was connected.
3096  *
3097  * Emitted when a drive is connected to the system.
3098  */
3099
3100
3101 /**
3102  * GVolumeMonitor::drive-disconnected:
3103  * @volume_monitor: The volume monitor emitting the signal.
3104  * @drive: a #GDrive that was disconnected.
3105  *
3106  * Emitted when a drive is disconnected from the system.
3107  */
3108
3109
3110 /**
3111  * GVolumeMonitor::drive-eject-button:
3112  * @volume_monitor: The volume monitor emitting the signal.
3113  * @drive: the drive where the eject button was pressed
3114  *
3115  * Emitted when the eject button is pressed on @drive.
3116  *
3117  * Since: 2.18
3118  */
3119
3120
3121 /**
3122  * GVolumeMonitor::drive-stop-button:
3123  * @volume_monitor: The volume monitor emitting the signal.
3124  * @drive: the drive where the stop button was pressed
3125  *
3126  * Emitted when the stop button is pressed on @drive.
3127  *
3128  * Since: 2.22
3129  */
3130
3131
3132 /**
3133  * GVolumeMonitor::mount-added:
3134  * @volume_monitor: The volume monitor emitting the signal.
3135  * @mount: a #GMount that was added.
3136  *
3137  * Emitted when a mount is added.
3138  */
3139
3140
3141 /**
3142  * GVolumeMonitor::mount-changed:
3143  * @volume_monitor: The volume monitor emitting the signal.
3144  * @mount: a #GMount that changed.
3145  *
3146  * Emitted when a mount changes.
3147  */
3148
3149
3150 /**
3151  * GVolumeMonitor::mount-pre-unmount:
3152  * @volume_monitor: The volume monitor emitting the signal.
3153  * @mount: a #GMount that is being unmounted.
3154  *
3155  * Emitted when a mount is about to be removed.
3156  */
3157
3158
3159 /**
3160  * GVolumeMonitor::mount-removed:
3161  * @volume_monitor: The volume monitor emitting the signal.
3162  * @mount: a #GMount that was removed.
3163  *
3164  * Emitted when a mount is removed.
3165  */
3166
3167
3168 /**
3169  * GVolumeMonitor::volume-added:
3170  * @volume_monitor: The volume monitor emitting the signal.
3171  * @volume: a #GVolume that was added.
3172  *
3173  * Emitted when a mountable volume is added to the system.
3174  */
3175
3176
3177 /**
3178  * GVolumeMonitor::volume-changed:
3179  * @volume_monitor: The volume monitor emitting the signal.
3180  * @volume: a #GVolume that changed.
3181  *
3182  * Emitted when mountable volume is changed.
3183  */
3184
3185
3186 /**
3187  * GVolumeMonitor::volume-removed:
3188  * @volume_monitor: The volume monitor emitting the signal.
3189  * @volume: a #GVolume that was removed.
3190  *
3191  * Emitted when a mountable volume is removed from the system.
3192  */
3193
3194
3195 /**
3196  * GWin32InputStream:close-handle:
3197  *
3198  * Whether to close the file handle when the stream is closed.
3199  *
3200  * Since: 2.26
3201  */
3202
3203
3204 /**
3205  * GWin32InputStream:handle:
3206  *
3207  * The handle that the stream reads from.
3208  *
3209  * Since: 2.26
3210  */
3211
3212
3213 /**
3214  * GWin32OutputStream:close-handle:
3215  *
3216  * Whether to close the file handle when the stream is closed.
3217  *
3218  * Since: 2.26
3219  */
3220
3221
3222 /**
3223  * GWin32OutputStream:handle:
3224  *
3225  * The file handle that the stream writes to.
3226  *
3227  * Since: 2.26
3228  */
3229
3230
3231 /**
3232  * GZlibCompressor:
3233  *
3234  * Zlib decompression
3235  */
3236
3237
3238 /**
3239  * GZlibCompressor:file-info:
3240  *
3241  * If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is
3242  * %G_ZLIB_COMPRESSOR_FORMAT_GZIP, the compressor will write the file name
3243  * and modification time from the file info to the GZIP header.
3244  *
3245  * Since: 2.26
3246  */
3247
3248
3249 /**
3250  * GZlibDecompressor:
3251  *
3252  * Zlib decompression
3253  */
3254
3255
3256 /**
3257  * GZlibDecompressor:file-info:
3258  *
3259  * A #GFileInfo containing the information found in the GZIP header
3260  * of the data stream processed, or %NULL if the header was not yet
3261  * fully processed, is not present at all, or the compressor's
3262  * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP.
3263  *
3264  * Since: 2.26
3265  */
3266
3267
3268 /**
3269  * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT:
3270  *
3271  * The purpose used to verify the client certificate in a TLS connection.
3272  * Used by TLS servers.
3273  */
3274
3275
3276 /**
3277  * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER:
3278  *
3279  * The purpose used to verify the server certificate in a TLS connection. This
3280  * is the most common purpose in use. Used by TLS clients.
3281  */
3282
3283
3284 /**
3285  * G_TYPE_SETTINGS_SCHEMA:
3286  *
3287  * A boxed #GType corresponding to #GSettingsSchema.
3288  *
3289  * Since: 2.32
3290  */
3291
3292
3293 /**
3294  * G_TYPE_SETTINGS_SCHEMA_SOURCE:
3295  *
3296  * A boxed #GType corresponding to #GSettingsSchemaSource.
3297  *
3298  * Since: 2.32
3299  */
3300
3301
3302 /**
3303  * SECTION:extensionpoints
3304  * @short_description: Extension Points
3305  * @include: gio.h
3306  * @see_also: <link linkend="extending-gio">Extending GIO</link>
3307  *
3308  * #GIOExtensionPoint provides a mechanism for modules to extend the
3309  * functionality of the library or application that loaded it in an
3310  * organized fashion.
3311  *
3312  * An extension point is identified by a name, and it may optionally
3313  * require that any implementation must by of a certain type (or derived
3314  * thereof). Use g_io_extension_point_register() to register an
3315  * extension point, and g_io_extension_point_set_required_type() to
3316  * set a required type.
3317  *
3318  * A module can implement an extension point by specifying the #GType
3319  * that implements the functionality. Additionally, each implementation
3320  * of an extension point has a name, and a priority. Use
3321  * g_io_extension_point_implement() to implement an extension point.
3322  *
3323  *  |[
3324  *  GIOExtensionPoint *ep;
3325  *
3326  *  /&ast; Register an extension point &ast;/
3327  *  ep = g_io_extension_point_register ("my-extension-point");
3328  *  g_io_extension_point_set_required_type (ep, MY_TYPE_EXAMPLE);
3329  *  ]|
3330  *
3331  *  |[
3332  *  /&ast; Implement an extension point &ast;/
3333  *  G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
3334  *  g_io_extension_point_implement ("my-extension-point",
3335  *                                  my_example_impl_get_type (),
3336  *                                  "my-example",
3337  *                                  10);
3338  *  ]|
3339  *
3340  *  It is up to the code that registered the extension point how
3341  *  it uses the implementations that have been associated with it.
3342  *  Depending on the use case, it may use all implementations, or
3343  *  only the one with the highest priority, or pick a specific
3344  *  one by name.
3345  *
3346  *  To avoid opening all modules just to find out what extension
3347  *  points they implement, GIO makes use of a caching mechanism,
3348  *  see <link linkend="gio-querymodules">gio-querymodules</link>.
3349  *  You are expected to run this command after installing a
3350  *  GIO module.
3351  *
3352  *  The <envar>GIO_EXTRA_MODULES</envar> environment variable can be
3353  *  used to specify additional directories to automatically load modules
3354  *  from. This environment variable has the same syntax as the
3355  *  <envar>PATH</envar>. If two modules have the same base name in different
3356  *  directories, then the latter one will be ignored. If additional
3357  *  directories are specified GIO will load modules from the built-in
3358  *  directory last.
3359  */
3360
3361
3362 /**
3363  * SECTION:gaction
3364  * @title: GAction
3365  * @short_description: An action interface
3366  *
3367  * #GAction represents a single named action.
3368  *
3369  * The main interface to an action is that it can be activated with
3370  * g_action_activate().  This results in the 'activate' signal being
3371  * emitted.  An activation has a #GVariant parameter (which may be
3372  * %NULL).  The correct type for the parameter is determined by a static
3373  * parameter type (which is given at construction time).
3374  *
3375  * An action may optionally have a state, in which case the state may be
3376  * set with g_action_change_state().  This call takes a #GVariant.  The
3377  * correct type for the state is determined by a static state type
3378  * (which is given at construction time).
3379  *
3380  * The state may have a hint associated with it, specifying its valid
3381  * range.
3382  *
3383  * #GAction is merely the interface to the concept of an action, as
3384  * described above.  Various implementations of actions exist, including
3385  * #GSimpleAction and #GtkAction.
3386  *
3387  * In all cases, the implementing class is responsible for storing the
3388  * name of the action, the parameter type, the enabled state, the
3389  * optional state type and the state and emitting the appropriate
3390  * signals when these change.  The implementor responsible for filtering
3391  * calls to g_action_activate() and g_action_change_state() for type
3392  * safety and for the state being enabled.
3393  *
3394  * Probably the only useful thing to do with a #GAction is to put it
3395  * inside of a #GSimpleActionGroup.
3396  */
3397
3398
3399 /**
3400  * SECTION:gactiongroup
3401  * @title: GActionGroup
3402  * @short_description: A group of actions
3403  * @see_also: #GAction
3404  *
3405  * #GActionGroup represents a group of actions. Actions can be used to
3406  * expose functionality in a structured way, either from one part of a
3407  * program to another, or to the outside world. Action groups are often
3408  * used together with a #GMenuModel that provides additional
3409  * representation data for displaying the actions to the user, e.g. in
3410  * a menu.
3411  *
3412  * The main way to interact with the actions in a GActionGroup is to
3413  * activate them with g_action_group_activate_action(). Activating an
3414  * action may require a #GVariant parameter. The required type of the
3415  * parameter can be inquired with g_action_group_get_action_parameter_type().
3416  * Actions may be disabled, see g_action_group_get_action_enabled().
3417  * Activating a disabled action has no effect.
3418  *
3419  * Actions may optionally have a state in the form of a #GVariant. The
3420  * current state of an action can be inquired with
3421  * g_action_group_get_action_state(). Activating a stateful action may
3422  * change its state, but it is also possible to set the state by calling
3423  * g_action_group_change_action_state().
3424  *
3425  * As typical example, consider a text editing application which has an
3426  * option to change the current font to 'bold'. A good way to represent
3427  * this would be a stateful action, with a boolean state. Activating the
3428  * action would toggle the state.
3429  *
3430  * Each action in the group has a unique name (which is a string).  All
3431  * method calls, except g_action_group_list_actions() take the name of
3432  * an action as an argument.
3433  *
3434  * The #GActionGroup API is meant to be the 'public' API to the action
3435  * group.  The calls here are exactly the interaction that 'external
3436  * forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have
3437  * with actions.  'Internal' APIs (ie: ones meant only to be accessed by
3438  * the action group implementation) are found on subclasses.  This is
3439  * why you will find - for example - g_action_group_get_action_enabled()
3440  * but not an equivalent <function>set()</function> call.
3441  *
3442  * Signals are emitted on the action group in response to state changes
3443  * on individual actions.
3444  *
3445  * Implementations of #GActionGroup should provide implementations for
3446  * the virtual functions g_action_group_list_actions() and
3447  * g_action_group_query_action().  The other virtual functions should
3448  * not be implemented - their "wrappers" are actually implemented with
3449  * calls to g_action_group_query_action().
3450  */
3451
3452
3453 /**
3454  * SECTION:gactiongroupexporter
3455  * @title: GActionGroup exporter
3456  * @short_description: Export GActionGroups on D-Bus
3457  * @see_also: #GActionGroup, #GDBusActionGroup
3458  *
3459  * These functions support exporting a #GActionGroup on D-Bus.
3460  * The D-Bus interface that is used is a private implementation
3461  * detail.
3462  *
3463  * To access an exported #GActionGroup remotely, use
3464  * g_dbus_action_group_get() to obtain a #GDBusActionGroup.
3465  */
3466
3467
3468 /**
3469  * SECTION:gactionmap
3470  * @title: GActionMap
3471  * @short_description: Interface for action containers
3472  *
3473  * The GActionMap interface is implemented by #GActionGroup
3474  * implementations that operate by containing a number of
3475  * named #GAction instances, such as #GSimpleActionGroup.
3476  *
3477  * One useful application of this interface is to map the
3478  * names of actions from various action groups to unique,
3479  * prefixed names (e.g. by prepending "app." or "win.").
3480  * This is the motivation for the 'Map' part of the interface
3481  * name.
3482  *
3483  * Since: 2.32
3484  */
3485
3486
3487 /**
3488  * SECTION:gappinfo
3489  * @short_description: Application information and launch contexts
3490  * @include: gio/gio.h
3491  *
3492  * #GAppInfo and #GAppLaunchContext are used for describing and launching
3493  * applications installed on the system.
3494  *
3495  * As of GLib 2.20, URIs will always be converted to POSIX paths
3496  * (using g_file_get_path()) when using g_app_info_launch() even if
3497  * the application requested an URI and not a POSIX path. For example
3498  * for an desktop-file based application with Exec key <literal>totem
3499  * &percnt;U</literal> and a single URI,
3500  * <literal>sftp://foo/file.avi</literal>, then
3501  * <literal>/home/user/.gvfs/sftp on foo/file.avi</literal> will be
3502  * passed. This will only work if a set of suitable GIO extensions
3503  * (such as gvfs 2.26 compiled with FUSE support), is available and
3504  * operational; if this is not the case, the URI will be passed
3505  * unmodified to the application. Some URIs, such as
3506  * <literal>mailto:</literal>, of course cannot be mapped to a POSIX
3507  * path (in gvfs there's no FUSE mount for it); such URIs will be
3508  * passed unmodified to the application.
3509  *
3510  * Specifically for gvfs 2.26 and later, the POSIX URI will be mapped
3511  * back to the GIO URI in the #GFile constructors (since gvfs
3512  * implements the #GVfs extension point). As such, if the application
3513  * needs to examine the URI, it needs to use g_file_get_uri() or
3514  * similar on #GFile. In other words, an application cannot assume
3515  * that the URI passed to e.g. g_file_new_for_commandline_arg() is
3516  * equal to the result of g_file_get_uri(). The following snippet
3517  * illustrates this:
3518  *
3519  * <programlisting>
3520  * GFile *f;
3521  * char *uri;
3522  *
3523  * file = g_file_new_for_commandline_arg (uri_from_commandline);
3524  *
3525  * uri = g_file_get_uri (file);
3526  * strcmp (uri, uri_from_commandline) == 0; // FALSE
3527  * g_free (uri);
3528  *
3529  * if (g_file_has_uri_scheme (file, "cdda"))
3530  *   {
3531  *     // do something special with uri
3532  *   }
3533  * g_object_unref (file);
3534  * </programlisting>
3535  *
3536  * This code will work when both <literal>cdda://sr0/Track
3537  * 1.wav</literal> and <literal>/home/user/.gvfs/cdda on sr0/Track
3538  * 1.wav</literal> is passed to the application. It should be noted
3539  * that it's generally not safe for applications to rely on the format
3540  * of a particular URIs. Different launcher applications (e.g. file
3541  * managers) may have different ideas of what a given URI means.
3542  */
3543
3544
3545 /**
3546  * SECTION:gapplication
3547  * @title: GApplication
3548  * @short_description: Core application class
3549  *
3550  * A #GApplication is the foundation of an application.  It wraps some
3551  * low-level platform-specific services and is intended to act as the
3552  * foundation for higher-level application classes such as
3553  * #GtkApplication or #MxApplication.  In general, you should not use
3554  * this class outside of a higher level framework.
3555  *
3556  * GApplication provides convenient life cycle management by maintaining
3557  * a <firstterm>use count</firstterm> for the primary application instance.
3558  * The use count can be changed using g_application_hold() and
3559  * g_application_release(). If it drops to zero, the application exits.
3560  * Higher-level classes such as #GtkApplication employ the use count to
3561  * ensure that the application stays alive as long as it has any opened
3562  * windows.
3563  *
3564  * Another feature that GApplication (optionally) provides is process
3565  * uniqueness.  Applications can make use of this functionality by
3566  * providing a unique application ID.  If given, only one application
3567  * with this ID can be running at a time per session.  The session
3568  * concept is platform-dependent, but corresponds roughly to a graphical
3569  * desktop login.  When your application is launched again, its
3570  * arguments are passed through platform communication to the already
3571  * running program.  The already running instance of the program is
3572  * called the <firstterm>primary instance</firstterm>; for non-unique
3573  * applications this is the always the current instance.
3574  * On Linux, the D-Bus session bus is used for communication.
3575  *
3576  * The use of #GApplication differs from some other commonly-used
3577  * uniqueness libraries (such as libunique) in important ways.  The
3578  * application is not expected to manually register itself and check if
3579  * it is the primary instance.  Instead, the <code>main()</code>
3580  * function of a #GApplication should do very little more than
3581  * instantiating the application instance, possibly connecting signal
3582  * handlers, then calling g_application_run().  All checks for
3583  * uniqueness are done internally.  If the application is the primary
3584  * instance then the startup signal is emitted and the mainloop runs.
3585  * If the application is not the primary instance then a signal is sent
3586  * to the primary instance and g_application_run() promptly returns.
3587  * See the code examples below.
3588  *
3589  * If used, the expected form of an application identifier is very close
3590  * to that of of a
3591  * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-interface">DBus bus name</ulink>.
3592  * Examples include: "com.example.MyApp", "org.example.internal-apps.Calculator".
3593  * For details on valid application identifiers, see g_application_id_is_valid().
3594  *
3595  * On Linux, the application identifier is claimed as a well-known bus name
3596  * on the user's session bus.  This means that the uniqueness of your
3597  * application is scoped to the current session.  It also means that your
3598  * application may provide additional services (through registration of other
3599  * object paths) at that bus name.  The registration of these object paths
3600  * should be done with the shared GDBus session bus.  Note that due to the
3601  * internal architecture of GDBus, method calls can be dispatched at any time
3602  * (even if a main loop is not running).  For this reason, you must ensure that
3603  * any object paths that you wish to register are registered before #GApplication
3604  * attempts to acquire the bus name of your application (which happens in
3605  * g_application_register()).  Unfortunately, this means that you cannot use
3606  * g_application_get_is_remote() to decide if you want to register object paths.
3607  *
3608  * GApplication also implements the #GActionGroup and #GActionMap
3609  * interfaces and lets you easily export actions by adding them with
3610  * g_action_map_add_action(). When invoking an action by calling
3611  * g_action_group_activate_action() on the application, it is always
3612  * invoked in the primary instance. The actions are also exported on
3613  * the session bus, and GIO provides the #GDBusActionGroup wrapper to
3614  * conveniently access them remotely. GIO provides a #GDBusMenuModel wrapper
3615  * for remote access to exported #GMenuModels.
3616  *
3617  * There is a number of different entry points into a GApplication:
3618  * <itemizedlist>
3619  * <listitem>via 'Activate' (i.e. just starting the application)</listitem>
3620  * <listitem>via 'Open' (i.e. opening some files)</listitem>
3621  * <listitem>by handling a command-line</listitem>
3622  * <listitem>via activating an action</listitem>
3623  * </itemizedlist>
3624  * The #GApplication::startup signal lets you handle the application
3625  * initialization for all of these in a single place.
3626  *
3627  * Regardless of which of these entry points is used to start the application,
3628  * GApplication passes some <firstterm id="platform-data">platform
3629  * data</firstterm> from the launching instance to the primary instance,
3630  * in the form of a #GVariant dictionary mapping strings to variants.
3631  * To use platform data, override the @before_emit or @after_emit virtual
3632  * functions in your #GApplication subclass. When dealing with
3633  * #GApplicationCommandLine objects, the platform data is directly
3634  * available via g_application_command_line_get_cwd(),
3635  * g_application_command_line_get_environ() and
3636  * g_application_command_line_get_platform_data().
3637  *
3638  * As the name indicates, the platform data may vary depending on the
3639  * operating system, but it always includes the current directory (key
3640  * "cwd"), and optionally the environment (ie the set of environment
3641  * variables and their values) of the calling process (key "environ").
3642  * The environment is only added to the platform data if the
3643  * %G_APPLICATION_SEND_ENVIRONMENT flag is set. #GApplication subclasses
3644  * can add their own platform data by overriding the @add_platform_data
3645  * virtual function. For instance, #GtkApplication adds startup notification
3646  * data in this way.
3647  *
3648  * To parse commandline arguments you may handle the
3649  * #GApplication::command-line signal or override the local_command_line()
3650  * vfunc, to parse them in either the primary instance or the local instance,
3651  * respectively.
3652  *
3653  * <example id="gapplication-example-open"><title>Opening files with a GApplication</title>
3654  * <programlisting>
3655  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-open.c">
3656  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3657  * </xi:include>
3658  * </programlisting>
3659  * </example>
3660  *
3661  * <example id="gapplication-example-actions"><title>A GApplication with actions</title>
3662  * <programlisting>
3663  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-actions.c">
3664  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3665  * </xi:include>
3666  * </programlisting>
3667  * </example>
3668  *
3669  * <example id="gapplication-example-menu"><title>A GApplication with menus</title>
3670  * <programlisting>
3671  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-menu.c">
3672  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3673  * </xi:include>
3674  * </programlisting>
3675  * </example>
3676  *
3677  * <example id="gapplication-example-dbushooks"><title>Using extra D-Bus hooks with a GApplication</title>
3678  * <programlisting>
3679  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-dbushooks.c">
3680  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3681  * </xi:include>
3682  * </programlisting>
3683  * </example>
3684  */
3685
3686
3687 /**
3688  * SECTION:gapplicationcommandline
3689  * @title: GApplicationCommandLine
3690  * @short_description: A command-line invocation of an application
3691  * @see_also: #GApplication
3692  *
3693  * #GApplicationCommandLine represents a command-line invocation of
3694  * an application.  It is created by #GApplication and emitted
3695  * in the #GApplication::command-line signal and virtual function.
3696  *
3697  * The class contains the list of arguments that the program was invoked
3698  * with.  It is also possible to query if the commandline invocation was
3699  * local (ie: the current process is running in direct response to the
3700  * invocation) or remote (ie: some other process forwarded the
3701  * commandline to this process).
3702  *
3703  * The GApplicationCommandLine object can provide the @argc and @argv
3704  * parameters for use with the #GOptionContext command-line parsing API,
3705  * with the g_application_command_line_get_arguments() function. See
3706  * <xref linkend="gapplication-example-cmdline3"/> for an example.
3707  *
3708  * The exit status of the originally-invoked process may be set and
3709  * messages can be printed to stdout or stderr of that process.  The
3710  * lifecycle of the originally-invoked process is tied to the lifecycle
3711  * of this object (ie: the process exits when the last reference is
3712  * dropped).
3713  *
3714  * The main use for #GApplicationCommandLine (and the
3715  * #GApplication::command-line signal) is 'Emacs server' like use cases:
3716  * You can set the <envar>EDITOR</envar> environment variable to have
3717  * e.g. git use your favourite editor to edit commit messages, and if you
3718  * already have an instance of the editor running, the editing will happen
3719  * in the running instance, instead of opening a new one. An important
3720  * aspect of this use case is that the process that gets started by git
3721  * does not return until the editing is done.
3722  *
3723  * <example id="gapplication-example-cmdline"><title>Handling commandline arguments with GApplication</title>
3724  * <para>
3725  * A simple example where the commandline is completely handled
3726  * in the #GApplication::command-line handler. The launching instance exits
3727  * once the signal handler in the primary instance has returned, and the
3728  * return value of the signal handler becomes the exit status of the launching
3729  * instance.
3730  * </para>
3731  * <programlisting>
3732  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline.c">
3733  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3734  * </xi:include>
3735  * </programlisting>
3736  * </example>
3737  *
3738  * <example id="gapplication-example-cmdline2"><title>Split commandline handling</title>
3739  * <para>
3740  * An example of split commandline handling. Options that start with
3741  * <literal>--local-</literal> are handled locally, all other options are
3742  * passed to the #GApplication::command-line handler which runs in the primary
3743  * instance.
3744  * </para>
3745  * <programlisting>
3746  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline2.c">
3747  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3748  * </xi:include>
3749  * </programlisting>
3750  * </example>
3751  *
3752  * <example id="gapplication-example-cmdline3"><title>Deferred commandline handling</title>
3753  * <para>
3754  * An example of deferred commandline handling. Here, the commandline is
3755  * not completely handled before the #GApplication::command-line handler
3756  * returns. Instead, we keep a reference to the GApplicationCommandLine
3757  * object and handle it later(in this example, in an idle). Note that it
3758  * is necessary to hold the application until you are done with the
3759  * commandline.
3760  * </para>
3761  * <para>
3762  * This example also shows how to use #GOptionContext for parsing the
3763  * commandline arguments. Note that it is necessary to disable the
3764  * built-in help-handling of #GOptionContext, since it calls exit()
3765  * after printing help, which is not what you want to happen in
3766  * the primary instance.
3767  * </para>
3768  * <programlisting>
3769  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline3.c">
3770  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3771  * </xi:include>
3772  * </programlisting>
3773  * </example>
3774  */
3775
3776
3777 /**
3778  * SECTION:gasyncinitable
3779  * @short_description: Asynchronously failable object initialization interface
3780  * @include: gio/gio.h
3781  * @see_also: #GInitable
3782  *
3783  * This is the asynchronous version of #GInitable; it behaves the same
3784  * in all ways except that initialization is asynchronous. For more details
3785  * see the descriptions on #GInitable.
3786  *
3787  * A class may implement both the #GInitable and #GAsyncInitable interfaces.
3788  *
3789  * Users of objects implementing this are not intended to use the interface
3790  * method directly; instead it will be used automatically in various ways.
3791  * For C applications you generally just call g_async_initable_new_async()
3792  * directly, or indirectly via a foo_thing_new_async() wrapper. This will call
3793  * g_async_initable_init_async() under the cover, calling back with %NULL and
3794  * a set %GError on failure.
3795  *
3796  * A typical implementation might look something like this:
3797  *
3798  * |[
3799  * enum {
3800  *    NOT_INITIALIZED,
3801  *    INITIALIZING,
3802  *    INITIALIZED
3803  * };
3804  *
3805  * static void
3806  * _foo_ready_cb (Foo *self)
3807  * {
3808  *   GList *l;
3809  *
3810  *   self->priv->state = INITIALIZED;
3811  *
3812  *   for (l = self->priv->init_results; l != NULL; l = l->next)
3813  *     {
3814  *       GTask *task = l->data;
3815  *
3816  *       if (self->priv->success)
3817  *         g_task_return_boolean (task, TRUE);
3818  *       else
3819  *         g_task_return_new_error (task, ...);
3820  *       g_object_unref (task);
3821  *     }
3822  *
3823  *   g_list_free (self->priv->init_results);
3824  *   self->priv->init_results = NULL;
3825  * }
3826  *
3827  * static void
3828  * foo_init_async (GAsyncInitable       *initable,
3829  *                 int                   io_priority,
3830  *                 GCancellable         *cancellable,
3831  *                 GAsyncReadyCallback   callback,
3832  *                 gpointer              user_data)
3833  * {
3834  *   Foo *self = FOO (initable);
3835  *   GTask *task;
3836  *
3837  *   task = g_task_new (initable, cancellable, callback, user_data);
3838  *
3839  *   switch (self->priv->state)
3840  *     {
3841  *       case NOT_INITIALIZED:
3842  *         _foo_get_ready (self);
3843  *         self->priv->init_results = g_list_append (self->priv->init_results,
3844  *                                                   task);
3845  *         self->priv->state = INITIALIZING;
3846  *         break;
3847  *       case INITIALIZING:
3848  *         self->priv->init_results = g_list_append (self->priv->init_results,
3849  *                                                   task);
3850  *         break;
3851  *       case INITIALIZED:
3852  *         if (!self->priv->success)
3853  *           g_task_return_new_error (task, ...);
3854  *         else
3855  *           g_task_return_boolean (task, TRUE);
3856  *         g_object_unref (task);
3857  *         break;
3858  *     }
3859  * }
3860  *
3861  * static gboolean
3862  * foo_init_finish (GAsyncInitable       *initable,
3863  *                  GAsyncResult         *result,
3864  *                  GError              **error)
3865  * {
3866  *   g_return_val_if_fail (g_task_is_valid (result, initable), FALSE);
3867  *
3868  *   return g_task_propagate_boolean (G_TASK (result), error);
3869  * }
3870  *
3871  * static void
3872  * foo_async_initable_iface_init (gpointer g_iface,
3873  *                                gpointer data)
3874  * {
3875  *   GAsyncInitableIface *iface = g_iface;
3876  *
3877  *   iface->init_async = foo_init_async;
3878  *   iface->init_finish = foo_init_finish;
3879  * }
3880  * ]|
3881  */
3882
3883
3884 /**
3885  * SECTION:gasyncresult
3886  * @short_description: Asynchronous Function Results
3887  * @include: gio/gio.h
3888  * @see_also: #GTask
3889  *
3890  * Provides a base class for implementing asynchronous function results.
3891  *
3892  * Asynchronous operations are broken up into two separate operations
3893  * which are chained together by a #GAsyncReadyCallback. To begin
3894  * an asynchronous operation, provide a #GAsyncReadyCallback to the
3895  * asynchronous function. This callback will be triggered when the
3896  * operation has completed, and will be passed a #GAsyncResult instance
3897  * filled with the details of the operation's success or failure, the
3898  * object the asynchronous function was started for and any error codes
3899  * returned. The asynchronous callback function is then expected to call
3900  * the corresponding "_finish()" function, passing the object the
3901  * function was called for, the #GAsyncResult instance, and (optionally)
3902  * an @error to grab any error conditions that may have occurred.
3903  *
3904  * The "_finish()" function for an operation takes the generic result
3905  * (of type #GAsyncResult) and returns the specific result that the
3906  * operation in question yields (e.g. a #GFileEnumerator for a
3907  * "enumerate children" operation). If the result or error status of the
3908  * operation is not needed, there is no need to call the "_finish()"
3909  * function; GIO will take care of cleaning up the result and error
3910  * information after the #GAsyncReadyCallback returns. You can pass
3911  * %NULL for the #GAsyncReadyCallback if you don't need to take any
3912  * action at all after the operation completes. Applications may also
3913  * take a reference to the #GAsyncResult and call "_finish()" later;
3914  * however, the "_finish()" function may be called at most once.
3915  *
3916  * Example of a typical asynchronous operation flow:
3917  * |[
3918  * void _theoretical_frobnitz_async (Theoretical         *t,
3919  *                                   GCancellable        *c,
3920  *                                   GAsyncReadyCallback *cb,
3921  *                                   gpointer             u);
3922  *
3923  * gboolean _theoretical_frobnitz_finish (Theoretical   *t,
3924  *                                        GAsyncResult  *res,
3925  *                                        GError       **e);
3926  *
3927  * static void
3928  * frobnitz_result_func (GObject      *source_object,
3929  *               GAsyncResult *res,
3930  *               gpointer      user_data)
3931  * {
3932  *   gboolean success = FALSE;
3933  *
3934  *   success = _theoretical_frobnitz_finish (source_object, res, NULL);
3935  *
3936  *   if (success)
3937  *     g_printf ("Hurray!\n");
3938  *   else
3939  *     g_printf ("Uh oh!\n");
3940  *
3941  *   /<!-- -->* ... *<!-- -->/
3942  *
3943  * }
3944  *
3945  * int main (int argc, void *argv[])
3946  * {
3947  *    /<!-- -->* ... *<!-- -->/
3948  *
3949  *    _theoretical_frobnitz_async (theoretical_data,
3950  *                                 NULL,
3951  *                                 frobnitz_result_func,
3952  *                                 NULL);
3953  *
3954  *    /<!-- -->* ... *<!-- -->/
3955  * }
3956  * ]|
3957  *
3958  * The callback for an asynchronous operation is called only once, and is
3959  * always called, even in the case of a cancelled operation. On cancellation
3960  * the result is a %G_IO_ERROR_CANCELLED error.
3961  *
3962  * <para id="io-priority"><indexterm><primary>I/O
3963  * priority</primary></indexterm> Many I/O-related asynchronous
3964  * operations have a priority parameter, which is used in certain
3965  * cases to determine the order in which operations are executed. They
3966  * are <emphasis>not</emphasis> used to determine system-wide I/O
3967  * scheduling. Priorities are integers, with lower numbers indicating
3968  * higher priority. It is recommended to choose priorities between
3969  * %G_PRIORITY_LOW and %G_PRIORITY_HIGH, with %G_PRIORITY_DEFAULT as a
3970  * default. </para>
3971  */
3972
3973
3974 /**
3975  * SECTION:gbufferedinputstream
3976  * @short_description: Buffered Input Stream
3977  * @include: gio/gio.h
3978  * @see_also: #GFilterInputStream, #GInputStream
3979  *
3980  * Buffered input stream implements #GFilterInputStream and provides
3981  * for buffered reads.
3982  *
3983  * By default, #GBufferedInputStream's buffer size is set at 4 kilobytes.
3984  *
3985  * To create a buffered input stream, use g_buffered_input_stream_new(),
3986  * or g_buffered_input_stream_new_sized() to specify the buffer's size at
3987  * construction.
3988  *
3989  * To get the size of a buffer within a buffered input stream, use
3990  * g_buffered_input_stream_get_buffer_size(). To change the size of a
3991  * buffered input stream's buffer, use
3992  * g_buffered_input_stream_set_buffer_size(). Note that the buffer's size
3993  * cannot be reduced below the size of the data within the buffer.
3994  */
3995
3996
3997 /**
3998  * SECTION:gbufferedoutputstream
3999  * @short_description: Buffered Output Stream
4000  * @include: gio/gio.h
4001  * @see_also: #GFilterOutputStream, #GOutputStream
4002  *
4003  * Buffered output stream implements #GFilterOutputStream and provides
4004  * for buffered writes.
4005  *
4006  * By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes.
4007  *
4008  * To create a buffered output stream, use g_buffered_output_stream_new(),
4009  * or g_buffered_output_stream_new_sized() to specify the buffer's size
4010  * at construction.
4011  *
4012  * To get the size of a buffer within a buffered input stream, use
4013  * g_buffered_output_stream_get_buffer_size(). To change the size of a
4014  * buffered output stream's buffer, use
4015  * g_buffered_output_stream_set_buffer_size(). Note that the buffer's
4016  * size cannot be reduced below the size of the data within the buffer.
4017  */
4018
4019
4020 /**
4021  * SECTION:gcancellable
4022  * @short_description: Thread-safe Operation Cancellation Stack
4023  * @include: gio/gio.h
4024  *
4025  * GCancellable is a thread-safe operation cancellation stack used
4026  * throughout GIO to allow for cancellation of synchronous and
4027  * asynchronous operations.
4028  */
4029
4030
4031 /**
4032  * SECTION:gcharsetconverter
4033  * @short_description: Convert between charsets
4034  * @include: gio/gio.h
4035  *
4036  * #GCharsetConverter is an implementation of #GConverter based on
4037  * GIConv.
4038  */
4039
4040
4041 /**
4042  * SECTION:gcontenttype
4043  * @short_description: Platform-specific content typing
4044  * @include: gio/gio.h
4045  *
4046  * A content type is a platform specific string that defines the type
4047  * 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".
4048  * On Win32 it is an extension string like ".doc", ".txt" or a perceived
4049  * string like "audio". Such strings can be looked up in the registry at
4050  * HKEY_CLASSES_ROOT.
4051  */
4052
4053
4054 /**
4055  * SECTION:gconverter
4056  * @short_description: Data conversion interface
4057  * @include: gio/gio.h
4058  * @see_also: #GInputStream, #GOutputStream
4059  *
4060  * #GConverter is implemented by objects that convert
4061  * binary data in various ways. The conversion can be
4062  * stateful and may fail at any place.
4063  *
4064  * Some example conversions are: character set conversion,
4065  * compression, decompression and regular expression
4066  * replace.
4067  *
4068  * Since: 2.24
4069  */
4070
4071
4072 /**
4073  * SECTION:gconverterinputstream
4074  * @short_description: Converter Input Stream
4075  * @include: gio/gio.h
4076  * @see_also: #GInputStream, #GConverter
4077  *
4078  * Converter input stream implements #GInputStream and allows
4079  * conversion of data of various types during reading.
4080  *
4081  * As of GLib 2.34, #GConverterInputStream implements
4082  * #GPollableInputStream.
4083  */
4084
4085
4086 /**
4087  * SECTION:gconverteroutputstream
4088  * @short_description: Converter Output Stream
4089  * @include: gio/gio.h
4090  * @see_also: #GOutputStream, #GConverter
4091  *
4092  * Converter output stream implements #GOutputStream and allows
4093  * conversion of data of various types during reading.
4094  *
4095  * As of GLib 2.34, #GConverterOutputStream implements
4096  * #GPollableOutputStream.
4097  */
4098
4099
4100 /**
4101  * SECTION:gcredentials
4102  * @short_description: An object containing credentials
4103  * @include: gio/gio.h
4104  *
4105  * The #GCredentials type is a reference-counted wrapper for native
4106  * credentials. This information is typically used for identifying,
4107  * authenticating and authorizing other processes.
4108  *
4109  * Some operating systems supports looking up the credentials of the
4110  * remote peer of a communication endpoint - see e.g.
4111  * g_socket_get_credentials().
4112  *
4113  * Some operating systems supports securely sending and receiving
4114  * credentials over a Unix Domain Socket, see
4115  * #GUnixCredentialsMessage, g_unix_connection_send_credentials() and
4116  * g_unix_connection_receive_credentials() for details.
4117  *
4118  * On Linux, the native credential type is a <type>struct ucred</type>
4119  * - see the
4120  * <citerefentry><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry>
4121  * man page for details. This corresponds to
4122  * %G_CREDENTIALS_TYPE_LINUX_UCRED.
4123  *
4124  * On FreeBSD, the native credential type is a <type>struct cmsgcred</type>.
4125  * This corresponds to %G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED.
4126  *
4127  * On OpenBSD, the native credential type is a <type>struct sockpeercred</type>.
4128  * This corresponds to %G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED.
4129  */
4130
4131
4132 /**
4133  * SECTION:gdatainputstream
4134  * @short_description: Data Input Stream
4135  * @include: gio/gio.h
4136  * @see_also: #GInputStream
4137  *
4138  * Data input stream implements #GInputStream and includes functions for
4139  * reading structured data directly from a binary input stream.
4140  */
4141
4142
4143 /**
4144  * SECTION:gdataoutputstream
4145  * @short_description: Data Output Stream
4146  * @include: gio/gio.h
4147  * @see_also: #GOutputStream
4148  *
4149  * Data output stream implements #GOutputStream and includes functions for
4150  * writing data directly to an output stream.
4151  */
4152
4153
4154 /**
4155  * SECTION:gdbusactiongroup
4156  * @title: GDBusActionGroup
4157  * @short_description: A D-Bus GActionGroup implementation
4158  * @see_also: <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
4159  *
4160  * #GDBusActionGroup is an implementation of the #GActionGroup
4161  * interface that can be used as a proxy for an action group
4162  * that is exported over D-Bus with g_dbus_connection_export_action_group().
4163  */
4164
4165
4166 /**
4167  * SECTION:gdbusaddress
4168  * @title: D-Bus Addresses
4169  * @short_description: D-Bus connection endpoints
4170  * @include: gio/gio.h
4171  *
4172  * Routines for working with D-Bus addresses. A D-Bus address is a string
4173  * like "unix:tmpdir=/tmp/my-app-name". The exact format of addresses
4174  * is explained in detail in the <link linkend="http://dbus.freedesktop.org/doc/dbus-specification.html&num;addresses">D-Bus specification</link>.
4175  */
4176
4177
4178 /**
4179  * SECTION:gdbusauthobserver
4180  * @short_description: Object used for authenticating connections
4181  * @include: gio/gio.h
4182  *
4183  * The #GDBusAuthObserver type provides a mechanism for participating
4184  * in how a #GDBusServer (or a #GDBusConnection) authenticates remote
4185  * peers. Simply instantiate a #GDBusAuthObserver and connect to the
4186  * signals you are interested in. Note that new signals may be added
4187  * in the future
4188  *
4189  * For example, if you only want to allow D-Bus connections from
4190  * processes owned by the same uid as the server, you would use a
4191  * signal handler like the following:
4192  * <example id="auth-observer"><title>Controlling Authentication</title><programlisting>
4193  * static gboolean
4194  * on_authorize_authenticated_peer (GDBusAuthObserver *observer,
4195  *                                  GIOStream         *stream,
4196  *                                  GCredentials      *credentials,
4197  *                                  gpointer           user_data)
4198  * {
4199  *   gboolean authorized;
4200  *
4201  *   authorized = FALSE;
4202  *   if (credentials != NULL)
4203  *     {
4204  *       GCredentials *own_credentials;
4205  *       own_credentials = g_credentials_new ();
4206  *       if (g_credentials_is_same_user (credentials, own_credentials, NULL))
4207  *         authorized = TRUE;
4208  *       g_object_unref (own_credentials);
4209  *     }
4210  *
4211  *   return authorized;
4212  * }
4213  * </programlisting></example>
4214  */
4215
4216
4217 /**
4218  * SECTION:gdbusconnection
4219  * @short_description: D-Bus Connections
4220  * @include: gio/gio.h
4221  *
4222  * The #GDBusConnection type is used for D-Bus connections to remote
4223  * peers such as a message buses. It is a low-level API that offers a
4224  * lot of flexibility. For instance, it lets you establish a connection
4225  * over any transport that can by represented as an #GIOStream.
4226  *
4227  * This class is rarely used directly in D-Bus clients. If you are writing
4228  * an D-Bus client, it is often easier to use the g_bus_own_name(),
4229  * g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs.
4230  *
4231  * As an exception to the usual GLib rule that a particular object must not be
4232  * used by two threads at the same time, #GDBusConnection's methods may be
4233  * called from any thread<footnote>
4234  * <para>
4235  *   This is so that g_bus_get() and g_bus_get_sync() can safely return the
4236  *   same #GDBusConnection when called from any thread.
4237  * </para>
4238  * </footnote>.
4239  *
4240  * Most of the ways to obtain a #GDBusConnection automatically initialize it
4241  * (i.e. connect to D-Bus): for instance, g_dbus_connection_new() and
4242  * g_bus_get(), and the synchronous versions of those methods, give you an
4243  * initialized connection. Language bindings for GIO should use
4244  * g_initable_new() or g_async_initable_new_async(), which also initialize the
4245  * connection.
4246  *
4247  * If you construct an uninitialized #GDBusConnection, such as via
4248  * g_object_new(), you must initialize it via g_initable_init() or
4249  * g_async_initable_init_async() before using its methods or properties.
4250  * Calling methods or accessing properties on a #GDBusConnection that has not
4251  * completed initialization successfully is considered to be invalid, and leads
4252  * to undefined behaviour. In particular, if initialization fails with a
4253  * #GError, the only valid thing you can do with that #GDBusConnection is to
4254  * free it with g_object_unref().
4255  *
4256  * <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>
4257  *
4258  * <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>
4259  *
4260  * <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>
4261  *
4262  * <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>
4263  */
4264
4265
4266 /**
4267  * SECTION:gdbuserror
4268  * @title: GDBusError
4269  * @short_description: Mapping D-Bus errors to and from GError
4270  * @include: gio/gio.h
4271  *
4272  * All facilities that return errors from remote methods (such as
4273  * g_dbus_connection_call_sync()) use #GError to represent both D-Bus
4274  * errors (e.g. errors returned from the other peer) and locally
4275  * in-process generated errors.
4276  *
4277  * To check if a returned #GError is an error from a remote peer, use
4278  * g_dbus_error_is_remote_error(). To get the actual D-Bus error name,
4279  * use g_dbus_error_get_remote_error(). Before presenting an error,
4280  * always use g_dbus_error_strip_remote_error().
4281  *
4282  * In addition, facilities used to return errors to a remote peer also
4283  * use #GError. See g_dbus_method_invocation_return_error() for
4284  * discussion about how the D-Bus error name is set.
4285  *
4286  * Applications can associate a #GError error domain with a set of D-Bus errors in order to
4287  * automatically map from D-Bus errors to #GError and back. This
4288  * is typically done in the function returning the #GQuark for the
4289  * error domain:
4290  * <example id="error-registration"><title>Error Registration</title><programlisting>
4291  * /<!-- -->* foo-bar-error.h: *<!-- -->/
4292  *
4293  * #define FOO_BAR_ERROR (foo_bar_error_quark ())
4294  * GQuark foo_bar_error_quark (void);
4295  *
4296  * typedef enum
4297  * {
4298  *   FOO_BAR_ERROR_FAILED,
4299  *   FOO_BAR_ERROR_ANOTHER_ERROR,
4300  *   FOO_BAR_ERROR_SOME_THIRD_ERROR,
4301  *   FOO_BAR_N_ERRORS /<!-- -->*< skip >*<!-- -->/
4302  * } FooBarError;
4303  *
4304  * /<!-- -->* foo-bar-error.c: *<!-- -->/
4305  *
4306  * static const GDBusErrorEntry foo_bar_error_entries[] =
4307  * {
4308  *   {FOO_BAR_ERROR_FAILED,           "org.project.Foo.Bar.Error.Failed"},
4309  *   {FOO_BAR_ERROR_ANOTHER_ERROR,    "org.project.Foo.Bar.Error.AnotherError"},
4310  *   {FOO_BAR_ERROR_SOME_THIRD_ERROR, "org.project.Foo.Bar.Error.SomeThirdError"},
4311  * };
4312  *
4313  * /<!-- -->* Ensure that every error code has an associated D-Bus error name *<!-- -->/
4314  * G_STATIC_ASSERT (G_N_ELEMENTS (foo_bar_error_entries) == FOO_BAR_N_ERRORS);
4315  *
4316  * GQuark
4317  * foo_bar_error_quark (void)
4318  * {
4319  *   static volatile gsize quark_volatile = 0;
4320  *   g_dbus_error_register_error_domain ("foo-bar-error-quark",
4321  *                                       &quark_volatile,
4322  *                                       foo_bar_error_entries,
4323  *                                       G_N_ELEMENTS (foo_bar_error_entries));
4324  *   return (GQuark) quark_volatile;
4325  * }
4326  * </programlisting></example>
4327  * With this setup, a D-Bus peer can transparently pass e.g. %FOO_BAR_ERROR_ANOTHER_ERROR and
4328  * other peers will see the D-Bus error name <literal>org.project.Foo.Bar.Error.AnotherError</literal>.
4329  *
4330  * If the other peer is using GDBus, and has registered the association with
4331  * g_dbus_error_register_error_domain() in advance (e.g. by invoking the %FOO_BAR_ERROR quark
4332  * generation itself in the previous example) the peer will see also %FOO_BAR_ERROR_ANOTHER_ERROR instead
4333  * of %G_IO_ERROR_DBUS_ERROR. Note that GDBus clients can still recover
4334  * <literal>org.project.Foo.Bar.Error.AnotherError</literal> using g_dbus_error_get_remote_error().
4335  *
4336  * Note that errors in the %G_DBUS_ERROR error domain is intended only
4337  * for returning errors from a remote message bus process. Errors
4338  * generated locally in-process by e.g. #GDBusConnection is from the
4339  * %G_IO_ERROR domain.
4340  */
4341
4342
4343 /**
4344  * SECTION:gdbusinterface
4345  * @short_description: Base type for D-Bus interfaces
4346  * @include: gio/gio.h
4347  *
4348  * The #GDBusInterface type is the base type for D-Bus interfaces both
4349  * on the service side (see #GDBusInterfaceSkeleton) and client side
4350  * (see #GDBusProxy).
4351  */
4352
4353
4354 /**
4355  * SECTION:gdbusinterfaceskeleton
4356  * @short_description: Service-side D-Bus interface
4357  * @include: gio/gio.h
4358  *
4359  * Abstract base class for D-Bus interfaces on the service side.
4360  */
4361
4362
4363 /**
4364  * SECTION:gdbusintrospection
4365  * @title: D-Bus Introspection Data
4366  * @short_description: Node and interface description data structures
4367  * @include: gio/gio.h
4368  *
4369  * Various data structures and convenience routines to parse and
4370  * generate D-Bus introspection XML. Introspection information is
4371  * used when registering objects with g_dbus_connection_register_object().
4372  *
4373  * The format of D-Bus introspection XML is specified in the
4374  * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format">D-Bus specification</ulink>.
4375  */
4376
4377
4378 /**
4379  * SECTION:gdbusmenumodel
4380  * @title: GDBusMenuModel
4381  * @short_description: A D-Bus GMenuModel implementation
4382  * @see_also: <link linkend="gio-GMenuModel-exporter">GMenuModel Exporter</link>
4383  *
4384  * #GDBusMenuModel is an implementation of #GMenuModel that can be used
4385  * as a proxy for a menu model that is exported over D-Bus with
4386  * g_dbus_connection_export_menu_model().
4387  */
4388
4389
4390 /**
4391  * SECTION:gdbusmessage
4392  * @short_description: D-Bus Message
4393  * @include: gio/gio.h
4394  *
4395  * A type for representing D-Bus messages that can be sent or received
4396  * on a #GDBusConnection.
4397  */
4398
4399
4400 /**
4401  * SECTION:gdbusmethodinvocation
4402  * @short_description: Object for handling remote calls
4403  * @include: gio/gio.h
4404  *
4405  * Instances of the #GDBusMethodInvocation class are used when
4406  * handling D-Bus method calls. It provides a way to asynchronously
4407  * return results and errors.
4408  *
4409  * The normal way to obtain a #GDBusMethodInvocation object is to receive
4410  * it as an argument to the handle_method_call() function in a
4411  * #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object().
4412  */
4413
4414
4415 /**
4416  * SECTION:gdbusnameowning
4417  * @title: Owning Bus Names
4418  * @short_description: Simple API for owning bus names
4419  * @include: gio/gio.h
4420  *
4421  * Convenience API for owning bus names.
4422  *
4423  * <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>
4424  */
4425
4426
4427 /**
4428  * SECTION:gdbusnamewatching
4429  * @title: Watching Bus Names
4430  * @short_description: Simple API for watching bus names
4431  * @include: gio/gio.h
4432  *
4433  * Convenience API for watching bus names.
4434  *
4435  * <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>
4436  */
4437
4438
4439 /**
4440  * SECTION:gdbusobject
4441  * @short_description: Base type for D-Bus objects
4442  * @include: gio/gio.h
4443  *
4444  * The #GDBusObject type is the base type for D-Bus objects on both
4445  * the service side (see #GDBusObjectSkeleton) and the client side
4446  * (see #GDBusObjectProxy). It is essentially just a container of
4447  * interfaces.
4448  */
4449
4450
4451 /**
4452  * SECTION:gdbusobjectmanager
4453  * @short_description: Base type for D-Bus object managers
4454  * @include: gio/gio.h
4455  *
4456  * The #GDBusObjectManager type is the base type for service- and
4457  * client-side implementations of the standardized <ulink
4458  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4459  * interface.
4460  *
4461  * See #GDBusObjectManagerClient for the client-side implementation
4462  * and #GDBusObjectManagerServer for the service-side implementation.
4463  */
4464
4465
4466 /**
4467  * SECTION:gdbusobjectmanagerclient
4468  * @short_description: Client-side object manager
4469  * @include: gio/gio.h
4470  *
4471  * #GDBusObjectManagerClient is used to create, monitor and delete object
4472  * proxies for remote objects exported by a #GDBusObjectManagerServer (or any
4473  * code implementing the <ulink
4474  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4475  * interface).
4476  *
4477  * Once an instance of this type has been created, you can connect to
4478  * the #GDBusObjectManager::object-added and
4479  * #GDBusObjectManager::object-removed signals and inspect the
4480  * #GDBusObjectProxy objects returned by
4481  * g_dbus_object_manager_get_objects().
4482  *
4483  * If the name for a #GDBusObjectManagerClient is not owned by anyone at
4484  * object construction time, the default behavior is to request the
4485  * message bus to launch an owner for the name. This behavior can be
4486  * disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
4487  * flag. It's also worth noting that this only works if the name of
4488  * interest is activatable in the first place. E.g. in some cases it
4489  * is not possible to launch an owner for the requested name. In this
4490  * case, #GDBusObjectManagerClient object construction still succeeds but
4491  * there will be no object proxies
4492  * (e.g. g_dbus_object_manager_get_objects() returns the empty list) and
4493  * the #GDBusObjectManagerClient:name-owner property is %NULL.
4494  *
4495  * The owner of the requested name can come and go (for example
4496  * consider a system service being restarted) â€“ #GDBusObjectManagerClient
4497  * handles this case too; simply connect to the #GObject::notify
4498  * signal to watch for changes on the #GDBusObjectManagerClient:name-owner
4499  * property. When the name owner vanishes, the behavior is that
4500  * #GDBusObjectManagerClient:name-owner is set to %NULL (this includes
4501  * emission of the #GObject::notify signal) and then
4502  * #GDBusObjectManager::object-removed signals are synthesized
4503  * for all currently existing object proxies. Since
4504  * #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can
4505  * use this information to disambiguate a synthesized signal from a
4506  * genuine signal caused by object removal on the remote
4507  * #GDBusObjectManager. Similarly, when a new name owner appears,
4508  * #GDBusObjectManager::object-added signals are synthesized
4509  * while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all
4510  * object proxies have been added, the #GDBusObjectManagerClient:name-owner
4511  * is set to the new name owner (this includes emission of the
4512  * #GObject::notify signal).  Furthermore, you are guaranteed that
4513  * #GDBusObjectManagerClient:name-owner will alternate between a name owner
4514  * (e.g. <literal>:1.42</literal>) and %NULL even in the case where
4515  * the name of interest is atomically replaced
4516  *
4517  * Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy
4518  * instances. All signals (including the
4519  * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
4520  * signal) delivered to #GDBusProxy instances are guaranteed to
4521  * originate from the name owner. This guarantee along with the
4522  * behavior described above, means that certain race conditions
4523  * including the <emphasis><quote>half the proxy is from the old owner
4524  * and the other half is from the new owner</quote></emphasis> problem
4525  * cannot happen.
4526  *
4527  * To avoid having the application connect to signals on the returned
4528  * #GDBusObjectProxy and #GDBusProxy objects, the
4529  * #GDBusObject::interface-added,
4530  * #GDBusObject::interface-removed,
4531  * #GDBusProxy::g-properties-changed and
4532  * #GDBusProxy::g-signal signals
4533  * are also emitted on the #GDBusObjectManagerClient instance managing these
4534  * objects. The signals emitted are
4535  * #GDBusObjectManager::interface-added,
4536  * #GDBusObjectManager::interface-removed,
4537  * #GDBusObjectManagerClient::interface-proxy-properties-changed and
4538  * #GDBusObjectManagerClient::interface-proxy-signal.
4539  *
4540  * Note that all callbacks and signals are emitted in the
4541  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4542  * that the #GDBusObjectManagerClient object was constructed
4543  * in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects
4544  * originating from the #GDBusObjectManagerClient object will be created in
4545  * the same context and, consequently, will deliver signals in the
4546  * same main loop.
4547  */
4548
4549
4550 /**
4551  * SECTION:gdbusobjectmanagerserver
4552  * @short_description: Service-side object manager
4553  * @include: gio/gio.h
4554  *
4555  * #GDBusObjectManagerServer is used to export #GDBusObject instances using
4556  * the standardized <ulink
4557  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4558  * interface. For example, remote D-Bus clients can get all objects
4559  * and properties in a single call. Additionally, any change in the
4560  * object hierarchy is broadcast using signals. This means that D-Bus
4561  * clients can keep caches up to date by only listening to D-Bus
4562  * signals.
4563  *
4564  * See #GDBusObjectManagerClient for the client-side code that is
4565  * intended to be used with #GDBusObjectManagerServer or any D-Bus
4566  * object implementing the org.freedesktop.DBus.ObjectManager
4567  * interface.
4568  */
4569
4570
4571 /**
4572  * SECTION:gdbusobjectproxy
4573  * @short_description: Client-side D-Bus object
4574  * @include: gio/gio.h
4575  *
4576  * A #GDBusObjectProxy is an object used to represent a remote object
4577  * with one or more D-Bus interfaces. Normally, you don't instantiate
4578  * a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient
4579  * is used to obtain it.
4580  *
4581  * Since: 2.30
4582  */
4583
4584
4585 /**
4586  * SECTION:gdbusobjectskeleton
4587  * @short_description: Service-side D-Bus object
4588  * @include: gio/gio.h
4589  *
4590  * A #GDBusObjectSkeleton instance is essentially a group of D-Bus
4591  * interfaces. The set of exported interfaces on the object may be
4592  * dynamic and change at runtime.
4593  *
4594  * This type is intended to be used with #GDBusObjectManager.
4595  */
4596
4597
4598 /**
4599  * SECTION:gdbusproxy
4600  * @short_description: Client-side D-Bus interface proxy
4601  * @include: gio/gio.h
4602  *
4603  * #GDBusProxy is a base class used for proxies to access a D-Bus
4604  * interface on a remote object. A #GDBusProxy can be constructed for
4605  * both well-known and unique names.
4606  *
4607  * By default, #GDBusProxy will cache all properties (and listen to
4608  * changes) of the remote object, and proxy all signals that gets
4609  * emitted. This behaviour can be changed by passing suitable
4610  * #GDBusProxyFlags when the proxy is created. If the proxy is for a
4611  * well-known name, the property cache is flushed when the name owner
4612  * vanishes and reloaded when a name owner appears.
4613  *
4614  * If a #GDBusProxy is used for a well-known name, the owner of the
4615  * name is tracked and can be read from
4616  * #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to
4617  * get notified of changes. Additionally, only signals and property
4618  * changes emitted from the current name owner are considered and
4619  * calls are always sent to the current name owner. This avoids a
4620  * number of race conditions when the name is lost by one owner and
4621  * claimed by another. However, if no name owner currently exists,
4622  * then calls will be sent to the well-known name which may result in
4623  * the message bus launching an owner (unless
4624  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set).
4625  *
4626  * The generic #GDBusProxy::g-properties-changed and
4627  * #GDBusProxy::g-signal signals are not very convenient to work
4628  * with. Therefore, the recommended way of working with proxies is to
4629  * subclass #GDBusProxy, and have more natural properties and signals
4630  * in your derived class. See <xref linkend="gdbus-example-gdbus-codegen"/>
4631  * for how this can easily be done using the
4632  * <command><link linkend="gdbus-codegen">gdbus-codegen</link></command>
4633  * tool.
4634  *
4635  * A #GDBusProxy instance can be used from multiple threads but note
4636  * that all signals (e.g. #GDBusProxy::g-signal, #GDBusProxy::g-properties-changed
4637  * and #GObject::notify) are emitted in the
4638  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4639  * of the thread where the instance was constructed.
4640  *
4641  * <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>
4642  */
4643
4644
4645 /**
4646  * SECTION:gdbusserver
4647  * @short_description: Helper for accepting connections
4648  * @include: gio/gio.h
4649  *
4650  * #GDBusServer is a helper for listening to and accepting D-Bus
4651  * connections. This can be used to create a new D-Bus server, allowing two
4652  * peers to use the D-Bus protocol for their own specialized communication.
4653  * A server instance provided in this way will not perform message routing or
4654  * implement the org.freedesktop.DBus interface.
4655  *
4656  * To just export an object on a well-known name on a message bus, such as the
4657  * session or system bus, you should instead use g_bus_own_name().
4658  *
4659  * <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>
4660  */
4661
4662
4663 /**
4664  * SECTION:gdbusutils
4665  * @title: D-Bus Utilities
4666  * @short_description: Various utilities related to D-Bus.
4667  * @include: gio/gio.h
4668  *
4669  * Various utility routines related to D-Bus.
4670  */
4671
4672
4673 /**
4674  * SECTION:gdesktopappinfo
4675  * @title: GDesktopAppInfo
4676  * @short_description: Application information from desktop files
4677  * @include: gio/gdesktopappinfo.h
4678  *
4679  * #GDesktopAppInfo is an implementation of #GAppInfo based on
4680  * desktop files.
4681  *
4682  * Note that <filename>&lt;gio/gdesktopappinfo.h&gt;</filename> belongs to
4683  * the UNIX-specific GIO interfaces, thus you have to use the
4684  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4685  */
4686
4687
4688 /**
4689  * SECTION:gdrive
4690  * @short_description: Drive management
4691  * @include: gio/gio.h
4692  *
4693  * #GDrive - this represent a piece of hardware connected to the machine.
4694  * It's generally only created for removable hardware or hardware with
4695  * removable media.
4696  *
4697  * #GDrive is a container class for #GVolume objects that stem from
4698  * the same piece of media. As such, #GDrive abstracts a drive with
4699  * (or without) removable media and provides operations for querying
4700  * whether media is available, determining whether media change is
4701  * automatically detected and ejecting the media.
4702  *
4703  * If the #GDrive reports that media isn't automatically detected, one
4704  * can poll for media; typically one should not do this periodically
4705  * as a poll for media operation is potententially expensive and may
4706  * spin up the drive creating noise.
4707  *
4708  * #GDrive supports starting and stopping drives with authentication
4709  * support for the former. This can be used to support a diverse set
4710  * of use cases including connecting/disconnecting iSCSI devices,
4711  * powering down external disk enclosures and starting/stopping
4712  * multi-disk devices such as RAID devices. Note that the actual
4713  * semantics and side-effects of starting/stopping a #GDrive may vary
4714  * according to implementation. To choose the correct verbs in e.g. a
4715  * file manager, use g_drive_get_start_stop_type().
4716  *
4717  * For porting from GnomeVFS note that there is no equivalent of
4718  * #GDrive in that API.
4719  */
4720
4721
4722 /**
4723  * SECTION:gemblem
4724  * @short_description: An object for emblems
4725  * @include: gio/gio.h
4726  * @see_also: #GIcon, #GEmblemedIcon, #GLoadableIcon, #GThemedIcon
4727  *
4728  * #GEmblem is an implementation of #GIcon that supports
4729  * having an emblem, which is an icon with additional properties.
4730  * It can than be added to a #GEmblemedIcon.
4731  *
4732  * Currently, only metainformation about the emblem's origin is
4733  * supported. More may be added in the future.
4734  */
4735
4736
4737 /**
4738  * SECTION:gemblemedicon
4739  * @short_description: Icon with emblems
4740  * @include: gio/gio.h
4741  * @see_also: #GIcon, #GLoadableIcon, #GThemedIcon, #GEmblem
4742  *
4743  * #GEmblemedIcon is an implementation of #GIcon that supports
4744  * adding an emblem to an icon. Adding multiple emblems to an
4745  * icon is ensured via g_emblemed_icon_add_emblem().
4746  *
4747  * Note that #GEmblemedIcon allows no control over the position
4748  * of the emblems. See also #GEmblem for more information.
4749  */
4750
4751
4752 /**
4753  * SECTION:gfile
4754  * @short_description: File and Directory Handling
4755  * @include: gio/gio.h
4756  * @see_also: #GFileInfo, #GFileEnumerator
4757  *
4758  * #GFile is a high level abstraction for manipulating files on a
4759  * virtual file system. #GFiles are lightweight, immutable objects
4760  * that do no I/O upon creation. It is necessary to understand that
4761  * #GFile objects do not represent files, merely an identifier for a
4762  * file. All file content I/O is implemented as streaming operations
4763  * (see #GInputStream and #GOutputStream).
4764  *
4765  * To construct a #GFile, you can use:
4766  * <simplelist>
4767  * <member>g_file_new_for_path() if you have a path.</member>
4768  * <member>g_file_new_for_uri() if you have a URI.</member>
4769  * <member>g_file_new_for_commandline_arg() for a command line argument.</member>
4770  * <member>g_file_new_tmp() to create a temporary file from a template.</member>
4771  * <member>g_file_parse_name() from a UTF-8 string gotten from g_file_get_parse_name().</member>
4772  * </simplelist>
4773  *
4774  * One way to think of a #GFile is as an abstraction of a pathname. For
4775  * normal files the system pathname is what is stored internally, but as
4776  * #GFiles are extensible it could also be something else that corresponds
4777  * to a pathname in a userspace implementation of a filesystem.
4778  *
4779  * #GFiles make up hierarchies of directories and files that correspond to
4780  * the files on a filesystem. You can move through the file system with
4781  * #GFile using g_file_get_parent() to get an identifier for the parent
4782  * directory, g_file_get_child() to get a child within a directory,
4783  * g_file_resolve_relative_path() to resolve a relative path between two
4784  * #GFiles. There can be multiple hierarchies, so you may not end up at
4785  * the same root if you repeatedly call g_file_get_parent() on two different
4786  * files.
4787  *
4788  * All #GFiles have a basename (get with g_file_get_basename()). These names
4789  * are byte strings that are used to identify the file on the filesystem
4790  * (relative to its parent directory) and there is no guarantees that they
4791  * have any particular charset encoding or even make any sense at all. If
4792  * you want to use filenames in a user interface you should use the display
4793  * name that you can get by requesting the
4794  * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info().
4795  * This is guaranteed to be in UTF-8 and can be used in a user interface.
4796  * But always store the real basename or the #GFile to use to actually
4797  * access the file, because there is no way to go from a display name to
4798  * the actual name.
4799  *
4800  * Using #GFile as an identifier has the same weaknesses as using a path
4801  * in that there may be multiple aliases for the same file. For instance,
4802  * hard or soft links may cause two different #GFiles to refer to the same
4803  * file. Other possible causes for aliases are: case insensitive filesystems,
4804  * short and long names on FAT/NTFS, or bind mounts in Linux. If you want to
4805  * check if two #GFiles point to the same file you can query for the
4806  * %G_FILE_ATTRIBUTE_ID_FILE attribute. Note that #GFile does some trivial
4807  * canonicalization of pathnames passed in, so that trivial differences in
4808  * the path string used at creation (duplicated slashes, slash at end of
4809  * path, "." or ".." path segments, etc) does not create different #GFiles.
4810  *
4811  * Many #GFile operations have both synchronous and asynchronous versions
4812  * to suit your application. Asynchronous versions of synchronous functions
4813  * simply have _async() appended to their function names. The asynchronous
4814  * I/O functions call a #GAsyncReadyCallback which is then used to finalize
4815  * the operation, producing a GAsyncResult which is then passed to the
4816  * function's matching _finish() operation.
4817  *
4818  * Some #GFile operations do not have synchronous analogs, as they may
4819  * take a very long time to finish, and blocking may leave an application
4820  * unusable. Notable cases include:
4821  * <simplelist>
4822  * <member>g_file_mount_mountable() to mount a mountable file.</member>
4823  * <member>g_file_unmount_mountable_with_operation() to unmount a mountable file.</member>
4824  * <member>g_file_eject_mountable_with_operation() to eject a mountable file.</member>
4825  * </simplelist>
4826  *
4827  * <para id="gfile-etag"><indexterm><primary>entity tag</primary></indexterm>
4828  * One notable feature of #GFiles are entity tags, or "etags" for
4829  * short. Entity tags are somewhat like a more abstract version of the
4830  * traditional mtime, and can be used to quickly determine if the file has
4831  * been modified from the version on the file system. See the HTTP 1.1
4832  * <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">specification</ulink>
4833  * for HTTP Etag headers, which are a very similar concept.
4834  * </para>
4835  */
4836
4837
4838 /**
4839  * SECTION:gfileattribute
4840  * @short_description: Key-Value Paired File Attributes
4841  * @include: gio/gio.h
4842  * @see_also: #GFile, #GFileInfo
4843  *
4844  * File attributes in GIO consist of a list of key-value pairs.
4845  *
4846  * Keys are strings that contain a key namespace and a key name, separated
4847  * by a colon, e.g. "namespace::keyname". Namespaces are included to sort
4848  * key-value pairs by namespaces for relevance. Keys can be retrived
4849  * using wildcards, e.g. "standard::*" will return all of the keys in the
4850  * "standard" namespace.
4851  *
4852  * The list of possible attributes for a filesystem (pointed to by a #GFile) is
4853  * available as a #GFileAttributeInfoList. This list is queryable by key names
4854  * as indicated earlier.
4855  *
4856  * Information is stored within the list in #GFileAttributeInfo structures.
4857  * The info structure can store different types, listed in the enum
4858  * #GFileAttributeType. Upon creation of a #GFileAttributeInfo, the type will
4859  * be set to %G_FILE_ATTRIBUTE_TYPE_INVALID.
4860  *
4861  * Classes that implement #GFileIface will create a #GFileAttributeInfoList and
4862  * install default keys and values for their given file system, architecture,
4863  * and other possible implementation details (e.g., on a UNIX system, a file
4864  * attribute key will be registered for the user id for a given file).
4865  *
4866  * <para>
4867  * <table>
4868  * <title>GFileAttributes Default Namespaces</title>
4869  * <tgroup cols='2' align='left'><thead>
4870  * <row><entry>Namspace</entry><entry>Description</entry></row>
4871  * </thead>
4872  * <tbody>
4873  * <row><entry>"standard"</entry><entry>The "Standard" namespace. General file
4874  * information that any application may need should be put in this namespace.
4875  * Examples include the file's name, type, and size.</entry></row>
4876  * <row><entry>"etag"</entry><entry>The <link linkend="gfile-etag">"Entity Tag"</link>
4877  * namespace. Currently, the only key in this namespace is "value", which contains
4878  * the value of the current entity tag.</entry></row>
4879  * <row><entry>"id"</entry><entry>The "Identification" namespace. This
4880  * namespace is used by file managers and applications that list directories
4881  * to check for loops and to uniquely identify files.</entry></row>
4882  * <row><entry>"access"</entry><entry>The "Access" namespace. Used to check
4883  * if a user has the proper privilidges to access files and perform
4884  * file operations. Keys in this namespace are made to be generic
4885  * and easily understood, e.g. the "can_read" key is %TRUE if
4886  * the current user has permission to read the file. UNIX permissions and
4887  * NTFS ACLs in Windows should be mapped to these values.</entry></row>
4888  * <row><entry>"mountable"</entry><entry>The "Mountable" namespace. Includes
4889  * simple boolean keys for checking if a file or path supports mount operations, e.g.
4890  * mount, unmount, eject. These are used for files of type %G_FILE_TYPE_MOUNTABLE.</entry></row>
4891  * <row><entry>"time"</entry><entry>The "Time" namespace. Includes file
4892  * access, changed, created times. </entry></row>
4893  * <row><entry>"unix"</entry><entry>The "Unix" namespace. Includes UNIX-specific
4894  * information and may not be available for all files. Examples include
4895  * the UNIX "UID", "GID", etc.</entry></row>
4896  * <row><entry>"dos"</entry><entry>The "DOS" namespace. Includes DOS-specific
4897  * information and may not be available for all files. Examples include
4898  * "is_system" for checking if a file is marked as a system file, and "is_archive"
4899  * for checking if a file is marked as an archive file.</entry></row>
4900  * <row><entry>"owner"</entry><entry>The "Owner" namespace. Includes information
4901  * about who owns a file. May not be available for all file systems. Examples include
4902  * "user" for getting the user name of the file owner. This information is often mapped from
4903  * some backend specific data such as a unix UID.</entry></row>
4904  * <row><entry>"thumbnail"</entry><entry>The "Thumbnail" namespace. Includes
4905  * information about file thumbnails and their location within the file system. Examples of
4906  * keys in this namespace include "path" to get the location of a thumbnail, and "failed"
4907  * to check if thumbnailing of the file failed.</entry></row>
4908  * <row><entry>"filesystem"</entry><entry>The "Filesystem" namespace. Gets information
4909  * about the file system where a file is located, such as its type, how much
4910  * space is left available, and the overall size of the file system.</entry></row>
4911  * <row><entry>"gvfs"</entry><entry>The "GVFS" namespace. Keys in this namespace
4912  * contain information about the current GVFS backend in use. </entry></row>
4913  * <row><entry>"xattr"</entry><entry>The "xattr" namespace. Gets information
4914  * about extended user attributes. See attr(5). The "user." prefix of the
4915  * extended user attribute name is stripped away when constructing keys in
4916  * this namespace, e.g. "xattr::mime_type" for the extended attribute with
4917  * the name "user.mime_type". Note that this information is only available
4918  * if GLib has been built with extended attribute support.</entry></row>
4919  * <row><entry>"xattr-sys"</entry><entry>The "xattr-sys" namespace.
4920  * Gets information about extended attributes which are not user-specific.
4921  * See attr(5). Note that this information is only available if GLib
4922  * has been built with extended attribute support.</entry></row>
4923  * <row><entry>"selinux"</entry><entry>The "SELinux" namespace. Includes
4924  * information about the SELinux context of files. Note that this information
4925  * is only available if GLib has been built with SELinux support.</entry></row>
4926  * </tbody>
4927  * </tgroup>
4928  * </table>
4929  * </para>
4930  *
4931  * Please note that these are not all of the possible namespaces.
4932  * More namespaces can be added from GIO modules or by individual applications.
4933  * For more information about writing GIO modules, see #GIOModule.
4934  *
4935  * <!-- TODO: Implementation note about using extended attributes on supported
4936  * file systems -->
4937  *
4938  * <para><table>
4939  * <title>GFileAttributes Built-in Keys and Value Types</title>
4940  * <tgroup cols='3' align='left'><thead>
4941  * <row><entry>Enum Value</entry><entry>Namespace::Key</entry><entry>Value Type</entry></row>
4942  * </thead><tbody>
4943  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TYPE</entry><entry>standard::type</entry><entry>uint32 (#GFileType)</entry></row>
4944  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN</entry><entry>standard::is-hidden</entry><entry>boolean</entry></row>
4945  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP</entry><entry>standard::is-backup</entry><entry>boolean</entry></row>
4946  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK</entry><entry>standard::is-symlink</entry><entry>boolean</entry></row>
4947  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL</entry><entry>standard::is-virtual</entry><entry>boolean</entry></row>
4948  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_NAME</entry><entry>standard::name</entry><entry>byte string</entry></row>
4949  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME</entry><entry>standard::display-name</entry><entry>string</entry></row>
4950  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME</entry><entry>standard::edit-name</entry><entry>string</entry></row>
4951  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ICON</entry><entry>standard::icon</entry><entry>object (#GIcon)</entry></row>
4952  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE</entry><entry>standard::content-type</entry><entry>string</entry></row>
4953  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE</entry><entry>standard::fast-content-type</entry><entry>string</entry></row>
4954  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SIZE</entry><entry>standard::size</entry><entry>uint64</entry></row>
4955  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE</entry><entry>standard::allocated-size</entry><entry>uint64</entry></row>
4956  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET</entry><entry>standard::symlink-target</entry><entry>byte string</entry></row>
4957  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TARGET_URI</entry><entry>standard::target-uri</entry><entry>string</entry></row>
4958  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER</entry><entry>standard::sort-order</entry><entry>int32</entry></row>
4959  * <row><entry>%G_FILE_ATTRIBUTE_ETAG_VALUE</entry><entry>etag::value</entry><entry>string</entry></row>
4960  * <row><entry>%G_FILE_ATTRIBUTE_ID_FILE</entry><entry>id::file</entry><entry>string</entry></row>
4961  * <row><entry>%G_FILE_ATTRIBUTE_ID_FILESYSTEM</entry><entry>id::filesystem</entry><entry>string</entry></row>
4962  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_READ</entry><entry>access::can-read</entry><entry>boolean</entry></row>
4963  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE</entry><entry>access::can-write</entry><entry>boolean</entry></row>
4964  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE</entry><entry>access::can-execute</entry><entry>boolean</entry></row>
4965  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE</entry><entry>access::can-delete</entry><entry>boolean</entry></row>
4966  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH</entry><entry>access::can-trash</entry><entry>boolean</entry></row>
4967  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME</entry><entry>access::can-rename</entry><entry>boolean</entry></row>
4968  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT</entry><entry>mountable::can-mount</entry><entry>boolean</entry></row>
4969  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT</entry><entry>mountable::can-unmount</entry><entry>boolean</entry></row>
4970  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT</entry><entry>mountable::can-eject</entry><entry>boolean</entry></row>
4971  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE</entry><entry>mountable::unix-device</entry><entry>uint32</entry></row>
4972  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE</entry><entry>mountable::unix-device-file</entry><entry>string</entry></row>
4973  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI</entry><entry>mountable::hal-udi</entry><entry>string</entry></row>
4974  * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED</entry><entry>time::modified</entry><entry>uint64</entry></row>
4975  * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC</entry><entry>time::modified-usec</entry><entry>uint32</entry></row>
4976  * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS</entry><entry>time::access</entry><entry>uint64</entry></row>
4977  * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS_USEC</entry><entry>time::access-usec</entry><entry>uint32</entry></row>
4978  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED</entry><entry>time::changed</entry><entry>uint64</entry></row>
4979  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED_USEC</entry><entry>time::changed-usec</entry><entry>uint32</entry></row>
4980  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED</entry><entry>time::created</entry><entry>uint64</entry></row>
4981  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED_USEC</entry><entry>time::created-usec</entry><entry>uint32</entry></row>
4982  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_DEVICE</entry><entry>unix::device</entry><entry>uint32</entry></row>
4983  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_INODE</entry><entry>unix::inode</entry><entry>uint64</entry></row>
4984  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_MODE</entry><entry>unix::mode</entry><entry>uint32</entry></row>
4985  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_NLINK</entry><entry>unix::nlink</entry><entry>uint32</entry></row>
4986  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_UID</entry><entry>unix::uid</entry><entry>uint32</entry></row>
4987  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_GID</entry><entry>unix::gid</entry><entry>uint32</entry></row>
4988  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_RDEV</entry><entry>unix::rdev</entry><entry>uint32</entry></row>
4989  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE</entry><entry>unix::block-size</entry><entry>uint32</entry></row>
4990  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCKS</entry><entry>unix::blocks</entry><entry>uint64</entry></row>
4991  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT</entry><entry>unix::is-mountpoint</entry><entry>boolean</entry></row>
4992  * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE</entry><entry>dos::is-archive</entry><entry>boolean</entry></row>
4993  * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_SYSTEM</entry><entry>dos::is-system</entry><entry>boolean</entry></row>
4994  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER</entry><entry>owner::user</entry><entry>string</entry></row>
4995  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER_REAL</entry><entry>owner::user-real</entry><entry>string</entry></row>
4996  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_GROUP</entry><entry>owner::group</entry><entry>string</entry></row>
4997  * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAIL_PATH</entry><entry>thumbnail::path</entry><entry>bytestring</entry></row>
4998  * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAILING_FAILED</entry><entry>thumbnail::failed</entry><entry>boolean</entry></row>
4999  * <row><entry>%G_FILE_ATTRIBUTE_PREVIEW_ICON</entry><entry>preview::icon</entry><entry>object (#GIcon)</entry></row>
5000  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_SIZE</entry><entry>filesystem::size</entry><entry>uint64</entry></row>
5001  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_FREE</entry><entry>filesystem::free</entry><entry>uint64</entry></row>
5002  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_USED</entry><entry>filesystem::used</entry><entry>uint64</entry></row>
5003  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_TYPE</entry><entry>filesystem::type</entry><entry>string</entry></row>
5004  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_READONLY</entry><entry>filesystem::readonly</entry><entry>boolean</entry></row>
5005  * <row><entry>%G_FILE_ATTRIBUTE_GVFS_BACKEND</entry><entry>gvfs::backend</entry><entry>string</entry></row>
5006  * <row><entry>%G_FILE_ATTRIBUTE_SELINUX_CONTEXT</entry><entry>selinux::context</entry><entry>string</entry></row>
5007  * </tbody></tgroup></table></para>
5008  *
5009  * Note that there are no predefined keys in the "xattr" and "xattr-sys"
5010  * namespaces. Keys for the "xattr" namespace are constructed by stripping
5011  * away the "user." prefix from the extended user attribute, and prepending
5012  * "xattr::". Keys for the "xattr-sys" namespace are constructed by
5013  * concatenating "xattr-sys::" with the extended attribute name. All extended
5014  * attribute values are returned as hex-encoded strings in which bytes outside
5015  * the ASCII range are encoded as hexadecimal escape sequences of the form
5016  * \x<replaceable>nn</replaceable>.
5017  */
5018
5019
5020 /**
5021  * SECTION:gfiledescriptorbased
5022  * @short_description: Interface for file descriptor based IO
5023  * @include: gio/gfiledescriptorbased.h
5024  * @see_also: #GInputStream, #GOutputStream
5025  *
5026  * #GFileDescriptorBased is implemented by streams (implementations of
5027  * #GInputStream or #GOutputStream) that are based on file descriptors.
5028  *
5029  * Note that <filename>&lt;gio/gfiledescriptorbased.h&gt;</filename> belongs to
5030  * the UNIX-specific GIO interfaces, thus you have to use the
5031  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
5032  *
5033  * Since: 2.24
5034  */
5035
5036
5037 /**
5038  * SECTION:gfileenumerator
5039  * @short_description: Enumerated Files Routines
5040  * @include: gio/gio.h
5041  *
5042  * #GFileEnumerator allows you to operate on a set of #GFile<!-- -->s,
5043  * returning a #GFileInfo structure for each file enumerated (e.g.
5044  * g_file_enumerate_children() will return a #GFileEnumerator for each
5045  * of the children within a directory).
5046  *
5047  * To get the next file's information from a #GFileEnumerator, use
5048  * g_file_enumerator_next_file() or its asynchronous version,
5049  * g_file_enumerator_next_files_async(). Note that the asynchronous
5050  * version will return a list of #GFileInfo<!---->s, whereas the
5051  * synchronous will only return the next file in the enumerator.
5052  *
5053  * To close a #GFileEnumerator, use g_file_enumerator_close(), or
5054  * its asynchronous version, g_file_enumerator_close_async(). Once
5055  * a #GFileEnumerator is closed, no further actions may be performed
5056  * on it, and it should be freed with g_object_unref().
5057  */
5058
5059
5060 /**
5061  * SECTION:gfileicon
5062  * @short_description: Icons pointing to an image file
5063  * @include: gio/gio.h
5064  * @see_also: #GIcon, #GLoadableIcon
5065  *
5066  * #GFileIcon specifies an icon by pointing to an image file
5067  * to be used as icon.
5068  */
5069
5070
5071 /**
5072  * SECTION:gfileinfo
5073  * @short_description: File Information and Attributes
5074  * @include: gio/gio.h
5075  * @see_also: #GFile, <link linkend="gio-GFileAttribute">GFileAttribute</link>
5076  *
5077  * Functionality for manipulating basic metadata for files. #GFileInfo
5078  * implements methods for getting information that all files should
5079  * contain, and allows for manipulation of extended attributes.
5080  *
5081  * See <link linkend="gio-GFileAttribute">GFileAttribute</link> for more
5082  * information on how GIO handles file attributes.
5083  *
5084  * To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
5085  * async variant). To obtain a #GFileInfo for a file input or output
5086  * stream, use g_file_input_stream_query_info() or
5087  * g_file_output_stream_query_info() (or their async variants).
5088  *
5089  * To change the actual attributes of a file, you should then set the
5090  * attribute in the #GFileInfo and call g_file_set_attributes_from_info()
5091  * or g_file_set_attributes_async() on a GFile.
5092  *
5093  * However, not all attributes can be changed in the file. For instance,
5094  * the actual size of a file cannot be changed via g_file_info_set_size().
5095  * You may call g_file_query_settable_attributes() and
5096  * g_file_query_writable_namespaces() to discover the settable attributes
5097  * of a particular file at runtime.
5098  *
5099  * #GFileAttributeMatcher allows for searching through a #GFileInfo for
5100  * attributes.
5101  */
5102
5103
5104 /**
5105  * SECTION:gfileinputstream
5106  * @short_description: File input streaming operations
5107  * @include: gio/gio.h
5108  * @see_also: #GInputStream, #GDataInputStream, #GSeekable
5109  *
5110  * GFileInputStream provides input streams that take their
5111  * content from a file.
5112  *
5113  * GFileInputStream implements #GSeekable, which allows the input
5114  * stream to jump to arbitrary positions in the file, provided the
5115  * filesystem of the file allows it. To find the position of a file
5116  * input stream, use g_seekable_tell(). To find out if a file input
5117  * stream supports seeking, use g_seekable_can_seek().
5118  * To position a file input stream, use g_seekable_seek().
5119  */
5120
5121
5122 /**
5123  * SECTION:gfileiostream
5124  * @short_description: File read and write streaming operations
5125  * @include: gio/gio.h
5126  * @see_also: #GIOStream, #GFileInputStream, #GFileOutputStream, #GSeekable
5127  *
5128  * GFileIOStream provides io streams that both read and write to the same
5129  * file handle.
5130  *
5131  * GFileIOStream implements #GSeekable, which allows the io
5132  * stream to jump to arbitrary positions in the file and to truncate
5133  * the file, provided the filesystem of the file supports these
5134  * operations.
5135  *
5136  * To find the position of a file io stream, use
5137  * g_seekable_tell().
5138  *
5139  * To find out if a file io stream supports seeking, use g_seekable_can_seek().
5140  * To position a file io stream, use g_seekable_seek().
5141  * To find out if a file io stream supports truncating, use
5142  * g_seekable_can_truncate(). To truncate a file io
5143  * stream, use g_seekable_truncate().
5144  *
5145  * The default implementation of all the #GFileIOStream operations
5146  * and the implementation of #GSeekable just call into the same operations
5147  * on the output stream.
5148  *
5149  * Since: 2.22
5150  */
5151
5152
5153 /**
5154  * SECTION:gfilemonitor
5155  * @short_description: File Monitor
5156  * @include: gio/gio.h
5157  *
5158  * Monitors a file or directory for changes.
5159  *
5160  * To obtain a #GFileMonitor for a file or directory, use
5161  * g_file_monitor(), g_file_monitor_file(), or
5162  * g_file_monitor_directory().
5163  *
5164  * To get informed about changes to the file or directory you are
5165  * monitoring, connect to the #GFileMonitor::changed signal. The
5166  * signal will be emitted in the <link
5167  * linkend="g-main-context-push-thread-default">thread-default main
5168  * context</link> of the thread that the monitor was created in
5169  * (though if the global default main context is blocked, this may
5170  * cause notifications to be blocked even if the thread-default
5171  * context is still running).
5172  */
5173
5174
5175 /**
5176  * SECTION:gfilenamecompleter
5177  * @short_description: Filename Completer
5178  * @include: gio/gio.h
5179  *
5180  * Completes partial file and directory names given a partial string by
5181  * looking in the file system for clues. Can return a list of possible
5182  * completion strings for widget implementations.
5183  */
5184
5185
5186 /**
5187  * SECTION:gfileoutputstream
5188  * @short_description: File output streaming operations
5189  * @include: gio/gio.h
5190  * @see_also: #GOutputStream, #GDataOutputStream, #GSeekable
5191  *
5192  * GFileOutputStream provides output streams that write their
5193  * content to a file.
5194  *
5195  * GFileOutputStream implements #GSeekable, which allows the output
5196  * stream to jump to arbitrary positions in the file and to truncate
5197  * the file, provided the filesystem of the file supports these
5198  * operations.
5199  *
5200  * To find the position of a file output stream, use g_seekable_tell().
5201  * To find out if a file output stream supports seeking, use
5202  * g_seekable_can_seek().To position a file output stream, use
5203  * g_seekable_seek(). To find out if a file output stream supports
5204  * truncating, use g_seekable_can_truncate(). To truncate a file output
5205  * stream, use g_seekable_truncate().
5206  */
5207
5208
5209 /**
5210  * SECTION:gfilterinputstream
5211  * @short_description: Filter Input Stream
5212  * @include: gio/gio.h
5213  *
5214  * Base class for input stream implementations that perform some
5215  * kind of filtering operation on a base stream. Typical examples
5216  * of filtering operations are character set conversion, compression
5217  * and byte order flipping.
5218  */
5219
5220
5221 /**
5222  * SECTION:gfilteroutputstream
5223  * @short_description: Filter Output Stream
5224  * @include: gio/gio.h
5225  *
5226  * Base class for output stream implementations that perform some
5227  * kind of filtering operation on a base stream. Typical examples
5228  * of filtering operations are character set conversion, compression
5229  * and byte order flipping.
5230  */
5231
5232
5233 /**
5234  * SECTION:gicon
5235  * @short_description: Interface for icons
5236  * @include: gio/gio.h
5237  *
5238  * #GIcon is a very minimal interface for icons. It provides functions
5239  * for checking the equality of two icons, hashing of icons and
5240  * serializing an icon to and from strings.
5241  *
5242  * #GIcon does not provide the actual pixmap for the icon as this is out
5243  * of GIO's scope, however implementations of #GIcon may contain the name
5244  * of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
5245  *
5246  * To obtain a hash of a #GIcon, see g_icon_hash().
5247  *
5248  * To check if two #GIcons are equal, see g_icon_equal().
5249  *
5250  * For serializing a #GIcon, use g_icon_to_string() and
5251  * g_icon_new_for_string().
5252  *
5253  * If your application or library provides one or more #GIcon
5254  * implementations you need to ensure that each #GType is registered
5255  * with the type system prior to calling g_icon_new_for_string().
5256  */
5257
5258
5259 /**
5260  * SECTION:ginetaddress
5261  * @short_description: An IPv4/IPv6 address
5262  *
5263  * #GInetAddress represents an IPv4 or IPv6 internet address. Use
5264  * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
5265  * look up the #GInetAddress for a hostname. Use
5266  * g_resolver_lookup_by_address() or
5267  * g_resolver_lookup_by_address_async() to look up the hostname for a
5268  * #GInetAddress.
5269  *
5270  * To actually connect to a remote host, you will need a
5271  * #GInetSocketAddress (which includes a #GInetAddress as well as a
5272  * port number).
5273  */
5274
5275
5276 /**
5277  * SECTION:ginetaddressmask
5278  * @short_description: An IPv4/IPv6 address mask
5279  *
5280  * #GInetAddressMask represents a range of IPv4 or IPv6 addresses
5281  * described by a base address and a length indicating how many bits
5282  * of the base address are relevant for matching purposes. These are
5283  * often given in string form. Eg, "10.0.0.0/8", or "fe80::/10".
5284  */
5285
5286
5287 /**
5288  * SECTION:ginetsocketaddress
5289  * @short_description: Internet GSocketAddress
5290  *
5291  * An IPv4 or IPv6 socket address; that is, the combination of a
5292  * #GInetAddress and a port number.
5293  */
5294
5295
5296 /**
5297  * SECTION:ginitable
5298  * @short_description: Failable object initialization interface
5299  * @include: gio/gio.h
5300  * @see_also: #GAsyncInitable
5301  *
5302  * #GInitable is implemented by objects that can fail during
5303  * initialization. If an object implements this interface then
5304  * it must be initialized as the first thing after construction,
5305  * either via g_initable_init() or g_async_initable_init_async()
5306  * (the latter is only available if it also implements #GAsyncInitable).
5307  *
5308  * If the object is not initialized, or initialization returns with an
5309  * error, then all operations on the object except g_object_ref() and
5310  * g_object_unref() are considered to be invalid, and have undefined
5311  * behaviour. They will often fail with g_critical() or g_warning(), but
5312  * this must not be relied on.
5313  *
5314  * Users of objects implementing this are not intended to use
5315  * the interface method directly, instead it will be used automatically
5316  * in various ways. For C applications you generally just call
5317  * g_initable_new() directly, or indirectly via a foo_thing_new() wrapper.
5318  * This will call g_initable_init() under the cover, returning %NULL and
5319  * setting a #GError on failure (at which point the instance is
5320  * unreferenced).
5321  *
5322  * For bindings in languages where the native constructor supports
5323  * exceptions the binding could check for objects implemention %GInitable
5324  * during normal construction and automatically initialize them, throwing
5325  * an exception on failure.
5326  */
5327
5328
5329 /**
5330  * SECTION:ginputstream
5331  * @short_description: Base class for implementing streaming input
5332  * @include: gio/gio.h
5333  *
5334  * #GInputStream has functions to read from a stream (g_input_stream_read()),
5335  * to close a stream (g_input_stream_close()) and to skip some content
5336  * (g_input_stream_skip()).
5337  *
5338  * To copy the content of an input stream to an output stream without
5339  * manually handling the reads and writes, use g_output_stream_splice().
5340  *
5341  * All of these functions have async variants too.
5342  */
5343
5344
5345 /**
5346  * SECTION:gioerror
5347  * @short_description: Error helper functions
5348  * @include: gio/gio.h
5349  *
5350  * Contains helper functions for reporting errors to the user.
5351  */
5352
5353
5354 /**
5355  * SECTION:giomodule
5356  * @short_description: Loadable GIO Modules
5357  * @include: gio/gio.h
5358  *
5359  * Provides an interface and default functions for loading and unloading
5360  * modules. This is used internally to make GIO extensible, but can also
5361  * be used by others to implement module loading.
5362  */
5363
5364
5365 /**
5366  * SECTION:gioscheduler
5367  * @short_description: I/O Scheduler
5368  * @include: gio/gio.h
5369  *
5370  * <note><para>
5371  *   As of GLib 2.36, the <literal>g_io_scheduler</literal> methods
5372  *   are deprecated in favor of #GThreadPool and #GTask.
5373  * </para></note>
5374  *
5375  * Schedules asynchronous I/O operations. #GIOScheduler integrates
5376  * into the main event loop (#GMainLoop) and uses threads.
5377  */
5378
5379
5380 /**
5381  * SECTION:giostream
5382  * @short_description: Base class for implementing read/write streams
5383  * @include: gio/gio.h
5384  * @see_also: #GInputStream, #GOutputStream
5385  *
5386  * GIOStream represents an object that has both read and write streams.
5387  * Generally the two streams acts as separate input and output streams,
5388  * but they share some common resources and state. For instance, for
5389  * seekable streams they may use the same position in both streams.
5390  *
5391  * Examples of #GIOStream objects are #GSocketConnection which represents
5392  * a two-way network connection, and #GFileIOStream which represent a
5393  * file handle opened in read-write mode.
5394  *
5395  * To do the actual reading and writing you need to get the substreams
5396  * with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
5397  *
5398  * The #GIOStream object owns the input and the output streams, not the other
5399  * way around, so keeping the substreams alive will not keep the #GIOStream
5400  * object alive. If the #GIOStream object is freed it will be closed, thus
5401  * closing the substream, so even if the substreams stay alive they will
5402  * always just return a %G_IO_ERROR_CLOSED for all operations.
5403  *
5404  * To close a stream use g_io_stream_close() which will close the common
5405  * stream object and also the individual substreams. You can also close
5406  * the substreams themselves. In most cases this only marks the
5407  * substream as closed, so further I/O on it fails. However, some streams
5408  * may support "half-closed" states where one direction of the stream
5409  * is actually shut down.
5410  *
5411  * Since: 2.22
5412  */
5413
5414
5415 /**
5416  * SECTION:gloadableicon
5417  * @short_description: Loadable Icons
5418  * @include: gio/gio.h
5419  * @see_also: #GIcon, #GThemedIcon
5420  *
5421  * Extends the #GIcon interface and adds the ability to
5422  * load icons from streams.
5423  */
5424
5425
5426 /**
5427  * SECTION:gmemoryinputstream
5428  * @short_description: Streaming input operations on memory chunks
5429  * @include: gio/gio.h
5430  * @see_also: #GMemoryOutputStream
5431  *
5432  * #GMemoryInputStream is a class for using arbitrary
5433  * memory chunks as input for GIO streaming input operations.
5434  *
5435  * As of GLib 2.34, #GMemoryInputStream implements
5436  * #GPollableInputStream.
5437  */
5438
5439
5440 /**
5441  * SECTION:gmemoryoutputstream
5442  * @short_description: Streaming output operations on memory chunks
5443  * @include: gio/gio.h
5444  * @see_also: #GMemoryInputStream
5445  *
5446  * #GMemoryOutputStream is a class for using arbitrary
5447  * memory chunks as output for GIO streaming output operations.
5448  *
5449  * As of GLib 2.34, #GMemoryOutputStream implements
5450  * #GPollableOutputStream.
5451  */
5452
5453
5454 /**
5455  * SECTION:gmenu
5456  * @title: GMenu
5457  * @short_description: A simple implementation of GMenuModel
5458  *
5459  * #GMenu is a simple implementation of #GMenuModel.
5460  * You populate a #GMenu by adding #GMenuItem instances to it.
5461  *
5462  * There are some convenience functions to allow you to directly
5463  * add items (avoiding #GMenuItem) for the common cases. To add
5464  * a regular item, use g_menu_insert(). To add a section, use
5465  * g_menu_insert_section(). To add a submenu, use
5466  * g_menu_insert_submenu().
5467  */
5468
5469
5470 /**
5471  * SECTION:gmenuexporter
5472  * @title: GMenuModel exporter
5473  * @short_description: Export GMenuModels on D-Bus
5474  * @see_also: #GMenuModel, #GDBusMenuModel
5475  *
5476  * These functions support exporting a #GMenuModel on D-Bus.
5477  * The D-Bus interface that is used is a private implementation
5478  * detail.
5479  *
5480  * To access an exported #GMenuModel remotely, use
5481  * g_dbus_menu_model_get() to obtain a #GDBusMenuModel.
5482  */
5483
5484
5485 /**
5486  * SECTION:gmenumodel
5487  * @title: GMenuModel
5488  * @short_description: An abstract class representing the contents of a menu
5489  * @see_also: #GActionGroup
5490  *
5491  * #GMenuModel represents the contents of a menu -- an ordered list of
5492  * menu items. The items are associated with actions, which can be
5493  * activated through them. Items can be grouped in sections, and may
5494  * have submenus associated with them. Both items and sections usually
5495  * have some representation data, such as labels or icons. The type of
5496  * the associated action (ie whether it is stateful, and what kind of
5497  * state it has) can influence the representation of the item.
5498  *
5499  * The conceptual model of menus in #GMenuModel is hierarchical:
5500  * sections and submenus are again represented by #GMenuModels.
5501  * Menus themselves do not define their own roles. Rather, the role
5502  * of a particular #GMenuModel is defined by the item that references
5503  * it (or, in the case of the 'root' menu, is defined by the context
5504  * in which it is used).
5505  *
5506  * As an example, consider the visible portions of the menu in
5507  * <xref linkend="menu-example"/>.
5508  *
5509  * <figure id="menu-example">
5510  *   <title>An example menu</title>
5511  *   <graphic fileref="menu-example.png" format="PNG"></graphic>
5512  * </figure>
5513  *
5514  * There are 8 "menus" visible in the screenshot: one menubar, two
5515  * submenus and 5 sections:
5516  * <itemizedlist>
5517  * <listitem>the toplevel menubar (containing 4 items)</listitem>
5518  * <listitem>the View submenu (containing 3 sections)</listitem>
5519  * <listitem>the first section of the View submenu (containing 2 items)</listitem>
5520  * <listitem>the second section of the View submenu (containing 1 item)</listitem>
5521  * <listitem>the final section of the View submenu (containing 1 item)</listitem>
5522  * <listitem>the Highlight Mode submenu (containing 2 sections)</listitem>
5523  * <listitem>the Sources section (containing 2 items)</listitem>
5524  * <listitem>the Markup section (containing 2 items)</listitem>
5525  * </itemizedlist>
5526  *
5527  * <xref linkend="menu-model"/> illustrates the conceptual connection between
5528  * these 8 menus. Each large block in the figure represents a menu and the
5529  * smaller blocks within the large block represent items in that menu. Some
5530  * items contain references to other menus.
5531  *
5532  * <figure id="menu-model">
5533  *   <title>A menu model</title>
5534  *   <graphic fileref="menu-model.png" format="PNG"></graphic>
5535  * </figure>
5536  *
5537  * Notice that the separators visible in <xref linkend="menu-example"/>
5538  * appear nowhere in <xref linkend="menu-model"/>. This is because
5539  * separators are not explicitly represented in the menu model. Instead,
5540  * a separator is inserted between any two non-empty sections of a menu.
5541  * Section items can have labels just like any other item. In that case,
5542  * a display system may show a section header instead of a separator.
5543  *
5544  * The motivation for this abstract model of application controls is
5545  * that modern user interfaces tend to make these controls available
5546  * outside the application. Examples include global menus, jumplists,
5547  * dash boards, etc. To support such uses, it is necessary to 'export'
5548  * information about actions and their representation in menus, which
5549  * is exactly what the
5550  * <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
5551  * and the
5552  * <link linkend="gio-GMenuModel-exporter">GMenuModel exporter</link>
5553  * do for #GActionGroup and #GMenuModel. The client-side counterparts
5554  * to make use of the exported information are #GDBusActionGroup and
5555  * #GDBusMenuModel.
5556  *
5557  * The API of #GMenuModel is very generic, with iterators for the
5558  * attributes and links of an item, see g_menu_model_iterate_item_attributes()
5559  * and g_menu_model_iterate_item_links(). The 'standard' attributes and
5560  * link types have predefined names: %G_MENU_ATTRIBUTE_LABEL,
5561  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, %G_MENU_LINK_SECTION
5562  * and %G_MENU_LINK_SUBMENU.
5563  *
5564  * Items in a #GMenuModel represent active controls if they refer to
5565  * an action that can get activated when the user interacts with the
5566  * menu item. The reference to the action is encoded by the string id
5567  * in the %G_MENU_ATTRIBUTE_ACTION attribute. An action id uniquely
5568  * identifies an action in an action group. Which action group(s) provide
5569  * actions depends on the context in which the menu model is used.
5570  * E.g. when the model is exported as the application menu of a
5571  * #GtkApplication, actions can be application-wide or window-specific
5572  * (and thus come from two different action groups). By convention, the
5573  * application-wide actions have names that start with "app.", while the
5574  * names of window-specific actions start with "win.".
5575  *
5576  * While a wide variety of stateful actions is possible, the following
5577  * is the minimum that is expected to be supported by all users of exported
5578  * menu information:
5579  * <itemizedlist>
5580  * <listitem>an action with no parameter type and no state</listitem>
5581  * <listitem>an action with no parameter type and boolean state</listitem>
5582  * <listitem>an action with string parameter type and string state</listitem>
5583  * </itemizedlist>
5584  *
5585  * <formalpara><title>Stateless</title>
5586  * <para>
5587  * A stateless action typically corresponds to an ordinary menu item.
5588  * </para>
5589  * <para>
5590  * Selecting such a menu item will activate the action (with no parameter).
5591  * </para>
5592  * </formalpara>
5593  *
5594  * <formalpara><title>Boolean State</title>
5595  * <para>
5596  * An action with a boolean state will most typically be used with a "toggle"
5597  * or "switch" menu item. The state can be set directly, but activating the
5598  * action (with no parameter) results in the state being toggled.
5599  * </para>
5600  * <para>
5601  * Selecting a toggle menu item will activate the action. The menu item should
5602  * be rendered as "checked" when the state is true.
5603  * </para>
5604  * </formalpara>
5605  *
5606  * <formalpara><title>String Parameter and State</title>
5607  * <para>
5608  * Actions with string parameters and state will most typically be used to
5609  * represent an enumerated choice over the items available for a group of
5610  * radio menu items. Activating the action with a string parameter is
5611  * equivalent to setting that parameter as the state.
5612  * </para>
5613  * <para>
5614  * Radio menu items, in addition to being associated with the action, will
5615  * have a target value. Selecting that menu item will result in activation
5616  * of the action with the target value as the parameter. The menu item should
5617  * be rendered as "selected" when the state of the action is equal to the
5618  * target value of the menu item.
5619  * </para>
5620  * </formalpara>
5621  */
5622
5623
5624 /**
5625  * SECTION:gmount
5626  * @short_description: Mount management
5627  * @include: gio/gio.h
5628  * @see_also: GVolume, GUnixMountEntry, GUnixMountPoint
5629  *
5630  * The #GMount interface represents user-visible mounts. Note, when
5631  * porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume.
5632  *
5633  * #GMount is a "mounted" filesystem that you can access. Mounted is in
5634  * quotes because it's not the same as a unix mount, it might be a gvfs
5635  * mount, but you can still access the files on it if you use GIO. Might or
5636  * might not be related to a volume object.
5637  *
5638  * Unmounting a #GMount instance is an asynchronous operation. For
5639  * more information about asynchronous operations, see #GAsyncResult
5640  * and #GTask. To unmount a #GMount instance, first call
5641  * g_mount_unmount_with_operation() with (at least) the #GMount instance and a
5642  * #GAsyncReadyCallback.  The callback will be fired when the
5643  * operation has resolved (either with success or failure), and a
5644  * #GAsyncReady structure will be passed to the callback.  That
5645  * callback should then call g_mount_unmount_with_operation_finish() with the #GMount
5646  * and the #GAsyncReady data to see if the operation was completed
5647  * successfully.  If an @error is present when g_mount_unmount_with_operation_finish()
5648  * is called, then it will be filled with any error information.
5649  */
5650
5651
5652 /**
5653  * SECTION:gmountoperation
5654  * @short_description: Object used for authentication and user interaction
5655  * @include: gio/gio.h
5656  *
5657  * #GMountOperation provides a mechanism for interacting with the user.
5658  * It can be used for authenticating mountable operations, such as loop
5659  * mounting files, hard drive partitions or server locations. It can
5660  * also be used to ask the user questions or show a list of applications
5661  * preventing unmount or eject operations from completing.
5662  *
5663  * Note that #GMountOperation is used for more than just #GMount
5664  * objects â€“ for example it is also used in g_drive_start() and
5665  * g_drive_stop().
5666  *
5667  * Users should instantiate a subclass of this that implements all the
5668  * various callbacks to show the required dialogs, such as
5669  * #GtkMountOperation. If no user interaction is desired (for example
5670  * when automounting filesystems at login time), usually %NULL can be
5671  * passed, see each method taking a #GMountOperation for details.
5672  */
5673
5674
5675 /**
5676  * SECTION:gnetworkaddress
5677  * @short_description: A GSocketConnectable for resolving hostnames
5678  * @include: gio/gio.h
5679  *
5680  * #GNetworkAddress provides an easy way to resolve a hostname and
5681  * then attempt to connect to that host, handling the possibility of
5682  * multiple IP addresses and multiple address families.
5683  *
5684  * See #GSocketConnectable for and example of using the connectable
5685  * interface.
5686  */
5687
5688
5689 /**
5690  * SECTION:gnetworking
5691  * @title: gnetworking.h
5692  * @short_description: System networking includes
5693  * @include: gio/gnetworking.h
5694  *
5695  * The <literal>gnetworking.h</literal> header can be included to get
5696  * various low-level networking-related system headers, automatically
5697  * taking care of certain portability issues for you.
5698  *
5699  * This can be used, for example, if you want to call setsockopt()
5700  * on a #GSocket.
5701  *
5702  * Note that while WinSock has many of the same APIs as the
5703  * traditional UNIX socket API, most of them behave at least slightly
5704  * differently (particularly with respect to error handling). If you
5705  * want your code to work under both UNIX and Windows, you will need
5706  * to take these differences into account.
5707  *
5708  * Also, under glibc, certain non-portable functions are only visible
5709  * in the headers if you define <literal>_GNU_SOURCE</literal> before
5710  * including them. Note that this symbol must be defined before
5711  * including <emphasis>any</emphasis> headers, or it may not take
5712  * effect.
5713  */
5714
5715
5716 /**
5717  * SECTION:gnetworkmonitor
5718  * @title: GNetworkMonitor
5719  * @short_description: Network status monitor
5720  * @include: gio/gio.h
5721  *
5722  * #GNetworkMonitor provides an easy-to-use cross-platform API
5723  * for monitoring network connectivity. On Linux, the implementation
5724  * is based on the kernel's netlink interface.
5725  */
5726
5727
5728 /**
5729  * SECTION:gnetworkservice
5730  * @short_description: A GSocketConnectable for resolving SRV records
5731  * @include: gio/gio.h
5732  *
5733  * Like #GNetworkAddress does with hostnames, #GNetworkService
5734  * provides an easy way to resolve a SRV record, and then attempt to
5735  * connect to one of the hosts that implements that service, handling
5736  * service priority/weighting, multiple IP addresses, and multiple
5737  * address families.
5738  *
5739  * See #GSrvTarget for more information about SRV records, and see
5740  * #GSocketConnectable for and example of using the connectable
5741  * interface.
5742  */
5743
5744
5745 /**
5746  * SECTION:goutputstream
5747  * @short_description: Base class for implementing streaming output
5748  * @include: gio/gio.h
5749  *
5750  * #GOutputStream has functions to write to a stream (g_output_stream_write()),
5751  * to close a stream (g_output_stream_close()) and to flush pending writes
5752  * (g_output_stream_flush()).
5753  *
5754  * To copy the content of an input stream to an output stream without
5755  * manually handling the reads and writes, use g_output_stream_splice().
5756  *
5757  * All of these functions have async variants too.
5758  */
5759
5760
5761 /**
5762  * SECTION:gpermission
5763  * @title: GPermission
5764  * @short_description: An object representing the permission to perform a certain action
5765  *
5766  * A #GPermission represents the status of the caller's permission to
5767  * perform a certain action.
5768  *
5769  * You can query if the action is currently allowed and if it is
5770  * possible to acquire the permission so that the action will be allowed
5771  * in the future.
5772  *
5773  * There is also an API to actually acquire the permission and one to
5774  * release it.
5775  *
5776  * As an example, a #GPermission might represent the ability for the
5777  * user to write to a #GSettings object.  This #GPermission object could
5778  * then be used to decide if it is appropriate to show a "Click here to
5779  * unlock" button in a dialog and to provide the mechanism to invoke
5780  * when that button is clicked.
5781  */
5782
5783
5784 /**
5785  * SECTION:gpollableinputstream
5786  * @short_description: Interface for pollable input streams
5787  * @include: gio/gio.h
5788  * @see_also: #GInputStream, #GPollableOutputStream, #GFileDescriptorBased
5789  *
5790  * #GPollableInputStream is implemented by #GInputStreams that
5791  * can be polled for readiness to read. This can be used when
5792  * interfacing with a non-GIO API that expects
5793  * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5794  *
5795  * Since: 2.28
5796  */
5797
5798
5799 /**
5800  * SECTION:gpollableoutputstream
5801  * @short_description: Interface for pollable output streams
5802  * @include: gio/gio.h
5803  * @see_also: #GOutputStream, #GFileDescriptorBased, #GPollableInputStream
5804  *
5805  * #GPollableOutputStream is implemented by #GOutputStreams that
5806  * can be polled for readiness to write. This can be used when
5807  * interfacing with a non-GIO API that expects
5808  * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5809  *
5810  * Since: 2.28
5811  */
5812
5813
5814 /**
5815  * SECTION:gpollableutils
5816  * @short_description: #GPollableInputStream / #GPollableOutputStream utilities
5817  * @include: gio/gio.h
5818  *
5819  * Utility functions for #GPollableInputStream and
5820  * #GPollableOutputStream implementations.
5821  */
5822
5823
5824 /**
5825  * SECTION:gproxy
5826  * @short_description: Interface for proxy handling
5827  *
5828  * A #GProxy handles connecting to a remote host via a given type of
5829  * proxy server. It is implemented by the 'gio-proxy' extension point.
5830  * The extensions are named after their proxy protocol name. As an
5831  * example, a SOCKS5 proxy implementation can be retrieved with the
5832  * name 'socks5' using the function
5833  * g_io_extension_point_get_extension_by_name().
5834  *
5835  * Since: 2.26
5836  */
5837
5838
5839 /**
5840  * SECTION:gproxyaddress
5841  * @short_description: An internet address with proxy information
5842  *
5843  * Support for proxied #GInetSocketAddress.
5844  */
5845
5846
5847 /**
5848  * SECTION:gproxyresolver
5849  * @short_description: Asynchronous and cancellable network proxy resolver
5850  * @include: gio/gio.h
5851  *
5852  * #GProxyResolver provides synchronous and asynchronous network proxy
5853  * resolution. #GProxyResolver is used within #GSocketClient through
5854  * the method g_socket_connectable_proxy_enumerate().
5855  */
5856
5857
5858 /**
5859  * SECTION:gremoteactiongroup
5860  * @title: GRemoteActionGroup
5861  * @short_description: a #GActionGroup that interacts with other processes
5862  *
5863  * The GRemoteActionGroup interface is implemented by #GActionGroup
5864  * instances that either transmit action invocations to other processes
5865  * or receive action invocations in the local process from other
5866  * processes.
5867  *
5868  * The interface has <literal>_full</literal> variants of the two
5869  * methods on #GActionGroup used to activate actions:
5870  * g_action_group_activate_action() and
5871  * g_action_group_change_action_state().  These variants allow a
5872  * "platform data" #GVariant to be specified: a dictionary providing
5873  * context for the action invocation (for example: timestamps, startup
5874  * notification IDs, etc).
5875  *
5876  * #GDBusActionGroup implements #GRemoteActionGroup.  This provides a
5877  * mechanism to send platform data for action invocations over D-Bus.
5878  *
5879  * Additionally, g_dbus_connection_export_action_group() will check if
5880  * the exported #GActionGroup implements #GRemoteActionGroup and use the
5881  * <literal>_full</literal> variants of the calls if available.  This
5882  * provides a mechanism by which to receive platform data for action
5883  * invocations that arrive by way of D-Bus.
5884  *
5885  * Since: 2.32
5886  */
5887
5888
5889 /**
5890  * SECTION:gresolver
5891  * @short_description: Asynchronous and cancellable DNS resolver
5892  * @include: gio/gio.h
5893  *
5894  * #GResolver provides cancellable synchronous and asynchronous DNS
5895  * resolution, for hostnames (g_resolver_lookup_by_address(),
5896  * g_resolver_lookup_by_name() and their async variants) and SRV
5897  * (service) records (g_resolver_lookup_service()).
5898  *
5899  * #GNetworkAddress and #GNetworkService provide wrappers around
5900  * #GResolver functionality that also implement #GSocketConnectable,
5901  * making it easy to connect to a remote host/service.
5902  */
5903
5904
5905 /**
5906  * SECTION:gresource
5907  * @short_description: Resource framework
5908  * @include: gio/gio.h
5909  *
5910  * Applications and libraries often contain binary or textual data that is really part of the
5911  * application, rather than user data. For instance #GtkBuilder .ui files, splashscreen images,
5912  * GMenu markup xml, CSS files, icons, etc. These are often shipped as files in <filename>$datadir/appname</filename>, or
5913  * manually included as literal strings in the code.
5914  *
5915  * The #GResource API and the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5916  * provide a convenient and efficient alternative to this which has some nice properties. You
5917  * maintain the files as normal files, so its easy to edit them, but during the build the files
5918  * are combined into a binary bundle that is linked into the executable. This means that loading
5919  * the resource files are efficient (as they are already in memory, shared with other instances) and
5920  * simple (no need to check for things like I/O errors or locate the files in the filesystem). It
5921  * also makes it easier to create relocatable applications.
5922  *
5923  * Resource files can also be marked as compressed. Such files will be included in the resource bundle
5924  * in a compressed form, but will be automatically uncompressed when the resource is used. This
5925  * is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away.
5926  *
5927  * Resource files can also be marked to be preprocessed, by setting the value of the
5928  * <literal>preprocess</literal> attribute to a comma-separated list of preprocessing options.
5929  * The only options currently supported are:
5930  *
5931  * <literal>xml-stripblanks</literal> which will use <command>xmllint</command> to strip
5932  * ignorable whitespace from the xml file. For this to work, the <envar>XMLLINT</envar>
5933  * environment variable must be set to the full path to the xmllint executable, or xmllint
5934  * must be in the PATH; otherwise the preprocessing step is skipped.
5935  *
5936  * <literal>to-pixdata</literal> which will use <command>gdk-pixbuf-pixdata</command> to convert
5937  * images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside
5938  * the resource file, rather than an (uncompressed) copy if it. For this, the gdk-pixbuf-pixdata
5939  * program must be in the PATH, or the <envar>GDK_PIXBUF_PIXDATA</envar> environment variable must be
5940  * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will
5941  * abort.
5942  *
5943  * Resource bundles are created by the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5944  * which takes an xml file that describes the bundle, and a set of files that the xml references. These
5945  * are combined into a binary resource bundle.
5946  *
5947  * <example id="resource-example"><title>Example resource description</title>
5948  * <programlisting><![CDATA[
5949  * <?xml version="1.0" encoding="UTF-8"?>
5950  * <gresources>
5951  *   <gresource prefix="/org/gtk/Example">
5952  *     <file>data/splashscreen.png</file>
5953  *     <file compressed="true">dialog.ui</file>
5954  *     <file preprocess="xml-stripblanks">menumarkup.xml</file>
5955  *   </gresource>
5956  * </gresources>
5957  * ]]></programlisting></example>
5958  *
5959  * This will create a resource bundle with the following files:
5960  * <programlisting><![CDATA[
5961  * /org/gtk/Example/data/splashscreen.png
5962  * /org/gtk/Example/dialog.ui
5963  * /org/gtk/Example/menumarkup.xml
5964  * ]]></programlisting>
5965  *
5966  * Note that all resources in the process share the same namespace, so use java-style
5967  * path prefixes (like in the above example) to avoid conflicts.
5968  *
5969  * You can then use <link linkend="glib-compile-resources">glib-compile-resources</link> to compile the xml to a
5970  * binary bundle that you can load with g_resource_load(). However, its more common to use the --generate-source and
5971  * --generate-header arguments to create a source file and header to link directly into your application.
5972  *
5973  * Once a #GResource has been created and registered all the data in it can be accessed globally in the process by
5974  * using API calls like g_resources_open_stream() to stream the data or g_resources_lookup_data() to get a direct pointer
5975  * to the data. You can also use uris like "resource:///org/gtk/Example/data/splashscreen.png" with #GFile to access
5976  * the resource data.
5977  *
5978  * There are two forms of the generated source, the default version uses the compiler support for constructor
5979  * and destructor functions (where available) to automatically create and register the #GResource on startup
5980  * or library load time. If you pass --manual-register two functions to register/unregister the resource is instead
5981  * created. This requires an explicit initialization call in your application/library, but it works on all platforms,
5982  * even on the minor ones where this is not available. (Constructor support is available for at least Win32, MacOS and Linux.)
5983  *
5984  * Note that resource data can point directly into the data segment of e.g. a library, so if you are unloading libraries
5985  * during runtime you need to be very careful with keeping around pointers to data from a resource, as this goes away
5986  * when the library is unloaded. However, in practice this is not generally a problem, since most resource accesses
5987  * is for your own resources, and resource data is often used once, during parsing, and then released.
5988  *
5989  * Since: 2.32
5990  */
5991
5992
5993 /**
5994  * SECTION:gseekable
5995  * @short_description: Stream seeking interface
5996  * @include: gio/gio.h
5997  * @see_also: #GInputStream, #GOutputStream
5998  *
5999  * #GSeekable is implemented by streams (implementations of
6000  * #GInputStream or #GOutputStream) that support seeking.
6001  */
6002
6003
6004 /**
6005  * SECTION:gsettings
6006  * @short_description: High-level API for application settings
6007  *
6008  * The #GSettings class provides a convenient API for storing and retrieving
6009  * application settings.
6010  *
6011  * Reads and writes can be considered to be non-blocking.  Reading
6012  * settings with #GSettings is typically extremely fast: on
6013  * approximately the same order of magnitude (but slower than) a
6014  * #GHashTable lookup.  Writing settings is also extremely fast in terms
6015  * of time to return to your application, but can be extremely expensive
6016  * for other threads and other processes.  Many settings backends
6017  * (including dconf) have lazy initialisation which means in the common
6018  * case of the user using their computer without modifying any settings
6019  * a lot of work can be avoided.  For dconf, the D-Bus service doesn't
6020  * even need to be started in this case.  For this reason, you should
6021  * only ever modify #GSettings keys in response to explicit user action.
6022  * Particular care should be paid to ensure that modifications are not
6023  * made during startup -- for example, when setting the initial value
6024  * of preferences widgets.  The built-in g_settings_bind() functionality
6025  * is careful not to write settings in response to notify signals as a
6026  * result of modifications that it makes to widgets.
6027  *
6028  * When creating a GSettings instance, you have to specify a schema
6029  * that describes the keys in your settings and their types and default
6030  * values, as well as some other information.
6031  *
6032  * Normally, a schema has as fixed path that determines where the settings
6033  * are stored in the conceptual global tree of settings. However, schemas
6034  * can also be 'relocatable', i.e. not equipped with a fixed path. This is
6035  * useful e.g. when the schema describes an 'account', and you want to be
6036  * able to store a arbitrary number of accounts.
6037  *
6038  * Paths must start with and end with a forward slash character ('/')
6039  * and must not contain two sequential slash characters.  Paths should
6040  * be chosen based on a domain name associated with the program or
6041  * library to which the settings belong.  Examples of paths are
6042  * "/org/gtk/settings/file-chooser/" and "/ca/desrt/dconf-editor/".
6043  * Paths should not start with "/apps/", "/desktop/" or "/system/" as
6044  * they often did in GConf.
6045  *
6046  * Unlike other configuration systems (like GConf), GSettings does not
6047  * restrict keys to basic types like strings and numbers. GSettings stores
6048  * values as #GVariant, and allows any #GVariantType for keys. Key names
6049  * are restricted to lowercase characters, numbers and '-'. Furthermore,
6050  * the names must begin with a lowercase character, must not end
6051  * with a '-', and must not contain consecutive dashes.
6052  *
6053  * Similar to GConf, the default values in GSettings schemas can be
6054  * localized, but the localized values are stored in gettext catalogs
6055  * and looked up with the domain that is specified in the
6056  * <tag class="attribute">gettext-domain</tag> attribute of the
6057  * <tag class="starttag">schemalist</tag> or <tag class="starttag">schema</tag>
6058  * elements and the category that is specified in the l10n attribute of the
6059  * <tag class="starttag">key</tag> element.
6060  *
6061  * GSettings uses schemas in a compact binary form that is created
6062  * by the <link linkend="glib-compile-schemas">glib-compile-schemas</link>
6063  * utility. The input is a schema description in an XML format that can be
6064  * described by the following DTD:
6065  * |[<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>]|
6066  *
6067  * glib-compile-schemas expects schema files to have the extension <filename>.gschema.xml</filename>
6068  *
6069  * At runtime, schemas are identified by their id (as specified
6070  * in the <tag class="attribute">id</tag> attribute of the
6071  * <tag class="starttag">schema</tag> element). The
6072  * convention for schema ids is to use a dotted name, similar in
6073  * style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular,
6074  * if the settings are for a specific service that owns a D-Bus bus name,
6075  * the D-Bus bus name and schema id should match. For schemas which deal
6076  * with settings not associated with one named application, the id should
6077  * not use StudlyCaps, e.g. "org.gnome.font-rendering".
6078  *
6079  * In addition to #GVariant types, keys can have types that have enumerated
6080  * types. These can be described by a <tag class="starttag">choice</tag>,
6081  * <tag class="starttag">enum</tag> or <tag class="starttag">flags</tag> element, see
6082  * <xref linkend="schema-enumerated"/>. The underlying type of
6083  * such a key is string, but you can use g_settings_get_enum(),
6084  * g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags()
6085  * access the numeric values corresponding to the string value of enum
6086  * and flags keys.
6087  *
6088  * <example id="schema-default-values"><title>Default values</title>
6089  * <programlisting><![CDATA[
6090  * <schemalist>
6091  *   <schema id="org.gtk.Test" path="/org/gtk/Test/" gettext-domain="test">
6092  *
6093  *     <key name="greeting" type="s">
6094  *       <default l10n="messages">"Hello, earthlings"</default>
6095  *       <summary>A greeting</summary>
6096  *       <description>
6097  *         Greeting of the invading martians
6098  *       </description>
6099  *     </key>
6100  *
6101  *     <key name="box" type="(ii)">
6102  *       <default>(20,30)</default>
6103  *     </key>
6104  *
6105  *   </schema>
6106  * </schemalist>
6107  * ]]></programlisting></example>
6108  *
6109  * <example id="schema-enumerated"><title>Ranges, choices and enumerated types</title>
6110  * <programlisting><![CDATA[
6111  * <schemalist>
6112  *
6113  *   <enum id="org.gtk.Test.myenum">
6114  *     <value nick="first" value="1"/>
6115  *     <value nick="second" value="2"/>
6116  *   </enum>
6117  *
6118  *   <flags id="org.gtk.Test.myflags">
6119  *     <value nick="flag1" value="1"/>
6120  *     <value nick="flag2" value="2"/>
6121  *     <value nick="flag3" value="4"/>
6122  *   </flags>
6123  *
6124  *   <schema id="org.gtk.Test">
6125  *
6126  *     <key name="key-with-range" type="i">
6127  *       <range min="1" max="100"/>
6128  *       <default>10</default>
6129  *     </key>
6130  *
6131  *     <key name="key-with-choices" type="s">
6132  *       <choices>
6133  *         <choice value='Elisabeth'/>
6134  *         <choice value='Annabeth'/>
6135  *         <choice value='Joe'/>
6136  *       </choices>
6137  *       <aliases>
6138  *         <alias value='Anna' target='Annabeth'/>
6139  *         <alias value='Beth' target='Elisabeth'/>
6140  *       </aliases>
6141  *       <default>'Joe'</default>
6142  *     </key>
6143  *
6144  *     <key name='enumerated-key' enum='org.gtk.Test.myenum'>
6145  *       <default>'first'</default>
6146  *     </key>
6147  *
6148  *     <key name='flags-key' flags='org.gtk.Test.myflags'>
6149  *       <default>["flag1",flag2"]</default>
6150  *     </key>
6151  *   </schema>
6152  * </schemalist>
6153  * ]]></programlisting></example>
6154  *
6155  * <refsect2>
6156  *   <title>Vendor overrides</title>
6157  *   <para>
6158  *     Default values are defined in the schemas that get installed by
6159  *     an application. Sometimes, it is necessary for a vendor or distributor
6160  *     to adjust these defaults. Since patching the XML source for the schema
6161  *     is inconvenient and error-prone,
6162  *     <link linkend="glib-compile-schemas">glib-compile-schemas</link> reads
6163  *     so-called 'vendor override' files. These are keyfiles in the same
6164  *     directory as the XML schema sources which can override default values.
6165  *     The schema id serves as the group name in the key file, and the values
6166  *     are expected in serialized GVariant form, as in the following example:
6167  *     <informalexample><programlisting>
6168  *     [org.gtk.Example]
6169  *     key1='string'
6170  *     key2=1.5
6171  *     </programlisting></informalexample>
6172  *   </para>
6173  *   <para>
6174  *     glib-compile-schemas expects schema files to have the extension
6175  *     <filename>.gschema.override</filename>
6176  *   </para>
6177  * </refsect2>
6178  *
6179  * <refsect2>
6180  *   <title>Binding</title>
6181  *   <para>
6182  *     A very convenient feature of GSettings lets you bind #GObject properties
6183  *     directly to settings, using g_settings_bind(). Once a GObject property
6184  *     has been bound to a setting, changes on either side are automatically
6185  *     propagated to the other side. GSettings handles details like
6186  *     mapping between GObject and GVariant types, and preventing infinite
6187  *     cycles.
6188  *   </para>
6189  *   <para>
6190  *     This makes it very easy to hook up a preferences dialog to the
6191  *     underlying settings. To make this even more convenient, GSettings
6192  *     looks for a boolean property with the name "sensitivity" and
6193  *     automatically binds it to the writability of the bound setting.
6194  *     If this 'magic' gets in the way, it can be suppressed with the
6195  *     #G_SETTINGS_BIND_NO_SENSITIVITY flag.
6196  *   </para>
6197  * </refsect2>
6198  */
6199
6200
6201 /**
6202  * SECTION:gsettingsbackend
6203  * @title: GSettingsBackend
6204  * @short_description: Interface for settings backend implementations
6205  * @include: gio/gsettingsbackend.h
6206  * @see_also: #GSettings, #GIOExtensionPoint
6207  *
6208  * The #GSettingsBackend interface defines a generic interface for
6209  * non-strictly-typed data that is stored in a hierarchy. To implement
6210  * an alternative storage backend for #GSettings, you need to implement
6211  * the #GSettingsBackend interface and then make it implement the
6212  * extension point #G_SETTINGS_BACKEND_EXTENSION_POINT_NAME.
6213  *
6214  * The interface defines methods for reading and writing values, a
6215  * method for determining if writing of certain values will fail
6216  * (lockdown) and a change notification mechanism.
6217  *
6218  * The semantics of the interface are very precisely defined and
6219  * implementations must carefully adhere to the expectations of
6220  * callers that are documented on each of the interface methods.
6221  *
6222  * Some of the GSettingsBackend functions accept or return a #GTree.
6223  * These trees always have strings as keys and #GVariant as values.
6224  * g_settings_backend_create_tree() is a convenience function to create
6225  * suitable trees.
6226  *
6227  * <note><para>
6228  * The #GSettingsBackend API is exported to allow third-party
6229  * implementations, but does not carry the same stability guarantees
6230  * as the public GIO API. For this reason, you have to define the
6231  * C preprocessor symbol #G_SETTINGS_ENABLE_BACKEND before including
6232  * <filename>gio/gsettingsbackend.h</filename>
6233  * </para></note>
6234  */
6235
6236
6237 /**
6238  * SECTION:gsettingsschema
6239  * @short_description: introspecting and controlling the loading of GSettings schemas
6240  *
6241  * The #GSettingsSchemaSource and #GSettingsSchema APIs provide a
6242  * mechanism for advanced control over the loading of schemas and a
6243  * mechanism for introspecting their content.
6244  *
6245  * Plugin loading systems that wish to provide plugins a way to access
6246  * settings face the problem of how to make the schemas for these
6247  * settings visible to GSettings.  Typically, a plugin will want to ship
6248  * the schema along with itself and it won't be installed into the
6249  * standard system directories for schemas.
6250  *
6251  * #GSettingsSchemaSource provides a mechanism for dealing with this by
6252  * allowing the creation of a new 'schema source' from which schemas can
6253  * be acquired.  This schema source can then become part of the metadata
6254  * associated with the plugin and queried whenever the plugin requires
6255  * access to some settings.
6256  *
6257  * Consider the following example:
6258  *
6259  * |[
6260  * typedef struct
6261  * {
6262  *    ...
6263  *    GSettingsSchemaSource *schema_source;
6264  *    ...
6265  * } Plugin;
6266  *
6267  * Plugin *
6268  * initialise_plugin (const gchar *dir)
6269  * {
6270  *   Plugin *plugin;
6271  *
6272  *   ...
6273  *
6274  *   plugin->schema_source =
6275  *     g_settings_new_schema_source_from_directory (dir,
6276  *       g_settings_schema_source_get_default (), FALSE, NULL);
6277  *
6278  *   ...
6279  *
6280  *   return plugin;
6281  * }
6282  *
6283  * ...
6284  *
6285  * GSettings *
6286  * plugin_get_settings (Plugin      *plugin,
6287  *                      const gchar *schema_id)
6288  * {
6289  *   GSettingsSchema *schema;
6290  *
6291  *   if (schema_id == NULL)
6292  *     schema_id = plugin->identifier;
6293  *
6294  *   schema = g_settings_schema_source_lookup (plugin->schema_source,
6295  *                                             schema_id, FALSE);
6296  *
6297  *   if (schema == NULL)
6298  *     {
6299  *       ... disable the plugin or abort, etc ...
6300  *     }
6301  *
6302  *   return g_settings_new_full (schema, NULL, NULL);
6303  * }
6304  * ]|
6305  *
6306  * The code above shows how hooks should be added to the code that
6307  * initialises (or enables) the plugin to create the schema source and
6308  * how an API can be added to the plugin system to provide a convenient
6309  * way for the plugin to access its settings, using the schemas that it
6310  * ships.
6311  *
6312  * From the standpoint of the plugin, it would need to ensure that it
6313  * ships a gschemas.compiled file as part of itself, and then simply do
6314  * the following:
6315  *
6316  * |[
6317  * {
6318  *   GSettings *settings;
6319  *   gint some_value;
6320  *
6321  *   settings = plugin_get_settings (self, NULL);
6322  *   some_value = g_settings_get_int (settings, "some-value");
6323  *   ...
6324  * }
6325  * ]|
6326  *
6327  * It's also possible that the plugin system expects the schema source
6328  * files (ie: .gschema.xml files) instead of a gschemas.compiled file.
6329  * In that case, the plugin loading system must compile the schemas for
6330  * itself before attempting to create the settings source.
6331  *
6332  * Since: 2.32
6333  */
6334
6335
6336 /**
6337  * SECTION:gsimpleaction
6338  * @title: GSimpleAction
6339  * @short_description: A simple GAction implementation
6340  *
6341  * A #GSimpleAction is the obvious simple implementation of the #GAction
6342  * interface. This is the easiest way to create an action for purposes of
6343  * adding it to a #GSimpleActionGroup.
6344  *
6345  * See also #GtkAction.
6346  */
6347
6348
6349 /**
6350  * SECTION:gsimpleactiongroup
6351  * @title: GSimpleActionGroup
6352  * @short_description: A simple GActionGroup implementation
6353  *
6354  * #GSimpleActionGroup is a hash table filled with #GAction objects,
6355  * implementing the #GActionGroup and #GActionMap interfaces.
6356  */
6357
6358
6359 /**
6360  * SECTION:gsimpleasyncresult
6361  * @short_description: Simple asynchronous results implementation
6362  * @include: gio/gio.h
6363  * @see_also: #GAsyncResult
6364  *
6365  * <note><para>
6366  *   As of GLib 2.36, #GSimpleAsyncResult is deprecated in favor of
6367  *   #GTask, which provides a simpler API.
6368  * </para></note>
6369  *
6370  * #GSimpleAsyncResult implements #GAsyncResult.
6371  *
6372  * GSimpleAsyncResult handles #GAsyncReadyCallback<!-- -->s, error
6373  * reporting, operation cancellation and the final state of an operation,
6374  * completely transparent to the application. Results can be returned
6375  * as a pointer e.g. for functions that return data that is collected
6376  * asynchronously, a boolean value for checking the success or failure
6377  * of an operation, or a #gssize for operations which return the number
6378  * of bytes modified by the operation; all of the simple return cases
6379  * are covered.
6380  *
6381  * Most of the time, an application will not need to know of the details
6382  * of this API; it is handled transparently, and any necessary operations
6383  * are handled by #GAsyncResult's interface. However, if implementing a
6384  * new GIO module, for writing language bindings, or for complex
6385  * applications that need better control of how asynchronous operations
6386  * are completed, it is important to understand this functionality.
6387  *
6388  * GSimpleAsyncResults are tagged with the calling function to ensure
6389  * that asynchronous functions and their finishing functions are used
6390  * together correctly.
6391  *
6392  * To create a new #GSimpleAsyncResult, call g_simple_async_result_new().
6393  * If the result needs to be created for a #GError, use
6394  * g_simple_async_result_new_from_error() or
6395  * g_simple_async_result_new_take_error(). If a #GError is not available
6396  * (e.g. the asynchronous operation's doesn't take a #GError argument),
6397  * but the result still needs to be created for an error condition, use
6398  * g_simple_async_result_new_error() (or g_simple_async_result_set_error_va()
6399  * if your application or binding requires passing a variable argument list
6400  * directly), and the error can then be propagated through the use of
6401  * g_simple_async_result_propagate_error().
6402  *
6403  * An asynchronous operation can be made to ignore a cancellation event by
6404  * calling g_simple_async_result_set_handle_cancellation() with a
6405  * #GSimpleAsyncResult for the operation and %FALSE. This is useful for
6406  * operations that are dangerous to cancel, such as close (which would
6407  * cause a leak if cancelled before being run).
6408  *
6409  * GSimpleAsyncResult can integrate into GLib's event loop, #GMainLoop,
6410  * or it can use #GThread<!-- -->s.
6411  * g_simple_async_result_complete() will finish an I/O task directly
6412  * from the point where it is called. g_simple_async_result_complete_in_idle()
6413  * will finish it from an idle handler in the <link
6414  * linkend="g-main-context-push-thread-default">thread-default main
6415  * context</link>. g_simple_async_result_run_in_thread() will run the
6416  * job in a separate thread and then deliver the result to the
6417  * thread-default main context.
6418  *
6419  * To set the results of an asynchronous function,
6420  * g_simple_async_result_set_op_res_gpointer(),
6421  * g_simple_async_result_set_op_res_gboolean(), and
6422  * g_simple_async_result_set_op_res_gssize()
6423  * are provided, setting the operation's result to a gpointer, gboolean, or
6424  * gssize, respectively.
6425  *
6426  * Likewise, to get the result of an asynchronous function,
6427  * g_simple_async_result_get_op_res_gpointer(),
6428  * g_simple_async_result_get_op_res_gboolean(), and
6429  * g_simple_async_result_get_op_res_gssize() are
6430  * provided, getting the operation's result as a gpointer, gboolean, and
6431  * gssize, respectively.
6432  *
6433  * For the details of the requirements implementations must respect, see
6434  * #GAsyncResult.  A typical implementation of an asynchronous operation
6435  * using GSimpleAsyncResult looks something like this:
6436  *
6437  * |[
6438  * static void
6439  * baked_cb (Cake    *cake,
6440  *           gpointer user_data)
6441  * {
6442  *   /&ast; In this example, this callback is not given a reference to the cake, so
6443  *    &ast; the GSimpleAsyncResult has to take a reference to it.
6444  *    &ast;/
6445  *   GSimpleAsyncResult *result = user_data;
6446  *
6447  *   if (cake == NULL)
6448  *     g_simple_async_result_set_error (result,
6449  *                                      BAKER_ERRORS,
6450  *                                      BAKER_ERROR_NO_FLOUR,
6451  *                                      "Go to the supermarket");
6452  *   else
6453  *     g_simple_async_result_set_op_res_gpointer (result,
6454  *                                                g_object_ref (cake),
6455  *                                                g_object_unref);
6456  *
6457  *
6458  *   /&ast; In this example, we assume that baked_cb is called as a callback from
6459  *    &ast; the mainloop, so it's safe to complete the operation synchronously here.
6460  *    &ast; If, however, _baker_prepare_cake () might call its callback without
6461  *    &ast; first returning to the mainloop â€” inadvisable, but some APIs do so â€”
6462  *    &ast; we would need to use g_simple_async_result_complete_in_idle().
6463  *    &ast;/
6464  *   g_simple_async_result_complete (result);
6465  *   g_object_unref (result);
6466  * }
6467  *
6468  * void
6469  * baker_bake_cake_async (Baker              *self,
6470  *                        guint               radius,
6471  *                        GAsyncReadyCallback callback,
6472  *                        gpointer            user_data)
6473  * {
6474  *   GSimpleAsyncResult *simple;
6475  *   Cake               *cake;
6476  *
6477  *   if (radius < 3)
6478  *     {
6479  *       g_simple_async_report_error_in_idle (G_OBJECT (self),
6480  *                                            callback,
6481  *                                            user_data,
6482  *                                            BAKER_ERRORS,
6483  *                                            BAKER_ERROR_TOO_SMALL,
6484  *                                            "%ucm radius cakes are silly",
6485  *                                            radius);
6486  *       return;
6487  *     }
6488  *
6489  *   simple = g_simple_async_result_new (G_OBJECT (self),
6490  *                                       callback,
6491  *                                       user_data,
6492  *                                       baker_bake_cake_async);
6493  *   cake = _baker_get_cached_cake (self, radius);
6494  *
6495  *   if (cake != NULL)
6496  *     {
6497  *       g_simple_async_result_set_op_res_gpointer (simple,
6498  *                                                  g_object_ref (cake),
6499  *                                                  g_object_unref);
6500  *       g_simple_async_result_complete_in_idle (simple);
6501  *       g_object_unref (simple);
6502  *       /&ast; Drop the reference returned by _baker_get_cached_cake(); the
6503  *        &ast; GSimpleAsyncResult has taken its own reference.
6504  *        &ast;/
6505  *       g_object_unref (cake);
6506  *       return;
6507  *     }
6508  *
6509  *   _baker_prepare_cake (self, radius, baked_cb, simple);
6510  * }
6511  *
6512  * Cake *
6513  * baker_bake_cake_finish (Baker        *self,
6514  *                         GAsyncResult *result,
6515  *                         GError      **error)
6516  * {
6517  *   GSimpleAsyncResult *simple;
6518  *   Cake               *cake;
6519  *
6520  *   g_return_val_if_fail (g_simple_async_result_is_valid (result,
6521  *                                                         G_OBJECT (self),
6522  *                                                         baker_bake_cake_async),
6523  *                         NULL);
6524  *
6525  *   simple = (GSimpleAsyncResult *) result;
6526  *
6527  *   if (g_simple_async_result_propagate_error (simple, error))
6528  *     return NULL;
6529  *
6530  *   cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
6531  *   return g_object_ref (cake);
6532  * }
6533  * ]|
6534  */
6535
6536
6537 /**
6538  * SECTION:gsimplepermission
6539  * @title: GSimplePermission
6540  * @short_description: A GPermission that doesn't change value
6541  *
6542  * #GSimplePermission is a trivial implementation of #GPermission that
6543  * represents a permission that is either always or never allowed.  The
6544  * value is given at construction and doesn't change.
6545  *
6546  * Calling request or release will result in errors.
6547  */
6548
6549
6550 /**
6551  * SECTION:gsimpleproxyresolver
6552  * @short_description: Simple proxy resolver implementation
6553  * @include: gio/gio.h
6554  * @see_also: g_socket_client_set_proxy_resolver()
6555  *
6556  * #GSimpleProxyResolver is a simple #GProxyResolver implementation
6557  * that handles a single default proxy, multiple URI-scheme-specific
6558  * proxies, and a list of hosts that proxies should not be used for.
6559  *
6560  * #GSimpleProxyResolver is never the default proxy resolver, but it
6561  * can be used as the base class for another proxy resolver
6562  * implementation, or it can be created and used manually, such as
6563  * with g_socket_client_set_proxy_resolver().
6564  *
6565  * Since: 2.36
6566  */
6567
6568
6569 /**
6570  * SECTION:gsocket
6571  * @short_description: Low-level socket object
6572  * @include: gio/gio.h
6573  * @see_also: #GInitable, <link linkend="gio-gnetworking.h">gnetworking.h</link>
6574  *
6575  * A #GSocket is a low-level networking primitive. It is a more or less
6576  * direct mapping of the BSD socket API in a portable GObject based API.
6577  * It supports both the UNIX socket implementations and winsock2 on Windows.
6578  *
6579  * #GSocket is the platform independent base upon which the higher level
6580  * network primitives are based. Applications are not typically meant to
6581  * use it directly, but rather through classes like #GSocketClient,
6582  * #GSocketService and #GSocketConnection. However there may be cases where
6583  * direct use of #GSocket is useful.
6584  *
6585  * #GSocket implements the #GInitable interface, so if it is manually constructed
6586  * by e.g. g_object_new() you must call g_initable_init() and check the
6587  * results before using the object. This is done automatically in
6588  * g_socket_new() and g_socket_new_from_fd(), so these functions can return
6589  * %NULL.
6590  *
6591  * Sockets operate in two general modes, blocking or non-blocking. When
6592  * in blocking mode all operations block until the requested operation
6593  * is finished or there is an error. In non-blocking mode all calls that
6594  * would block return immediately with a %G_IO_ERROR_WOULD_BLOCK error.
6595  * To know when a call would successfully run you can call g_socket_condition_check(),
6596  * or g_socket_condition_wait(). You can also use g_socket_create_source() and
6597  * attach it to a #GMainContext to get callbacks when I/O is possible.
6598  * Note that all sockets are always set to non blocking mode in the system, and
6599  * blocking mode is emulated in GSocket.
6600  *
6601  * When working in non-blocking mode applications should always be able to
6602  * handle getting a %G_IO_ERROR_WOULD_BLOCK error even when some other
6603  * function said that I/O was possible. This can easily happen in case
6604  * of a race condition in the application, but it can also happen for other
6605  * reasons. For instance, on Windows a socket is always seen as writable
6606  * until a write returns %G_IO_ERROR_WOULD_BLOCK.
6607  *
6608  * #GSocket<!-- -->s can be either connection oriented or datagram based.
6609  * For connection oriented types you must first establish a connection by
6610  * either connecting to an address or accepting a connection from another
6611  * address. For connectionless socket types the target/source address is
6612  * specified or received in each I/O operation.
6613  *
6614  * All socket file descriptors are set to be close-on-exec.
6615  *
6616  * Note that creating a #GSocket causes the signal %SIGPIPE to be
6617  * ignored for the remainder of the program. If you are writing a
6618  * command-line utility that uses #GSocket, you may need to take into
6619  * account the fact that your program will not automatically be killed
6620  * if it tries to write to %stdout after it has been closed.
6621  *
6622  * Since: 2.22
6623  */
6624
6625
6626 /**
6627  * SECTION:gsocketaddress
6628  * @short_description: Abstract base class representing endpoints for socket communication
6629  *
6630  * #GSocketAddress is the equivalent of <type>struct sockaddr</type>
6631  * in the BSD sockets API. This is an abstract class; use
6632  * #GInetSocketAddress for internet sockets, or #GUnixSocketAddress
6633  * for UNIX domain sockets.
6634  */
6635
6636
6637 /**
6638  * SECTION:gsocketclient
6639  * @short_description: Helper for connecting to a network service
6640  * @include: gio/gio.h
6641  * @see_also: #GSocketConnection, #GSocketListener
6642  *
6643  * #GSocketClient is a lightweight high-level utility class for connecting to
6644  * a network host using a connection oriented socket type.
6645  *
6646  * You create a #GSocketClient object, set any options you want, and then
6647  * call a sync or async connect operation, which returns a #GSocketConnection
6648  * subclass on success.
6649  *
6650  * The type of the #GSocketConnection object returned depends on the type of
6651  * the underlying socket that is in use. For instance, for a TCP/IP connection
6652  * it will be a #GTcpConnection.
6653  *
6654  * As #GSocketClient is a lightweight object, you don't need to cache it. You
6655  * can just create a new one any time you need one.
6656  *
6657  * Since: 2.22
6658  */
6659
6660
6661 /**
6662  * SECTION:gsocketconnectable
6663  * @short_description: Interface for potential socket endpoints
6664  *
6665  * Objects that describe one or more potential socket endpoints
6666  * implement #GSocketConnectable. Callers can then use
6667  * g_socket_connectable_enumerate() to get a #GSocketAddressEnumerator
6668  * to try out each socket address in turn until one succeeds, as shown
6669  * in the sample code below.
6670  *
6671  * |[
6672  * MyConnectionType *
6673  * connect_to_host (const char    *hostname,
6674  *                  guint16        port,
6675  *                  GCancellable  *cancellable,
6676  *                  GError       **error)
6677  * {
6678  *   MyConnection *conn = NULL;
6679  *   GSocketConnectable *addr;
6680  *   GSocketAddressEnumerator *enumerator;
6681  *   GSocketAddress *sockaddr;
6682  *   GError *conn_error = NULL;
6683  *
6684  *   addr = g_network_address_new ("www.gnome.org", 80);
6685  *   enumerator = g_socket_connectable_enumerate (addr);
6686  *   g_object_unref (addr);
6687  *
6688  *   /<!-- -->* Try each sockaddr until we succeed. Record the first
6689  *    * connection error, but not any further ones (since they'll probably
6690  *    * be basically the same as the first).
6691  *    *<!-- -->/
6692  *   while (!conn && (sockaddr = g_socket_address_enumerator_next (enumerator, cancellable, error))
6693  *     {
6694  *       conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error);
6695  *       g_object_unref (sockaddr);
6696  *     }
6697  *   g_object_unref (enumerator);
6698  *
6699  *   if (conn)
6700  *     {
6701  *       if (conn_error)
6702  *         {
6703  *           /<!-- -->* We couldn't connect to the first address, but we succeeded
6704  *            * in connecting to a later address.
6705  *            *<!-- -->/
6706  *           g_error_free (conn_error);
6707  *         }
6708  *       return conn;
6709  *     }
6710  *   else if (error)
6711  *     {
6712  *       /<!-- -->* Either the initial lookup failed, or else the caller
6713  *        * cancelled us.
6714  *        *<!-- -->/
6715  *       if (conn_error)
6716  *         g_error_free (conn_error);
6717  *       return NULL;
6718  *     }
6719  *   else
6720  *     {
6721  *       g_error_propagate (error, conn_error);
6722  *       return NULL;
6723  *     }
6724  * }
6725  * ]|
6726  */
6727
6728
6729 /**
6730  * SECTION:gsocketconnection
6731  * @short_description: A socket connection
6732  * @include: gio/gio.h
6733  * @see_also: #GIOStream, #GSocketClient, #GSocketListener
6734  *
6735  * #GSocketConnection is a #GIOStream for a connected socket. They
6736  * can be created either by #GSocketClient when connecting to a host,
6737  * or by #GSocketListener when accepting a new client.
6738  *
6739  * The type of the #GSocketConnection object returned from these calls
6740  * depends on the type of the underlying socket that is in use. For
6741  * instance, for a TCP/IP connection it will be a #GTcpConnection.
6742  *
6743  * Choosing what type of object to construct is done with the socket
6744  * connection factory, and it is possible for 3rd parties to register
6745  * custom socket connection types for specific combination of socket
6746  * family/type/protocol using g_socket_connection_factory_register_type().
6747  *
6748  * Since: 2.22
6749  */
6750
6751
6752 /**
6753  * SECTION:gsocketcontrolmessage
6754  * @title: GSocketControlMessage
6755  * @short_description: A GSocket control message
6756  * @see_also: #GSocket.
6757  *
6758  * A #GSocketControlMessage is a special-purpose utility message that
6759  * can be sent to or received from a #GSocket. These types of
6760  * messages are often called "ancillary data".
6761  *
6762  * The message can represent some sort of special instruction to or
6763  * information from the socket or can represent a special kind of
6764  * transfer to the peer (for example, sending a file description over
6765  * a UNIX socket).
6766  *
6767  * These messages are sent with g_socket_send_message() and received
6768  * with g_socket_receive_message().
6769  *
6770  * To extend the set of control message that can be sent, subclass this
6771  * class and override the get_size, get_level, get_type and serialize
6772  * methods.
6773  *
6774  * To extend the set of control messages that can be received, subclass
6775  * this class and implement the deserialize method. Also, make sure your
6776  * class is registered with the GType typesystem before calling
6777  * g_socket_receive_message() to read such a message.
6778  *
6779  * Since: 2.22
6780  */
6781
6782
6783 /**
6784  * SECTION:gsocketlistener
6785  * @title: GSocketListener
6786  * @short_description: Helper for accepting network client connections
6787  * @see_also: #GThreadedSocketService, #GSocketService.
6788  *
6789  * A #GSocketListener is an object that keeps track of a set
6790  * of server sockets and helps you accept sockets from any of the
6791  * socket, either sync or async.
6792  *
6793  * If you want to implement a network server, also look at #GSocketService
6794  * and #GThreadedSocketService which are subclass of #GSocketListener
6795  * that makes this even easier.
6796  *
6797  * Since: 2.22
6798  */
6799
6800
6801 /**
6802  * SECTION:gsocketservice
6803  * @title: GSocketService
6804  * @short_description: Make it easy to implement a network service
6805  * @see_also: #GThreadedSocketService, #GSocketListener.
6806  *
6807  * A #GSocketService is an object that represents a service that
6808  * is provided to the network or over local sockets.  When a new
6809  * connection is made to the service the #GSocketService::incoming
6810  * signal is emitted.
6811  *
6812  * A #GSocketService is a subclass of #GSocketListener and you need
6813  * to add the addresses you want to accept connections on with the
6814  * #GSocketListener APIs.
6815  *
6816  * There are two options for implementing a network service based on
6817  * #GSocketService. The first is to create the service using
6818  * g_socket_service_new() and to connect to the #GSocketService::incoming
6819  * signal. The second is to subclass #GSocketService and override the
6820  * default signal handler implementation.
6821  *
6822  * In either case, the handler must immediately return, or else it
6823  * will block additional incoming connections from being serviced.
6824  * If you are interested in writing connection handlers that contain
6825  * blocking code then see #GThreadedSocketService.
6826  *
6827  * The socket service runs on the main loop of the <link
6828  * linkend="g-main-context-push-thread-default-context">thread-default
6829  * context</link> of the thread it is created in, and is not
6830  * threadsafe in general. However, the calls to start and stop the
6831  * service are thread-safe so these can be used from threads that
6832  * handle incoming clients.
6833  *
6834  * Since: 2.22
6835  */
6836
6837
6838 /**
6839  * SECTION:gsrvtarget
6840  * @short_description: DNS SRV record target
6841  * @include: gio/gio.h
6842  *
6843  * SRV (service) records are used by some network protocols to provide
6844  * service-specific aliasing and load-balancing. For example, XMPP
6845  * (Jabber) uses SRV records to locate the XMPP server for a domain;
6846  * rather than connecting directly to "example.com" or assuming a
6847  * specific server hostname like "xmpp.example.com", an XMPP client
6848  * would look up the "xmpp-client" SRV record for "example.com", and
6849  * then connect to whatever host was pointed to by that record.
6850  *
6851  * You can use g_resolver_lookup_service() or
6852  * g_resolver_lookup_service_async() to find the #GSrvTarget<!-- -->s
6853  * for a given service. However, if you are simply planning to connect
6854  * to the remote service, you can use #GNetworkService's
6855  * #GSocketConnectable interface and not need to worry about
6856  * #GSrvTarget at all.
6857  */
6858
6859
6860 /**
6861  * SECTION:gtask
6862  * @short_description: Cancellable synchronous or asynchronous task and result
6863  * @include: gio/gio.h
6864  * @see_also: #GAsyncResult
6865  *
6866  * <para>
6867  *   A #GTask represents and manages a cancellable "task".
6868  * </para>
6869  * <refsect2>
6870  *   <title>Asynchronous operations</title>
6871  *   <para>
6872  *     The most common usage of #GTask is as a #GAsyncResult, to
6873  *     manage data during an asynchronous operation. You call
6874  *     g_task_new() in the "start" method, followed by
6875  *     g_task_set_task_data() and the like if you need to keep some
6876  *     additional data associated with the task, and then pass the
6877  *     task object around through your asynchronous operation.
6878  *     Eventually, you will call a method such as
6879  *     g_task_return_pointer() or g_task_return_error(), which will
6880  *     save the value you give it and then invoke the task's callback
6881  *     function (waiting until the next next iteration of the main
6882  *     loop first, if necessary). The caller will pass the #GTask back
6883  *     to the operation's finish function (as a #GAsyncResult), and
6884  *     you can use g_task_propagate_pointer() or the like to extract
6885  *     the return value.
6886  *   </para>
6887  *   <example id="gtask-async"><title>GTask as a GAsyncResult</title>
6888  *   <programlisting>
6889  *     typedef struct {
6890  *       CakeFrostingType frosting;
6891  *       char *message;
6892  *     } DecorationData;
6893  *
6894  *     static void
6895  *     decoration_data_free (DecorationData *decoration)
6896  *     {
6897  *       g_free (decoration->message);
6898  *       g_slice_free (DecorationData, decoration);
6899  *     }
6900  *
6901  *     static void
6902  *     baked_cb (Cake     *cake,
6903  *               gpointer  user_data)
6904  *     {
6905  *       GTask *task = user_data;
6906  *       DecorationData *decoration = g_task_get_task_data (task);
6907  *       GError *error = NULL;
6908  *
6909  *       if (cake == NULL)
6910  *         {
6911  *           g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_NO_FLOUR,
6912  *                                    "Go to the supermarket");
6913  *           g_object_unref (task);
6914  *           return;
6915  *         }
6916  *
6917  *       if (!cake_decorate (cake, decoration->frosting, decoration->message, &error))
6918  *         {
6919  *           g_object_unref (cake);
6920  *           /&ast; g_task_return_error() takes ownership of error &ast;/
6921  *           g_task_return_error (task, error);
6922  *           g_object_unref (task);
6923  *           return;
6924  *         }
6925  *
6926  *       g_task_return_pointer (result, cake, g_object_unref);
6927  *       g_object_unref (task);
6928  *     }
6929  *
6930  *     void
6931  *     baker_bake_cake_async (Baker               *self,
6932  *                            guint                radius,
6933  *                            CakeFlavor           flavor,
6934  *                            CakeFrostingType     frosting,
6935  *                            const char          *message,
6936  *                            GCancellable        *cancellable,
6937  *                            GAsyncReadyCallback  callback,
6938  *                            gpointer             user_data)
6939  *     {
6940  *       GTask *task;
6941  *       DecorationData *decoration;
6942  *       Cake  *cake;
6943  *
6944  *       task = g_task_new (self, cancellable, callback, user_data);
6945  *       if (radius < 3)
6946  *         {
6947  *           g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_TOO_SMALL,
6948  *                                    "%ucm radius cakes are silly",
6949  *                                    radius);
6950  *           g_object_unref (task);
6951  *           return;
6952  *         }
6953  *
6954  *       cake = _baker_get_cached_cake (self, radius, flavor, frosting, message);
6955  *       if (cake != NULL)
6956  *         {
6957  *           /&ast; _baker_get_cached_cake() returns a reffed cake &ast;/
6958  *           g_task_return_pointer (task, cake, g_object_unref);
6959  *           g_object_unref (task);
6960  *           return;
6961  *         }
6962  *
6963  *       decoration = g_slice_new (DecorationData);
6964  *       decoration->frosting = frosting;
6965  *       decoration->message = g_strdup (message);
6966  *       g_task_set_task_data (task, decoration, (GDestroyNotify) decoration_data_free);
6967  *
6968  *       _baker_begin_cake (self, radius, flavor, cancellable, baked_cb, task);
6969  *     }
6970  *
6971  *     Cake *
6972  *     baker_bake_cake_finish (Baker         *self,
6973  *                             GAsyncResult  *result,
6974  *                             GError       **error)
6975  *     {
6976  *       g_return_val_if_fail (g_task_is_valid (result, self), NULL);
6977  *
6978  *       return g_task_propagate_pointer (G_TASK (result), error);
6979  *     }
6980  *   </programlisting>
6981  *   </example>
6982  * </refsect2>
6983  * <refsect2>
6984  *   <title>Chained asynchronous operations</title>
6985  *   <para>
6986  *     #GTask also tries to simplify asynchronous operations that
6987  *     internally chain together several smaller asynchronous
6988  *     operations. g_task_get_cancellable(), g_task_get_context(), and
6989  *     g_task_get_priority() allow you to get back the task's
6990  *     #GCancellable, #GMainContext, and <link
6991  *     linkend="io-priority">I/O priority</link> when starting a new
6992  *     subtask, so you don't have to keep track of them yourself.
6993  *     g_task_attach_source() simplifies the case of waiting for a
6994  *     source to fire (automatically using the correct #GMainContext
6995  *     and priority).
6996  *   </para>
6997  *   <example id="gtask-chained"><title>Chained asynchronous operations</title>
6998  *   <programlisting>
6999  *     typedef struct {
7000  *       Cake *cake;
7001  *       CakeFrostingType frosting;
7002  *       char *message;
7003  *     } BakingData;
7004  *
7005  *     static void
7006  *     decoration_data_free (BakingData *bd)
7007  *     {
7008  *       if (bd->cake)
7009  *         g_object_unref (bd->cake);
7010  *       g_free (bd->message);
7011  *       g_slice_free (BakingData, bd);
7012  *     }
7013  *
7014  *     static void
7015  *     decorated_cb (Cake         *cake,
7016  *                   GAsyncResult *result,
7017  *                   gpointer      user_data)
7018  *     {
7019  *       GTask *task = user_data;
7020  *       GError *error = NULL;
7021  *
7022  *       if (!cake_decorate_finish (cake, result, &error))
7023  *         {
7024  *           g_object_unref (cake);
7025  *           g_task_return_error (task, error);
7026  *           g_object_unref (task);
7027  *           return;
7028  *         }
7029  *
7030  *       /&ast; baking_data_free() will drop its ref on the cake, so
7031  *        &ast; we have to take another here to give to the caller.
7032  *        &ast;/
7033  *       g_task_return_pointer (result, g_object_ref (cake), g_object_unref);
7034  *       g_object_unref (task);
7035  *     }
7036  *
7037  *     static void
7038  *     decorator_ready (gpointer user_data)
7039  *     {
7040  *       GTask *task = user_data;
7041  *       BakingData *bd = g_task_get_task_data (task);
7042  *
7043  *       cake_decorate_async (bd->cake, bd->frosting, bd->message,
7044  *                            g_task_get_cancellable (task),
7045  *                            decorated_cb, task);
7046  *     }
7047  *
7048  *     static void
7049  *     baked_cb (Cake     *cake,
7050  *               gpointer  user_data)
7051  *     {
7052  *       GTask *task = user_data;
7053  *       BakingData *bd = g_task_get_task_data (task);
7054  *       GError *error = NULL;
7055  *
7056  *       if (cake == NULL)
7057  *         {
7058  *           g_task_return_new_error (task, BAKER_ERROR, BAKER_ERROR_NO_FLOUR,
7059  *                                    "Go to the supermarket");
7060  *           g_object_unref (task);
7061  *           return;
7062  *         }
7063  *
7064  *       bd->cake = cake;
7065  *
7066  *       /&ast; Bail out now if the user has already cancelled &ast;/
7067  *       if (g_task_return_error_if_cancelled (g_task_get_cancellable (task)))
7068  *         {
7069  *           g_object_unref (task);
7070  *           return;
7071  *         }
7072  *
7073  *       if (cake_decorator_available (cake))
7074  *         decorator_ready (task);
7075  *       else
7076  *         {
7077  *           GSource *source;
7078  *
7079  *           source = cake_decorator_wait_source_new (cake);
7080  *           /&ast; Attach @source to @task's GMainContext and have it call
7081  *            &ast; decorator_ready() when it is ready.
7082  *            &ast;/
7083  *           g_task_attach_source (task, source,
7084  *                                 G_CALLBACK (decorator_ready));
7085  *           g_source_unref (source);
7086  *         }
7087  *     }
7088  *
7089  *     void
7090  *     baker_bake_cake_async (Baker               *self,
7091  *                            guint                radius,
7092  *                            CakeFlavor           flavor,
7093  *                            CakeFrostingType     frosting,
7094  *                            const char          *message,
7095  *                            gint                 priority,
7096  *                            GCancellable        *cancellable,
7097  *                            GAsyncReadyCallback  callback,
7098  *                            gpointer             user_data)
7099  *     {
7100  *       GTask *task;
7101  *       BakingData *bd;
7102  *
7103  *       task = g_task_new (self, cancellable, callback, user_data);
7104  *       g_task_set_priority (task, priority);
7105  *
7106  *       bd = g_slice_new0 (BakingData);
7107  *       bd->frosting = frosting;
7108  *       bd->message = g_strdup (message);
7109  *       g_task_set_task_data (task, bd, (GDestroyNotify) baking_data_free);
7110  *
7111  *       _baker_begin_cake (self, radius, flavor, cancellable, baked_cb, task);
7112  *     }
7113  *
7114  *     Cake *
7115  *     baker_bake_cake_finish (Baker         *self,
7116  *                             GAsyncResult  *result,
7117  *                             GError       **error)
7118  *     {
7119  *       g_return_val_if_fail (g_task_is_valid (result, self), NULL);
7120  *
7121  *       return g_task_propagate_pointer (G_TASK (result), error);
7122  *     }
7123  *   </programlisting>
7124  *   </example>
7125  * </refsect2>
7126  * <refsect2>
7127  *   <title>Asynchronous operations from synchronous ones</title>
7128  *   <para>
7129  *     You can use g_task_run_in_thread() to turn a synchronous
7130  *     operation into an asynchronous one, by running it in a thread
7131  *     which will then dispatch the result back to the caller's
7132  *     #GMainContext when it completes.
7133  *   </para>
7134  *   <example id="gtask-run-in-thread"><title>g_task_run_in_thread()</title>
7135  *   <programlisting>
7136  *     typedef struct {
7137  *       guint radius;
7138  *       CakeFlavor flavor;
7139  *       CakeFrostingType frosting;
7140  *       char *message;
7141  *     } CakeData;
7142  *
7143  *     static void
7144  *     cake_data_free (CakeData *cake_data)
7145  *     {
7146  *       g_free (cake_data->message);
7147  *       g_slice_free (CakeData, cake_data);
7148  *     }
7149  *
7150  *     static void
7151  *     bake_cake_thread (GTask         *task,
7152  *                       gpointer       source_object,
7153  *                       gpointer       task_data,
7154  *                       GCancellable  *cancellable)
7155  *     {
7156  *       Baker *self = source_object;
7157  *       CakeData *cake_data = task_data;
7158  *       Cake *cake;
7159  *       GError *error = NULL;
7160  *
7161  *       cake = bake_cake (baker, cake_data->radius, cake_data->flavor,
7162  *                         cake_data->frosting, cake_data->message,
7163  *                         cancellable, &error);
7164  *       if (cake)
7165  *         g_task_return_pointer (task, cake, g_object_unref);
7166  *       else
7167  *         g_task_return_error (task, error);
7168  *     }
7169  *
7170  *     void
7171  *     baker_bake_cake_async (Baker               *self,
7172  *                            guint                radius,
7173  *                            CakeFlavor           flavor,
7174  *                            CakeFrostingType     frosting,
7175  *                            const char          *message,
7176  *                            GCancellable        *cancellable,
7177  *                            GAsyncReadyCallback  callback,
7178  *                            gpointer             user_data)
7179  *     {
7180  *       CakeData *cake_data;
7181  *       GTask *task;
7182  *
7183  *       cake_data = g_slice_new (CakeData);
7184  *       cake_data->radius = radius;
7185  *       cake_data->flavor = flavor;
7186  *       cake_data->frosting = frosting;
7187  *       cake_data->message = g_strdup (message);
7188  *       task = g_task_new (self, cancellable, callback, user_data);
7189  *       g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7190  *       g_task_run_in_thread (task, bake_cake_thread);
7191  *     }
7192  *
7193  *     Cake *
7194  *     baker_bake_cake_finish (Baker         *self,
7195  *                             GAsyncResult  *result,
7196  *                             GError       **error)
7197  *     {
7198  *       g_return_val_if_fail (g_task_is_valid (result, self), NULL);
7199  *
7200  *       return g_task_propagate_pointer (G_TASK (result), error);
7201  *     }
7202  *   </programlisting>
7203  *   </example>
7204  * </refsect2>
7205  * <refsect2>
7206  *   <title>Adding cancellability to uncancellable tasks</title>
7207  *   <para>
7208  *     Finally, g_task_run_in_thread() and g_task_run_in_thread_sync()
7209  *     can be used to turn an uncancellable operation into a
7210  *     cancellable one. If you call g_task_set_return_on_cancel(),
7211  *     passing %TRUE, then if the task's #GCancellable is cancelled,
7212  *     it will return control back to the caller immediately, while
7213  *     allowing the task thread to continue running in the background
7214  *     (and simply discarding its result when it finally does finish).
7215  *     Provided that the task thread is careful about how it uses
7216  *     locks and other externally-visible resources, this allows you
7217  *     to make "GLib-friendly" asynchronous and cancellable
7218  *     synchronous variants of blocking APIs.
7219  *   </para>
7220  *   <example id="gtask-cancellable"><title>g_task_set_return_on_cancel()</title>
7221  *   <programlisting>
7222  *     static void
7223  *     bake_cake_thread (GTask         *task,
7224  *                       gpointer       source_object,
7225  *                       gpointer       task_data,
7226  *                       GCancellable  *cancellable)
7227  *     {
7228  *       Baker *self = source_object;
7229  *       CakeData *cake_data = task_data;
7230  *       Cake *cake;
7231  *       GError *error = NULL;
7232  *
7233  *       cake = bake_cake (baker, cake_data->radius, cake_data->flavor,
7234  *                         cake_data->frosting, cake_data->message,
7235  *                         &error);
7236  *       if (error)
7237  *         {
7238  *           g_task_return_error (task, error);
7239  *           return;
7240  *         }
7241  *
7242  *       /&ast; If the task has already been cancelled, then we don't
7243  *        &ast; want to add the cake to the cake cache. Likewise, we don't
7244  *        &ast; want to have the task get cancelled in the middle of
7245  *        &ast; updating the cache. g_task_set_return_on_cancel() will
7246  *        &ast; return %TRUE here if it managed to disable return-on-cancel,
7247  *        &ast; or %FALSE if the task was cancelled before it could.
7248  *        &ast;/
7249  *       if (g_task_set_return_on_cancel (task, FALSE))
7250  *         {
7251  *           /&ast; If the caller cancels at this point, their
7252  *            &ast; GAsyncReadyCallback won't be invoked until we return,
7253  *            &ast; so we don't have to worry that this code will run at
7254  *            &ast; the same time as that code does. But if there were
7255  *            &ast; other functions that might look at the cake cache,
7256  *            &ast; then we'd probably need a GMutex here as well.
7257  *            &ast;/
7258  *           baker_add_cake_to_cache (baker, cake);
7259  *           g_task_return_pointer (task, cake, g_object_unref);
7260  *         }
7261  *     }
7262  *
7263  *     void
7264  *     baker_bake_cake_async (Baker               *self,
7265  *                            guint                radius,
7266  *                            CakeFlavor           flavor,
7267  *                            CakeFrostingType     frosting,
7268  *                            const char          *message,
7269  *                            GCancellable        *cancellable,
7270  *                            GAsyncReadyCallback  callback,
7271  *                            gpointer             user_data)
7272  *     {
7273  *       CakeData *cake_data;
7274  *       GTask *task;
7275  *
7276  *       cake_data = g_slice_new (CakeData);
7277  *       /&ast; ... &ast;/
7278  *
7279  *       task = g_task_new (self, cancellable, callback, user_data);
7280  *       g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7281  *       g_task_set_return_on_cancel (task, TRUE);
7282  *       g_task_run_in_thread (task, bake_cake_thread);
7283  *     }
7284  *
7285  *     Cake *
7286  *     baker_bake_cake_sync (Baker               *self,
7287  *                           guint                radius,
7288  *                           CakeFlavor           flavor,
7289  *                           CakeFrostingType     frosting,
7290  *                           const char          *message,
7291  *                           GCancellable        *cancellable,
7292  *                           GError             **error)
7293  *     {
7294  *       CakeData *cake_data;
7295  *       GTask *task;
7296  *       Cake *cake;
7297  *
7298  *       cake_data = g_slice_new (CakeData);
7299  *       /&ast; ... &ast;/
7300  *
7301  *       task = g_task_new (self, cancellable, NULL, NULL);
7302  *       g_task_set_task_data (task, cake_data, (GDestroyNotify) cake_data_free);
7303  *       g_task_set_return_on_cancel (task, TRUE);
7304  *       g_task_run_in_thread_sync (task, bake_cake_thread);
7305  *
7306  *       cake = g_task_propagate_pointer (task, error);
7307  *       g_object_unref (task);
7308  *       return cake;
7309  *     }
7310  *   </programlisting>
7311  *   </example>
7312  * </refsect2>
7313  * <refsect2>
7314  *   <title>Porting from <literal>GSimpleAsyncResult</literal></title>
7315  *   <para>
7316  *     #GTask's API attempts to be simpler than #GSimpleAsyncResult's
7317  *     in several ways:
7318  *   </para>
7319  *   <itemizedlist>
7320  *     <listitem><para>
7321  *       You can save task-specific data with g_task_set_task_data(), and
7322  *       retrieve it later with g_task_get_task_data(). This replaces the
7323  *       abuse of g_simple_async_result_set_op_res_gpointer() for the same
7324  *       purpose with #GSimpleAsyncResult.
7325  *     </para></listitem>
7326  *     <listitem><para>
7327  *       In addition to the task data, #GTask also keeps track of the
7328  *       <link linkend="io-priority">priority</link>, #GCancellable, and
7329  *       #GMainContext associated with the task, so tasks that consist of
7330  *       a chain of simpler asynchronous operations will have easy access
7331  *       to those values when starting each sub-task.
7332  *     </para></listitem>
7333  *     <listitem><para>
7334  *       g_task_return_error_if_cancelled() provides simplified
7335  *       handling for cancellation. In addition, cancellation
7336  *       overrides any other #GTask return value by default, like
7337  *       #GSimpleAsyncResult does when
7338  *       g_simple_async_result_set_check_cancellable() is called.
7339  *       (You can use g_task_set_check_cancellable() to turn off that
7340  *       behavior.) On the other hand, g_task_run_in_thread()
7341  *       guarantees that it will always run your
7342  *       <literal>task_func</literal>, even if the task's #GCancellable
7343  *       is already cancelled before the task gets a chance to run;
7344  *       you can start your <literal>task_func</literal> with a
7345  *       g_task_return_error_if_cancelled() check if you need the
7346  *       old behavior.
7347  *     </para></listitem>
7348  *     <listitem><para>
7349  *       The "return" methods (eg, g_task_return_pointer())
7350  *       automatically cause the task to be "completed" as well, and
7351  *       there is no need to worry about the "complete" vs "complete
7352  *       in idle" distinction. (#GTask automatically figures out
7353  *       whether the task's callback can be invoked directly, or
7354  *       if it needs to be sent to another #GMainContext, or delayed
7355  *       until the next iteration of the current #GMainContext.)
7356  *     </para></listitem>
7357  *     <listitem><para>
7358  *       The "finish" functions for #GTask-based operations are generally
7359  *       much simpler than #GSimpleAsyncResult ones, normally consisting
7360  *       of only a single call to g_task_propagate_pointer() or the like.
7361  *       Since g_task_propagate_pointer() "steals" the return value from
7362  *       the #GTask, it is not necessary to juggle pointers around to
7363  *       prevent it from being freed twice.
7364  *     </para></listitem>
7365  *     <listitem><para>
7366  *       With #GSimpleAsyncResult, it was common to call
7367  *       g_simple_async_result_propagate_error() from the
7368  *       <literal>_finish()</literal> wrapper function, and have
7369  *       virtual method implementations only deal with successful
7370  *       returns. This behavior is deprecated, because it makes it
7371  *       difficult for a subclass to chain to a parent class's async
7372  *       methods. Instead, the wrapper function should just be a
7373  *       simple wrapper, and the virtual method should call an
7374  *       appropriate <literal>g_task_propagate_</literal> function.
7375  *       Note that wrapper methods can now use
7376  *       g_async_result_legacy_propagate_error() to do old-style
7377  *       #GSimpleAsyncResult error-returning behavior, and
7378  *       g_async_result_is_tagged() to check if a result is tagged as
7379  *       having come from the <literal>_async()</literal> wrapper
7380  *       function (for "short-circuit" results, such as when passing
7381  *       0 to g_input_stream_read_async()).
7382  *     </para></listitem>
7383  *   </itemizedlist>
7384  * </refsect2>
7385  */
7386
7387
7388 /**
7389  * SECTION:gtcpconnection
7390  * @title: GTcpConnection
7391  * @short_description: A TCP GSocketConnection
7392  * @see_also: #GSocketConnection.
7393  *
7394  * This is the subclass of #GSocketConnection that is created
7395  * for TCP/IP sockets.
7396  *
7397  * Since: 2.22
7398  */
7399
7400
7401 /**
7402  * SECTION:gtcpwrapperconnection
7403  * @title: GTcpWrapperConnection
7404  * @short_description: wrapper for non-GSocketConnection-based, GSocket-based GIOStreams
7405  * @see_also: #GSocketConnection.
7406  *
7407  * A #GTcpWrapperConnection can be used to wrap a #GIOStream that is
7408  * based on a #GSocket, but which is not actually a
7409  * #GSocketConnection. This is used by #GSocketClient so that it can
7410  * always return a #GSocketConnection, even when the connection it has
7411  * actually created is not directly a #GSocketConnection.
7412  *
7413  * Since: 2.28
7414  */
7415
7416
7417 /**
7418  * SECTION:gtestdbus
7419  * @short_description: D-Bus testing helper
7420  * @include: gio/gio.h
7421  *
7422  * A helper class for testing code which uses D-Bus without touching the user's
7423  * session bus.
7424  */
7425
7426
7427 /**
7428  * SECTION:gthemedicon
7429  * @short_description: Icon theming support
7430  * @include: gio/gio.h
7431  * @see_also: #GIcon, #GLoadableIcon
7432  *
7433  * #GThemedIcon is an implementation of #GIcon that supports icon themes.
7434  * #GThemedIcon contains a list of all of the icons present in an icon
7435  * theme, so that icons can be looked up quickly. #GThemedIcon does
7436  * not provide actual pixmaps for icons, just the icon names.
7437  * Ideally something like gtk_icon_theme_choose_icon() should be used to
7438  * resolve the list of names so that fallback icons work nicely with
7439  * themes that inherit other themes.
7440  */
7441
7442
7443 /**
7444  * SECTION:gthreadedsocketservice
7445  * @title: GThreadedSocketService
7446  * @short_description: A threaded GSocketService
7447  * @see_also: #GSocketService.
7448  *
7449  * A #GThreadedSocketService is a simple subclass of #GSocketService
7450  * that handles incoming connections by creating a worker thread and
7451  * dispatching the connection to it by emitting the
7452  * #GThreadedSocketService::run signal in the new thread.
7453  *
7454  * The signal handler may perform blocking IO and need not return
7455  * until the connection is closed.
7456  *
7457  * The service is implemented using a thread pool, so there is a
7458  * limited amount of threads available to serve incoming requests.
7459  * The service automatically stops the #GSocketService from accepting
7460  * new connections when all threads are busy.
7461  *
7462  * As with #GSocketService, you may connect to #GThreadedSocketService::run,
7463  * or subclass and override the default handler.
7464  */
7465
7466
7467 /**
7468  * SECTION:gtls
7469  * @title: TLS Overview
7470  * @short_description: TLS (aka SSL) support for GSocketConnection
7471  * @include: gio/gio.h
7472  *
7473  * #GTlsConnection and related classes provide TLS (Transport Layer
7474  * Security, previously known as SSL, Secure Sockets Layer) support for
7475  * gio-based network streams.
7476  *
7477  * In the simplest case, for a client connection, you can just set the
7478  * #GSocketClient:tls flag on a #GSocketClient, and then any
7479  * connections created by that client will have TLS negotiated
7480  * automatically, using appropriate default settings, and rejecting
7481  * any invalid or self-signed certificates (unless you change that
7482  * default by setting the #GSocketClient:tls-validation-flags
7483  * property). The returned object will be a #GTcpWrapperConnection,
7484  * which wraps the underlying #GTlsClientConnection.
7485  *
7486  * For greater control, you can create your own #GTlsClientConnection,
7487  * wrapping a #GSocketConnection (or an arbitrary #GIOStream with
7488  * pollable input and output streams) and then connect to its signals,
7489  * such as #GTlsConnection::accept-certificate, before starting the
7490  * handshake.
7491  *
7492  * Server-side TLS is similar, using #GTlsServerConnection. At the
7493  * moment, there is no support for automatically wrapping server-side
7494  * connections in the way #GSocketClient does for client-side
7495  * connections.
7496  */
7497
7498
7499 /**
7500  * SECTION:gtlsbackend
7501  * @title: GTlsBackend
7502  * @short_description: TLS backend implementation
7503  * @include: gio/gio.h
7504  */
7505
7506
7507 /**
7508  * SECTION:gtlscertificate
7509  * @title: GTlsCertificate
7510  * @short_description: TLS certificate
7511  * @see_also: #GTlsConnection
7512  *
7513  * A certificate used for TLS authentication and encryption.
7514  * This can represent either a certificate only (eg, the certificate
7515  * received by a client from a server), or the combination of
7516  * a certificate and a private key (which is needed when acting as a
7517  * #GTlsServerConnection).
7518  *
7519  * Since: 2.28
7520  */
7521
7522
7523 /**
7524  * SECTION:gtlsclientconnection
7525  * @short_description: TLS client-side connection
7526  * @include: gio/gio.h
7527  *
7528  * #GTlsClientConnection is the client-side subclass of
7529  * #GTlsConnection, representing a client-side TLS connection.
7530  */
7531
7532
7533 /**
7534  * SECTION:gtlsconnection
7535  * @short_description: TLS connection type
7536  * @include: gio/gio.h
7537  *
7538  * #GTlsConnection is the base TLS connection class type, which wraps
7539  * a #GIOStream and provides TLS encryption on top of it. Its
7540  * subclasses, #GTlsClientConnection and #GTlsServerConnection,
7541  * implement client-side and server-side TLS, respectively.
7542  *
7543  * Since: 2.28
7544  */
7545
7546
7547 /**
7548  * SECTION:gtlsdatabase
7549  * @short_description: TLS database type
7550  * @include: gio/gio.h
7551  *
7552  * #GTlsDatabase is used to lookup certificates and other information
7553  * from a certificate or key store. It is an abstract base class which
7554  * TLS library specific subtypes override.
7555  *
7556  * Most common client applications will not directly interact with
7557  * #GTlsDatabase. It is used internally by #GTlsConnection.
7558  *
7559  * Since: 2.30
7560  */
7561
7562
7563 /**
7564  * SECTION:gtlsfiledatabase
7565  * @short_description: TLS file based database type
7566  * @include: gio/gio.h
7567  *
7568  * #GTlsFileDatabase is implemented by #GTlsDatabase objects which load
7569  * their certificate information from a file. It is in interface which
7570  * TLS library specific subtypes implement.
7571  *
7572  * Since: 2.30
7573  */
7574
7575
7576 /**
7577  * SECTION:gtlsinteraction
7578  * @short_description: Interaction with the user during TLS operations.
7579  * @include: gio/gio.h
7580  *
7581  * #GTlsInteraction provides a mechanism for the TLS connection and database
7582  * code to interact with the user. It can be used to ask the user for passwords.
7583  *
7584  * To use a #GTlsInteraction with a TLS connection use
7585  * g_tls_connection_set_interaction().
7586  *
7587  * Callers should instantiate a derived class that implements the various
7588  * interaction methods to show the required dialogs.
7589  *
7590  * Callers should use the 'invoke' functions like
7591  * g_tls_interaction_invoke_ask_password() to run interaction methods. These
7592  * functions make sure that the interaction is invoked in the main loop
7593  * and not in the current thread, if the current thread is not running the
7594  * main loop.
7595  *
7596  * Derived classes can choose to implement whichever interactions methods they'd
7597  * like to support by overriding those virtual methods in their class
7598  * initialization function. Any interactions not implemented will return
7599  * %G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method,
7600  * it must also implement the corresponding finish method.
7601  */
7602
7603
7604 /**
7605  * SECTION:gtlspassword
7606  * @title: GTlsPassword
7607  * @short_description: TLS Passwords for prompting
7608  * @include: gio/gio.h
7609  *
7610  * Holds a password used in TLS.
7611  */
7612
7613
7614 /**
7615  * SECTION:gtlsserverconnection
7616  * @short_description: TLS server-side connection
7617  * @include: gio/gio.h
7618  *
7619  * #GTlsServerConnection is the server-side subclass of #GTlsConnection,
7620  * representing a server-side TLS connection.
7621  *
7622  * Since: 2.28
7623  */
7624
7625
7626 /**
7627  * SECTION:gunixconnection
7628  * @title: GUnixConnection
7629  * @short_description: A UNIX domain GSocketConnection
7630  * @include: gio/gunixconnection.h
7631  * @see_also: #GSocketConnection.
7632  *
7633  * This is the subclass of #GSocketConnection that is created
7634  * for UNIX domain sockets.
7635  *
7636  * It contains functions to do some of the UNIX socket specific
7637  * functionality like passing file descriptors.
7638  *
7639  * Note that <filename>&lt;gio/gunixconnection.h&gt;</filename> belongs to
7640  * the UNIX-specific GIO interfaces, thus you have to use the
7641  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7642  *
7643  * Since: 2.22
7644  */
7645
7646
7647 /**
7648  * SECTION:gunixcredentialsmessage
7649  * @title: GUnixCredentialsMessage
7650  * @short_description: A GSocketControlMessage containing credentials
7651  * @include: gio/gunixcredentialsmessage.h
7652  * @see_also: #GUnixConnection, #GSocketControlMessage
7653  *
7654  * This #GSocketControlMessage contains a #GCredentials instance.  It
7655  * may be sent using g_socket_send_message() and received using
7656  * g_socket_receive_message() over UNIX sockets (ie: sockets in the
7657  * %G_SOCKET_FAMILY_UNIX family).
7658  *
7659  * For an easier way to send and receive credentials over
7660  * stream-oriented UNIX sockets, see
7661  * g_unix_connection_send_credentials() and
7662  * g_unix_connection_receive_credentials(). To receive credentials of
7663  * a foreign process connected to a socket, use
7664  * g_socket_get_credentials().
7665  */
7666
7667
7668 /**
7669  * SECTION:gunixfdlist
7670  * @title: GUnixFDList
7671  * @short_description: An object containing a set of UNIX file descriptors
7672  * @include: gio/gunixfdlist.h
7673  * @see_also: #GUnixFDMessage
7674  *
7675  * A #GUnixFDList contains a list of file descriptors.  It owns the file
7676  * descriptors that it contains, closing them when finalized.
7677  *
7678  * It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in
7679  * the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message()
7680  * and received using g_socket_receive_message().
7681  *
7682  * Note that <filename>&lt;gio/gunixfdlist.h&gt;</filename> belongs to
7683  * the UNIX-specific GIO interfaces, thus you have to use the
7684  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7685  */
7686
7687
7688 /**
7689  * SECTION:gunixfdmessage
7690  * @title: GUnixFDMessage
7691  * @short_description: A GSocketControlMessage containing a GUnixFDList
7692  * @include: gio/gunixfdmessage.h
7693  * @see_also: #GUnixConnection, #GUnixFDList, #GSocketControlMessage
7694  *
7695  * This #GSocketControlMessage contains a #GUnixFDList.
7696  * It may be sent using g_socket_send_message() and received using
7697  * g_socket_receive_message() over UNIX sockets (ie: sockets in the
7698  * %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied
7699  * between processes by the kernel.
7700  *
7701  * For an easier way to send and receive file descriptors over
7702  * stream-oriented UNIX sockets, see g_unix_connection_send_fd() and
7703  * g_unix_connection_receive_fd().
7704  *
7705  * Note that <filename>&lt;gio/gunixfdmessage.h&gt;</filename> belongs to
7706  * the UNIX-specific GIO interfaces, thus you have to use the
7707  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7708  */
7709
7710
7711 /**
7712  * SECTION:gunixinputstream
7713  * @short_description: Streaming input operations for UNIX file descriptors
7714  * @include: gio/gunixinputstream.h
7715  * @see_also: #GInputStream
7716  *
7717  * #GUnixInputStream implements #GInputStream for reading from a UNIX
7718  * file descriptor, including asynchronous operations. (If the file
7719  * descriptor refers to a socket or pipe, this will use poll() to do
7720  * asynchronous I/O. If it refers to a regular file, it will fall back
7721  * to doing asynchronous I/O in another thread.)
7722  *
7723  * Note that <filename>&lt;gio/gunixinputstream.h&gt;</filename> belongs
7724  * to the UNIX-specific GIO interfaces, thus you have to use the
7725  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7726  */
7727
7728
7729 /**
7730  * SECTION:gunixmounts
7731  * @include: gio/gunixmounts.h
7732  * @short_description: UNIX mounts
7733  *
7734  * Routines for managing mounted UNIX mount points and paths.
7735  *
7736  * Note that <filename>&lt;gio/gunixmounts.h&gt;</filename> belongs to the
7737  * UNIX-specific GIO interfaces, thus you have to use the
7738  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7739  */
7740
7741
7742 /**
7743  * SECTION:gunixoutputstream
7744  * @short_description: Streaming output operations for UNIX file descriptors
7745  * @include: gio/gunixoutputstream.h
7746  * @see_also: #GOutputStream
7747  *
7748  * #GUnixOutputStream implements #GOutputStream for writing to a UNIX
7749  * file descriptor, including asynchronous operations. (If the file
7750  * descriptor refers to a socket or pipe, this will use poll() to do
7751  * asynchronous I/O. If it refers to a regular file, it will fall back
7752  * to doing asynchronous I/O in another thread.)
7753  *
7754  * Note that <filename>&lt;gio/gunixoutputstream.h&gt;</filename> belongs
7755  * to the UNIX-specific GIO interfaces, thus you have to use the
7756  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7757  */
7758
7759
7760 /**
7761  * SECTION:gunixsocketaddress
7762  * @short_description: UNIX GSocketAddress
7763  * @include: gio/gunixsocketaddress.h
7764  *
7765  * Support for UNIX-domain (also known as local) sockets.
7766  *
7767  * UNIX domain sockets are generally visible in the filesystem.
7768  * However, some systems support abstract socket names which are not
7769  * visible in the filesystem and not affected by the filesystem
7770  * permissions, visibility, etc. Currently this is only supported
7771  * under Linux. If you attempt to use abstract sockets on other
7772  * systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED
7773  * errors. You can use g_unix_socket_address_abstract_names_supported()
7774  * to see if abstract names are supported.
7775  *
7776  * Note that <filename>&lt;gio/gunixsocketaddress.h&gt;</filename> belongs to
7777  * the UNIX-specific GIO interfaces, thus you have to use the
7778  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7779  */
7780
7781
7782 /**
7783  * SECTION:gvfs
7784  * @short_description: Virtual File System
7785  * @include: gio/gio.h
7786  *
7787  * Entry point for using GIO functionality.
7788  */
7789
7790
7791 /**
7792  * SECTION:gvolume
7793  * @short_description: Volume management
7794  * @include: gio/gio.h
7795  *
7796  * The #GVolume interface represents user-visible objects that can be
7797  * mounted. Note, when porting from GnomeVFS, #GVolume is the moral
7798  * equivalent of #GnomeVFSDrive.
7799  *
7800  * Mounting a #GVolume instance is an asynchronous operation. For more
7801  * information about asynchronous operations, see #GAsyncResult and
7802  * #GTask. To mount a #GVolume, first call g_volume_mount() with (at
7803  * least) the #GVolume instance, optionally a #GMountOperation object
7804  * and a #GAsyncReadyCallback.
7805  *
7806  * Typically, one will only want to pass %NULL for the
7807  * #GMountOperation if automounting all volumes when a desktop session
7808  * starts since it's not desirable to put up a lot of dialogs asking
7809  * for credentials.
7810  *
7811  * The callback will be fired when the operation has resolved (either
7812  * with success or failure), and a #GAsyncReady structure will be
7813  * passed to the callback.  That callback should then call
7814  * g_volume_mount_finish() with the #GVolume instance and the
7815  * #GAsyncReady data to see if the operation was completed
7816  * successfully.  If an @error is present when g_volume_mount_finish()
7817  * is called, then it will be filled with any error information.
7818  *
7819  * <para id="volume-identifier">
7820  * It is sometimes necessary to directly access the underlying
7821  * operating system object behind a volume (e.g. for passing a volume
7822  * to an application via the commandline). For this purpose, GIO
7823  * allows to obtain an 'identifier' for the volume. There can be
7824  * different kinds of identifiers, such as Hal UDIs, filesystem labels,
7825  * traditional Unix devices (e.g. <filename>/dev/sda2</filename>),
7826  * uuids. GIO uses predefind strings as names for the different kinds
7827  * of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI,
7828  * #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier()
7829  * to obtain an identifier for a volume.
7830  * </para>
7831  *
7832  * Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
7833  * when the gvfs hal volume monitor is in use. Other volume monitors
7834  * will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
7835  * identifier, which can be used to obtain a hal device by means of
7836  * libhal_manager_find_device_string_match().
7837  */
7838
7839
7840 /**
7841  * SECTION:gvolumemonitor
7842  * @short_description: Volume Monitor
7843  * @include: gio/gio.h
7844  * @see_also: #GFileMonitor
7845  *
7846  * #GVolumeMonitor is for listing the user interesting devices and volumes
7847  * on the computer. In other words, what a file selector or file manager
7848  * would show in a sidebar.
7849  *
7850  * #GVolumeMonitor is not <link
7851  * linkend="g-main-context-push-thread-default">thread-default-context
7852  * aware</link>, and so should not be used other than from the main
7853  * thread, with no thread-default-context active.
7854  */
7855
7856
7857 /**
7858  * SECTION:gwin32inputstream
7859  * @short_description: Streaming input operations for Windows file handles
7860  * @include: gio/gwin32inputstream.h
7861  * @see_also: #GInputStream
7862  *
7863  * #GWin32InputStream implements #GInputStream for reading from a
7864  * Windows file handle.
7865  *
7866  * Note that <filename>&lt;gio/gwin32inputstream.h&gt;</filename> belongs
7867  * to the Windows-specific GIO interfaces, thus you have to use the
7868  * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7869  */
7870
7871
7872 /**
7873  * SECTION:gwin32outputstream
7874  * @short_description: Streaming output operations for Windows file handles
7875  * @include: gio/gwin32outputstream.h
7876  * @see_also: #GOutputStream
7877  *
7878  * #GWin32OutputStream implements #GOutputStream for writing to a
7879  * Windows file handle.
7880  *
7881  * Note that <filename>&lt;gio/gwin32outputstream.h&gt;</filename> belongs
7882  * to the Windows-specific GIO interfaces, thus you have to use the
7883  * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7884  */
7885
7886
7887 /**
7888  * SECTION:gzcompressor
7889  * @short_description: Zlib compressor
7890  * @include: gio/gio.h
7891  *
7892  * #GZlibCompressor is an implementation of #GConverter that
7893  * compresses data using zlib.
7894  */
7895
7896
7897 /**
7898  * SECTION:gzdecompressor
7899  * @short_description: Zlib decompressor
7900  * @include: gio/gio.h
7901  *
7902  * #GZlibDecompressor is an implementation of #GConverter that
7903  * decompresses data compressed with zlib.
7904  */
7905
7906
7907 /**
7908  * _g_io_module_get_default:
7909  * @extension_point: the name of an extension point
7910  * @envvar: (allow-none): the name of an environment variable to override the default implementation.
7911  * @verify_func: (allow-none): a function to call to verify that a given implementation is usable in the current environment.
7912  *
7913  * Retrieves the default object implementing @extension_point.
7914  *
7915  * If @envvar is not %NULL, and the environment variable with that
7916  * name is set, then the implementation it specifies will be tried
7917  * first. After that, or if @envvar is not set, all other
7918  * implementations will be tried in order of decreasing priority.
7919  *
7920  * If an extension point implementation implements #GInitable, then
7921  * that implementation will only be used if it initializes
7922  * successfully. Otherwise, if @verify_func is not %NULL, then it will
7923  * be called on each candidate implementation after construction, to
7924  * check if it is actually usable or not.
7925  *
7926  * The result is cached after it is generated the first time, and
7927  * the function is thread-safe.
7928  *
7929  * Returns: (transfer none): an object implementing @extension_point, or %NULL if there are no usable implementations.
7930  */
7931
7932
7933 /**
7934  * _g_io_module_get_default_type:
7935  * @extension_point: the name of an extension point
7936  * @envvar: (allow-none): the name of an environment variable to override the default implementation.
7937  * @is_supported_offset: a vtable offset, or zero
7938  *
7939  * Retrieves the default class implementing @extension_point.
7940  *
7941  * If @envvar is not %NULL, and the environment variable with that
7942  * name is set, then the implementation it specifies will be tried
7943  * first. After that, or if @envvar is not set, all other
7944  * implementations will be tried in order of decreasing priority.
7945  *
7946  * If @is_supported_offset is non-zero, then it is the offset into the
7947  * class vtable at which there is a function that takes no arguments and
7948  * returns a boolean.  This function will be called on each candidate
7949  * implementation to check if it is actually usable or not.
7950  *
7951  * The result is cached after it is generated the first time, and
7952  * the function is thread-safe.
7953  *
7954  * Returns: (transfer none): an object implementing @extension_point, or %NULL if there are no usable implementations.
7955  */
7956
7957
7958 /**
7959  * g_action_activate:
7960  * @action: a #GAction
7961  * @parameter: (allow-none): the parameter to the activation
7962  *
7963  * Activates the action.
7964  *
7965  * @parameter must be the correct type of parameter for the action (ie:
7966  * the parameter type given at construction time).  If the parameter
7967  * type was %NULL then @parameter must also be %NULL.
7968  *
7969  * Since: 2.28
7970  */
7971
7972
7973 /**
7974  * g_action_change_state:
7975  * @action: a #GAction
7976  * @value: the new state
7977  *
7978  * Request for the state of @action to be changed to @value.
7979  *
7980  * The action must be stateful and @value must be of the correct type.
7981  * See g_action_get_state_type().
7982  *
7983  * This call merely requests a change.  The action may refuse to change
7984  * its state or may change its state to something other than @value.
7985  * See g_action_get_state_hint().
7986  *
7987  * If the @value GVariant is floating, it is consumed.
7988  *
7989  * Since: 2.30
7990  */
7991
7992
7993 /**
7994  * g_action_get_enabled:
7995  * @action: a #GAction
7996  *
7997  * Checks if @action is currently enabled.
7998  *
7999  * An action must be enabled in order to be activated or in order to
8000  * have its state changed from outside callers.
8001  *
8002  * Returns: whether the action is enabled
8003  * Since: 2.28
8004  */
8005
8006
8007 /**
8008  * g_action_get_name:
8009  * @action: a #GAction
8010  *
8011  * Queries the name of @action.
8012  *
8013  * Returns: the name of the action
8014  * Since: 2.28
8015  */
8016
8017
8018 /**
8019  * g_action_get_parameter_type:
8020  * @action: a #GAction
8021  *
8022  * Queries the type of the parameter that must be given when activating
8023  * @action.
8024  *
8025  * When activating the action using g_action_activate(), the #GVariant
8026  * given to that function must be of the type returned by this function.
8027  *
8028  * In the case that this function returns %NULL, you must not give any
8029  * #GVariant, but %NULL instead.
8030  *
8031  * Returns: (allow-none): the parameter type
8032  * Since: 2.28
8033  */
8034
8035
8036 /**
8037  * g_action_get_state:
8038  * @action: a #GAction
8039  *
8040  * Queries the current state of @action.
8041  *
8042  * If the action is not stateful then %NULL will be returned.  If the
8043  * action is stateful then the type of the return value is the type
8044  * given by g_action_get_state_type().
8045  *
8046  * The return value (if non-%NULL) should be freed with
8047  * g_variant_unref() when it is no longer required.
8048  *
8049  * Returns: (transfer full): the current state of the action
8050  * Since: 2.28
8051  */
8052
8053
8054 /**
8055  * g_action_get_state_hint:
8056  * @action: a #GAction
8057  *
8058  * Requests a hint about the valid range of values for the state of
8059  * @action.
8060  *
8061  * If %NULL is returned it either means that the action is not stateful
8062  * or that there is no hint about the valid range of values for the
8063  * state of the action.
8064  *
8065  * If a #GVariant array is returned then each item in the array is a
8066  * possible value for the state.  If a #GVariant pair (ie: two-tuple) is
8067  * returned then the tuple specifies the inclusive lower and upper bound
8068  * of valid values for the state.
8069  *
8070  * In any case, the information is merely a hint.  It may be possible to
8071  * have a state value outside of the hinted range and setting a value
8072  * within the range may fail.
8073  *
8074  * The return value (if non-%NULL) should be freed with
8075  * g_variant_unref() when it is no longer required.
8076  *
8077  * Returns: (transfer full): the state range hint
8078  * Since: 2.28
8079  */
8080
8081
8082 /**
8083  * g_action_get_state_type:
8084  * @action: a #GAction
8085  *
8086  * Queries the type of the state of @action.
8087  *
8088  * If the action is stateful (e.g. created with
8089  * g_simple_action_new_stateful()) then this function returns the
8090  * #GVariantType of the state.  This is the type of the initial value
8091  * given as the state. All calls to g_action_change_state() must give a
8092  * #GVariant of this type and g_action_get_state() will return a
8093  * #GVariant of the same type.
8094  *
8095  * If the action is not stateful (e.g. created with g_simple_action_new())
8096  * then this function will return %NULL. In that case, g_action_get_state()
8097  * will return %NULL and you must not call g_action_change_state().
8098  *
8099  * Returns: (allow-none): the state type, if the action is stateful
8100  * Since: 2.28
8101  */
8102
8103
8104 /**
8105  * g_action_group_action_added:
8106  * @action_group: a #GActionGroup
8107  * @action_name: the name of an action in the group
8108  *
8109  * Emits the #GActionGroup::action-added signal on @action_group.
8110  *
8111  * This function should only be called by #GActionGroup implementations.
8112  *
8113  * Since: 2.28
8114  */
8115
8116
8117 /**
8118  * g_action_group_action_enabled_changed:
8119  * @action_group: a #GActionGroup
8120  * @action_name: the name of an action in the group
8121  * @enabled: whether or not the action is now enabled
8122  *
8123  * Emits the #GActionGroup::action-enabled-changed signal on @action_group.
8124  *
8125  * This function should only be called by #GActionGroup implementations.
8126  *
8127  * Since: 2.28
8128  */
8129
8130
8131 /**
8132  * g_action_group_action_removed:
8133  * @action_group: a #GActionGroup
8134  * @action_name: the name of an action in the group
8135  *
8136  * Emits the #GActionGroup::action-removed signal on @action_group.
8137  *
8138  * This function should only be called by #GActionGroup implementations.
8139  *
8140  * Since: 2.28
8141  */
8142
8143
8144 /**
8145  * g_action_group_action_state_changed:
8146  * @action_group: a #GActionGroup
8147  * @action_name: the name of an action in the group
8148  * @state: the new state of the named action
8149  *
8150  * Emits the #GActionGroup::action-state-changed signal on @action_group.
8151  *
8152  * This function should only be called by #GActionGroup implementations.
8153  *
8154  * Since: 2.28
8155  */
8156
8157
8158 /**
8159  * g_action_group_activate_action:
8160  * @action_group: a #GActionGroup
8161  * @action_name: the name of the action to activate
8162  * @parameter: (allow-none): parameters to the activation
8163  *
8164  * Activate the named action within @action_group.
8165  *
8166  * If the action is expecting a parameter, then the correct type of
8167  * parameter must be given as @parameter.  If the action is expecting no
8168  * parameters then @parameter must be %NULL.  See
8169  * g_action_group_get_action_parameter_type().
8170  *
8171  * Since: 2.28
8172  */
8173
8174
8175 /**
8176  * g_action_group_change_action_state:
8177  * @action_group: a #GActionGroup
8178  * @action_name: the name of the action to request the change on
8179  * @value: the new state
8180  *
8181  * Request for the state of the named action within @action_group to be
8182  * changed to @value.
8183  *
8184  * The action must be stateful and @value must be of the correct type.
8185  * See g_action_group_get_action_state_type().
8186  *
8187  * This call merely requests a change.  The action may refuse to change
8188  * its state or may change its state to something other than @value.
8189  * See g_action_group_get_action_state_hint().
8190  *
8191  * If the @value GVariant is floating, it is consumed.
8192  *
8193  * Since: 2.28
8194  */
8195
8196
8197 /**
8198  * g_action_group_get_action_enabled:
8199  * @action_group: a #GActionGroup
8200  * @action_name: the name of the action to query
8201  *
8202  * Checks if the named action within @action_group is currently enabled.
8203  *
8204  * An action must be enabled in order to be activated or in order to
8205  * have its state changed from outside callers.
8206  *
8207  * Returns: whether or not the action is currently enabled
8208  * Since: 2.28
8209  */
8210
8211
8212 /**
8213  * g_action_group_get_action_parameter_type:
8214  * @action_group: a #GActionGroup
8215  * @action_name: the name of the action to query
8216  *
8217  * Queries the type of the parameter that must be given when activating
8218  * the named action within @action_group.
8219  *
8220  * When activating the action using g_action_group_activate_action(),
8221  * the #GVariant given to that function must be of the type returned
8222  * by this function.
8223  *
8224  * In the case that this function returns %NULL, you must not give any
8225  * #GVariant, but %NULL instead.
8226  *
8227  * The parameter type of a particular action will never change but it is
8228  * possible for an action to be removed and for a new action to be added
8229  * with the same name but a different parameter type.
8230  *
8231  * Returns: the parameter type
8232  * Since: 2.28
8233  */
8234
8235
8236 /**
8237  * g_action_group_get_action_state:
8238  * @action_group: a #GActionGroup
8239  * @action_name: the name of the action to query
8240  *
8241  * Queries the current state of the named action within @action_group.
8242  *
8243  * If the action is not stateful then %NULL will be returned.  If the
8244  * action is stateful then the type of the return value is the type
8245  * given by g_action_group_get_action_state_type().
8246  *
8247  * The return value (if non-%NULL) should be freed with
8248  * g_variant_unref() when it is no longer required.
8249  *
8250  * Returns: (allow-none): the current state of the action
8251  * Since: 2.28
8252  */
8253
8254
8255 /**
8256  * g_action_group_get_action_state_hint:
8257  * @action_group: a #GActionGroup
8258  * @action_name: the name of the action to query
8259  *
8260  * Requests a hint about the valid range of values for the state of the
8261  * named action within @action_group.
8262  *
8263  * If %NULL is returned it either means that the action is not stateful
8264  * or that there is no hint about the valid range of values for the
8265  * state of the action.
8266  *
8267  * If a #GVariant array is returned then each item in the array is a
8268  * possible value for the state.  If a #GVariant pair (ie: two-tuple) is
8269  * returned then the tuple specifies the inclusive lower and upper bound
8270  * of valid values for the state.
8271  *
8272  * In any case, the information is merely a hint.  It may be possible to
8273  * have a state value outside of the hinted range and setting a value
8274  * within the range may fail.
8275  *
8276  * The return value (if non-%NULL) should be freed with
8277  * g_variant_unref() when it is no longer required.
8278  *
8279  * Returns: (transfer full): the state range hint
8280  * Since: 2.28
8281  */
8282
8283
8284 /**
8285  * g_action_group_get_action_state_type:
8286  * @action_group: a #GActionGroup
8287  * @action_name: the name of the action to query
8288  *
8289  * Queries the type of the state of the named action within
8290  * @action_group.
8291  *
8292  * If the action is stateful then this function returns the
8293  * #GVariantType of the state.  All calls to
8294  * g_action_group_change_action_state() must give a #GVariant of this
8295  * type and g_action_group_get_action_state() will return a #GVariant
8296  * of the same type.
8297  *
8298  * If the action is not stateful then this function will return %NULL.
8299  * In that case, g_action_group_get_action_state() will return %NULL
8300  * and you must not call g_action_group_change_action_state().
8301  *
8302  * The state type of a particular action will never change but it is
8303  * possible for an action to be removed and for a new action to be added
8304  * with the same name but a different state type.
8305  *
8306  * Returns: (transfer full): the state type, if the action is stateful
8307  * Since: 2.28
8308  */
8309
8310
8311 /**
8312  * g_action_group_has_action:
8313  * @action_group: a #GActionGroup
8314  * @action_name: the name of the action to check for
8315  *
8316  * Checks if the named action exists within @action_group.
8317  *
8318  * Returns: whether the named action exists
8319  * Since: 2.28
8320  */
8321
8322
8323 /**
8324  * g_action_group_list_actions:
8325  * @action_group: a #GActionGroup
8326  *
8327  * Lists the actions contained within @action_group.
8328  *
8329  * The caller is responsible for freeing the list with g_strfreev() when
8330  * it is no longer required.
8331  *
8332  * Returns: (transfer full): a %NULL-terminated array of the names of the actions in the groupb
8333  * Since: 2.28
8334  */
8335
8336
8337 /**
8338  * g_action_group_query_action:
8339  * @action_group: a #GActionGroup
8340  * @action_name: the name of an action in the group
8341  * @enabled: (out): if the action is presently enabled
8342  * @parameter_type: (out) (allow-none): the parameter type, or %NULL if none needed
8343  * @state_type: (out) (allow-none): the state type, or %NULL if stateless
8344  * @state_hint: (out) (allow-none): the state hint, or %NULL if none
8345  * @state: (out) (allow-none): the current state, or %NULL if stateless
8346  *
8347  * Queries all aspects of the named action within an @action_group.
8348  *
8349  * This function acquires the information available from
8350  * g_action_group_has_action(), g_action_group_get_action_enabled(),
8351  * g_action_group_get_action_parameter_type(),
8352  * g_action_group_get_action_state_type(),
8353  * g_action_group_get_action_state_hint() and
8354  * g_action_group_get_action_state() with a single function call.
8355  *
8356  * This provides two main benefits.
8357  *
8358  * The first is the improvement in efficiency that comes with not having
8359  * to perform repeated lookups of the action in order to discover
8360  * different things about it.  The second is that implementing
8361  * #GActionGroup can now be done by only overriding this one virtual
8362  * function.
8363  *
8364  * The interface provides a default implementation of this function that
8365  * calls the individual functions, as required, to fetch the
8366  * information.  The interface also provides default implementations of
8367  * those functions that call this function.  All implementations,
8368  * therefore, must override either this function or all of the others.
8369  *
8370  * If the action exists, %TRUE is returned and any of the requested
8371  * fields (as indicated by having a non-%NULL reference passed in) are
8372  * filled.  If the action doesn't exist, %FALSE is returned and the
8373  * fields may or may not have been modified.
8374  *
8375  * Returns: %TRUE if the action exists, else %FALSE
8376  * Since: 2.32
8377  */
8378
8379
8380 /**
8381  * g_action_map_add_action:
8382  * @action_map: a #GActionMap
8383  * @action: a #GAction
8384  *
8385  * Adds an action to the @action_map.
8386  *
8387  * If the action map already contains an action with the same name
8388  * as @action then the old action is dropped from the action map.
8389  *
8390  * The action map takes its own reference on @action.
8391  *
8392  * Since: 2.32
8393  */
8394
8395
8396 /**
8397  * g_action_map_add_action_entries:
8398  * @action_map: a #GActionMap
8399  * @entries: (array length=n_entries) (element-type GActionEntry): a pointer to the first item in an array of #GActionEntry structs
8400  * @n_entries: the length of @entries, or -1 if @entries is %NULL-terminated
8401  * @user_data: the user data for signal connections
8402  *
8403  * A convenience function for creating multiple #GSimpleAction instances
8404  * and adding them to a #GActionMap.
8405  *
8406  * Each action is constructed as per one #GActionEntry.
8407  *
8408  * <example>
8409  * <title>Using g_action_map_add_action_entries()</title>
8410  * <programlisting>
8411  * static void
8412  * activate_quit (GSimpleAction *simple,
8413  *                GVariant      *parameter,
8414  *                gpointer       user_data)
8415  * {
8416  *   exit (0);
8417  * }
8418  *
8419  * static void
8420  * activate_print_string (GSimpleAction *simple,
8421  *                        GVariant      *parameter,
8422  *                        gpointer       user_data)
8423  * {
8424  *   g_print ("%s\n", g_variant_get_string (parameter, NULL));
8425  * }
8426  *
8427  * static GActionGroup *
8428  * create_action_group (void)
8429  * {
8430  *   const GActionEntry entries[] = {
8431  *     { "quit",         activate_quit              },
8432  *     { "print-string", activate_print_string, "s" }
8433  *   };
8434  *   GSimpleActionGroup *group;
8435  *
8436  *   group = g_simple_action_group_new ();
8437  *   g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
8438  *
8439  *   return G_ACTION_GROUP (group);
8440  * }
8441  * </programlisting>
8442  * </example>
8443  *
8444  * Since: 2.32
8445  */
8446
8447
8448 /**
8449  * g_action_map_lookup_action:
8450  * @action_map: a #GActionMap
8451  * @action_name: the name of an action
8452  *
8453  * Looks up the action with the name @action_name in @action_map.
8454  *
8455  * If no such action exists, returns %NULL.
8456  *
8457  * Returns: (transfer none): a #GAction, or %NULL
8458  * Since: 2.32
8459  */
8460
8461
8462 /**
8463  * g_action_map_remove_action:
8464  * @action_map: a #GActionMap
8465  * @action_name: the name of the action
8466  *
8467  * Removes the named action from the action map.
8468  *
8469  * If no action of this name is in the map then nothing happens.
8470  *
8471  * Since: 2.32
8472  */
8473
8474
8475 /**
8476  * g_app_info_add_supports_type:
8477  * @appinfo: a #GAppInfo.
8478  * @content_type: a string.
8479  * @error: a #GError.
8480  *
8481  * Adds a content type to the application information to indicate the
8482  * application is capable of opening files with the given content type.
8483  *
8484  * Returns: %TRUE on success, %FALSE on error.
8485  */
8486
8487
8488 /**
8489  * g_app_info_can_delete:
8490  * @appinfo: a #GAppInfo
8491  *
8492  * Obtains the information whether the #GAppInfo can be deleted.
8493  * See g_app_info_delete().
8494  *
8495  * Returns: %TRUE if @appinfo can be deleted
8496  * Since: 2.20
8497  */
8498
8499
8500 /**
8501  * g_app_info_can_remove_supports_type:
8502  * @appinfo: a #GAppInfo.
8503  *
8504  * Checks if a supported content type can be removed from an application.
8505  *
8506  * Returns: %TRUE if it is possible to remove supported content types from a given @appinfo, %FALSE if not.
8507  */
8508
8509
8510 /**
8511  * g_app_info_create_from_commandline:
8512  * @commandline: the commandline to use
8513  * @application_name: (allow-none): the application name, or %NULL to use @commandline
8514  * @flags: flags that can specify details of the created #GAppInfo
8515  * @error: a #GError location to store the error occurring, %NULL to ignore.
8516  *
8517  * Creates a new #GAppInfo from the given information.
8518  *
8519  * Note that for @commandline, the quoting rules of the Exec key of the
8520  * <ulink url="http://freedesktop.org/Standards/desktop-entry-spec">freedesktop.org Desktop
8521  * Entry Specification</ulink> are applied. For example, if the @commandline contains
8522  * percent-encoded URIs, the percent-character must be doubled in order to prevent it from
8523  * being swallowed by Exec key unquoting. See the specification for exact quoting rules.
8524  *
8525  * Returns: (transfer full): new #GAppInfo for given command.
8526  */
8527
8528
8529 /**
8530  * g_app_info_delete:
8531  * @appinfo: a #GAppInfo
8532  *
8533  * Tries to delete a #GAppInfo.
8534  *
8535  * On some platforms, there may be a difference between user-defined
8536  * #GAppInfo<!-- -->s which can be deleted, and system-wide ones which
8537  * cannot. See g_app_info_can_delete().
8538  *
8539  * Virtual: do_delete
8540  * Returns: %TRUE if @appinfo has been deleted
8541  * Since: 2.20
8542  */
8543
8544
8545 /**
8546  * g_app_info_dup:
8547  * @appinfo: a #GAppInfo.
8548  *
8549  * Creates a duplicate of a #GAppInfo.
8550  *
8551  * Returns: (transfer full): a duplicate of @appinfo.
8552  */
8553
8554
8555 /**
8556  * g_app_info_equal:
8557  * @appinfo1: the first #GAppInfo.
8558  * @appinfo2: the second #GAppInfo.
8559  *
8560  * Checks if two #GAppInfo<!-- -->s are equal.
8561  *
8562  * Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
8563  */
8564
8565
8566 /**
8567  * g_app_info_get_all:
8568  *
8569  * Gets a list of all of the applications currently registered
8570  * on this system.
8571  *
8572  * For desktop files, this includes applications that have
8573  * <literal>NoDisplay=true</literal> set or are excluded from
8574  * display by means of <literal>OnlyShowIn</literal> or
8575  * <literal>NotShowIn</literal>. See g_app_info_should_show().
8576  * The returned list does not include applications which have
8577  * the <literal>Hidden</literal> key set.
8578  *
8579  * Returns: (element-type GAppInfo) (transfer full): a newly allocated #GList of references to #GAppInfo<!---->s.
8580  */
8581
8582
8583 /**
8584  * g_app_info_get_all_for_type:
8585  * @content_type: the content type to find a #GAppInfo for
8586  *
8587  * Gets a list of all #GAppInfos for a given content type,
8588  * including the recommended and fallback #GAppInfos. See
8589  * g_app_info_get_recommended_for_type() and
8590  * g_app_info_get_fallback_for_type().
8591  *
8592  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
8593  */
8594
8595
8596 /**
8597  * g_app_info_get_commandline:
8598  * @appinfo: a #GAppInfo
8599  *
8600  * Gets the commandline with which the application will be
8601  * started.
8602  *
8603  * Returns: a string containing the @appinfo's commandline, or %NULL if this information is not available
8604  * Since: 2.20
8605  */
8606
8607
8608 /**
8609  * g_app_info_get_default_for_type:
8610  * @content_type: the content type to find a #GAppInfo for
8611  * @must_support_uris: if %TRUE, the #GAppInfo is expected to support URIs
8612  *
8613  * Gets the default #GAppInfo for a given content type.
8614  *
8615  * Returns: (transfer full): #GAppInfo for given @content_type or %NULL on error.
8616  */
8617
8618
8619 /**
8620  * g_app_info_get_default_for_uri_scheme:
8621  * @uri_scheme: a string containing a URI scheme.
8622  *
8623  * Gets the default application for handling URIs with
8624  * the given URI scheme. A URI scheme is the initial part
8625  * of the URI, up to but not including the ':', e.g. "http",
8626  * "ftp" or "sip".
8627  *
8628  * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
8629  */
8630
8631
8632 /**
8633  * g_app_info_get_description:
8634  * @appinfo: a #GAppInfo.
8635  *
8636  * Gets a human-readable description of an installed application.
8637  *
8638  * Returns: a string containing a description of the application @appinfo, or %NULL if none.
8639  */
8640
8641
8642 /**
8643  * g_app_info_get_display_name:
8644  * @appinfo: a #GAppInfo.
8645  *
8646  * Gets the display name of the application. The display name is often more
8647  * descriptive to the user than the name itself.
8648  *
8649  * Returns: the display name of the application for @appinfo, or the name if no display name is available.
8650  * Since: 2.24
8651  */
8652
8653
8654 /**
8655  * g_app_info_get_executable:
8656  * @appinfo: a #GAppInfo
8657  *
8658  * Gets the executable's name for the installed application.
8659  *
8660  * Returns: a string containing the @appinfo's application binaries name
8661  */
8662
8663
8664 /**
8665  * g_app_info_get_fallback_for_type:
8666  * @content_type: the content type to find a #GAppInfo for
8667  *
8668  * Gets a list of fallback #GAppInfos for a given content type, i.e.
8669  * those applications which claim to support the given content type
8670  * by MIME type subclassing and not directly.
8671  *
8672  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
8673  * Since: 2.28
8674  */
8675
8676
8677 /**
8678  * g_app_info_get_icon:
8679  * @appinfo: a #GAppInfo.
8680  *
8681  * Gets the icon for the application.
8682  *
8683  * Returns: (transfer none): the default #GIcon for @appinfo or %NULL if there is no default icon.
8684  */
8685
8686
8687 /**
8688  * g_app_info_get_id:
8689  * @appinfo: a #GAppInfo.
8690  *
8691  * Gets the ID of an application. An id is a string that
8692  * identifies the application. The exact format of the id is
8693  * platform dependent. For instance, on Unix this is the
8694  * desktop file id from the xdg menu specification.
8695  *
8696  * Note that the returned ID may be %NULL, depending on how
8697  * the @appinfo has been constructed.
8698  *
8699  * Returns: a string containing the application's ID.
8700  */
8701
8702
8703 /**
8704  * g_app_info_get_name:
8705  * @appinfo: a #GAppInfo.
8706  *
8707  * Gets the installed name of the application.
8708  *
8709  * Returns: the name of the application for @appinfo.
8710  */
8711
8712
8713 /**
8714  * g_app_info_get_recommended_for_type:
8715  * @content_type: the content type to find a #GAppInfo for
8716  *
8717  * Gets a list of recommended #GAppInfos for a given content type, i.e.
8718  * those applications which claim to support the given content type exactly,
8719  * and not by MIME type subclassing.
8720  * Note that the first application of the list is the last used one, i.e.
8721  * the last one for which g_app_info_set_as_last_used_for_type() has been
8722  * called.
8723  *
8724  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
8725  * Since: 2.28
8726  */
8727
8728
8729 /**
8730  * g_app_info_get_supported_types:
8731  * @appinfo: a #GAppInfo that can handle files
8732  *
8733  * Retrieves the list of content types that @app_info claims to support.
8734  * If this information is not provided by the environment, this function
8735  * will return %NULL.
8736  * This function does not take in consideration associations added with
8737  * g_app_info_add_supports_type(), but only those exported directly by
8738  * the application.
8739  *
8740  * Returns: (transfer none) (array zero-terminated=1) (element-type utf8): a list of content types.
8741  * Since: 2.34
8742  */
8743
8744
8745 /**
8746  * g_app_info_launch:
8747  * @appinfo: a #GAppInfo
8748  * @files: (allow-none) (element-type GFile): a #GList of #GFile objects
8749  * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
8750  * @error: a #GError
8751  *
8752  * Launches the application. Passes @files to the launched application
8753  * as arguments, using the optional @launch_context to get information
8754  * about the details of the launcher (like what screen it is on).
8755  * On error, @error will be set accordingly.
8756  *
8757  * To launch the application without arguments pass a %NULL @files list.
8758  *
8759  * Note that even if the launch is successful the application launched
8760  * can fail to start if it runs into problems during startup. There is
8761  * no way to detect this.
8762  *
8763  * Some URIs can be changed when passed through a GFile (for instance
8764  * unsupported URIs with strange formats like mailto:), so if you have
8765  * a textual URI you want to pass in as argument, consider using
8766  * g_app_info_launch_uris() instead.
8767  *
8768  * The launched application inherits the environment of the launching
8769  * process, but it can be modified with g_app_launch_context_setenv() and
8770  * g_app_launch_context_unsetenv().
8771  *
8772  * On UNIX, this function sets the <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>
8773  * environment variable with the path of the launched desktop file and
8774  * <envar>GIO_LAUNCHED_DESKTOP_FILE_PID</envar> to the process
8775  * id of the launched process. This can be used to ignore
8776  * <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>, should it be inherited
8777  * by further processes. The <envar>DISPLAY</envar> and
8778  * <envar>DESKTOP_STARTUP_ID</envar> environment variables are also
8779  * set, based on information provided in @launch_context.
8780  *
8781  * Returns: %TRUE on successful launch, %FALSE otherwise.
8782  */
8783
8784
8785 /**
8786  * g_app_info_launch_default_for_uri:
8787  * @uri: the uri to show
8788  * @launch_context: (allow-none): an optional #GAppLaunchContext.
8789  * @error: a #GError.
8790  *
8791  * Utility function that launches the default application
8792  * registered to handle the specified uri. Synchronous I/O
8793  * is done on the uri to detect the type of the file if
8794  * required.
8795  *
8796  * Returns: %TRUE on success, %FALSE on error.
8797  */
8798
8799
8800 /**
8801  * g_app_info_launch_uris:
8802  * @appinfo: a #GAppInfo
8803  * @uris: (allow-none) (element-type utf8): a #GList containing URIs to launch.
8804  * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
8805  * @error: a #GError
8806  *
8807  * Launches the application. This passes the @uris to the launched application
8808  * as arguments, using the optional @launch_context to get information
8809  * about the details of the launcher (like what screen it is on).
8810  * On error, @error will be set accordingly.
8811  *
8812  * To launch the application without arguments pass a %NULL @uris list.
8813  *
8814  * Note that even if the launch is successful the application launched
8815  * can fail to start if it runs into problems during startup. There is
8816  * no way to detect this.
8817  *
8818  * Returns: %TRUE on successful launch, %FALSE otherwise.
8819  */
8820
8821
8822 /**
8823  * g_app_info_remove_supports_type:
8824  * @appinfo: a #GAppInfo.
8825  * @content_type: a string.
8826  * @error: a #GError.
8827  *
8828  * Removes a supported type from an application, if possible.
8829  *
8830  * Returns: %TRUE on success, %FALSE on error.
8831  */
8832
8833
8834 /**
8835  * g_app_info_reset_type_associations:
8836  * @content_type: a content type
8837  *
8838  * Removes all changes to the type associations done by
8839  * g_app_info_set_as_default_for_type(),
8840  * g_app_info_set_as_default_for_extension(),
8841  * g_app_info_add_supports_type() or
8842  * g_app_info_remove_supports_type().
8843  *
8844  * Since: 2.20
8845  */
8846
8847
8848 /**
8849  * g_app_info_set_as_default_for_extension:
8850  * @appinfo: a #GAppInfo.
8851  * @extension: a string containing the file extension (without the dot).
8852  * @error: a #GError.
8853  *
8854  * Sets the application as the default handler for the given file extension.
8855  *
8856  * Returns: %TRUE on success, %FALSE on error.
8857  */
8858
8859
8860 /**
8861  * g_app_info_set_as_default_for_type:
8862  * @appinfo: a #GAppInfo.
8863  * @content_type: the content type.
8864  * @error: a #GError.
8865  *
8866  * Sets the application as the default handler for a given type.
8867  *
8868  * Returns: %TRUE on success, %FALSE on error.
8869  */
8870
8871
8872 /**
8873  * g_app_info_set_as_last_used_for_type:
8874  * @appinfo: a #GAppInfo.
8875  * @content_type: the content type.
8876  * @error: a #GError.
8877  *
8878  * Sets the application as the last used application for a given type.
8879  * This will make the application appear as first in the list returned
8880  * by g_app_info_get_recommended_for_type(), regardless of the default
8881  * application for that content type.
8882  *
8883  * Returns: %TRUE on success, %FALSE on error.
8884  */
8885
8886
8887 /**
8888  * g_app_info_should_show:
8889  * @appinfo: a #GAppInfo.
8890  *
8891  * Checks if the application info should be shown in menus that
8892  * list available applications.
8893  *
8894  * Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise.
8895  */
8896
8897
8898 /**
8899  * g_app_info_supports_files:
8900  * @appinfo: a #GAppInfo.
8901  *
8902  * Checks if the application accepts files as arguments.
8903  *
8904  * Returns: %TRUE if the @appinfo supports files.
8905  */
8906
8907
8908 /**
8909  * g_app_info_supports_uris:
8910  * @appinfo: a #GAppInfo.
8911  *
8912  * Checks if the application supports reading files and directories from URIs.
8913  *
8914  * Returns: %TRUE if the @appinfo supports URIs.
8915  */
8916
8917
8918 /**
8919  * g_app_launch_context_get_display:
8920  * @context: a #GAppLaunchContext
8921  * @info: a #GAppInfo
8922  * @files: (element-type GFile): a #GList of #GFile objects
8923  *
8924  * Gets the display string for the @context. This is used to ensure new
8925  * applications are started on the same display as the launching
8926  * application, by setting the <envar>DISPLAY</envar> environment variable.
8927  *
8928  * Returns: a display string for the display.
8929  */
8930
8931
8932 /**
8933  * g_app_launch_context_get_environment:
8934  * @context: a #GAppLaunchContext
8935  *
8936  * Gets the complete environment variable list to be passed to
8937  * the child process when @context is used to launch an application.
8938  * This is a %NULL-terminated array of strings, where each string has
8939  * the form <literal>KEY=VALUE</literal>.
8940  *
8941  * Returns: (array zero-terminated=1) (transfer full): the child's environment
8942  * Since: 2.32
8943  */
8944
8945
8946 /**
8947  * g_app_launch_context_get_startup_notify_id:
8948  * @context: a #GAppLaunchContext
8949  * @info: a #GAppInfo
8950  * @files: (element-type GFile): a #GList of of #GFile objects
8951  *
8952  * Initiates startup notification for the application and returns the
8953  * <envar>DESKTOP_STARTUP_ID</envar> for the launched operation,
8954  * if supported.
8955  *
8956  * Startup notification IDs are defined in the <ulink
8957  * url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
8958  * FreeDesktop.Org Startup Notifications standard</ulink>.
8959  *
8960  * Returns: a startup notification ID for the application, or %NULL if not supported.
8961  */
8962
8963
8964 /**
8965  * g_app_launch_context_launch_failed:
8966  * @context: a #GAppLaunchContext.
8967  * @startup_notify_id: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
8968  *
8969  * Called when an application has failed to launch, so that it can cancel
8970  * the application startup notification started in g_app_launch_context_get_startup_notify_id().
8971  */
8972
8973
8974 /**
8975  * g_app_launch_context_new:
8976  *
8977  * Creates a new application launch context. This is not normally used,
8978  * instead you instantiate a subclass of this, such as #GdkAppLaunchContext.
8979  *
8980  * Returns: a #GAppLaunchContext.
8981  */
8982
8983
8984 /**
8985  * g_app_launch_context_setenv:
8986  * @context: a #GAppLaunchContext
8987  * @variable: the environment variable to set
8988  * @value: the value for to set the variable to.
8989  *
8990  * Arranges for @variable to be set to @value in the child's
8991  * environment when @context is used to launch an application.
8992  *
8993  * Since: 2.32
8994  */
8995
8996
8997 /**
8998  * g_app_launch_context_unsetenv:
8999  * @context: a #GAppLaunchContext
9000  * @variable: the environment variable to remove
9001  *
9002  * Arranges for @variable to be unset in the child's environment
9003  * when @context is used to launch an application.
9004  *
9005  * Since: 2.32
9006  */
9007
9008
9009 /**
9010  * g_application_activate:
9011  * @application: a #GApplication
9012  *
9013  * Activates the application.
9014  *
9015  * In essence, this results in the #GApplication::activate signal being
9016  * emitted in the primary instance.
9017  *
9018  * The application must be registered before calling this function.
9019  *
9020  * Since: 2.28
9021  */
9022
9023
9024 /**
9025  * g_application_command_line_create_file_for_arg:
9026  * @cmdline: a #GApplicationCommandLine
9027  * @arg: an argument from @cmdline
9028  *
9029  * Creates a #GFile corresponding to a filename that was given as part
9030  * of the invocation of @cmdline.
9031  *
9032  * This differs from g_file_new_for_commandline_arg() in that it
9033  * resolves relative pathnames using the current working directory of
9034  * the invoking process rather than the local process.
9035  *
9036  * Returns: (transfer full): a new #GFile
9037  * Since: 2.36
9038  */
9039
9040
9041 /**
9042  * g_application_command_line_get_arguments:
9043  * @cmdline: a #GApplicationCommandLine
9044  * @argc: (out) (allow-none): the length of the arguments array, or %NULL
9045  *
9046  * Gets the list of arguments that was passed on the command line.
9047  *
9048  * The strings in the array may contain non-utf8 data.
9049  *
9050  * The return value is %NULL-terminated and should be freed using
9051  * g_strfreev().
9052  *
9053  * Returns: (array length=argc) (transfer full): the string array containing the arguments (the argv)
9054  * Since: 2.28
9055  */
9056
9057
9058 /**
9059  * g_application_command_line_get_cwd:
9060  * @cmdline: a #GApplicationCommandLine
9061  *
9062  * Gets the working directory of the command line invocation.
9063  * The string may contain non-utf8 data.
9064  *
9065  * It is possible that the remote application did not send a working
9066  * directory, so this may be %NULL.
9067  *
9068  * The return value should not be modified or freed and is valid for as
9069  * long as @cmdline exists.
9070  *
9071  * Returns: the current directory, or %NULL
9072  * Since: 2.28
9073  */
9074
9075
9076 /**
9077  * g_application_command_line_get_environ:
9078  * @cmdline: a #GApplicationCommandLine
9079  *
9080  * Gets the contents of the 'environ' variable of the command line
9081  * invocation, as would be returned by g_get_environ(), ie as a
9082  * %NULL-terminated list of strings in the form 'NAME=VALUE'.
9083  * The strings may contain non-utf8 data.
9084  *
9085  * The remote application usually does not send an environment.  Use
9086  * %G_APPLICATION_SEND_ENVIRONMENT to affect that.  Even with this flag
9087  * set it is possible that the environment is still not available (due
9088  * to invocation messages from other applications).
9089  *
9090  * The return value should not be modified or freed and is valid for as
9091  * long as @cmdline exists.
9092  *
9093  * See g_application_command_line_getenv() if you are only interested
9094  * in the value of a single environment variable.
9095  *
9096  * Returns: (array zero-terminated=1) (transfer none): the environment strings, or %NULL if they were not sent
9097  * Since: 2.28
9098  */
9099
9100
9101 /**
9102  * g_application_command_line_get_exit_status:
9103  * @cmdline: a #GApplicationCommandLine
9104  *
9105  * Gets the exit status of @cmdline.  See
9106  * g_application_command_line_set_exit_status() for more information.
9107  *
9108  * Returns: the exit status
9109  * Since: 2.28
9110  */
9111
9112
9113 /**
9114  * g_application_command_line_get_is_remote:
9115  * @cmdline: a #GApplicationCommandLine
9116  *
9117  * Determines if @cmdline represents a remote invocation.
9118  *
9119  * Returns: %TRUE if the invocation was remote
9120  * Since: 2.28
9121  */
9122
9123
9124 /**
9125  * g_application_command_line_get_platform_data:
9126  * @cmdline: #GApplicationCommandLine
9127  *
9128  * Gets the platform data associated with the invocation of @cmdline.
9129  *
9130  * This is a #GVariant dictionary containing information about the
9131  * context in which the invocation occurred.  It typically contains
9132  * information like the current working directory and the startup
9133  * notification ID.
9134  *
9135  * For local invocation, it will be %NULL.
9136  *
9137  * Returns: (allow-none): the platform data, or %NULL
9138  * Since: 2.28
9139  */
9140
9141
9142 /**
9143  * g_application_command_line_get_stdin:
9144  * @cmdline: a #GApplicationCommandLine
9145  *
9146  * Gets the stdin of the invoking process.
9147  *
9148  * The #GInputStream can be used to read data passed to the standard
9149  * input of the invoking process.
9150  * This doesn't work on all platforms.  Presently, it is only available
9151  * on UNIX when using a DBus daemon capable of passing file descriptors.
9152  * If stdin is not available then %NULL will be returned.  In the
9153  * future, support may be expanded to other platforms.
9154  *
9155  * You must only call this function once per commandline invocation.
9156  *
9157  * Returns: (transfer full): a #GInputStream for stdin
9158  * Since: 2.34
9159  */
9160
9161
9162 /**
9163  * g_application_command_line_getenv:
9164  * @cmdline: a #GApplicationCommandLine
9165  * @name: the environment variable to get
9166  *
9167  * Gets the value of a particular environment variable of the command
9168  * line invocation, as would be returned by g_getenv().  The strings may
9169  * contain non-utf8 data.
9170  *
9171  * The remote application usually does not send an environment.  Use
9172  * %G_APPLICATION_SEND_ENVIRONMENT to affect that.  Even with this flag
9173  * set it is possible that the environment is still not available (due
9174  * to invocation messages from other applications).
9175  *
9176  * The return value should not be modified or freed and is valid for as
9177  * long as @cmdline exists.
9178  *
9179  * Returns: the value of the variable, or %NULL if unset or unsent
9180  * Since: 2.28
9181  */
9182
9183
9184 /**
9185  * g_application_command_line_print:
9186  * @cmdline: a #GApplicationCommandLine
9187  * @format: a printf-style format string
9188  * @...: arguments, as per @format
9189  *
9190  * Formats a message and prints it using the stdout print handler in the
9191  * invoking process.
9192  *
9193  * If @cmdline is a local invocation then this is exactly equivalent to
9194  * g_print().  If @cmdline is remote then this is equivalent to calling
9195  * g_print() in the invoking process.
9196  *
9197  * Since: 2.28
9198  */
9199
9200
9201 /**
9202  * g_application_command_line_printerr:
9203  * @cmdline: a #GApplicationCommandLine
9204  * @format: a printf-style format string
9205  * @...: arguments, as per @format
9206  *
9207  * Formats a message and prints it using the stderr print handler in the
9208  * invoking process.
9209  *
9210  * If @cmdline is a local invocation then this is exactly equivalent to
9211  * g_printerr().  If @cmdline is remote then this is equivalent to
9212  * calling g_printerr() in the invoking process.
9213  *
9214  * Since: 2.28
9215  */
9216
9217
9218 /**
9219  * g_application_command_line_set_exit_status:
9220  * @cmdline: a #GApplicationCommandLine
9221  * @exit_status: the exit status
9222  *
9223  * Sets the exit status that will be used when the invoking process
9224  * exits.
9225  *
9226  * The return value of the #GApplication::command-line signal is
9227  * passed to this function when the handler returns.  This is the usual
9228  * way of setting the exit status.
9229  *
9230  * In the event that you want the remote invocation to continue running
9231  * and want to decide on the exit status in the future, you can use this
9232  * call.  For the case of a remote invocation, the remote process will
9233  * typically exit when the last reference is dropped on @cmdline.  The
9234  * exit status of the remote process will be equal to the last value
9235  * that was set with this function.
9236  *
9237  * In the case that the commandline invocation is local, the situation
9238  * is slightly more complicated.  If the commandline invocation results
9239  * in the mainloop running (ie: because the use-count of the application
9240  * increased to a non-zero value) then the application is considered to
9241  * have been 'successful' in a certain sense, and the exit status is
9242  * always zero.  If the application use count is zero, though, the exit
9243  * status of the local #GApplicationCommandLine is used.
9244  *
9245  * Since: 2.28
9246  */
9247
9248
9249 /**
9250  * g_application_get_application_id:
9251  * @application: a #GApplication
9252  *
9253  * Gets the unique identifier for @application.
9254  *
9255  * Returns: the identifier for @application, owned by @application
9256  * Since: 2.28
9257  */
9258
9259
9260 /**
9261  * g_application_get_dbus_connection:
9262  * @application: a #GApplication
9263  *
9264  * Gets the #GDBusConnection being used by the application, or %NULL.
9265  *
9266  * If #GApplication is using its D-Bus backend then this function will
9267  * return the #GDBusConnection being used for uniqueness and
9268  * communication with the desktop environment and other instances of the
9269  * application.
9270  *
9271  * If #GApplication is not using D-Bus then this function will return
9272  * %NULL.  This includes the situation where the D-Bus backend would
9273  * normally be in use but we were unable to connect to the bus.
9274  *
9275  * This function must not be called before the application has been
9276  * registered.  See g_application_get_is_registered().
9277  *
9278  * Returns: (transfer none): a #GDBusConnection, or %NULL
9279  * Since: 2.34
9280  */
9281
9282
9283 /**
9284  * g_application_get_dbus_object_path:
9285  * @application: a #GApplication
9286  *
9287  * Gets the D-Bus object path being used by the application, or %NULL.
9288  *
9289  * If #GApplication is using its D-Bus backend then this function will
9290  * return the D-Bus object path that #GApplication is using.  If the
9291  * application is the primary instance then there is an object published
9292  * at this path.  If the application is not the primary instance then
9293  * the result of this function is undefined.
9294  *
9295  * If #GApplication is not using D-Bus then this function will return
9296  * %NULL.  This includes the situation where the D-Bus backend would
9297  * normally be in use but we were unable to connect to the bus.
9298  *
9299  * This function must not be called before the application has been
9300  * registered.  See g_application_get_is_registered().
9301  *
9302  * Returns: the object path, or %NULL
9303  * Since: 2.34
9304  */
9305
9306
9307 /**
9308  * g_application_get_default:
9309  *
9310  * Returns the default #GApplication instance for this process.
9311  *
9312  * Normally there is only one #GApplication per process and it becomes
9313  * the default when it is created.  You can exercise more control over
9314  * this by using g_application_set_default().
9315  *
9316  * If there is no default application then %NULL is returned.
9317  *
9318  * Returns: (transfer none): the default application for this process, or %NULL
9319  * Since: 2.32
9320  */
9321
9322
9323 /**
9324  * g_application_get_flags:
9325  * @application: a #GApplication
9326  *
9327  * Gets the flags for @application.
9328  *
9329  * See #GApplicationFlags.
9330  *
9331  * Returns: the flags for @application
9332  * Since: 2.28
9333  */
9334
9335
9336 /**
9337  * g_application_get_inactivity_timeout:
9338  * @application: a #GApplication
9339  *
9340  * Gets the current inactivity timeout for the application.
9341  *
9342  * This is the amount of time (in milliseconds) after the last call to
9343  * g_application_release() before the application stops running.
9344  *
9345  * Returns: the timeout, in milliseconds
9346  * Since: 2.28
9347  */
9348
9349
9350 /**
9351  * g_application_get_is_registered:
9352  * @application: a #GApplication
9353  *
9354  * Checks if @application is registered.
9355  *
9356  * An application is registered if g_application_register() has been
9357  * successfully called.
9358  *
9359  * Returns: %TRUE if @application is registered
9360  * Since: 2.28
9361  */
9362
9363
9364 /**
9365  * g_application_get_is_remote:
9366  * @application: a #GApplication
9367  *
9368  * Checks if @application is remote.
9369  *
9370  * If @application is remote then it means that another instance of
9371  * application already exists (the 'primary' instance).  Calls to
9372  * perform actions on @application will result in the actions being
9373  * performed by the primary instance.
9374  *
9375  * The value of this property cannot be accessed before
9376  * g_application_register() has been called.  See
9377  * g_application_get_is_registered().
9378  *
9379  * Returns: %TRUE if @application is remote
9380  * Since: 2.28
9381  */
9382
9383
9384 /**
9385  * g_application_hold:
9386  * @application: a #GApplication
9387  *
9388  * Increases the use count of @application.
9389  *
9390  * Use this function to indicate that the application has a reason to
9391  * continue to run.  For example, g_application_hold() is called by GTK+
9392  * when a toplevel window is on the screen.
9393  *
9394  * To cancel the hold, call g_application_release().
9395  */
9396
9397
9398 /**
9399  * g_application_id_is_valid:
9400  * @application_id: a potential application identifier
9401  *
9402  * Checks if @application_id is a valid application identifier.
9403  *
9404  * A valid ID is required for calls to g_application_new() and
9405  * g_application_set_application_id().
9406  *
9407  * For convenience, the restrictions on application identifiers are
9408  * reproduced here:
9409  * <itemizedlist>
9410  *   <listitem>Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-." and must not begin with a digit.</listitem>
9411  *   <listitem>Application identifiers must contain at least one '.' (period) character (and thus at least three elements).</listitem>
9412  *   <listitem>Application identifiers must not begin or end with a '.' (period) character.</listitem>
9413  *   <listitem>Application identifiers must not contain consecutive '.' (period) characters.</listitem>
9414  *   <listitem>Application identifiers must not exceed 255 characters.</listitem>
9415  * </itemizedlist>
9416  *
9417  * Returns: %TRUE if @application_id is valid
9418  */
9419
9420
9421 /**
9422  * g_application_new:
9423  * @application_id: (allow-none): the application id
9424  * @flags: the application flags
9425  *
9426  * Creates a new #GApplication instance.
9427  *
9428  * If non-%NULL, the application id must be valid.  See
9429  * g_application_id_is_valid().
9430  *
9431  * If no application ID is given then some features of #GApplication
9432  * (most notably application uniqueness) will be disabled.
9433  *
9434  * Returns: a new #GApplication instance
9435  */
9436
9437
9438 /**
9439  * g_application_open:
9440  * @application: a #GApplication
9441  * @files: (array length=n_files): an array of #GFiles to open
9442  * @n_files: the length of the @files array
9443  * @hint: a hint (or ""), but never %NULL
9444  *
9445  * Opens the given files.
9446  *
9447  * In essence, this results in the #GApplication::open signal being emitted
9448  * in the primary instance.
9449  *
9450  * @n_files must be greater than zero.
9451  *
9452  * @hint is simply passed through to the ::open signal.  It is
9453  * intended to be used by applications that have multiple modes for
9454  * opening files (eg: "view" vs "edit", etc).  Unless you have a need
9455  * for this functionality, you should use "".
9456  *
9457  * The application must be registered before calling this function
9458  * and it must have the %G_APPLICATION_HANDLES_OPEN flag set.
9459  *
9460  * Since: 2.28
9461  */
9462
9463
9464 /**
9465  * g_application_quit:
9466  * @application: a #GApplication
9467  *
9468  * Immediately quits the application.
9469  *
9470  * Upon return to the mainloop, g_application_run() will return,
9471  * calling only the 'shutdown' function before doing so.
9472  *
9473  * The hold count is ignored.
9474  *
9475  * The result of calling g_application_run() again after it returns is
9476  * unspecified.
9477  *
9478  * Since: 2.32
9479  */
9480
9481
9482 /**
9483  * g_application_register:
9484  * @application: a #GApplication
9485  * @cancellable: (allow-none): a #GCancellable, or %NULL
9486  * @error: a pointer to a NULL #GError, or %NULL
9487  *
9488  * Attempts registration of the application.
9489  *
9490  * This is the point at which the application discovers if it is the
9491  * primary instance or merely acting as a remote for an already-existing
9492  * primary instance.  This is implemented by attempting to acquire the
9493  * application identifier as a unique bus name on the session bus using
9494  * GDBus.
9495  *
9496  * If there is no application ID or if %G_APPLICATION_NON_UNIQUE was
9497  * given, then this process will always become the primary instance.
9498  *
9499  * Due to the internal architecture of GDBus, method calls can be
9500  * dispatched at any time (even if a main loop is not running).  For
9501  * this reason, you must ensure that any object paths that you wish to
9502  * register are registered before calling this function.
9503  *
9504  * If the application has already been registered then %TRUE is
9505  * returned with no work performed.
9506  *
9507  * The #GApplication::startup signal is emitted if registration succeeds
9508  * and @application is the primary instance (including the non-unique
9509  * case).
9510  *
9511  * In the event of an error (such as @cancellable being cancelled, or a
9512  * failure to connect to the session bus), %FALSE is returned and @error
9513  * is set appropriately.
9514  *
9515  * Note: the return value of this function is not an indicator that this
9516  * instance is or is not the primary instance of the application.  See
9517  * g_application_get_is_remote() for that.
9518  *
9519  * Returns: %TRUE if registration succeeded
9520  * Since: 2.28
9521  */
9522
9523
9524 /**
9525  * g_application_release:
9526  * @application: a #GApplication
9527  *
9528  * Decrease the use count of @application.
9529  *
9530  * When the use count reaches zero, the application will stop running.
9531  *
9532  * Never call this function except to cancel the effect of a previous
9533  * call to g_application_hold().
9534  */
9535
9536
9537 /**
9538  * g_application_run:
9539  * @application: a #GApplication
9540  * @argc: the argc from main() (or 0 if @argv is %NULL)
9541  * @argv: (array length=argc) (allow-none): the argv from main(), or %NULL
9542  *
9543  * Runs the application.
9544  *
9545  * This function is intended to be run from main() and its return value
9546  * is intended to be returned by main(). Although you are expected to pass
9547  * the @argc, @argv parameters from main() to this function, it is possible
9548  * to pass %NULL if @argv is not available or commandline handling is not
9549  * required.
9550  *
9551  * First, the local_command_line() virtual function is invoked.
9552  * This function always runs on the local instance. It gets passed a pointer
9553  * to a %NULL-terminated copy of @argv and is expected to remove the arguments
9554  * that it handled (shifting up remaining arguments). See
9555  * <xref linkend="gapplication-example-cmdline2"/> for an example of
9556  * parsing @argv manually. Alternatively, you may use the #GOptionContext API,
9557  * after setting <literal>argc = g_strv_length (argv);</literal>.
9558  *
9559  * The last argument to local_command_line() is a pointer to the @status
9560  * variable which can used to set the exit status that is returned from
9561  * g_application_run().
9562  *
9563  * If local_command_line() returns %TRUE, the command line is expected
9564  * to be completely handled, including possibly registering as the primary
9565  * instance, calling g_application_activate() or g_application_open(), etc.
9566  *
9567  * If local_command_line() returns %FALSE then the application is registered
9568  * and the #GApplication::command-line signal is emitted in the primary
9569  * instance (which may or may not be this instance). The signal handler
9570  * gets passed a #GApplicationCommandLine object that (among other things)
9571  * contains the remaining commandline arguments that have not been handled
9572  * by local_command_line().
9573  *
9574  * If the application has the %G_APPLICATION_HANDLES_COMMAND_LINE
9575  * flag set then the default implementation of local_command_line()
9576  * always returns %FALSE immediately, resulting in the commandline
9577  * always being handled in the primary instance.
9578  *
9579  * Otherwise, the default implementation of local_command_line() tries
9580  * to do a couple of things that are probably reasonable for most
9581  * applications.  First, g_application_register() is called to attempt
9582  * to register the application.  If that works, then the command line
9583  * arguments are inspected.  If no commandline arguments are given, then
9584  * g_application_activate() is called.  If commandline arguments are
9585  * given and the %G_APPLICATION_HANDLES_OPEN flag is set then they
9586  * are assumed to be filenames and g_application_open() is called.
9587  *
9588  * If you need to handle commandline arguments that are not filenames,
9589  * and you don't mind commandline handling to happen in the primary
9590  * instance, you should set %G_APPLICATION_HANDLES_COMMAND_LINE and
9591  * process the commandline arguments in your #GApplication::command-line
9592  * signal handler, either manually or using the #GOptionContext API.
9593  *
9594  * If you are interested in doing more complicated local handling of the
9595  * commandline then you should implement your own #GApplication subclass
9596  * and override local_command_line(). In this case, you most likely want
9597  * to return %TRUE from your local_command_line() implementation to
9598  * suppress the default handling. See
9599  * <xref linkend="gapplication-example-cmdline2"/> for an example.
9600  *
9601  * If, after the above is done, the use count of the application is zero
9602  * then the exit status is returned immediately.  If the use count is
9603  * non-zero then the default main context is iterated until the use count
9604  * falls to zero, at which point 0 is returned.
9605  *
9606  * If the %G_APPLICATION_IS_SERVICE flag is set, then the service will
9607  * run for as much as 10 seconds with a use count of zero while waiting
9608  * for the message that caused the activation to arrive.  After that,
9609  * if the use count falls to zero the application will exit immediately,
9610  * except in the case that g_application_set_inactivity_timeout() is in
9611  * use.
9612  *
9613  * Returns: the exit status
9614  * Since: 2.28
9615  */
9616
9617
9618 /**
9619  * g_application_set_action_group:
9620  * @application: a #GApplication
9621  * @action_group: (allow-none): a #GActionGroup, or %NULL
9622  *
9623  * This used to be how actions were associated with a #GApplication.
9624  * Now there is #GActionMap for that.
9625  *
9626  * Since: 2.28
9627  * 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.
9628  */
9629
9630
9631 /**
9632  * g_application_set_application_id:
9633  * @application: a #GApplication
9634  * @application_id: (allow-none): the identifier for @application
9635  *
9636  * Sets the unique identifier for @application.
9637  *
9638  * The application id can only be modified if @application has not yet
9639  * been registered.
9640  *
9641  * If non-%NULL, the application id must be valid.  See
9642  * g_application_id_is_valid().
9643  *
9644  * Since: 2.28
9645  */
9646
9647
9648 /**
9649  * g_application_set_default:
9650  * @application: (allow-none): the application to set as default, or %NULL
9651  *
9652  * Sets or unsets the default application for the process, as returned
9653  * by g_application_get_default().
9654  *
9655  * This function does not take its own reference on @application.  If
9656  * @application is destroyed then the default application will revert
9657  * back to %NULL.
9658  *
9659  * Since: 2.32
9660  */
9661
9662
9663 /**
9664  * g_application_set_flags:
9665  * @application: a #GApplication
9666  * @flags: the flags for @application
9667  *
9668  * Sets the flags for @application.
9669  *
9670  * The flags can only be modified if @application has not yet been
9671  * registered.
9672  *
9673  * See #GApplicationFlags.
9674  *
9675  * Since: 2.28
9676  */
9677
9678
9679 /**
9680  * g_application_set_inactivity_timeout:
9681  * @application: a #GApplication
9682  * @inactivity_timeout: the timeout, in milliseconds
9683  *
9684  * Sets the current inactivity timeout for the application.
9685  *
9686  * This is the amount of time (in milliseconds) after the last call to
9687  * g_application_release() before the application stops running.
9688  *
9689  * This call has no side effects of its own.  The value set here is only
9690  * used for next time g_application_release() drops the use count to
9691  * zero.  Any timeouts currently in progress are not impacted.
9692  *
9693  * Since: 2.28
9694  */
9695
9696
9697 /**
9698  * g_async_initable_init_async:
9699  * @initable: a #GAsyncInitable.
9700  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
9701  * @cancellable: optional #GCancellable object, %NULL to ignore.
9702  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
9703  * @user_data: the data to pass to callback function
9704  *
9705  * Starts asynchronous initialization of the object implementing the
9706  * interface. This must be done before any real use of the object after
9707  * initial construction. If the object also implements #GInitable you can
9708  * optionally call g_initable_init() instead.
9709  *
9710  * When the initialization is finished, @callback will be called. You can
9711  * then call g_async_initable_init_finish() to get the result of the
9712  * initialization.
9713  *
9714  * Implementations may also support cancellation. If @cancellable is not
9715  * %NULL, then initialization can be cancelled by triggering the cancellable
9716  * object from another thread. If the operation was cancelled, the error
9717  * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL, and
9718  * the object doesn't support cancellable initialization, the error
9719  * %G_IO_ERROR_NOT_SUPPORTED will be returned.
9720  *
9721  * As with #GInitable, if the object is not initialized, or initialization
9722  * returns with an error, then all operations on the object except
9723  * g_object_ref() and g_object_unref() are considered to be invalid, and
9724  * have undefined behaviour. They will often fail with g_critical() or
9725  * g_warning(), but this must not be relied on.
9726  *
9727  * Implementations of this method must be idempotent: i.e. multiple calls
9728  * to this function with the same argument should return the same results.
9729  * Only the first call initializes the object; further calls return the result
9730  * of the first call. This is so that it's safe to implement the singleton
9731  * pattern in the GObject constructor function.
9732  *
9733  * For classes that also support the #GInitable interface, the default
9734  * implementation of this method will run the g_initable_init() function
9735  * in a thread, so if you want to support asynchronous initialization via
9736  * threads, just implement the #GAsyncInitable interface without overriding
9737  * any interface methods.
9738  *
9739  * Since: 2.22
9740  */
9741
9742
9743 /**
9744  * g_async_initable_init_finish:
9745  * @initable: a #GAsyncInitable.
9746  * @res: a #GAsyncResult.
9747  * @error: a #GError location to store the error occurring, or %NULL to ignore.
9748  *
9749  * Finishes asynchronous initialization and returns the result.
9750  * See g_async_initable_init_async().
9751  *
9752  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
9753  * Since: 2.22
9754  */
9755
9756
9757 /**
9758  * g_async_initable_new_async:
9759  * @object_type: a #GType supporting #GAsyncInitable.
9760  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
9761  * @cancellable: optional #GCancellable object, %NULL to ignore.
9762  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
9763  * @user_data: the data to pass to callback function
9764  * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
9765  * @...: the value of the first property, followed by other property value pairs, and ended by %NULL.
9766  *
9767  * Helper function for constructing #GAsyncInitable object. This is
9768  * similar to g_object_new() but also initializes the object asynchronously.
9769  *
9770  * When the initialization is finished, @callback will be called. You can
9771  * then call g_async_initable_new_finish() to get the new object and check
9772  * for any errors.
9773  *
9774  * Since: 2.22
9775  */
9776
9777
9778 /**
9779  * g_async_initable_new_finish:
9780  * @initable: the #GAsyncInitable from the callback
9781  * @res: the #GAsyncResult from the callback
9782  * @error: return location for errors, or %NULL to ignore
9783  *
9784  * Finishes the async construction for the various g_async_initable_new
9785  * calls, returning the created object or %NULL on error.
9786  *
9787  * Returns: (type GObject.Object) (transfer full): a newly created #GObject, or %NULL on error. Free with g_object_unref().
9788  * Since: 2.22
9789  */
9790
9791
9792 /**
9793  * g_async_initable_new_valist_async:
9794  * @object_type: a #GType supporting #GAsyncInitable.
9795  * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
9796  * @var_args: The var args list generated from @first_property_name.
9797  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
9798  * @cancellable: optional #GCancellable object, %NULL to ignore.
9799  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
9800  * @user_data: the data to pass to callback function
9801  *
9802  * Helper function for constructing #GAsyncInitable object. This is
9803  * similar to g_object_new_valist() but also initializes the object
9804  * asynchronously.
9805  *
9806  * When the initialization is finished, @callback will be called. You can
9807  * then call g_async_initable_new_finish() to get the new object and check
9808  * for any errors.
9809  *
9810  * Since: 2.22
9811  */
9812
9813
9814 /**
9815  * g_async_initable_newv_async:
9816  * @object_type: a #GType supporting #GAsyncInitable.
9817  * @n_parameters: the number of parameters in @parameters
9818  * @parameters: the parameters to use to construct the object
9819  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
9820  * @cancellable: optional #GCancellable object, %NULL to ignore.
9821  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
9822  * @user_data: the data to pass to callback function
9823  *
9824  * Helper function for constructing #GAsyncInitable object. This is
9825  * similar to g_object_newv() but also initializes the object asynchronously.
9826  *
9827  * When the initialization is finished, @callback will be called. You can
9828  * then call g_async_initable_new_finish() to get the new object and check
9829  * for any errors.
9830  *
9831  * Since: 2.22
9832  */
9833
9834
9835 /**
9836  * g_async_result_get_source_object:
9837  * @res: a #GAsyncResult
9838  *
9839  * Gets the source object from a #GAsyncResult.
9840  *
9841  * Returns: (transfer full): a new reference to the source object for the @res, or %NULL if there is none.
9842  */
9843
9844
9845 /**
9846  * g_async_result_get_user_data:
9847  * @res: a #GAsyncResult.
9848  *
9849  * Gets the user data from a #GAsyncResult.
9850  *
9851  * Returns: (transfer full): the user data for @res.
9852  */
9853
9854
9855 /**
9856  * g_async_result_is_tagged:
9857  * @res: a #GAsyncResult
9858  * @source_tag: an application-defined tag
9859  *
9860  * Checks if @res has the given @source_tag (generally a function
9861  * pointer indicating the function @res was created by).
9862  *
9863  * Returns: %TRUE if @res has the indicated @source_tag, %FALSE if not.
9864  * Since: 2.34
9865  */
9866
9867
9868 /**
9869  * g_async_result_legacy_propagate_error:
9870  * @res: a #GAsyncResult
9871  * @error: (out): a location to propagate the error to.
9872  *
9873  * If @res is a #GSimpleAsyncResult, this is equivalent to
9874  * g_simple_async_result_propagate_error(). Otherwise it returns
9875  * %FALSE.
9876  *
9877  * This can be used for legacy error handling in async
9878  * <literal>_finish ()</literal> wrapper functions that traditionally
9879  * handled #GSimpleAsyncResult error returns themselves rather than
9880  * calling into the virtual method. This should not be used in new
9881  * code; #GAsyncResult errors that are set by virtual methods should
9882  * also be extracted by virtual methods, to enable subclasses to chain
9883  * up correctly.
9884  *
9885  * Returns: %TRUE if @error is has been filled in with an error from @res, %FALSE if not.
9886  * Since: 2.34
9887  */
9888
9889
9890 /**
9891  * g_buffered_input_stream_fill:
9892  * @stream: a #GBufferedInputStream
9893  * @count: the number of bytes that will be read from the stream
9894  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
9895  * @error: location to store the error occurring, or %NULL to ignore
9896  *
9897  * Tries to read @count bytes from the stream into the buffer.
9898  * Will block during this read.
9899  *
9900  * If @count is zero, returns zero and does nothing. A value of @count
9901  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
9902  *
9903  * On success, the number of bytes read into the buffer is returned.
9904  * It is not an error if this is not the same as the requested size, as it
9905  * can happen e.g. near the end of a file. Zero is returned on end of file
9906  * (or if @count is zero),  but never otherwise.
9907  *
9908  * If @count is -1 then the attempted read size is equal to the number of
9909  * bytes that are required to fill the buffer.
9910  *
9911  * If @cancellable is not %NULL, then the operation can be cancelled by
9912  * triggering the cancellable object from another thread. If the operation
9913  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
9914  * operation was partially finished when the operation was cancelled the
9915  * partial result will be returned, without an error.
9916  *
9917  * On error -1 is returned and @error is set accordingly.
9918  *
9919  * For the asynchronous, non-blocking, version of this function, see
9920  * g_buffered_input_stream_fill_async().
9921  *
9922  * Returns: the number of bytes read into @stream's buffer, up to @count, or -1 on error.
9923  */
9924
9925
9926 /**
9927  * g_buffered_input_stream_fill_async:
9928  * @stream: a #GBufferedInputStream
9929  * @count: the number of bytes that will be read from the stream
9930  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
9931  * @cancellable: (allow-none): optional #GCancellable object
9932  * @callback: (scope async): a #GAsyncReadyCallback
9933  * @user_data: (closure): a #gpointer
9934  *
9935  * Reads data into @stream's buffer asynchronously, up to @count size.
9936  * @io_priority can be used to prioritize reads. For the synchronous
9937  * version of this function, see g_buffered_input_stream_fill().
9938  *
9939  * If @count is -1 then the attempted read size is equal to the number
9940  * of bytes that are required to fill the buffer.
9941  */
9942
9943
9944 /**
9945  * g_buffered_input_stream_fill_finish:
9946  * @stream: a #GBufferedInputStream
9947  * @result: a #GAsyncResult
9948  * @error: a #GError
9949  *
9950  * Finishes an asynchronous read.
9951  *
9952  * Returns: a #gssize of the read stream, or %-1 on an error.
9953  */
9954
9955
9956 /**
9957  * g_buffered_input_stream_get_available:
9958  * @stream: #GBufferedInputStream
9959  *
9960  * Gets the size of the available data within the stream.
9961  *
9962  * Returns: size of the available stream.
9963  */
9964
9965
9966 /**
9967  * g_buffered_input_stream_get_buffer_size:
9968  * @stream: a #GBufferedInputStream
9969  *
9970  * Gets the size of the input buffer.
9971  *
9972  * Returns: the current buffer size.
9973  */
9974
9975
9976 /**
9977  * g_buffered_input_stream_new:
9978  * @base_stream: a #GInputStream
9979  *
9980  * Creates a new #GInputStream from the given @base_stream, with
9981  * a buffer set to the default size (4 kilobytes).
9982  *
9983  * Returns: a #GInputStream for the given @base_stream.
9984  */
9985
9986
9987 /**
9988  * g_buffered_input_stream_new_sized:
9989  * @base_stream: a #GInputStream
9990  * @size: a #gsize
9991  *
9992  * Creates a new #GBufferedInputStream from the given @base_stream,
9993  * with a buffer set to @size.
9994  *
9995  * Returns: a #GInputStream.
9996  */
9997
9998
9999 /**
10000  * g_buffered_input_stream_peek:
10001  * @stream: a #GBufferedInputStream
10002  * @buffer: (array length=count) (element-type guint8): a pointer to an allocated chunk of memory
10003  * @offset: a #gsize
10004  * @count: a #gsize
10005  *
10006  * Peeks in the buffer, copying data of size @count into @buffer,
10007  * offset @offset bytes.
10008  *
10009  * Returns: a #gsize of the number of bytes peeked, or -1 on error.
10010  */
10011
10012
10013 /**
10014  * g_buffered_input_stream_peek_buffer:
10015  * @stream: a #GBufferedInputStream
10016  * @count: (out): a #gsize to get the number of bytes available in the buffer
10017  *
10018  * Returns the buffer with the currently available bytes. The returned
10019  * buffer must not be modified and will become invalid when reading from
10020  * the stream or filling the buffer.
10021  *
10022  * Returns: (array length=count) (element-type guint8) (transfer none): read-only buffer
10023  */
10024
10025
10026 /**
10027  * g_buffered_input_stream_read_byte:
10028  * @stream: a #GBufferedInputStream
10029  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
10030  * @error: location to store the error occurring, or %NULL to ignore
10031  *
10032  * Tries to read a single byte from the stream or the buffer. Will block
10033  * during this read.
10034  *
10035  * On success, the byte read from the stream is returned. On end of stream
10036  * -1 is returned but it's not an exceptional error and @error is not set.
10037  *
10038  * If @cancellable is not %NULL, then the operation can be cancelled by
10039  * triggering the cancellable object from another thread. If the operation
10040  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
10041  * operation was partially finished when the operation was cancelled the
10042  * partial result will be returned, without an error.
10043  *
10044  * On error -1 is returned and @error is set accordingly.
10045  *
10046  * Returns: the byte read from the @stream, or -1 on end of stream or error.
10047  */
10048
10049
10050 /**
10051  * g_buffered_input_stream_set_buffer_size:
10052  * @stream: a #GBufferedInputStream
10053  * @size: a #gsize
10054  *
10055  * Sets the size of the internal buffer of @stream to @size, or to the
10056  * size of the contents of the buffer. The buffer can never be resized
10057  * smaller than its current contents.
10058  */
10059
10060
10061 /**
10062  * g_buffered_output_stream_get_auto_grow:
10063  * @stream: a #GBufferedOutputStream.
10064  *
10065  * Checks if the buffer automatically grows as data is added.
10066  *
10067  * Returns: %TRUE if the @stream's buffer automatically grows, %FALSE otherwise.
10068  */
10069
10070
10071 /**
10072  * g_buffered_output_stream_get_buffer_size:
10073  * @stream: a #GBufferedOutputStream.
10074  *
10075  * Gets the size of the buffer in the @stream.
10076  *
10077  * Returns: the current size of the buffer.
10078  */
10079
10080
10081 /**
10082  * g_buffered_output_stream_new:
10083  * @base_stream: a #GOutputStream.
10084  *
10085  * Creates a new buffered output stream for a base stream.
10086  *
10087  * Returns: a #GOutputStream for the given @base_stream.
10088  */
10089
10090
10091 /**
10092  * g_buffered_output_stream_new_sized:
10093  * @base_stream: a #GOutputStream.
10094  * @size: a #gsize.
10095  *
10096  * Creates a new buffered output stream with a given buffer size.
10097  *
10098  * Returns: a #GOutputStream with an internal buffer set to @size.
10099  */
10100
10101
10102 /**
10103  * g_buffered_output_stream_set_auto_grow:
10104  * @stream: a #GBufferedOutputStream.
10105  * @auto_grow: a #gboolean.
10106  *
10107  * Sets whether or not the @stream's buffer should automatically grow.
10108  * If @auto_grow is true, then each write will just make the buffer
10109  * larger, and you must manually flush the buffer to actually write out
10110  * the data to the underlying stream.
10111  */
10112
10113
10114 /**
10115  * g_buffered_output_stream_set_buffer_size:
10116  * @stream: a #GBufferedOutputStream.
10117  * @size: a #gsize.
10118  *
10119  * Sets the size of the internal buffer to @size.
10120  */
10121
10122
10123 /**
10124  * g_bus_get:
10125  * @bus_type: A #GBusType.
10126  * @cancellable: (allow-none): A #GCancellable or %NULL.
10127  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
10128  * @user_data: The data to pass to @callback.
10129  *
10130  * Asynchronously connects to the message bus specified by @bus_type.
10131  *
10132  * When the operation is finished, @callback will be invoked. You can
10133  * then call g_bus_get_finish() to get the result of the operation.
10134  *
10135  * This is a asynchronous failable function. See g_bus_get_sync() for
10136  * the synchronous version.
10137  *
10138  * Since: 2.26
10139  */
10140
10141
10142 /**
10143  * g_bus_get_finish:
10144  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get().
10145  * @error: Return location for error or %NULL.
10146  *
10147  * Finishes an operation started with g_bus_get().
10148  *
10149  * The returned object is a singleton, that is, shared with other
10150  * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
10151  * event that you need a private message bus connection, use
10152  * g_dbus_address_get_for_bus_sync() and
10153  * g_dbus_connection_new_for_address().
10154  *
10155  * Note that the returned #GDBusConnection object will (usually) have
10156  * the #GDBusConnection:exit-on-close property set to %TRUE.
10157  *
10158  * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
10159  * Since: 2.26
10160  */
10161
10162
10163 /**
10164  * g_bus_get_sync:
10165  * @bus_type: A #GBusType.
10166  * @cancellable: (allow-none): A #GCancellable or %NULL.
10167  * @error: Return location for error or %NULL.
10168  *
10169  * Synchronously connects to the message bus specified by @bus_type.
10170  * Note that the returned object may shared with other callers,
10171  * e.g. if two separate parts of a process calls this function with
10172  * the same @bus_type, they will share the same object.
10173  *
10174  * This is a synchronous failable function. See g_bus_get() and
10175  * g_bus_get_finish() for the asynchronous version.
10176  *
10177  * The returned object is a singleton, that is, shared with other
10178  * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
10179  * event that you need a private message bus connection, use
10180  * g_dbus_address_get_for_bus_sync() and
10181  * g_dbus_connection_new_for_address().
10182  *
10183  * Note that the returned #GDBusConnection object will (usually) have
10184  * the #GDBusConnection:exit-on-close property set to %TRUE.
10185  *
10186  * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
10187  * Since: 2.26
10188  */
10189
10190
10191 /**
10192  * g_bus_own_name:
10193  * @bus_type: The type of bus to own a name on.
10194  * @name: The well-known name to own.
10195  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10196  * @bus_acquired_handler: (allow-none): Handler to invoke when connected to the bus of type @bus_type or %NULL.
10197  * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
10198  * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
10199  * @user_data: User data to pass to handlers.
10200  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10201  *
10202  * Starts acquiring @name on the bus specified by @bus_type and calls
10203  * @name_acquired_handler and @name_lost_handler when the name is
10204  * acquired respectively lost. Callbacks will be invoked in the <link
10205  * linkend="g-main-context-push-thread-default">thread-default main
10206  * loop</link> of the thread you are calling this function from.
10207  *
10208  * You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
10209  * callbacks will be invoked after calling this function - there are three
10210  * possible cases:
10211  * <itemizedlist>
10212  *   <listitem><para>
10213  *     @name_lost_handler with a %NULL connection (if a connection to the bus can't be made).
10214  *   </para></listitem>
10215  *   <listitem><para>
10216  *     @bus_acquired_handler then @name_lost_handler (if the name can't be obtained)
10217  *   </para></listitem>
10218  *   <listitem><para>
10219  *     @bus_acquired_handler then @name_acquired_handler (if the name was obtained).
10220  *   </para></listitem>
10221  * </itemizedlist>
10222  * When you are done owning the name, just call g_bus_unown_name()
10223  * with the owner id this function returns.
10224  *
10225  * If the name is acquired or lost (for example another application
10226  * could acquire the name if you allow replacement or the application
10227  * currently owning the name exits), the handlers are also invoked. If the
10228  * #GDBusConnection that is used for attempting to own the name
10229  * closes, then @name_lost_handler is invoked since it is no
10230  * longer possible for other processes to access the process.
10231  *
10232  * You cannot use g_bus_own_name() several times for the same name (unless
10233  * interleaved with calls to g_bus_unown_name()) - only the first call
10234  * will work.
10235  *
10236  * Another guarantee is that invocations of @name_acquired_handler
10237  * and @name_lost_handler are guaranteed to alternate; that
10238  * is, if @name_acquired_handler is invoked then you are
10239  * guaranteed that the next time one of the handlers is invoked, it
10240  * will be @name_lost_handler. The reverse is also true.
10241  *
10242  * If you plan on exporting objects (using e.g.
10243  * g_dbus_connection_register_object()), note that it is generally too late
10244  * to export the objects in @name_acquired_handler. Instead, you can do this
10245  * in @bus_acquired_handler since you are guaranteed that this will run
10246  * before @name is requested from the bus.
10247  *
10248  * This behavior makes it very simple to write applications that wants
10249  * to own names and export objects, see <xref linkend="gdbus-owning-names"/>.
10250  * Simply register objects to be exported in @bus_acquired_handler and
10251  * unregister the objects (if any) in @name_lost_handler.
10252  *
10253  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10254  * Since: 2.26
10255  */
10256
10257
10258 /**
10259  * g_bus_own_name_on_connection:
10260  * @connection: A #GDBusConnection.
10261  * @name: The well-known name to own.
10262  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10263  * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
10264  * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
10265  * @user_data: User data to pass to handlers.
10266  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10267  *
10268  * Like g_bus_own_name() but takes a #GDBusConnection instead of a
10269  * #GBusType.
10270  *
10271  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10272  * Since: 2.26
10273  */
10274
10275
10276 /**
10277  * g_bus_own_name_on_connection_with_closures:
10278  * @connection: A #GDBusConnection.
10279  * @name: The well-known name to own.
10280  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10281  * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
10282  * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
10283  *
10284  * Version of g_bus_own_name_on_connection() using closures instead of callbacks for
10285  * easier binding in other languages.
10286  *
10287  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10288  * Rename to: g_bus_own_name_on_connection
10289  * Since: 2.26
10290  */
10291
10292
10293 /**
10294  * g_bus_own_name_with_closures:
10295  * @bus_type: The type of bus to own a name on.
10296  * @name: The well-known name to own.
10297  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
10298  * @bus_acquired_closure: (allow-none): #GClosure to invoke when connected to the bus of type @bus_type or %NULL.
10299  * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
10300  * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
10301  *
10302  * Version of g_bus_own_name() using closures instead of callbacks for
10303  * easier binding in other languages.
10304  *
10305  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
10306  * Rename to: g_bus_own_name
10307  * Since: 2.26
10308  */
10309
10310
10311 /**
10312  * g_bus_unown_name:
10313  * @owner_id: An identifier obtained from g_bus_own_name()
10314  *
10315  * Stops owning a name.
10316  *
10317  * Since: 2.26
10318  */
10319
10320
10321 /**
10322  * g_bus_unwatch_name:
10323  * @watcher_id: An identifier obtained from g_bus_watch_name()
10324  *
10325  * Stops watching a name.
10326  *
10327  * Since: 2.26
10328  */
10329
10330
10331 /**
10332  * g_bus_watch_name:
10333  * @bus_type: The type of bus to watch a name on.
10334  * @name: The name (well-known or unique) to watch.
10335  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10336  * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
10337  * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
10338  * @user_data: User data to pass to handlers.
10339  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10340  *
10341  * Starts watching @name on the bus specified by @bus_type and calls
10342  * @name_appeared_handler and @name_vanished_handler when the name is
10343  * known to have a owner respectively known to lose its
10344  * owner. Callbacks will be invoked in the <link
10345  * linkend="g-main-context-push-thread-default">thread-default main
10346  * loop</link> of the thread you are calling this function from.
10347  *
10348  * You are guaranteed that one of the handlers will be invoked after
10349  * calling this function. When you are done watching the name, just
10350  * call g_bus_unwatch_name() with the watcher id this function
10351  * returns.
10352  *
10353  * If the name vanishes or appears (for example the application owning
10354  * the name could restart), the handlers are also invoked. If the
10355  * #GDBusConnection that is used for watching the name disconnects, then
10356  * @name_vanished_handler is invoked since it is no longer
10357  * possible to access the name.
10358  *
10359  * Another guarantee is that invocations of @name_appeared_handler
10360  * and @name_vanished_handler are guaranteed to alternate; that
10361  * is, if @name_appeared_handler is invoked then you are
10362  * guaranteed that the next time one of the handlers is invoked, it
10363  * will be @name_vanished_handler. The reverse is also true.
10364  *
10365  * This behavior makes it very simple to write applications that wants
10366  * to take action when a certain name exists, see <xref
10367  * linkend="gdbus-watching-names"/>. Basically, the application
10368  * should create object proxies in @name_appeared_handler and destroy
10369  * them again (if any) in @name_vanished_handler.
10370  *
10371  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10372  * Since: 2.26
10373  */
10374
10375
10376 /**
10377  * g_bus_watch_name_on_connection:
10378  * @connection: A #GDBusConnection.
10379  * @name: The name (well-known or unique) to watch.
10380  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10381  * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
10382  * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
10383  * @user_data: User data to pass to handlers.
10384  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
10385  *
10386  * Like g_bus_watch_name() but takes a #GDBusConnection instead of a
10387  * #GBusType.
10388  *
10389  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10390  * Since: 2.26
10391  */
10392
10393
10394 /**
10395  * g_bus_watch_name_on_connection_with_closures:
10396  * @connection: A #GDBusConnection.
10397  * @name: The name (well-known or unique) to watch.
10398  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10399  * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
10400  * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
10401  *
10402  * Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
10403  * easier binding in other languages.
10404  *
10405  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10406  * Rename to: g_bus_watch_name_on_connection
10407  * Since: 2.26
10408  */
10409
10410
10411 /**
10412  * g_bus_watch_name_with_closures:
10413  * @bus_type: The type of bus to watch a name on.
10414  * @name: The name (well-known or unique) to watch.
10415  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
10416  * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
10417  * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
10418  *
10419  * Version of g_bus_watch_name() using closures instead of callbacks for
10420  * easier binding in other languages.
10421  *
10422  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
10423  * Rename to: g_bus_watch_name
10424  * Since: 2.26
10425  */
10426
10427
10428 /**
10429  * g_cancellable_cancel:
10430  * @cancellable: a #GCancellable object.
10431  *
10432  * Will set @cancellable to cancelled, and will emit the
10433  * #GCancellable::cancelled signal. (However, see the warning about
10434  * race conditions in the documentation for that signal if you are
10435  * planning to connect to it.)
10436  *
10437  * This function is thread-safe. In other words, you can safely call
10438  * it from a thread other than the one running the operation that was
10439  * passed the @cancellable.
10440  *
10441  * The convention within gio is that cancelling an asynchronous
10442  * operation causes it to complete asynchronously. That is, if you
10443  * cancel the operation from the same thread in which it is running,
10444  * then the operation's #GAsyncReadyCallback will not be invoked until
10445  * the application returns to the main loop.
10446  */
10447
10448
10449 /**
10450  * g_cancellable_connect:
10451  * @cancellable: A #GCancellable.
10452  * @callback: The #GCallback to connect.
10453  * @data: Data to pass to @callback.
10454  * @data_destroy_func: (allow-none): Free function for @data or %NULL.
10455  *
10456  * Convenience function to connect to the #GCancellable::cancelled
10457  * signal. Also handles the race condition that may happen
10458  * if the cancellable is cancelled right before connecting.
10459  *
10460  * @callback is called at most once, either directly at the
10461  * time of the connect if @cancellable is already cancelled,
10462  * or when @cancellable is cancelled in some thread.
10463  *
10464  * @data_destroy_func will be called when the handler is
10465  * disconnected, or immediately if the cancellable is already
10466  * cancelled.
10467  *
10468  * See #GCancellable::cancelled for details on how to use this.
10469  *
10470  * Returns: The id of the signal handler or 0 if @cancellable has already been cancelled.
10471  * Since: 2.22
10472  */
10473
10474
10475 /**
10476  * g_cancellable_disconnect:
10477  * @cancellable: (allow-none): A #GCancellable or %NULL.
10478  * @handler_id: Handler id of the handler to be disconnected, or %0.
10479  *
10480  * Disconnects a handler from a cancellable instance similar to
10481  * g_signal_handler_disconnect().  Additionally, in the event that a
10482  * signal handler is currently running, this call will block until the
10483  * handler has finished.  Calling this function from a
10484  * #GCancellable::cancelled signal handler will therefore result in a
10485  * deadlock.
10486  *
10487  * This avoids a race condition where a thread cancels at the
10488  * same time as the cancellable operation is finished and the
10489  * signal handler is removed. See #GCancellable::cancelled for
10490  * details on how to use this.
10491  *
10492  * If @cancellable is %NULL or @handler_id is %0 this function does
10493  * nothing.
10494  *
10495  * Since: 2.22
10496  */
10497
10498
10499 /**
10500  * g_cancellable_get_current:
10501  *
10502  * Gets the top cancellable from the stack.
10503  *
10504  * Returns: (transfer none): a #GCancellable from the top of the stack, or %NULL if the stack is empty.
10505  */
10506
10507
10508 /**
10509  * g_cancellable_get_fd:
10510  * @cancellable: a #GCancellable.
10511  *
10512  * Gets the file descriptor for a cancellable job. This can be used to
10513  * implement cancellable operations on Unix systems. The returned fd will
10514  * turn readable when @cancellable is cancelled.
10515  *
10516  * You are not supposed to read from the fd yourself, just check for
10517  * readable status. Reading to unset the readable status is done
10518  * with g_cancellable_reset().
10519  *
10520  * After a successful return from this function, you should use
10521  * g_cancellable_release_fd() to free up resources allocated for
10522  * the returned file descriptor.
10523  *
10524  * See also g_cancellable_make_pollfd().
10525  *
10526  * Returns: A valid file descriptor. %-1 if the file descriptor is not supported, or on errors.
10527  */
10528
10529
10530 /**
10531  * g_cancellable_is_cancelled:
10532  * @cancellable: (allow-none): a #GCancellable or %NULL
10533  *
10534  * Checks if a cancellable job has been cancelled.
10535  *
10536  * Returns: %TRUE if @cancellable is cancelled, FALSE if called with %NULL or if item is not cancelled.
10537  */
10538
10539
10540 /**
10541  * g_cancellable_make_pollfd:
10542  * @cancellable: (allow-none): a #GCancellable or %NULL
10543  * @pollfd: a pointer to a #GPollFD
10544  *
10545  * Creates a #GPollFD corresponding to @cancellable; this can be passed
10546  * to g_poll() and used to poll for cancellation. This is useful both
10547  * for unix systems without a native poll and for portability to
10548  * windows.
10549  *
10550  * When this function returns %TRUE, you should use
10551  * g_cancellable_release_fd() to free up resources allocated for the
10552  * @pollfd. After a %FALSE return, do not call g_cancellable_release_fd().
10553  *
10554  * If this function returns %FALSE, either no @cancellable was given or
10555  * resource limits prevent this function from allocating the necessary
10556  * structures for polling. (On Linux, you will likely have reached
10557  * the maximum number of file descriptors.) The suggested way to handle
10558  * these cases is to ignore the @cancellable.
10559  *
10560  * You are not supposed to read from the fd yourself, just check for
10561  * readable status. Reading to unset the readable status is done
10562  * with g_cancellable_reset().
10563  *
10564  * Returns: %TRUE if @pollfd was successfully initialized, %FALSE on failure to prepare the cancellable.
10565  * Since: 2.22
10566  */
10567
10568
10569 /**
10570  * g_cancellable_new:
10571  *
10572  * Creates a new #GCancellable object.
10573  *
10574  * Applications that want to start one or more operations
10575  * that should be cancellable should create a #GCancellable
10576  * and pass it to the operations.
10577  *
10578  * One #GCancellable can be used in multiple consecutive
10579  * operations or in multiple concurrent operations.
10580  *
10581  * Returns: a #GCancellable.
10582  */
10583
10584
10585 /**
10586  * g_cancellable_pop_current:
10587  * @cancellable: a #GCancellable object
10588  *
10589  * Pops @cancellable off the cancellable stack (verifying that @cancellable
10590  * is on the top of the stack).
10591  */
10592
10593
10594 /**
10595  * g_cancellable_push_current:
10596  * @cancellable: a #GCancellable object
10597  *
10598  * Pushes @cancellable onto the cancellable stack. The current
10599  * cancellable can then be received using g_cancellable_get_current().
10600  *
10601  * This is useful when implementing cancellable operations in
10602  * code that does not allow you to pass down the cancellable object.
10603  *
10604  * This is typically called automatically by e.g. #GFile operations,
10605  * so you rarely have to call this yourself.
10606  */
10607
10608
10609 /**
10610  * g_cancellable_release_fd:
10611  * @cancellable: a #GCancellable
10612  *
10613  * Releases a resources previously allocated by g_cancellable_get_fd()
10614  * or g_cancellable_make_pollfd().
10615  *
10616  * For compatibility reasons with older releases, calling this function
10617  * is not strictly required, the resources will be automatically freed
10618  * when the @cancellable is finalized. However, the @cancellable will
10619  * block scarce file descriptors until it is finalized if this function
10620  * is not called. This can cause the application to run out of file
10621  * descriptors when many #GCancellables are used at the same time.
10622  *
10623  * Since: 2.22
10624  */
10625
10626
10627 /**
10628  * g_cancellable_reset:
10629  * @cancellable: a #GCancellable object.
10630  *
10631  * Resets @cancellable to its uncancelled state.
10632  *
10633  * If cancellable is currently in use by any cancellable operation
10634  * then the behavior of this function is undefined.
10635  */
10636
10637
10638 /**
10639  * g_cancellable_set_error_if_cancelled:
10640  * @cancellable: (allow-none): a #GCancellable or %NULL
10641  * @error: #GError to append error state to
10642  *
10643  * If the @cancellable is cancelled, sets the error to notify
10644  * that the operation was cancelled.
10645  *
10646  * Returns: %TRUE if @cancellable was cancelled, %FALSE if it was not
10647  */
10648
10649
10650 /**
10651  * g_cancellable_source_new: (skip)
10652  * @cancellable: (allow-none): a #GCancellable, or %NULL
10653  *
10654  * Creates a source that triggers if @cancellable is cancelled and
10655  * calls its callback of type #GCancellableSourceFunc. This is
10656  * primarily useful for attaching to another (non-cancellable) source
10657  * with g_source_add_child_source() to add cancellability to it.
10658  *
10659  * For convenience, you can call this with a %NULL #GCancellable,
10660  * in which case the source will never trigger.
10661  *
10662  * Returns: (transfer full): the new #GSource.
10663  * Since: 2.28
10664  */
10665
10666
10667 /**
10668  * g_charset_converter_get_num_fallbacks:
10669  * @converter: a #GCharsetConverter
10670  *
10671  * Gets the number of fallbacks that @converter has applied so far.
10672  *
10673  * Returns: the number of fallbacks that @converter has applied
10674  * Since: 2.24
10675  */
10676
10677
10678 /**
10679  * g_charset_converter_get_use_fallback:
10680  * @converter: a #GCharsetConverter
10681  *
10682  * Gets the #GCharsetConverter:use-fallback property.
10683  *
10684  * Returns: %TRUE if fallbacks are used by @converter
10685  * Since: 2.24
10686  */
10687
10688
10689 /**
10690  * g_charset_converter_new:
10691  * @to_charset: destination charset
10692  * @from_charset: source charset
10693  * @error: #GError for error reporting, or %NULL to ignore.
10694  *
10695  * Creates a new #GCharsetConverter.
10696  *
10697  * Returns: a new #GCharsetConverter or %NULL on error.
10698  * Since: 2.24
10699  */
10700
10701
10702 /**
10703  * g_charset_converter_set_use_fallback:
10704  * @converter: a #GCharsetConverter
10705  * @use_fallback: %TRUE to use fallbacks
10706  *
10707  * Sets the #GCharsetConverter:use-fallback property.
10708  *
10709  * Since: 2.24
10710  */
10711
10712
10713 /**
10714  * g_content_type_can_be_executable:
10715  * @type: a content type string
10716  *
10717  * Checks if a content type can be executable. Note that for instance
10718  * things like text files can be executables (i.e. scripts and batch files).
10719  *
10720  * Returns: %TRUE if the file type corresponds to a type that can be executable, %FALSE otherwise.
10721  */
10722
10723
10724 /**
10725  * g_content_type_equals:
10726  * @type1: a content type string
10727  * @type2: a content type string
10728  *
10729  * Compares two content types for equality.
10730  *
10731  * Returns: %TRUE if the two strings are identical or equivalent, %FALSE otherwise.
10732  */
10733
10734
10735 /**
10736  * g_content_type_from_mime_type:
10737  * @mime_type: a mime type string
10738  *
10739  * Tries to find a content type based on the mime type name.
10740  *
10741  * Returns: (allow-none): Newly allocated string with content type or %NULL. Free with g_free()
10742  * Since: 2.18
10743  */
10744
10745
10746 /**
10747  * g_content_type_get_description:
10748  * @type: a content type string
10749  *
10750  * Gets the human readable description of the content type.
10751  *
10752  * Returns: a short description of the content type @type. Free the returned string with g_free()
10753  */
10754
10755
10756 /**
10757  * g_content_type_get_generic_icon_name:
10758  * @type: a content type string
10759  *
10760  * Gets the generic icon name for a content type.
10761  *
10762  * See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
10763  * specification for more on the generic icon name.
10764  *
10765  * Returns: (allow-none): the registered generic icon name for the given @type, or %NULL if unknown. Free with g_free()
10766  * Since: 2.34
10767  */
10768
10769
10770 /**
10771  * g_content_type_get_icon:
10772  * @type: a content type string
10773  *
10774  * Gets the icon for a content type.
10775  *
10776  * Returns: (transfer full): #GIcon corresponding to the content type. Free the returned object with g_object_unref()
10777  */
10778
10779
10780 /**
10781  * g_content_type_get_mime_type:
10782  * @type: a content type string
10783  *
10784  * Gets the mime type for the content type, if one is registered.
10785  *
10786  * Returns: (allow-none): the registered mime type for the given @type, or %NULL if unknown.
10787  */
10788
10789
10790 /**
10791  * g_content_type_get_symbolic_icon:
10792  * @type: a content type string
10793  *
10794  * Gets the symbolic icon for a content type.
10795  *
10796  * Returns: (transfer full): symbolic #GIcon corresponding to the content type. Free the returned object with g_object_unref()
10797  * Since: 2.34
10798  */
10799
10800
10801 /**
10802  * g_content_type_guess:
10803  * @filename: (allow-none): a string, or %NULL
10804  * @data: (allow-none) (array length=data_size): a stream of data, or %NULL
10805  * @data_size: the size of @data
10806  * @result_uncertain: (allow-none) (out): return location for the certainty of the result, or %NULL
10807  *
10808  * Guesses the content type based on example data. If the function is
10809  * uncertain, @result_uncertain will be set to %TRUE. Either @filename
10810  * or @data may be %NULL, in which case the guess will be based solely
10811  * on the other argument.
10812  *
10813  * Returns: a string indicating a guessed content type for the given data. Free with g_free()
10814  */
10815
10816
10817 /**
10818  * g_content_type_guess_for_tree:
10819  * @root: the root of the tree to guess a type for
10820  *
10821  * Tries to guess the type of the tree with root @root, by
10822  * looking at the files it contains. The result is an array
10823  * of content types, with the best guess coming first.
10824  *
10825  * The types returned all have the form x-content/foo, e.g.
10826  * x-content/audio-cdda (for audio CDs) or x-content/image-dcf
10827  * (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
10828  * specification for more on x-content types.
10829  *
10830  * This function is useful in the implementation of
10831  * g_mount_guess_content_type().
10832  *
10833  * Returns: (transfer full) (array zero-terminated=1): an %NULL-terminated array of zero or more content types. Free with g_strfreev()
10834  * Since: 2.18
10835  */
10836
10837
10838 /**
10839  * g_content_type_is_a:
10840  * @type: a content type string
10841  * @supertype: a content type string
10842  *
10843  * Determines if @type is a subset of @supertype.
10844  *
10845  * Returns: %TRUE if @type is a kind of @supertype, %FALSE otherwise.
10846  */
10847
10848
10849 /**
10850  * g_content_type_is_unknown:
10851  * @type: a content type string
10852  *
10853  * Checks if the content type is the generic "unknown" type.
10854  * On UNIX this is the "application/octet-stream" mimetype,
10855  * while on win32 it is "*".
10856  *
10857  * Returns: %TRUE if the type is the unknown type.
10858  */
10859
10860
10861 /**
10862  * g_content_types_get_registered:
10863  *
10864  * Gets a list of strings containing all the registered content types
10865  * known to the system. The list and its data should be freed using
10866  * <programlisting>
10867  * g_list_free_full (list, g_free);
10868  * </programlisting>
10869  *
10870  * Returns: (element-type utf8) (transfer full): #GList of the registered content types
10871  */
10872
10873
10874 /**
10875  * g_converter_convert:
10876  * @converter: a #GConverter.
10877  * @inbuf: (array length=inbuf_size) (element-type guint8): the buffer containing the data to convert.
10878  * @inbuf_size: the number of bytes in @inbuf
10879  * @outbuf: a buffer to write converted data in.
10880  * @outbuf_size: the number of bytes in @outbuf, must be at least one
10881  * @flags: a #GConverterFlags controlling the conversion details
10882  * @bytes_read: (out): will be set to the number of bytes read from @inbuf on success
10883  * @bytes_written: (out): will be set to the number of bytes written to @outbuf on success
10884  * @error: location to store the error occurring, or %NULL to ignore
10885  *
10886  * This is the main operation used when converting data. It is to be called
10887  * multiple times in a loop, and each time it will do some work, i.e.
10888  * producing some output (in @outbuf) or consuming some input (from @inbuf) or
10889  * both. If its not possible to do any work an error is returned.
10890  *
10891  * Note that a single call may not consume all input (or any input at all).
10892  * Also a call may produce output even if given no input, due to state stored
10893  * in the converter producing output.
10894  *
10895  * If any data was either produced or consumed, and then an error happens, then
10896  * only the successful conversion is reported and the error is returned on the
10897  * next call.
10898  *
10899  * A full conversion loop involves calling this method repeatedly, each time
10900  * giving it new input and space output space. When there is no more input
10901  * data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
10902  * The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
10903  * each time until all data is consumed and all output is produced, then
10904  * %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
10905  * may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
10906  * in a decompression converter where the end of data is detectable from the
10907  * data (and there might even be other data after the end of the compressed data).
10908  *
10909  * When some data has successfully been converted @bytes_read and is set to
10910  * the number of bytes read from @inbuf, and @bytes_written is set to indicate
10911  * how many bytes was written to @outbuf. If there are more data to output
10912  * or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
10913  * %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
10914  * then %G_CONVERTER_FINISHED is returned.
10915  *
10916  * On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
10917  * Some errors need special handling:
10918  *
10919  * %G_IO_ERROR_NO_SPACE is returned if there is not enough space
10920  * to write the resulting converted data, the application should
10921  * call the function again with a larger @outbuf to continue.
10922  *
10923  * %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
10924  * input to fully determine what the conversion should produce,
10925  * and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
10926  * example with an incomplete multibyte sequence when converting text,
10927  * or when a regexp matches up to the end of the input (and may match
10928  * further input). It may also happen when @inbuf_size is zero and
10929  * there is no more data to produce.
10930  *
10931  * When this happens the application should read more input and then
10932  * call the function again. If further input shows that there is no
10933  * more data call the function again with the same data but with
10934  * the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
10935  * to finish as e.g. in the regexp match case (or, to fail again with
10936  * %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
10937  * input is actually partial).
10938  *
10939  * After g_converter_convert() has returned %G_CONVERTER_FINISHED the
10940  * converter object is in an invalid state where its not allowed
10941  * to call g_converter_convert() anymore. At this time you can only
10942  * free the object or call g_converter_reset() to reset it to the
10943  * initial state.
10944  *
10945  * If the flag %G_CONVERTER_FLUSH is set then conversion is modified
10946  * to try to write out all internal state to the output. The application
10947  * has to call the function multiple times with the flag set, and when
10948  * the available input has been consumed and all internal state has
10949  * been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
10950  * really at the end) is returned instead of %G_CONVERTER_CONVERTED.
10951  * This is somewhat similar to what happens at the end of the input stream,
10952  * but done in the middle of the data.
10953  *
10954  * This has different meanings for different conversions. For instance
10955  * in a compression converter it would mean that we flush all the
10956  * compression state into output such that if you uncompress the
10957  * compressed data you get back all the input data. Doing this may
10958  * make the final file larger due to padding though. Another example
10959  * is a regexp conversion, where if you at the end of the flushed data
10960  * have a match, but there is also a potential longer match. In the
10961  * non-flushed case we would ask for more input, but when flushing we
10962  * treat this as the end of input and do the match.
10963  *
10964  * Flushing is not always possible (like if a charset converter flushes
10965  * at a partial multibyte sequence). Converters are supposed to try
10966  * to produce as much output as possible and then return an error
10967  * (typically %G_IO_ERROR_PARTIAL_INPUT).
10968  *
10969  * Returns: a #GConverterResult, %G_CONVERTER_ERROR on error.
10970  * Since: 2.24
10971  */
10972
10973
10974 /**
10975  * g_converter_input_stream_get_converter:
10976  * @converter_stream: a #GConverterInputStream
10977  *
10978  * Gets the #GConverter that is used by @converter_stream.
10979  *
10980  * Returns: (transfer none): the converter of the converter input stream
10981  * Since: 2.24
10982  */
10983
10984
10985 /**
10986  * g_converter_input_stream_new:
10987  * @base_stream: a #GInputStream
10988  * @converter: a #GConverter
10989  *
10990  * Creates a new converter input stream for the @base_stream.
10991  *
10992  * Returns: a new #GInputStream.
10993  */
10994
10995
10996 /**
10997  * g_converter_output_stream_get_converter:
10998  * @converter_stream: a #GConverterOutputStream
10999  *
11000  * Gets the #GConverter that is used by @converter_stream.
11001  *
11002  * Returns: (transfer none): the converter of the converter output stream
11003  * Since: 2.24
11004  */
11005
11006
11007 /**
11008  * g_converter_output_stream_new:
11009  * @base_stream: a #GOutputStream
11010  * @converter: a #GConverter
11011  *
11012  * Creates a new converter output stream for the @base_stream.
11013  *
11014  * Returns: a new #GOutputStream.
11015  */
11016
11017
11018 /**
11019  * g_converter_reset:
11020  * @converter: a #GConverter.
11021  *
11022  * Resets all internal state in the converter, making it behave
11023  * as if it was just created. If the converter has any internal
11024  * state that would produce output then that output is lost.
11025  *
11026  * Since: 2.24
11027  */
11028
11029
11030 /**
11031  * g_credentials_get_native: (skip)
11032  * @credentials: A #GCredentials.
11033  * @native_type: The type of native credentials to get.
11034  *
11035  * Gets a pointer to native credentials of type @native_type from
11036  * @credentials.
11037  *
11038  * It is a programming error (which will cause an warning to be
11039  * logged) to use this method if there is no #GCredentials support for
11040  * the OS or if @native_type isn't supported by the OS.
11041  *
11042  * 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.
11043  * Since: 2.26
11044  */
11045
11046
11047 /**
11048  * g_credentials_get_unix_pid:
11049  * @credentials: A #GCredentials
11050  * @error: Return location for error or %NULL.
11051  *
11052  * Tries to get the UNIX process identifier from @credentials. This
11053  * method is only available on UNIX platforms.
11054  *
11055  * This operation can fail if #GCredentials is not supported on the
11056  * OS or if the native credentials type does not contain information
11057  * about the UNIX process ID.
11058  *
11059  * Returns: The UNIX process ID, or -1 if @error is set.
11060  * Since: 2.36
11061  */
11062
11063
11064 /**
11065  * g_credentials_get_unix_user:
11066  * @credentials: A #GCredentials
11067  * @error: Return location for error or %NULL.
11068  *
11069  * Tries to get the UNIX user identifier from @credentials. This
11070  * method is only available on UNIX platforms.
11071  *
11072  * This operation can fail if #GCredentials is not supported on the
11073  * OS or if the native credentials type does not contain information
11074  * about the UNIX user.
11075  *
11076  * Returns: The UNIX user identifier or -1 if @error is set.
11077  * Since: 2.26
11078  */
11079
11080
11081 /**
11082  * g_credentials_is_same_user:
11083  * @credentials: A #GCredentials.
11084  * @other_credentials: A #GCredentials.
11085  * @error: Return location for error or %NULL.
11086  *
11087  * Checks if @credentials and @other_credentials is the same user.
11088  *
11089  * This operation can fail if #GCredentials is not supported on the
11090  * the OS.
11091  *
11092  * Returns: %TRUE if @credentials and @other_credentials has the same user, %FALSE otherwise or if @error is set.
11093  * Since: 2.26
11094  */
11095
11096
11097 /**
11098  * g_credentials_new:
11099  *
11100  * Creates a new #GCredentials object with credentials matching the
11101  * the current process.
11102  *
11103  * Returns: A #GCredentials. Free with g_object_unref().
11104  * Since: 2.26
11105  */
11106
11107
11108 /**
11109  * g_credentials_set_native:
11110  * @credentials: A #GCredentials.
11111  * @native_type: The type of native credentials to set.
11112  * @native: A pointer to native credentials.
11113  *
11114  * Copies the native credentials of type @native_type from @native
11115  * into @credentials.
11116  *
11117  * It is a programming error (which will cause an warning to be
11118  * logged) to use this method if there is no #GCredentials support for
11119  * the OS or if @native_type isn't supported by the OS.
11120  *
11121  * Since: 2.26
11122  */
11123
11124
11125 /**
11126  * g_credentials_set_unix_user:
11127  * @credentials: A #GCredentials.
11128  * @uid: The UNIX user identifier to set.
11129  * @error: Return location for error or %NULL.
11130  *
11131  * Tries to set the UNIX user identifier on @credentials. This method
11132  * is only available on UNIX platforms.
11133  *
11134  * This operation can fail if #GCredentials is not supported on the
11135  * OS or if the native credentials type does not contain information
11136  * about the UNIX user.
11137  *
11138  * Returns: %TRUE if @uid was set, %FALSE if error is set.
11139  * Since: 2.26
11140  */
11141
11142
11143 /**
11144  * g_credentials_to_string:
11145  * @credentials: A #GCredentials object.
11146  *
11147  * Creates a human-readable textual representation of @credentials
11148  * that can be used in logging and debug messages. The format of the
11149  * returned string may change in future GLib release.
11150  *
11151  * Returns: A string that should be freed with g_free().
11152  * Since: 2.26
11153  */
11154
11155
11156 /**
11157  * g_data_input_stream_get_byte_order:
11158  * @stream: a given #GDataInputStream.
11159  *
11160  * Gets the byte order for the data input stream.
11161  *
11162  * Returns: the @stream's current #GDataStreamByteOrder.
11163  */
11164
11165
11166 /**
11167  * g_data_input_stream_get_newline_type:
11168  * @stream: a given #GDataInputStream.
11169  *
11170  * Gets the current newline type for the @stream.
11171  *
11172  * Returns: #GDataStreamNewlineType for the given @stream.
11173  */
11174
11175
11176 /**
11177  * g_data_input_stream_new:
11178  * @base_stream: a #GInputStream.
11179  *
11180  * Creates a new data input stream for the @base_stream.
11181  *
11182  * Returns: a new #GDataInputStream.
11183  */
11184
11185
11186 /**
11187  * g_data_input_stream_read_byte:
11188  * @stream: a given #GDataInputStream.
11189  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11190  * @error: #GError for error reporting.
11191  *
11192  * Reads an unsigned 8-bit/1-byte value from @stream.
11193  *
11194  * Returns: an unsigned 8-bit/1-byte value read from the @stream or %0 if an error occurred.
11195  */
11196
11197
11198 /**
11199  * g_data_input_stream_read_int16:
11200  * @stream: a given #GDataInputStream.
11201  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11202  * @error: #GError for error reporting.
11203  *
11204  * Reads a 16-bit/2-byte value from @stream.
11205  *
11206  * In order to get the correct byte order for this read operation,
11207  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11208  *
11209  * Returns: a signed 16-bit/2-byte value read from @stream or %0 if an error occurred.
11210  */
11211
11212
11213 /**
11214  * g_data_input_stream_read_int32:
11215  * @stream: a given #GDataInputStream.
11216  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11217  * @error: #GError for error reporting.
11218  *
11219  * Reads a signed 32-bit/4-byte value from @stream.
11220  *
11221  * In order to get the correct byte order for this read operation,
11222  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11223  *
11224  * If @cancellable is not %NULL, then the operation can be cancelled by
11225  * triggering the cancellable object from another thread. If the operation
11226  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11227  *
11228  * Returns: a signed 32-bit/4-byte value read from the @stream or %0 if an error occurred.
11229  */
11230
11231
11232 /**
11233  * g_data_input_stream_read_int64:
11234  * @stream: a given #GDataInputStream.
11235  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11236  * @error: #GError for error reporting.
11237  *
11238  * Reads a 64-bit/8-byte value from @stream.
11239  *
11240  * In order to get the correct byte order for this read operation,
11241  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11242  *
11243  * If @cancellable is not %NULL, then the operation can be cancelled by
11244  * triggering the cancellable object from another thread. If the operation
11245  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11246  *
11247  * Returns: a signed 64-bit/8-byte value read from @stream or %0 if an error occurred.
11248  */
11249
11250
11251 /**
11252  * g_data_input_stream_read_line:
11253  * @stream: a given #GDataInputStream.
11254  * @length: (out): a #gsize to get the length of the data read in.
11255  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11256  * @error: #GError for error reporting.
11257  *
11258  * Reads a line from the data input stream.  Note that no encoding
11259  * checks or conversion is performed; the input is not guaranteed to
11260  * be UTF-8, and may in fact have embedded NUL characters.
11261  *
11262  * If @cancellable is not %NULL, then the operation can be cancelled by
11263  * triggering the cancellable object from another thread. If the operation
11264  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11265  *
11266  * 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.
11267  */
11268
11269
11270 /**
11271  * g_data_input_stream_read_line_async:
11272  * @stream: a given #GDataInputStream.
11273  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11274  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11275  * @callback: (scope async): callback to call when the request is satisfied.
11276  * @user_data: (closure): the data to pass to callback function.
11277  *
11278  * The asynchronous version of g_data_input_stream_read_line().  It is
11279  * an error to have two outstanding calls to this function.
11280  *
11281  * When the operation is finished, @callback will be called. You
11282  * can then call g_data_input_stream_read_line_finish() to get
11283  * the result of the operation.
11284  *
11285  * Since: 2.20
11286  */
11287
11288
11289 /**
11290  * g_data_input_stream_read_line_finish:
11291  * @stream: a given #GDataInputStream.
11292  * @result: the #GAsyncResult that was provided to the callback.
11293  * @length: (out): a #gsize to get the length of the data read in.
11294  * @error: #GError for error reporting.
11295  *
11296  * Finish an asynchronous call started by
11297  * g_data_input_stream_read_line_async().  Note the warning about
11298  * string encoding in g_data_input_stream_read_line() applies here as
11299  * well.
11300  *
11301  * 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.
11302  * Since: 2.20
11303  */
11304
11305
11306 /**
11307  * g_data_input_stream_read_line_finish_utf8:
11308  * @stream: a given #GDataInputStream.
11309  * @result: the #GAsyncResult that was provided to the callback.
11310  * @length: (out): a #gsize to get the length of the data read in.
11311  * @error: #GError for error reporting.
11312  *
11313  * Finish an asynchronous call started by
11314  * g_data_input_stream_read_line_async().
11315  *
11316  * 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.
11317  * Since: 2.30
11318  */
11319
11320
11321 /**
11322  * g_data_input_stream_read_line_utf8:
11323  * @stream: a given #GDataInputStream.
11324  * @length: (out): a #gsize to get the length of the data read in.
11325  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11326  * @error: #GError for error reporting.
11327  *
11328  * Reads a UTF-8 encoded line from the data input stream.
11329  *
11330  * If @cancellable is not %NULL, then the operation can be cancelled by
11331  * triggering the cancellable object from another thread. If the operation
11332  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11333  *
11334  * 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.
11335  * Since: 2.30
11336  */
11337
11338
11339 /**
11340  * g_data_input_stream_read_uint16:
11341  * @stream: a given #GDataInputStream.
11342  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11343  * @error: #GError for error reporting.
11344  *
11345  * Reads an unsigned 16-bit/2-byte value from @stream.
11346  *
11347  * In order to get the correct byte order for this read operation,
11348  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11349  *
11350  * Returns: an unsigned 16-bit/2-byte value read from the @stream or %0 if an error occurred.
11351  */
11352
11353
11354 /**
11355  * g_data_input_stream_read_uint32:
11356  * @stream: a given #GDataInputStream.
11357  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11358  * @error: #GError for error reporting.
11359  *
11360  * Reads an unsigned 32-bit/4-byte value from @stream.
11361  *
11362  * In order to get the correct byte order for this read operation,
11363  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
11364  *
11365  * If @cancellable is not %NULL, then the operation can be cancelled by
11366  * triggering the cancellable object from another thread. If the operation
11367  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11368  *
11369  * Returns: an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred.
11370  */
11371
11372
11373 /**
11374  * g_data_input_stream_read_uint64:
11375  * @stream: a given #GDataInputStream.
11376  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11377  * @error: #GError for error reporting.
11378  *
11379  * Reads an unsigned 64-bit/8-byte value from @stream.
11380  *
11381  * In order to get the correct byte order for this read operation,
11382  * see g_data_input_stream_get_byte_order().
11383  *
11384  * If @cancellable is not %NULL, then the operation can be cancelled by
11385  * triggering the cancellable object from another thread. If the operation
11386  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11387  *
11388  * Returns: an unsigned 64-bit/8-byte read from @stream or %0 if an error occurred.
11389  */
11390
11391
11392 /**
11393  * g_data_input_stream_read_until:
11394  * @stream: a given #GDataInputStream.
11395  * @stop_chars: characters to terminate the read.
11396  * @length: (out): a #gsize to get the length of the data read in.
11397  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11398  * @error: #GError for error reporting.
11399  *
11400  * Reads a string from the data input stream, up to the first
11401  * occurrence of any of the stop characters.
11402  *
11403  * Note that, in contrast to g_data_input_stream_read_until_async(),
11404  * this function consumes the stop character that it finds.
11405  *
11406  * Don't use this function in new code.  Its functionality is
11407  * inconsistent with g_data_input_stream_read_until_async().  Both
11408  * functions will be marked as deprecated in a future release.  Use
11409  * g_data_input_stream_read_upto() instead, but note that that function
11410  * does not consume the stop character.
11411  *
11412  * 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.
11413  */
11414
11415
11416 /**
11417  * g_data_input_stream_read_until_async:
11418  * @stream: a given #GDataInputStream.
11419  * @stop_chars: characters to terminate the read.
11420  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11421  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11422  * @callback: (scope async): callback to call when the request is satisfied.
11423  * @user_data: (closure): the data to pass to callback function.
11424  *
11425  * The asynchronous version of g_data_input_stream_read_until().
11426  * It is an error to have two outstanding calls to this function.
11427  *
11428  * Note that, in contrast to g_data_input_stream_read_until(),
11429  * this function does not consume the stop character that it finds.  You
11430  * must read it for yourself.
11431  *
11432  * When the operation is finished, @callback will be called. You
11433  * can then call g_data_input_stream_read_until_finish() to get
11434  * the result of the operation.
11435  *
11436  * Don't use this function in new code.  Its functionality is
11437  * inconsistent with g_data_input_stream_read_until().  Both functions
11438  * will be marked as deprecated in a future release.  Use
11439  * g_data_input_stream_read_upto_async() instead.
11440  *
11441  * Since: 2.20
11442  */
11443
11444
11445 /**
11446  * g_data_input_stream_read_until_finish:
11447  * @stream: a given #GDataInputStream.
11448  * @result: the #GAsyncResult that was provided to the callback.
11449  * @length: (out): a #gsize to get the length of the data read in.
11450  * @error: #GError for error reporting.
11451  *
11452  * Finish an asynchronous call started by
11453  * g_data_input_stream_read_until_async().
11454  *
11455  * Since: 2.20
11456  * 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.
11457  */
11458
11459
11460 /**
11461  * g_data_input_stream_read_upto:
11462  * @stream: a #GDataInputStream
11463  * @stop_chars: characters to terminate the read
11464  * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
11465  * @length: (out): a #gsize to get the length of the data read in
11466  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
11467  * @error: #GError for error reporting
11468  *
11469  * Reads a string from the data input stream, up to the first
11470  * occurrence of any of the stop characters.
11471  *
11472  * In contrast to g_data_input_stream_read_until(), this function
11473  * does <emphasis>not</emphasis> consume the stop character. You have
11474  * to use g_data_input_stream_read_byte() to get it before calling
11475  * g_data_input_stream_read_upto() again.
11476  *
11477  * Note that @stop_chars may contain '\0' if @stop_chars_len is
11478  * specified.
11479  *
11480  * 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
11481  * Since: 2.26
11482  */
11483
11484
11485 /**
11486  * g_data_input_stream_read_upto_async:
11487  * @stream: a #GDataInputStream
11488  * @stop_chars: characters to terminate the read
11489  * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
11490  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
11491  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
11492  * @callback: (scope async): callback to call when the request is satisfied
11493  * @user_data: (closure): the data to pass to callback function
11494  *
11495  * The asynchronous version of g_data_input_stream_read_upto().
11496  * It is an error to have two outstanding calls to this function.
11497  *
11498  * In contrast to g_data_input_stream_read_until(), this function
11499  * does <emphasis>not</emphasis> consume the stop character. You have
11500  * to use g_data_input_stream_read_byte() to get it before calling
11501  * g_data_input_stream_read_upto() again.
11502  *
11503  * Note that @stop_chars may contain '\0' if @stop_chars_len is
11504  * specified.
11505  *
11506  * When the operation is finished, @callback will be called. You
11507  * can then call g_data_input_stream_read_upto_finish() to get
11508  * the result of the operation.
11509  *
11510  * Since: 2.26
11511  */
11512
11513
11514 /**
11515  * g_data_input_stream_read_upto_finish:
11516  * @stream: a #GDataInputStream
11517  * @result: the #GAsyncResult that was provided to the callback
11518  * @length: (out): a #gsize to get the length of the data read in
11519  * @error: #GError for error reporting
11520  *
11521  * Finish an asynchronous call started by
11522  * g_data_input_stream_read_upto_async().
11523  *
11524  * Note that this function does <emphasis>not</emphasis> consume the
11525  * stop character. You have to use g_data_input_stream_read_byte() to
11526  * get it before calling g_data_input_stream_read_upto_async() again.
11527  *
11528  * 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.
11529  * Since: 2.24
11530  */
11531
11532
11533 /**
11534  * g_data_input_stream_set_byte_order:
11535  * @stream: a given #GDataInputStream.
11536  * @order: a #GDataStreamByteOrder to set.
11537  *
11538  * This function sets the byte order for the given @stream. All subsequent
11539  * reads from the @stream will be read in the given @order.
11540  */
11541
11542
11543 /**
11544  * g_data_input_stream_set_newline_type:
11545  * @stream: a #GDataInputStream.
11546  * @type: the type of new line return as #GDataStreamNewlineType.
11547  *
11548  * Sets the newline type for the @stream.
11549  *
11550  * Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
11551  * chunk ends in "CR" we must read an additional byte to know if this is "CR" or
11552  * "CR LF", and this might block if there is no more data available.
11553  */
11554
11555
11556 /**
11557  * g_data_output_stream_get_byte_order:
11558  * @stream: a #GDataOutputStream.
11559  *
11560  * Gets the byte order for the stream.
11561  *
11562  * Returns: the #GDataStreamByteOrder for the @stream.
11563  */
11564
11565
11566 /**
11567  * g_data_output_stream_new:
11568  * @base_stream: a #GOutputStream.
11569  *
11570  * Creates a new data output stream for @base_stream.
11571  *
11572  * Returns: #GDataOutputStream.
11573  */
11574
11575
11576 /**
11577  * g_data_output_stream_put_byte:
11578  * @stream: a #GDataOutputStream.
11579  * @data: a #guchar.
11580  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11581  * @error: a #GError, %NULL to ignore.
11582  *
11583  * Puts a byte into the output stream.
11584  *
11585  * Returns: %TRUE if @data was successfully added to the @stream.
11586  */
11587
11588
11589 /**
11590  * g_data_output_stream_put_int16:
11591  * @stream: a #GDataOutputStream.
11592  * @data: a #gint16.
11593  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11594  * @error: a #GError, %NULL to ignore.
11595  *
11596  * Puts a signed 16-bit integer into the output stream.
11597  *
11598  * Returns: %TRUE if @data was successfully added to the @stream.
11599  */
11600
11601
11602 /**
11603  * g_data_output_stream_put_int32:
11604  * @stream: a #GDataOutputStream.
11605  * @data: a #gint32.
11606  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11607  * @error: a #GError, %NULL to ignore.
11608  *
11609  * Puts a signed 32-bit integer into the output stream.
11610  *
11611  * Returns: %TRUE if @data was successfully added to the @stream.
11612  */
11613
11614
11615 /**
11616  * g_data_output_stream_put_int64:
11617  * @stream: a #GDataOutputStream.
11618  * @data: a #gint64.
11619  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11620  * @error: a #GError, %NULL to ignore.
11621  *
11622  * Puts a signed 64-bit integer into the stream.
11623  *
11624  * Returns: %TRUE if @data was successfully added to the @stream.
11625  */
11626
11627
11628 /**
11629  * g_data_output_stream_put_string:
11630  * @stream: a #GDataOutputStream.
11631  * @str: a string.
11632  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11633  * @error: a #GError, %NULL to ignore.
11634  *
11635  * Puts a string into the output stream.
11636  *
11637  * Returns: %TRUE if @string was successfully added to the @stream.
11638  */
11639
11640
11641 /**
11642  * g_data_output_stream_put_uint16:
11643  * @stream: a #GDataOutputStream.
11644  * @data: a #guint16.
11645  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11646  * @error: a #GError, %NULL to ignore.
11647  *
11648  * Puts an unsigned 16-bit integer into the output stream.
11649  *
11650  * Returns: %TRUE if @data was successfully added to the @stream.
11651  */
11652
11653
11654 /**
11655  * g_data_output_stream_put_uint32:
11656  * @stream: a #GDataOutputStream.
11657  * @data: a #guint32.
11658  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11659  * @error: a #GError, %NULL to ignore.
11660  *
11661  * Puts an unsigned 32-bit integer into the stream.
11662  *
11663  * Returns: %TRUE if @data was successfully added to the @stream.
11664  */
11665
11666
11667 /**
11668  * g_data_output_stream_put_uint64:
11669  * @stream: a #GDataOutputStream.
11670  * @data: a #guint64.
11671  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
11672  * @error: a #GError, %NULL to ignore.
11673  *
11674  * Puts an unsigned 64-bit integer into the stream.
11675  *
11676  * Returns: %TRUE if @data was successfully added to the @stream.
11677  */
11678
11679
11680 /**
11681  * g_data_output_stream_set_byte_order:
11682  * @stream: a #GDataOutputStream.
11683  * @order: a %GDataStreamByteOrder.
11684  *
11685  * Sets the byte order of the data output stream to @order.
11686  */
11687
11688
11689 /**
11690  * g_dbus_action_group_get:
11691  * @connection: A #GDBusConnection
11692  * @bus_name: the bus name which exports the action group
11693  * @object_path: the object path at which the action group is exported
11694  *
11695  * Obtains a #GDBusActionGroup for the action group which is exported at
11696  * the given @bus_name and @object_path.
11697  *
11698  * The thread default main context is taken at the time of this call.
11699  * All signals on the menu model (and any linked models) are reported
11700  * with respect to this context.  All calls on the returned menu model
11701  * (and linked models) must also originate from this same context, with
11702  * the thread default main context unchanged.
11703  *
11704  * This call is non-blocking.  The returned action group may or may not
11705  * already be filled in.  The correct thing to do is connect the signals
11706  * for the action group to monitor for changes and then to call
11707  * g_action_group_list_actions() to get the initial list.
11708  *
11709  * Returns: (transfer full): a #GDBusActionGroup
11710  * Since: 2.32
11711  */
11712
11713
11714 /**
11715  * g_dbus_address_escape_value:
11716  * @string: an unescaped string to be included in a D-Bus address as the value in a key-value pair
11717  *
11718  * Escape @string so it can appear in a D-Bus address as the value
11719  * part of a key-value pair.
11720  *
11721  * For instance, if @string is <code>/run/bus-for-:0</code>,
11722  * this function would return <code>/run/bus-for-%3A0</code>,
11723  * which could be used in a D-Bus address like
11724  * <code>unix:nonce-tcp:host=127.0.0.1,port=42,noncefile=/run/bus-for-%3A0</code>.
11725  *
11726  * Returns: (transfer full): a copy of @string with all non-optionally-escaped bytes escaped
11727  * Since: 2.36
11728  */
11729
11730
11731 /**
11732  * g_dbus_address_get_for_bus_sync:
11733  * @bus_type: A #GBusType.
11734  * @cancellable: (allow-none): A #GCancellable or %NULL.
11735  * @error: Return location for error or %NULL.
11736  *
11737  * Synchronously looks up the D-Bus address for the well-known message
11738  * bus instance specified by @bus_type. This may involve using various
11739  * platform specific mechanisms.
11740  *
11741  * Returns: A valid D-Bus address string for @bus_type or %NULL if @error is set.
11742  * Since: 2.26
11743  */
11744
11745
11746 /**
11747  * g_dbus_address_get_stream:
11748  * @address: A valid D-Bus address.
11749  * @cancellable: (allow-none): A #GCancellable or %NULL.
11750  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
11751  * @user_data: Data to pass to @callback.
11752  *
11753  * Asynchronously connects to an endpoint specified by @address and
11754  * sets up the connection so it is in a state to run the client-side
11755  * of the D-Bus authentication conversation.
11756  *
11757  * When the operation is finished, @callback will be invoked. You can
11758  * then call g_dbus_address_get_stream_finish() to get the result of
11759  * the operation.
11760  *
11761  * This is an asynchronous failable function. See
11762  * g_dbus_address_get_stream_sync() for the synchronous version.
11763  *
11764  * Since: 2.26
11765  */
11766
11767
11768 /**
11769  * g_dbus_address_get_stream_finish:
11770  * @res: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
11771  * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
11772  * @error: Return location for error or %NULL.
11773  *
11774  * Finishes an operation started with g_dbus_address_get_stream().
11775  *
11776  * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
11777  * Since: 2.26
11778  */
11779
11780
11781 /**
11782  * g_dbus_address_get_stream_sync:
11783  * @address: A valid D-Bus address.
11784  * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
11785  * @cancellable: (allow-none): A #GCancellable or %NULL.
11786  * @error: Return location for error or %NULL.
11787  *
11788  * Synchronously connects to an endpoint specified by @address and
11789  * sets up the connection so it is in a state to run the client-side
11790  * of the D-Bus authentication conversation.
11791  *
11792  * This is a synchronous failable function. See
11793  * g_dbus_address_get_stream() for the asynchronous version.
11794  *
11795  * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
11796  * Since: 2.26
11797  */
11798
11799
11800 /**
11801  * g_dbus_annotation_info_lookup:
11802  * @annotations: (array zero-terminated=1) (allow-none): A %NULL-terminated array of annotations or %NULL.
11803  * @name: The name of the annotation to look up.
11804  *
11805  * Looks up the value of an annotation.
11806  *
11807  * The cost of this function is O(n) in number of annotations.
11808  *
11809  * Returns: The value or %NULL if not found. Do not free, it is owned by @annotations.
11810  * Since: 2.26
11811  */
11812
11813
11814 /**
11815  * g_dbus_annotation_info_ref:
11816  * @info: A #GDBusNodeInfo
11817  *
11818  * If @info is statically allocated does nothing. Otherwise increases
11819  * the reference count.
11820  *
11821  * Returns: The same @info.
11822  * Since: 2.26
11823  */
11824
11825
11826 /**
11827  * g_dbus_annotation_info_unref:
11828  * @info: A #GDBusAnnotationInfo.
11829  *
11830  * If @info is statically allocated, does nothing. Otherwise decreases
11831  * the reference count of @info. When its reference count drops to 0,
11832  * the memory used is freed.
11833  *
11834  * Since: 2.26
11835  */
11836
11837
11838 /**
11839  * g_dbus_arg_info_ref:
11840  * @info: A #GDBusArgInfo
11841  *
11842  * If @info is statically allocated does nothing. Otherwise increases
11843  * the reference count.
11844  *
11845  * Returns: The same @info.
11846  * Since: 2.26
11847  */
11848
11849
11850 /**
11851  * g_dbus_arg_info_unref:
11852  * @info: A #GDBusArgInfo.
11853  *
11854  * If @info is statically allocated, does nothing. Otherwise decreases
11855  * the reference count of @info. When its reference count drops to 0,
11856  * the memory used is freed.
11857  *
11858  * Since: 2.26
11859  */
11860
11861
11862 /**
11863  * g_dbus_auth_observer_allow_mechanism:
11864  * @observer: A #GDBusAuthObserver.
11865  * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
11866  *
11867  * Emits the #GDBusAuthObserver::allow-mechanism signal on @observer.
11868  *
11869  * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
11870  * Since: 2.34
11871  */
11872
11873
11874 /**
11875  * g_dbus_auth_observer_authorize_authenticated_peer:
11876  * @observer: A #GDBusAuthObserver.
11877  * @stream: A #GIOStream for the #GDBusConnection.
11878  * @credentials: (allow-none): Credentials received from the peer or %NULL.
11879  *
11880  * Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
11881  *
11882  * Returns: %TRUE if the peer is authorized, %FALSE if not.
11883  * Since: 2.26
11884  */
11885
11886
11887 /**
11888  * g_dbus_auth_observer_new:
11889  *
11890  * Creates a new #GDBusAuthObserver object.
11891  *
11892  * Returns: A #GDBusAuthObserver. Free with g_object_unref().
11893  * Since: 2.26
11894  */
11895
11896
11897 /**
11898  * g_dbus_connection_add_filter:
11899  * @connection: A #GDBusConnection.
11900  * @filter_function: A filter function.
11901  * @user_data: User data to pass to @filter_function.
11902  * @user_data_free_func: Function to free @user_data with when filter is removed or %NULL.
11903  *
11904  * Adds a message filter. Filters are handlers that are run on all
11905  * incoming and outgoing messages, prior to standard dispatch. Filters
11906  * are run in the order that they were added.  The same handler can be
11907  * added as a filter more than once, in which case it will be run more
11908  * than once.  Filters added during a filter callback won't be run on
11909  * the message being processed. Filter functions are allowed to modify
11910  * and even drop messages.
11911  *
11912  * Note that filters are run in a dedicated message handling thread so
11913  * they can't block and, generally, can't do anything but signal a
11914  * worker thread. Also note that filters are rarely needed - use API
11915  * such as g_dbus_connection_send_message_with_reply(),
11916  * g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
11917  *
11918  * If a filter consumes an incoming message the message is not
11919  * dispatched anywhere else - not even the standard dispatch machinery
11920  * (that API such as g_dbus_connection_signal_subscribe() and
11921  * g_dbus_connection_send_message_with_reply() relies on) will see the
11922  * message. Similary, if a filter consumes an outgoing message, the
11923  * message will not be sent to the other peer.
11924  *
11925  * Returns: A filter identifier that can be used with g_dbus_connection_remove_filter().
11926  * Since: 2.26
11927  */
11928
11929
11930 /**
11931  * g_dbus_connection_call:
11932  * @connection: A #GDBusConnection.
11933  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
11934  * @object_path: Path of remote object.
11935  * @interface_name: D-Bus interface to invoke method on.
11936  * @method_name: The name of the method to invoke.
11937  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
11938  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
11939  * @flags: Flags from the #GDBusCallFlags enumeration.
11940  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
11941  * @cancellable: (allow-none): A #GCancellable or %NULL.
11942  * @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.
11943  * @user_data: The data to pass to @callback.
11944  *
11945  * Asynchronously invokes the @method_name method on the
11946  * @interface_name D-Bus interface on the remote object at
11947  * @object_path owned by @bus_name.
11948  *
11949  * If @connection is closed then the operation will fail with
11950  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
11951  * fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
11952  * not compatible with the D-Bus protocol, the operation fails with
11953  * %G_IO_ERROR_INVALID_ARGUMENT.
11954  *
11955  * If @reply_type is non-%NULL then the reply will be checked for having this type and an
11956  * error will be raised if it does not match.  Said another way, if you give a @reply_type
11957  * then any non-%NULL return value will be of this type.
11958  *
11959  * If the @parameters #GVariant is floating, it is consumed. This allows
11960  * convenient 'inline' use of g_variant_new(), e.g.:
11961  * |[
11962  *  g_dbus_connection_call (connection,
11963  *                          "org.freedesktop.StringThings",
11964  *                          "/org/freedesktop/StringThings",
11965  *                          "org.freedesktop.StringThings",
11966  *                          "TwoStrings",
11967  *                          g_variant_new ("(ss)",
11968  *                                         "Thing One",
11969  *                                         "Thing Two"),
11970  *                          NULL,
11971  *                          G_DBUS_CALL_FLAGS_NONE,
11972  *                          -1,
11973  *                          NULL,
11974  *                          (GAsyncReadyCallback) two_strings_done,
11975  *                          NULL);
11976  * ]|
11977  *
11978  * This is an asynchronous method. When the operation is finished, @callback will be invoked
11979  * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
11980  * of the thread you are calling this method from. You can then call
11981  * g_dbus_connection_call_finish() to get the result of the operation.
11982  * See g_dbus_connection_call_sync() for the synchronous version of this
11983  * function.
11984  *
11985  * If @callback is %NULL then the D-Bus method call message will be sent with
11986  * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
11987  *
11988  * Since: 2.26
11989  */
11990
11991
11992 /**
11993  * g_dbus_connection_call_finish:
11994  * @connection: A #GDBusConnection.
11995  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
11996  * @error: Return location for error or %NULL.
11997  *
11998  * Finishes an operation started with g_dbus_connection_call().
11999  *
12000  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12001  * Since: 2.26
12002  */
12003
12004
12005 /**
12006  * g_dbus_connection_call_sync:
12007  * @connection: A #GDBusConnection.
12008  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12009  * @object_path: Path of remote object.
12010  * @interface_name: D-Bus interface to invoke method on.
12011  * @method_name: The name of the method to invoke.
12012  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12013  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12014  * @flags: Flags from the #GDBusCallFlags enumeration.
12015  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12016  * @cancellable: (allow-none): A #GCancellable or %NULL.
12017  * @error: Return location for error or %NULL.
12018  *
12019  * Synchronously invokes the @method_name method on the
12020  * @interface_name D-Bus interface on the remote object at
12021  * @object_path owned by @bus_name.
12022  *
12023  * If @connection is closed then the operation will fail with
12024  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
12025  * operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
12026  * contains a value not compatible with the D-Bus protocol, the operation
12027  * fails with %G_IO_ERROR_INVALID_ARGUMENT.
12028  *
12029  * If @reply_type is non-%NULL then the reply will be checked for having
12030  * this type and an error will be raised if it does not match.  Said
12031  * another way, if you give a @reply_type then any non-%NULL return
12032  * value will be of this type.
12033  *
12034  * If the @parameters #GVariant is floating, it is consumed.
12035  * This allows convenient 'inline' use of g_variant_new(), e.g.:
12036  * |[
12037  *  g_dbus_connection_call_sync (connection,
12038  *                               "org.freedesktop.StringThings",
12039  *                               "/org/freedesktop/StringThings",
12040  *                               "org.freedesktop.StringThings",
12041  *                               "TwoStrings",
12042  *                               g_variant_new ("(ss)",
12043  *                                              "Thing One",
12044  *                                              "Thing Two"),
12045  *                               NULL,
12046  *                               G_DBUS_CALL_FLAGS_NONE,
12047  *                               -1,
12048  *                               NULL,
12049  *                               &amp;error);
12050  * ]|
12051  *
12052  * The calling thread is blocked until a reply is received. See
12053  * g_dbus_connection_call() for the asynchronous version of
12054  * this method.
12055  *
12056  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12057  * Since: 2.26
12058  */
12059
12060
12061 /**
12062  * g_dbus_connection_call_with_unix_fd_list:
12063  * @connection: A #GDBusConnection.
12064  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12065  * @object_path: Path of remote object.
12066  * @interface_name: D-Bus interface to invoke method on.
12067  * @method_name: The name of the method to invoke.
12068  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12069  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12070  * @flags: Flags from the #GDBusCallFlags enumeration.
12071  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12072  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12073  * @cancellable: (allow-none): A #GCancellable or %NULL.
12074  * @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.
12075  * @user_data: The data to pass to @callback.
12076  *
12077  * Like g_dbus_connection_call() but also takes a #GUnixFDList object.
12078  *
12079  * This method is only available on UNIX.
12080  *
12081  * Since: 2.30
12082  */
12083
12084
12085 /**
12086  * g_dbus_connection_call_with_unix_fd_list_finish:
12087  * @connection: A #GDBusConnection.
12088  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12089  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
12090  * @error: Return location for error or %NULL.
12091  *
12092  * Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
12093  *
12094  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12095  * Since: 2.30
12096  */
12097
12098
12099 /**
12100  * g_dbus_connection_call_with_unix_fd_list_sync:
12101  * @connection: A #GDBusConnection.
12102  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
12103  * @object_path: Path of remote object.
12104  * @interface_name: D-Bus interface to invoke method on.
12105  * @method_name: The name of the method to invoke.
12106  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
12107  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
12108  * @flags: Flags from the #GDBusCallFlags enumeration.
12109  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12110  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
12111  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
12112  * @cancellable: (allow-none): A #GCancellable or %NULL.
12113  * @error: Return location for error or %NULL.
12114  *
12115  * Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
12116  *
12117  * This method is only available on UNIX.
12118  *
12119  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
12120  * Since: 2.30
12121  */
12122
12123
12124 /**
12125  * g_dbus_connection_close:
12126  * @connection: A #GDBusConnection.
12127  * @cancellable: (allow-none): A #GCancellable or %NULL.
12128  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12129  * @user_data: The data to pass to @callback.
12130  *
12131  * Closes @connection. Note that this never causes the process to
12132  * exit (this might only happen if the other end of a shared message
12133  * bus connection disconnects, see #GDBusConnection:exit-on-close).
12134  *
12135  * Once the connection is closed, operations such as sending a message
12136  * will return with the error %G_IO_ERROR_CLOSED. Closing a connection
12137  * will not automatically flush the connection so queued messages may
12138  * be lost. Use g_dbus_connection_flush() if you need such guarantees.
12139  *
12140  * If @connection is already closed, this method fails with
12141  * %G_IO_ERROR_CLOSED.
12142  *
12143  * When @connection has been closed, the #GDBusConnection::closed
12144  * signal is emitted in the <link
12145  * linkend="g-main-context-push-thread-default">thread-default main
12146  * loop</link> of the thread that @connection was constructed in.
12147  *
12148  * This is an asynchronous method. When the operation is finished,
12149  * @callback will be invoked in the <link
12150  * linkend="g-main-context-push-thread-default">thread-default main
12151  * loop</link> of the thread you are calling this method from. You can
12152  * then call g_dbus_connection_close_finish() to get the result of the
12153  * operation.  See g_dbus_connection_close_sync() for the synchronous
12154  * version.
12155  *
12156  * Since: 2.26
12157  */
12158
12159
12160 /**
12161  * g_dbus_connection_close_finish:
12162  * @connection: A #GDBusConnection.
12163  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
12164  * @error: Return location for error or %NULL.
12165  *
12166  * Finishes an operation started with g_dbus_connection_close().
12167  *
12168  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12169  * Since: 2.26
12170  */
12171
12172
12173 /**
12174  * g_dbus_connection_close_sync:
12175  * @connection: A #GDBusConnection.
12176  * @cancellable: (allow-none): A #GCancellable or %NULL.
12177  * @error: Return location for error or %NULL.
12178  *
12179  * Synchronously closees @connection. The calling thread is blocked
12180  * until this is done. See g_dbus_connection_close() for the
12181  * asynchronous version of this method and more details about what it
12182  * does.
12183  *
12184  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12185  * Since: 2.26
12186  */
12187
12188
12189 /**
12190  * g_dbus_connection_emit_signal:
12191  * @connection: A #GDBusConnection.
12192  * @destination_bus_name: (allow-none): The unique bus name for the destination for the signal or %NULL to emit to all listeners.
12193  * @object_path: Path of remote object.
12194  * @interface_name: D-Bus interface to emit a signal on.
12195  * @signal_name: The name of the signal to emit.
12196  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
12197  * @error: Return location for error or %NULL.
12198  *
12199  * Emits a signal.
12200  *
12201  * If the parameters GVariant is floating, it is consumed.
12202  *
12203  * This can only fail if @parameters is not compatible with the D-Bus protocol.
12204  *
12205  * Returns: %TRUE unless @error is set.
12206  * Since: 2.26
12207  */
12208
12209
12210 /**
12211  * g_dbus_connection_export_action_group:
12212  * @connection: a #GDBusConnection
12213  * @object_path: a D-Bus object path
12214  * @action_group: a #GActionGroup
12215  * @error: a pointer to a %NULL #GError, or %NULL
12216  *
12217  * Exports @action_group on @connection at @object_path.
12218  *
12219  * The implemented D-Bus API should be considered private.  It is
12220  * subject to change in the future.
12221  *
12222  * A given object path can only have one action group exported on it.
12223  * If this constraint is violated, the export will fail and 0 will be
12224  * returned (with @error set accordingly).
12225  *
12226  * You can unexport the action group using
12227  * g_dbus_connection_unexport_action_group() with the return value of
12228  * this function.
12229  *
12230  * The thread default main context is taken at the time of this call.
12231  * All incoming action activations and state change requests are
12232  * reported from this context.  Any changes on the action group that
12233  * cause it to emit signals must also come from this same context.
12234  * Since incoming action activations and state change requests are
12235  * rather likely to cause changes on the action group, this effectively
12236  * limits a given action group to being exported from only one main
12237  * context.
12238  *
12239  * Returns: the ID of the export (never zero), or 0 in case of failure
12240  * Since: 2.32
12241  */
12242
12243
12244 /**
12245  * g_dbus_connection_export_menu_model:
12246  * @connection: a #GDBusConnection
12247  * @object_path: a D-Bus object path
12248  * @menu: a #GMenuModel
12249  * @error: return location for an error, or %NULL
12250  *
12251  * Exports @menu on @connection at @object_path.
12252  *
12253  * The implemented D-Bus API should be considered private.
12254  * It is subject to change in the future.
12255  *
12256  * An object path can only have one menu model exported on it. If this
12257  * constraint is violated, the export will fail and 0 will be
12258  * returned (with @error set accordingly).
12259  *
12260  * You can unexport the menu model using
12261  * g_dbus_connection_unexport_menu_model() with the return value of
12262  * this function.
12263  *
12264  * Returns: the ID of the export (never zero), or 0 in case of failure
12265  * Since: 2.32
12266  */
12267
12268
12269 /**
12270  * g_dbus_connection_flush:
12271  * @connection: A #GDBusConnection.
12272  * @cancellable: (allow-none): A #GCancellable or %NULL.
12273  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12274  * @user_data: The data to pass to @callback.
12275  *
12276  * Asynchronously flushes @connection, that is, writes all queued
12277  * outgoing message to the transport and then flushes the transport
12278  * (using g_output_stream_flush_async()). This is useful in programs
12279  * that wants to emit a D-Bus signal and then exit
12280  * immediately. Without flushing the connection, there is no guarantee
12281  * that the message has been sent to the networking buffers in the OS
12282  * kernel.
12283  *
12284  * This is an asynchronous method. When the operation is finished,
12285  * @callback will be invoked in the <link
12286  * linkend="g-main-context-push-thread-default">thread-default main
12287  * loop</link> of the thread you are calling this method from. You can
12288  * then call g_dbus_connection_flush_finish() to get the result of the
12289  * operation.  See g_dbus_connection_flush_sync() for the synchronous
12290  * version.
12291  *
12292  * Since: 2.26
12293  */
12294
12295
12296 /**
12297  * g_dbus_connection_flush_finish:
12298  * @connection: A #GDBusConnection.
12299  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
12300  * @error: Return location for error or %NULL.
12301  *
12302  * Finishes an operation started with g_dbus_connection_flush().
12303  *
12304  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12305  * Since: 2.26
12306  */
12307
12308
12309 /**
12310  * g_dbus_connection_flush_sync:
12311  * @connection: A #GDBusConnection.
12312  * @cancellable: (allow-none): A #GCancellable or %NULL.
12313  * @error: Return location for error or %NULL.
12314  *
12315  * Synchronously flushes @connection. The calling thread is blocked
12316  * until this is done. See g_dbus_connection_flush() for the
12317  * asynchronous version of this method and more details about what it
12318  * does.
12319  *
12320  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
12321  * Since: 2.26
12322  */
12323
12324
12325 /**
12326  * g_dbus_connection_get_capabilities:
12327  * @connection: A #GDBusConnection.
12328  *
12329  * Gets the capabilities negotiated with the remote peer
12330  *
12331  * Returns: Zero or more flags from the #GDBusCapabilityFlags enumeration.
12332  * Since: 2.26
12333  */
12334
12335
12336 /**
12337  * g_dbus_connection_get_exit_on_close:
12338  * @connection: A #GDBusConnection.
12339  *
12340  * Gets whether the process is terminated when @connection is
12341  * closed by the remote peer. See
12342  * #GDBusConnection:exit-on-close for more details.
12343  *
12344  * Returns: Whether the process is terminated when @connection is closed by the remote peer.
12345  * Since: 2.26
12346  */
12347
12348
12349 /**
12350  * g_dbus_connection_get_guid:
12351  * @connection: A #GDBusConnection.
12352  *
12353  * The GUID of the peer performing the role of server when
12354  * authenticating. See #GDBusConnection:guid for more details.
12355  *
12356  * Returns: The GUID. Do not free this string, it is owned by @connection.
12357  * Since: 2.26
12358  */
12359
12360
12361 /**
12362  * g_dbus_connection_get_last_serial:
12363  * @connection: A #GDBusConnection.
12364  *
12365  * Retrieves the last serial number assigned to a #GDBusMessage on
12366  * the current thread. This includes messages sent via both low-level
12367  * API such as g_dbus_connection_send_message() as well as
12368  * high-level API such as g_dbus_connection_emit_signal(),
12369  * g_dbus_connection_call() or g_dbus_proxy_call().
12370  *
12371  * Returns: the last used serial or zero when no message has been sent within the current thread.
12372  * Since: 2.34
12373  */
12374
12375
12376 /**
12377  * g_dbus_connection_get_peer_credentials:
12378  * @connection: A #GDBusConnection.
12379  *
12380  * Gets the credentials of the authenticated peer. This will always
12381  * return %NULL unless @connection acted as a server
12382  * (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
12383  * when set up and the client passed credentials as part of the
12384  * authentication process.
12385  *
12386  * In a message bus setup, the message bus is always the server and
12387  * each application is a client. So this method will always return
12388  * %NULL for message bus clients.
12389  *
12390  * Returns: (transfer none): A #GCredentials or %NULL if not available. Do not free this object, it is owned by @connection.
12391  * Since: 2.26
12392  */
12393
12394
12395 /**
12396  * g_dbus_connection_get_stream:
12397  * @connection: a #GDBusConnection
12398  *
12399  * Gets the underlying stream used for IO.
12400  *
12401  * While the #GDBusConnection is active, it will interact with this
12402  * stream from a worker thread, so it is not safe to interact with
12403  * the stream directly.
12404  *
12405  * Returns: (transfer none): the stream used for IO
12406  * Since: 2.26
12407  */
12408
12409
12410 /**
12411  * g_dbus_connection_get_unique_name:
12412  * @connection: A #GDBusConnection.
12413  *
12414  * Gets the unique name of @connection as assigned by the message
12415  * bus. This can also be used to figure out if @connection is a
12416  * message bus connection.
12417  *
12418  * Returns: The unique name or %NULL if @connection is not a message bus connection. Do not free this string, it is owned by @connection.
12419  * Since: 2.26
12420  */
12421
12422
12423 /**
12424  * g_dbus_connection_is_closed:
12425  * @connection: A #GDBusConnection.
12426  *
12427  * Gets whether @connection is closed.
12428  *
12429  * Returns: %TRUE if the connection is closed, %FALSE otherwise.
12430  * Since: 2.26
12431  */
12432
12433
12434 /**
12435  * g_dbus_connection_new:
12436  * @stream: A #GIOStream.
12437  * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
12438  * @flags: Flags describing how to make the connection.
12439  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12440  * @cancellable: (allow-none): A #GCancellable or %NULL.
12441  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12442  * @user_data: The data to pass to @callback.
12443  *
12444  * Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
12445  * with the end represented by @stream.
12446  *
12447  * If @stream is a #GSocketConnection, then the corresponding #GSocket
12448  * will be put into non-blocking mode.
12449  *
12450  * The D-Bus connection will interact with @stream from a worker thread.
12451  * As a result, the caller should not interact with @stream after this
12452  * method has been called, except by calling g_object_unref() on it.
12453  *
12454  * If @observer is not %NULL it may be used to control the
12455  * authentication process.
12456  *
12457  * When the operation is finished, @callback will be invoked. You can
12458  * then call g_dbus_connection_new_finish() to get the result of the
12459  * operation.
12460  *
12461  * This is a asynchronous failable constructor. See
12462  * g_dbus_connection_new_sync() for the synchronous
12463  * version.
12464  *
12465  * Since: 2.26
12466  */
12467
12468
12469 /**
12470  * g_dbus_connection_new_finish:
12471  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
12472  * @error: Return location for error or %NULL.
12473  *
12474  * Finishes an operation started with g_dbus_connection_new().
12475  *
12476  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
12477  * Since: 2.26
12478  */
12479
12480
12481 /**
12482  * g_dbus_connection_new_for_address:
12483  * @address: A D-Bus address.
12484  * @flags: Flags describing how to make the connection.
12485  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12486  * @cancellable: (allow-none): A #GCancellable or %NULL.
12487  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
12488  * @user_data: The data to pass to @callback.
12489  *
12490  * Asynchronously connects and sets up a D-Bus client connection for
12491  * exchanging D-Bus messages with an endpoint specified by @address
12492  * which must be in the D-Bus address format.
12493  *
12494  * This constructor can only be used to initiate client-side
12495  * connections - use g_dbus_connection_new() if you need to act as the
12496  * server. In particular, @flags cannot contain the
12497  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
12498  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
12499  *
12500  * When the operation is finished, @callback will be invoked. You can
12501  * then call g_dbus_connection_new_finish() to get the result of the
12502  * operation.
12503  *
12504  * If @observer is not %NULL it may be used to control the
12505  * authentication process.
12506  *
12507  * This is a asynchronous failable constructor. See
12508  * g_dbus_connection_new_for_address_sync() for the synchronous
12509  * version.
12510  *
12511  * Since: 2.26
12512  */
12513
12514
12515 /**
12516  * g_dbus_connection_new_for_address_finish:
12517  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
12518  * @error: Return location for error or %NULL.
12519  *
12520  * Finishes an operation started with g_dbus_connection_new_for_address().
12521  *
12522  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
12523  * Since: 2.26
12524  */
12525
12526
12527 /**
12528  * g_dbus_connection_new_for_address_sync:
12529  * @address: A D-Bus address.
12530  * @flags: Flags describing how to make the connection.
12531  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12532  * @cancellable: (allow-none): A #GCancellable or %NULL.
12533  * @error: Return location for error or %NULL.
12534  *
12535  * Synchronously connects and sets up a D-Bus client connection for
12536  * exchanging D-Bus messages with an endpoint specified by @address
12537  * which must be in the D-Bus address format.
12538  *
12539  * This constructor can only be used to initiate client-side
12540  * connections - use g_dbus_connection_new_sync() if you need to act
12541  * as the server. In particular, @flags cannot contain the
12542  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
12543  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
12544  *
12545  * This is a synchronous failable constructor. See
12546  * g_dbus_connection_new_for_address() for the asynchronous version.
12547  *
12548  * If @observer is not %NULL it may be used to control the
12549  * authentication process.
12550  *
12551  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
12552  * Since: 2.26
12553  */
12554
12555
12556 /**
12557  * g_dbus_connection_new_sync:
12558  * @stream: A #GIOStream.
12559  * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
12560  * @flags: Flags describing how to make the connection.
12561  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
12562  * @cancellable: (allow-none): A #GCancellable or %NULL.
12563  * @error: Return location for error or %NULL.
12564  *
12565  * Synchronously sets up a D-Bus connection for exchanging D-Bus messages
12566  * with the end represented by @stream.
12567  *
12568  * If @stream is a #GSocketConnection, then the corresponding #GSocket
12569  * will be put into non-blocking mode.
12570  *
12571  * The D-Bus connection will interact with @stream from a worker thread.
12572  * As a result, the caller should not interact with @stream after this
12573  * method has been called, except by calling g_object_unref() on it.
12574  *
12575  * If @observer is not %NULL it may be used to control the
12576  * authentication process.
12577  *
12578  * This is a synchronous failable constructor. See
12579  * g_dbus_connection_new() for the asynchronous version.
12580  *
12581  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
12582  * Since: 2.26
12583  */
12584
12585
12586 /**
12587  * g_dbus_connection_register_object:
12588  * @connection: A #GDBusConnection.
12589  * @object_path: The object path to register at.
12590  * @interface_info: Introspection data for the interface.
12591  * @vtable: (allow-none): A #GDBusInterfaceVTable to call into or %NULL.
12592  * @user_data: (allow-none): Data to pass to functions in @vtable.
12593  * @user_data_free_func: Function to call when the object path is unregistered.
12594  * @error: Return location for error or %NULL.
12595  *
12596  * Registers callbacks for exported objects at @object_path with the
12597  * D-Bus interface that is described in @interface_info.
12598  *
12599  * Calls to functions in @vtable (and @user_data_free_func) will
12600  * happen in the <link linkend="g-main-context-push-thread-default">thread-default main
12601  * loop</link> of the thread you are calling this method from.
12602  *
12603  * Note that all #GVariant values passed to functions in @vtable will match
12604  * the signature given in @interface_info - if a remote caller passes
12605  * incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
12606  * is returned to the remote caller.
12607  *
12608  * Additionally, if the remote caller attempts to invoke methods or
12609  * access properties not mentioned in @interface_info the
12610  * <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
12611  * <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
12612  * are returned to the caller.
12613  *
12614  * It is considered a programming error if the
12615  * #GDBusInterfaceGetPropertyFunc function in @vtable returns a
12616  * #GVariant of incorrect type.
12617  *
12618  * If an existing callback is already registered at @object_path and
12619  * @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
12620  *
12621  * GDBus automatically implements the standard D-Bus interfaces
12622  * org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
12623  * and org.freedesktop.Peer, so you don't have to implement those for
12624  * the objects you export. You <emphasis>can</emphasis> implement
12625  * org.freedesktop.DBus.Properties yourself, e.g. to handle getting
12626  * and setting of properties asynchronously.
12627  *
12628  * Note that the reference count on @interface_info will be
12629  * incremented by 1 (unless allocated statically, e.g. if the
12630  * reference count is -1, see g_dbus_interface_info_ref()) for as long
12631  * as the object is exported. Also note that @vtable will be copied.
12632  *
12633  * See <xref linkend="gdbus-server"/> for an example of how to use this method.
12634  *
12635  * Returns: 0 if @error is set, otherwise a registration id (never 0) that can be used with g_dbus_connection_unregister_object() .
12636  * Since: 2.26
12637  */
12638
12639
12640 /**
12641  * g_dbus_connection_register_subtree:
12642  * @connection: A #GDBusConnection.
12643  * @object_path: The object path to register the subtree at.
12644  * @vtable: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
12645  * @flags: Flags used to fine tune the behavior of the subtree.
12646  * @user_data: Data to pass to functions in @vtable.
12647  * @user_data_free_func: Function to call when the subtree is unregistered.
12648  * @error: Return location for error or %NULL.
12649  *
12650  * Registers a whole subtree of <quote>dynamic</quote> objects.
12651  *
12652  * The @enumerate and @introspection functions in @vtable are used to
12653  * convey, to remote callers, what nodes exist in the subtree rooted
12654  * by @object_path.
12655  *
12656  * When handling remote calls into any node in the subtree, first the
12657  * @enumerate function is used to check if the node exists. If the node exists
12658  * or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
12659  * the @introspection function is used to check if the node supports the
12660  * requested method. If so, the @dispatch function is used to determine
12661  * where to dispatch the call. The collected #GDBusInterfaceVTable and
12662  * #gpointer will be used to call into the interface vtable for processing
12663  * the request.
12664  *
12665  * All calls into user-provided code will be invoked in the <link
12666  * linkend="g-main-context-push-thread-default">thread-default main
12667  * loop</link> of the thread you are calling this method from.
12668  *
12669  * If an existing subtree is already registered at @object_path or
12670  * then @error is set to #G_IO_ERROR_EXISTS.
12671  *
12672  * Note that it is valid to register regular objects (using
12673  * g_dbus_connection_register_object()) in a subtree registered with
12674  * g_dbus_connection_register_subtree() - if so, the subtree handler
12675  * is tried as the last resort. One way to think about a subtree
12676  * handler is to consider it a <quote>fallback handler</quote>
12677  * for object paths not registered via g_dbus_connection_register_object()
12678  * or other bindings.
12679  *
12680  * Note that @vtable will be copied so you cannot change it after
12681  * registration.
12682  *
12683  * See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
12684  *
12685  * Returns: 0 if @error is set, otherwise a subtree registration id (never 0) that can be used with g_dbus_connection_unregister_subtree() .
12686  * Since: 2.26
12687  */
12688
12689
12690 /**
12691  * g_dbus_connection_remove_filter:
12692  * @connection: a #GDBusConnection
12693  * @filter_id: an identifier obtained from g_dbus_connection_add_filter()
12694  *
12695  * Removes a filter.
12696  *
12697  * Since: 2.26
12698  */
12699
12700
12701 /**
12702  * g_dbus_connection_send_message:
12703  * @connection: A #GDBusConnection.
12704  * @message: A #GDBusMessage
12705  * @flags: Flags affecting how the message is sent.
12706  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
12707  * @error: Return location for error or %NULL.
12708  *
12709  * Asynchronously sends @message to the peer represented by @connection.
12710  *
12711  * Unless @flags contain the
12712  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
12713  * will be assigned by @connection and set on @message via
12714  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
12715  * serial number used will be written to this location prior to
12716  * submitting the message to the underlying transport.
12717  *
12718  * If @connection is closed then the operation will fail with
12719  * %G_IO_ERROR_CLOSED. If @message is not well-formed,
12720  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
12721  *
12722  * See <xref linkend="gdbus-server"/> and <xref
12723  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
12724  * low-level API to send and receive UNIX file descriptors.
12725  *
12726  * Note that @message must be unlocked, unless @flags contain the
12727  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
12728  *
12729  * Returns: %TRUE if the message was well-formed and queued for transmission, %FALSE if @error is set.
12730  * Since: 2.26
12731  */
12732
12733
12734 /**
12735  * g_dbus_connection_send_message_with_reply:
12736  * @connection: A #GDBusConnection.
12737  * @message: A #GDBusMessage.
12738  * @flags: Flags affecting how the message is sent.
12739  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12740  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
12741  * @cancellable: (allow-none): A #GCancellable or %NULL.
12742  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
12743  * @user_data: The data to pass to @callback.
12744  *
12745  * Asynchronously sends @message to the peer represented by @connection.
12746  *
12747  * Unless @flags contain the
12748  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
12749  * will be assigned by @connection and set on @message via
12750  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
12751  * serial number used will be written to this location prior to
12752  * submitting the message to the underlying transport.
12753  *
12754  * If @connection is closed then the operation will fail with
12755  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
12756  * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
12757  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
12758  *
12759  * This is an asynchronous method. When the operation is finished, @callback will be invoked
12760  * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
12761  * of the thread you are calling this method from. You can then call
12762  * g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
12763  * See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
12764  *
12765  * Note that @message must be unlocked, unless @flags contain the
12766  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
12767  *
12768  * See <xref linkend="gdbus-server"/> and <xref
12769  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
12770  * low-level API to send and receive UNIX file descriptors.
12771  *
12772  * Since: 2.26
12773  */
12774
12775
12776 /**
12777  * g_dbus_connection_send_message_with_reply_finish:
12778  * @connection: a #GDBusConnection
12779  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
12780  * @error: Return location for error or %NULL.
12781  *
12782  * Finishes an operation started with g_dbus_connection_send_message_with_reply().
12783  *
12784  * Note that @error is only set if a local in-process error
12785  * occurred. That is to say that the returned #GDBusMessage object may
12786  * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
12787  * g_dbus_message_to_gerror() to transcode this to a #GError.
12788  *
12789  * See <xref linkend="gdbus-server"/> and <xref
12790  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
12791  * low-level API to send and receive UNIX file descriptors.
12792  *
12793  * Returns: (transfer full): A locked #GDBusMessage or %NULL if @error is set.
12794  * Since: 2.26
12795  */
12796
12797
12798 /**
12799  * g_dbus_connection_send_message_with_reply_sync:
12800  * @connection: A #GDBusConnection.
12801  * @message: A #GDBusMessage.
12802  * @flags: Flags affecting how the message is sent.
12803  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
12804  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
12805  * @cancellable: (allow-none): A #GCancellable or %NULL.
12806  * @error: Return location for error or %NULL.
12807  *
12808  * Synchronously sends @message to the peer represented by @connection
12809  * and blocks the calling thread until a reply is received or the
12810  * timeout is reached. See g_dbus_connection_send_message_with_reply()
12811  * for the asynchronous version of this method.
12812  *
12813  * Unless @flags contain the
12814  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
12815  * will be assigned by @connection and set on @message via
12816  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
12817  * serial number used will be written to this location prior to
12818  * submitting the message to the underlying transport.
12819  *
12820  * If @connection is closed then the operation will fail with
12821  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
12822  * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
12823  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
12824  *
12825  * Note that @error is only set if a local in-process error
12826  * occurred. That is to say that the returned #GDBusMessage object may
12827  * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
12828  * g_dbus_message_to_gerror() to transcode this to a #GError.
12829  *
12830  * See <xref linkend="gdbus-server"/> and <xref
12831  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
12832  * low-level API to send and receive UNIX file descriptors.
12833  *
12834  * Note that @message must be unlocked, unless @flags contain the
12835  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
12836  *
12837  * Returns: (transfer full): A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
12838  * Since: 2.26
12839  */
12840
12841
12842 /**
12843  * g_dbus_connection_set_exit_on_close:
12844  * @connection: A #GDBusConnection.
12845  * @exit_on_close: Whether the process should be terminated when @connection is closed by the remote peer.
12846  *
12847  * Sets whether the process should be terminated when @connection is
12848  * closed by the remote peer. See #GDBusConnection:exit-on-close for
12849  * more details.
12850  *
12851  * Note that this function should be used with care. Most modern UNIX
12852  * desktops tie the notion of a user session the session bus, and expect
12853  * all of a users applications to quit when their bus connection goes away.
12854  * If you are setting @exit_on_close to %FALSE for the shared session
12855  * bus connection, you should make sure that your application exits
12856  * when the user session ends.
12857  *
12858  * Since: 2.26
12859  */
12860
12861
12862 /**
12863  * g_dbus_connection_signal_subscribe:
12864  * @connection: A #GDBusConnection.
12865  * @sender: (allow-none): Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
12866  * @interface_name: (allow-none): D-Bus interface name to match on or %NULL to match on all interfaces.
12867  * @member: (allow-none): D-Bus signal name to match on or %NULL to match on all signals.
12868  * @object_path: (allow-none): Object path to match on or %NULL to match on all object paths.
12869  * @arg0: (allow-none): Contents of first string argument to match on or %NULL to match on all kinds of arguments.
12870  * @flags: Flags describing how to subscribe to the signal (currently unused).
12871  * @callback: Callback to invoke when there is a signal matching the requested data.
12872  * @user_data: User data to pass to @callback.
12873  * @user_data_free_func: (allow-none): Function to free @user_data with when subscription is removed or %NULL.
12874  *
12875  * Subscribes to signals on @connection and invokes @callback with a
12876  * whenever the signal is received. Note that @callback
12877  * will be invoked in the <link
12878  * linkend="g-main-context-push-thread-default">thread-default main
12879  * loop</link> of the thread you are calling this method from.
12880  *
12881  * If @connection is not a message bus connection, @sender must be
12882  * %NULL.
12883  *
12884  * If @sender is a well-known name note that @callback is invoked with
12885  * the unique name for the owner of @sender, not the well-known name
12886  * as one would expect. This is because the message bus rewrites the
12887  * name. As such, to avoid certain race conditions, users should be
12888  * tracking the name owner of the well-known name and use that when
12889  * processing the received signal.
12890  *
12891  * Returns: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
12892  * Since: 2.26
12893  */
12894
12895
12896 /**
12897  * g_dbus_connection_signal_unsubscribe:
12898  * @connection: A #GDBusConnection.
12899  * @subscription_id: A subscription id obtained from g_dbus_connection_signal_subscribe().
12900  *
12901  * Unsubscribes from signals.
12902  *
12903  * Since: 2.26
12904  */
12905
12906
12907 /**
12908  * g_dbus_connection_start_message_processing:
12909  * @connection: A #GDBusConnection.
12910  *
12911  * If @connection was created with
12912  * %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
12913  * starts processing messages. Does nothing on if @connection wasn't
12914  * created with this flag or if the method has already been called.
12915  *
12916  * Since: 2.26
12917  */
12918
12919
12920 /**
12921  * g_dbus_connection_unexport_action_group:
12922  * @connection: a #GDBusConnection
12923  * @export_id: the ID from g_dbus_connection_export_action_group()
12924  *
12925  * Reverses the effect of a previous call to
12926  * g_dbus_connection_export_action_group().
12927  *
12928  * It is an error to call this function with an ID that wasn't returned
12929  * from g_dbus_connection_export_action_group() or to call it with the
12930  * same ID more than once.
12931  *
12932  * Since: 2.32
12933  */
12934
12935
12936 /**
12937  * g_dbus_connection_unexport_menu_model:
12938  * @connection: a #GDBusConnection
12939  * @export_id: the ID from g_dbus_connection_export_menu_model()
12940  *
12941  * Reverses the effect of a previous call to
12942  * g_dbus_connection_export_menu_model().
12943  *
12944  * It is an error to call this function with an ID that wasn't returned
12945  * from g_dbus_connection_export_menu_model() or to call it with the
12946  * same ID more than once.
12947  *
12948  * Since: 2.32
12949  */
12950
12951
12952 /**
12953  * g_dbus_connection_unregister_object:
12954  * @connection: A #GDBusConnection.
12955  * @registration_id: A registration id obtained from g_dbus_connection_register_object().
12956  *
12957  * Unregisters an object.
12958  *
12959  * Returns: %TRUE if the object was unregistered, %FALSE otherwise.
12960  * Since: 2.26
12961  */
12962
12963
12964 /**
12965  * g_dbus_connection_unregister_subtree:
12966  * @connection: A #GDBusConnection.
12967  * @registration_id: A subtree registration id obtained from g_dbus_connection_register_subtree().
12968  *
12969  * Unregisters a subtree.
12970  *
12971  * Returns: %TRUE if the subtree was unregistered, %FALSE otherwise.
12972  * Since: 2.26
12973  */
12974
12975
12976 /**
12977  * g_dbus_error_encode_gerror:
12978  * @error: A #GError.
12979  *
12980  * Creates a D-Bus error name to use for @error. If @error matches
12981  * a registered error (cf. g_dbus_error_register_error()), the corresponding
12982  * D-Bus error name will be returned.
12983  *
12984  * Otherwise the a name of the form
12985  * <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
12986  * will be used. This allows other GDBus applications to map the error
12987  * on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
12988  *
12989  * This function is typically only used in object mappings to put a
12990  * #GError on the wire. Regular applications should not use it.
12991  *
12992  * Returns: A D-Bus error name (never %NULL). Free with g_free().
12993  * Since: 2.26
12994  */
12995
12996
12997 /**
12998  * g_dbus_error_get_remote_error:
12999  * @error: A #GError.
13000  *
13001  * Gets the D-Bus error name used for @error, if any.
13002  *
13003  * This function is guaranteed to return a D-Bus error name for all
13004  * #GError<!-- -->s returned from functions handling remote method
13005  * calls (e.g. g_dbus_connection_call_finish()) unless
13006  * g_dbus_error_strip_remote_error() has been used on @error.
13007  *
13008  * Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
13009  * Since: 2.26
13010  */
13011
13012
13013 /**
13014  * g_dbus_error_is_remote_error:
13015  * @error: A #GError.
13016  *
13017  * Checks if @error represents an error received via D-Bus from a remote peer. If so,
13018  * use g_dbus_error_get_remote_error() to get the name of the error.
13019  *
13020  * Returns: %TRUE if @error represents an error from a remote peer, %FALSE otherwise.
13021  * Since: 2.26
13022  */
13023
13024
13025 /**
13026  * g_dbus_error_new_for_dbus_error:
13027  * @dbus_error_name: D-Bus error name.
13028  * @dbus_error_message: D-Bus error message.
13029  *
13030  * Creates a #GError based on the contents of @dbus_error_name and
13031  * @dbus_error_message.
13032  *
13033  * Errors registered with g_dbus_error_register_error() will be looked
13034  * up using @dbus_error_name and if a match is found, the error domain
13035  * and code is used. Applications can use g_dbus_error_get_remote_error()
13036  * to recover @dbus_error_name.
13037  *
13038  * If a match against a registered error is not found and the D-Bus
13039  * error name is in a form as returned by g_dbus_error_encode_gerror()
13040  * the error domain and code encoded in the name is used to
13041  * create the #GError. Also, @dbus_error_name is added to the error message
13042  * such that it can be recovered with g_dbus_error_get_remote_error().
13043  *
13044  * Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
13045  * in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
13046  * added to the error message such that it can be recovered with
13047  * g_dbus_error_get_remote_error().
13048  *
13049  * In all three cases, @dbus_error_name can always be recovered from the
13050  * returned #GError using the g_dbus_error_get_remote_error() function
13051  * (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
13052  *
13053  * This function is typically only used in object mappings to prepare
13054  * #GError instances for applications. Regular applications should not use
13055  * it.
13056  *
13057  * Returns: An allocated #GError. Free with g_error_free().
13058  * Since: 2.26
13059  */
13060
13061
13062 /**
13063  * g_dbus_error_register_error:
13064  * @error_domain: A #GQuark for a error domain.
13065  * @error_code: An error code.
13066  * @dbus_error_name: A D-Bus error name.
13067  *
13068  * Creates an association to map between @dbus_error_name and
13069  * #GError<!-- -->s specified by @error_domain and @error_code.
13070  *
13071  * This is typically done in the routine that returns the #GQuark for
13072  * an error domain.
13073  *
13074  * Returns: %TRUE if the association was created, %FALSE if it already exists.
13075  * Since: 2.26
13076  */
13077
13078
13079 /**
13080  * g_dbus_error_register_error_domain:
13081  * @error_domain_quark_name: The error domain name.
13082  * @quark_volatile: A pointer where to store the #GQuark.
13083  * @entries: A pointer to @num_entries #GDBusErrorEntry struct items.
13084  * @num_entries: Number of items to register.
13085  *
13086  * Helper function for associating a #GError error domain with D-Bus error names.
13087  *
13088  * Since: 2.26
13089  */
13090
13091
13092 /**
13093  * g_dbus_error_set_dbus_error:
13094  * @error: A pointer to a #GError or %NULL.
13095  * @dbus_error_name: D-Bus error name.
13096  * @dbus_error_message: D-Bus error message.
13097  * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13098  * @...: Arguments for @format.
13099  *
13100  * Does nothing if @error is %NULL. Otherwise sets *@error to
13101  * a new #GError created with g_dbus_error_new_for_dbus_error()
13102  * with @dbus_error_message prepend with @format (unless %NULL).
13103  *
13104  * Since: 2.26
13105  */
13106
13107
13108 /**
13109  * g_dbus_error_set_dbus_error_valist:
13110  * @error: A pointer to a #GError or %NULL.
13111  * @dbus_error_name: D-Bus error name.
13112  * @dbus_error_message: D-Bus error message.
13113  * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
13114  * @var_args: Arguments for @format.
13115  *
13116  * Like g_dbus_error_set_dbus_error() but intended for language bindings.
13117  *
13118  * Since: 2.26
13119  */
13120
13121
13122 /**
13123  * g_dbus_error_strip_remote_error:
13124  * @error: A #GError.
13125  *
13126  * Looks for extra information in the error message used to recover
13127  * the D-Bus error name and strips it if found. If stripped, the
13128  * message field in @error will correspond exactly to what was
13129  * received on the wire.
13130  *
13131  * This is typically used when presenting errors to the end user.
13132  *
13133  * Returns: %TRUE if information was stripped, %FALSE otherwise.
13134  * Since: 2.26
13135  */
13136
13137
13138 /**
13139  * g_dbus_error_unregister_error:
13140  * @error_domain: A #GQuark for a error domain.
13141  * @error_code: An error code.
13142  * @dbus_error_name: A D-Bus error name.
13143  *
13144  * Destroys an association previously set up with g_dbus_error_register_error().
13145  *
13146  * Returns: %TRUE if the association was destroyed, %FALSE if it wasn't found.
13147  * Since: 2.26
13148  */
13149
13150
13151 /**
13152  * g_dbus_generate_guid:
13153  *
13154  * Generate a D-Bus GUID that can be used with
13155  * e.g. g_dbus_connection_new().
13156  *
13157  * See the D-Bus specification regarding what strings are valid D-Bus
13158  * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
13159  *
13160  * Returns: A valid D-Bus GUID. Free with g_free().
13161  * Since: 2.26
13162  */
13163
13164
13165 /**
13166  * g_dbus_gvalue_to_gvariant:
13167  * @gvalue: A #GValue to convert to a #GVariant.
13168  * @type: A #GVariantType.
13169  *
13170  * Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
13171  *
13172  * The conversion is using the following rules:
13173  * <table frame='all'>
13174  *   <title>#GValue / #GVariant conversion rules</title>
13175  *   <tgroup cols='2' align='left' colsep='1' rowsep='1'>
13176  *     <thead>
13177  *       <row>
13178  *         <entry>If the #GType for @gvalue is...</entry>
13179  *         <entry>... then @type must be</entry>
13180  *       </row>
13181  *     </thead>
13182  *     <tbody>
13183  *       <row>
13184  *         <entry>#G_TYPE_STRING</entry>
13185  *         <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>
13186  *       </row>
13187  *       <row>
13188  *         <entry>#G_TYPE_STRV</entry>
13189  *         <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>
13190  *       </row>
13191  *       <row>
13192  *         <entry>#G_TYPE_BOOLEAN</entry>
13193  *         <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
13194  *       </row>
13195  *       <row>
13196  *         <entry>#G_TYPE_UCHAR</entry>
13197  *         <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
13198  *       </row>
13199  *       <row>
13200  *         <entry>#G_TYPE_INT</entry>
13201  *         <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
13202  *       </row>
13203  *       <row>
13204  *         <entry>#G_TYPE_UINT</entry>
13205  *         <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
13206  *       </row>
13207  *       <row>
13208  *         <entry>#G_TYPE_INT64</entry>
13209  *         <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
13210  *       </row>
13211  *       <row>
13212  *         <entry>#G_TYPE_UINT64</entry>
13213  *         <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
13214  *       </row>
13215  *       <row>
13216  *         <entry>#G_TYPE_DOUBLE</entry>
13217  *         <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
13218  *       </row>
13219  *       <row>
13220  *         <entry>#G_TYPE_VARIANT</entry>
13221  *         <entry>Any #GVariantType</entry>
13222  *       </row>
13223  *     </tbody>
13224  *   </tgroup>
13225  * </table>
13226  * This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
13227  * is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
13228  * also fail for any #GType (including e.g. #G_TYPE_OBJECT and
13229  * #G_TYPE_BOXED derived-types) not in the table above.
13230  *
13231  * Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
13232  * %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
13233  * %NULL) for @type is returned (e.g. 0 for scalar types, the empty
13234  * string for string types, <literal>'/'</literal> for object path
13235  * types, the empty array for any array type and so on).
13236  *
13237  * See the g_dbus_gvariant_to_gvalue() function for how to convert a
13238  * #GVariant to a #GValue.
13239  *
13240  * Returns: A #GVariant (never floating) of #GVariantType @type holding the data from @gvalue or %NULL in case of failure. Free with g_variant_unref().
13241  * Since: 2.30
13242  */
13243
13244
13245 /**
13246  * g_dbus_gvariant_to_gvalue:
13247  * @value: A #GVariant.
13248  * @out_gvalue: (out): Return location pointing to a zero-filled (uninitialized) #GValue.
13249  *
13250  * Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
13251  *
13252  * The rules specified in the g_dbus_gvalue_to_gvariant() function are
13253  * used - this function is essentially its reverse form.
13254  *
13255  * The conversion never fails - a valid #GValue is always returned in
13256  * @out_gvalue.
13257  *
13258  * Since: 2.30
13259  */
13260
13261
13262 /**
13263  * g_dbus_interface_dup_object:
13264  * @interface_: An exported D-Bus interface.
13265  *
13266  * Gets the #GDBusObject that @interface_ belongs to, if any.
13267  *
13268  * Returns: (transfer full): A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
13269  * Since: 2.32
13270  * Rename to: g_dbus_interface_get_object
13271  */
13272
13273
13274 /**
13275  * g_dbus_interface_get_info:
13276  * @interface_: An exported D-Bus interface.
13277  *
13278  * Gets D-Bus introspection information for the D-Bus interface
13279  * implemented by @interface_.
13280  *
13281  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
13282  * Since: 2.30
13283  */
13284
13285
13286 /**
13287  * g_dbus_interface_get_object: (skip)
13288  * @interface_: An exported D-Bus interface.
13289  *
13290  * Gets the #GDBusObject that @interface_ belongs to, if any.
13291  *
13292  * <warning>It is not safe to use the returned object if @interface_
13293  * or the returned object is being used from other threads. See
13294  * g_dbus_interface_dup_object() for a thread-safe
13295  * alternative.</warning>
13296  *
13297  * Returns: (transfer none): A #GDBusObject or %NULL. The returned reference belongs to @interface_ and should not be freed.
13298  * Since: 2.30
13299  */
13300
13301
13302 /**
13303  * g_dbus_interface_info_cache_build:
13304  * @info: A #GDBusInterfaceInfo.
13305  *
13306  * Builds a lookup-cache to speed up
13307  * g_dbus_interface_info_lookup_method(),
13308  * g_dbus_interface_info_lookup_signal() and
13309  * g_dbus_interface_info_lookup_property().
13310  *
13311  * If this has already been called with @info, the existing cache is
13312  * used and its use count is increased.
13313  *
13314  * Note that @info cannot be modified until
13315  * g_dbus_interface_info_cache_release() is called.
13316  *
13317  * Since: 2.30
13318  */
13319
13320
13321 /**
13322  * g_dbus_interface_info_cache_release:
13323  * @info: A GDBusInterfaceInfo
13324  *
13325  * Decrements the usage count for the cache for @info built by
13326  * g_dbus_interface_info_cache_build() (if any) and frees the
13327  * resources used by the cache if the usage count drops to zero.
13328  *
13329  * Since: 2.30
13330  */
13331
13332
13333 /**
13334  * g_dbus_interface_info_generate_xml:
13335  * @info: A #GDBusNodeInfo
13336  * @indent: Indentation level.
13337  * @string_builder: (out): A #GString to to append XML data to.
13338  *
13339  * Appends an XML representation of @info (and its children) to @string_builder.
13340  *
13341  * This function is typically used for generating introspection XML
13342  * documents at run-time for handling the
13343  * <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
13344  * method.
13345  *
13346  * Since: 2.26
13347  */
13348
13349
13350 /**
13351  * g_dbus_interface_info_lookup_method:
13352  * @info: A #GDBusInterfaceInfo.
13353  * @name: A D-Bus method name (typically in CamelCase)
13354  *
13355  * Looks up information about a method.
13356  *
13357  * The cost of this function is O(n) in number of methods unless
13358  * g_dbus_interface_info_cache_build() has been used on @info.
13359  *
13360  * Returns: (transfer none): A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
13361  * Since: 2.26
13362  */
13363
13364
13365 /**
13366  * g_dbus_interface_info_lookup_property:
13367  * @info: A #GDBusInterfaceInfo.
13368  * @name: A D-Bus property name (typically in CamelCase).
13369  *
13370  * Looks up information about a property.
13371  *
13372  * The cost of this function is O(n) in number of properties unless
13373  * g_dbus_interface_info_cache_build() has been used on @info.
13374  *
13375  * Returns: (transfer none): A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
13376  * Since: 2.26
13377  */
13378
13379
13380 /**
13381  * g_dbus_interface_info_lookup_signal:
13382  * @info: A #GDBusInterfaceInfo.
13383  * @name: A D-Bus signal name (typically in CamelCase)
13384  *
13385  * Looks up information about a signal.
13386  *
13387  * The cost of this function is O(n) in number of signals unless
13388  * g_dbus_interface_info_cache_build() has been used on @info.
13389  *
13390  * Returns: (transfer none): A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
13391  * Since: 2.26
13392  */
13393
13394
13395 /**
13396  * g_dbus_interface_info_ref:
13397  * @info: A #GDBusInterfaceInfo
13398  *
13399  * If @info is statically allocated does nothing. Otherwise increases
13400  * the reference count.
13401  *
13402  * Returns: The same @info.
13403  * Since: 2.26
13404  */
13405
13406
13407 /**
13408  * g_dbus_interface_info_unref:
13409  * @info: A #GDBusInterfaceInfo.
13410  *
13411  * If @info is statically allocated, does nothing. Otherwise decreases
13412  * the reference count of @info. When its reference count drops to 0,
13413  * the memory used is freed.
13414  *
13415  * Since: 2.26
13416  */
13417
13418
13419 /**
13420  * g_dbus_interface_set_object:
13421  * @interface_: An exported D-Bus interface.
13422  * @object: (allow-none): A #GDBusObject or %NULL.
13423  *
13424  * Sets the #GDBusObject for @interface_ to @object.
13425  *
13426  * Note that @interface_ will hold a weak reference to @object.
13427  *
13428  * Since: 2.30
13429  */
13430
13431
13432 /**
13433  * g_dbus_interface_skeleton_export:
13434  * @interface_: The D-Bus interface to export.
13435  * @connection: A #GDBusConnection to export @interface_ on.
13436  * @object_path: The path to export the interface at.
13437  * @error: Return location for error or %NULL.
13438  *
13439  * Exports @interface_ at @object_path on @connection.
13440  *
13441  * This can be called multiple times to export the same @interface_
13442  * onto multiple connections however the @object_path provided must be
13443  * the same for all connections.
13444  *
13445  * Use g_dbus_interface_skeleton_unexport() to unexport the object.
13446  *
13447  * Returns: %TRUE if the interface was exported on @connection, otherwise %FALSE with @error set.
13448  * Since: 2.30
13449  */
13450
13451
13452 /**
13453  * g_dbus_interface_skeleton_flush:
13454  * @interface_: A #GDBusInterfaceSkeleton.
13455  *
13456  * If @interface_ has outstanding changes, request for these changes to be
13457  * emitted immediately.
13458  *
13459  * For example, an exported D-Bus interface may queue up property
13460  * changes and emit the
13461  * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
13462  * signal later (e.g. in an idle handler). This technique is useful
13463  * for collapsing multiple property changes into one.
13464  *
13465  * Since: 2.30
13466  */
13467
13468
13469 /**
13470  * g_dbus_interface_skeleton_get_connection:
13471  * @interface_: A #GDBusInterfaceSkeleton.
13472  *
13473  * Gets the first connection that @interface_ is exported on, if any.
13474  *
13475  * Returns: (transfer none): A #GDBusConnection or %NULL if @interface_ is not exported anywhere. Do not free, the object belongs to @interface_.
13476  * Since: 2.30
13477  */
13478
13479
13480 /**
13481  * g_dbus_interface_skeleton_get_connections:
13482  * @interface_: A #GDBusInterfaceSkeleton.
13483  *
13484  * Gets a list of the connections that @interface_ is exported on.
13485  *
13486  * 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().
13487  * Since: 2.32
13488  */
13489
13490
13491 /**
13492  * g_dbus_interface_skeleton_get_flags:
13493  * @interface_: A #GDBusInterfaceSkeleton.
13494  *
13495  * Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
13496  * of @interface_
13497  *
13498  * Returns: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
13499  * Since: 2.30
13500  */
13501
13502
13503 /**
13504  * g_dbus_interface_skeleton_get_info:
13505  * @interface_: A #GDBusInterfaceSkeleton.
13506  *
13507  * Gets D-Bus introspection information for the D-Bus interface
13508  * implemented by @interface_.
13509  *
13510  * Returns: (transfer none): A #GDBusInterfaceInfo (never %NULL). Do not free.
13511  * Since: 2.30
13512  */
13513
13514
13515 /**
13516  * g_dbus_interface_skeleton_get_object_path:
13517  * @interface_: A #GDBusInterfaceSkeleton.
13518  *
13519  * Gets the object path that @interface_ is exported on, if any.
13520  *
13521  * Returns: A string owned by @interface_ or %NULL if @interface_ is not exported anywhere. Do not free, the string belongs to @interface_.
13522  * Since: 2.30
13523  */
13524
13525
13526 /**
13527  * g_dbus_interface_skeleton_get_properties:
13528  * @interface_: A #GDBusInterfaceSkeleton.
13529  *
13530  * Gets all D-Bus properties for @interface_.
13531  *
13532  * Returns: (transfer full): A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
13533  * Since: 2.30
13534  */
13535
13536
13537 /**
13538  * g_dbus_interface_skeleton_get_vtable: (skip)
13539  * @interface_: A #GDBusInterfaceSkeleton.
13540  *
13541  * Gets the interface vtable for the D-Bus interface implemented by
13542  * @interface_. The returned function pointers should expect @interface_
13543  * itself to be passed as @user_data.
13544  *
13545  * Returns: A #GDBusInterfaceVTable (never %NULL).
13546  * Since: 2.30
13547  */
13548
13549
13550 /**
13551  * g_dbus_interface_skeleton_has_connection:
13552  * @interface_: A #GDBusInterfaceSkeleton.
13553  * @connection: A #GDBusConnection.
13554  *
13555  * Checks if @interface_ is exported on @connection.
13556  *
13557  * Returns: %TRUE if @interface_ is exported on @connection, %FALSE otherwise.
13558  * Since: 2.32
13559  */
13560
13561
13562 /**
13563  * g_dbus_interface_skeleton_set_flags:
13564  * @interface_: A #GDBusInterfaceSkeleton.
13565  * @flags: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
13566  *
13567  * Sets flags describing what the behavior of @skeleton should be.
13568  *
13569  * Since: 2.30
13570  */
13571
13572
13573 /**
13574  * g_dbus_interface_skeleton_unexport:
13575  * @interface_: A #GDBusInterfaceSkeleton.
13576  *
13577  * Stops exporting @interface_ on all connections it is exported on.
13578  *
13579  * To unexport @interface_ from only a single connection, use
13580  * g_dbus_interface_skeleton_unexport_from_connection()
13581  *
13582  * Since: 2.30
13583  */
13584
13585
13586 /**
13587  * g_dbus_interface_skeleton_unexport_from_connection:
13588  * @interface_: A #GDBusInterfaceSkeleton.
13589  * @connection: A #GDBusConnection.
13590  *
13591  * Stops exporting @interface_ on @connection.
13592  *
13593  * To stop exporting on all connections the interface is exported on,
13594  * use g_dbus_interface_skeleton_unexport().
13595  *
13596  * Since: 2.32
13597  */
13598
13599
13600 /**
13601  * g_dbus_is_address:
13602  * @string: A string.
13603  *
13604  * Checks if @string is a D-Bus address.
13605  *
13606  * This doesn't check if @string is actually supported by #GDBusServer
13607  * or #GDBusConnection - use g_dbus_is_supported_address() to do more
13608  * checks.
13609  *
13610  * Returns: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
13611  * Since: 2.26
13612  */
13613
13614
13615 /**
13616  * g_dbus_is_guid:
13617  * @string: The string to check.
13618  *
13619  * Checks if @string is a D-Bus GUID.
13620  *
13621  * See the D-Bus specification regarding what strings are valid D-Bus
13622  * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
13623  *
13624  * Returns: %TRUE if @string is a guid, %FALSE otherwise.
13625  * Since: 2.26
13626  */
13627
13628
13629 /**
13630  * g_dbus_is_interface_name:
13631  * @string: The string to check.
13632  *
13633  * Checks if @string is a valid D-Bus interface name.
13634  *
13635  * Returns: %TRUE if valid, %FALSE otherwise.
13636  * Since: 2.26
13637  */
13638
13639
13640 /**
13641  * g_dbus_is_member_name:
13642  * @string: The string to check.
13643  *
13644  * Checks if @string is a valid D-Bus member (e.g. signal or method) name.
13645  *
13646  * Returns: %TRUE if valid, %FALSE otherwise.
13647  * Since: 2.26
13648  */
13649
13650
13651 /**
13652  * g_dbus_is_name:
13653  * @string: The string to check.
13654  *
13655  * Checks if @string is a valid D-Bus bus name (either unique or well-known).
13656  *
13657  * Returns: %TRUE if valid, %FALSE otherwise.
13658  * Since: 2.26
13659  */
13660
13661
13662 /**
13663  * g_dbus_is_supported_address:
13664  * @string: A string.
13665  * @error: Return location for error or %NULL.
13666  *
13667  * Like g_dbus_is_address() but also checks if the library suppors the
13668  * transports in @string and that key/value pairs for each transport
13669  * are valid.
13670  *
13671  * Returns: %TRUE if @string is a valid D-Bus address that is supported by this library, %FALSE if @error is set.
13672  * Since: 2.26
13673  */
13674
13675
13676 /**
13677  * g_dbus_is_unique_name:
13678  * @string: The string to check.
13679  *
13680  * Checks if @string is a valid D-Bus unique bus name.
13681  *
13682  * Returns: %TRUE if valid, %FALSE otherwise.
13683  * Since: 2.26
13684  */
13685
13686
13687 /**
13688  * g_dbus_menu_model_get:
13689  * @connection: a #GDBusConnection
13690  * @bus_name: the bus name which exports the menu model
13691  * @object_path: the object path at which the menu model is exported
13692  *
13693  * Obtains a #GDBusMenuModel for the menu model which is exported
13694  * at the given @bus_name and @object_path.
13695  *
13696  * The thread default main context is taken at the time of this call.
13697  * All signals on the menu model (and any linked models) are reported
13698  * with respect to this context.  All calls on the returned menu model
13699  * (and linked models) must also originate from this same context, with
13700  * the thread default main context unchanged.
13701  *
13702  * Returns: (transfer full): a #GDBusMenuModel object. Free with g_object_unref().
13703  * Since: 2.32
13704  */
13705
13706
13707 /**
13708  * g_dbus_message_bytes_needed:
13709  * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
13710  * @blob_len: The length of @blob (must be at least 16).
13711  * @error: Return location for error or %NULL.
13712  *
13713  * Utility function to calculate how many bytes are needed to
13714  * completely deserialize the D-Bus message stored at @blob.
13715  *
13716  * 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).
13717  * Since: 2.26
13718  */
13719
13720
13721 /**
13722  * g_dbus_message_copy:
13723  * @message: A #GDBusMessage.
13724  * @error: Return location for error or %NULL.
13725  *
13726  * Copies @message. The copy is a deep copy and the returned
13727  * #GDBusMessage is completely identical except that it is guaranteed
13728  * to not be locked.
13729  *
13730  * This operation can fail if e.g. @message contains file descriptors
13731  * and the per-process or system-wide open files limit is reached.
13732  *
13733  * Returns: (transfer full): A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
13734  * Since: 2.26
13735  */
13736
13737
13738 /**
13739  * g_dbus_message_get_arg0:
13740  * @message: A #GDBusMessage.
13741  *
13742  * Convenience to get the first item in the body of @message.
13743  *
13744  * Returns: The string item or %NULL if the first item in the body of @message is not a string.
13745  * Since: 2.26
13746  */
13747
13748
13749 /**
13750  * g_dbus_message_get_body:
13751  * @message: A #GDBusMessage.
13752  *
13753  * Gets the body of a message.
13754  *
13755  * Returns: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
13756  * Since: 2.26
13757  */
13758
13759
13760 /**
13761  * g_dbus_message_get_byte_order:
13762  * @message: A #GDBusMessage.
13763  *
13764  * Gets the byte order of @message.
13765  *
13766  * Returns: The byte order.
13767  */
13768
13769
13770 /**
13771  * g_dbus_message_get_destination:
13772  * @message: A #GDBusMessage.
13773  *
13774  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
13775  *
13776  * Returns: The value.
13777  * Since: 2.26
13778  */
13779
13780
13781 /**
13782  * g_dbus_message_get_error_name:
13783  * @message: A #GDBusMessage.
13784  *
13785  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
13786  *
13787  * Returns: The value.
13788  * Since: 2.26
13789  */
13790
13791
13792 /**
13793  * g_dbus_message_get_flags:
13794  * @message: A #GDBusMessage.
13795  *
13796  * Gets the flags for @message.
13797  *
13798  * Returns: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
13799  * Since: 2.26
13800  */
13801
13802
13803 /**
13804  * g_dbus_message_get_header:
13805  * @message: A #GDBusMessage.
13806  * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
13807  *
13808  * Gets a header field on @message.
13809  *
13810  * Returns: A #GVariant with the value if the header was found, %NULL otherwise. Do not free, it is owned by @message.
13811  * Since: 2.26
13812  */
13813
13814
13815 /**
13816  * g_dbus_message_get_header_fields:
13817  * @message: A #GDBusMessage.
13818  *
13819  * Gets an array of all header fields on @message that are set.
13820  *
13821  * 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().
13822  * Since: 2.26
13823  */
13824
13825
13826 /**
13827  * g_dbus_message_get_interface:
13828  * @message: A #GDBusMessage.
13829  *
13830  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
13831  *
13832  * Returns: The value.
13833  * Since: 2.26
13834  */
13835
13836
13837 /**
13838  * g_dbus_message_get_locked:
13839  * @message: A #GDBusMessage.
13840  *
13841  * Checks whether @message is locked. To monitor changes to this
13842  * value, conncet to the #GObject::notify signal to listen for changes
13843  * on the #GDBusMessage:locked property.
13844  *
13845  * Returns: %TRUE if @message is locked, %FALSE otherwise.
13846  * Since: 2.26
13847  */
13848
13849
13850 /**
13851  * g_dbus_message_get_member:
13852  * @message: A #GDBusMessage.
13853  *
13854  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
13855  *
13856  * Returns: The value.
13857  * Since: 2.26
13858  */
13859
13860
13861 /**
13862  * g_dbus_message_get_message_type:
13863  * @message: A #GDBusMessage.
13864  *
13865  * Gets the type of @message.
13866  *
13867  * Returns: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
13868  * Since: 2.26
13869  */
13870
13871
13872 /**
13873  * g_dbus_message_get_num_unix_fds:
13874  * @message: A #GDBusMessage.
13875  *
13876  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
13877  *
13878  * Returns: The value.
13879  * Since: 2.26
13880  */
13881
13882
13883 /**
13884  * g_dbus_message_get_path:
13885  * @message: A #GDBusMessage.
13886  *
13887  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
13888  *
13889  * Returns: The value.
13890  * Since: 2.26
13891  */
13892
13893
13894 /**
13895  * g_dbus_message_get_reply_serial:
13896  * @message: A #GDBusMessage.
13897  *
13898  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
13899  *
13900  * Returns: The value.
13901  * Since: 2.26
13902  */
13903
13904
13905 /**
13906  * g_dbus_message_get_sender:
13907  * @message: A #GDBusMessage.
13908  *
13909  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
13910  *
13911  * Returns: The value.
13912  * Since: 2.26
13913  */
13914
13915
13916 /**
13917  * g_dbus_message_get_serial:
13918  * @message: A #GDBusMessage.
13919  *
13920  * Gets the serial for @message.
13921  *
13922  * Returns: A #guint32.
13923  * Since: 2.26
13924  */
13925
13926
13927 /**
13928  * g_dbus_message_get_signature:
13929  * @message: A #GDBusMessage.
13930  *
13931  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
13932  *
13933  * Returns: The value.
13934  * Since: 2.26
13935  */
13936
13937
13938 /**
13939  * g_dbus_message_get_unix_fd_list:
13940  * @message: A #GDBusMessage.
13941  *
13942  * Gets the UNIX file descriptors associated with @message, if any.
13943  *
13944  * This method is only available on UNIX.
13945  *
13946  * Returns: (transfer none): A #GUnixFDList or %NULL if no file descriptors are associated. Do not free, this object is owned by @message.
13947  * Since: 2.26
13948  */
13949
13950
13951 /**
13952  * g_dbus_message_lock:
13953  * @message: A #GDBusMessage.
13954  *
13955  * If @message is locked, does nothing. Otherwise locks the message.
13956  *
13957  * Since: 2.26
13958  */
13959
13960
13961 /**
13962  * g_dbus_message_new:
13963  *
13964  * Creates a new empty #GDBusMessage.
13965  *
13966  * Returns: A #GDBusMessage. Free with g_object_unref().
13967  * Since: 2.26
13968  */
13969
13970
13971 /**
13972  * g_dbus_message_new_from_blob:
13973  * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
13974  * @blob_len: The length of @blob.
13975  * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
13976  * @error: Return location for error or %NULL.
13977  *
13978  * Creates a new #GDBusMessage from the data stored at @blob. The byte
13979  * order that the message was in can be retrieved using
13980  * g_dbus_message_get_byte_order().
13981  *
13982  * Returns: A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
13983  * Since: 2.26
13984  */
13985
13986
13987 /**
13988  * g_dbus_message_new_method_call:
13989  * @name: (allow-none): A valid D-Bus name or %NULL.
13990  * @path: A valid object path.
13991  * @interface_: (allow-none): A valid D-Bus interface name or %NULL.
13992  * @method: A valid method name.
13993  *
13994  * Creates a new #GDBusMessage for a method call.
13995  *
13996  * Returns: A #GDBusMessage. Free with g_object_unref().
13997  * Since: 2.26
13998  */
13999
14000
14001 /**
14002  * g_dbus_message_new_method_error:
14003  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14004  * @error_name: A valid D-Bus error name.
14005  * @error_message_format: The D-Bus error message in a printf() format.
14006  * @...: Arguments for @error_message_format.
14007  *
14008  * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14009  *
14010  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14011  * Since: 2.26
14012  */
14013
14014
14015 /**
14016  * g_dbus_message_new_method_error_literal:
14017  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14018  * @error_name: A valid D-Bus error name.
14019  * @error_message: The D-Bus error message.
14020  *
14021  * Creates a new #GDBusMessage that is an error reply to @method_call_message.
14022  *
14023  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14024  * Since: 2.26
14025  */
14026
14027
14028 /**
14029  * g_dbus_message_new_method_error_valist:
14030  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14031  * @error_name: A valid D-Bus error name.
14032  * @error_message_format: The D-Bus error message in a printf() format.
14033  * @var_args: Arguments for @error_message_format.
14034  *
14035  * Like g_dbus_message_new_method_error() but intended for language bindings.
14036  *
14037  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
14038  * Since: 2.26
14039  */
14040
14041
14042 /**
14043  * g_dbus_message_new_method_reply:
14044  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
14045  *
14046  * Creates a new #GDBusMessage that is a reply to @method_call_message.
14047  *
14048  * Returns: (transfer full): #GDBusMessage. Free with g_object_unref().
14049  * Since: 2.26
14050  */
14051
14052
14053 /**
14054  * g_dbus_message_new_signal:
14055  * @path: A valid object path.
14056  * @interface_: A valid D-Bus interface name.
14057  * @signal: A valid signal name.
14058  *
14059  * Creates a new #GDBusMessage for a signal emission.
14060  *
14061  * Returns: A #GDBusMessage. Free with g_object_unref().
14062  * Since: 2.26
14063  */
14064
14065
14066 /**
14067  * g_dbus_message_print:
14068  * @message: A #GDBusMessage.
14069  * @indent: Indentation level.
14070  *
14071  * Produces a human-readable multi-line description of @message.
14072  *
14073  * The contents of the description has no ABI guarantees, the contents
14074  * and formatting is subject to change at any time. Typical output
14075  * looks something like this:
14076  * <programlisting>
14077  * Type&colon;    method-call
14078  * Flags&colon;   none
14079  * Version&colon; 0
14080  * Serial&colon;  4
14081  * Headers&colon;
14082  *   path -> objectpath '/org/gtk/GDBus/TestObject'
14083  *   interface -> 'org.gtk.GDBus.TestInterface'
14084  *   member -> 'GimmeStdout'
14085  *   destination -> ':1.146'
14086  * Body&colon; ()
14087  * UNIX File Descriptors:
14088  *   (none)
14089  * </programlisting>
14090  * or
14091  * <programlisting>
14092  * Type&colon;    method-return
14093  * Flags&colon;   no-reply-expected
14094  * Version&colon; 0
14095  * Serial&colon;  477
14096  * Headers&colon;
14097  *   reply-serial -> uint32 4
14098  *   destination -> ':1.159'
14099  *   sender -> ':1.146'
14100  *   num-unix-fds -> uint32 1
14101  * Body&colon; ()
14102  * UNIX File Descriptors&colon;
14103  *   fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
14104  * </programlisting>
14105  *
14106  * Returns: A string that should be freed with g_free().
14107  * Since: 2.26
14108  */
14109
14110
14111 /**
14112  * g_dbus_message_set_body:
14113  * @message: A #GDBusMessage.
14114  * @body: Either %NULL or a #GVariant that is a tuple.
14115  *
14116  * Sets the body @message. As a side-effect the
14117  * %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
14118  * type string of @body (or cleared if @body is %NULL).
14119  *
14120  * If @body is floating, @message assumes ownership of @body.
14121  *
14122  * Since: 2.26
14123  */
14124
14125
14126 /**
14127  * g_dbus_message_set_byte_order:
14128  * @message: A #GDBusMessage.
14129  * @byte_order: The byte order.
14130  *
14131  * Sets the byte order of @message.
14132  */
14133
14134
14135 /**
14136  * g_dbus_message_set_destination:
14137  * @message: A #GDBusMessage.
14138  * @value: The value to set.
14139  *
14140  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
14141  *
14142  * Since: 2.26
14143  */
14144
14145
14146 /**
14147  * g_dbus_message_set_error_name:
14148  * @message: A #GDBusMessage.
14149  * @value: The value to set.
14150  *
14151  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
14152  *
14153  * Since: 2.26
14154  */
14155
14156
14157 /**
14158  * g_dbus_message_set_flags:
14159  * @message: A #GDBusMessage.
14160  * @flags: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
14161  *
14162  * Sets the flags to set on @message.
14163  *
14164  * Since: 2.26
14165  */
14166
14167
14168 /**
14169  * g_dbus_message_set_header:
14170  * @message: A #GDBusMessage.
14171  * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
14172  * @value: (allow-none): A #GVariant to set the header field or %NULL to clear the header field.
14173  *
14174  * Sets a header field on @message.
14175  *
14176  * If @value is floating, @message assumes ownership of @value.
14177  *
14178  * Since: 2.26
14179  */
14180
14181
14182 /**
14183  * g_dbus_message_set_interface:
14184  * @message: A #GDBusMessage.
14185  * @value: The value to set.
14186  *
14187  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
14188  *
14189  * Since: 2.26
14190  */
14191
14192
14193 /**
14194  * g_dbus_message_set_member:
14195  * @message: A #GDBusMessage.
14196  * @value: The value to set.
14197  *
14198  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
14199  *
14200  * Since: 2.26
14201  */
14202
14203
14204 /**
14205  * g_dbus_message_set_message_type:
14206  * @message: A #GDBusMessage.
14207  * @type: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
14208  *
14209  * Sets @message to be of @type.
14210  *
14211  * Since: 2.26
14212  */
14213
14214
14215 /**
14216  * g_dbus_message_set_num_unix_fds:
14217  * @message: A #GDBusMessage.
14218  * @value: The value to set.
14219  *
14220  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
14221  *
14222  * Since: 2.26
14223  */
14224
14225
14226 /**
14227  * g_dbus_message_set_path:
14228  * @message: A #GDBusMessage.
14229  * @value: The value to set.
14230  *
14231  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
14232  *
14233  * Since: 2.26
14234  */
14235
14236
14237 /**
14238  * g_dbus_message_set_reply_serial:
14239  * @message: A #GDBusMessage.
14240  * @value: The value to set.
14241  *
14242  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
14243  *
14244  * Since: 2.26
14245  */
14246
14247
14248 /**
14249  * g_dbus_message_set_sender:
14250  * @message: A #GDBusMessage.
14251  * @value: The value to set.
14252  *
14253  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
14254  *
14255  * Since: 2.26
14256  */
14257
14258
14259 /**
14260  * g_dbus_message_set_serial:
14261  * @message: A #GDBusMessage.
14262  * @serial: A #guint32.
14263  *
14264  * Sets the serial for @message.
14265  *
14266  * Since: 2.26
14267  */
14268
14269
14270 /**
14271  * g_dbus_message_set_signature:
14272  * @message: A #GDBusMessage.
14273  * @value: The value to set.
14274  *
14275  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
14276  *
14277  * Since: 2.26
14278  */
14279
14280
14281 /**
14282  * g_dbus_message_set_unix_fd_list:
14283  * @message: A #GDBusMessage.
14284  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
14285  *
14286  * Sets the UNIX file descriptors associated with @message. As a
14287  * side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
14288  * field is set to the number of fds in @fd_list (or cleared if
14289  * @fd_list is %NULL).
14290  *
14291  * This method is only available on UNIX.
14292  *
14293  * Since: 2.26
14294  */
14295
14296
14297 /**
14298  * g_dbus_message_to_blob:
14299  * @message: A #GDBusMessage.
14300  * @out_size: Return location for size of generated blob.
14301  * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
14302  * @error: Return location for error.
14303  *
14304  * Serializes @message to a blob. The byte order returned by
14305  * g_dbus_message_get_byte_order() will be used.
14306  *
14307  * 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().
14308  * Since: 2.26
14309  */
14310
14311
14312 /**
14313  * g_dbus_message_to_gerror:
14314  * @message: A #GDBusMessage.
14315  * @error: The #GError to set.
14316  *
14317  * If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
14318  * nothing and returns %FALSE.
14319  *
14320  * Otherwise this method encodes the error in @message as a #GError
14321  * using g_dbus_error_set_dbus_error() using the information in the
14322  * %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
14323  * well as the first string item in @message's body.
14324  *
14325  * Returns: %TRUE if @error was set, %FALSE otherwise.
14326  * Since: 2.26
14327  */
14328
14329
14330 /**
14331  * g_dbus_method_info_ref:
14332  * @info: A #GDBusMethodInfo
14333  *
14334  * If @info is statically allocated does nothing. Otherwise increases
14335  * the reference count.
14336  *
14337  * Returns: The same @info.
14338  * Since: 2.26
14339  */
14340
14341
14342 /**
14343  * g_dbus_method_info_unref:
14344  * @info: A #GDBusMethodInfo.
14345  *
14346  * If @info is statically allocated, does nothing. Otherwise decreases
14347  * the reference count of @info. When its reference count drops to 0,
14348  * the memory used is freed.
14349  *
14350  * Since: 2.26
14351  */
14352
14353
14354 /**
14355  * g_dbus_method_invocation_get_connection:
14356  * @invocation: A #GDBusMethodInvocation.
14357  *
14358  * Gets the #GDBusConnection the method was invoked on.
14359  *
14360  * Returns: (transfer none): A #GDBusConnection. Do not free, it is owned by @invocation.
14361  * Since: 2.26
14362  */
14363
14364
14365 /**
14366  * g_dbus_method_invocation_get_interface_name:
14367  * @invocation: A #GDBusMethodInvocation.
14368  *
14369  * Gets the name of the D-Bus interface the method was invoked on.
14370  *
14371  * Returns: A string. Do not free, it is owned by @invocation.
14372  * Since: 2.26
14373  */
14374
14375
14376 /**
14377  * g_dbus_method_invocation_get_message:
14378  * @invocation: A #GDBusMethodInvocation.
14379  *
14380  * Gets the #GDBusMessage for the method invocation. This is useful if
14381  * you need to use low-level protocol features, such as UNIX file
14382  * descriptor passing, that cannot be properly expressed in the
14383  * #GVariant API.
14384  *
14385  * See <xref linkend="gdbus-server"/> and <xref
14386  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
14387  * low-level API to send and receive UNIX file descriptors.
14388  *
14389  * Returns: (transfer none): #GDBusMessage. Do not free, it is owned by @invocation.
14390  * Since: 2.26
14391  */
14392
14393
14394 /**
14395  * g_dbus_method_invocation_get_method_info:
14396  * @invocation: A #GDBusMethodInvocation.
14397  *
14398  * Gets information about the method call, if any.
14399  *
14400  * Returns: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
14401  * Since: 2.26
14402  */
14403
14404
14405 /**
14406  * g_dbus_method_invocation_get_method_name:
14407  * @invocation: A #GDBusMethodInvocation.
14408  *
14409  * Gets the name of the method that was invoked.
14410  *
14411  * Returns: A string. Do not free, it is owned by @invocation.
14412  * Since: 2.26
14413  */
14414
14415
14416 /**
14417  * g_dbus_method_invocation_get_object_path:
14418  * @invocation: A #GDBusMethodInvocation.
14419  *
14420  * Gets the object path the method was invoked on.
14421  *
14422  * Returns: A string. Do not free, it is owned by @invocation.
14423  * Since: 2.26
14424  */
14425
14426
14427 /**
14428  * g_dbus_method_invocation_get_parameters:
14429  * @invocation: A #GDBusMethodInvocation.
14430  *
14431  * Gets the parameters of the method invocation. If there are no input
14432  * parameters then this will return a GVariant with 0 children rather than NULL.
14433  *
14434  * Returns: (transfer none): A #GVariant tuple. Do not unref this because it is owned by @invocation.
14435  * Since: 2.26
14436  */
14437
14438
14439 /**
14440  * g_dbus_method_invocation_get_sender:
14441  * @invocation: A #GDBusMethodInvocation.
14442  *
14443  * Gets the bus name that invoked the method.
14444  *
14445  * Returns: A string. Do not free, it is owned by @invocation.
14446  * Since: 2.26
14447  */
14448
14449
14450 /**
14451  * g_dbus_method_invocation_get_user_data: (skip)
14452  * @invocation: A #GDBusMethodInvocation.
14453  *
14454  * Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
14455  *
14456  * Returns: A #gpointer.
14457  * Since: 2.26
14458  */
14459
14460
14461 /**
14462  * g_dbus_method_invocation_return_dbus_error:
14463  * @invocation: (transfer full): A #GDBusMethodInvocation.
14464  * @error_name: A valid D-Bus error name.
14465  * @error_message: A valid D-Bus error message.
14466  *
14467  * Finishes handling a D-Bus method call by returning an error.
14468  *
14469  * This method will free @invocation, you cannot use it afterwards.
14470  *
14471  * Since: 2.26
14472  */
14473
14474
14475 /**
14476  * g_dbus_method_invocation_return_error:
14477  * @invocation: (transfer full): A #GDBusMethodInvocation.
14478  * @domain: A #GQuark for the #GError error domain.
14479  * @code: The error code.
14480  * @format: printf()-style format.
14481  * @...: Parameters for @format.
14482  *
14483  * Finishes handling a D-Bus method call by returning an error.
14484  *
14485  * See g_dbus_error_encode_gerror() for details about what error name
14486  * will be returned on the wire. In a nutshell, if the given error is
14487  * registered using g_dbus_error_register_error() the name given
14488  * during registration is used. Otherwise, a name of the form
14489  * <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
14490  * used. This provides transparent mapping of #GError between
14491  * applications using GDBus.
14492  *
14493  * If you are writing an application intended to be portable,
14494  * <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
14495  * or use g_dbus_method_invocation_return_dbus_error().
14496  *
14497  * This method will free @invocation, you cannot use it afterwards.
14498  *
14499  * Since: 2.26
14500  */
14501
14502
14503 /**
14504  * g_dbus_method_invocation_return_error_literal:
14505  * @invocation: (transfer full): A #GDBusMethodInvocation.
14506  * @domain: A #GQuark for the #GError error domain.
14507  * @code: The error code.
14508  * @message: The error message.
14509  *
14510  * Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
14511  *
14512  * This method will free @invocation, you cannot use it afterwards.
14513  *
14514  * Since: 2.26
14515  */
14516
14517
14518 /**
14519  * g_dbus_method_invocation_return_error_valist:
14520  * @invocation: (transfer full): A #GDBusMethodInvocation.
14521  * @domain: A #GQuark for the #GError error domain.
14522  * @code: The error code.
14523  * @format: printf()-style format.
14524  * @var_args: #va_list of parameters for @format.
14525  *
14526  * Like g_dbus_method_invocation_return_error() but intended for
14527  * language bindings.
14528  *
14529  * This method will free @invocation, you cannot use it afterwards.
14530  *
14531  * Since: 2.26
14532  */
14533
14534
14535 /**
14536  * g_dbus_method_invocation_return_gerror:
14537  * @invocation: (transfer full): A #GDBusMethodInvocation.
14538  * @error: A #GError.
14539  *
14540  * Like g_dbus_method_invocation_return_error() but takes a #GError
14541  * instead of the error domain, error code and message.
14542  *
14543  * This method will free @invocation, you cannot use it afterwards.
14544  *
14545  * Since: 2.26
14546  */
14547
14548
14549 /**
14550  * g_dbus_method_invocation_return_value:
14551  * @invocation: (transfer full): A #GDBusMethodInvocation.
14552  * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
14553  *
14554  * Finishes handling a D-Bus method call by returning @parameters.
14555  * If the @parameters GVariant is floating, it is consumed.
14556  *
14557  * It is an error if @parameters is not of the right format.
14558  *
14559  * This method will free @invocation, you cannot use it afterwards.
14560  *
14561  * Since: 2.26
14562  */
14563
14564
14565 /**
14566  * g_dbus_method_invocation_return_value_with_unix_fd_list:
14567  * @invocation: (transfer full): A #GDBusMethodInvocation.
14568  * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
14569  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
14570  *
14571  * Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
14572  *
14573  * This method is only available on UNIX.
14574  *
14575  * This method will free @invocation, you cannot use it afterwards.
14576  *
14577  * Since: 2.30
14578  */
14579
14580
14581 /**
14582  * g_dbus_method_invocation_take_error: (skip)
14583  * @invocation: (transfer full): A #GDBusMethodInvocation.
14584  * @error: (transfer full): A #GError.
14585  *
14586  * Like g_dbus_method_invocation_return_gerror() but takes ownership
14587  * of @error so the caller does not need to free it.
14588  *
14589  * This method will free @invocation, you cannot use it afterwards.
14590  *
14591  * Since: 2.30
14592  */
14593
14594
14595 /**
14596  * g_dbus_node_info_generate_xml:
14597  * @info: A #GDBusNodeInfo.
14598  * @indent: Indentation level.
14599  * @string_builder: (out): A #GString to to append XML data to.
14600  *
14601  * Appends an XML representation of @info (and its children) to @string_builder.
14602  *
14603  * This function is typically used for generating introspection XML documents at run-time for
14604  * handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
14605  *
14606  * Since: 2.26
14607  */
14608
14609
14610 /**
14611  * g_dbus_node_info_lookup_interface:
14612  * @info: A #GDBusNodeInfo.
14613  * @name: A D-Bus interface name.
14614  *
14615  * Looks up information about an interface.
14616  *
14617  * The cost of this function is O(n) in number of interfaces.
14618  *
14619  * Returns: (transfer none): A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
14620  * Since: 2.26
14621  */
14622
14623
14624 /**
14625  * g_dbus_node_info_new_for_xml:
14626  * @xml_data: Valid D-Bus introspection XML.
14627  * @error: Return location for error.
14628  *
14629  * Parses @xml_data and returns a #GDBusNodeInfo representing the data.
14630  *
14631  * The introspection XML must contain exactly one top-level
14632  * <tag class="starttag">node</tag> element.
14633  *
14634  * Note that this routine is using a
14635  * <link linkend="glib-Simple-XML-Subset-Parser.description">GMarkup</link>-based
14636  * parser that only accepts a subset of valid XML documents.
14637  *
14638  * Returns: A #GDBusNodeInfo structure or %NULL if @error is set. Free with g_dbus_node_info_unref().
14639  * Since: 2.26
14640  */
14641
14642
14643 /**
14644  * g_dbus_node_info_ref:
14645  * @info: A #GDBusNodeInfo
14646  *
14647  * If @info is statically allocated does nothing. Otherwise increases
14648  * the reference count.
14649  *
14650  * Returns: The same @info.
14651  * Since: 2.26
14652  */
14653
14654
14655 /**
14656  * g_dbus_node_info_unref:
14657  * @info: A #GDBusNodeInfo.
14658  *
14659  * If @info is statically allocated, does nothing. Otherwise decreases
14660  * the reference count of @info. When its reference count drops to 0,
14661  * the memory used is freed.
14662  *
14663  * Since: 2.26
14664  */
14665
14666
14667 /**
14668  * g_dbus_object_get_interface:
14669  * @object: A #GDBusObject.
14670  * @interface_name: A D-Bus interface name.
14671  *
14672  * Gets the D-Bus interface with name @interface_name associated with
14673  * @object, if any.
14674  *
14675  * Returns: (transfer full): %NULL if not found, otherwise a #GDBusInterface that must be freed with g_object_unref().
14676  * Since: 2.30
14677  */
14678
14679
14680 /**
14681  * g_dbus_object_get_interfaces:
14682  * @object: A #GDBusObject.
14683  *
14684  * Gets the D-Bus interfaces associated with @object.
14685  *
14686  * 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().
14687  * Since: 2.30
14688  */
14689
14690
14691 /**
14692  * g_dbus_object_get_object_path:
14693  * @object: A #GDBusObject.
14694  *
14695  * Gets the object path for @object.
14696  *
14697  * Returns: A string owned by @object. Do not free.
14698  * Since: 2.30
14699  */
14700
14701
14702 /**
14703  * g_dbus_object_manager_client_get_connection:
14704  * @manager: A #GDBusObjectManagerClient
14705  *
14706  * Gets the #GDBusConnection used by @manager.
14707  *
14708  * Returns: (transfer none): A #GDBusConnection object. Do not free, the object belongs to @manager.
14709  * Since: 2.30
14710  */
14711
14712
14713 /**
14714  * g_dbus_object_manager_client_get_flags:
14715  * @manager: A #GDBusObjectManagerClient
14716  *
14717  * Gets the flags that @manager was constructed with.
14718  *
14719  * Returns: Zero of more flags from the #GDBusObjectManagerClientFlags enumeration.
14720  * Since: 2.30
14721  */
14722
14723
14724 /**
14725  * g_dbus_object_manager_client_get_name:
14726  * @manager: A #GDBusObjectManagerClient
14727  *
14728  * Gets the name that @manager is for, or %NULL if not a message bus
14729  * connection.
14730  *
14731  * Returns: A unique or well-known name. Do not free, the string belongs to @manager.
14732  * Since: 2.30
14733  */
14734
14735
14736 /**
14737  * g_dbus_object_manager_client_get_name_owner:
14738  * @manager: A #GDBusObjectManagerClient.
14739  *
14740  * The unique name that owns the name that @manager is for or %NULL if
14741  * no-one currently owns that name. You can connect to the
14742  * #GObject::notify signal to track changes to the
14743  * #GDBusObjectManagerClient:name-owner property.
14744  *
14745  * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
14746  * Since: 2.30
14747  */
14748
14749
14750 /**
14751  * g_dbus_object_manager_client_new:
14752  * @connection: A #GDBusConnection.
14753  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
14754  * @name: The owner of the control object (unique or well-known name).
14755  * @object_path: The object path of the control object.
14756  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
14757  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
14758  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
14759  * @cancellable: (allow-none): A #GCancellable or %NULL
14760  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
14761  * @user_data: The data to pass to @callback.
14762  *
14763  * Asynchronously creates a new #GDBusObjectManagerClient object.
14764  *
14765  * This is an asynchronous failable constructor. When the result is
14766  * ready, @callback will be invoked in the
14767  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
14768  * of the thread you are calling this method from. You can
14769  * then call g_dbus_object_manager_client_new_finish() to get the result. See
14770  * g_dbus_object_manager_client_new_sync() for the synchronous version.
14771  *
14772  * Since: 2.30
14773  */
14774
14775
14776 /**
14777  * g_dbus_object_manager_client_new_finish:
14778  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
14779  * @error: Return location for error or %NULL.
14780  *
14781  * Finishes an operation started with g_dbus_object_manager_client_new().
14782  *
14783  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
14784  * Since: 2.30
14785  */
14786
14787
14788 /**
14789  * g_dbus_object_manager_client_new_for_bus:
14790  * @bus_type: A #GBusType.
14791  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
14792  * @name: The owner of the control object (unique or well-known name).
14793  * @object_path: The object path of the control object.
14794  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
14795  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
14796  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
14797  * @cancellable: (allow-none): A #GCancellable or %NULL
14798  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
14799  * @user_data: The data to pass to @callback.
14800  *
14801  * Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
14802  * #GDBusConnection.
14803  *
14804  * This is an asynchronous failable constructor. When the result is
14805  * ready, @callback will be invoked in the
14806  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
14807  * of the thread you are calling this method from. You can
14808  * then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
14809  * g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
14810  *
14811  * Since: 2.30
14812  */
14813
14814
14815 /**
14816  * g_dbus_object_manager_client_new_for_bus_finish:
14817  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
14818  * @error: Return location for error or %NULL.
14819  *
14820  * Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
14821  *
14822  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
14823  * Since: 2.30
14824  */
14825
14826
14827 /**
14828  * g_dbus_object_manager_client_new_for_bus_sync:
14829  * @bus_type: A #GBusType.
14830  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
14831  * @name: The owner of the control object (unique or well-known name).
14832  * @object_path: The object path of the control object.
14833  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
14834  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
14835  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
14836  * @cancellable: (allow-none): A #GCancellable or %NULL
14837  * @error: Return location for error or %NULL.
14838  *
14839  * Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
14840  * of a #GDBusConnection.
14841  *
14842  * This is a synchronous failable constructor - the calling thread is
14843  * blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
14844  * for the asynchronous version.
14845  *
14846  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
14847  * Since: 2.30
14848  */
14849
14850
14851 /**
14852  * g_dbus_object_manager_client_new_sync:
14853  * @connection: A #GDBusConnection.
14854  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
14855  * @name: (allow-none): The owner of the control object (unique or well-known name), or %NULL when not using a message bus connection.
14856  * @object_path: The object path of the control object.
14857  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
14858  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
14859  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
14860  * @cancellable: (allow-none): A #GCancellable or %NULL
14861  * @error: Return location for error or %NULL.
14862  *
14863  * Creates a new #GDBusObjectManagerClient object.
14864  *
14865  * This is a synchronous failable constructor - the calling thread is
14866  * blocked until a reply is received. See g_dbus_object_manager_client_new()
14867  * for the asynchronous version.
14868  *
14869  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
14870  * Since: 2.30
14871  */
14872
14873
14874 /**
14875  * g_dbus_object_manager_get_interface:
14876  * @manager: A #GDBusObjectManager.
14877  * @object_path: Object path to lookup.
14878  * @interface_name: D-Bus interface name to lookup.
14879  *
14880  * Gets the interface proxy for @interface_name at @object_path, if
14881  * any.
14882  *
14883  * Returns: (transfer full): A #GDBusInterface instance or %NULL. Free with g_object_unref().
14884  * Since: 2.30
14885  */
14886
14887
14888 /**
14889  * g_dbus_object_manager_get_object:
14890  * @manager: A #GDBusObjectManager.
14891  * @object_path: Object path to lookup.
14892  *
14893  * Gets the #GDBusObjectProxy at @object_path, if any.
14894  *
14895  * Returns: (transfer full): A #GDBusObject or %NULL. Free with g_object_unref().
14896  * Since: 2.30
14897  */
14898
14899
14900 /**
14901  * g_dbus_object_manager_get_object_path:
14902  * @manager: A #GDBusObjectManager.
14903  *
14904  * Gets the object path that @manager is for.
14905  *
14906  * Returns: A string owned by @manager. Do not free.
14907  * Since: 2.30
14908  */
14909
14910
14911 /**
14912  * g_dbus_object_manager_get_objects:
14913  * @manager: A #GDBusObjectManager.
14914  *
14915  * Gets all #GDBusObject objects known to @manager.
14916  *
14917  * 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().
14918  * Since: 2.30
14919  */
14920
14921
14922 /**
14923  * g_dbus_object_manager_server_export:
14924  * @manager: A #GDBusObjectManagerServer.
14925  * @object: A #GDBusObjectSkeleton.
14926  *
14927  * Exports @object on @manager.
14928  *
14929  * If there is already a #GDBusObject exported at the object path,
14930  * then the old object is removed.
14931  *
14932  * The object path for @object must be in the hierarchy rooted by the
14933  * object path for @manager.
14934  *
14935  * Note that @manager will take a reference on @object for as long as
14936  * it is exported.
14937  *
14938  * Since: 2.30
14939  */
14940
14941
14942 /**
14943  * g_dbus_object_manager_server_export_uniquely:
14944  * @manager: A #GDBusObjectManagerServer.
14945  * @object: An object.
14946  *
14947  * Like g_dbus_object_manager_server_export() but appends a string of
14948  * the form <literal>_N</literal> (with N being a natural number) to
14949  * @object<!-- -->'s object path if an object with the given path
14950  * already exists. As such, the #GDBusObjectProxy:g-object-path property
14951  * of @object may be modified.
14952  *
14953  * Since: 2.30
14954  */
14955
14956
14957 /**
14958  * g_dbus_object_manager_server_get_connection:
14959  * @manager: A #GDBusObjectManagerServer
14960  *
14961  * Gets the #GDBusConnection used by @manager.
14962  *
14963  * 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().
14964  * Since: 2.30
14965  */
14966
14967
14968 /**
14969  * g_dbus_object_manager_server_is_exported:
14970  * @manager: A #GDBusObjectManagerServer.
14971  * @object: An object.
14972  *
14973  * Returns whether @object is currently exported on @manager.
14974  *
14975  * Returns: %TRUE if @object is exported
14976  * Since: 2.34
14977  */
14978
14979
14980 /**
14981  * g_dbus_object_manager_server_new:
14982  * @object_path: The object path to export the manager object at.
14983  *
14984  * Creates a new #GDBusObjectManagerServer object.
14985  *
14986  * The returned server isn't yet exported on any connection. To do so,
14987  * use g_dbus_object_manager_server_set_connection(). Normally you
14988  * want to export all of your objects before doing so to avoid <ulink
14989  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
14990  * signals being emitted.
14991  *
14992  * Returns: A #GDBusObjectManagerServer object. Free with g_object_unref().
14993  * Since: 2.30
14994  */
14995
14996
14997 /**
14998  * g_dbus_object_manager_server_set_connection:
14999  * @manager: A #GDBusObjectManagerServer.
15000  * @connection: (allow-none): A #GDBusConnection or %NULL.
15001  *
15002  * Exports all objects managed by @manager on @connection. If
15003  * @connection is %NULL, stops exporting objects.
15004  */
15005
15006
15007 /**
15008  * g_dbus_object_manager_server_unexport:
15009  * @manager: A #GDBusObjectManagerServer.
15010  * @object_path: An object path.
15011  *
15012  * If @manager has an object at @path, removes the object. Otherwise
15013  * does nothing.
15014  *
15015  * Note that @object_path must be in the hierarchy rooted by the
15016  * object path for @manager.
15017  *
15018  * Returns: %TRUE if object at @object_path was removed, %FALSE otherwise.
15019  * Since: 2.30
15020  */
15021
15022
15023 /**
15024  * g_dbus_object_proxy_get_connection:
15025  * @proxy: a #GDBusObjectProxy
15026  *
15027  * Gets the connection that @proxy is for.
15028  *
15029  * Returns: (transfer none): A #GDBusConnection. Do not free, the object is owned by @proxy.
15030  * Since: 2.30
15031  */
15032
15033
15034 /**
15035  * g_dbus_object_proxy_new:
15036  * @connection: a #GDBusConnection
15037  * @object_path: the object path
15038  *
15039  * Creates a new #GDBusObjectProxy for the given connection and
15040  * object path.
15041  *
15042  * Returns: a new #GDBusObjectProxy
15043  * Since: 2.30
15044  */
15045
15046
15047 /**
15048  * g_dbus_object_skeleton_add_interface:
15049  * @object: A #GDBusObjectSkeleton.
15050  * @interface_: A #GDBusInterfaceSkeleton.
15051  *
15052  * Adds @interface_ to @object.
15053  *
15054  * If @object already contains a #GDBusInterfaceSkeleton with the same
15055  * interface name, it is removed before @interface_ is added.
15056  *
15057  * Note that @object takes its own reference on @interface_ and holds
15058  * it until removed.
15059  *
15060  * Since: 2.30
15061  */
15062
15063
15064 /**
15065  * g_dbus_object_skeleton_flush:
15066  * @object: A #GDBusObjectSkeleton.
15067  *
15068  * This method simply calls g_dbus_interface_skeleton_flush() on all
15069  * interfaces belonging to @object. See that method for when flushing
15070  * is useful.
15071  *
15072  * Since: 2.30
15073  */
15074
15075
15076 /**
15077  * g_dbus_object_skeleton_new:
15078  * @object_path: An object path.
15079  *
15080  * Creates a new #GDBusObjectSkeleton.
15081  *
15082  * Returns: A #GDBusObjectSkeleton. Free with g_object_unref().
15083  * Since: 2.30
15084  */
15085
15086
15087 /**
15088  * g_dbus_object_skeleton_remove_interface:
15089  * @object: A #GDBusObjectSkeleton.
15090  * @interface_: A #GDBusInterfaceSkeleton.
15091  *
15092  * Removes @interface_ from @object.
15093  *
15094  * Since: 2.30
15095  */
15096
15097
15098 /**
15099  * g_dbus_object_skeleton_remove_interface_by_name:
15100  * @object: A #GDBusObjectSkeleton.
15101  * @interface_name: A D-Bus interface name.
15102  *
15103  * Removes the #GDBusInterface with @interface_name from @object.
15104  *
15105  * If no D-Bus interface of the given interface exists, this function
15106  * does nothing.
15107  *
15108  * Since: 2.30
15109  */
15110
15111
15112 /**
15113  * g_dbus_object_skeleton_set_object_path:
15114  * @object: A #GDBusObjectSkeleton.
15115  * @object_path: A valid D-Bus object path.
15116  *
15117  * Sets the object path for @object.
15118  *
15119  * Since: 2.30
15120  */
15121
15122
15123 /**
15124  * g_dbus_property_info_ref:
15125  * @info: A #GDBusPropertyInfo
15126  *
15127  * If @info is statically allocated does nothing. Otherwise increases
15128  * the reference count.
15129  *
15130  * Returns: The same @info.
15131  * Since: 2.26
15132  */
15133
15134
15135 /**
15136  * g_dbus_property_info_unref:
15137  * @info: A #GDBusPropertyInfo.
15138  *
15139  * If @info is statically allocated, does nothing. Otherwise decreases
15140  * the reference count of @info. When its reference count drops to 0,
15141  * the memory used is freed.
15142  *
15143  * Since: 2.26
15144  */
15145
15146
15147 /**
15148  * g_dbus_proxy_call:
15149  * @proxy: A #GDBusProxy.
15150  * @method_name: Name of method to invoke.
15151  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15152  * @flags: Flags from the #GDBusCallFlags enumeration.
15153  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15154  * @cancellable: (allow-none): A #GCancellable or %NULL.
15155  * @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.
15156  * @user_data: The data to pass to @callback.
15157  *
15158  * Asynchronously invokes the @method_name method on @proxy.
15159  *
15160  * If @method_name contains any dots, then @name is split into interface and
15161  * method name parts. This allows using @proxy for invoking methods on
15162  * other interfaces.
15163  *
15164  * If the #GDBusConnection associated with @proxy is closed then
15165  * the operation will fail with %G_IO_ERROR_CLOSED. If
15166  * @cancellable is canceled, the operation will fail with
15167  * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15168  * compatible with the D-Bus protocol, the operation fails with
15169  * %G_IO_ERROR_INVALID_ARGUMENT.
15170  *
15171  * If the @parameters #GVariant is floating, it is consumed. This allows
15172  * convenient 'inline' use of g_variant_new(), e.g.:
15173  * |[
15174  *  g_dbus_proxy_call (proxy,
15175  *                     "TwoStrings",
15176  *                     g_variant_new ("(ss)",
15177  *                                    "Thing One",
15178  *                                    "Thing Two"),
15179  *                     G_DBUS_CALL_FLAGS_NONE,
15180  *                     -1,
15181  *                     NULL,
15182  *                     (GAsyncReadyCallback) two_strings_done,
15183  *                     &amp;data);
15184  * ]|
15185  *
15186  * If @proxy has an expected interface (see
15187  * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15188  * then the return value is checked against the return type.
15189  *
15190  * This is an asynchronous method. When the operation is finished,
15191  * @callback will be invoked in the
15192  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
15193  * of the thread you are calling this method from.
15194  * You can then call g_dbus_proxy_call_finish() to get the result of
15195  * the operation. See g_dbus_proxy_call_sync() for the synchronous
15196  * version of this method.
15197  *
15198  * If @callback is %NULL then the D-Bus method call message will be sent with
15199  * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
15200  *
15201  * Since: 2.26
15202  */
15203
15204
15205 /**
15206  * g_dbus_proxy_call_finish:
15207  * @proxy: A #GDBusProxy.
15208  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
15209  * @error: Return location for error or %NULL.
15210  *
15211  * Finishes an operation started with g_dbus_proxy_call().
15212  *
15213  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15214  * Since: 2.26
15215  */
15216
15217
15218 /**
15219  * g_dbus_proxy_call_sync:
15220  * @proxy: A #GDBusProxy.
15221  * @method_name: Name of method to invoke.
15222  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15223  * @flags: Flags from the #GDBusCallFlags enumeration.
15224  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15225  * @cancellable: (allow-none): A #GCancellable or %NULL.
15226  * @error: Return location for error or %NULL.
15227  *
15228  * Synchronously invokes the @method_name method on @proxy.
15229  *
15230  * If @method_name contains any dots, then @name is split into interface and
15231  * method name parts. This allows using @proxy for invoking methods on
15232  * other interfaces.
15233  *
15234  * If the #GDBusConnection associated with @proxy is disconnected then
15235  * the operation will fail with %G_IO_ERROR_CLOSED. If
15236  * @cancellable is canceled, the operation will fail with
15237  * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
15238  * compatible with the D-Bus protocol, the operation fails with
15239  * %G_IO_ERROR_INVALID_ARGUMENT.
15240  *
15241  * If the @parameters #GVariant is floating, it is consumed. This allows
15242  * convenient 'inline' use of g_variant_new(), e.g.:
15243  * |[
15244  *  g_dbus_proxy_call_sync (proxy,
15245  *                          "TwoStrings",
15246  *                          g_variant_new ("(ss)",
15247  *                                         "Thing One",
15248  *                                         "Thing Two"),
15249  *                          G_DBUS_CALL_FLAGS_NONE,
15250  *                          -1,
15251  *                          NULL,
15252  *                          &amp;error);
15253  * ]|
15254  *
15255  * The calling thread is blocked until a reply is received. See
15256  * g_dbus_proxy_call() for the asynchronous version of this
15257  * method.
15258  *
15259  * If @proxy has an expected interface (see
15260  * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
15261  * then the return value is checked against the return type.
15262  *
15263  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15264  * Since: 2.26
15265  */
15266
15267
15268 /**
15269  * g_dbus_proxy_call_with_unix_fd_list:
15270  * @proxy: A #GDBusProxy.
15271  * @method_name: Name of method to invoke.
15272  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15273  * @flags: Flags from the #GDBusCallFlags enumeration.
15274  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15275  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15276  * @cancellable: (allow-none): A #GCancellable or %NULL.
15277  * @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.
15278  * @user_data: The data to pass to @callback.
15279  *
15280  * Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
15281  *
15282  * This method is only available on UNIX.
15283  *
15284  * Since: 2.30
15285  */
15286
15287
15288 /**
15289  * g_dbus_proxy_call_with_unix_fd_list_finish:
15290  * @proxy: A #GDBusProxy.
15291  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15292  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
15293  * @error: Return location for error or %NULL.
15294  *
15295  * Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
15296  *
15297  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15298  * Since: 2.30
15299  */
15300
15301
15302 /**
15303  * g_dbus_proxy_call_with_unix_fd_list_sync:
15304  * @proxy: A #GDBusProxy.
15305  * @method_name: Name of method to invoke.
15306  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
15307  * @flags: Flags from the #GDBusCallFlags enumeration.
15308  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
15309  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
15310  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
15311  * @cancellable: (allow-none): A #GCancellable or %NULL.
15312  * @error: Return location for error or %NULL.
15313  *
15314  * Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
15315  *
15316  * This method is only available on UNIX.
15317  *
15318  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
15319  * Since: 2.30
15320  */
15321
15322
15323 /**
15324  * g_dbus_proxy_get_cached_property:
15325  * @proxy: A #GDBusProxy.
15326  * @property_name: Property name.
15327  *
15328  * Looks up the value for a property from the cache. This call does no
15329  * blocking IO.
15330  *
15331  * If @proxy has an expected interface (see
15332  * #GDBusProxy:g-interface-info) and @property_name is referenced by
15333  * it, then @value is checked against the type of the property.
15334  *
15335  * 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().
15336  * Since: 2.26
15337  */
15338
15339
15340 /**
15341  * g_dbus_proxy_get_cached_property_names:
15342  * @proxy: A #GDBusProxy.
15343  *
15344  * Gets the names of all cached properties on @proxy.
15345  *
15346  * Returns: (transfer full): A %NULL-terminated array of strings or %NULL if @proxy has no cached properties. Free the returned array with g_strfreev().
15347  * Since: 2.26
15348  */
15349
15350
15351 /**
15352  * g_dbus_proxy_get_connection:
15353  * @proxy: A #GDBusProxy.
15354  *
15355  * Gets the connection @proxy is for.
15356  *
15357  * Returns: (transfer none): A #GDBusConnection owned by @proxy. Do not free.
15358  * Since: 2.26
15359  */
15360
15361
15362 /**
15363  * g_dbus_proxy_get_default_timeout:
15364  * @proxy: A #GDBusProxy.
15365  *
15366  * Gets the timeout to use if -1 (specifying default timeout) is
15367  * passed as @timeout_msec in the g_dbus_proxy_call() and
15368  * g_dbus_proxy_call_sync() functions.
15369  *
15370  * See the #GDBusProxy:g-default-timeout property for more details.
15371  *
15372  * Returns: Timeout to use for @proxy.
15373  * Since: 2.26
15374  */
15375
15376
15377 /**
15378  * g_dbus_proxy_get_flags:
15379  * @proxy: A #GDBusProxy.
15380  *
15381  * Gets the flags that @proxy was constructed with.
15382  *
15383  * Returns: Flags from the #GDBusProxyFlags enumeration.
15384  * Since: 2.26
15385  */
15386
15387
15388 /**
15389  * g_dbus_proxy_get_interface_info:
15390  * @proxy: A #GDBusProxy
15391  *
15392  * Returns the #GDBusInterfaceInfo, if any, specifying the interface
15393  * that @proxy conforms to. See the #GDBusProxy:g-interface-info
15394  * property for more details.
15395  *
15396  * Returns: A #GDBusInterfaceInfo or %NULL. Do not unref the returned object, it is owned by @proxy.
15397  * Since: 2.26
15398  */
15399
15400
15401 /**
15402  * g_dbus_proxy_get_interface_name:
15403  * @proxy: A #GDBusProxy.
15404  *
15405  * Gets the D-Bus interface name @proxy is for.
15406  *
15407  * Returns: A string owned by @proxy. Do not free.
15408  * Since: 2.26
15409  */
15410
15411
15412 /**
15413  * g_dbus_proxy_get_name:
15414  * @proxy: A #GDBusProxy.
15415  *
15416  * Gets the name that @proxy was constructed for.
15417  *
15418  * Returns: A string owned by @proxy. Do not free.
15419  * Since: 2.26
15420  */
15421
15422
15423 /**
15424  * g_dbus_proxy_get_name_owner:
15425  * @proxy: A #GDBusProxy.
15426  *
15427  * The unique name that owns the name that @proxy is for or %NULL if
15428  * no-one currently owns that name. You may connect to the
15429  * #GObject::notify signal to track changes to the
15430  * #GDBusProxy:g-name-owner property.
15431  *
15432  * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
15433  * Since: 2.26
15434  */
15435
15436
15437 /**
15438  * g_dbus_proxy_get_object_path:
15439  * @proxy: A #GDBusProxy.
15440  *
15441  * Gets the object path @proxy is for.
15442  *
15443  * Returns: A string owned by @proxy. Do not free.
15444  * Since: 2.26
15445  */
15446
15447
15448 /**
15449  * g_dbus_proxy_new:
15450  * @connection: A #GDBusConnection.
15451  * @flags: Flags used when constructing the proxy.
15452  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
15453  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
15454  * @object_path: An object path.
15455  * @interface_name: A D-Bus interface name.
15456  * @cancellable: (allow-none): A #GCancellable or %NULL.
15457  * @callback: Callback function to invoke when the proxy is ready.
15458  * @user_data: User data to pass to @callback.
15459  *
15460  * Creates a proxy for accessing @interface_name on the remote object
15461  * at @object_path owned by @name at @connection and asynchronously
15462  * loads D-Bus properties unless the
15463  * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
15464  * the #GDBusProxy::g-properties-changed signal to get notified about
15465  * property changes.
15466  *
15467  * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
15468  * match rules for signals. Connect to the #GDBusProxy::g-signal signal
15469  * to handle signals from the remote object.
15470  *
15471  * If @name is a well-known name and the
15472  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
15473  * owner currently exists, the message bus will be requested to launch
15474  * a name owner for the name.
15475  *
15476  * This is a failable asynchronous constructor - when the proxy is
15477  * ready, @callback will be invoked and you can use
15478  * g_dbus_proxy_new_finish() to get the result.
15479  *
15480  * See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
15481  *
15482  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
15483  *
15484  * Since: 2.26
15485  */
15486
15487
15488 /**
15489  * g_dbus_proxy_new_finish:
15490  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
15491  * @error: Return location for error or %NULL.
15492  *
15493  * Finishes creating a #GDBusProxy.
15494  *
15495  * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
15496  * Since: 2.26
15497  */
15498
15499
15500 /**
15501  * g_dbus_proxy_new_for_bus:
15502  * @bus_type: A #GBusType.
15503  * @flags: Flags used when constructing the proxy.
15504  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
15505  * @name: A bus name (well-known or unique).
15506  * @object_path: An object path.
15507  * @interface_name: A D-Bus interface name.
15508  * @cancellable: (allow-none): A #GCancellable or %NULL.
15509  * @callback: Callback function to invoke when the proxy is ready.
15510  * @user_data: User data to pass to @callback.
15511  *
15512  * Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
15513  *
15514  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
15515  *
15516  * Since: 2.26
15517  */
15518
15519
15520 /**
15521  * g_dbus_proxy_new_for_bus_finish:
15522  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
15523  * @error: Return location for error or %NULL.
15524  *
15525  * Finishes creating a #GDBusProxy.
15526  *
15527  * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
15528  * Since: 2.26
15529  */
15530
15531
15532 /**
15533  * g_dbus_proxy_new_for_bus_sync:
15534  * @bus_type: A #GBusType.
15535  * @flags: Flags used when constructing the proxy.
15536  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
15537  * @name: A bus name (well-known or unique).
15538  * @object_path: An object path.
15539  * @interface_name: A D-Bus interface name.
15540  * @cancellable: (allow-none): A #GCancellable or %NULL.
15541  * @error: Return location for error or %NULL.
15542  *
15543  * Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
15544  *
15545  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
15546  *
15547  * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
15548  * Since: 2.26
15549  */
15550
15551
15552 /**
15553  * g_dbus_proxy_new_sync:
15554  * @connection: A #GDBusConnection.
15555  * @flags: Flags used when constructing the proxy.
15556  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
15557  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
15558  * @object_path: An object path.
15559  * @interface_name: A D-Bus interface name.
15560  * @cancellable: (allow-none): A #GCancellable or %NULL.
15561  * @error: (allow-none): Return location for error or %NULL.
15562  *
15563  * Creates a proxy for accessing @interface_name on the remote object
15564  * at @object_path owned by @name at @connection and synchronously
15565  * loads D-Bus properties unless the
15566  * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
15567  *
15568  * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
15569  * match rules for signals. Connect to the #GDBusProxy::g-signal signal
15570  * to handle signals from the remote object.
15571  *
15572  * If @name is a well-known name and the
15573  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
15574  * owner currently exists, the message bus will be requested to launch
15575  * a name owner for the name.
15576  *
15577  * This is a synchronous failable constructor. See g_dbus_proxy_new()
15578  * and g_dbus_proxy_new_finish() for the asynchronous version.
15579  *
15580  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
15581  *
15582  * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
15583  * Since: 2.26
15584  */
15585
15586
15587 /**
15588  * g_dbus_proxy_set_cached_property:
15589  * @proxy: A #GDBusProxy
15590  * @property_name: Property name.
15591  * @value: (allow-none): Value for the property or %NULL to remove it from the cache.
15592  *
15593  * If @value is not %NULL, sets the cached value for the property with
15594  * name @property_name to the value in @value.
15595  *
15596  * If @value is %NULL, then the cached value is removed from the
15597  * property cache.
15598  *
15599  * If @proxy has an expected interface (see
15600  * #GDBusProxy:g-interface-info) and @property_name is referenced by
15601  * it, then @value is checked against the type of the property.
15602  *
15603  * If the @value #GVariant is floating, it is consumed. This allows
15604  * convenient 'inline' use of g_variant_new(), e.g.
15605  * |[
15606  *  g_dbus_proxy_set_cached_property (proxy,
15607  *                                    "SomeProperty",
15608  *                                    g_variant_new ("(si)",
15609  *                                                  "A String",
15610  *                                                  42));
15611  * ]|
15612  *
15613  * Normally you will not need to use this method since @proxy is
15614  * tracking changes using the
15615  * <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
15616  * D-Bus signal. However, for performance reasons an object may decide
15617  * to not use this signal for some properties and instead use a
15618  * proprietary out-of-band mechanism to transmit changes.
15619  *
15620  * As a concrete example, consider an object with a property
15621  * <literal>ChatroomParticipants</literal> which is an array of
15622  * strings. Instead of transmitting the same (long) array every time
15623  * the property changes, it is more efficient to only transmit the
15624  * delta using e.g. signals <literal>ChatroomParticipantJoined(String
15625  * name)</literal> and <literal>ChatroomParticipantParted(String
15626  * name)</literal>.
15627  *
15628  * Since: 2.26
15629  */
15630
15631
15632 /**
15633  * g_dbus_proxy_set_default_timeout:
15634  * @proxy: A #GDBusProxy.
15635  * @timeout_msec: Timeout in milliseconds.
15636  *
15637  * Sets the timeout to use if -1 (specifying default timeout) is
15638  * passed as @timeout_msec in the g_dbus_proxy_call() and
15639  * g_dbus_proxy_call_sync() functions.
15640  *
15641  * See the #GDBusProxy:g-default-timeout property for more details.
15642  *
15643  * Since: 2.26
15644  */
15645
15646
15647 /**
15648  * g_dbus_proxy_set_interface_info:
15649  * @proxy: A #GDBusProxy
15650  * @info: (allow-none): Minimum interface this proxy conforms to or %NULL to unset.
15651  *
15652  * Ensure that interactions with @proxy conform to the given
15653  * interface. See the #GDBusProxy:g-interface-info property for more
15654  * details.
15655  *
15656  * Since: 2.26
15657  */
15658
15659
15660 /**
15661  * g_dbus_server_get_client_address:
15662  * @server: A #GDBusServer.
15663  *
15664  * Gets a D-Bus address string that can be used by clients to connect
15665  * to @server.
15666  *
15667  * Returns: A D-Bus address string. Do not free, the string is owned by @server.
15668  * Since: 2.26
15669  */
15670
15671
15672 /**
15673  * g_dbus_server_get_flags:
15674  * @server: A #GDBusServer.
15675  *
15676  * Gets the flags for @server.
15677  *
15678  * Returns: A set of flags from the #GDBusServerFlags enumeration.
15679  * Since: 2.26
15680  */
15681
15682
15683 /**
15684  * g_dbus_server_get_guid:
15685  * @server: A #GDBusServer.
15686  *
15687  * Gets the GUID for @server.
15688  *
15689  * Returns: A D-Bus GUID. Do not free this string, it is owned by @server.
15690  * Since: 2.26
15691  */
15692
15693
15694 /**
15695  * g_dbus_server_is_active:
15696  * @server: A #GDBusServer.
15697  *
15698  * Gets whether @server is active.
15699  *
15700  * Returns: %TRUE if server is active, %FALSE otherwise.
15701  * Since: 2.26
15702  */
15703
15704
15705 /**
15706  * g_dbus_server_new_sync:
15707  * @address: A D-Bus address.
15708  * @flags: Flags from the #GDBusServerFlags enumeration.
15709  * @guid: A D-Bus GUID.
15710  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
15711  * @cancellable: (allow-none): A #GCancellable or %NULL.
15712  * @error: Return location for server or %NULL.
15713  *
15714  * Creates a new D-Bus server that listens on the first address in
15715  * @address that works.
15716  *
15717  * Once constructed, you can use g_dbus_server_get_client_address() to
15718  * get a D-Bus address string that clients can use to connect.
15719  *
15720  * Connect to the #GDBusServer::new-connection signal to handle
15721  * incoming connections.
15722  *
15723  * The returned #GDBusServer isn't active - you have to start it with
15724  * g_dbus_server_start().
15725  *
15726  * See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
15727  * be used.
15728  *
15729  * This is a synchronous failable constructor. See
15730  * g_dbus_server_new() for the asynchronous version.
15731  *
15732  * Returns: A #GDBusServer or %NULL if @error is set. Free with g_object_unref().
15733  * Since: 2.26
15734  */
15735
15736
15737 /**
15738  * g_dbus_server_start:
15739  * @server: A #GDBusServer.
15740  *
15741  * Starts @server.
15742  *
15743  * Since: 2.26
15744  */
15745
15746
15747 /**
15748  * g_dbus_server_stop:
15749  * @server: A #GDBusServer.
15750  *
15751  * Stops @server.
15752  *
15753  * Since: 2.26
15754  */
15755
15756
15757 /**
15758  * g_dbus_signal_info_ref:
15759  * @info: A #GDBusSignalInfo
15760  *
15761  * If @info is statically allocated does nothing. Otherwise increases
15762  * the reference count.
15763  *
15764  * Returns: The same @info.
15765  * Since: 2.26
15766  */
15767
15768
15769 /**
15770  * g_dbus_signal_info_unref:
15771  * @info: A #GDBusSignalInfo.
15772  *
15773  * If @info is statically allocated, does nothing. Otherwise decreases
15774  * the reference count of @info. When its reference count drops to 0,
15775  * the memory used is freed.
15776  *
15777  * Since: 2.26
15778  */
15779
15780
15781 /**
15782  * g_desktop_app_info_get_boolean:
15783  * @info: a #GDesktopAppInfo
15784  * @key: the key to look up
15785  *
15786  * Looks up a boolean value in the keyfile backing @info.
15787  *
15788  * The @key is looked up in the "Desktop Entry" group.
15789  *
15790  * Returns: the boolean value, or %FALSE if the key is not found
15791  * Since: 2.36
15792  */
15793
15794
15795 /**
15796  * g_desktop_app_info_get_categories:
15797  * @info: a #GDesktopAppInfo
15798  *
15799  * Gets the categories from the desktop file.
15800  *
15801  * Returns: The unparsed Categories key from the desktop file; i.e. no attempt is made to split it by ';' or validate it.
15802  */
15803
15804
15805 /**
15806  * g_desktop_app_info_get_filename:
15807  * @info: a #GDesktopAppInfo
15808  *
15809  * When @info was created from a known filename, return it.  In some
15810  * situations such as the #GDesktopAppInfo returned from
15811  * g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
15812  *
15813  * Returns: The full path to the file for @info, or %NULL if not known.
15814  * Since: 2.24
15815  */
15816
15817
15818 /**
15819  * g_desktop_app_info_get_generic_name:
15820  * @info: a #GDesktopAppInfo
15821  *
15822  * Gets the generic name from the destkop file.
15823  *
15824  * Returns: The value of the GenericName key
15825  */
15826
15827
15828 /**
15829  * g_desktop_app_info_get_is_hidden:
15830  * @info: a #GDesktopAppInfo.
15831  *
15832  * A desktop file is hidden if the Hidden key in it is
15833  * set to True.
15834  *
15835  * Returns: %TRUE if hidden, %FALSE otherwise.
15836  */
15837
15838
15839 /**
15840  * g_desktop_app_info_get_keywords:
15841  * @info: a #GDesktopAppInfo
15842  *
15843  * Gets the keywords from the desktop file.
15844  *
15845  * Returns: (transfer none): The value of the Keywords key
15846  * Since: 2.32
15847  */
15848
15849
15850 /**
15851  * g_desktop_app_info_get_nodisplay:
15852  * @info: a #GDesktopAppInfo
15853  *
15854  * Gets the value of the NoDisplay key, which helps determine if the
15855  * application info should be shown in menus. See
15856  * #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
15857  *
15858  * Returns: The value of the NoDisplay key
15859  * Since: 2.30
15860  */
15861
15862
15863 /**
15864  * g_desktop_app_info_get_show_in:
15865  * @info: a #GDesktopAppInfo
15866  * @desktop_env: a string specifying a desktop name
15867  *
15868  * Checks if the application info should be shown in menus that list available
15869  * applications for a specific name of the desktop, based on the
15870  * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
15871  *
15872  * If @desktop_env is %NULL, then the name of the desktop set with
15873  * g_desktop_app_info_set_desktop_env() is used.
15874  *
15875  * Note that g_app_info_should_show() for @info will include this check (with
15876  * %NULL for @desktop_env) as well as additional checks.
15877  *
15878  * Returns: %TRUE if the @info should be shown in @desktop_env according to the <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE otherwise.
15879  * Since: 2.30
15880  */
15881
15882
15883 /**
15884  * g_desktop_app_info_get_startup_wm_class:
15885  * @info: a #GDesktopAppInfo that supports startup notify
15886  *
15887  * Retrieves the StartupWMClass field from @info. This represents the
15888  * WM_CLASS property of the main window of the application, if launched
15889  * through @info.
15890  *
15891  * Returns: (transfer none): the startup WM class, or %NULL if none is set in the desktop file.
15892  * Since: 2.34
15893  */
15894
15895
15896 /**
15897  * g_desktop_app_info_get_string:
15898  * @info: a #GDesktopAppInfo
15899  * @key: the key to look up
15900  *
15901  * Looks up a string value in the keyfile backing @info.
15902  *
15903  * The @key is looked up in the "Desktop Entry" group.
15904  *
15905  * Returns: a newly allocated string, or %NULL if the key is not found
15906  * Since: 2.36
15907  */
15908
15909
15910 /**
15911  * g_desktop_app_info_has_key:
15912  * @info: a #GDesktopAppInfo
15913  * @key: the key to look up
15914  *
15915  * Returns whether @key exists in the "Desktop Entry" group
15916  * of the keyfile backing @info.
15917  *
15918  * Returns: %TRUE if the @key exists
15919  * Since: 2.26
15920  */
15921
15922
15923 /**
15924  * g_desktop_app_info_launch_uris_as_manager:
15925  * @appinfo: a #GDesktopAppInfo
15926  * @uris: (element-type utf8): List of URIs
15927  * @launch_context: a #GAppLaunchContext
15928  * @spawn_flags: #GSpawnFlags, used for each process
15929  * @user_setup: (scope call): a #GSpawnChildSetupFunc, used once for each process.
15930  * @user_setup_data: (closure user_setup): User data for @user_setup
15931  * @pid_callback: (scope call): Callback for child processes
15932  * @pid_callback_data: (closure pid_callback): User data for @callback
15933  * @error: return location for a #GError, or %NULL
15934  *
15935  * This function performs the equivalent of g_app_info_launch_uris(),
15936  * but is intended primarily for operating system components that
15937  * launch applications.  Ordinary applications should use
15938  * g_app_info_launch_uris().
15939  *
15940  * In contrast to g_app_info_launch_uris(), all processes created will
15941  * always be run directly as children as if by the UNIX fork()/exec()
15942  * calls.
15943  *
15944  * This guarantee allows additional control over the exact environment
15945  * of the child processes, which is provided via a setup function
15946  * @user_setup, as well as the process identifier of each child process
15947  * via @pid_callback. See g_spawn_async() for more information about the
15948  * semantics of the @user_setup function.
15949  *
15950  * Returns: %TRUE on successful launch, %FALSE otherwise.
15951  */
15952
15953
15954 /**
15955  * g_desktop_app_info_lookup_get_default_for_uri_scheme:
15956  * @lookup: a #GDesktopAppInfoLookup
15957  * @uri_scheme: a string containing a URI scheme.
15958  *
15959  * Gets the default application for launching applications
15960  * using this URI scheme for a particular GDesktopAppInfoLookup
15961  * implementation.
15962  *
15963  * The GDesktopAppInfoLookup interface and this function is used
15964  * to implement g_app_info_get_default_for_uri_scheme() backends
15965  * in a GIO module. There is no reason for applications to use it
15966  * directly. Applications should use g_app_info_get_default_for_uri_scheme().
15967  *
15968  * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
15969  * Deprecated: The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
15970  */
15971
15972
15973 /**
15974  * g_desktop_app_info_new:
15975  * @desktop_id: the desktop file id
15976  *
15977  * Creates a new #GDesktopAppInfo based on a desktop file id.
15978  *
15979  * A desktop file id is the basename of the desktop file, including the
15980  * .desktop extension. GIO is looking for a desktop file with this name
15981  * in the <filename>applications</filename> subdirectories of the XDG data
15982  * directories (i.e. the directories specified in the
15983  * <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
15984  * variables). GIO also supports the prefix-to-subdirectory mapping that is
15985  * described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
15986  * (i.e. a desktop id of kde-foo.desktop will match
15987  * <filename>/usr/share/applications/kde/foo.desktop</filename>).
15988  *
15989  * Returns: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
15990  */
15991
15992
15993 /**
15994  * g_desktop_app_info_new_from_filename:
15995  * @filename: the path of a desktop file, in the GLib filename encoding
15996  *
15997  * Creates a new #GDesktopAppInfo.
15998  *
15999  * Returns: a new #GDesktopAppInfo or %NULL on error.
16000  */
16001
16002
16003 /**
16004  * g_desktop_app_info_new_from_keyfile:
16005  * @key_file: an opened #GKeyFile
16006  *
16007  * Creates a new #GDesktopAppInfo.
16008  *
16009  * Returns: a new #GDesktopAppInfo or %NULL on error.
16010  * Since: 2.18
16011  */
16012
16013
16014 /**
16015  * g_desktop_app_info_set_desktop_env:
16016  * @desktop_env: a string specifying what desktop this is
16017  *
16018  * Sets the name of the desktop that the application is running in.
16019  * This is used by g_app_info_should_show() and
16020  * g_desktop_app_info_get_show_in() to evaluate the
16021  * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
16022  * desktop entry fields.
16023  *
16024  * The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
16025  * Menu specification</ulink> recognizes the following:
16026  * <simplelist>
16027  *   <member>GNOME</member>
16028  *   <member>KDE</member>
16029  *   <member>ROX</member>
16030  *   <member>XFCE</member>
16031  *   <member>LXDE</member>
16032  *   <member>Unity</member>
16033  *   <member>Old</member>
16034  * </simplelist>
16035  *
16036  * Should be called only once; subsequent calls are ignored.
16037  */
16038
16039
16040 /**
16041  * g_drive_can_eject:
16042  * @drive: a #GDrive.
16043  *
16044  * Checks if a drive can be ejected.
16045  *
16046  * Returns: %TRUE if the @drive can be ejected, %FALSE otherwise.
16047  */
16048
16049
16050 /**
16051  * g_drive_can_poll_for_media:
16052  * @drive: a #GDrive.
16053  *
16054  * Checks if a drive can be polled for media changes.
16055  *
16056  * Returns: %TRUE if the @drive can be polled for media changes, %FALSE otherwise.
16057  */
16058
16059
16060 /**
16061  * g_drive_can_start:
16062  * @drive: a #GDrive.
16063  *
16064  * Checks if a drive can be started.
16065  *
16066  * Returns: %TRUE if the @drive can be started, %FALSE otherwise.
16067  * Since: 2.22
16068  */
16069
16070
16071 /**
16072  * g_drive_can_start_degraded:
16073  * @drive: a #GDrive.
16074  *
16075  * Checks if a drive can be started degraded.
16076  *
16077  * Returns: %TRUE if the @drive can be started degraded, %FALSE otherwise.
16078  * Since: 2.22
16079  */
16080
16081
16082 /**
16083  * g_drive_can_stop:
16084  * @drive: a #GDrive.
16085  *
16086  * Checks if a drive can be stopped.
16087  *
16088  * Returns: %TRUE if the @drive can be stopped, %FALSE otherwise.
16089  * Since: 2.22
16090  */
16091
16092
16093 /**
16094  * g_drive_eject:
16095  * @drive: a #GDrive.
16096  * @flags: flags affecting the unmount if required for eject
16097  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16098  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16099  * @user_data: user data to pass to @callback
16100  *
16101  * Asynchronously ejects a drive.
16102  *
16103  * When the operation is finished, @callback will be called.
16104  * You can then call g_drive_eject_finish() to obtain the
16105  * result of the operation.
16106  *
16107  * Deprecated: 2.22: Use g_drive_eject_with_operation() instead.
16108  */
16109
16110
16111 /**
16112  * g_drive_eject_finish:
16113  * @drive: a #GDrive.
16114  * @result: a #GAsyncResult.
16115  * @error: a #GError, or %NULL
16116  *
16117  * Finishes ejecting a drive.
16118  *
16119  * Returns: %TRUE if the drive has been ejected successfully, %FALSE otherwise.
16120  * Deprecated: 2.22: Use g_drive_eject_with_operation_finish() instead.
16121  */
16122
16123
16124 /**
16125  * g_drive_eject_with_operation:
16126  * @drive: a #GDrive.
16127  * @flags: flags affecting the unmount if required for eject
16128  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16129  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16130  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16131  * @user_data: user data passed to @callback.
16132  *
16133  * Ejects a drive. This is an asynchronous operation, and is
16134  * finished by calling g_drive_eject_with_operation_finish() with the @drive
16135  * and #GAsyncResult data returned in the @callback.
16136  *
16137  * Since: 2.22
16138  */
16139
16140
16141 /**
16142  * g_drive_eject_with_operation_finish:
16143  * @drive: a #GDrive.
16144  * @result: a #GAsyncResult.
16145  * @error: a #GError location to store the error occurring, or %NULL to ignore.
16146  *
16147  * Finishes ejecting a drive. If any errors occurred during the operation,
16148  * @error will be set to contain the errors and %FALSE will be returned.
16149  *
16150  * Returns: %TRUE if the drive was successfully ejected. %FALSE otherwise.
16151  * Since: 2.22
16152  */
16153
16154
16155 /**
16156  * g_drive_enumerate_identifiers:
16157  * @drive: a #GDrive
16158  *
16159  * Gets the kinds of identifiers that @drive has.
16160  * Use g_drive_get_identifier() to obtain the identifiers
16161  * themselves.
16162  *
16163  * Returns: (transfer full) (array zero-terminated=1): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
16164  */
16165
16166
16167 /**
16168  * g_drive_get_icon:
16169  * @drive: a #GDrive.
16170  *
16171  * Gets the icon for @drive.
16172  *
16173  * Returns: (transfer full): #GIcon for the @drive. Free the returned object with g_object_unref().
16174  */
16175
16176
16177 /**
16178  * g_drive_get_identifier:
16179  * @drive: a #GDrive
16180  * @kind: the kind of identifier to return
16181  *
16182  * Gets the identifier of the given kind for @drive.
16183  *
16184  * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GDrive doesn't have this kind of identifier.
16185  */
16186
16187
16188 /**
16189  * g_drive_get_name:
16190  * @drive: a #GDrive.
16191  *
16192  * Gets the name of @drive.
16193  *
16194  * Returns: a string containing @drive's name. The returned string should be freed when no longer needed.
16195  */
16196
16197
16198 /**
16199  * g_drive_get_sort_key:
16200  * @drive: A #GDrive.
16201  *
16202  * Gets the sort key for @drive, if any.
16203  *
16204  * Returns: Sorting key for @drive or %NULL if no such key is available.
16205  * Since: 2.32
16206  */
16207
16208
16209 /**
16210  * g_drive_get_start_stop_type:
16211  * @drive: a #GDrive.
16212  *
16213  * Gets a hint about how a drive can be started/stopped.
16214  *
16215  * Returns: A value from the #GDriveStartStopType enumeration.
16216  * Since: 2.22
16217  */
16218
16219
16220 /**
16221  * g_drive_get_symbolic_icon:
16222  * @drive: a #GDrive.
16223  *
16224  * Gets the icon for @drive.
16225  *
16226  * Returns: (transfer full): symbolic #GIcon for the @drive. Free the returned object with g_object_unref().
16227  * Since: 2.34
16228  */
16229
16230
16231 /**
16232  * g_drive_get_volumes:
16233  * @drive: a #GDrive.
16234  *
16235  * Get a list of mountable volumes for @drive.
16236  *
16237  * The returned list should be freed with g_list_free(), after
16238  * its elements have been unreffed with g_object_unref().
16239  *
16240  * Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive.
16241  */
16242
16243
16244 /**
16245  * g_drive_has_media:
16246  * @drive: a #GDrive.
16247  *
16248  * Checks if the @drive has media. Note that the OS may not be polling
16249  * the drive for media changes; see g_drive_is_media_check_automatic()
16250  * for more details.
16251  *
16252  * Returns: %TRUE if @drive has media, %FALSE otherwise.
16253  */
16254
16255
16256 /**
16257  * g_drive_has_volumes:
16258  * @drive: a #GDrive.
16259  *
16260  * Check if @drive has any mountable volumes.
16261  *
16262  * Returns: %TRUE if the @drive contains volumes, %FALSE otherwise.
16263  */
16264
16265
16266 /**
16267  * g_drive_is_media_check_automatic:
16268  * @drive: a #GDrive.
16269  *
16270  * Checks if @drive is capabable of automatically detecting media changes.
16271  *
16272  * Returns: %TRUE if the @drive is capabable of automatically detecting media changes, %FALSE otherwise.
16273  */
16274
16275
16276 /**
16277  * g_drive_is_media_removable:
16278  * @drive: a #GDrive.
16279  *
16280  * Checks if the @drive supports removable media.
16281  *
16282  * Returns: %TRUE if @drive supports removable media, %FALSE otherwise.
16283  */
16284
16285
16286 /**
16287  * g_drive_poll_for_media:
16288  * @drive: a #GDrive.
16289  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16290  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16291  * @user_data: user data to pass to @callback
16292  *
16293  * Asynchronously polls @drive to see if media has been inserted or removed.
16294  *
16295  * When the operation is finished, @callback will be called.
16296  * You can then call g_drive_poll_for_media_finish() to obtain the
16297  * result of the operation.
16298  */
16299
16300
16301 /**
16302  * g_drive_poll_for_media_finish:
16303  * @drive: a #GDrive.
16304  * @result: a #GAsyncResult.
16305  * @error: a #GError, or %NULL
16306  *
16307  * Finishes an operation started with g_drive_poll_for_media() on a drive.
16308  *
16309  * Returns: %TRUE if the drive has been poll_for_mediaed successfully, %FALSE otherwise.
16310  */
16311
16312
16313 /**
16314  * g_drive_start:
16315  * @drive: a #GDrive.
16316  * @flags: flags affecting the start operation.
16317  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16318  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16319  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16320  * @user_data: user data to pass to @callback
16321  *
16322  * Asynchronously starts a drive.
16323  *
16324  * When the operation is finished, @callback will be called.
16325  * You can then call g_drive_start_finish() to obtain the
16326  * result of the operation.
16327  *
16328  * Since: 2.22
16329  */
16330
16331
16332 /**
16333  * g_drive_start_finish:
16334  * @drive: a #GDrive.
16335  * @result: a #GAsyncResult.
16336  * @error: a #GError, or %NULL
16337  *
16338  * Finishes starting a drive.
16339  *
16340  * Returns: %TRUE if the drive has been started successfully, %FALSE otherwise.
16341  * Since: 2.22
16342  */
16343
16344
16345 /**
16346  * g_drive_stop:
16347  * @drive: a #GDrive.
16348  * @flags: flags affecting the unmount if required for stopping.
16349  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
16350  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16351  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
16352  * @user_data: user data to pass to @callback
16353  *
16354  * Asynchronously stops a drive.
16355  *
16356  * When the operation is finished, @callback will be called.
16357  * You can then call g_drive_stop_finish() to obtain the
16358  * result of the operation.
16359  *
16360  * Since: 2.22
16361  */
16362
16363
16364 /**
16365  * g_drive_stop_finish:
16366  * @drive: a #GDrive.
16367  * @result: a #GAsyncResult.
16368  * @error: a #GError, or %NULL
16369  *
16370  * Finishes stopping a drive.
16371  *
16372  * Returns: %TRUE if the drive has been stopped successfully, %FALSE otherwise.
16373  * Since: 2.22
16374  */
16375
16376
16377 /**
16378  * g_emblem_get_icon:
16379  * @emblem: a #GEmblem from which the icon should be extracted.
16380  *
16381  * Gives back the icon from @emblem.
16382  *
16383  * Returns: (transfer none): a #GIcon. The returned object belongs to the emblem and should not be modified or freed.
16384  * Since: 2.18
16385  */
16386
16387
16388 /**
16389  * g_emblem_get_origin:
16390  * @emblem: a #GEmblem
16391  *
16392  * Gets the origin of the emblem.
16393  *
16394  * Returns: (transfer none): the origin of the emblem
16395  * Since: 2.18
16396  */
16397
16398
16399 /**
16400  * g_emblem_new:
16401  * @icon: a GIcon containing the icon.
16402  *
16403  * Creates a new emblem for @icon.
16404  *
16405  * Returns: a new #GEmblem.
16406  * Since: 2.18
16407  */
16408
16409
16410 /**
16411  * g_emblem_new_with_origin:
16412  * @icon: a GIcon containing the icon.
16413  * @origin: a GEmblemOrigin enum defining the emblem's origin
16414  *
16415  * Creates a new emblem for @icon.
16416  *
16417  * Returns: a new #GEmblem.
16418  * Since: 2.18
16419  */
16420
16421
16422 /**
16423  * g_emblemed_icon_add_emblem:
16424  * @emblemed: a #GEmblemedIcon
16425  * @emblem: a #GEmblem
16426  *
16427  * Adds @emblem to the #GList of #GEmblem <!-- -->s.
16428  *
16429  * Since: 2.18
16430  */
16431
16432
16433 /**
16434  * g_emblemed_icon_clear_emblems:
16435  * @emblemed: a #GEmblemedIcon
16436  *
16437  * Removes all the emblems from @icon.
16438  *
16439  * Since: 2.28
16440  */
16441
16442
16443 /**
16444  * g_emblemed_icon_get_emblems:
16445  * @emblemed: a #GEmblemedIcon
16446  *
16447  * Gets the list of emblems for the @icon.
16448  *
16449  * Returns: (element-type Gio.Emblem) (transfer none): a #GList of #GEmblem <!-- -->s that is owned by @emblemed
16450  * Since: 2.18
16451  */
16452
16453
16454 /**
16455  * g_emblemed_icon_get_icon:
16456  * @emblemed: a #GEmblemedIcon
16457  *
16458  * Gets the main icon for @emblemed.
16459  *
16460  * Returns: (transfer none): a #GIcon that is owned by @emblemed
16461  * Since: 2.18
16462  */
16463
16464
16465 /**
16466  * g_emblemed_icon_new:
16467  * @icon: a #GIcon
16468  * @emblem: (allow-none): a #GEmblem, or %NULL
16469  *
16470  * Creates a new emblemed icon for @icon with the emblem @emblem.
16471  *
16472  * Returns: (transfer full) (type GEmblemedIcon): a new #GIcon
16473  * Since: 2.18
16474  */
16475
16476
16477 /**
16478  * g_file_append_to:
16479  * @file: input #GFile
16480  * @flags: a set of #GFileCreateFlags
16481  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16482  * @error: a #GError, or %NULL
16483  *
16484  * Gets an output stream for appending data to the file.
16485  * If the file doesn't already exist it is created.
16486  *
16487  * By default files created are generally readable by everyone,
16488  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
16489  * will be made readable only to the current user, to the level that
16490  * is supported on the target filesystem.
16491  *
16492  * If @cancellable is not %NULL, then the operation can be cancelled
16493  * by triggering the cancellable object from another thread. If the
16494  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
16495  * returned.
16496  *
16497  * Some file systems don't allow all file names, and may return an
16498  * %G_IO_ERROR_INVALID_FILENAME error. If the file is a directory the
16499  * %G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are
16500  * possible too, and depend on what kind of filesystem the file is on.
16501  *
16502  * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
16503  */
16504
16505
16506 /**
16507  * g_file_append_to_async:
16508  * @file: input #GFile
16509  * @flags: a set of #GFileCreateFlags
16510  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
16511  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16512  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
16513  * @user_data: (closure): the data to pass to callback function
16514  *
16515  * Asynchronously opens @file for appending.
16516  *
16517  * For more details, see g_file_append_to() which is
16518  * the synchronous version of this call.
16519  *
16520  * When the operation is finished, @callback will be called.
16521  * You can then call g_file_append_to_finish() to get the result
16522  * of the operation.
16523  */
16524
16525
16526 /**
16527  * g_file_append_to_finish:
16528  * @file: input #GFile
16529  * @res: #GAsyncResult
16530  * @error: a #GError, or %NULL
16531  *
16532  * Finishes an asynchronous file append operation started with
16533  * g_file_append_to_async().
16534  *
16535  * Returns: (transfer full): a valid #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
16536  */
16537
16538
16539 /**
16540  * g_file_attribute_info_list_add:
16541  * @list: a #GFileAttributeInfoList.
16542  * @name: the name of the attribute to add.
16543  * @type: the #GFileAttributeType for the attribute.
16544  * @flags: #GFileAttributeInfoFlags for the attribute.
16545  *
16546  * Adds a new attribute with @name to the @list, setting
16547  * its @type and @flags.
16548  */
16549
16550
16551 /**
16552  * g_file_attribute_info_list_dup:
16553  * @list: a #GFileAttributeInfoList to duplicate.
16554  *
16555  * Makes a duplicate of a file attribute info list.
16556  *
16557  * Returns: a copy of the given @list.
16558  */
16559
16560
16561 /**
16562  * g_file_attribute_info_list_lookup:
16563  * @list: a #GFileAttributeInfoList.
16564  * @name: the name of the attribute to lookup.
16565  *
16566  * Gets the file attribute with the name @name from @list.
16567  *
16568  * Returns: a #GFileAttributeInfo for the @name, or %NULL if an attribute isn't found.
16569  */
16570
16571
16572 /**
16573  * g_file_attribute_info_list_new:
16574  *
16575  * Creates a new file attribute info list.
16576  *
16577  * Returns: a #GFileAttributeInfoList.
16578  */
16579
16580
16581 /**
16582  * g_file_attribute_info_list_ref:
16583  * @list: a #GFileAttributeInfoList to reference.
16584  *
16585  * References a file attribute info list.
16586  *
16587  * Returns: #GFileAttributeInfoList or %NULL on error.
16588  */
16589
16590
16591 /**
16592  * g_file_attribute_info_list_unref:
16593  * @list: The #GFileAttributeInfoList to unreference.
16594  *
16595  * Removes a reference from the given @list. If the reference count
16596  * falls to zero, the @list is deleted.
16597  */
16598
16599
16600 /**
16601  * g_file_attribute_matcher_enumerate_namespace:
16602  * @matcher: a #GFileAttributeMatcher.
16603  * @ns: a string containing a file attribute namespace.
16604  *
16605  * Checks if the matcher will match all of the keys in a given namespace.
16606  * This will always return %TRUE if a wildcard character is in use (e.g. if
16607  * matcher was created with "standard::*" and @ns is "standard", or if matcher was created
16608  * using "*" and namespace is anything.)
16609  *
16610  * TODO: this is awkwardly worded.
16611  *
16612  * Returns: %TRUE if the matcher matches all of the entries in the given @ns, %FALSE otherwise.
16613  */
16614
16615
16616 /**
16617  * g_file_attribute_matcher_enumerate_next:
16618  * @matcher: a #GFileAttributeMatcher.
16619  *
16620  * Gets the next matched attribute from a #GFileAttributeMatcher.
16621  *
16622  * Returns: a string containing the next attribute or %NULL if no more attribute exist.
16623  */
16624
16625
16626 /**
16627  * g_file_attribute_matcher_matches:
16628  * @matcher: a #GFileAttributeMatcher.
16629  * @attribute: a file attribute key.
16630  *
16631  * Checks if an attribute will be matched by an attribute matcher. If
16632  * the matcher was created with the "*" matching string, this function
16633  * will always return %TRUE.
16634  *
16635  * Returns: %TRUE if @attribute matches @matcher. %FALSE otherwise.
16636  */
16637
16638
16639 /**
16640  * g_file_attribute_matcher_matches_only:
16641  * @matcher: a #GFileAttributeMatcher.
16642  * @attribute: a file attribute key.
16643  *
16644  * Checks if a attribute matcher only matches a given attribute. Always
16645  * returns %FALSE if "*" was used when creating the matcher.
16646  *
16647  * Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
16648  */
16649
16650
16651 /**
16652  * g_file_attribute_matcher_new:
16653  * @attributes: an attribute string to match.
16654  *
16655  * Creates a new file attribute matcher, which matches attributes
16656  * against a given string. #GFileAttributeMatcher<!-- -->s are reference
16657  * counted structures, and are created with a reference count of 1. If
16658  * the number of references falls to 0, the #GFileAttributeMatcher is
16659  * automatically destroyed.
16660  *
16661  * The @attribute string should be formatted with specific keys separated
16662  * from namespaces with a double colon. Several "namespace::key" strings may be
16663  * concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
16664  * The wildcard "*" may be used to match all keys and namespaces, or
16665  * "namespace::*" will match all keys in a given namespace.
16666  *
16667  * Examples of strings to use:
16668  * <table>
16669  * <title>File Attribute Matcher strings and results</title>
16670  * <tgroup cols='2' align='left'><thead>
16671  * <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
16672  * <tbody>
16673  * <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
16674  * <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
16675  * <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
16676  * all keys in the unix namespace.</entry></row>
16677  * </tbody></tgroup>
16678  * </table>
16679  *
16680  * Returns: a #GFileAttributeMatcher.
16681  */
16682
16683
16684 /**
16685  * g_file_attribute_matcher_ref:
16686  * @matcher: a #GFileAttributeMatcher.
16687  *
16688  * References a file attribute matcher.
16689  *
16690  * Returns: a #GFileAttributeMatcher.
16691  */
16692
16693
16694 /**
16695  * g_file_attribute_matcher_subtract:
16696  * @matcher: Matcher to subtract from
16697  * @subtract: The matcher to subtract
16698  *
16699  * Subtracts all attributes of @subtract from @matcher and returns
16700  * a matcher that supports those attributes.
16701  *
16702  * Note that currently it is not possible to remove a single
16703  * attribute when the @matcher matches the whole namespace - or remove
16704  * a namespace or attribute when the matcher matches everything. This
16705  * is a limitation of the current implementation, but may be fixed
16706  * in the future.
16707  *
16708  * Returns: A file attribute matcher matching all attributes of @matcher that are not matched by @subtract
16709  */
16710
16711
16712 /**
16713  * g_file_attribute_matcher_to_string:
16714  * @matcher: (allow-none): a #GFileAttributeMatcher.
16715  *
16716  * Prints what the matcher is matching against. The format will be
16717  * equal to the format passed to g_file_attribute_matcher_new().
16718  * The output however, might not be identical, as the matcher may
16719  * decide to use a different order or omit needless parts.
16720  *
16721  * Returns: a string describing the attributes the matcher matches against or %NULL if @matcher was %NULL.
16722  * Since: 2.32
16723  */
16724
16725
16726 /**
16727  * g_file_attribute_matcher_unref:
16728  * @matcher: a #GFileAttributeMatcher.
16729  *
16730  * Unreferences @matcher. If the reference count falls below 1,
16731  * the @matcher is automatically freed.
16732  */
16733
16734
16735 /**
16736  * g_file_copy:
16737  * @source: input #GFile
16738  * @destination: destination #GFile
16739  * @flags: set of #GFileCopyFlags
16740  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16741  * @progress_callback: (allow-none) (scope call): function to callback with progress information, or %NULL if progress information is not needed
16742  * @progress_callback_data: (closure): user data to pass to @progress_callback
16743  * @error: #GError to set on error, or %NULL
16744  *
16745  * Copies the file @source to the location specified by @destination.
16746  * Can not handle recursive copies of directories.
16747  *
16748  * If the flag #G_FILE_COPY_OVERWRITE is specified an already
16749  * existing @destination file is overwritten.
16750  *
16751  * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
16752  * will be copied as symlinks, otherwise the target of the
16753  * @source symlink will be copied.
16754  *
16755  * If @cancellable is not %NULL, then the operation can be cancelled by
16756  * triggering the cancellable object from another thread. If the operation
16757  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
16758  *
16759  * If @progress_callback is not %NULL, then the operation can be monitored
16760  * by setting this to a #GFileProgressCallback function.
16761  * @progress_callback_data will be passed to this function. It is guaranteed
16762  * that this callback will be called after all data has been transferred with
16763  * the total number of bytes copied during the operation.
16764  *
16765  * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND error
16766  * is returned, independent on the status of the @destination.
16767  *
16768  * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then
16769  * the error %G_IO_ERROR_EXISTS is returned.
16770  *
16771  * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
16772  * error is returned. If trying to overwrite a directory with a directory the
16773  * %G_IO_ERROR_WOULD_MERGE error is returned.
16774  *
16775  * If the source is a directory and the target does not exist, or
16776  * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
16777  * %G_IO_ERROR_WOULD_RECURSE error is returned.
16778  *
16779  * If you are interested in copying the #GFile object itself (not the on-disk
16780  * file), see g_file_dup().
16781  *
16782  * Returns: %TRUE on success, %FALSE otherwise.
16783  */
16784
16785
16786 /**
16787  * g_file_copy_async: (skip)
16788  * @source: input #GFile
16789  * @destination: destination #GFile
16790  * @flags: set of #GFileCopyFlags
16791  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
16792  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16793  * @progress_callback: (allow-none): function to callback with progress information, or %NULL if progress information is not needed
16794  * @progress_callback_data: (closure): user data to pass to @progress_callback
16795  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
16796  * @user_data: the data to pass to callback function
16797  *
16798  * Copies the file @source to the location specified by @destination
16799  * asynchronously. For details of the behaviour, see g_file_copy().
16800  *
16801  * If @progress_callback is not %NULL, then that function that will be called
16802  * just like in g_file_copy(), however the callback will run in the main loop,
16803  * not in the thread that is doing the I/O operation.
16804  *
16805  * When the operation is finished, @callback will be called. You can then call
16806  * g_file_copy_finish() to get the result of the operation.
16807  */
16808
16809
16810 /**
16811  * g_file_copy_attributes:
16812  * @source: a #GFile with attributes
16813  * @destination: a #GFile to copy attributes to
16814  * @flags: a set of #GFileCopyFlags
16815  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16816  * @error: a #GError, %NULL to ignore
16817  *
16818  * Copies the file attributes from @source to @destination.
16819  *
16820  * Normally only a subset of the file attributes are copied,
16821  * those that are copies in a normal file copy operation
16822  * (which for instance does not include e.g. owner). However
16823  * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
16824  * all the metadata that is possible to copy is copied. This
16825  * is useful when implementing move by copy + delete source.
16826  *
16827  * Returns: %TRUE if the attributes were copied successfully, %FALSE otherwise.
16828  */
16829
16830
16831 /**
16832  * g_file_copy_finish:
16833  * @file: input #GFile
16834  * @res: a #GAsyncResult
16835  * @error: a #GError, or %NULL
16836  *
16837  * Finishes copying the file started with g_file_copy_async().
16838  *
16839  * Returns: a %TRUE on success, %FALSE on error.
16840  */
16841
16842
16843 /**
16844  * g_file_create:
16845  * @file: input #GFile
16846  * @flags: a set of #GFileCreateFlags
16847  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16848  * @error: a #GError, or %NULL
16849  *
16850  * Creates a new file and returns an output stream for writing to it.
16851  * The file must not already exist.
16852  *
16853  * By default files created are generally readable by everyone,
16854  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
16855  * will be made readable only to the current user, to the level
16856  * that is supported on the target filesystem.
16857  *
16858  * If @cancellable is not %NULL, then the operation can be cancelled
16859  * by triggering the cancellable object from another thread. If the
16860  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
16861  * returned.
16862  *
16863  * If a file or directory with this name already exists the
16864  * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
16865  * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
16866  * error, and if the name is to long %G_IO_ERROR_FILENAME_TOO_LONG will
16867  * be returned. Other errors are possible too, and depend on what kind
16868  * of filesystem the file is on.
16869  *
16870  * Returns: (transfer full): a #GFileOutputStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
16871  */
16872
16873
16874 /**
16875  * g_file_create_async:
16876  * @file: input #GFile
16877  * @flags: a set of #GFileCreateFlags
16878  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
16879  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16880  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
16881  * @user_data: (closure): the data to pass to callback function
16882  *
16883  * Asynchronously creates a new file and returns an output stream
16884  * for writing to it. The file must not already exist.
16885  *
16886  * For more details, see g_file_create() which is
16887  * the synchronous version of this call.
16888  *
16889  * When the operation is finished, @callback will be called.
16890  * You can then call g_file_create_finish() to get the result
16891  * of the operation.
16892  */
16893
16894
16895 /**
16896  * g_file_create_finish:
16897  * @file: input #GFile
16898  * @res: a #GAsyncResult
16899  * @error: a #GError, or %NULL
16900  *
16901  * Finishes an asynchronous file create operation started with
16902  * g_file_create_async().
16903  *
16904  * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
16905  */
16906
16907
16908 /**
16909  * g_file_create_readwrite:
16910  * @file: a #GFile
16911  * @flags: a set of #GFileCreateFlags
16912  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16913  * @error: return location for a #GError, or %NULL
16914  *
16915  * Creates a new file and returns a stream for reading and
16916  * writing to it. The file must not already exist.
16917  *
16918  * By default files created are generally readable by everyone,
16919  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
16920  * will be made readable only to the current user, to the level
16921  * that is supported on the target filesystem.
16922  *
16923  * If @cancellable is not %NULL, then the operation can be cancelled
16924  * by triggering the cancellable object from another thread. If the
16925  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
16926  * returned.
16927  *
16928  * If a file or directory with this name already exists, the
16929  * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
16930  * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
16931  * error, and if the name is too long, %G_IO_ERROR_FILENAME_TOO_LONG
16932  * will be returned. Other errors are possible too, and depend on what
16933  * kind of filesystem the file is on.
16934  *
16935  * Note that in many non-local file cases read and write streams are
16936  * not supported, so make sure you really need to do read and write
16937  * streaming, rather than just opening for reading or writing.
16938  *
16939  * Returns: (transfer full): a #GFileIOStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
16940  * Since: 2.22
16941  */
16942
16943
16944 /**
16945  * g_file_create_readwrite_async:
16946  * @file: input #GFile
16947  * @flags: a set of #GFileCreateFlags
16948  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
16949  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16950  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
16951  * @user_data: (closure): the data to pass to callback function
16952  *
16953  * Asynchronously creates a new file and returns a stream
16954  * for reading and writing to it. The file must not already exist.
16955  *
16956  * For more details, see g_file_create_readwrite() which is
16957  * the synchronous version of this call.
16958  *
16959  * When the operation is finished, @callback will be called.
16960  * You can then call g_file_create_readwrite_finish() to get
16961  * the result of the operation.
16962  *
16963  * Since: 2.22
16964  */
16965
16966
16967 /**
16968  * g_file_create_readwrite_finish:
16969  * @file: input #GFile
16970  * @res: a #GAsyncResult
16971  * @error: a #GError, or %NULL
16972  *
16973  * Finishes an asynchronous file create operation started with
16974  * g_file_create_readwrite_async().
16975  *
16976  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
16977  * Since: 2.22
16978  */
16979
16980
16981 /**
16982  * g_file_delete:
16983  * @file: input #GFile
16984  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
16985  * @error: a #GError, or %NULL
16986  *
16987  * Deletes a file. If the @file is a directory, it will only be
16988  * deleted if it is empty. This has the same semantics as g_unlink().
16989  *
16990  * If @cancellable is not %NULL, then the operation can be cancelled by
16991  * triggering the cancellable object from another thread. If the operation
16992  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
16993  *
16994  * Virtual: delete_file
16995  * Returns: %TRUE if the file was deleted. %FALSE otherwise.
16996  */
16997
16998
16999 /**
17000  * g_file_delete_async:
17001  * @file: input #GFile
17002  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17003  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17004  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17005  * @user_data: the data to pass to callback function
17006  *
17007  * Asynchronously delete a file. If the @file is a directory, it will
17008  * only be deleted if it is empty.  This has the same semantics as
17009  * g_unlink().
17010  *
17011  * Virtual: delete_file_async
17012  * Since: 2.34
17013  */
17014
17015
17016 /**
17017  * g_file_delete_finish:
17018  * @file: input #GFile
17019  * @result: a #GAsyncResult
17020  * @error: a #GError, or %NULL
17021  *
17022  * Finishes deleting a file started with g_file_delete_async().
17023  *
17024  * Virtual: delete_file_finish
17025  * Since: 2.34
17026  */
17027
17028
17029 /**
17030  * g_file_descriptor_based_get_fd:
17031  * @fd_based: a #GFileDescriptorBased.
17032  *
17033  * Gets the underlying file descriptor.
17034  *
17035  * Returns: The file descriptor
17036  * Since: 2.24
17037  */
17038
17039
17040 /**
17041  * g_file_dup:
17042  * @file: input #GFile
17043  *
17044  * Duplicates a #GFile handle. This operation does not duplicate
17045  * the actual file or directory represented by the #GFile; see
17046  * g_file_copy() if attempting to copy a file.
17047  *
17048  * This call does no blocking I/O.
17049  *
17050  * Returns: (transfer full): a new #GFile that is a duplicate of the given #GFile.
17051  */
17052
17053
17054 /**
17055  * g_file_eject_mountable:
17056  * @file: input #GFile
17057  * @flags: flags affecting the operation
17058  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17059  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
17060  * @user_data: (closure): the data to pass to callback function
17061  *
17062  * Starts an asynchronous eject on a mountable.
17063  * When this operation has completed, @callback will be called with
17064  * @user_user data, and the operation can be finalized with
17065  * g_file_eject_mountable_finish().
17066  *
17067  * If @cancellable is not %NULL, then the operation can be cancelled by
17068  * triggering the cancellable object from another thread. If the operation
17069  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17070  *
17071  * Deprecated: 2.22: Use g_file_eject_mountable_with_operation() instead.
17072  */
17073
17074
17075 /**
17076  * g_file_eject_mountable_finish:
17077  * @file: input #GFile
17078  * @result: a #GAsyncResult
17079  * @error: a #GError, or %NULL
17080  *
17081  * Finishes an asynchronous eject operation started by
17082  * g_file_eject_mountable().
17083  *
17084  * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17085  * Deprecated: 2.22: Use g_file_eject_mountable_with_operation_finish() instead.
17086  */
17087
17088
17089 /**
17090  * g_file_eject_mountable_with_operation:
17091  * @file: input #GFile
17092  * @flags: flags affecting the operation
17093  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
17094  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17095  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
17096  * @user_data: (closure): the data to pass to callback function
17097  *
17098  * Starts an asynchronous eject on a mountable.
17099  * When this operation has completed, @callback will be called with
17100  * @user_user data, and the operation can be finalized with
17101  * g_file_eject_mountable_with_operation_finish().
17102  *
17103  * If @cancellable is not %NULL, then the operation can be cancelled by
17104  * triggering the cancellable object from another thread. If the operation
17105  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17106  *
17107  * Since: 2.22
17108  */
17109
17110
17111 /**
17112  * g_file_eject_mountable_with_operation_finish:
17113  * @file: input #GFile
17114  * @result: a #GAsyncResult
17115  * @error: a #GError, or %NULL
17116  *
17117  * Finishes an asynchronous eject operation started by
17118  * g_file_eject_mountable_with_operation().
17119  *
17120  * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
17121  * Since: 2.22
17122  */
17123
17124
17125 /**
17126  * g_file_enumerate_children:
17127  * @file: input #GFile
17128  * @attributes: an attribute query string
17129  * @flags: a set of #GFileQueryInfoFlags
17130  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17131  * @error: #GError for error reporting
17132  *
17133  * Gets the requested information about the files in a directory.
17134  * The result is a #GFileEnumerator object that will give out
17135  * #GFileInfo objects for all the files in the directory.
17136  *
17137  * The @attributes value is a string that specifies the file
17138  * attributes that should be gathered. It is not an error if
17139  * it's not possible to read a particular requested attribute
17140  * from a file - it just won't be set. @attributes should
17141  * be a comma-separated list of attributes or attribute wildcards.
17142  * The wildcard "*" means all attributes, and a wildcard like
17143  * "standard::*" means all attributes in the standard namespace.
17144  * An example attribute query be "standard::*,owner::user".
17145  * The standard attributes are available as defines, like
17146  * #G_FILE_ATTRIBUTE_STANDARD_NAME.
17147  *
17148  * If @cancellable is not %NULL, then the operation can be cancelled
17149  * by triggering the cancellable object from another thread. If the
17150  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
17151  * returned.
17152  *
17153  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
17154  * be returned. If the file is not a directory, the %G_IO_ERROR_NOT_DIRECTORY
17155  * error will be returned. Other errors are possible too.
17156  *
17157  * Returns: (transfer full): A #GFileEnumerator if successful, %NULL on error. Free the returned object with g_object_unref().
17158  */
17159
17160
17161 /**
17162  * g_file_enumerate_children_async:
17163  * @file: input #GFile
17164  * @attributes: an attribute query string
17165  * @flags: a set of #GFileQueryInfoFlags
17166  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17167  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17168  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17169  * @user_data: (closure): the data to pass to callback function
17170  *
17171  * Asynchronously gets the requested information about the files
17172  * in a directory. The result is a #GFileEnumerator object that will
17173  * give out #GFileInfo objects for all the files in the directory.
17174  *
17175  * For more details, see g_file_enumerate_children() which is
17176  * the synchronous version of this call.
17177  *
17178  * When the operation is finished, @callback will be called. You can
17179  * then call g_file_enumerate_children_finish() to get the result of
17180  * the operation.
17181  */
17182
17183
17184 /**
17185  * g_file_enumerate_children_finish:
17186  * @file: input #GFile
17187  * @res: a #GAsyncResult
17188  * @error: a #GError
17189  *
17190  * Finishes an async enumerate children operation.
17191  * See g_file_enumerate_children_async().
17192  *
17193  * Returns: (transfer full): a #GFileEnumerator or %NULL if an error occurred. Free the returned object with g_object_unref().
17194  */
17195
17196
17197 /**
17198  * g_file_enumerator_close:
17199  * @enumerator: a #GFileEnumerator.
17200  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17201  * @error: location to store the error occurring, or %NULL to ignore
17202  *
17203  * Releases all resources used by this enumerator, making the
17204  * enumerator return %G_IO_ERROR_CLOSED on all calls.
17205  *
17206  * This will be automatically called when the last reference
17207  * is dropped, but you might want to call this function to make
17208  * sure resources are released as early as possible.
17209  *
17210  * Returns: #TRUE on success or #FALSE on error.
17211  */
17212
17213
17214 /**
17215  * g_file_enumerator_close_async:
17216  * @enumerator: a #GFileEnumerator.
17217  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17218  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17219  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17220  * @user_data: (closure): the data to pass to callback function
17221  *
17222  * Asynchronously closes the file enumerator.
17223  *
17224  * If @cancellable is not %NULL, then the operation can be cancelled by
17225  * triggering the cancellable object from another thread. If the operation
17226  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
17227  * g_file_enumerator_close_finish().
17228  */
17229
17230
17231 /**
17232  * g_file_enumerator_close_finish:
17233  * @enumerator: a #GFileEnumerator.
17234  * @result: a #GAsyncResult.
17235  * @error: a #GError location to store the error occurring, or %NULL to ignore.
17236  *
17237  * Finishes closing a file enumerator, started from g_file_enumerator_close_async().
17238  *
17239  * If the file enumerator was already closed when g_file_enumerator_close_async()
17240  * was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
17241  * return %FALSE. If the file enumerator had pending operation when the close
17242  * operation was started, then this function will report %G_IO_ERROR_PENDING, and
17243  * return %FALSE.  If @cancellable was not %NULL, then the operation may have been
17244  * cancelled by triggering the cancellable object from another thread. If the operation
17245  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
17246  * returned.
17247  *
17248  * Returns: %TRUE if the close operation has finished successfully.
17249  */
17250
17251
17252 /**
17253  * g_file_enumerator_get_child:
17254  * @enumerator: a #GFileEnumerator
17255  * @info: a #GFileInfo gotten from g_file_enumerator_next_file() or the async equivalents.
17256  *
17257  * Return a new #GFile which refers to the file named by @info in the source
17258  * directory of @enumerator.  This function is primarily intended to be used
17259  * inside loops with g_file_enumerator_next_file().
17260  *
17261  * This is a convenience method that's equivalent to:
17262  * |[
17263  *   gchar *name = g_file_info_get_name (info);
17264  *   GFile *child = g_file_get_child (g_file_enumerator_get_container (enumr),
17265  *                                    name);
17266  * ]|
17267  *
17268  * Returns: (transfer full): a #GFile for the #GFileInfo passed it.
17269  * Since: 2.36
17270  */
17271
17272
17273 /**
17274  * g_file_enumerator_get_container:
17275  * @enumerator: a #GFileEnumerator
17276  *
17277  * Get the #GFile container which is being enumerated.
17278  *
17279  * Returns: (transfer none): the #GFile which is being enumerated.
17280  * Since: 2.18
17281  */
17282
17283
17284 /**
17285  * g_file_enumerator_has_pending:
17286  * @enumerator: a #GFileEnumerator.
17287  *
17288  * Checks if the file enumerator has pending operations.
17289  *
17290  * Returns: %TRUE if the @enumerator has pending operations.
17291  */
17292
17293
17294 /**
17295  * g_file_enumerator_is_closed:
17296  * @enumerator: a #GFileEnumerator.
17297  *
17298  * Checks if the file enumerator has been closed.
17299  *
17300  * Returns: %TRUE if the @enumerator is closed.
17301  */
17302
17303
17304 /**
17305  * g_file_enumerator_next_file:
17306  * @enumerator: a #GFileEnumerator.
17307  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17308  * @error: location to store the error occurring, or %NULL to ignore
17309  *
17310  * Returns information for the next file in the enumerated object.
17311  * Will block until the information is available. The #GFileInfo
17312  * returned from this function will contain attributes that match the
17313  * attribute string that was passed when the #GFileEnumerator was created.
17314  *
17315  * On error, returns %NULL and sets @error to the error. If the
17316  * enumerator is at the end, %NULL will be returned and @error will
17317  * be unset.
17318  *
17319  * 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.
17320  */
17321
17322
17323 /**
17324  * g_file_enumerator_next_files_async:
17325  * @enumerator: a #GFileEnumerator.
17326  * @num_files: the number of file info objects to request
17327  * @io_priority: the <link linkend="io-priority">io priority</link> of the request.
17328  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17329  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17330  * @user_data: (closure): the data to pass to callback function
17331  *
17332  * Request information for a number of files from the enumerator asynchronously.
17333  * When all i/o for the operation is finished the @callback will be called with
17334  * the requested information.
17335  *
17336  * The callback can be called with less than @num_files files in case of error
17337  * or at the end of the enumerator. In case of a partial error the callback will
17338  * be called with any succeeding items and no error, and on the next request the
17339  * error will be reported. If a request is cancelled the callback will be called
17340  * with %G_IO_ERROR_CANCELLED.
17341  *
17342  * During an async request no other sync and async calls are allowed, and will
17343  * result in %G_IO_ERROR_PENDING errors.
17344  *
17345  * Any outstanding i/o request with higher priority (lower numerical value) will
17346  * be executed before an outstanding request with lower priority. Default
17347  * priority is %G_PRIORITY_DEFAULT.
17348  */
17349
17350
17351 /**
17352  * g_file_enumerator_next_files_finish:
17353  * @enumerator: a #GFileEnumerator.
17354  * @result: a #GAsyncResult.
17355  * @error: a #GError location to store the error occurring, or %NULL to ignore.
17356  *
17357  * Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
17358  *
17359  * 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.
17360  */
17361
17362
17363 /**
17364  * g_file_enumerator_set_pending:
17365  * @enumerator: a #GFileEnumerator.
17366  * @pending: a boolean value.
17367  *
17368  * Sets the file enumerator as having pending operations.
17369  */
17370
17371
17372 /**
17373  * g_file_equal:
17374  * @file1: the first #GFile
17375  * @file2: the second #GFile
17376  *
17377  * Checks equality of two given #GFiles.
17378  *
17379  * Note that two #GFiles that differ can still refer to the same
17380  * file on the filesystem due to various forms of filename
17381  * aliasing.
17382  *
17383  * This call does no blocking I/O.
17384  *
17385  * Returns: %TRUE if @file1 and @file2 are equal. %FALSE if either is not a #GFile.
17386  */
17387
17388
17389 /**
17390  * g_file_find_enclosing_mount:
17391  * @file: input #GFile
17392  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17393  * @error: a #GError
17394  *
17395  * Gets a #GMount for the #GFile.
17396  *
17397  * If the #GFileIface for @file does not have a mount (e.g.
17398  * possibly a remote share), @error will be set to %G_IO_ERROR_NOT_FOUND
17399  * and %NULL will be returned.
17400  *
17401  * If @cancellable is not %NULL, then the operation can be cancelled by
17402  * triggering the cancellable object from another thread. If the operation
17403  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17404  *
17405  * Returns: (transfer full): a #GMount where the @file is located or %NULL on error. Free the returned object with g_object_unref().
17406  */
17407
17408
17409 /**
17410  * g_file_find_enclosing_mount_async:
17411  * @file: a #GFile
17412  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
17413  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17414  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17415  * @user_data: (closure): the data to pass to callback function
17416  *
17417  * Asynchronously gets the mount for the file.
17418  *
17419  * For more details, see g_file_find_enclosing_mount() which is
17420  * the synchronous version of this call.
17421  *
17422  * When the operation is finished, @callback will be called.
17423  * You can then call g_file_find_enclosing_mount_finish() to
17424  * get the result of the operation.
17425  */
17426
17427
17428 /**
17429  * g_file_find_enclosing_mount_finish:
17430  * @file: a #GFile
17431  * @res: a #GAsyncResult
17432  * @error: a #GError
17433  *
17434  * Finishes an asynchronous find mount request.
17435  * See g_file_find_enclosing_mount_async().
17436  *
17437  * Returns: (transfer full): #GMount for given @file or %NULL on error. Free the returned object with g_object_unref().
17438  */
17439
17440
17441 /**
17442  * g_file_get_basename:
17443  * @file: input #GFile
17444  *
17445  * Gets the base name (the last component of the path) for a given #GFile.
17446  *
17447  * If called for the top level of a system (such as the filesystem root
17448  * or a uri like sftp://host/) it will return a single directory separator
17449  * (and on Windows, possibly a drive letter).
17450  *
17451  * The base name is a byte string (not UTF-8). It has no defined encoding
17452  * or rules other than it may not contain zero bytes.  If you want to use
17453  * filenames in a user interface you should use the display name that you
17454  * can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
17455  * attribute with g_file_query_info().
17456  *
17457  * This call does no blocking I/O.
17458  *
17459  * 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.
17460  */
17461
17462
17463 /**
17464  * g_file_get_child:
17465  * @file: input #GFile
17466  * @name: string containing the child's basename
17467  *
17468  * Gets a child of @file with basename equal to @name.
17469  *
17470  * Note that the file with that specific name might not exist, but
17471  * you can still have a #GFile that points to it. You can use this
17472  * for instance to create that file.
17473  *
17474  * This call does no blocking I/O.
17475  *
17476  * Returns: (transfer full): a #GFile to a child specified by @name. Free the returned object with g_object_unref().
17477  */
17478
17479
17480 /**
17481  * g_file_get_child_for_display_name:
17482  * @file: input #GFile
17483  * @display_name: string to a possible child
17484  * @error: return location for an error
17485  *
17486  * Gets the child of @file for a given @display_name (i.e. a UTF-8
17487  * version of the name). If this function fails, it returns %NULL
17488  * and @error will be set. This is very useful when constructing a
17489  * #GFile for a new file and the user entered the filename in the
17490  * user interface, for instance when you select a directory and
17491  * type a filename in the file selector.
17492  *
17493  * This call does no blocking I/O.
17494  *
17495  * 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().
17496  */
17497
17498
17499 /**
17500  * g_file_get_parent:
17501  * @file: input #GFile
17502  *
17503  * Gets the parent directory for the @file.
17504  * If the @file represents the root directory of the
17505  * file system, then %NULL will be returned.
17506  *
17507  * This call does no blocking I/O.
17508  *
17509  * 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().
17510  */
17511
17512
17513 /**
17514  * g_file_get_parse_name:
17515  * @file: input #GFile
17516  *
17517  * Gets the parse name of the @file.
17518  * A parse name is a UTF-8 string that describes the
17519  * file such that one can get the #GFile back using
17520  * g_file_parse_name().
17521  *
17522  * This is generally used to show the #GFile as a nice
17523  * full-pathname kind of string in a user interface,
17524  * like in a location entry.
17525  *
17526  * For local files with names that can safely be converted
17527  * to UTF-8 the pathname is used, otherwise the IRI is used
17528  * (a form of URI that allows UTF-8 characters unescaped).
17529  *
17530  * This call does no blocking I/O.
17531  *
17532  * Returns: a string containing the #GFile's parse name. The returned string should be freed with g_free() when no longer needed.
17533  */
17534
17535
17536 /**
17537  * g_file_get_path:
17538  * @file: input #GFile
17539  *
17540  * Gets the local pathname for #GFile, if one exists.
17541  *
17542  * This call does no blocking I/O.
17543  *
17544  * 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.
17545  */
17546
17547
17548 /**
17549  * g_file_get_relative_path:
17550  * @parent: input #GFile
17551  * @descendant: input #GFile
17552  *
17553  * Gets the path for @descendant relative to @parent.
17554  *
17555  * This call does no blocking I/O.
17556  *
17557  * 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.
17558  */
17559
17560
17561 /**
17562  * g_file_get_uri:
17563  * @file: input #GFile
17564  *
17565  * Gets the URI for the @file.
17566  *
17567  * This call does no blocking I/O.
17568  *
17569  * Returns: a string containing the #GFile's URI. The returned string should be freed with g_free() when no longer needed.
17570  */
17571
17572
17573 /**
17574  * g_file_get_uri_scheme:
17575  * @file: input #GFile
17576  *
17577  * Gets the URI scheme for a #GFile.
17578  * RFC 3986 decodes the scheme as:
17579  * <programlisting>
17580  * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
17581  * </programlisting>
17582  * Common schemes include "file", "http", "ftp", etc.
17583  *
17584  * This call does no blocking I/O.
17585  *
17586  * Returns: a string containing the URI scheme for the given #GFile. The returned string should be freed with g_free() when no longer needed.
17587  */
17588
17589
17590 /**
17591  * g_file_has_parent:
17592  * @file: input #GFile
17593  * @parent: (allow-none): the parent to check for, or %NULL
17594  *
17595  * Checks if @file has a parent, and optionally, if it is @parent.
17596  *
17597  * If @parent is %NULL then this function returns %TRUE if @file has any
17598  * parent at all.  If @parent is non-%NULL then %TRUE is only returned
17599  * if @file is a child of @parent.
17600  *
17601  * Returns: %TRUE if @file is a child of @parent (or any parent in the case that @parent is %NULL).
17602  * Since: 2.24
17603  */
17604
17605
17606 /**
17607  * g_file_has_prefix:
17608  * @file: input #GFile
17609  * @prefix: input #GFile
17610  *
17611  * Checks whether @file has the prefix specified by @prefix.
17612  *
17613  * In other words, if the names of initial elements of @file's
17614  * pathname match @prefix. Only full pathname elements are matched,
17615  * so a path like /foo is not considered a prefix of /foobar, only
17616  * of /foo/bar.
17617  *
17618  * This call does no I/O, as it works purely on names. As such it can
17619  * sometimes return %FALSE even if @file is inside a @prefix (from a
17620  * filesystem point of view), because the prefix of @file is an alias
17621  * of @prefix.
17622  *
17623  * Virtual: prefix_matches
17624  * Returns: %TRUE if the @files's parent, grandparent, etc is @prefix, %FALSE otherwise.
17625  */
17626
17627
17628 /**
17629  * g_file_has_uri_scheme:
17630  * @file: input #GFile
17631  * @uri_scheme: a string containing a URI scheme
17632  *
17633  * Checks to see if a #GFile has a given URI scheme.
17634  *
17635  * This call does no blocking I/O.
17636  *
17637  * Returns: %TRUE if #GFile's backend supports the given URI scheme, %FALSE if URI scheme is %NULL, not supported, or #GFile is invalid.
17638  */
17639
17640
17641 /**
17642  * g_file_hash:
17643  * @file: (type GFile): #gconstpointer to a #GFile
17644  *
17645  * Creates a hash value for a #GFile.
17646  *
17647  * This call does no blocking I/O.
17648  *
17649  * Virtual: hash
17650  * 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.
17651  */
17652
17653
17654 /**
17655  * g_file_icon_get_file:
17656  * @icon: a #GIcon.
17657  *
17658  * Gets the #GFile associated with the given @icon.
17659  *
17660  * Returns: (transfer none): a #GFile, or %NULL.
17661  */
17662
17663
17664 /**
17665  * g_file_icon_new:
17666  * @file: a #GFile.
17667  *
17668  * Creates a new icon for a file.
17669  *
17670  * Returns: (transfer full) (type GFileIcon): a #GIcon for the given @file, or %NULL on error.
17671  */
17672
17673
17674 /**
17675  * g_file_info_clear_status:
17676  * @info: a #GFileInfo.
17677  *
17678  * Clears the status information from @info.
17679  */
17680
17681
17682 /**
17683  * g_file_info_copy_into:
17684  * @src_info: source to copy attributes from.
17685  * @dest_info: destination to copy attributes to.
17686  *
17687  * Copies all of the <link linkend="gio-GFileAttribute">GFileAttribute</link>s
17688  * from @src_info to @dest_info.
17689  */
17690
17691
17692 /**
17693  * g_file_info_dup:
17694  * @other: a #GFileInfo.
17695  *
17696  * Duplicates a file info structure.
17697  *
17698  * Returns: (transfer full): a duplicate #GFileInfo of @other.
17699  */
17700
17701
17702 /**
17703  * g_file_info_get_attribute_as_string:
17704  * @info: a #GFileInfo.
17705  * @attribute: a file attribute key.
17706  *
17707  * Gets the value of a attribute, formated as a string.
17708  * This escapes things as needed to make the string valid
17709  * utf8.
17710  *
17711  * Returns: a UTF-8 string associated with the given @attribute. When you're done with the string it must be freed with g_free().
17712  */
17713
17714
17715 /**
17716  * g_file_info_get_attribute_boolean:
17717  * @info: a #GFileInfo.
17718  * @attribute: a file attribute key.
17719  *
17720  * Gets the value of a boolean attribute. If the attribute does not
17721  * contain a boolean value, %FALSE will be returned.
17722  *
17723  * Returns: the boolean value contained within the attribute.
17724  */
17725
17726
17727 /**
17728  * g_file_info_get_attribute_byte_string:
17729  * @info: a #GFileInfo.
17730  * @attribute: a file attribute key.
17731  *
17732  * Gets the value of a byte string attribute. If the attribute does
17733  * not contain a byte string, %NULL will be returned.
17734  *
17735  * Returns: the contents of the @attribute value as a byte string, or %NULL otherwise.
17736  */
17737
17738
17739 /**
17740  * g_file_info_get_attribute_data:
17741  * @info: a #GFileInfo
17742  * @attribute: a file attribute key
17743  * @type: (out) (allow-none): return location for the attribute type, or %NULL
17744  * @value_pp: (out) (allow-none): return location for the attribute value, or %NULL
17745  * @status: (out) (allow-none): return location for the attribute status, or %NULL
17746  *
17747  * Gets the attribute type, value and status for an attribute key.
17748  *
17749  * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
17750  */
17751
17752
17753 /**
17754  * g_file_info_get_attribute_int32:
17755  * @info: a #GFileInfo.
17756  * @attribute: a file attribute key.
17757  *
17758  * Gets a signed 32-bit integer contained within the attribute. If the
17759  * attribute does not contain a signed 32-bit integer, or is invalid,
17760  * 0 will be returned.
17761  *
17762  * Returns: a signed 32-bit integer from the attribute.
17763  */
17764
17765
17766 /**
17767  * g_file_info_get_attribute_int64:
17768  * @info: a #GFileInfo.
17769  * @attribute: a file attribute key.
17770  *
17771  * Gets a signed 64-bit integer contained within the attribute. If the
17772  * attribute does not contain an signed 64-bit integer, or is invalid,
17773  * 0 will be returned.
17774  *
17775  * Returns: a signed 64-bit integer from the attribute.
17776  */
17777
17778
17779 /**
17780  * g_file_info_get_attribute_object:
17781  * @info: a #GFileInfo.
17782  * @attribute: a file attribute key.
17783  *
17784  * Gets the value of a #GObject attribute. If the attribute does
17785  * not contain a #GObject, %NULL will be returned.
17786  *
17787  * Returns: (transfer none): a #GObject associated with the given @attribute, or %NULL otherwise.
17788  */
17789
17790
17791 /**
17792  * g_file_info_get_attribute_status:
17793  * @info: a #GFileInfo
17794  * @attribute: a file attribute key
17795  *
17796  * Gets the attribute status for an attribute key.
17797  *
17798  * Returns: a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
17799  */
17800
17801
17802 /**
17803  * g_file_info_get_attribute_string:
17804  * @info: a #GFileInfo.
17805  * @attribute: a file attribute key.
17806  *
17807  * Gets the value of a string attribute. If the attribute does
17808  * not contain a string, %NULL will be returned.
17809  *
17810  * Returns: the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
17811  */
17812
17813
17814 /**
17815  * g_file_info_get_attribute_stringv:
17816  * @info: a #GFileInfo.
17817  * @attribute: a file attribute key.
17818  *
17819  * Gets the value of a stringv attribute. If the attribute does
17820  * not contain a stringv, %NULL will be returned.
17821  *
17822  * Returns: (transfer none): the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
17823  * Since: 2.22
17824  */
17825
17826
17827 /**
17828  * g_file_info_get_attribute_type:
17829  * @info: a #GFileInfo.
17830  * @attribute: a file attribute key.
17831  *
17832  * Gets the attribute type for an attribute key.
17833  *
17834  * Returns: a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
17835  */
17836
17837
17838 /**
17839  * g_file_info_get_attribute_uint32:
17840  * @info: a #GFileInfo.
17841  * @attribute: a file attribute key.
17842  *
17843  * Gets an unsigned 32-bit integer contained within the attribute. If the
17844  * attribute does not contain an unsigned 32-bit integer, or is invalid,
17845  * 0 will be returned.
17846  *
17847  * Returns: an unsigned 32-bit integer from the attribute.
17848  */
17849
17850
17851 /**
17852  * g_file_info_get_attribute_uint64:
17853  * @info: a #GFileInfo.
17854  * @attribute: a file attribute key.
17855  *
17856  * Gets a unsigned 64-bit integer contained within the attribute. If the
17857  * attribute does not contain an unsigned 64-bit integer, or is invalid,
17858  * 0 will be returned.
17859  *
17860  * Returns: a unsigned 64-bit integer from the attribute.
17861  */
17862
17863
17864 /**
17865  * g_file_info_get_content_type:
17866  * @info: a #GFileInfo.
17867  *
17868  * Gets the file's content type.
17869  *
17870  * Returns: a string containing the file's content type.
17871  */
17872
17873
17874 /**
17875  * g_file_info_get_deletion_date:
17876  * @info: a #GFileInfo.
17877  *
17878  * Returns the #GDateTime representing the deletion date of the file, as
17879  * available in G_FILE_ATTRIBUTE_TRASH_DELETION_DATE. If the
17880  * G_FILE_ATTRIBUTE_TRASH_DELETION_DATE attribute is unset, %NULL is returned.
17881  *
17882  * Returns: a #GDateTime, or %NULL.
17883  * Since: 2.36
17884  */
17885
17886
17887 /**
17888  * g_file_info_get_display_name:
17889  * @info: a #GFileInfo.
17890  *
17891  * Gets a display name for a file.
17892  *
17893  * Returns: a string containing the display name.
17894  */
17895
17896
17897 /**
17898  * g_file_info_get_edit_name:
17899  * @info: a #GFileInfo.
17900  *
17901  * Gets the edit name for a file.
17902  *
17903  * Returns: a string containing the edit name.
17904  */
17905
17906
17907 /**
17908  * g_file_info_get_etag:
17909  * @info: a #GFileInfo.
17910  *
17911  * Gets the <link linkend="gfile-etag">entity tag</link> for a given
17912  * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
17913  *
17914  * Returns: a string containing the value of the "etag:value" attribute.
17915  */
17916
17917
17918 /**
17919  * g_file_info_get_file_type:
17920  * @info: a #GFileInfo.
17921  *
17922  * Gets a file's type (whether it is a regular file, symlink, etc).
17923  * This is different from the file's content type, see g_file_info_get_content_type().
17924  *
17925  * Returns: a #GFileType for the given file.
17926  */
17927
17928
17929 /**
17930  * g_file_info_get_icon:
17931  * @info: a #GFileInfo.
17932  *
17933  * Gets the icon for a file.
17934  *
17935  * Returns: (transfer none): #GIcon for the given @info.
17936  */
17937
17938
17939 /**
17940  * g_file_info_get_is_backup:
17941  * @info: a #GFileInfo.
17942  *
17943  * Checks if a file is a backup file.
17944  *
17945  * Returns: %TRUE if file is a backup file, %FALSE otherwise.
17946  */
17947
17948
17949 /**
17950  * g_file_info_get_is_hidden:
17951  * @info: a #GFileInfo.
17952  *
17953  * Checks if a file is hidden.
17954  *
17955  * Returns: %TRUE if the file is a hidden file, %FALSE otherwise.
17956  */
17957
17958
17959 /**
17960  * g_file_info_get_is_symlink:
17961  * @info: a #GFileInfo.
17962  *
17963  * Checks if a file is a symlink.
17964  *
17965  * Returns: %TRUE if the given @info is a symlink.
17966  */
17967
17968
17969 /**
17970  * g_file_info_get_modification_time:
17971  * @info: a #GFileInfo.
17972  * @result: (out caller-allocates): a #GTimeVal.
17973  *
17974  * Gets the modification time of the current @info and sets it
17975  * in @result.
17976  */
17977
17978
17979 /**
17980  * g_file_info_get_name:
17981  * @info: a #GFileInfo.
17982  *
17983  * Gets the name for a file.
17984  *
17985  * Returns: a string containing the file name.
17986  */
17987
17988
17989 /**
17990  * g_file_info_get_size:
17991  * @info: a #GFileInfo.
17992  *
17993  * Gets the file's size.
17994  *
17995  * Returns: a #goffset containing the file's size.
17996  */
17997
17998
17999 /**
18000  * g_file_info_get_sort_order:
18001  * @info: a #GFileInfo.
18002  *
18003  * Gets the value of the sort_order attribute from the #GFileInfo.
18004  * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18005  *
18006  * Returns: a #gint32 containing the value of the "standard::sort_order" attribute.
18007  */
18008
18009
18010 /**
18011  * g_file_info_get_symbolic_icon:
18012  * @info: a #GFileInfo.
18013  *
18014  * Gets the symbolic icon for a file.
18015  *
18016  * Returns: (transfer none): #GIcon for the given @info.
18017  * Since: 2.34
18018  */
18019
18020
18021 /**
18022  * g_file_info_get_symlink_target:
18023  * @info: a #GFileInfo.
18024  *
18025  * Gets the symlink target for a given #GFileInfo.
18026  *
18027  * Returns: a string containing the symlink target.
18028  */
18029
18030
18031 /**
18032  * g_file_info_has_attribute:
18033  * @info: a #GFileInfo.
18034  * @attribute: a file attribute key.
18035  *
18036  * Checks if a file info structure has an attribute named @attribute.
18037  *
18038  * Returns: %TRUE if @Ginfo has an attribute named @attribute, %FALSE otherwise.
18039  */
18040
18041
18042 /**
18043  * g_file_info_has_namespace:
18044  * @info: a #GFileInfo.
18045  * @name_space: a file attribute namespace.
18046  *
18047  * Checks if a file info structure has an attribute in the
18048  * specified @name_space.
18049  *
18050  * Returns: %TRUE if @Ginfo has an attribute in @name_space, %FALSE otherwise.
18051  * Since: 2.22
18052  */
18053
18054
18055 /**
18056  * g_file_info_list_attributes:
18057  * @info: a #GFileInfo.
18058  * @name_space: a file attribute key's namespace.
18059  *
18060  * Lists the file info structure's attributes.
18061  *
18062  * 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.
18063  */
18064
18065
18066 /**
18067  * g_file_info_new:
18068  *
18069  * Creates a new file info structure.
18070  *
18071  * Returns: a #GFileInfo.
18072  */
18073
18074
18075 /**
18076  * g_file_info_remove_attribute:
18077  * @info: a #GFileInfo.
18078  * @attribute: a file attribute key.
18079  *
18080  * Removes all cases of @attribute from @info if it exists.
18081  */
18082
18083
18084 /**
18085  * g_file_info_set_attribute:
18086  * @info: a #GFileInfo.
18087  * @attribute: a file attribute key.
18088  * @type: a #GFileAttributeType
18089  * @value_p: pointer to the value
18090  *
18091  * Sets the @attribute to contain the given value, if possible. To unset the
18092  * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
18093  */
18094
18095
18096 /**
18097  * g_file_info_set_attribute_boolean:
18098  * @info: a #GFileInfo.
18099  * @attribute: a file attribute key.
18100  * @attr_value: a boolean value.
18101  *
18102  * Sets the @attribute to contain the given @attr_value,
18103  * if possible.
18104  */
18105
18106
18107 /**
18108  * g_file_info_set_attribute_byte_string:
18109  * @info: a #GFileInfo.
18110  * @attribute: a file attribute key.
18111  * @attr_value: a byte string.
18112  *
18113  * Sets the @attribute to contain the given @attr_value,
18114  * if possible.
18115  */
18116
18117
18118 /**
18119  * g_file_info_set_attribute_int32:
18120  * @info: a #GFileInfo.
18121  * @attribute: a file attribute key.
18122  * @attr_value: a signed 32-bit integer
18123  *
18124  * Sets the @attribute to contain the given @attr_value,
18125  * if possible.
18126  */
18127
18128
18129 /**
18130  * g_file_info_set_attribute_int64:
18131  * @info: a #GFileInfo.
18132  * @attribute: attribute name to set.
18133  * @attr_value: int64 value to set attribute to.
18134  *
18135  * Sets the @attribute to contain the given @attr_value,
18136  * if possible.
18137  */
18138
18139
18140 /**
18141  * g_file_info_set_attribute_mask:
18142  * @info: a #GFileInfo.
18143  * @mask: a #GFileAttributeMatcher.
18144  *
18145  * Sets @mask on @info to match specific attribute types.
18146  */
18147
18148
18149 /**
18150  * g_file_info_set_attribute_object:
18151  * @info: a #GFileInfo.
18152  * @attribute: a file attribute key.
18153  * @attr_value: a #GObject.
18154  *
18155  * Sets the @attribute to contain the given @attr_value,
18156  * if possible.
18157  */
18158
18159
18160 /**
18161  * g_file_info_set_attribute_status:
18162  * @info: a #GFileInfo
18163  * @attribute: a file attribute key
18164  * @status: a #GFileAttributeStatus
18165  *
18166  * Sets the attribute status for an attribute key. This is only
18167  * needed by external code that implement g_file_set_attributes_from_info()
18168  * or similar functions.
18169  *
18170  * The attribute must exist in @info for this to work. Otherwise %FALSE
18171  * is returned and @info is unchanged.
18172  *
18173  * Returns: %TRUE if the status was changed, %FALSE if the key was not set.
18174  * Since: 2.22
18175  */
18176
18177
18178 /**
18179  * g_file_info_set_attribute_string:
18180  * @info: a #GFileInfo.
18181  * @attribute: a file attribute key.
18182  * @attr_value: a UTF-8 string.
18183  *
18184  * Sets the @attribute to contain the given @attr_value,
18185  * if possible.
18186  */
18187
18188
18189 /**
18190  * g_file_info_set_attribute_stringv:
18191  * @info: a #GFileInfo.
18192  * @attribute: a file attribute key
18193  * @attr_value: (array) (element-type utf8): a %NULL terminated array of UTF-8 strings.
18194  *
18195  * Sets the @attribute to contain the given @attr_value,
18196  * if possible.
18197  *
18198  * Sinze: 2.22
18199  */
18200
18201
18202 /**
18203  * g_file_info_set_attribute_uint32:
18204  * @info: a #GFileInfo.
18205  * @attribute: a file attribute key.
18206  * @attr_value: an unsigned 32-bit integer.
18207  *
18208  * Sets the @attribute to contain the given @attr_value,
18209  * if possible.
18210  */
18211
18212
18213 /**
18214  * g_file_info_set_attribute_uint64:
18215  * @info: a #GFileInfo.
18216  * @attribute: a file attribute key.
18217  * @attr_value: an unsigned 64-bit integer.
18218  *
18219  * Sets the @attribute to contain the given @attr_value,
18220  * if possible.
18221  */
18222
18223
18224 /**
18225  * g_file_info_set_content_type:
18226  * @info: a #GFileInfo.
18227  * @content_type: a content type. See <link linkend="gio-GContentType">GContentType</link>.
18228  *
18229  * Sets the content type attribute for a given #GFileInfo.
18230  * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
18231  */
18232
18233
18234 /**
18235  * g_file_info_set_display_name:
18236  * @info: a #GFileInfo.
18237  * @display_name: a string containing a display name.
18238  *
18239  * Sets the display name for the current #GFileInfo.
18240  * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
18241  */
18242
18243
18244 /**
18245  * g_file_info_set_edit_name:
18246  * @info: a #GFileInfo.
18247  * @edit_name: a string containing an edit name.
18248  *
18249  * Sets the edit name for the current file.
18250  * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
18251  */
18252
18253
18254 /**
18255  * g_file_info_set_file_type:
18256  * @info: a #GFileInfo.
18257  * @type: a #GFileType.
18258  *
18259  * Sets the file type in a #GFileInfo to @type.
18260  * See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
18261  */
18262
18263
18264 /**
18265  * g_file_info_set_icon:
18266  * @info: a #GFileInfo.
18267  * @icon: a #GIcon.
18268  *
18269  * Sets the icon for a given #GFileInfo.
18270  * See %G_FILE_ATTRIBUTE_STANDARD_ICON.
18271  */
18272
18273
18274 /**
18275  * g_file_info_set_is_hidden:
18276  * @info: a #GFileInfo.
18277  * @is_hidden: a #gboolean.
18278  *
18279  * Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
18280  * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
18281  */
18282
18283
18284 /**
18285  * g_file_info_set_is_symlink:
18286  * @info: a #GFileInfo.
18287  * @is_symlink: a #gboolean.
18288  *
18289  * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
18290  * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
18291  */
18292
18293
18294 /**
18295  * g_file_info_set_modification_time:
18296  * @info: a #GFileInfo.
18297  * @mtime: a #GTimeVal.
18298  *
18299  * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
18300  * info to the given time value.
18301  */
18302
18303
18304 /**
18305  * g_file_info_set_name:
18306  * @info: a #GFileInfo.
18307  * @name: a string containing a name.
18308  *
18309  * Sets the name attribute for the current #GFileInfo.
18310  * See %G_FILE_ATTRIBUTE_STANDARD_NAME.
18311  */
18312
18313
18314 /**
18315  * g_file_info_set_size:
18316  * @info: a #GFileInfo.
18317  * @size: a #goffset containing the file's size.
18318  *
18319  * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
18320  * to the given size.
18321  */
18322
18323
18324 /**
18325  * g_file_info_set_sort_order:
18326  * @info: a #GFileInfo.
18327  * @sort_order: a sort order integer.
18328  *
18329  * Sets the sort order attribute in the file info structure. See
18330  * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
18331  */
18332
18333
18334 /**
18335  * g_file_info_set_symbolic_icon:
18336  * @info: a #GFileInfo.
18337  * @icon: a #GIcon.
18338  *
18339  * Sets the symbolic icon for a given #GFileInfo.
18340  * See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
18341  *
18342  * Since: 2.34
18343  */
18344
18345
18346 /**
18347  * g_file_info_set_symlink_target:
18348  * @info: a #GFileInfo.
18349  * @symlink_target: a static string containing a path to a symlink target.
18350  *
18351  * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
18352  * to the given symlink target.
18353  */
18354
18355
18356 /**
18357  * g_file_info_unset_attribute_mask:
18358  * @info: #GFileInfo.
18359  *
18360  * Unsets a mask set by g_file_info_set_attribute_mask(), if one
18361  * is set.
18362  */
18363
18364
18365 /**
18366  * g_file_input_stream_query_info:
18367  * @stream: a #GFileInputStream.
18368  * @attributes: a file attribute query string.
18369  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18370  * @error: a #GError location to store the error occurring, or %NULL to ignore.
18371  *
18372  * Queries a file input stream the given @attributes. This function blocks
18373  * while querying the stream. For the asynchronous (non-blocking) version
18374  * of this function, see g_file_input_stream_query_info_async(). While the
18375  * stream is blocked, the stream will set the pending flag internally, and
18376  * any other operations on the stream will fail with %G_IO_ERROR_PENDING.
18377  *
18378  * Returns: (transfer full): a #GFileInfo, or %NULL on error.
18379  */
18380
18381
18382 /**
18383  * g_file_input_stream_query_info_async:
18384  * @stream: a #GFileInputStream.
18385  * @attributes: a file attribute query string.
18386  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18387  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18388  * @callback: (scope async): callback to call when the request is satisfied
18389  * @user_data: (closure): the data to pass to callback function
18390  *
18391  * Queries the stream information asynchronously.
18392  * When the operation is finished @callback will be called.
18393  * You can then call g_file_input_stream_query_info_finish()
18394  * to get the result of the operation.
18395  *
18396  * For the synchronous version of this function,
18397  * see g_file_input_stream_query_info().
18398  *
18399  * If @cancellable is not %NULL, then the operation can be cancelled by
18400  * triggering the cancellable object from another thread. If the operation
18401  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set
18402  */
18403
18404
18405 /**
18406  * g_file_input_stream_query_info_finish:
18407  * @stream: a #GFileInputStream.
18408  * @result: a #GAsyncResult.
18409  * @error: a #GError location to store the error occurring, or %NULL to ignore.
18410  *
18411  * Finishes an asynchronous info query operation.
18412  *
18413  * Returns: (transfer full): #GFileInfo.
18414  */
18415
18416
18417 /**
18418  * g_file_io_stream_get_etag:
18419  * @stream: a #GFileIOStream.
18420  *
18421  * Gets the entity tag for the file when it has been written.
18422  * This must be called after the stream has been written
18423  * and closed, as the etag can change while writing.
18424  *
18425  * Returns: the entity tag for the stream.
18426  * Since: 2.22
18427  */
18428
18429
18430 /**
18431  * g_file_io_stream_query_info:
18432  * @stream: a #GFileIOStream.
18433  * @attributes: a file attribute query string.
18434  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18435  * @error: a #GError, %NULL to ignore.
18436  *
18437  * Queries a file io stream for the given @attributes.
18438  * This function blocks while querying the stream. For the asynchronous
18439  * version of this function, see g_file_io_stream_query_info_async().
18440  * While the stream is blocked, the stream will set the pending flag
18441  * internally, and any other operations on the stream will fail with
18442  * %G_IO_ERROR_PENDING.
18443  *
18444  * Can fail if the stream was already closed (with @error being set to
18445  * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
18446  * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
18447  * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
18448  * all cases of failure, %NULL will be returned.
18449  *
18450  * If @cancellable is not %NULL, then the operation can be cancelled by
18451  * triggering the cancellable object from another thread. If the operation
18452  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
18453  * be returned.
18454  *
18455  * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
18456  * Since: 2.22
18457  */
18458
18459
18460 /**
18461  * g_file_io_stream_query_info_async:
18462  * @stream: a #GFileIOStream.
18463  * @attributes: a file attribute query string.
18464  * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
18465  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18466  * @callback: (scope async): callback to call when the request is satisfied
18467  * @user_data: (closure): the data to pass to callback function
18468  *
18469  * Asynchronously queries the @stream for a #GFileInfo. When completed,
18470  * @callback will be called with a #GAsyncResult which can be used to
18471  * finish the operation with g_file_io_stream_query_info_finish().
18472  *
18473  * For the synchronous version of this function, see
18474  * g_file_io_stream_query_info().
18475  *
18476  * Since: 2.22
18477  */
18478
18479
18480 /**
18481  * g_file_io_stream_query_info_finish:
18482  * @stream: a #GFileIOStream.
18483  * @result: a #GAsyncResult.
18484  * @error: a #GError, %NULL to ignore.
18485  *
18486  * Finalizes the asynchronous query started
18487  * by g_file_io_stream_query_info_async().
18488  *
18489  * Returns: (transfer full): A #GFileInfo for the finished query.
18490  * Since: 2.22
18491  */
18492
18493
18494 /**
18495  * g_file_is_native:
18496  * @file: input #GFile
18497  *
18498  * Checks to see if a file is native to the platform.
18499  *
18500  * A native file s one expressed in the platform-native filename format,
18501  * e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
18502  * as it might be on a locally mounted remote filesystem.
18503  *
18504  * On some systems non-native files may be available using the native
18505  * filesystem via a userspace filesystem (FUSE), in these cases this call
18506  * will return %FALSE, but g_file_get_path() will still return a native path.
18507  *
18508  * This call does no blocking I/O.
18509  *
18510  * Returns: %TRUE if @file is native
18511  */
18512
18513
18514 /**
18515  * g_file_load_contents:
18516  * @file: input #GFile
18517  * @cancellable: optional #GCancellable object, %NULL to ignore
18518  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
18519  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
18520  * @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
18521  * @error: a #GError, or %NULL
18522  *
18523  * Loads the content of the file into memory. The data is always
18524  * zero-terminated, but this is not included in the resultant @length.
18525  * The returned @content should be freed with g_free() when no longer
18526  * needed.
18527  *
18528  * If @cancellable is not %NULL, then the operation can be cancelled by
18529  * triggering the cancellable object from another thread. If the operation
18530  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18531  *
18532  * Returns: %TRUE if the @file's contents were successfully loaded. %FALSE if there were errors.
18533  */
18534
18535
18536 /**
18537  * g_file_load_contents_async:
18538  * @file: input #GFile
18539  * @cancellable: optional #GCancellable object, %NULL to ignore
18540  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
18541  * @user_data: the data to pass to callback function
18542  *
18543  * Starts an asynchronous load of the @file's contents.
18544  *
18545  * For more details, see g_file_load_contents() which is
18546  * the synchronous version of this call.
18547  *
18548  * When the load operation has completed, @callback will be called
18549  * with @user data. To finish the operation, call
18550  * g_file_load_contents_finish() with the #GAsyncResult returned by
18551  * the @callback.
18552  *
18553  * If @cancellable is not %NULL, then the operation can be cancelled by
18554  * triggering the cancellable object from another thread. If the operation
18555  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18556  */
18557
18558
18559 /**
18560  * g_file_load_contents_finish:
18561  * @file: input #GFile
18562  * @res: a #GAsyncResult
18563  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
18564  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
18565  * @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
18566  * @error: a #GError, or %NULL
18567  *
18568  * Finishes an asynchronous load of the @file's contents.
18569  * The contents are placed in @contents, and @length is set to the
18570  * size of the @contents string. The @content should be freed with
18571  * g_free() when no longer needed. If @etag_out is present, it will be
18572  * set to the new entity tag for the @file.
18573  *
18574  * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
18575  */
18576
18577
18578 /**
18579  * g_file_load_partial_contents_async: (skip)
18580  * @file: input #GFile
18581  * @cancellable: optional #GCancellable object, %NULL to ignore
18582  * @read_more_callback: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read
18583  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
18584  * @user_data: the data to pass to the callback functions
18585  *
18586  * Reads the partial contents of a file. A #GFileReadMoreCallback should
18587  * be used to stop reading from the file when appropriate, else this
18588  * function will behave exactly as g_file_load_contents_async(). This
18589  * operation can be finished by g_file_load_partial_contents_finish().
18590  *
18591  * Users of this function should be aware that @user_data is passed to
18592  * both the @read_more_callback and the @callback.
18593  *
18594  * If @cancellable is not %NULL, then the operation can be cancelled by
18595  * triggering the cancellable object from another thread. If the operation
18596  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18597  */
18598
18599
18600 /**
18601  * g_file_load_partial_contents_finish:
18602  * @file: input #GFile
18603  * @res: a #GAsyncResult
18604  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
18605  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
18606  * @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
18607  * @error: a #GError, or %NULL
18608  *
18609  * Finishes an asynchronous partial load operation that was started
18610  * with g_file_load_partial_contents_async(). The data is always
18611  * zero-terminated, but this is not included in the resultant @length.
18612  * The returned @content should be freed with g_free() when no longer
18613  * needed.
18614  *
18615  * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
18616  */
18617
18618
18619 /**
18620  * g_file_make_directory:
18621  * @file: input #GFile
18622  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18623  * @error: a #GError, or %NULL
18624  *
18625  * Creates a directory. Note that this will only create a child directory
18626  * of the immediate parent directory of the path or URI given by the #GFile.
18627  * To recursively create directories, see g_file_make_directory_with_parents().
18628  * This function will fail if the parent directory does not exist, setting
18629  * @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support
18630  * creating directories, this function will fail, setting @error to
18631  * %G_IO_ERROR_NOT_SUPPORTED.
18632  *
18633  * For a local #GFile the newly created directory will have the default
18634  * (current) ownership and permissions of the current process.
18635  *
18636  * If @cancellable is not %NULL, then the operation can be cancelled by
18637  * triggering the cancellable object from another thread. If the operation
18638  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18639  *
18640  * Returns: %TRUE on successful creation, %FALSE otherwise.
18641  */
18642
18643
18644 /**
18645  * g_file_make_directory_with_parents:
18646  * @file: input #GFile
18647  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18648  * @error: a #GError, or %NULL
18649  *
18650  * Creates a directory and any parent directories that may not
18651  * exist similar to 'mkdir -p'. If the file system does not support
18652  * creating directories, this function will fail, setting @error to
18653  * %G_IO_ERROR_NOT_SUPPORTED. If the directory itself already exists,
18654  * this function will fail setting @error to %G_IO_ERROR_EXISTS, unlike
18655  * the similar g_mkdir_with_parents().
18656  *
18657  * For a local #GFile the newly created directories will have the default
18658  * (current) ownership and permissions of the current process.
18659  *
18660  * If @cancellable is not %NULL, then the operation can be cancelled by
18661  * triggering the cancellable object from another thread. If the operation
18662  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18663  *
18664  * Returns: %TRUE if all directories have been successfully created, %FALSE otherwise.
18665  * Since: 2.18
18666  */
18667
18668
18669 /**
18670  * g_file_make_symbolic_link:
18671  * @file: a #GFile with the name of the symlink to create
18672  * @symlink_value: a string with the path for the target of the new symlink
18673  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18674  * @error: a #GError
18675  *
18676  * Creates a symbolic link named @file which contains the string
18677  * @symlink_value.
18678  *
18679  * If @cancellable is not %NULL, then the operation can be cancelled by
18680  * triggering the cancellable object from another thread. If the operation
18681  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18682  *
18683  * Returns: %TRUE on the creation of a new symlink, %FALSE otherwise.
18684  */
18685
18686
18687 /**
18688  * g_file_monitor:
18689  * @file: input #GFile
18690  * @flags: a set of #GFileMonitorFlags
18691  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18692  * @error: a #GError, or %NULL
18693  *
18694  * Obtains a file or directory monitor for the given file,
18695  * depending on the type of the file.
18696  *
18697  * If @cancellable is not %NULL, then the operation can be cancelled by
18698  * triggering the cancellable object from another thread. If the operation
18699  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18700  *
18701  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
18702  * Since: 2.18
18703  */
18704
18705
18706 /**
18707  * g_file_monitor_cancel:
18708  * @monitor: a #GFileMonitor.
18709  *
18710  * Cancels a file monitor.
18711  *
18712  * Returns: %TRUE if monitor was cancelled.
18713  */
18714
18715
18716 /**
18717  * g_file_monitor_directory:
18718  * @file: input #GFile
18719  * @flags: a set of #GFileMonitorFlags
18720  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18721  * @error: a #GError, or %NULL
18722  *
18723  * Obtains a directory monitor for the given file.
18724  * This may fail if directory monitoring is not supported.
18725  *
18726  * If @cancellable is not %NULL, then the operation can be cancelled by
18727  * triggering the cancellable object from another thread. If the operation
18728  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18729  *
18730  * It does not make sense for @flags to contain
18731  * %G_FILE_MONITOR_WATCH_HARD_LINKS, since hard links can not be made to
18732  * directories.  It is not possible to monitor all the files in a
18733  * directory for changes made via hard links; if you want to do this then
18734  * you must register individual watches with g_file_monitor().
18735  *
18736  * Virtual: monitor_dir
18737  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
18738  */
18739
18740
18741 /**
18742  * g_file_monitor_emit_event:
18743  * @monitor: a #GFileMonitor.
18744  * @child: a #GFile.
18745  * @other_file: a #GFile.
18746  * @event_type: a set of #GFileMonitorEvent flags.
18747  *
18748  * Emits the #GFileMonitor::changed signal if a change
18749  * has taken place. Should be called from file monitor
18750  * implementations only.
18751  *
18752  * The signal will be emitted from an idle handler (in the <link
18753  * linkend="g-main-context-push-thread-default">thread-default main
18754  * context</link>).
18755  */
18756
18757
18758 /**
18759  * g_file_monitor_file:
18760  * @file: input #GFile
18761  * @flags: a set of #GFileMonitorFlags
18762  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18763  * @error: a #GError, or %NULL
18764  *
18765  * Obtains a file monitor for the given file. If no file notification
18766  * mechanism exists, then regular polling of the file is used.
18767  *
18768  * If @cancellable is not %NULL, then the operation can be cancelled by
18769  * triggering the cancellable object from another thread. If the operation
18770  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18771  *
18772  * If @flags contains %G_FILE_MONITOR_WATCH_HARD_LINKS then the monitor
18773  * will also attempt to report changes made to the file via another
18774  * filename (ie, a hard link). Without this flag, you can only rely on
18775  * changes made through the filename contained in @file to be
18776  * reported. Using this flag may result in an increase in resource
18777  * usage, and may not have any effect depending on the #GFileMonitor
18778  * backend and/or filesystem type.
18779  *
18780  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
18781  */
18782
18783
18784 /**
18785  * g_file_monitor_is_cancelled:
18786  * @monitor: a #GFileMonitor
18787  *
18788  * Returns whether the monitor is canceled.
18789  *
18790  * Returns: %TRUE if monitor is canceled. %FALSE otherwise.
18791  */
18792
18793
18794 /**
18795  * g_file_monitor_set_rate_limit:
18796  * @monitor: a #GFileMonitor.
18797  * @limit_msecs: a non-negative integer with the limit in milliseconds to poll for changes
18798  *
18799  * Sets the rate limit to which the @monitor will report
18800  * consecutive change events to the same file.
18801  */
18802
18803
18804 /**
18805  * g_file_mount_enclosing_volume:
18806  * @location: input #GFile
18807  * @flags: flags affecting the operation
18808  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction
18809  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18810  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
18811  * @user_data: the data to pass to callback function
18812  *
18813  * Starts a @mount_operation, mounting the volume that contains
18814  * the file @location.
18815  *
18816  * When this operation has completed, @callback will be called with
18817  * @user_user data, and the operation can be finalized with
18818  * g_file_mount_enclosing_volume_finish().
18819  *
18820  * If @cancellable is not %NULL, then the operation can be cancelled by
18821  * triggering the cancellable object from another thread. If the operation
18822  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18823  */
18824
18825
18826 /**
18827  * g_file_mount_enclosing_volume_finish:
18828  * @location: input #GFile
18829  * @result: a #GAsyncResult
18830  * @error: a #GError, or %NULL
18831  *
18832  * Finishes a mount operation started by g_file_mount_enclosing_volume().
18833  *
18834  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
18835  */
18836
18837
18838 /**
18839  * g_file_mount_mountable:
18840  * @file: input #GFile
18841  * @flags: flags affecting the operation
18842  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
18843  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18844  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
18845  * @user_data: (closure): the data to pass to callback function
18846  *
18847  * Mounts a file of type G_FILE_TYPE_MOUNTABLE.
18848  * Using @mount_operation, you can request callbacks when, for instance,
18849  * passwords are needed during authentication.
18850  *
18851  * If @cancellable is not %NULL, then the operation can be cancelled by
18852  * triggering the cancellable object from another thread. If the operation
18853  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18854  *
18855  * When the operation is finished, @callback will be called.
18856  * You can then call g_file_mount_mountable_finish() to get
18857  * the result of the operation.
18858  */
18859
18860
18861 /**
18862  * g_file_mount_mountable_finish:
18863  * @file: input #GFile
18864  * @result: a #GAsyncResult
18865  * @error: a #GError, or %NULL
18866  *
18867  * Finishes a mount operation. See g_file_mount_mountable() for details.
18868  *
18869  * Finish an asynchronous mount operation that was started
18870  * with g_file_mount_mountable().
18871  *
18872  * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
18873  */
18874
18875
18876 /**
18877  * g_file_move:
18878  * @source: #GFile pointing to the source location
18879  * @destination: #GFile pointing to the destination location
18880  * @flags: set of #GFileCopyFlags
18881  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18882  * @progress_callback: (allow-none) (scope call): #GFileProgressCallback function for updates
18883  * @progress_callback_data: (closure): gpointer to user data for the callback function
18884  * @error: #GError for returning error conditions, or %NULL
18885  *
18886  * Tries to move the file or directory @source to the location specified
18887  * by @destination. If native move operations are supported then this is
18888  * used, otherwise a copy + delete fallback is used. The native
18889  * implementation may support moving directories (for instance on moves
18890  * inside the same filesystem), but the fallback code does not.
18891  *
18892  * If the flag #G_FILE_COPY_OVERWRITE is specified an already
18893  * existing @destination file is overwritten.
18894  *
18895  * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
18896  * will be copied as symlinks, otherwise the target of the
18897  * @source symlink will be copied.
18898  *
18899  * If @cancellable is not %NULL, then the operation can be cancelled by
18900  * triggering the cancellable object from another thread. If the operation
18901  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18902  *
18903  * If @progress_callback is not %NULL, then the operation can be monitored
18904  * by setting this to a #GFileProgressCallback function.
18905  * @progress_callback_data will be passed to this function. It is
18906  * guaranteed that this callback will be called after all data has been
18907  * transferred with the total number of bytes copied during the operation.
18908  *
18909  * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND
18910  * error is returned, independent on the status of the @destination.
18911  *
18912  * If #G_FILE_COPY_OVERWRITE is not specified and the target exists,
18913  * then the error %G_IO_ERROR_EXISTS is returned.
18914  *
18915  * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
18916  * error is returned. If trying to overwrite a directory with a directory the
18917  * %G_IO_ERROR_WOULD_MERGE error is returned.
18918  *
18919  * If the source is a directory and the target does not exist, or
18920  * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then
18921  * the %G_IO_ERROR_WOULD_RECURSE error may be returned (if the native
18922  * move operation isn't available).
18923  *
18924  * Returns: %TRUE on successful move, %FALSE otherwise.
18925  */
18926
18927
18928 /**
18929  * g_file_new_for_commandline_arg:
18930  * @arg: a command line string
18931  *
18932  * Creates a #GFile with the given argument from the command line.
18933  * The value of @arg can be either a URI, an absolute path or a
18934  * relative path resolved relative to the current working directory.
18935  * This operation never fails, but the returned object might not
18936  * support any I/O operation if @arg points to a malformed path.
18937  *
18938  * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
18939  */
18940
18941
18942 /**
18943  * g_file_new_for_commandline_arg_and_cwd:
18944  * @arg: a command line string
18945  * @cwd: the current working directory of the commandline
18946  *
18947  * Creates a #GFile with the given argument from the command line.
18948  *
18949  * This function is similar to g_file_new_for_commandline_arg() except
18950  * that it allows for passing the current working directory as an
18951  * argument instead of using the current working directory of the
18952  * process.
18953  *
18954  * This is useful if the commandline argument was given in a context
18955  * other than the invocation of the current process.
18956  *
18957  * See also g_application_command_line_create_file_for_arg().
18958  *
18959  * Returns: (transfer full): a new #GFile
18960  * Since: 2.36
18961  */
18962
18963
18964 /**
18965  * g_file_new_for_path:
18966  * @path: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
18967  *
18968  * Constructs a #GFile for a given path. This operation never
18969  * fails, but the returned object might not support any I/O
18970  * operation if @path is malformed.
18971  *
18972  * Returns: (transfer full): a new #GFile for the given @path. Free the returned object with g_object_unref().
18973  */
18974
18975
18976 /**
18977  * g_file_new_for_uri:
18978  * @uri: a UTF-8 string containing a URI
18979  *
18980  * Constructs a #GFile for a given URI. This operation never
18981  * fails, but the returned object might not support any I/O
18982  * operation if @uri is malformed or if the uri type is
18983  * not supported.
18984  *
18985  * Returns: (transfer full): a new #GFile for the given @uri. Free the returned object with g_object_unref().
18986  */
18987
18988
18989 /**
18990  * g_file_new_tmp:
18991  * @tmpl: (type filename) (allow-none): Template for the file name, as in g_file_open_tmp(), or %NULL for a default template
18992  * @iostream: (out): on return, a #GFileIOStream for the created file
18993  * @error: a #GError, or %NULL
18994  *
18995  * Opens a file in the preferred directory for temporary files (as
18996  * returned by g_get_tmp_dir()) and returns a #GFile and
18997  * #GFileIOStream pointing to it.
18998  *
18999  * @tmpl should be a string in the GLib file name encoding
19000  * containing a sequence of six 'X' characters, and containing no
19001  * directory components. If it is %NULL, a default template is used.
19002  *
19003  * Unlike the other #GFile constructors, this will return %NULL if
19004  * a temporary file could not be created.
19005  *
19006  * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
19007  * Since: 2.32
19008  */
19009
19010
19011 /**
19012  * g_file_open_readwrite:
19013  * @file: #GFile to open
19014  * @cancellable: (allow-none): a #GCancellable
19015  * @error: a #GError, or %NULL
19016  *
19017  * Opens an existing file for reading and writing. The result is
19018  * a #GFileIOStream that can be used to read and write the contents
19019  * of the file.
19020  *
19021  * If @cancellable is not %NULL, then the operation can be cancelled
19022  * by triggering the cancellable object from another thread. If the
19023  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19024  * returned.
19025  *
19026  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
19027  * be returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
19028  * error will be returned. Other errors are possible too, and depend on
19029  * what kind of filesystem the file is on. Note that in many non-local
19030  * file cases read and write streams are not supported, so make sure you
19031  * really need to do read and write streaming, rather than just opening
19032  * for reading or writing.
19033  *
19034  * Returns: (transfer full): #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19035  * Since: 2.22
19036  */
19037
19038
19039 /**
19040  * g_file_open_readwrite_async:
19041  * @file: input #GFile
19042  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19043  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19044  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19045  * @user_data: (closure): the data to pass to callback function
19046  *
19047  * Asynchronously opens @file for reading and writing.
19048  *
19049  * For more details, see g_file_open_readwrite() which is
19050  * the synchronous version of this call.
19051  *
19052  * When the operation is finished, @callback will be called.
19053  * You can then call g_file_open_readwrite_finish() to get
19054  * the result of the operation.
19055  *
19056  * Since: 2.22
19057  */
19058
19059
19060 /**
19061  * g_file_open_readwrite_finish:
19062  * @file: input #GFile
19063  * @res: a #GAsyncResult
19064  * @error: a #GError, or %NULL
19065  *
19066  * Finishes an asynchronous file read operation started with
19067  * g_file_open_readwrite_async().
19068  *
19069  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19070  * Since: 2.22
19071  */
19072
19073
19074 /**
19075  * g_file_output_stream_get_etag:
19076  * @stream: a #GFileOutputStream.
19077  *
19078  * Gets the entity tag for the file when it has been written.
19079  * This must be called after the stream has been written
19080  * and closed, as the etag can change while writing.
19081  *
19082  * Returns: the entity tag for the stream.
19083  */
19084
19085
19086 /**
19087  * g_file_output_stream_query_info:
19088  * @stream: a #GFileOutputStream.
19089  * @attributes: a file attribute query string.
19090  * @cancellable: optional #GCancellable object, %NULL to ignore.
19091  * @error: a #GError, %NULL to ignore.
19092  *
19093  * Queries a file output stream for the given @attributes.
19094  * This function blocks while querying the stream. For the asynchronous
19095  * version of this function, see g_file_output_stream_query_info_async().
19096  * While the stream is blocked, the stream will set the pending flag
19097  * internally, and any other operations on the stream will fail with
19098  * %G_IO_ERROR_PENDING.
19099  *
19100  * Can fail if the stream was already closed (with @error being set to
19101  * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
19102  * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
19103  * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
19104  * all cases of failure, %NULL will be returned.
19105  *
19106  * If @cancellable is not %NULL, then the operation can be cancelled by
19107  * triggering the cancellable object from another thread. If the operation
19108  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
19109  * be returned.
19110  *
19111  * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
19112  */
19113
19114
19115 /**
19116  * g_file_output_stream_query_info_async:
19117  * @stream: a #GFileOutputStream.
19118  * @attributes: a file attribute query string.
19119  * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
19120  * @cancellable: optional #GCancellable object, %NULL to ignore.
19121  * @callback: callback to call when the request is satisfied
19122  * @user_data: the data to pass to callback function
19123  *
19124  * Asynchronously queries the @stream for a #GFileInfo. When completed,
19125  * @callback will be called with a #GAsyncResult which can be used to
19126  * finish the operation with g_file_output_stream_query_info_finish().
19127  *
19128  * For the synchronous version of this function, see
19129  * g_file_output_stream_query_info().
19130  */
19131
19132
19133 /**
19134  * g_file_output_stream_query_info_finish:
19135  * @stream: a #GFileOutputStream.
19136  * @result: a #GAsyncResult.
19137  * @error: a #GError, %NULL to ignore.
19138  *
19139  * Finalizes the asynchronous query started
19140  * by g_file_output_stream_query_info_async().
19141  *
19142  * Returns: (transfer full): A #GFileInfo for the finished query.
19143  */
19144
19145
19146 /**
19147  * g_file_parse_name:
19148  * @parse_name: a file name or path to be parsed
19149  *
19150  * Constructs a #GFile with the given @parse_name (i.e. something
19151  * given by g_file_get_parse_name()). This operation never fails,
19152  * but the returned object might not support any I/O operation if
19153  * the @parse_name cannot be parsed.
19154  *
19155  * Returns: (transfer full): a new #GFile.
19156  */
19157
19158
19159 /**
19160  * g_file_poll_mountable:
19161  * @file: input #GFile
19162  * @cancellable: optional #GCancellable object, %NULL to ignore
19163  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
19164  * @user_data: the data to pass to callback function
19165  *
19166  * Polls a file of type #G_FILE_TYPE_MOUNTABLE.
19167  *
19168  * If @cancellable is not %NULL, then the operation can be cancelled by
19169  * triggering the cancellable object from another thread. If the operation
19170  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19171  *
19172  * When the operation is finished, @callback will be called.
19173  * You can then call g_file_mount_mountable_finish() to get
19174  * the result of the operation.
19175  *
19176  * Since: 2.22
19177  */
19178
19179
19180 /**
19181  * g_file_poll_mountable_finish:
19182  * @file: input #GFile
19183  * @result: a #GAsyncResult
19184  * @error: a #GError, or %NULL
19185  *
19186  * Finishes a poll operation. See g_file_poll_mountable() for details.
19187  *
19188  * Finish an asynchronous poll operation that was polled
19189  * with g_file_poll_mountable().
19190  *
19191  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
19192  * Since: 2.22
19193  */
19194
19195
19196 /**
19197  * g_file_query_default_handler:
19198  * @file: a #GFile to open
19199  * @cancellable: optional #GCancellable object, %NULL to ignore
19200  * @error: a #GError, or %NULL
19201  *
19202  * Returns the #GAppInfo that is registered as the default
19203  * application to handle the file specified by @file.
19204  *
19205  * If @cancellable is not %NULL, then the operation can be cancelled by
19206  * triggering the cancellable object from another thread. If the operation
19207  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19208  *
19209  * 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()
19210  */
19211
19212
19213 /**
19214  * g_file_query_exists:
19215  * @file: input #GFile
19216  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19217  *
19218  * Utility function to check if a particular file exists. This is
19219  * implemented using g_file_query_info() and as such does blocking I/O.
19220  *
19221  * Note that in many cases it is racy to first check for file existence
19222  * and then execute something based on the outcome of that, because the
19223  * file might have been created or removed in between the operations. The
19224  * general approach to handling that is to not check, but just do the
19225  * operation and handle the errors as they come.
19226  *
19227  * As an example of race-free checking, take the case of reading a file,
19228  * and if it doesn't exist, creating it. There are two racy versions: read
19229  * it, and on error create it; and: check if it exists, if not create it.
19230  * These can both result in two processes creating the file (with perhaps
19231  * a partially written file as the result). The correct approach is to
19232  * always try to create the file with g_file_create() which will either
19233  * atomically create the file or fail with a %G_IO_ERROR_EXISTS error.
19234  *
19235  * However, in many cases an existence check is useful in a user interface,
19236  * for instance to make a menu item sensitive/insensitive, so that you don't
19237  * have to fool users that something is possible and then just show an error
19238  * dialog. If you do this, you should make sure to also handle the errors
19239  * that can happen due to races when you execute the operation.
19240  *
19241  * Returns: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
19242  */
19243
19244
19245 /**
19246  * g_file_query_file_type:
19247  * @file: input #GFile
19248  * @flags: a set of #GFileQueryInfoFlags passed to g_file_query_info()
19249  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19250  *
19251  * Utility function to inspect the #GFileType of a file. This is
19252  * implemented using g_file_query_info() and as such does blocking I/O.
19253  *
19254  * The primary use case of this method is to check if a file is
19255  * a regular file, directory, or symlink.
19256  *
19257  * Returns: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file does not exist
19258  * Since: 2.18
19259  */
19260
19261
19262 /**
19263  * g_file_query_filesystem_info:
19264  * @file: input #GFile
19265  * @attributes: an attribute query string
19266  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19267  * @error: a #GError
19268  *
19269  * Similar to g_file_query_info(), but obtains information
19270  * about the filesystem the @file is on, rather than the file itself.
19271  * For instance the amount of space available and the type of
19272  * the filesystem.
19273  *
19274  * The @attributes value is a string that specifies the attributes
19275  * that should be gathered. It is not an error if it's not possible
19276  * to read a particular requested attribute from a file - it just
19277  * won't be set. @attributes should be a comma-separated list of
19278  * attributes or attribute wildcards. The wildcard "*" means all
19279  * attributes, and a wildcard like "filesystem::*" means all attributes
19280  * in the filesystem namespace. The standard namespace for filesystem
19281  * attributes is "filesystem". Common attributes of interest are
19282  * #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem
19283  * in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available),
19284  * and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
19285  *
19286  * If @cancellable is not %NULL, then the operation can be cancelled
19287  * by triggering the cancellable object from another thread. If the
19288  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19289  * returned.
19290  *
19291  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
19292  * be returned. Other errors are possible too, and depend on what
19293  * kind of filesystem the file is on.
19294  *
19295  * Returns: (transfer full): a #GFileInfo or %NULL if there was an error. Free the returned object with g_object_unref().
19296  */
19297
19298
19299 /**
19300  * g_file_query_filesystem_info_async:
19301  * @file: input #GFile
19302  * @attributes: an attribute query string
19303  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19304  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19305  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19306  * @user_data: (closure): the data to pass to callback function
19307  *
19308  * Asynchronously gets the requested information about the filesystem
19309  * that the specified @file is on. The result is a #GFileInfo object
19310  * that contains key-value attributes (such as type or size for the
19311  * file).
19312  *
19313  * For more details, see g_file_query_filesystem_info() which is the
19314  * synchronous version of this call.
19315  *
19316  * When the operation is finished, @callback will be called. You can
19317  * then call g_file_query_info_finish() to get the result of the
19318  * operation.
19319  */
19320
19321
19322 /**
19323  * g_file_query_filesystem_info_finish:
19324  * @file: input #GFile
19325  * @res: a #GAsyncResult
19326  * @error: a #GError
19327  *
19328  * Finishes an asynchronous filesystem info query.
19329  * See g_file_query_filesystem_info_async().
19330  *
19331  * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19332  */
19333
19334
19335 /**
19336  * g_file_query_info:
19337  * @file: input #GFile
19338  * @attributes: an attribute query string
19339  * @flags: a set of #GFileQueryInfoFlags
19340  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19341  * @error: a #GError
19342  *
19343  * Gets the requested information about specified @file.
19344  * The result is a #GFileInfo object that contains key-value
19345  * attributes (such as the type or size of the file).
19346  *
19347  * The @attributes value is a string that specifies the file
19348  * attributes that should be gathered. It is not an error if
19349  * it's not possible to read a particular requested attribute
19350  * from a file - it just won't be set. @attributes should be a
19351  * comma-separated list of attributes or attribute wildcards.
19352  * The wildcard "*" means all attributes, and a wildcard like
19353  * "standard::*" means all attributes in the standard namespace.
19354  * An example attribute query be "standard::*,owner::user".
19355  * The standard attributes are available as defines, like
19356  * #G_FILE_ATTRIBUTE_STANDARD_NAME.
19357  *
19358  * If @cancellable is not %NULL, then the operation can be cancelled
19359  * by triggering the cancellable object from another thread. If the
19360  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19361  * returned.
19362  *
19363  * For symlinks, normally the information about the target of the
19364  * symlink is returned, rather than information about the symlink
19365  * itself. However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS
19366  * in @flags the information about the symlink itself will be returned.
19367  * Also, for symlinks that point to non-existing files the information
19368  * about the symlink itself will be returned.
19369  *
19370  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
19371  * returned. Other errors are possible too, and depend on what kind of
19372  * filesystem the file is on.
19373  *
19374  * Returns: (transfer full): a #GFileInfo for the given @file, or %NULL on error. Free the returned object with g_object_unref().
19375  */
19376
19377
19378 /**
19379  * g_file_query_info_async:
19380  * @file: input #GFile
19381  * @attributes: an attribute query string
19382  * @flags: a set of #GFileQueryInfoFlags
19383  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19384  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19385  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19386  * @user_data: (closure): the data to pass to callback function
19387  *
19388  * Asynchronously gets the requested information about specified @file.
19389  * The result is a #GFileInfo object that contains key-value attributes
19390  * (such as type or size for the file).
19391  *
19392  * For more details, see g_file_query_info() which is the synchronous
19393  * version of this call.
19394  *
19395  * When the operation is finished, @callback will be called. You can
19396  * then call g_file_query_info_finish() to get the result of the operation.
19397  */
19398
19399
19400 /**
19401  * g_file_query_info_finish:
19402  * @file: input #GFile
19403  * @res: a #GAsyncResult
19404  * @error: a #GError
19405  *
19406  * Finishes an asynchronous file info query.
19407  * See g_file_query_info_async().
19408  *
19409  * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
19410  */
19411
19412
19413 /**
19414  * g_file_query_settable_attributes:
19415  * @file: input #GFile
19416  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19417  * @error: a #GError, or %NULL
19418  *
19419  * Obtain the list of settable attributes for the file.
19420  *
19421  * Returns the type and full attribute name of all the attributes
19422  * that can be set on this file. This doesn't mean setting it will
19423  * always succeed though, you might get an access failure, or some
19424  * specific file may not support a specific attribute.
19425  *
19426  * If @cancellable is not %NULL, then the operation can be cancelled by
19427  * triggering the cancellable object from another thread. If the operation
19428  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19429  *
19430  * Returns: a #GFileAttributeInfoList describing the settable attributes. When you are done with it, release it with g_file_attribute_info_list_unref()
19431  */
19432
19433
19434 /**
19435  * g_file_query_writable_namespaces:
19436  * @file: input #GFile
19437  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19438  * @error: a #GError, or %NULL
19439  *
19440  * Obtain the list of attribute namespaces where new attributes
19441  * can be created by a user. An example of this is extended
19442  * attributes (in the "xattr" namespace).
19443  *
19444  * If @cancellable is not %NULL, then the operation can be cancelled by
19445  * triggering the cancellable object from another thread. If the operation
19446  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19447  *
19448  * Returns: a #GFileAttributeInfoList describing the writable namespaces. When you are done with it, release it with g_file_attribute_info_list_unref()
19449  */
19450
19451
19452 /**
19453  * g_file_read:
19454  * @file: #GFile to read
19455  * @cancellable: (allow-none): a #GCancellable
19456  * @error: a #GError, or %NULL
19457  *
19458  * Opens a file for reading. The result is a #GFileInputStream that
19459  * can be used to read the contents of the file.
19460  *
19461  * If @cancellable is not %NULL, then the operation can be cancelled by
19462  * triggering the cancellable object from another thread. If the operation
19463  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19464  *
19465  * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
19466  * returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
19467  * error will be returned. Other errors are possible too, and depend
19468  * on what kind of filesystem the file is on.
19469  *
19470  * Virtual: read_fn
19471  * Returns: (transfer full): #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
19472  */
19473
19474
19475 /**
19476  * g_file_read_async:
19477  * @file: input #GFile
19478  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19479  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19480  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19481  * @user_data: (closure): the data to pass to callback function
19482  *
19483  * Asynchronously opens @file for reading.
19484  *
19485  * For more details, see g_file_read() which is
19486  * the synchronous version of this call.
19487  *
19488  * When the operation is finished, @callback will be called.
19489  * You can then call g_file_read_finish() to get the result
19490  * of the operation.
19491  */
19492
19493
19494 /**
19495  * g_file_read_finish:
19496  * @file: input #GFile
19497  * @res: a #GAsyncResult
19498  * @error: a #GError, or %NULL
19499  *
19500  * Finishes an asynchronous file read operation started with
19501  * g_file_read_async().
19502  *
19503  * Returns: (transfer full): a #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
19504  */
19505
19506
19507 /**
19508  * g_file_replace:
19509  * @file: input #GFile
19510  * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
19511  * @make_backup: %TRUE if a backup should be created
19512  * @flags: a set of #GFileCreateFlags
19513  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19514  * @error: a #GError, or %NULL
19515  *
19516  * Returns an output stream for overwriting the file, possibly
19517  * creating a backup copy of the file first. If the file doesn't exist,
19518  * it will be created.
19519  *
19520  * This will try to replace the file in the safest way possible so
19521  * that any errors during the writing will not affect an already
19522  * existing copy of the file. For instance, for local files it
19523  * may write to a temporary file and then atomically rename over
19524  * the destination when the stream is closed.
19525  *
19526  * By default files created are generally readable by everyone,
19527  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
19528  * will be made readable only to the current user, to the level that
19529  * is supported on the target filesystem.
19530  *
19531  * If @cancellable is not %NULL, then the operation can be cancelled
19532  * by triggering the cancellable object from another thread. If the
19533  * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
19534  * returned.
19535  *
19536  * If you pass in a non-%NULL @etag value, then this value is
19537  * compared to the current entity tag of the file, and if they differ
19538  * an %G_IO_ERROR_WRONG_ETAG error is returned. This generally means
19539  * that the file has been changed since you last read it. You can get
19540  * the new etag from g_file_output_stream_get_etag() after you've
19541  * finished writing and closed the #GFileOutputStream. When you load
19542  * a new file you can use g_file_input_stream_query_info() to get
19543  * the etag of the file.
19544  *
19545  * If @make_backup is %TRUE, this function will attempt to make a
19546  * backup of the current file before overwriting it. If this fails
19547  * a %G_IO_ERROR_CANT_CREATE_BACKUP error will be returned. If you
19548  * want to replace anyway, try again with @make_backup set to %FALSE.
19549  *
19550  * If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will
19551  * be returned, and if the file is some other form of non-regular file
19552  * then a %G_IO_ERROR_NOT_REGULAR_FILE error will be returned. Some
19553  * file systems don't allow all file names, and may return an
19554  * %G_IO_ERROR_INVALID_FILENAME error, and if the name is to long
19555  * %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are
19556  * possible too, and depend on what kind of filesystem the file is on.
19557  *
19558  * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
19559  */
19560
19561
19562 /**
19563  * g_file_replace_async:
19564  * @file: input #GFile
19565  * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
19566  * @make_backup: %TRUE if a backup should be created
19567  * @flags: a set of #GFileCreateFlags
19568  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19569  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19570  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19571  * @user_data: (closure): the data to pass to callback function
19572  *
19573  * Asynchronously overwrites the file, replacing the contents,
19574  * possibly creating a backup copy of the file first.
19575  *
19576  * For more details, see g_file_replace() which is
19577  * the synchronous version of this call.
19578  *
19579  * When the operation is finished, @callback will be called.
19580  * You can then call g_file_replace_finish() to get the result
19581  * of the operation.
19582  */
19583
19584
19585 /**
19586  * g_file_replace_contents:
19587  * @file: input #GFile
19588  * @contents: (element-type guint8) (array length=length): a string containing the new contents for @file
19589  * @length: the length of @contents in bytes
19590  * @etag: (allow-none): the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
19591  * @make_backup: %TRUE if a backup should be created
19592  * @flags: a set of #GFileCreateFlags
19593  * @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
19594  * @cancellable: optional #GCancellable object, %NULL to ignore
19595  * @error: a #GError, or %NULL
19596  *
19597  * Replaces the contents of @file with @contents of @length bytes.
19598  *
19599  * If @etag is specified (not %NULL), any existing file must have that etag,
19600  * or the error %G_IO_ERROR_WRONG_ETAG will be returned.
19601  *
19602  * If @make_backup is %TRUE, this function will attempt to make a backup
19603  * of @file.
19604  *
19605  * If @cancellable is not %NULL, then the operation can be cancelled by
19606  * triggering the cancellable object from another thread. If the operation
19607  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19608  *
19609  * The returned @new_etag can be used to verify that the file hasn't
19610  * changed the next time it is saved over.
19611  *
19612  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
19613  */
19614
19615
19616 /**
19617  * g_file_replace_contents_async:
19618  * @file: input #GFile
19619  * @contents: (element-type guint8) (array length=length): string of contents to replace the file with
19620  * @length: the length of @contents in bytes
19621  * @etag: (allow-none): a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
19622  * @make_backup: %TRUE if a backup should be created
19623  * @flags: a set of #GFileCreateFlags
19624  * @cancellable: optional #GCancellable object, %NULL to ignore
19625  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
19626  * @user_data: the data to pass to callback function
19627  *
19628  * Starts an asynchronous replacement of @file with the given
19629  * @contents of @length bytes. @etag will replace the document's
19630  * current entity tag.
19631  *
19632  * When this operation has completed, @callback will be called with
19633  * @user_user data, and the operation can be finalized with
19634  * g_file_replace_contents_finish().
19635  *
19636  * If @cancellable is not %NULL, then the operation can be cancelled by
19637  * triggering the cancellable object from another thread. If the operation
19638  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19639  *
19640  * If @make_backup is %TRUE, this function will attempt to
19641  * make a backup of @file.
19642  */
19643
19644
19645 /**
19646  * g_file_replace_contents_finish:
19647  * @file: input #GFile
19648  * @res: a #GAsyncResult
19649  * @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
19650  * @error: a #GError, or %NULL
19651  *
19652  * Finishes an asynchronous replace of the given @file. See
19653  * g_file_replace_contents_async(). Sets @new_etag to the new entity
19654  * tag for the document, if present.
19655  *
19656  * Returns: %TRUE on success, %FALSE on failure.
19657  */
19658
19659
19660 /**
19661  * g_file_replace_finish:
19662  * @file: input #GFile
19663  * @res: a #GAsyncResult
19664  * @error: a #GError, or %NULL
19665  *
19666  * Finishes an asynchronous file replace operation started with
19667  * g_file_replace_async().
19668  *
19669  * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
19670  */
19671
19672
19673 /**
19674  * g_file_replace_readwrite:
19675  * @file: a #GFile
19676  * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
19677  * @make_backup: %TRUE if a backup should be created
19678  * @flags: a set of #GFileCreateFlags
19679  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19680  * @error: return location for a #GError, or %NULL
19681  *
19682  * Returns an output stream for overwriting the file in readwrite mode,
19683  * possibly creating a backup copy of the file first. If the file doesn't
19684  * exist, it will be created.
19685  *
19686  * For details about the behaviour, see g_file_replace() which does the
19687  * same thing but returns an output stream only.
19688  *
19689  * Note that in many non-local file cases read and write streams are not
19690  * supported, so make sure you really need to do read and write streaming,
19691  * rather than just opening for reading or writing.
19692  *
19693  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
19694  * Since: 2.22
19695  */
19696
19697
19698 /**
19699  * g_file_replace_readwrite_async:
19700  * @file: input #GFile
19701  * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore
19702  * @make_backup: %TRUE if a backup should be created
19703  * @flags: a set of #GFileCreateFlags
19704  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19705  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19706  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19707  * @user_data: (closure): the data to pass to callback function
19708  *
19709  * Asynchronously overwrites the file in read-write mode,
19710  * replacing the contents, possibly creating a backup copy
19711  * of the file first.
19712  *
19713  * For more details, see g_file_replace_readwrite() which is
19714  * the synchronous version of this call.
19715  *
19716  * When the operation is finished, @callback will be called.
19717  * You can then call g_file_replace_readwrite_finish() to get
19718  * the result of the operation.
19719  *
19720  * Since: 2.22
19721  */
19722
19723
19724 /**
19725  * g_file_replace_readwrite_finish:
19726  * @file: input #GFile
19727  * @res: a #GAsyncResult
19728  * @error: a #GError, or %NULL
19729  *
19730  * Finishes an asynchronous file replace operation started with
19731  * g_file_replace_readwrite_async().
19732  *
19733  * Returns: (transfer full): a #GFileIOStream, or %NULL on error. Free the returned object with g_object_unref().
19734  * Since: 2.22
19735  */
19736
19737
19738 /**
19739  * g_file_resolve_relative_path:
19740  * @file: input #GFile
19741  * @relative_path: a given relative path string
19742  *
19743  * Resolves a relative path for @file to an absolute path.
19744  *
19745  * This call does no blocking I/O.
19746  *
19747  * 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().
19748  */
19749
19750
19751 /**
19752  * g_file_set_attribute:
19753  * @file: input #GFile
19754  * @attribute: a string containing the attribute's name
19755  * @type: The type of the attribute
19756  * @value_p: (allow-none): a pointer to the value (or the pointer itself if the type is a pointer type)
19757  * @flags: a set of #GFileQueryInfoFlags
19758  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19759  * @error: a #GError, or %NULL
19760  *
19761  * Sets an attribute in the file with attribute name @attribute to @value.
19762  *
19763  * Some attributes can be unset by setting @attribute to
19764  * %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
19765  *
19766  * If @cancellable is not %NULL, then the operation can be cancelled by
19767  * triggering the cancellable object from another thread. If the operation
19768  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19769  *
19770  * Returns: %TRUE if the attribute was set, %FALSE otherwise.
19771  */
19772
19773
19774 /**
19775  * g_file_set_attribute_byte_string:
19776  * @file: input #GFile
19777  * @attribute: a string containing the attribute's name
19778  * @value: a string containing the attribute's new value
19779  * @flags: a #GFileQueryInfoFlags
19780  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19781  * @error: a #GError, or %NULL
19782  *
19783  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
19784  * If @attribute is of a different type, this operation will fail,
19785  * returning %FALSE.
19786  *
19787  * If @cancellable is not %NULL, then the operation can be cancelled by
19788  * triggering the cancellable object from another thread. If the operation
19789  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19790  *
19791  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
19792  */
19793
19794
19795 /**
19796  * g_file_set_attribute_int32:
19797  * @file: input #GFile
19798  * @attribute: a string containing the attribute's name
19799  * @value: a #gint32 containing the attribute's new value
19800  * @flags: a #GFileQueryInfoFlags
19801  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19802  * @error: a #GError, or %NULL
19803  *
19804  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
19805  * If @attribute is of a different type, this operation will fail.
19806  *
19807  * If @cancellable is not %NULL, then the operation can be cancelled by
19808  * triggering the cancellable object from another thread. If the operation
19809  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19810  *
19811  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
19812  */
19813
19814
19815 /**
19816  * g_file_set_attribute_int64:
19817  * @file: input #GFile
19818  * @attribute: a string containing the attribute's name
19819  * @value: a #guint64 containing the attribute's new value
19820  * @flags: a #GFileQueryInfoFlags
19821  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19822  * @error: a #GError, or %NULL
19823  *
19824  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
19825  * If @attribute is of a different type, this operation will fail.
19826  *
19827  * If @cancellable is not %NULL, then the operation can be cancelled by
19828  * triggering the cancellable object from another thread. If the operation
19829  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19830  *
19831  * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
19832  */
19833
19834
19835 /**
19836  * g_file_set_attribute_string:
19837  * @file: input #GFile
19838  * @attribute: a string containing the attribute's name
19839  * @value: a string containing the attribute's value
19840  * @flags: #GFileQueryInfoFlags
19841  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19842  * @error: a #GError, or %NULL
19843  *
19844  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
19845  * If @attribute is of a different type, this operation will fail.
19846  *
19847  * If @cancellable is not %NULL, then the operation can be cancelled by
19848  * triggering the cancellable object from another thread. If the operation
19849  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19850  *
19851  * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
19852  */
19853
19854
19855 /**
19856  * g_file_set_attribute_uint32:
19857  * @file: input #GFile
19858  * @attribute: a string containing the attribute's name
19859  * @value: a #guint32 containing the attribute's new value
19860  * @flags: a #GFileQueryInfoFlags
19861  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19862  * @error: a #GError, or %NULL
19863  *
19864  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
19865  * If @attribute is of a different type, this operation will fail.
19866  *
19867  * If @cancellable is not %NULL, then the operation can be cancelled by
19868  * triggering the cancellable object from another thread. If the operation
19869  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19870  *
19871  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
19872  */
19873
19874
19875 /**
19876  * g_file_set_attribute_uint64:
19877  * @file: input #GFile
19878  * @attribute: a string containing the attribute's name
19879  * @value: a #guint64 containing the attribute's new value
19880  * @flags: a #GFileQueryInfoFlags
19881  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19882  * @error: a #GError, or %NULL
19883  *
19884  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
19885  * If @attribute is of a different type, this operation will fail.
19886  *
19887  * If @cancellable is not %NULL, then the operation can be cancelled by
19888  * triggering the cancellable object from another thread. If the operation
19889  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19890  *
19891  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
19892  */
19893
19894
19895 /**
19896  * g_file_set_attributes_async:
19897  * @file: input #GFile
19898  * @info: a #GFileInfo
19899  * @flags: a #GFileQueryInfoFlags
19900  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19901  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19902  * @callback: (scope async): a #GAsyncReadyCallback
19903  * @user_data: (closure): a #gpointer
19904  *
19905  * Asynchronously sets the attributes of @file with @info.
19906  *
19907  * For more details, see g_file_set_attributes_from_info(),
19908  * which is the synchronous version of this call.
19909  *
19910  * When the operation is finished, @callback will be called.
19911  * You can then call g_file_set_attributes_finish() to get
19912  * the result of the operation.
19913  */
19914
19915
19916 /**
19917  * g_file_set_attributes_finish:
19918  * @file: input #GFile
19919  * @result: a #GAsyncResult
19920  * @info: (out) (transfer full): a #GFileInfo
19921  * @error: a #GError, or %NULL
19922  *
19923  * Finishes setting an attribute started in g_file_set_attributes_async().
19924  *
19925  * Returns: %TRUE if the attributes were set correctly, %FALSE otherwise.
19926  */
19927
19928
19929 /**
19930  * g_file_set_attributes_from_info:
19931  * @file: input #GFile
19932  * @info: a #GFileInfo
19933  * @flags: #GFileQueryInfoFlags
19934  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19935  * @error: a #GError, or %NULL
19936  *
19937  * Tries to set all attributes in the #GFileInfo on the target
19938  * values, not stopping on the first error.
19939  *
19940  * If there is any error during this operation then @error will
19941  * be set to the first error. Error on particular fields are flagged
19942  * by setting the "status" field in the attribute value to
19943  * %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can
19944  * also detect further errors.
19945  *
19946  * If @cancellable is not %NULL, then the operation can be cancelled by
19947  * triggering the cancellable object from another thread. If the operation
19948  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19949  *
19950  * Returns: %FALSE if there was any error, %TRUE otherwise.
19951  */
19952
19953
19954 /**
19955  * g_file_set_display_name:
19956  * @file: input #GFile
19957  * @display_name: a string
19958  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19959  * @error: a #GError, or %NULL
19960  *
19961  * Renames @file to the specified display name.
19962  *
19963  * The display name is converted from UTF-8 to the correct encoding
19964  * for the target filesystem if possible and the @file is renamed to this.
19965  *
19966  * If you want to implement a rename operation in the user interface the
19967  * edit name (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the
19968  * initial value in the rename widget, and then the result after editing
19969  * should be passed to g_file_set_display_name().
19970  *
19971  * On success the resulting converted filename is returned.
19972  *
19973  * If @cancellable is not %NULL, then the operation can be cancelled by
19974  * triggering the cancellable object from another thread. If the operation
19975  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19976  *
19977  * 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().
19978  */
19979
19980
19981 /**
19982  * g_file_set_display_name_async:
19983  * @file: input #GFile
19984  * @display_name: a string
19985  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
19986  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
19987  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
19988  * @user_data: (closure): the data to pass to callback function
19989  *
19990  * Asynchronously sets the display name for a given #GFile.
19991  *
19992  * For more details, see g_file_set_display_name() which is
19993  * the synchronous version of this call.
19994  *
19995  * When the operation is finished, @callback will be called.
19996  * You can then call g_file_set_display_name_finish() to get
19997  * the result of the operation.
19998  */
19999
20000
20001 /**
20002  * g_file_set_display_name_finish:
20003  * @file: input #GFile
20004  * @res: a #GAsyncResult
20005  * @error: a #GError, or %NULL
20006  *
20007  * Finishes setting a display name started with
20008  * g_file_set_display_name_async().
20009  *
20010  * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
20011  */
20012
20013
20014 /**
20015  * g_file_start_mountable:
20016  * @file: input #GFile
20017  * @flags: flags affecting the operation
20018  * @start_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
20019  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20020  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20021  * @user_data: the data to pass to callback function
20022  *
20023  * Starts a file of type #G_FILE_TYPE_MOUNTABLE.
20024  * Using @start_operation, you can request callbacks when, for instance,
20025  * passwords are needed during authentication.
20026  *
20027  * If @cancellable is not %NULL, then the operation can be cancelled by
20028  * triggering the cancellable object from another thread. If the operation
20029  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20030  *
20031  * When the operation is finished, @callback will be called.
20032  * You can then call g_file_mount_mountable_finish() to get
20033  * the result of the operation.
20034  *
20035  * Since: 2.22
20036  */
20037
20038
20039 /**
20040  * g_file_start_mountable_finish:
20041  * @file: input #GFile
20042  * @result: a #GAsyncResult
20043  * @error: a #GError, or %NULL
20044  *
20045  * Finishes a start operation. See g_file_start_mountable() for details.
20046  *
20047  * Finish an asynchronous start operation that was started
20048  * with g_file_start_mountable().
20049  *
20050  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20051  * Since: 2.22
20052  */
20053
20054
20055 /**
20056  * g_file_stop_mountable:
20057  * @file: input #GFile
20058  * @flags: flags affecting the operation
20059  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
20060  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20061  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20062  * @user_data: the data to pass to callback function
20063  *
20064  * Stops a file of type #G_FILE_TYPE_MOUNTABLE.
20065  *
20066  * If @cancellable is not %NULL, then the operation can be cancelled by
20067  * triggering the cancellable object from another thread. If the operation
20068  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20069  *
20070  * When the operation is finished, @callback will be called.
20071  * You can then call g_file_stop_mountable_finish() to get
20072  * the result of the operation.
20073  *
20074  * Since: 2.22
20075  */
20076
20077
20078 /**
20079  * g_file_stop_mountable_finish:
20080  * @file: input #GFile
20081  * @result: a #GAsyncResult
20082  * @error: a #GError, or %NULL
20083  *
20084  * Finishes an stop operation, see g_file_stop_mountable() for details.
20085  *
20086  * Finish an asynchronous stop operation that was started
20087  * with g_file_stop_mountable().
20088  *
20089  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20090  * Since: 2.22
20091  */
20092
20093
20094 /**
20095  * g_file_supports_thread_contexts:
20096  * @file: a #GFile
20097  *
20098  * Checks if @file supports <link
20099  * linkend="g-main-context-push-thread-default-context">thread-default
20100  * contexts</link>. If this returns %FALSE, you cannot perform
20101  * asynchronous operations on @file in a thread that has a
20102  * thread-default context.
20103  *
20104  * Returns: Whether or not @file supports thread-default contexts.
20105  * Since: 2.22
20106  */
20107
20108
20109 /**
20110  * g_file_trash:
20111  * @file: #GFile to send to trash
20112  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20113  * @error: a #GError, or %NULL
20114  *
20115  * Sends @file to the "Trashcan", if possible. This is similar to
20116  * deleting it, but the user can recover it before emptying the trashcan.
20117  * Not all file systems support trashing, so this call can return the
20118  * %G_IO_ERROR_NOT_SUPPORTED error.
20119  *
20120  * If @cancellable is not %NULL, then the operation can be cancelled by
20121  * triggering the cancellable object from another thread. If the operation
20122  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20123  *
20124  * Returns: %TRUE on successful trash, %FALSE otherwise.
20125  */
20126
20127
20128 /**
20129  * g_file_unmount_mountable:
20130  * @file: input #GFile
20131  * @flags: flags affecting the operation
20132  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20133  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20134  * @user_data: (closure): the data to pass to callback function
20135  *
20136  * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
20137  *
20138  * If @cancellable is not %NULL, then the operation can be cancelled by
20139  * triggering the cancellable object from another thread. If the operation
20140  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20141  *
20142  * When the operation is finished, @callback will be called.
20143  * You can then call g_file_unmount_mountable_finish() to get
20144  * the result of the operation.
20145  *
20146  * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation() instead.
20147  */
20148
20149
20150 /**
20151  * g_file_unmount_mountable_finish:
20152  * @file: input #GFile
20153  * @result: a #GAsyncResult
20154  * @error: a #GError, or %NULL
20155  *
20156  * Finishes an unmount operation, see g_file_unmount_mountable() for details.
20157  *
20158  * Finish an asynchronous unmount operation that was started
20159  * with g_file_unmount_mountable().
20160  *
20161  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20162  * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation_finish() instead.
20163  */
20164
20165
20166 /**
20167  * g_file_unmount_mountable_with_operation:
20168  * @file: input #GFile
20169  * @flags: flags affecting the operation
20170  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction
20171  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20172  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
20173  * @user_data: (closure): the data to pass to callback function
20174  *
20175  * Unmounts a file of type #G_FILE_TYPE_MOUNTABLE.
20176  *
20177  * If @cancellable is not %NULL, then the operation can be cancelled by
20178  * triggering the cancellable object from another thread. If the operation
20179  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20180  *
20181  * When the operation is finished, @callback will be called.
20182  * You can then call g_file_unmount_mountable_finish() to get
20183  * the result of the operation.
20184  *
20185  * Since: 2.22
20186  */
20187
20188
20189 /**
20190  * g_file_unmount_mountable_with_operation_finish:
20191  * @file: input #GFile
20192  * @result: a #GAsyncResult
20193  * @error: a #GError, or %NULL
20194  *
20195  * Finishes an unmount operation,
20196  * see g_file_unmount_mountable_with_operation() for details.
20197  *
20198  * Finish an asynchronous unmount operation that was started
20199  * with g_file_unmount_mountable_with_operation().
20200  *
20201  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
20202  * Since: 2.22
20203  */
20204
20205
20206 /**
20207  * g_filename_completer_get_completion_suffix:
20208  * @completer: the filename completer.
20209  * @initial_text: text to be completed.
20210  *
20211  * Obtains a completion for @initial_text from @completer.
20212  *
20213  * 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.
20214  */
20215
20216
20217 /**
20218  * g_filename_completer_get_completions:
20219  * @completer: the filename completer.
20220  * @initial_text: text to be completed.
20221  *
20222  * Gets an array of completion strings for a given initial text.
20223  *
20224  * 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.
20225  */
20226
20227
20228 /**
20229  * g_filename_completer_new:
20230  *
20231  * Creates a new filename completer.
20232  *
20233  * Returns: a #GFilenameCompleter.
20234  */
20235
20236
20237 /**
20238  * g_filename_completer_set_dirs_only:
20239  * @completer: the filename completer.
20240  * @dirs_only: a #gboolean.
20241  *
20242  * If @dirs_only is %TRUE, @completer will only
20243  * complete directory names, and not file names.
20244  */
20245
20246
20247 /**
20248  * g_filter_input_stream_get_base_stream:
20249  * @stream: a #GFilterInputStream.
20250  *
20251  * Gets the base stream for the filter stream.
20252  *
20253  * Returns: (transfer none): a #GInputStream.
20254  */
20255
20256
20257 /**
20258  * g_filter_input_stream_get_close_base_stream:
20259  * @stream: a #GFilterInputStream.
20260  *
20261  * Returns whether the base stream will be closed when @stream is
20262  * closed.
20263  *
20264  * Returns: %TRUE if the base stream will be closed.
20265  */
20266
20267
20268 /**
20269  * g_filter_input_stream_set_close_base_stream:
20270  * @stream: a #GFilterInputStream.
20271  * @close_base: %TRUE to close the base stream.
20272  *
20273  * Sets whether the base stream will be closed when @stream is closed.
20274  */
20275
20276
20277 /**
20278  * g_filter_output_stream_get_base_stream:
20279  * @stream: a #GFilterOutputStream.
20280  *
20281  * Gets the base stream for the filter stream.
20282  *
20283  * Returns: (transfer none): a #GOutputStream.
20284  */
20285
20286
20287 /**
20288  * g_filter_output_stream_get_close_base_stream:
20289  * @stream: a #GFilterOutputStream.
20290  *
20291  * Returns whether the base stream will be closed when @stream is
20292  * closed.
20293  *
20294  * Returns: %TRUE if the base stream will be closed.
20295  */
20296
20297
20298 /**
20299  * g_filter_output_stream_set_close_base_stream:
20300  * @stream: a #GFilterOutputStream.
20301  * @close_base: %TRUE to close the base stream.
20302  *
20303  * Sets whether the base stream will be closed when @stream is closed.
20304  */
20305
20306
20307 /**
20308  * g_icon_equal:
20309  * @icon1: (allow-none): pointer to the first #GIcon.
20310  * @icon2: (allow-none): pointer to the second #GIcon.
20311  *
20312  * Checks if two icons are equal.
20313  *
20314  * Returns: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
20315  */
20316
20317
20318 /**
20319  * g_icon_hash:
20320  * @icon: #gconstpointer to an icon object.
20321  *
20322  * Gets a hash for an icon.
20323  *
20324  * Virtual: hash
20325  * Returns: a #guint containing a hash for the @icon, suitable for use in a #GHashTable or similar data structure.
20326  */
20327
20328
20329 /**
20330  * g_icon_new_for_string:
20331  * @str: A string obtained via g_icon_to_string().
20332  * @error: Return location for error.
20333  *
20334  * Generate a #GIcon instance from @str. This function can fail if
20335  * @str is not valid - see g_icon_to_string() for discussion.
20336  *
20337  * If your application or library provides one or more #GIcon
20338  * implementations you need to ensure that each #GType is registered
20339  * with the type system prior to calling g_icon_new_for_string().
20340  *
20341  * Returns: (transfer full): An object implementing the #GIcon interface or %NULL if @error is set.
20342  * Since: 2.20
20343  */
20344
20345
20346 /**
20347  * g_icon_to_string:
20348  * @icon: a #GIcon.
20349  *
20350  * Generates a textual representation of @icon that can be used for
20351  * serialization such as when passing @icon to a different process or
20352  * saving it to persistent storage. Use g_icon_new_for_string() to
20353  * get @icon back from the returned string.
20354  *
20355  * The encoding of the returned string is proprietary to #GIcon except
20356  * in the following two cases
20357  *
20358  * <itemizedlist>
20359  * <listitem><para>
20360  *     If @icon is a #GFileIcon, the returned string is a native path
20361  *     (such as <literal>/path/to/my icon.png</literal>) without escaping
20362  *     if the #GFile for @icon is a native file.  If the file is not
20363  *     native, the returned string is the result of g_file_get_uri()
20364  *     (such as <literal>sftp://path/to/my&percnt;20icon.png</literal>).
20365  * </para></listitem>
20366  * <listitem><para>
20367  *    If @icon is a #GThemedIcon with exactly one name, the encoding is
20368  *    simply the name (such as <literal>network-server</literal>).
20369  * </para></listitem>
20370  * </itemizedlist>
20371  *
20372  * Virtual: to_tokens
20373  * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't be serialized. Use g_free() to free.
20374  * Since: 2.20
20375  */
20376
20377
20378 /**
20379  * g_inet_address_equal:
20380  * @address: A #GInetAddress.
20381  * @other_address: Another #GInetAddress.
20382  *
20383  * Checks if two #GInetAddress instances are equal, e.g. the same address.
20384  *
20385  * Returns: %TRUE if @address and @other_address are equal, %FALSE otherwise.
20386  * Since: 2.30
20387  */
20388
20389
20390 /**
20391  * g_inet_address_get_family:
20392  * @address: a #GInetAddress
20393  *
20394  * Gets @address's family
20395  *
20396  * Returns: @address's family
20397  * Since: 2.22
20398  */
20399
20400
20401 /**
20402  * g_inet_address_get_is_any:
20403  * @address: a #GInetAddress
20404  *
20405  * Tests whether @address is the "any" address for its family.
20406  *
20407  * Returns: %TRUE if @address is the "any" address for its family.
20408  * Since: 2.22
20409  */
20410
20411
20412 /**
20413  * g_inet_address_get_is_link_local:
20414  * @address: a #GInetAddress
20415  *
20416  * Tests whether @address is a link-local address (that is, if it
20417  * identifies a host on a local network that is not connected to the
20418  * Internet).
20419  *
20420  * Returns: %TRUE if @address is a link-local address.
20421  * Since: 2.22
20422  */
20423
20424
20425 /**
20426  * g_inet_address_get_is_loopback:
20427  * @address: a #GInetAddress
20428  *
20429  * Tests whether @address is the loopback address for its family.
20430  *
20431  * Returns: %TRUE if @address is the loopback address for its family.
20432  * Since: 2.22
20433  */
20434
20435
20436 /**
20437  * g_inet_address_get_is_mc_global:
20438  * @address: a #GInetAddress
20439  *
20440  * Tests whether @address is a global multicast address.
20441  *
20442  * Returns: %TRUE if @address is a global multicast address.
20443  * Since: 2.22
20444  */
20445
20446
20447 /**
20448  * g_inet_address_get_is_mc_link_local:
20449  * @address: a #GInetAddress
20450  *
20451  * Tests whether @address is a link-local multicast address.
20452  *
20453  * Returns: %TRUE if @address is a link-local multicast address.
20454  * Since: 2.22
20455  */
20456
20457
20458 /**
20459  * g_inet_address_get_is_mc_node_local:
20460  * @address: a #GInetAddress
20461  *
20462  * Tests whether @address is a node-local multicast address.
20463  *
20464  * Returns: %TRUE if @address is a node-local multicast address.
20465  * Since: 2.22
20466  */
20467
20468
20469 /**
20470  * g_inet_address_get_is_mc_org_local:
20471  * @address: a #GInetAddress
20472  *
20473  * Tests whether @address is an organization-local multicast address.
20474  *
20475  * Returns: %TRUE if @address is an organization-local multicast address.
20476  * Since: 2.22
20477  */
20478
20479
20480 /**
20481  * g_inet_address_get_is_mc_site_local:
20482  * @address: a #GInetAddress
20483  *
20484  * Tests whether @address is a site-local multicast address.
20485  *
20486  * Returns: %TRUE if @address is a site-local multicast address.
20487  * Since: 2.22
20488  */
20489
20490
20491 /**
20492  * g_inet_address_get_is_multicast:
20493  * @address: a #GInetAddress
20494  *
20495  * Tests whether @address is a multicast address.
20496  *
20497  * Returns: %TRUE if @address is a multicast address.
20498  * Since: 2.22
20499  */
20500
20501
20502 /**
20503  * g_inet_address_get_is_site_local:
20504  * @address: a #GInetAddress
20505  *
20506  * Tests whether @address is a site-local address such as 10.0.0.1
20507  * (that is, the address identifies a host on a local network that can
20508  * not be reached directly from the Internet, but which may have
20509  * outgoing Internet connectivity via a NAT or firewall).
20510  *
20511  * Returns: %TRUE if @address is a site-local address.
20512  * Since: 2.22
20513  */
20514
20515
20516 /**
20517  * g_inet_address_get_native_size:
20518  * @address: a #GInetAddress
20519  *
20520  * Gets the size of the native raw binary address for @address. This
20521  * is the size of the data that you get from g_inet_address_to_bytes().
20522  *
20523  * Returns: the number of bytes used for the native version of @address.
20524  * Since: 2.22
20525  */
20526
20527
20528 /**
20529  * g_inet_address_mask_equal:
20530  * @mask: a #GInetAddressMask
20531  * @mask2: another #GInetAddressMask
20532  *
20533  * Tests if @mask and @mask2 are the same mask.
20534  *
20535  * Returns: whether @mask and @mask2 are the same mask
20536  * Since: 2.32
20537  */
20538
20539
20540 /**
20541  * g_inet_address_mask_get_address:
20542  * @mask: a #GInetAddressMask
20543  *
20544  * Gets @mask's base address
20545  *
20546  * Returns: (transfer none): @mask's base address
20547  * Since: 2.32
20548  */
20549
20550
20551 /**
20552  * g_inet_address_mask_get_family:
20553  * @mask: a #GInetAddressMask
20554  *
20555  * Gets the #GSocketFamily of @mask's address
20556  *
20557  * Returns: the #GSocketFamily of @mask's address
20558  * Since: 2.32
20559  */
20560
20561
20562 /**
20563  * g_inet_address_mask_get_length:
20564  * @mask: a #GInetAddressMask
20565  *
20566  * Gets @mask's length
20567  *
20568  * Returns: @mask's length
20569  * Since: 2.32
20570  */
20571
20572
20573 /**
20574  * g_inet_address_mask_matches:
20575  * @mask: a #GInetAddressMask
20576  * @address: a #GInetAddress
20577  *
20578  * Tests if @address falls within the range described by @mask.
20579  *
20580  * Returns: whether @address falls within the range described by @mask.
20581  * Since: 2.32
20582  */
20583
20584
20585 /**
20586  * g_inet_address_mask_new:
20587  * @addr: a #GInetAddress
20588  * @length: number of bits of @addr to use
20589  * @error: return location for #GError, or %NULL
20590  *
20591  * Creates a new #GInetAddressMask representing all addresses whose
20592  * first @length bits match @addr.
20593  *
20594  * Returns: a new #GInetAddressMask, or %NULL on error
20595  * Since: 2.32
20596  */
20597
20598
20599 /**
20600  * g_inet_address_mask_new_from_string:
20601  * @mask_string: an IP address or address/length string
20602  * @error: return location for #GError, or %NULL
20603  *
20604  * Parses @mask_string as an IP address and (optional) length, and
20605  * creates a new #GInetAddressMask. The length, if present, is
20606  * delimited by a "/". If it is not present, then the length is
20607  * assumed to be the full length of the address.
20608  *
20609  * Returns: a new #GInetAddressMask corresponding to @string, or %NULL on error.
20610  * Since: 2.32
20611  */
20612
20613
20614 /**
20615  * g_inet_address_mask_to_string:
20616  * @mask: a #GInetAddressMask
20617  *
20618  * Converts @mask back to its corresponding string form.
20619  *
20620  * Returns: a string corresponding to @mask.
20621  * Since: 2.32
20622  */
20623
20624
20625 /**
20626  * g_inet_address_new_any:
20627  * @family: the address family
20628  *
20629  * Creates a #GInetAddress for the "any" address (unassigned/"don't
20630  * care") for @family.
20631  *
20632  * Returns: a new #GInetAddress corresponding to the "any" address for @family.
20633  * Since: 2.22
20634  */
20635
20636
20637 /**
20638  * g_inet_address_new_from_bytes:
20639  * @bytes: (array) (element-type guint8): raw address data
20640  * @family: the address family of @bytes
20641  *
20642  * Creates a new #GInetAddress from the given @family and @bytes.
20643  * @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for
20644  * %G_SOCKET_FAMILY_IPV6.
20645  *
20646  * Returns: a new #GInetAddress corresponding to @family and @bytes.
20647  * Since: 2.22
20648  */
20649
20650
20651 /**
20652  * g_inet_address_new_from_string:
20653  * @string: a string representation of an IP address
20654  *
20655  * Parses @string as an IP address and creates a new #GInetAddress.
20656  *
20657  * Returns: a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed.
20658  * Since: 2.22
20659  */
20660
20661
20662 /**
20663  * g_inet_address_new_loopback:
20664  * @family: the address family
20665  *
20666  * Creates a #GInetAddress for the loopback address for @family.
20667  *
20668  * Returns: a new #GInetAddress corresponding to the loopback address for @family.
20669  * Since: 2.22
20670  */
20671
20672
20673 /**
20674  * g_inet_address_to_bytes: (skip)
20675  * @address: a #GInetAddress
20676  *
20677  * Gets the raw binary address data from @address.
20678  *
20679  * 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().
20680  * Since: 2.22
20681  */
20682
20683
20684 /**
20685  * g_inet_address_to_string:
20686  * @address: a #GInetAddress
20687  *
20688  * Converts @address to string form.
20689  *
20690  * Returns: a representation of @address as a string, which should be freed after use.
20691  * Since: 2.22
20692  */
20693
20694
20695 /**
20696  * g_inet_socket_address_get_address:
20697  * @address: a #GInetSocketAddress
20698  *
20699  * Gets @address's #GInetAddress.
20700  *
20701  * Returns: (transfer none): the #GInetAddress for @address, which must be g_object_ref()'d if it will be stored
20702  * Since: 2.22
20703  */
20704
20705
20706 /**
20707  * g_inet_socket_address_get_flowinfo:
20708  * @address: a %G_SOCKET_FAMILY_IPV6 #GInetSocketAddress
20709  *
20710  * Gets the <literal>sin6_flowinfo</literal> field from @address,
20711  * which must be an IPv6 address.
20712  *
20713  * Returns: the flowinfo field
20714  * Since: 2.32
20715  */
20716
20717
20718 /**
20719  * g_inet_socket_address_get_port:
20720  * @address: a #GInetSocketAddress
20721  *
20722  * Gets @address's port.
20723  *
20724  * Returns: the port for @address
20725  * Since: 2.22
20726  */
20727
20728
20729 /**
20730  * g_inet_socket_address_get_scope_id:
20731  * @address: a %G_SOCKET_FAMILY_IPV6 #GInetAddress
20732  *
20733  * Gets the <literal>sin6_scope_id</literal> field from @address,
20734  * which must be an IPv6 address.
20735  *
20736  * Returns: the scope id field
20737  * Since: 2.32
20738  */
20739
20740
20741 /**
20742  * g_inet_socket_address_new:
20743  * @address: a #GInetAddress
20744  * @port: a port number
20745  *
20746  * Creates a new #GInetSocketAddress for @address and @port.
20747  *
20748  * Returns: a new #GInetSocketAddress
20749  * Since: 2.22
20750  */
20751
20752
20753 /**
20754  * g_initable_init:
20755  * @initable: a #GInitable.
20756  * @cancellable: optional #GCancellable object, %NULL to ignore.
20757  * @error: a #GError location to store the error occurring, or %NULL to ignore.
20758  *
20759  * Initializes the object implementing the interface.
20760  *
20761  * The object must be initialized before any real use after initial
20762  * construction, either with this function or g_async_initable_init_async().
20763  *
20764  * Implementations may also support cancellation. If @cancellable is not %NULL,
20765  * then initialization can be cancelled by triggering the cancellable object
20766  * from another thread. If the operation was cancelled, the error
20767  * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
20768  * the object doesn't support cancellable initialization the error
20769  * %G_IO_ERROR_NOT_SUPPORTED will be returned.
20770  *
20771  * If the object is not initialized, or initialization returns with an
20772  * error, then all operations on the object except g_object_ref() and
20773  * g_object_unref() are considered to be invalid, and have undefined
20774  * behaviour. See the <xref linkend="ginitable"/> section introduction
20775  * for more details.
20776  *
20777  * Implementations of this method must be idempotent, i.e. multiple calls
20778  * to this function with the same argument should return the same results.
20779  * Only the first call initializes the object, further calls return the result
20780  * of the first call. This is so that it's safe to implement the singleton
20781  * pattern in the GObject constructor function.
20782  *
20783  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
20784  * Since: 2.22
20785  */
20786
20787
20788 /**
20789  * g_initable_new:
20790  * @object_type: a #GType supporting #GInitable.
20791  * @cancellable: optional #GCancellable object, %NULL to ignore.
20792  * @error: a #GError location to store the error occurring, or %NULL to ignore.
20793  * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
20794  * @...: the value if the first property, followed by and other property value pairs, and ended by %NULL.
20795  *
20796  * Helper function for constructing #GInitable object. This is
20797  * similar to g_object_new() but also initializes the object
20798  * and returns %NULL, setting an error on failure.
20799  *
20800  * Returns: (type GObject.Object) (transfer full): a newly allocated #GObject, or %NULL on error
20801  * Since: 2.22
20802  */
20803
20804
20805 /**
20806  * g_initable_new_valist:
20807  * @object_type: a #GType supporting #GInitable.
20808  * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
20809  * @var_args: The var args list generated from @first_property_name.
20810  * @cancellable: optional #GCancellable object, %NULL to ignore.
20811  * @error: a #GError location to store the error occurring, or %NULL to ignore.
20812  *
20813  * Helper function for constructing #GInitable object. This is
20814  * similar to g_object_new_valist() but also initializes the object
20815  * and returns %NULL, setting an error on failure.
20816  *
20817  * Returns: (type GObject.Object) (transfer full): a newly allocated #GObject, or %NULL on error
20818  * Since: 2.22
20819  */
20820
20821
20822 /**
20823  * g_initable_newv:
20824  * @object_type: a #GType supporting #GInitable.
20825  * @n_parameters: the number of parameters in @parameters
20826  * @parameters: (array length=n_parameters): the parameters to use to construct the object
20827  * @cancellable: optional #GCancellable object, %NULL to ignore.
20828  * @error: a #GError location to store the error occurring, or %NULL to ignore.
20829  *
20830  * Helper function for constructing #GInitable object. This is
20831  * similar to g_object_newv() but also initializes the object
20832  * and returns %NULL, setting an error on failure.
20833  *
20834  * Returns: (type GObject.Object) (transfer full): a newly allocated #GObject, or %NULL on error
20835  * Since: 2.22
20836  */
20837
20838
20839 /**
20840  * g_input_stream_clear_pending:
20841  * @stream: input stream
20842  *
20843  * Clears the pending flag on @stream.
20844  */
20845
20846
20847 /**
20848  * g_input_stream_close:
20849  * @stream: A #GInputStream.
20850  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20851  * @error: location to store the error occurring, or %NULL to ignore
20852  *
20853  * Closes the stream, releasing resources related to it.
20854  *
20855  * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
20856  * Closing a stream multiple times will not return an error.
20857  *
20858  * Streams will be automatically closed when the last reference
20859  * is dropped, but you might want to call this function to make sure
20860  * resources are released as early as possible.
20861  *
20862  * Some streams might keep the backing store of the stream (e.g. a file descriptor)
20863  * open after the stream is closed. See the documentation for the individual
20864  * stream for details.
20865  *
20866  * On failure the first error that happened will be reported, but the close
20867  * operation will finish as much as possible. A stream that failed to
20868  * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
20869  * is important to check and report the error to the user.
20870  *
20871  * If @cancellable is not %NULL, then the operation can be cancelled by
20872  * triggering the cancellable object from another thread. If the operation
20873  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20874  * Cancelling a close will still leave the stream closed, but some streams
20875  * can use a faster close that doesn't block to e.g. check errors.
20876  *
20877  * Returns: %TRUE on success, %FALSE on failure
20878  */
20879
20880
20881 /**
20882  * g_input_stream_close_async:
20883  * @stream: A #GInputStream.
20884  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
20885  * @cancellable: (allow-none): optional cancellable object
20886  * @callback: (scope async): callback to call when the request is satisfied
20887  * @user_data: (closure): the data to pass to callback function
20888  *
20889  * Requests an asynchronous closes of the stream, releasing resources related to it.
20890  * When the operation is finished @callback will be called.
20891  * You can then call g_input_stream_close_finish() to get the result of the
20892  * operation.
20893  *
20894  * For behaviour details see g_input_stream_close().
20895  *
20896  * The asyncronous methods have a default fallback that uses threads to implement
20897  * asynchronicity, so they are optional for inheriting classes. However, if you
20898  * override one you must override all.
20899  */
20900
20901
20902 /**
20903  * g_input_stream_close_finish:
20904  * @stream: a #GInputStream.
20905  * @result: a #GAsyncResult.
20906  * @error: a #GError location to store the error occurring, or %NULL to ignore.
20907  *
20908  * Finishes closing a stream asynchronously, started from g_input_stream_close_async().
20909  *
20910  * Returns: %TRUE if the stream was closed successfully.
20911  */
20912
20913
20914 /**
20915  * g_input_stream_has_pending:
20916  * @stream: input stream.
20917  *
20918  * Checks if an input stream has pending actions.
20919  *
20920  * Returns: %TRUE if @stream has pending actions.
20921  */
20922
20923
20924 /**
20925  * g_input_stream_is_closed:
20926  * @stream: input stream.
20927  *
20928  * Checks if an input stream is closed.
20929  *
20930  * Returns: %TRUE if the stream is closed.
20931  */
20932
20933
20934 /**
20935  * g_input_stream_read:
20936  * @stream: a #GInputStream.
20937  * @buffer: (array length=count) (element-type guint8): a buffer to read data into (which should be at least count bytes long).
20938  * @count: the number of bytes that will be read from the stream
20939  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20940  * @error: location to store the error occurring, or %NULL to ignore
20941  *
20942  * Tries to read @count bytes from the stream into the buffer starting at
20943  * @buffer. Will block during this read.
20944  *
20945  * If count is zero returns zero and does nothing. A value of @count
20946  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
20947  *
20948  * On success, the number of bytes read into the buffer is returned.
20949  * It is not an error if this is not the same as the requested size, as it
20950  * can happen e.g. near the end of a file. Zero is returned on end of file
20951  * (or if @count is zero),  but never otherwise.
20952  *
20953  * If @cancellable is not %NULL, then the operation can be cancelled by
20954  * triggering the cancellable object from another thread. If the operation
20955  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
20956  * operation was partially finished when the operation was cancelled the
20957  * partial result will be returned, without an error.
20958  *
20959  * On error -1 is returned and @error is set accordingly.
20960  *
20961  * Returns: Number of bytes read, or -1 on error, or 0 on end of file.
20962  */
20963
20964
20965 /**
20966  * g_input_stream_read_all:
20967  * @stream: a #GInputStream.
20968  * @buffer: (array length=count) (element-type guint8): a buffer to read data into (which should be at least count bytes long).
20969  * @count: the number of bytes that will be read from the stream
20970  * @bytes_read: (out): location to store the number of bytes that was read from the stream
20971  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20972  * @error: location to store the error occurring, or %NULL to ignore
20973  *
20974  * Tries to read @count bytes from the stream into the buffer starting at
20975  * @buffer. Will block during this read.
20976  *
20977  * This function is similar to g_input_stream_read(), except it tries to
20978  * read as many bytes as requested, only stopping on an error or end of stream.
20979  *
20980  * On a successful read of @count bytes, or if we reached the end of the
20981  * stream,  %TRUE is returned, and @bytes_read is set to the number of bytes
20982  * read into @buffer.
20983  *
20984  * If there is an error during the operation %FALSE is returned and @error
20985  * is set to indicate the error status, @bytes_read is updated to contain
20986  * the number of bytes read into @buffer before the error occurred.
20987  *
20988  * Returns: %TRUE on success, %FALSE if there was an error
20989  */
20990
20991
20992 /**
20993  * g_input_stream_read_async:
20994  * @stream: A #GInputStream.
20995  * @buffer: (array length=count) (element-type guint8): a buffer to read data into (which should be at least count bytes long).
20996  * @count: the number of bytes that will be read from the stream
20997  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
20998  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20999  * @callback: (scope async): callback to call when the request is satisfied
21000  * @user_data: (closure): the data to pass to callback function
21001  *
21002  * Request an asynchronous read of @count bytes from the stream into the buffer
21003  * starting at @buffer. When the operation is finished @callback will be called.
21004  * You can then call g_input_stream_read_finish() to get the result of the
21005  * operation.
21006  *
21007  * During an async request no other sync and async calls are allowed on @stream, and will
21008  * result in %G_IO_ERROR_PENDING errors.
21009  *
21010  * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21011  *
21012  * On success, the number of bytes read into the buffer will be passed to the
21013  * callback. It is not an error if this is not the same as the requested size, as it
21014  * can happen e.g. near the end of a file, but generally we try to read
21015  * as many bytes as requested. Zero is returned on end of file
21016  * (or if @count is zero),  but never otherwise.
21017  *
21018  * Any outstanding i/o request with higher priority (lower numerical value) will
21019  * be executed before an outstanding request with lower priority. Default
21020  * priority is %G_PRIORITY_DEFAULT.
21021  *
21022  * The asyncronous methods have a default fallback that uses threads to implement
21023  * asynchronicity, so they are optional for inheriting classes. However, if you
21024  * override one you must override all.
21025  */
21026
21027
21028 /**
21029  * g_input_stream_read_bytes:
21030  * @stream: a #GInputStream.
21031  * @count: maximum number of bytes that will be read from the stream. Common values include 4096 and 8192.
21032  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21033  * @error: location to store the error occurring, or %NULL to ignore
21034  *
21035  * Like g_input_stream_read(), this tries to read @count bytes from
21036  * the stream in a blocking fashion. However, rather than reading into
21037  * a user-supplied buffer, this will create a new #GBytes containing
21038  * the data that was read. This may be easier to use from language
21039  * bindings.
21040  *
21041  * If count is zero, returns a zero-length #GBytes and does nothing. A
21042  * value of @count larger than %G_MAXSSIZE will cause a
21043  * %G_IO_ERROR_INVALID_ARGUMENT error.
21044  *
21045  * On success, a new #GBytes is returned. It is not an error if the
21046  * size of this object is not the same as the requested size, as it
21047  * can happen e.g. near the end of a file. A zero-length #GBytes is
21048  * returned on end of file (or if @count is zero), but never
21049  * otherwise.
21050  *
21051  * If @cancellable is not %NULL, then the operation can be cancelled by
21052  * triggering the cancellable object from another thread. If the operation
21053  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21054  * operation was partially finished when the operation was cancelled the
21055  * partial result will be returned, without an error.
21056  *
21057  * On error %NULL is returned and @error is set accordingly.
21058  *
21059  * Returns: a new #GBytes, or %NULL on error
21060  */
21061
21062
21063 /**
21064  * g_input_stream_read_bytes_async:
21065  * @stream: A #GInputStream.
21066  * @count: the number of bytes that will be read from the stream
21067  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21068  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21069  * @callback: (scope async): callback to call when the request is satisfied
21070  * @user_data: (closure): the data to pass to callback function
21071  *
21072  * Request an asynchronous read of @count bytes from the stream into a
21073  * new #GBytes. When the operation is finished @callback will be
21074  * called. You can then call g_input_stream_read_bytes_finish() to get the
21075  * result of the operation.
21076  *
21077  * During an async request no other sync and async calls are allowed
21078  * on @stream, and will result in %G_IO_ERROR_PENDING errors.
21079  *
21080  * A value of @count larger than %G_MAXSSIZE will cause a
21081  * %G_IO_ERROR_INVALID_ARGUMENT error.
21082  *
21083  * On success, the new #GBytes will be passed to the callback. It is
21084  * not an error if this is smaller than the requested size, as it can
21085  * happen e.g. near the end of a file, but generally we try to read as
21086  * many bytes as requested. Zero is returned on end of file (or if
21087  * @count is zero), but never otherwise.
21088  *
21089  * Any outstanding I/O request with higher priority (lower numerical
21090  * value) will be executed before an outstanding request with lower
21091  * priority. Default priority is %G_PRIORITY_DEFAULT.
21092  */
21093
21094
21095 /**
21096  * g_input_stream_read_bytes_finish:
21097  * @stream: a #GInputStream.
21098  * @result: a #GAsyncResult.
21099  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21100  *
21101  * Finishes an asynchronous stream read-into-#GBytes operation.
21102  *
21103  * Returns: the newly-allocated #GBytes, or %NULL on error
21104  */
21105
21106
21107 /**
21108  * g_input_stream_read_finish:
21109  * @stream: a #GInputStream.
21110  * @result: a #GAsyncResult.
21111  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21112  *
21113  * Finishes an asynchronous stream read operation.
21114  *
21115  * Returns: number of bytes read in, or -1 on error, or 0 on end of file.
21116  */
21117
21118
21119 /**
21120  * g_input_stream_set_pending:
21121  * @stream: input stream
21122  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21123  *
21124  * Sets @stream to have actions pending. If the pending flag is
21125  * already set or @stream is closed, it will return %FALSE and set
21126  * @error.
21127  *
21128  * Returns: %TRUE if pending was previously unset and is now set.
21129  */
21130
21131
21132 /**
21133  * g_input_stream_skip:
21134  * @stream: a #GInputStream.
21135  * @count: the number of bytes that will be skipped from the stream
21136  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21137  * @error: location to store the error occurring, or %NULL to ignore
21138  *
21139  * Tries to skip @count bytes from the stream. Will block during the operation.
21140  *
21141  * This is identical to g_input_stream_read(), from a behaviour standpoint,
21142  * but the bytes that are skipped are not returned to the user. Some
21143  * streams have an implementation that is more efficient than reading the data.
21144  *
21145  * This function is optional for inherited classes, as the default implementation
21146  * emulates it using read.
21147  *
21148  * If @cancellable is not %NULL, then the operation can be cancelled by
21149  * triggering the cancellable object from another thread. If the operation
21150  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
21151  * operation was partially finished when the operation was cancelled the
21152  * partial result will be returned, without an error.
21153  *
21154  * Returns: Number of bytes skipped, or -1 on error
21155  */
21156
21157
21158 /**
21159  * g_input_stream_skip_async:
21160  * @stream: A #GInputStream.
21161  * @count: the number of bytes that will be skipped from the stream
21162  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21163  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21164  * @callback: (scope async): callback to call when the request is satisfied
21165  * @user_data: (closure): the data to pass to callback function
21166  *
21167  * Request an asynchronous skip of @count bytes from the stream.
21168  * When the operation is finished @callback will be called.
21169  * You can then call g_input_stream_skip_finish() to get the result
21170  * of the operation.
21171  *
21172  * During an async request no other sync and async calls are allowed,
21173  * and will result in %G_IO_ERROR_PENDING errors.
21174  *
21175  * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
21176  *
21177  * On success, the number of bytes skipped will be passed to the callback.
21178  * It is not an error if this is not the same as the requested size, as it
21179  * can happen e.g. near the end of a file, but generally we try to skip
21180  * as many bytes as requested. Zero is returned on end of file
21181  * (or if @count is zero), but never otherwise.
21182  *
21183  * Any outstanding i/o request with higher priority (lower numerical value)
21184  * will be executed before an outstanding request with lower priority.
21185  * Default priority is %G_PRIORITY_DEFAULT.
21186  *
21187  * The asynchronous methods have a default fallback that uses threads to
21188  * implement asynchronicity, so they are optional for inheriting classes.
21189  * However, if you override one, you must override all.
21190  */
21191
21192
21193 /**
21194  * g_input_stream_skip_finish:
21195  * @stream: a #GInputStream.
21196  * @result: a #GAsyncResult.
21197  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21198  *
21199  * Finishes a stream skip operation.
21200  *
21201  * Returns: the size of the bytes skipped, or %-1 on error.
21202  */
21203
21204
21205 /**
21206  * g_io_error_from_errno:
21207  * @err_no: Error number as defined in errno.h.
21208  *
21209  * Converts errno.h error codes into GIO error codes.
21210  *
21211  * Returns: #GIOErrorEnum value for the given errno.h error number.
21212  */
21213
21214
21215 /**
21216  * g_io_error_from_win32_error:
21217  * @error_code: Windows error number.
21218  *
21219  * Converts some common error codes into GIO error codes. The
21220  * fallback value G_IO_ERROR_FAILED is returned for error codes not
21221  * handled.
21222  *
21223  * Returns: #GIOErrorEnum value for the given error number.
21224  * Since: 2.26
21225  */
21226
21227
21228 /**
21229  * g_io_error_quark:
21230  *
21231  * Gets the GIO Error Quark.
21232  *
21233  * Returns: a #GQuark.
21234  */
21235
21236
21237 /**
21238  * g_io_extension_get_name:
21239  * @extension: a #GIOExtension
21240  *
21241  * Gets the name under which @extension was registered.
21242  *
21243  * Note that the same type may be registered as extension
21244  * for multiple extension points, under different names.
21245  *
21246  * Returns: the name of @extension.
21247  */
21248
21249
21250 /**
21251  * g_io_extension_get_priority:
21252  * @extension: a #GIOExtension
21253  *
21254  * Gets the priority with which @extension was registered.
21255  *
21256  * Returns: the priority of @extension
21257  */
21258
21259
21260 /**
21261  * g_io_extension_get_type:
21262  * @extension: a #GIOExtension
21263  *
21264  * Gets the type associated with @extension.
21265  *
21266  * Returns: the type of @extension
21267  */
21268
21269
21270 /**
21271  * g_io_extension_point_get_extension_by_name:
21272  * @extension_point: a #GIOExtensionPoint
21273  * @name: the name of the extension to get
21274  *
21275  * Finds a #GIOExtension for an extension point by name.
21276  *
21277  * Returns: (transfer none): the #GIOExtension for @extension_point that has the given name, or %NULL if there is no extension with that name
21278  */
21279
21280
21281 /**
21282  * g_io_extension_point_get_extensions:
21283  * @extension_point: a #GIOExtensionPoint
21284  *
21285  * Gets a list of all extensions that implement this extension point.
21286  * The list is sorted by priority, beginning with the highest priority.
21287  *
21288  * Returns: (element-type GIOExtension) (transfer none): a #GList of #GIOExtension<!-- -->s. The list is owned by GIO and should not be modified.
21289  */
21290
21291
21292 /**
21293  * g_io_extension_point_get_required_type:
21294  * @extension_point: a #GIOExtensionPoint
21295  *
21296  * Gets the required type for @extension_point.
21297  *
21298  * Returns: the #GType that all implementations must have, or #G_TYPE_INVALID if the extension point has no required type
21299  */
21300
21301
21302 /**
21303  * g_io_extension_point_implement:
21304  * @extension_point_name: the name of the extension point
21305  * @type: the #GType to register as extension
21306  * @extension_name: the name for the extension
21307  * @priority: the priority for the extension
21308  *
21309  * Registers @type as extension for the extension point with name
21310  * @extension_point_name.
21311  *
21312  * If @type has already been registered as an extension for this
21313  * extension point, the existing #GIOExtension object is returned.
21314  *
21315  * Returns: (transfer none): a #GIOExtension object for #GType
21316  */
21317
21318
21319 /**
21320  * g_io_extension_point_lookup:
21321  * @name: the name of the extension point
21322  *
21323  * Looks up an existing extension point.
21324  *
21325  * Returns: (transfer none): the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name.
21326  */
21327
21328
21329 /**
21330  * g_io_extension_point_register:
21331  * @name: The name of the extension point
21332  *
21333  * Registers an extension point.
21334  *
21335  * Returns: (transfer none): the new #GIOExtensionPoint. This object is owned by GIO and should not be freed.
21336  */
21337
21338
21339 /**
21340  * g_io_extension_point_set_required_type:
21341  * @extension_point: a #GIOExtensionPoint
21342  * @type: the #GType to require
21343  *
21344  * Sets the required type for @extension_point to @type.
21345  * All implementations must henceforth have this type.
21346  */
21347
21348
21349 /**
21350  * g_io_extension_ref_class:
21351  * @extension: a #GIOExtension
21352  *
21353  * Gets a reference to the class for the type that is
21354  * associated with @extension.
21355  *
21356  * Returns: (transfer full): the #GTypeClass for the type of @extension
21357  */
21358
21359
21360 /**
21361  * g_io_module_new:
21362  * @filename: filename of the shared library module.
21363  *
21364  * Creates a new GIOModule that will load the specific
21365  * shared library when in use.
21366  *
21367  * Returns: a #GIOModule from given @filename, or %NULL on error.
21368  */
21369
21370
21371 /**
21372  * g_io_module_scope_block:
21373  * @scope: a module loading scope
21374  * @basename: the basename to block
21375  *
21376  * Block modules with the given @basename from being loaded when
21377  * this scope is used with g_io_modules_scan_all_in_directory_with_scope()
21378  * or g_io_modules_load_all_in_directory_with_scope().
21379  *
21380  * Since: 2.30
21381  */
21382
21383
21384 /**
21385  * g_io_module_scope_free:
21386  * @scope: a module loading scope
21387  *
21388  * Free a module scope.
21389  *
21390  * Since: 2.30
21391  */
21392
21393
21394 /**
21395  * g_io_module_scope_new:
21396  * @flags: flags for the new scope
21397  *
21398  * Create a new scope for loading of IO modules. A scope can be used for
21399  * blocking duplicate modules, or blocking a module you don't want to load.
21400  *
21401  * Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules
21402  * which have the same base name as a module that has already been seen
21403  * in this scope.
21404  *
21405  * Returns: (transfer full): the new module scope
21406  * Since: 2.30
21407  */
21408
21409
21410 /**
21411  * g_io_modules_load_all_in_directory:
21412  * @dirname: pathname for a directory containing modules to load.
21413  *
21414  * Loads all the modules in the specified directory.
21415  *
21416  * If don't require all modules to be initialized (and thus registering
21417  * all gtypes) then you can use g_io_modules_scan_all_in_directory()
21418  * which allows delayed/lazy loading of modules.
21419  *
21420  * 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().
21421  */
21422
21423
21424 /**
21425  * g_io_modules_load_all_in_directory_with_scope:
21426  * @dirname: pathname for a directory containing modules to load.
21427  * @scope: a scope to use when scanning the modules.
21428  *
21429  * Loads all the modules in the specified directory.
21430  *
21431  * If don't require all modules to be initialized (and thus registering
21432  * all gtypes) then you can use g_io_modules_scan_all_in_directory()
21433  * which allows delayed/lazy loading of modules.
21434  *
21435  * 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().
21436  * Since: 2.30
21437  */
21438
21439
21440 /**
21441  * g_io_modules_scan_all_in_directory:
21442  * @dirname: pathname for a directory containing modules to scan.
21443  *
21444  * Scans all the modules in the specified directory, ensuring that
21445  * any extension point implemented by a module is registered.
21446  *
21447  * This may not actually load and initialize all the types in each
21448  * module, some modules may be lazily loaded and initialized when
21449  * an extension point it implementes is used with e.g.
21450  * g_io_extension_point_get_extensions() or
21451  * g_io_extension_point_get_extension_by_name().
21452  *
21453  * If you need to guarantee that all types are loaded in all the modules,
21454  * use g_io_modules_load_all_in_directory().
21455  *
21456  * Since: 2.24
21457  */
21458
21459
21460 /**
21461  * g_io_modules_scan_all_in_directory_with_scope:
21462  * @dirname: pathname for a directory containing modules to scan.
21463  * @scope: a scope to use when scanning the modules
21464  *
21465  * Scans all the modules in the specified directory, ensuring that
21466  * any extension point implemented by a module is registered.
21467  *
21468  * This may not actually load and initialize all the types in each
21469  * module, some modules may be lazily loaded and initialized when
21470  * an extension point it implementes is used with e.g.
21471  * g_io_extension_point_get_extensions() or
21472  * g_io_extension_point_get_extension_by_name().
21473  *
21474  * If you need to guarantee that all types are loaded in all the modules,
21475  * use g_io_modules_load_all_in_directory().
21476  *
21477  * Since: 2.30
21478  */
21479
21480
21481 /**
21482  * g_io_scheduler_cancel_all_jobs:
21483  *
21484  * Cancels all cancellable I/O jobs.
21485  *
21486  * A job is cancellable if a #GCancellable was passed into
21487  * g_io_scheduler_push_job().
21488  *
21489  * Deprecated: You should never call this function, since you don't know how other libraries in your program might be making use of gioscheduler.
21490  */
21491
21492
21493 /**
21494  * g_io_scheduler_job_send_to_mainloop:
21495  * @job: a #GIOSchedulerJob
21496  * @func: a #GSourceFunc callback that will be called in the original thread
21497  * @user_data: data to pass to @func
21498  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
21499  *
21500  * Used from an I/O job to send a callback to be run in the thread
21501  * that the job was started from, waiting for the result (and thus
21502  * blocking the I/O job).
21503  *
21504  * Returns: The return value of @func
21505  * Deprecated: Use g_main_context_invoke().
21506  */
21507
21508
21509 /**
21510  * g_io_scheduler_job_send_to_mainloop_async:
21511  * @job: a #GIOSchedulerJob
21512  * @func: a #GSourceFunc callback that will be called in the original thread
21513  * @user_data: data to pass to @func
21514  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
21515  *
21516  * Used from an I/O job to send a callback to be run asynchronously in
21517  * the thread that the job was started from. The callback will be run
21518  * when the main loop is available, but at that time the I/O job might
21519  * have finished. The return value from the callback is ignored.
21520  *
21521  * Note that if you are passing the @user_data from g_io_scheduler_push_job()
21522  * on to this function you have to ensure that it is not freed before
21523  * @func is called, either by passing %NULL as @notify to
21524  * g_io_scheduler_push_job() or by using refcounting for @user_data.
21525  *
21526  * Deprecated: Use g_main_context_invoke().
21527  */
21528
21529
21530 /**
21531  * g_io_scheduler_push_job:
21532  * @job_func: a #GIOSchedulerJobFunc.
21533  * @user_data: data to pass to @job_func
21534  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
21535  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
21536  * @cancellable: optional #GCancellable object, %NULL to ignore.
21537  *
21538  * Schedules the I/O job to run in another thread.
21539  *
21540  * @notify will be called on @user_data after @job_func has returned,
21541  * regardless whether the job was cancelled or has run to completion.
21542  *
21543  * If @cancellable is not %NULL, it can be used to cancel the I/O job
21544  * by calling g_cancellable_cancel() or by calling
21545  * g_io_scheduler_cancel_all_jobs().
21546  *
21547  * Deprecated: use #GThreadPool or g_task_run_in_thread()
21548  */
21549
21550
21551 /**
21552  * g_io_stream_clear_pending:
21553  * @stream: a #GIOStream
21554  *
21555  * Clears the pending flag on @stream.
21556  *
21557  * Since: 2.22
21558  */
21559
21560
21561 /**
21562  * g_io_stream_close:
21563  * @stream: a #GIOStream
21564  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21565  * @error: location to store the error occurring, or %NULL to ignore
21566  *
21567  * Closes the stream, releasing resources related to it. This will also
21568  * closes the individual input and output streams, if they are not already
21569  * closed.
21570  *
21571  * Once the stream is closed, all other operations will return
21572  * %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
21573  * return an error.
21574  *
21575  * Closing a stream will automatically flush any outstanding buffers
21576  * in the stream.
21577  *
21578  * Streams will be automatically closed when the last reference
21579  * is dropped, but you might want to call this function to make sure
21580  * resources are released as early as possible.
21581  *
21582  * Some streams might keep the backing store of the stream (e.g. a file
21583  * descriptor) open after the stream is closed. See the documentation for
21584  * the individual stream for details.
21585  *
21586  * On failure the first error that happened will be reported, but the
21587  * close operation will finish as much as possible. A stream that failed
21588  * to close will still return %G_IO_ERROR_CLOSED for all operations.
21589  * Still, it is important to check and report the error to the user,
21590  * otherwise there might be a loss of data as all data might not be written.
21591  *
21592  * If @cancellable is not NULL, then the operation can be cancelled by
21593  * triggering the cancellable object from another thread. If the operation
21594  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
21595  * Cancelling a close will still leave the stream closed, but some streams
21596  * can use a faster close that doesn't block to e.g. check errors.
21597  *
21598  * The default implementation of this method just calls close on the
21599  * individual input/output streams.
21600  *
21601  * Returns: %TRUE on success, %FALSE on failure
21602  * Since: 2.22
21603  */
21604
21605
21606 /**
21607  * g_io_stream_close_async:
21608  * @stream: a #GIOStream
21609  * @io_priority: the io priority of the request
21610  * @cancellable: (allow-none): optional cancellable object
21611  * @callback: (scope async): callback to call when the request is satisfied
21612  * @user_data: (closure): the data to pass to callback function
21613  *
21614  * Requests an asynchronous close of the stream, releasing resources
21615  * related to it. When the operation is finished @callback will be
21616  * called. You can then call g_io_stream_close_finish() to get
21617  * the result of the operation.
21618  *
21619  * For behaviour details see g_io_stream_close().
21620  *
21621  * The asynchronous methods have a default fallback that uses threads
21622  * to implement asynchronicity, so they are optional for inheriting
21623  * classes. However, if you override one you must override all.
21624  *
21625  * Since: 2.22
21626  */
21627
21628
21629 /**
21630  * g_io_stream_close_finish:
21631  * @stream: a #GIOStream
21632  * @result: a #GAsyncResult
21633  * @error: a #GError location to store the error occurring, or %NULL to ignore
21634  *
21635  * Closes a stream.
21636  *
21637  * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
21638  * Since: 2.22
21639  */
21640
21641
21642 /**
21643  * g_io_stream_get_input_stream:
21644  * @stream: a #GIOStream
21645  *
21646  * Gets the input stream for this object. This is used
21647  * for reading.
21648  *
21649  * Returns: (transfer none): a #GInputStream, owned by the #GIOStream. Do not free.
21650  * Since: 2.22
21651  */
21652
21653
21654 /**
21655  * g_io_stream_get_output_stream:
21656  * @stream: a #GIOStream
21657  *
21658  * Gets the output stream for this object. This is used for
21659  * writing.
21660  *
21661  * Returns: (transfer none): a #GOutputStream, owned by the #GIOStream. Do not free.
21662  * Since: 2.22
21663  */
21664
21665
21666 /**
21667  * g_io_stream_has_pending:
21668  * @stream: a #GIOStream
21669  *
21670  * Checks if a stream has pending actions.
21671  *
21672  * Returns: %TRUE if @stream has pending actions.
21673  * Since: 2.22
21674  */
21675
21676
21677 /**
21678  * g_io_stream_is_closed:
21679  * @stream: a #GIOStream
21680  *
21681  * Checks if a stream is closed.
21682  *
21683  * Returns: %TRUE if the stream is closed.
21684  * Since: 2.22
21685  */
21686
21687
21688 /**
21689  * g_io_stream_set_pending:
21690  * @stream: a #GIOStream
21691  * @error: a #GError location to store the error occurring, or %NULL to ignore
21692  *
21693  * Sets @stream to have actions pending. If the pending flag is
21694  * already set or @stream is closed, it will return %FALSE and set
21695  * @error.
21696  *
21697  * Returns: %TRUE if pending was previously unset and is now set.
21698  * Since: 2.22
21699  */
21700
21701
21702 /**
21703  * g_io_stream_splice_async:
21704  * @stream1: a #GIOStream.
21705  * @stream2: a #GIOStream.
21706  * @flags: a set of #GIOStreamSpliceFlags.
21707  * @io_priority: the io priority of the request.
21708  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21709  * @callback: (scope async): a #GAsyncReadyCallback.
21710  * @user_data: (closure): user data passed to @callback.
21711  *
21712  * Asyncronously splice the output stream of @stream1 to the input stream of
21713  * @stream2, and splice the output stream of @stream2 to the input stream of
21714  * @stream1.
21715  *
21716  * When the operation is finished @callback will be called.
21717  * You can then call g_io_stream_splice_finish() to get the
21718  * result of the operation.
21719  *
21720  * Since: 2.28
21721  */
21722
21723
21724 /**
21725  * g_io_stream_splice_finish:
21726  * @result: a #GAsyncResult.
21727  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21728  *
21729  * Finishes an asynchronous io stream splice operation.
21730  *
21731  * Returns: %TRUE on success, %FALSE otherwise.
21732  * Since: 2.28
21733  */
21734
21735
21736 /**
21737  * g_keyfile_settings_backend_new:
21738  * @filename: the filename of the keyfile
21739  * @root_path: the path under which all settings keys appear
21740  * @root_group: (allow-none): the group name corresponding to @root_path, or %NULL
21741  *
21742  * Creates a keyfile-backed #GSettingsBackend.
21743  *
21744  * The filename of the keyfile to use is given by @filename.
21745  *
21746  * All settings read to or written from the backend must fall under the
21747  * path given in @root_path (which must start and end with a slash and
21748  * not contain two consecutive slashes).  @root_path may be "/".
21749  *
21750  * If @root_group is non-%NULL then it specifies the name of the keyfile
21751  * group used for keys that are written directly below @root_path.  For
21752  * example, if @root_path is "/apps/example/" and @root_group is
21753  * "toplevel", then settings the key "/apps/example/enabled" to a value
21754  * of %TRUE will cause the following to appear in the keyfile:
21755  *
21756  * |[
21757  *   [toplevel]
21758  *   enabled=true
21759  * ]|
21760  *
21761  * If @root_group is %NULL then it is not permitted to store keys
21762  * directly below the @root_path.
21763  *
21764  * For keys not stored directly below @root_path (ie: in a sub-path),
21765  * the name of the subpath (with the final slash stripped) is used as
21766  * the name of the keyfile group.  To continue the example, if
21767  * "/apps/example/profiles/default/font-size" were set to
21768  * 12 then the following would appear in the keyfile:
21769  *
21770  * |[
21771  *   [profiles/default]
21772  *   font-size=12
21773  * ]|
21774  *
21775  * The backend will refuse writes (and return writability as being
21776  * %FALSE) for keys outside of @root_path and, in the event that
21777  * @root_group is %NULL, also for keys directly under @root_path.
21778  * Writes will also be refused if the backend detects that it has the
21779  * inability to rewrite the keyfile (ie: the containing directory is not
21780  * writable).
21781  *
21782  * There is no checking done for your key namespace clashing with the
21783  * syntax of the key file format.  For example, if you have '[' or ']'
21784  * characters in your path names or '=' in your key names you may be in
21785  * trouble.
21786  *
21787  * Returns: (transfer full): a keyfile-backed #GSettingsBackend
21788  */
21789
21790
21791 /**
21792  * g_loadable_icon_load:
21793  * @icon: a #GLoadableIcon.
21794  * @size: an integer.
21795  * @type: (out) (allow-none): a location to store the type of the loaded icon, %NULL to ignore.
21796  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21797  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21798  *
21799  * Loads a loadable icon. For the asynchronous version of this function,
21800  * see g_loadable_icon_load_async().
21801  *
21802  * Returns: (transfer full): a #GInputStream to read the icon from.
21803  */
21804
21805
21806 /**
21807  * g_loadable_icon_load_async:
21808  * @icon: a #GLoadableIcon.
21809  * @size: an integer.
21810  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21811  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
21812  * @user_data: (closure): the data to pass to callback function
21813  *
21814  * Loads an icon asynchronously. To finish this function, see
21815  * g_loadable_icon_load_finish(). For the synchronous, blocking
21816  * version of this function, see g_loadable_icon_load().
21817  */
21818
21819
21820 /**
21821  * g_loadable_icon_load_finish:
21822  * @icon: a #GLoadableIcon.
21823  * @res: a #GAsyncResult.
21824  * @type: a location to store the type of the loaded icon, %NULL to ignore.
21825  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21826  *
21827  * Finishes an asynchronous icon load started in g_loadable_icon_load_async().
21828  *
21829  * Returns: (transfer full): a #GInputStream to read the icon from.
21830  */
21831
21832
21833 /**
21834  * g_local_vfs_new:
21835  *
21836  * Returns a new #GVfs handle for a local vfs.
21837  *
21838  * Returns: a new #GVfs handle.
21839  */
21840
21841
21842 /**
21843  * g_memory_input_stream_add_bytes:
21844  * @stream: a #GMemoryInputStream
21845  * @bytes: input data
21846  *
21847  * Appends @bytes to data that can be read from the input stream.
21848  *
21849  * Since: 2.34
21850  */
21851
21852
21853 /**
21854  * g_memory_input_stream_add_data:
21855  * @stream: a #GMemoryInputStream
21856  * @data: (array length=len) (element-type guint8) (transfer full): input data
21857  * @len: length of the data, may be -1 if @data is a nul-terminated string
21858  * @destroy: (allow-none): function that is called to free @data, or %NULL
21859  *
21860  * Appends @data to data that can be read from the input stream
21861  */
21862
21863
21864 /**
21865  * g_memory_input_stream_new:
21866  *
21867  * Creates a new empty #GMemoryInputStream.
21868  *
21869  * Returns: a new #GInputStream
21870  */
21871
21872
21873 /**
21874  * g_memory_input_stream_new_from_bytes:
21875  * @bytes: a #GBytes
21876  *
21877  * Creates a new #GMemoryInputStream with data from the given @bytes.
21878  *
21879  * Returns: new #GInputStream read from @bytes
21880  * Since: 2.34
21881  */
21882
21883
21884 /**
21885  * g_memory_input_stream_new_from_data:
21886  * @data: (array length=len) (element-type guint8) (transfer full): input data
21887  * @len: length of the data, may be -1 if @data is a nul-terminated string
21888  * @destroy: (allow-none): function that is called to free @data, or %NULL
21889  *
21890  * Creates a new #GMemoryInputStream with data in memory of a given size.
21891  *
21892  * Returns: new #GInputStream read from @data of @len bytes.
21893  */
21894
21895
21896 /**
21897  * g_memory_output_stream_get_data:
21898  * @ostream: a #GMemoryOutputStream
21899  *
21900  * Gets any loaded data from the @ostream.
21901  *
21902  * Note that the returned pointer may become invalid on the next
21903  * write or truncate operation on the stream.
21904  *
21905  * Returns: (transfer none): pointer to the stream's data
21906  */
21907
21908
21909 /**
21910  * g_memory_output_stream_get_data_size:
21911  * @ostream: a #GMemoryOutputStream
21912  *
21913  * Returns the number of bytes from the start up
21914  * to including the last byte written in the stream
21915  * that has not been truncated away.
21916  *
21917  * Returns: the number of bytes written to the stream
21918  * Since: 2.18
21919  */
21920
21921
21922 /**
21923  * g_memory_output_stream_get_size:
21924  * @ostream: a #GMemoryOutputStream
21925  *
21926  * Gets the size of the currently allocated data area (available from
21927  * g_memory_output_stream_get_data()). If the stream isn't
21928  * growable (no realloc was passed to g_memory_output_stream_new()) then
21929  * this is the maximum size of the stream and further writes
21930  * will return %G_IO_ERROR_NO_SPACE.
21931  *
21932  * Note that for growable streams the returned size may become invalid on
21933  * the next write or truncate operation on the stream.
21934  *
21935  * If you want the number of bytes currently written to the stream, use
21936  * g_memory_output_stream_get_data_size().
21937  *
21938  * Returns: the number of bytes allocated for the data buffer
21939  */
21940
21941
21942 /**
21943  * g_memory_output_stream_new: (skip)
21944  * @data: (allow-none): pointer to a chunk of memory to use, or %NULL
21945  * @size: the size of @data
21946  * @realloc_function: (allow-none): a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
21947  * @destroy_function: (allow-none): a function to be called on @data when the stream is finalized, or %NULL
21948  *
21949  * Creates a new #GMemoryOutputStream.
21950  *
21951  * If @data is non-%NULL, the stream  will use that for its internal storage.
21952  * If @realloc_fn is non-%NULL, it will be used for resizing the internal
21953  * storage when necessary. To construct a fixed-size output stream,
21954  * pass %NULL as @realloc_fn.
21955  *
21956  * |[
21957  * /&ast; a stream that can grow &ast;/
21958  * stream = g_memory_output_stream_new (NULL, 0, realloc, free);
21959  *
21960  * /&ast; another stream that can grow &ast;/
21961  * stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
21962  *
21963  * /&ast; a fixed-size stream &ast;/
21964  * data = malloc (200);
21965  * stream3 = g_memory_output_stream_new (data, 200, NULL, free);
21966  * ]|
21967  *
21968  * Returns: A newly created #GMemoryOutputStream object.
21969  */
21970
21971
21972 /**
21973  * g_memory_output_stream_new_resizable:
21974  *
21975  * Creates a new #GMemoryOutputStream, using g_realloc() and g_free()
21976  * for memory allocation.
21977  *
21978  * Since: 2.36
21979  */
21980
21981
21982 /**
21983  * g_memory_output_stream_steal_as_bytes:
21984  * @ostream: a #GMemoryOutputStream
21985  *
21986  * Returns data from the @ostream as a #GBytes. @ostream must be
21987  * closed before calling this function.
21988  *
21989  * Returns: (transfer full): the stream's data
21990  * Since: 2.34
21991  */
21992
21993
21994 /**
21995  * g_memory_output_stream_steal_data:
21996  * @ostream: a #GMemoryOutputStream
21997  *
21998  * Gets any loaded data from the @ostream. Ownership of the data
21999  * is transferred to the caller; when no longer needed it must be
22000  * freed using the free function set in @ostream's
22001  * #GMemoryOutputStream:destroy-function property.
22002  *
22003  * @ostream must be closed before calling this function.
22004  *
22005  * Returns: (transfer full): the stream's data
22006  * Since: 2.26
22007  */
22008
22009
22010 /**
22011  * g_memory_settings_backend_new:
22012  *
22013  * Creates a memory-backed #GSettingsBackend.
22014  *
22015  * This backend allows changes to settings, but does not write them
22016  * to any backing storage, so the next time you run your application,
22017  * the memory backend will start out with the default values again.
22018  *
22019  * Returns: (transfer full): a newly created #GSettingsBackend
22020  * Since: 2.28
22021  */
22022
22023
22024 /**
22025  * g_menu_append:
22026  * @menu: a #GMenu
22027  * @label: (allow-none): the section label, or %NULL
22028  * @detailed_action: (allow-none): the detailed action string, or %NULL
22029  *
22030  * Convenience function for appending a normal menu item to the end of
22031  * @menu.  Combine g_menu_item_new() and g_menu_insert_item() for a more
22032  * flexible alternative.
22033  *
22034  * Since: 2.32
22035  */
22036
22037
22038 /**
22039  * g_menu_append_item:
22040  * @menu: a #GMenu
22041  * @item: a #GMenuItem to append
22042  *
22043  * Appends @item to the end of @menu.
22044  *
22045  * See g_menu_insert_item() for more information.
22046  *
22047  * Since: 2.32
22048  */
22049
22050
22051 /**
22052  * g_menu_append_section:
22053  * @menu: a #GMenu
22054  * @label: (allow-none): the section label, or %NULL
22055  * @section: a #GMenuModel with the items of the section
22056  *
22057  * Convenience function for appending a section menu item to the end of
22058  * @menu.  Combine g_menu_item_new_section() and g_menu_insert_item() for a
22059  * more flexible alternative.
22060  *
22061  * Since: 2.32
22062  */
22063
22064
22065 /**
22066  * g_menu_append_submenu:
22067  * @menu: a #GMenu
22068  * @label: (allow-none): the section label, or %NULL
22069  * @submenu: a #GMenuModel with the items of the submenu
22070  *
22071  * Convenience function for appending a submenu menu item to the end of
22072  * @menu.  Combine g_menu_item_new_submenu() and g_menu_insert_item() for a
22073  * more flexible alternative.
22074  *
22075  * Since: 2.32
22076  */
22077
22078
22079 /**
22080  * g_menu_attribute_iter_get_name:
22081  * @iter: a #GMenuAttributeIter
22082  *
22083  * Gets the name of the attribute at the current iterator position, as
22084  * a string.
22085  *
22086  * The iterator is not advanced.
22087  *
22088  * Returns: the name of the attribute
22089  * Since: 2.32
22090  */
22091
22092
22093 /**
22094  * g_menu_attribute_iter_get_next:
22095  * @iter: a #GMenuAttributeIter
22096  * @out_name: (out) (allow-none) (transfer none): the type of the attribute
22097  * @value: (out) (allow-none) (transfer full): the attribute value
22098  *
22099  * This function combines g_menu_attribute_iter_next() with
22100  * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().
22101  *
22102  * First the iterator is advanced to the next (possibly first) attribute.
22103  * If that fails, then %FALSE is returned and there are no other
22104  * effects.
22105  *
22106  * If successful, @name and @value are set to the name and value of the
22107  * attribute that has just been advanced to.  At this point,
22108  * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will
22109  * return the same values again.
22110  *
22111  * The value returned in @name remains valid for as long as the iterator
22112  * remains at the current position.  The value returned in @value must
22113  * be unreffed using g_variant_unref() when it is no longer in use.
22114  *
22115  * Returns: %TRUE on success, or %FALSE if there is no additional attribute
22116  * Since: 2.32
22117  */
22118
22119
22120 /**
22121  * g_menu_attribute_iter_get_value:
22122  * @iter: a #GMenuAttributeIter
22123  *
22124  * Gets the value of the attribute at the current iterator position.
22125  *
22126  * The iterator is not advanced.
22127  *
22128  * Returns: (transfer full): the value of the current attribute
22129  * Since: 2.32
22130  */
22131
22132
22133 /**
22134  * g_menu_attribute_iter_next:
22135  * @iter: a #GMenuAttributeIter
22136  *
22137  * Attempts to advance the iterator to the next (possibly first)
22138  * attribute.
22139  *
22140  * %TRUE is returned on success, or %FALSE if there are no more
22141  * attributes.
22142  *
22143  * You must call this function when you first acquire the iterator
22144  * to advance it to the first attribute (and determine if the first
22145  * attribute exists at all).
22146  *
22147  * Returns: %TRUE on success, or %FALSE when there are no more attributes
22148  * Since: 2.32
22149  */
22150
22151
22152 /**
22153  * g_menu_freeze:
22154  * @menu: a #GMenu
22155  *
22156  * Marks @menu as frozen.
22157  *
22158  * After the menu is frozen, it is an error to attempt to make any
22159  * changes to it.  In effect this means that the #GMenu API must no
22160  * longer be used.
22161  *
22162  * This function causes g_menu_model_is_mutable() to begin returning
22163  * %FALSE, which has some positive performance implications.
22164  *
22165  * Since: 2.32
22166  */
22167
22168
22169 /**
22170  * g_menu_insert:
22171  * @menu: a #GMenu
22172  * @position: the position at which to insert the item
22173  * @label: (allow-none): the section label, or %NULL
22174  * @detailed_action: (allow-none): the detailed action string, or %NULL
22175  *
22176  * Convenience function for inserting a normal menu item into @menu.
22177  * Combine g_menu_item_new() and g_menu_insert_item() for a more flexible
22178  * alternative.
22179  *
22180  * Since: 2.32
22181  */
22182
22183
22184 /**
22185  * g_menu_insert_item:
22186  * @menu: a #GMenu
22187  * @position: the position at which to insert the item
22188  * @item: the #GMenuItem to insert
22189  *
22190  * Inserts @item into @menu.
22191  *
22192  * The "insertion" is actually done by copying all of the attribute and
22193  * link values of @item and using them to form a new item within @menu.
22194  * As such, @item itself is not really inserted, but rather, a menu item
22195  * that is exactly the same as the one presently described by @item.
22196  *
22197  * This means that @item is essentially useless after the insertion
22198  * occurs.  Any changes you make to it are ignored unless it is inserted
22199  * again (at which point its updated values will be copied).
22200  *
22201  * You should probably just free @item once you're done.
22202  *
22203  * There are many convenience functions to take care of common cases.
22204  * See g_menu_insert(), g_menu_insert_section() and
22205  * g_menu_insert_submenu() as well as "prepend" and "append" variants of
22206  * each of these functions.
22207  *
22208  * Since: 2.32
22209  */
22210
22211
22212 /**
22213  * g_menu_insert_section:
22214  * @menu: a #GMenu
22215  * @position: the position at which to insert the item
22216  * @label: (allow-none): the section label, or %NULL
22217  * @section: a #GMenuModel with the items of the section
22218  *
22219  * Convenience function for inserting a section menu item into @menu.
22220  * Combine g_menu_item_new_section() and g_menu_insert_item() for a more
22221  * flexible alternative.
22222  *
22223  * Since: 2.32
22224  */
22225
22226
22227 /**
22228  * g_menu_insert_submenu:
22229  * @menu: a #GMenu
22230  * @position: the position at which to insert the item
22231  * @label: (allow-none): the section label, or %NULL
22232  * @submenu: a #GMenuModel with the items of the submenu
22233  *
22234  * Convenience function for inserting a submenu menu item into @menu.
22235  * Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more
22236  * flexible alternative.
22237  *
22238  * Since: 2.32
22239  */
22240
22241
22242 /**
22243  * g_menu_item_get_attribute:
22244  * @menu_item: a #GMenuItem
22245  * @attribute: the attribute name to query
22246  * @format_string: a #GVariant format string
22247  * @...: positional parameters, as per @format_string
22248  *
22249  * Queries the named @attribute on @menu_item.
22250  *
22251  * If the attribute exists and matches the #GVariantType corresponding
22252  * to @format_string then @format_string is used to deconstruct the
22253  * value into the positional parameters and %TRUE is returned.
22254  *
22255  * If the attribute does not exist, or it does exist but has the wrong
22256  * type, then the positional parameters are ignored and %FALSE is
22257  * returned.
22258  *
22259  * Returns: %TRUE if the named attribute was found with the expected type
22260  * Since: 2.34
22261  */
22262
22263
22264 /**
22265  * g_menu_item_get_attribute_value:
22266  * @menu_item: a #GMenuItem
22267  * @attribute: the attribute name to query
22268  * @expected_type: (allow-none): the expected type of the attribute
22269  *
22270  * Queries the named @attribute on @menu_item.
22271  *
22272  * If @expected_type is specified and the attribute does not have this
22273  * type, %NULL is returned.  %NULL is also returned if the attribute
22274  * simply does not exist.
22275  *
22276  * Returns: (transfer full): the attribute value, or %NULL
22277  * Since: 2.34
22278  */
22279
22280
22281 /**
22282  * g_menu_item_get_link:
22283  * @menu_item: a #GMenuItem
22284  * @link: the link name to query
22285  *
22286  * Queries the named @link on @menu_item.
22287  *
22288  * Returns: (transfer full): the link, or %NULL
22289  * Since: 2.34
22290  */
22291
22292
22293 /**
22294  * g_menu_item_new:
22295  * @label: (allow-none): the section label, or %NULL
22296  * @detailed_action: (allow-none): the detailed action string, or %NULL
22297  *
22298  * Creates a new #GMenuItem.
22299  *
22300  * If @label is non-%NULL it is used to set the "label" attribute of the
22301  * new item.
22302  *
22303  * If @detailed_action is non-%NULL it is used to set the "action" and
22304  * possibly the "target" attribute of the new item.  See
22305  * g_menu_item_set_detailed_action() for more information.
22306  *
22307  * Returns: a new #GMenuItem
22308  * Since: 2.32
22309  */
22310
22311
22312 /**
22313  * g_menu_item_new_from_model:
22314  * @model: a #GMenuModel
22315  * @item_index: the index of an item in @model
22316  *
22317  * Creates a #GMenuItem as an exact copy of an existing menu item in a
22318  * #GMenuModel.
22319  *
22320  * @item_index must be valid (ie: be sure to call
22321  * g_menu_model_get_n_items() first).
22322  *
22323  * Returns: a new #GMenuItem.
22324  * Since: 2.34
22325  */
22326
22327
22328 /**
22329  * g_menu_item_new_section:
22330  * @label: (allow-none): the section label, or %NULL
22331  * @section: a #GMenuModel with the items of the section
22332  *
22333  * Creates a new #GMenuItem representing a section.
22334  *
22335  * This is a convenience API around g_menu_item_new() and
22336  * g_menu_item_set_section().
22337  *
22338  * The effect of having one menu appear as a section of another is
22339  * exactly as it sounds: the items from @section become a direct part of
22340  * the menu that @menu_item is added to.
22341  *
22342  * Visual separation is typically displayed between two non-empty
22343  * sections.  If @label is non-%NULL then it will be encorporated into
22344  * this visual indication.  This allows for labeled subsections of a
22345  * menu.
22346  *
22347  * As a simple example, consider a typical "Edit" menu from a simple
22348  * program.  It probably contains an "Undo" and "Redo" item, followed by
22349  * a separator, followed by "Cut", "Copy" and "Paste".
22350  *
22351  * This would be accomplished by creating three #GMenu instances.  The
22352  * first would be populated with the "Undo" and "Redo" items, and the
22353  * second with the "Cut", "Copy" and "Paste" items.  The first and
22354  * second menus would then be added as submenus of the third.  In XML
22355  * format, this would look something like the following:
22356  *
22357  * <informalexample><programlisting><![CDATA[
22358  * <menu id='edit-menu'>
22359  *   <section>
22360  *     <item label='Undo'/>
22361  *     <item label='Redo'/>
22362  *   </section>
22363  *   <section>
22364  *     <item label='Cut'/>
22365  *     <item label='Copy'/>
22366  *     <item label='Paste'/>
22367  *   </section>
22368  * </menu>
22369  * ]]></programlisting></informalexample>
22370  *
22371  * The following example is exactly equivalent.  It is more illustrative
22372  * of the exact relationship between the menus and items (keeping in
22373  * mind that the 'link' element defines a new menu that is linked to the
22374  * containing one).  The style of the second example is more verbose and
22375  * difficult to read (and therefore not recommended except for the
22376  * purpose of understanding what is really going on).
22377  *
22378  * <informalexample><programlisting><![CDATA[
22379  * <menu id='edit-menu'>
22380  *   <item>
22381  *     <link name='section'>
22382  *       <item label='Undo'/>
22383  *       <item label='Redo'/>
22384  *     </link>
22385  *   </item>
22386  *   <item>
22387  *     <link name='section'>
22388  *       <item label='Cut'/>
22389  *       <item label='Copy'/>
22390  *       <item label='Paste'/>
22391  *     </link>
22392  *   </item>
22393  * </menu>
22394  * ]]></programlisting></informalexample>
22395  *
22396  * Returns: a new #GMenuItem
22397  * Since: 2.32
22398  */
22399
22400
22401 /**
22402  * g_menu_item_new_submenu:
22403  * @label: (allow-none): the section label, or %NULL
22404  * @submenu: a #GMenuModel with the items of the submenu
22405  *
22406  * Creates a new #GMenuItem representing a submenu.
22407  *
22408  * This is a convenience API around g_menu_item_new() and
22409  * g_menu_item_set_submenu().
22410  *
22411  * Returns: a new #GMenuItem
22412  * Since: 2.32
22413  */
22414
22415
22416 /**
22417  * g_menu_item_set_action_and_target:
22418  * @menu_item: a #GMenuItem
22419  * @action: (allow-none): the name of the action for this item
22420  * @format_string: (allow-none): a GVariant format string
22421  * @...: positional parameters, as per @format_string
22422  *
22423  * Sets or unsets the "action" and "target" attributes of @menu_item.
22424  *
22425  * If @action is %NULL then both the "action" and "target" attributes
22426  * are unset (and @format_string is ignored along with the positional
22427  * parameters).
22428  *
22429  * If @action is non-%NULL then the "action" attribute is set.
22430  * @format_string is then inspected.  If it is non-%NULL then the proper
22431  * position parameters are collected to create a #GVariant instance to
22432  * use as the target value.  If it is %NULL then the positional
22433  * parameters are ignored and the "target" attribute is unset.
22434  *
22435  * See also g_menu_item_set_action_and_target_value() for an equivalent
22436  * call that directly accepts a #GVariant.  See
22437  * g_menu_item_set_detailed_action() for a more convenient version that
22438  * works with string-typed targets.
22439  *
22440  * See also g_menu_item_set_action_and_target_value() for a
22441  * description of the semantics of the action and target attributes.
22442  *
22443  * Since: 2.32
22444  */
22445
22446
22447 /**
22448  * g_menu_item_set_action_and_target_value:
22449  * @menu_item: a #GMenuItem
22450  * @action: (allow-none): the name of the action for this item
22451  * @target_value: (allow-none): a #GVariant to use as the action target
22452  *
22453  * Sets or unsets the "action" and "target" attributes of @menu_item.
22454  *
22455  * If @action is %NULL then both the "action" and "target" attributes
22456  * are unset (and @target_value is ignored).
22457  *
22458  * If @action is non-%NULL then the "action" attribute is set.  The
22459  * "target" attribute is then set to the value of @target_value if it is
22460  * non-%NULL or unset otherwise.
22461  *
22462  * Normal menu items (ie: not submenu, section or other custom item
22463  * types) are expected to have the "action" attribute set to identify
22464  * the action that they are associated with.  The state type of the
22465  * action help to determine the disposition of the menu item.  See
22466  * #GAction and #GActionGroup for an overview of actions.
22467  *
22468  * In general, clicking on the menu item will result in activation of
22469  * the named action with the "target" attribute given as the parameter
22470  * to the action invocation.  If the "target" attribute is not set then
22471  * the action is invoked with no parameter.
22472  *
22473  * If the action has no state then the menu item is usually drawn as a
22474  * plain menu item (ie: with no additional decoration).
22475  *
22476  * If the action has a boolean state then the menu item is usually drawn
22477  * as a toggle menu item (ie: with a checkmark or equivalent
22478  * indication).  The item should be marked as 'toggled' or 'checked'
22479  * when the boolean state is %TRUE.
22480  *
22481  * If the action has a string state then the menu item is usually drawn
22482  * as a radio menu item (ie: with a radio bullet or equivalent
22483  * indication).  The item should be marked as 'selected' when the string
22484  * state is equal to the value of the @target property.
22485  *
22486  * See g_menu_item_set_action_and_target() or
22487  * g_menu_item_set_detailed_action() for two equivalent calls that are
22488  * probably more convenient for most uses.
22489  *
22490  * Since: 2.32
22491  */
22492
22493
22494 /**
22495  * g_menu_item_set_attribute:
22496  * @menu_item: a #GMenuItem
22497  * @attribute: the attribute to set
22498  * @format_string: (allow-none): a #GVariant format string, or %NULL
22499  * @...: positional parameters, as per @format_string
22500  *
22501  * Sets or unsets an attribute on @menu_item.
22502  *
22503  * The attribute to set or unset is specified by @attribute. This
22504  * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
22505  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
22506  * attribute name.
22507  * Attribute names are restricted to lowercase characters, numbers
22508  * and '-'. Furthermore, the names must begin with a lowercase character,
22509  * must not end with a '-', and must not contain consecutive dashes.
22510  *
22511  * If @format_string is non-%NULL then the proper position parameters
22512  * are collected to create a #GVariant instance to use as the attribute
22513  * value.  If it is %NULL then the positional parameterrs are ignored
22514  * and the named attribute is unset.
22515  *
22516  * See also g_menu_item_set_attribute_value() for an equivalent call
22517  * that directly accepts a #GVariant.
22518  *
22519  * Since: 2.32
22520  */
22521
22522
22523 /**
22524  * g_menu_item_set_attribute_value:
22525  * @menu_item: a #GMenuItem
22526  * @attribute: the attribute to set
22527  * @value: (allow-none): a #GVariant to use as the value, or %NULL
22528  *
22529  * Sets or unsets an attribute on @menu_item.
22530  *
22531  * The attribute to set or unset is specified by @attribute. This
22532  * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
22533  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
22534  * attribute name.
22535  * Attribute names are restricted to lowercase characters, numbers
22536  * and '-'. Furthermore, the names must begin with a lowercase character,
22537  * must not end with a '-', and must not contain consecutive dashes.
22538  *
22539  * must consist only of lowercase
22540  * ASCII characters, digits and '-'.
22541  *
22542  * If @value is non-%NULL then it is used as the new value for the
22543  * attribute.  If @value is %NULL then the attribute is unset. If
22544  * the @value #GVariant is floating, it is consumed.
22545  *
22546  * See also g_menu_item_set_attribute() for a more convenient way to do
22547  * the same.
22548  *
22549  * Since: 2.32
22550  */
22551
22552
22553 /**
22554  * g_menu_item_set_detailed_action:
22555  * @menu_item: a #GMenuItem
22556  * @detailed_action: the "detailed" action string
22557  *
22558  * Sets the "action" and possibly the "target" attribute of @menu_item.
22559  *
22560  * If @detailed_action contains a double colon ("::") then it is used as
22561  * a separator between an action name and a target string.  In this
22562  * case, this call is equivalent to calling
22563  * g_menu_item_set_action_and_target() with the part before the "::" and
22564  * with a string-type #GVariant containing the part following the "::".
22565  *
22566  * If @detailed_action doesn't contain "::" then the action is set to
22567  * the given string (verbatim) and the target value is unset.
22568  *
22569  * See g_menu_item_set_action_and_target() or
22570  * g_menu_item_set_action_and_target_value() for more flexible (but
22571  * slightly less convenient) alternatives.
22572  *
22573  * See also g_menu_item_set_action_and_target_value() for a description of
22574  * the semantics of the action and target attributes.
22575  *
22576  * Since: 2.32
22577  */
22578
22579
22580 /**
22581  * g_menu_item_set_label:
22582  * @menu_item: a #GMenuItem
22583  * @label: (allow-none): the label to set, or %NULL to unset
22584  *
22585  * Sets or unsets the "label" attribute of @menu_item.
22586  *
22587  * If @label is non-%NULL it is used as the label for the menu item.  If
22588  * it is %NULL then the label attribute is unset.
22589  *
22590  * Since: 2.32
22591  */
22592
22593
22594 /**
22595  * g_menu_item_set_link:
22596  * @menu_item: a #GMenuItem
22597  * @link: type of link to establish or unset
22598  * @model: (allow-none): the #GMenuModel to link to (or %NULL to unset)
22599  *
22600  * Creates a link from @menu_item to @model if non-%NULL, or unsets it.
22601  *
22602  * Links are used to establish a relationship between a particular menu
22603  * item and another menu.  For example, %G_MENU_LINK_SUBMENU is used to
22604  * associate a submenu with a particular menu item, and %G_MENU_LINK_SECTION
22605  * is used to create a section. Other types of link can be used, but there
22606  * is no guarantee that clients will be able to make sense of them.
22607  * Link types are restricted to lowercase characters, numbers
22608  * and '-'. Furthermore, the names must begin with a lowercase character,
22609  * must not end with a '-', and must not contain consecutive dashes.
22610  *
22611  * Since: 2.32
22612  */
22613
22614
22615 /**
22616  * g_menu_item_set_section:
22617  * @menu_item: a #GMenuItem
22618  * @section: (allow-none): a #GMenuModel, or %NULL
22619  *
22620  * Sets or unsets the "section" link of @menu_item to @section.
22621  *
22622  * The effect of having one menu appear as a section of another is
22623  * exactly as it sounds: the items from @section become a direct part of
22624  * the menu that @menu_item is added to.  See g_menu_item_new_section()
22625  * for more information about what it means for a menu item to be a
22626  * section.
22627  *
22628  * Since: 2.32
22629  */
22630
22631
22632 /**
22633  * g_menu_item_set_submenu:
22634  * @menu_item: a #GMenuItem
22635  * @submenu: (allow-none): a #GMenuModel, or %NULL
22636  *
22637  * Sets or unsets the "submenu" link of @menu_item to @submenu.
22638  *
22639  * If @submenu is non-%NULL, it is linked to.  If it is %NULL then the
22640  * link is unset.
22641  *
22642  * The effect of having one menu appear as a submenu of another is
22643  * exactly as it sounds.
22644  *
22645  * Since: 2.32
22646  */
22647
22648
22649 /**
22650  * g_menu_link_iter_get_name:
22651  * @iter: a #GMenuLinkIter
22652  *
22653  * Gets the name of the link at the current iterator position.
22654  *
22655  * The iterator is not advanced.
22656  *
22657  * Returns: the type of the link
22658  * Since: 2.32
22659  */
22660
22661
22662 /**
22663  * g_menu_link_iter_get_next:
22664  * @iter: a #GMenuLinkIter
22665  * @out_link: (out) (allow-none) (transfer none): the name of the link
22666  * @value: (out) (allow-none) (transfer full): the linked #GMenuModel
22667  *
22668  * This function combines g_menu_link_iter_next() with
22669  * g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
22670  *
22671  * First the iterator is advanced to the next (possibly first) link.
22672  * If that fails, then %FALSE is returned and there are no other effects.
22673  *
22674  * If successful, @out_link and @value are set to the name and #GMenuModel
22675  * of the link that has just been advanced to.  At this point,
22676  * g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the
22677  * same values again.
22678  *
22679  * The value returned in @out_link remains valid for as long as the iterator
22680  * remains at the current position.  The value returned in @value must
22681  * be unreffed using g_object_unref() when it is no longer in use.
22682  *
22683  * Returns: %TRUE on success, or %FALSE if there is no additional link
22684  * Since: 2.32
22685  */
22686
22687
22688 /**
22689  * g_menu_link_iter_get_value:
22690  * @iter: a #GMenuLinkIter
22691  *
22692  * Gets the linked #GMenuModel at the current iterator position.
22693  *
22694  * The iterator is not advanced.
22695  *
22696  * Returns: (transfer full): the #GMenuModel that is linked to
22697  * Since: 2.32
22698  */
22699
22700
22701 /**
22702  * g_menu_link_iter_next:
22703  * @iter: a #GMenuLinkIter
22704  *
22705  * Attempts to advance the iterator to the next (possibly first)
22706  * link.
22707  *
22708  * %TRUE is returned on success, or %FALSE if there are no more links.
22709  *
22710  * You must call this function when you first acquire the iterator to
22711  * advance it to the first link (and determine if the first link exists
22712  * at all).
22713  *
22714  * Returns: %TRUE on success, or %FALSE when there are no more links
22715  * Since: 2.32
22716  */
22717
22718
22719 /**
22720  * g_menu_model_get_item_attribute:
22721  * @model: a #GMenuModel
22722  * @item_index: the index of the item
22723  * @attribute: the attribute to query
22724  * @format_string: a #GVariant format string
22725  * @...: positional parameters, as per @format_string
22726  *
22727  * Queries item at position @item_index in @model for the attribute
22728  * specified by @attribute.
22729  *
22730  * If the attribute exists and matches the #GVariantType corresponding
22731  * to @format_string then @format_string is used to deconstruct the
22732  * value into the positional parameters and %TRUE is returned.
22733  *
22734  * If the attribute does not exist, or it does exist but has the wrong
22735  * type, then the positional parameters are ignored and %FALSE is
22736  * returned.
22737  *
22738  * This function is a mix of g_menu_model_get_item_attribute_value() and
22739  * g_variant_get(), followed by a g_variant_unref().  As such,
22740  * @format_string must make a complete copy of the data (since the
22741  * #GVariant may go away after the call to g_variant_unref()).  In
22742  * particular, no '&amp;' characters are allowed in @format_string.
22743  *
22744  * Returns: %TRUE if the named attribute was found with the expected type
22745  * Since: 2.32
22746  */
22747
22748
22749 /**
22750  * g_menu_model_get_item_attribute_value:
22751  * @model: a #GMenuModel
22752  * @item_index: the index of the item
22753  * @attribute: the attribute to query
22754  * @expected_type: (allow-none): the expected type of the attribute, or %NULL
22755  *
22756  * Queries the item at position @item_index in @model for the attribute
22757  * specified by @attribute.
22758  *
22759  * If @expected_type is non-%NULL then it specifies the expected type of
22760  * the attribute.  If it is %NULL then any type will be accepted.
22761  *
22762  * If the attribute exists and matches @expected_type (or if the
22763  * expected type is unspecified) then the value is returned.
22764  *
22765  * If the attribute does not exist, or does not match the expected type
22766  * then %NULL is returned.
22767  *
22768  * Returns: (transfer full): the value of the attribute
22769  * Since: 2.32
22770  */
22771
22772
22773 /**
22774  * g_menu_model_get_item_link:
22775  * @model: a #GMenuModel
22776  * @item_index: the index of the item
22777  * @link: the link to query
22778  *
22779  * Queries the item at position @item_index in @model for the link
22780  * specified by @link.
22781  *
22782  * If the link exists, the linked #GMenuModel is returned.  If the link
22783  * does not exist, %NULL is returned.
22784  *
22785  * Returns: (transfer full): the linked #GMenuModel, or %NULL
22786  * Since: 2.32
22787  */
22788
22789
22790 /**
22791  * g_menu_model_get_n_items:
22792  * @model: a #GMenuModel
22793  *
22794  * Query the number of items in @model.
22795  *
22796  * Returns: the number of items
22797  * Since: 2.32
22798  */
22799
22800
22801 /**
22802  * g_menu_model_is_mutable:
22803  * @model: a #GMenuModel
22804  *
22805  * Queries if @model is mutable.
22806  *
22807  * An immutable #GMenuModel will never emit the #GMenuModel::items-changed
22808  * signal. Consumers of the model may make optimisations accordingly.
22809  *
22810  * Returns: %TRUE if the model is mutable (ie: "items-changed" may be emitted).
22811  * Since: 2.32
22812  */
22813
22814
22815 /**
22816  * g_menu_model_items_changed:
22817  * @model: a #GMenuModel
22818  * @position: the position of the change
22819  * @removed: the number of items removed
22820  * @added: the number of items added
22821  *
22822  * Requests emission of the #GMenuModel::items-changed signal on @model.
22823  *
22824  * This function should never be called except by #GMenuModel
22825  * subclasses.  Any other calls to this function will very likely lead
22826  * to a violation of the interface of the model.
22827  *
22828  * The implementation should update its internal representation of the
22829  * menu before emitting the signal.  The implementation should further
22830  * expect to receive queries about the new state of the menu (and
22831  * particularly added menu items) while signal handlers are running.
22832  *
22833  * The implementation must dispatch this call directly from a mainloop
22834  * entry and not in response to calls -- particularly those from the
22835  * #GMenuModel API.  Said another way: the menu must not change while
22836  * user code is running without returning to the mainloop.
22837  *
22838  * Since: 2.32
22839  */
22840
22841
22842 /**
22843  * g_menu_model_iterate_item_attributes:
22844  * @model: a #GMenuModel
22845  * @item_index: the index of the item
22846  *
22847  * Creates a #GMenuAttributeIter to iterate over the attributes of
22848  * the item at position @item_index in @model.
22849  *
22850  * You must free the iterator with g_object_unref() when you are done.
22851  *
22852  * Returns: (transfer full): a new #GMenuAttributeIter
22853  * Since: 2.32
22854  */
22855
22856
22857 /**
22858  * g_menu_model_iterate_item_links:
22859  * @model: a #GMenuModel
22860  * @item_index: the index of the item
22861  *
22862  * Creates a #GMenuLinkIter to iterate over the links of the item at
22863  * position @item_index in @model.
22864  *
22865  * You must free the iterator with g_object_unref() when you are done.
22866  *
22867  * Returns: (transfer full): a new #GMenuLinkIter
22868  * Since: 2.32
22869  */
22870
22871
22872 /**
22873  * g_menu_new:
22874  *
22875  * Creates a new #GMenu.
22876  *
22877  * The new menu has no items.
22878  *
22879  * Returns: a new #GMenu
22880  * Since: 2.32
22881  */
22882
22883
22884 /**
22885  * g_menu_prepend:
22886  * @menu: a #GMenu
22887  * @label: (allow-none): the section label, or %NULL
22888  * @detailed_action: (allow-none): the detailed action string, or %NULL
22889  *
22890  * Convenience function for prepending a normal menu item to the start
22891  * of @menu.  Combine g_menu_item_new() and g_menu_insert_item() for a more
22892  * flexible alternative.
22893  *
22894  * Since: 2.32
22895  */
22896
22897
22898 /**
22899  * g_menu_prepend_item:
22900  * @menu: a #GMenu
22901  * @item: a #GMenuItem to prepend
22902  *
22903  * Prepends @item to the start of @menu.
22904  *
22905  * See g_menu_insert_item() for more information.
22906  *
22907  * Since: 2.32
22908  */
22909
22910
22911 /**
22912  * g_menu_prepend_section:
22913  * @menu: a #GMenu
22914  * @label: (allow-none): the section label, or %NULL
22915  * @section: a #GMenuModel with the items of the section
22916  *
22917  * Convenience function for prepending a section menu item to the start
22918  * of @menu.  Combine g_menu_item_new_section() and g_menu_insert_item() for
22919  * a more flexible alternative.
22920  *
22921  * Since: 2.32
22922  */
22923
22924
22925 /**
22926  * g_menu_prepend_submenu:
22927  * @menu: a #GMenu
22928  * @label: (allow-none): the section label, or %NULL
22929  * @submenu: a #GMenuModel with the items of the submenu
22930  *
22931  * Convenience function for prepending a submenu menu item to the start
22932  * of @menu.  Combine g_menu_item_new_submenu() and g_menu_insert_item() for
22933  * a more flexible alternative.
22934  *
22935  * Since: 2.32
22936  */
22937
22938
22939 /**
22940  * g_menu_remove:
22941  * @menu: a #GMenu
22942  * @position: the position of the item to remove
22943  *
22944  * Removes an item from the menu.
22945  *
22946  * @position gives the index of the item to remove.
22947  *
22948  * It is an error if position is not in range the range from 0 to one
22949  * less than the number of items in the menu.
22950  *
22951  * It is not possible to remove items by identity since items are added
22952  * to the menu simply by copying their links and attributes (ie:
22953  * identity of the item itself is not preserved).
22954  *
22955  * Since: 2.32
22956  */
22957
22958
22959 /**
22960  * g_mount_can_eject:
22961  * @mount: a #GMount.
22962  *
22963  * Checks if @mount can be eject.
22964  *
22965  * Returns: %TRUE if the @mount can be ejected.
22966  */
22967
22968
22969 /**
22970  * g_mount_can_unmount:
22971  * @mount: a #GMount.
22972  *
22973  * Checks if @mount can be mounted.
22974  *
22975  * Returns: %TRUE if the @mount can be unmounted.
22976  */
22977
22978
22979 /**
22980  * g_mount_eject:
22981  * @mount: a #GMount.
22982  * @flags: flags affecting the unmount if required for eject
22983  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22984  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
22985  * @user_data: user data passed to @callback.
22986  *
22987  * Ejects a mount. This is an asynchronous operation, and is
22988  * finished by calling g_mount_eject_finish() with the @mount
22989  * and #GAsyncResult data returned in the @callback.
22990  *
22991  * Deprecated: 2.22: Use g_mount_eject_with_operation() instead.
22992  */
22993
22994
22995 /**
22996  * g_mount_eject_finish:
22997  * @mount: a #GMount.
22998  * @result: a #GAsyncResult.
22999  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23000  *
23001  * Finishes ejecting a mount. If any errors occurred during the operation,
23002  * @error will be set to contain the errors and %FALSE will be returned.
23003  *
23004  * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23005  * Deprecated: 2.22: Use g_mount_eject_with_operation_finish() instead.
23006  */
23007
23008
23009 /**
23010  * g_mount_eject_with_operation:
23011  * @mount: a #GMount.
23012  * @flags: flags affecting the unmount if required for eject
23013  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23014  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23015  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23016  * @user_data: user data passed to @callback.
23017  *
23018  * Ejects a mount. This is an asynchronous operation, and is
23019  * finished by calling g_mount_eject_with_operation_finish() with the @mount
23020  * and #GAsyncResult data returned in the @callback.
23021  *
23022  * Since: 2.22
23023  */
23024
23025
23026 /**
23027  * g_mount_eject_with_operation_finish:
23028  * @mount: a #GMount.
23029  * @result: a #GAsyncResult.
23030  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23031  *
23032  * Finishes ejecting a mount. If any errors occurred during the operation,
23033  * @error will be set to contain the errors and %FALSE will be returned.
23034  *
23035  * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
23036  * Since: 2.22
23037  */
23038
23039
23040 /**
23041  * g_mount_get_default_location:
23042  * @mount: a #GMount.
23043  *
23044  * Gets the default location of @mount. The default location of the given
23045  * @mount is a path that reflects the main entry point for the user (e.g.
23046  * the home directory, or the root of the volume).
23047  *
23048  * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23049  */
23050
23051
23052 /**
23053  * g_mount_get_drive:
23054  * @mount: a #GMount.
23055  *
23056  * Gets the drive for the @mount.
23057  *
23058  * This is a convenience method for getting the #GVolume and then
23059  * using that object to get the #GDrive.
23060  *
23061  * 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.
23062  */
23063
23064
23065 /**
23066  * g_mount_get_icon:
23067  * @mount: a #GMount.
23068  *
23069  * Gets the icon for @mount.
23070  *
23071  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23072  */
23073
23074
23075 /**
23076  * g_mount_get_name:
23077  * @mount: a #GMount.
23078  *
23079  * Gets the name of @mount.
23080  *
23081  * Returns: the name for the given @mount. The returned string should be freed with g_free() when no longer needed.
23082  */
23083
23084
23085 /**
23086  * g_mount_get_root:
23087  * @mount: a #GMount.
23088  *
23089  * Gets the root directory on @mount.
23090  *
23091  * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
23092  */
23093
23094
23095 /**
23096  * g_mount_get_sort_key:
23097  * @mount: A #GMount.
23098  *
23099  * Gets the sort key for @mount, if any.
23100  *
23101  * Returns: Sorting key for @mount or %NULL if no such key is available.
23102  * Since: 2.32
23103  */
23104
23105
23106 /**
23107  * g_mount_get_symbolic_icon:
23108  * @mount: a #GMount.
23109  *
23110  * Gets the symbolic icon for @mount.
23111  *
23112  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
23113  * Since: 2.34
23114  */
23115
23116
23117 /**
23118  * g_mount_get_uuid:
23119  * @mount: a #GMount.
23120  *
23121  * Gets the UUID for the @mount. The reference is typically based on
23122  * the file system UUID for the mount in question and should be
23123  * considered an opaque string. Returns %NULL if there is no UUID
23124  * available.
23125  *
23126  * 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.
23127  */
23128
23129
23130 /**
23131  * g_mount_get_volume:
23132  * @mount: a #GMount.
23133  *
23134  * Gets the volume for the @mount.
23135  *
23136  * 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.
23137  */
23138
23139
23140 /**
23141  * g_mount_guess_content_type:
23142  * @mount: a #GMount
23143  * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23144  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23145  * @callback: a #GAsyncReadyCallback
23146  * @user_data: user data passed to @callback
23147  *
23148  * Tries to guess the type of content stored on @mount. Returns one or
23149  * more textual identifiers of well-known content types (typically
23150  * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23151  * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23152  * specification for more on x-content types.
23153  *
23154  * This is an asynchronous operation (see
23155  * g_mount_guess_content_type_sync() for the synchronous version), and
23156  * is finished by calling g_mount_guess_content_type_finish() with the
23157  * @mount and #GAsyncResult data returned in the @callback.
23158  *
23159  * Since: 2.18
23160  */
23161
23162
23163 /**
23164  * g_mount_guess_content_type_finish:
23165  * @mount: a #GMount
23166  * @result: a #GAsyncResult
23167  * @error: a #GError location to store the error occurring, or %NULL to ignore
23168  *
23169  * Finishes guessing content types of @mount. If any errors occurred
23170  * during the operation, @error will be set to contain the errors and
23171  * %FALSE will be returned. In particular, you may get an
23172  * %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
23173  * guessing.
23174  *
23175  * 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.
23176  * Since: 2.18
23177  */
23178
23179
23180 /**
23181  * g_mount_guess_content_type_sync:
23182  * @mount: a #GMount
23183  * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
23184  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
23185  * @error: a #GError location to store the error occurring, or %NULL to ignore
23186  *
23187  * Tries to guess the type of content stored on @mount. Returns one or
23188  * more textual identifiers of well-known content types (typically
23189  * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
23190  * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23191  * specification for more on x-content types.
23192  *
23193  * This is an synchronous operation and as such may block doing IO;
23194  * see g_mount_guess_content_type() for the asynchronous version.
23195  *
23196  * 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.
23197  * Since: 2.18
23198  */
23199
23200
23201 /**
23202  * g_mount_is_shadowed:
23203  * @mount: A #GMount.
23204  *
23205  * Determines if @mount is shadowed. Applications or libraries should
23206  * avoid displaying @mount in the user interface if it is shadowed.
23207  *
23208  * A mount is said to be shadowed if there exists one or more user
23209  * visible objects (currently #GMount objects) with a root that is
23210  * inside the root of @mount.
23211  *
23212  * One application of shadow mounts is when exposing a single file
23213  * system that is used to address several logical volumes. In this
23214  * situation, a #GVolumeMonitor implementation would create two
23215  * #GVolume objects (for example, one for the camera functionality of
23216  * the device and one for a SD card reader on the device) with
23217  * activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
23218  * and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
23219  * underlying mount (with root
23220  * <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
23221  * #GVolumeMonitor implementation would create two #GMount objects
23222  * (each with their root matching the corresponding volume activation
23223  * root) that would shadow the original mount.
23224  *
23225  * The proxy monitor in GVfs 2.26 and later, automatically creates and
23226  * manage shadow mounts (and shadows the underlying mount) if the
23227  * activation root on a #GVolume is set.
23228  *
23229  * Returns: %TRUE if @mount is shadowed.
23230  * Since: 2.20
23231  */
23232
23233
23234 /**
23235  * g_mount_operation_get_anonymous:
23236  * @op: a #GMountOperation.
23237  *
23238  * Check to see whether the mount operation is being used
23239  * for an anonymous user.
23240  *
23241  * Returns: %TRUE if mount operation is anonymous.
23242  */
23243
23244
23245 /**
23246  * g_mount_operation_get_choice:
23247  * @op: a #GMountOperation.
23248  *
23249  * Gets a choice from the mount operation.
23250  *
23251  * Returns: an integer containing an index of the user's choice from the choice's list, or %0.
23252  */
23253
23254
23255 /**
23256  * g_mount_operation_get_domain:
23257  * @op: a #GMountOperation.
23258  *
23259  * Gets the domain of the mount operation.
23260  *
23261  * Returns: a string set to the domain.
23262  */
23263
23264
23265 /**
23266  * g_mount_operation_get_password:
23267  * @op: a #GMountOperation.
23268  *
23269  * Gets a password from the mount operation.
23270  *
23271  * Returns: a string containing the password within @op.
23272  */
23273
23274
23275 /**
23276  * g_mount_operation_get_password_save:
23277  * @op: a #GMountOperation.
23278  *
23279  * Gets the state of saving passwords for the mount operation.
23280  *
23281  * Returns: a #GPasswordSave flag.
23282  */
23283
23284
23285 /**
23286  * g_mount_operation_get_username:
23287  * @op: a #GMountOperation.
23288  *
23289  * Get the user name from the mount operation.
23290  *
23291  * Returns: a string containing the user name.
23292  */
23293
23294
23295 /**
23296  * g_mount_operation_new:
23297  *
23298  * Creates a new mount operation.
23299  *
23300  * Returns: a #GMountOperation.
23301  */
23302
23303
23304 /**
23305  * g_mount_operation_reply:
23306  * @op: a #GMountOperation
23307  * @result: a #GMountOperationResult
23308  *
23309  * Emits the #GMountOperation::reply signal.
23310  */
23311
23312
23313 /**
23314  * g_mount_operation_set_anonymous:
23315  * @op: a #GMountOperation.
23316  * @anonymous: boolean value.
23317  *
23318  * Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
23319  */
23320
23321
23322 /**
23323  * g_mount_operation_set_choice:
23324  * @op: a #GMountOperation.
23325  * @choice: an integer.
23326  *
23327  * Sets a default choice for the mount operation.
23328  */
23329
23330
23331 /**
23332  * g_mount_operation_set_domain:
23333  * @op: a #GMountOperation.
23334  * @domain: the domain to set.
23335  *
23336  * Sets the mount operation's domain.
23337  */
23338
23339
23340 /**
23341  * g_mount_operation_set_password:
23342  * @op: a #GMountOperation.
23343  * @password: password to set.
23344  *
23345  * Sets the mount operation's password to @password.
23346  */
23347
23348
23349 /**
23350  * g_mount_operation_set_password_save:
23351  * @op: a #GMountOperation.
23352  * @save: a set of #GPasswordSave flags.
23353  *
23354  * Sets the state of saving passwords for the mount operation.
23355  */
23356
23357
23358 /**
23359  * g_mount_operation_set_username:
23360  * @op: a #GMountOperation.
23361  * @username: input username.
23362  *
23363  * Sets the user name within @op to @username.
23364  */
23365
23366
23367 /**
23368  * g_mount_remount:
23369  * @mount: a #GMount.
23370  * @flags: flags affecting the operation
23371  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23372  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23373  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23374  * @user_data: user data passed to @callback.
23375  *
23376  * Remounts a mount. This is an asynchronous operation, and is
23377  * finished by calling g_mount_remount_finish() with the @mount
23378  * and #GAsyncResults data returned in the @callback.
23379  *
23380  * Remounting is useful when some setting affecting the operation
23381  * of the volume has been changed, as these may need a remount to
23382  * take affect. While this is semantically equivalent with unmounting
23383  * and then remounting not all backends might need to actually be
23384  * unmounted.
23385  */
23386
23387
23388 /**
23389  * g_mount_remount_finish:
23390  * @mount: a #GMount.
23391  * @result: a #GAsyncResult.
23392  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23393  *
23394  * Finishes remounting a mount. If any errors occurred during the operation,
23395  * @error will be set to contain the errors and %FALSE will be returned.
23396  *
23397  * Returns: %TRUE if the mount was successfully remounted. %FALSE otherwise.
23398  */
23399
23400
23401 /**
23402  * g_mount_shadow:
23403  * @mount: A #GMount.
23404  *
23405  * Increments the shadow count on @mount. Usually used by
23406  * #GVolumeMonitor implementations when creating a shadow mount for
23407  * @mount, see g_mount_is_shadowed() for more information. The caller
23408  * will need to emit the #GMount::changed signal on @mount manually.
23409  *
23410  * Since: 2.20
23411  */
23412
23413
23414 /**
23415  * g_mount_unmount:
23416  * @mount: a #GMount.
23417  * @flags: flags affecting the operation
23418  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23419  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23420  * @user_data: user data passed to @callback.
23421  *
23422  * Unmounts a mount. This is an asynchronous operation, and is
23423  * finished by calling g_mount_unmount_finish() with the @mount
23424  * and #GAsyncResult data returned in the @callback.
23425  *
23426  * Deprecated: 2.22: Use g_mount_unmount_with_operation() instead.
23427  */
23428
23429
23430 /**
23431  * g_mount_unmount_finish:
23432  * @mount: a #GMount.
23433  * @result: a #GAsyncResult.
23434  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23435  *
23436  * Finishes unmounting a mount. If any errors occurred during the operation,
23437  * @error will be set to contain the errors and %FALSE will be returned.
23438  *
23439  * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
23440  * Deprecated: 2.22: Use g_mount_unmount_with_operation_finish() instead.
23441  */
23442
23443
23444 /**
23445  * g_mount_unmount_with_operation:
23446  * @mount: a #GMount.
23447  * @flags: flags affecting the operation
23448  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
23449  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23450  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
23451  * @user_data: user data passed to @callback.
23452  *
23453  * Unmounts a mount. This is an asynchronous operation, and is
23454  * finished by calling g_mount_unmount_with_operation_finish() with the @mount
23455  * and #GAsyncResult data returned in the @callback.
23456  *
23457  * Since: 2.22
23458  */
23459
23460
23461 /**
23462  * g_mount_unmount_with_operation_finish:
23463  * @mount: a #GMount.
23464  * @result: a #GAsyncResult.
23465  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23466  *
23467  * Finishes unmounting a mount. If any errors occurred during the operation,
23468  * @error will be set to contain the errors and %FALSE will be returned.
23469  *
23470  * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
23471  * Since: 2.22
23472  */
23473
23474
23475 /**
23476  * g_mount_unshadow:
23477  * @mount: A #GMount.
23478  *
23479  * Decrements the shadow count on @mount. Usually used by
23480  * #GVolumeMonitor implementations when destroying a shadow mount for
23481  * @mount, see g_mount_is_shadowed() for more information. The caller
23482  * will need to emit the #GMount::changed signal on @mount manually.
23483  *
23484  * Since: 2.20
23485  */
23486
23487
23488 /**
23489  * g_network_address_get_hostname:
23490  * @addr: a #GNetworkAddress
23491  *
23492  * Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
23493  * depending on what @addr was created with.
23494  *
23495  * Returns: @addr's hostname
23496  * Since: 2.22
23497  */
23498
23499
23500 /**
23501  * g_network_address_get_port:
23502  * @addr: a #GNetworkAddress
23503  *
23504  * Gets @addr's port number
23505  *
23506  * Returns: @addr's port (which may be 0)
23507  * Since: 2.22
23508  */
23509
23510
23511 /**
23512  * g_network_address_get_scheme:
23513  * @addr: a #GNetworkAddress
23514  *
23515  * Gets @addr's scheme
23516  *
23517  * Returns: @addr's scheme (%NULL if not built from URI)
23518  * Since: 2.26
23519  */
23520
23521
23522 /**
23523  * g_network_address_new:
23524  * @hostname: the hostname
23525  * @port: the port
23526  *
23527  * Creates a new #GSocketConnectable for connecting to the given
23528  * @hostname and @port.
23529  *
23530  * Returns: (transfer full) (type GNetworkAddress): the new #GNetworkAddress
23531  * Since: 2.22
23532  */
23533
23534
23535 /**
23536  * g_network_address_parse:
23537  * @host_and_port: the hostname and optionally a port
23538  * @default_port: the default port if not in @host_and_port
23539  * @error: a pointer to a #GError, or %NULL
23540  *
23541  * Creates a new #GSocketConnectable for connecting to the given
23542  * @hostname and @port. May fail and return %NULL in case
23543  * parsing @host_and_port fails.
23544  *
23545  * @host_and_port may be in any of a number of recognised formats; an IPv6
23546  * address, an IPv4 address, or a domain name (in which case a DNS
23547  * lookup is performed). Quoting with [] is supported for all address
23548  * types. A port override may be specified in the usual way with a
23549  * colon.
23550  *
23551  * If no port is specified in @host_and_port then @default_port will be
23552  * used as the port number to connect to.
23553  *
23554  * In general, @host_and_port is expected to be provided by the user
23555  * (allowing them to give the hostname, and a port overide if necessary)
23556  * and @default_port is expected to be provided by the application.
23557  *
23558  * (The port component of @host_and_port can also be specified as a
23559  * service name rather than as a numeric port, but this functionality
23560  * is deprecated, because it depends on the contents of /etc/services,
23561  * which is generally quite sparse on platforms other than Linux.)
23562  *
23563  * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
23564  * Since: 2.22
23565  */
23566
23567
23568 /**
23569  * g_network_address_parse_uri:
23570  * @uri: the hostname and optionally a port
23571  * @default_port: The default port if none is found in the URI
23572  * @error: a pointer to a #GError, or %NULL
23573  *
23574  * Creates a new #GSocketConnectable for connecting to the given
23575  * @uri. May fail and return %NULL in case parsing @uri fails.
23576  *
23577  * Using this rather than g_network_address_new() or
23578  * g_network_address_parse() allows #GSocketClient to determine
23579  * when to use application-specific proxy protocols.
23580  *
23581  * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
23582  * Since: 2.26
23583  */
23584
23585
23586 /**
23587  * g_network_monitor_base_add_network:
23588  * @monitor: the #GNetworkMonitorBase
23589  * @network: a #GInetAddressMask
23590  *
23591  * Adds @network to @monitor's list of available networks.
23592  *
23593  * Since: 2.32
23594  */
23595
23596
23597 /**
23598  * g_network_monitor_base_remove_network:
23599  * @monitor: the #GNetworkMonitorBase
23600  * @network: a #GInetAddressMask
23601  *
23602  * Removes @network from @monitor's list of available networks.
23603  *
23604  * Since: 2.32
23605  */
23606
23607
23608 /**
23609  * g_network_monitor_base_set_networks:
23610  * @monitor: the #GNetworkMonitorBase
23611  * @networks: (array length=length): an array of #GInetAddressMask
23612  * @length: length of @networks
23613  *
23614  * Drops @monitor's current list of available networks and replaces
23615  * it with @networks.
23616  */
23617
23618
23619 /**
23620  * g_network_monitor_can_reach:
23621  * @monitor: a #GNetworkMonitor
23622  * @connectable: a #GSocketConnectable
23623  * @cancellable: (allow-none): a #GCancellable, or %NULL
23624  * @error: return location for a #GError, or %NULL
23625  *
23626  * Attempts to determine whether or not the host pointed to by
23627  * @connectable can be reached, without actually trying to connect to
23628  * it.
23629  *
23630  * This may return %TRUE even when #GNetworkMonitor:network-available
23631  * is %FALSE, if, for example, @monitor can determine that
23632  * @connectable refers to a host on a local network.
23633  *
23634  * If @monitor believes that an attempt to connect to @connectable
23635  * will succeed, it will return %TRUE. Otherwise, it will return
23636  * %FALSE and set @error to an appropriate error (such as
23637  * %G_IO_ERROR_HOST_UNREACHABLE).
23638  *
23639  * Note that although this does not attempt to connect to
23640  * @connectable, it may still block for a brief period of time (eg,
23641  * trying to do multicast DNS on the local network), so if you do not
23642  * want to block, you should use g_network_monitor_can_reach_async().
23643  *
23644  * Returns: %TRUE if @connectable is reachable, %FALSE if not.
23645  * Since: 2.32
23646  */
23647
23648
23649 /**
23650  * g_network_monitor_can_reach_async:
23651  * @monitor: a #GNetworkMonitor
23652  * @connectable: a #GSocketConnectable
23653  * @cancellable: (allow-none): a #GCancellable, or %NULL
23654  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
23655  * @user_data: (closure): the data to pass to callback function
23656  *
23657  * Asynchronously attempts to determine whether or not the host
23658  * pointed to by @connectable can be reached, without actually
23659  * trying to connect to it.
23660  *
23661  * For more details, see g_network_monitor_can_reach().
23662  *
23663  * When the operation is finished, @callback will be called.
23664  * You can then call g_network_monitor_can_reach_finish()
23665  * to get the result of the operation.
23666  */
23667
23668
23669 /**
23670  * g_network_monitor_can_reach_finish:
23671  * @monitor: a #GNetworkMonitor
23672  * @result: a #GAsyncResult
23673  * @error: return location for errors, or %NULL
23674  *
23675  * Finishes an async network connectivity test.
23676  * See g_network_monitor_can_reach_async().
23677  *
23678  * Returns: %TRUE if network is reachable, %FALSE if not.
23679  */
23680
23681
23682 /**
23683  * g_network_monitor_get_default:
23684  *
23685  * Gets the default #GNetworkMonitor for the system.
23686  *
23687  * Returns: (transfer none): a #GNetworkMonitor
23688  * Since: 2.32
23689  */
23690
23691
23692 /**
23693  * g_network_monitor_get_network_available:
23694  * @monitor: the #GNetworkMonitor
23695  *
23696  * Checks if the network is available. "Available" here means that the
23697  * system has a default route available for at least one of IPv4 or
23698  * IPv6. It does not necessarily imply that the public Internet is
23699  * reachable. See #GNetworkMonitor:network-available for more details.
23700  *
23701  * Returns: whether the network is available
23702  * Since: 2.32
23703  */
23704
23705
23706 /**
23707  * g_network_service_get_domain:
23708  * @srv: a #GNetworkService
23709  *
23710  * Gets the domain that @srv serves. This might be either UTF-8 or
23711  * ASCII-encoded, depending on what @srv was created with.
23712  *
23713  * Returns: @srv's domain name
23714  * Since: 2.22
23715  */
23716
23717
23718 /**
23719  * g_network_service_get_protocol:
23720  * @srv: a #GNetworkService
23721  *
23722  * Gets @srv's protocol name (eg, "tcp").
23723  *
23724  * Returns: @srv's protocol name
23725  * Since: 2.22
23726  */
23727
23728
23729 /**
23730  * g_network_service_get_scheme:
23731  * @srv: a #GNetworkService
23732  *
23733  * Get's the URI scheme used to resolve proxies. By default, the service name
23734  * is used as scheme.
23735  *
23736  * Returns: @srv's scheme name
23737  * Since: 2.26
23738  */
23739
23740
23741 /**
23742  * g_network_service_get_service:
23743  * @srv: a #GNetworkService
23744  *
23745  * Gets @srv's service name (eg, "ldap").
23746  *
23747  * Returns: @srv's service name
23748  * Since: 2.22
23749  */
23750
23751
23752 /**
23753  * g_network_service_new:
23754  * @service: the service type to look up (eg, "ldap")
23755  * @protocol: the networking protocol to use for @service (eg, "tcp")
23756  * @domain: the DNS domain to look up the service in
23757  *
23758  * Creates a new #GNetworkService representing the given @service,
23759  * @protocol, and @domain. This will initially be unresolved; use the
23760  * #GSocketConnectable interface to resolve it.
23761  *
23762  * Returns: (transfer full) (type GNetworkService): a new #GNetworkService
23763  * Since: 2.22
23764  */
23765
23766
23767 /**
23768  * g_network_service_set_scheme:
23769  * @srv: a #GNetworkService
23770  * @scheme: a URI scheme
23771  *
23772  * Set's the URI scheme used to resolve proxies. By default, the service name
23773  * is used as scheme.
23774  *
23775  * Since: 2.26
23776  */
23777
23778
23779 /**
23780  * g_networking_init:
23781  *
23782  * Initializes the platform networking libraries (eg, on Windows, this
23783  * calls WSAStartup()). GLib will call this itself if it is needed, so
23784  * you only need to call it if you directly call system networking
23785  * functions (without calling any GLib networking functions first).
23786  *
23787  * Since: 2.36
23788  */
23789
23790
23791 /**
23792  * g_null_settings_backend_new:
23793  *
23794  * Creates a readonly #GSettingsBackend.
23795  *
23796  * This backend does not allow changes to settings, so all settings
23797  * will always have their default values.
23798  *
23799  * Returns: (transfer full): a newly created #GSettingsBackend
23800  * Since: 2.28
23801  */
23802
23803
23804 /**
23805  * g_output_stream_clear_pending:
23806  * @stream: output stream
23807  *
23808  * Clears the pending flag on @stream.
23809  */
23810
23811
23812 /**
23813  * g_output_stream_close:
23814  * @stream: A #GOutputStream.
23815  * @cancellable: (allow-none): optional cancellable object
23816  * @error: location to store the error occurring, or %NULL to ignore
23817  *
23818  * Closes the stream, releasing resources related to it.
23819  *
23820  * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
23821  * Closing a stream multiple times will not return an error.
23822  *
23823  * Closing a stream will automatically flush any outstanding buffers in the
23824  * stream.
23825  *
23826  * Streams will be automatically closed when the last reference
23827  * is dropped, but you might want to call this function to make sure
23828  * resources are released as early as possible.
23829  *
23830  * Some streams might keep the backing store of the stream (e.g. a file descriptor)
23831  * open after the stream is closed. See the documentation for the individual
23832  * stream for details.
23833  *
23834  * On failure the first error that happened will be reported, but the close
23835  * operation will finish as much as possible. A stream that failed to
23836  * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
23837  * is important to check and report the error to the user, otherwise
23838  * there might be a loss of data as all data might not be written.
23839  *
23840  * If @cancellable is not %NULL, then the operation can be cancelled by
23841  * triggering the cancellable object from another thread. If the operation
23842  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
23843  * Cancelling a close will still leave the stream closed, but there some streams
23844  * can use a faster close that doesn't block to e.g. check errors. On
23845  * cancellation (as with any error) there is no guarantee that all written
23846  * data will reach the target.
23847  *
23848  * Returns: %TRUE on success, %FALSE on failure
23849  */
23850
23851
23852 /**
23853  * g_output_stream_close_async:
23854  * @stream: A #GOutputStream.
23855  * @io_priority: the io priority of the request.
23856  * @cancellable: (allow-none): optional cancellable object
23857  * @callback: (scope async): callback to call when the request is satisfied
23858  * @user_data: (closure): the data to pass to callback function
23859  *
23860  * Requests an asynchronous close of the stream, releasing resources
23861  * related to it. When the operation is finished @callback will be
23862  * called. You can then call g_output_stream_close_finish() to get
23863  * the result of the operation.
23864  *
23865  * For behaviour details see g_output_stream_close().
23866  *
23867  * The asyncronous methods have a default fallback that uses threads
23868  * to implement asynchronicity, so they are optional for inheriting
23869  * classes. However, if you override one you must override all.
23870  */
23871
23872
23873 /**
23874  * g_output_stream_close_finish:
23875  * @stream: a #GOutputStream.
23876  * @result: a #GAsyncResult.
23877  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23878  *
23879  * Closes an output stream.
23880  *
23881  * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
23882  */
23883
23884
23885 /**
23886  * g_output_stream_flush:
23887  * @stream: a #GOutputStream.
23888  * @cancellable: (allow-none): optional cancellable object
23889  * @error: location to store the error occurring, or %NULL to ignore
23890  *
23891  * Forces a write of all user-space buffered data for the given
23892  * @stream. Will block during the operation. Closing the stream will
23893  * implicitly cause a flush.
23894  *
23895  * This function is optional for inherited classes.
23896  *
23897  * If @cancellable is not %NULL, then the operation can be cancelled by
23898  * triggering the cancellable object from another thread. If the operation
23899  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
23900  *
23901  * Returns: %TRUE on success, %FALSE on error
23902  */
23903
23904
23905 /**
23906  * g_output_stream_flush_async:
23907  * @stream: a #GOutputStream.
23908  * @io_priority: the io priority of the request.
23909  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23910  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
23911  * @user_data: (closure): the data to pass to callback function
23912  *
23913  * Forces an asynchronous write of all user-space buffered data for
23914  * the given @stream.
23915  * For behaviour details see g_output_stream_flush().
23916  *
23917  * When the operation is finished @callback will be
23918  * called. You can then call g_output_stream_flush_finish() to get the
23919  * result of the operation.
23920  */
23921
23922
23923 /**
23924  * g_output_stream_flush_finish:
23925  * @stream: a #GOutputStream.
23926  * @result: a GAsyncResult.
23927  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23928  *
23929  * Finishes flushing an output stream.
23930  *
23931  * Returns: %TRUE if flush operation succeeded, %FALSE otherwise.
23932  */
23933
23934
23935 /**
23936  * g_output_stream_has_pending:
23937  * @stream: a #GOutputStream.
23938  *
23939  * Checks if an ouput stream has pending actions.
23940  *
23941  * Returns: %TRUE if @stream has pending actions.
23942  */
23943
23944
23945 /**
23946  * g_output_stream_is_closed:
23947  * @stream: a #GOutputStream.
23948  *
23949  * Checks if an output stream has already been closed.
23950  *
23951  * Returns: %TRUE if @stream is closed. %FALSE otherwise.
23952  */
23953
23954
23955 /**
23956  * g_output_stream_is_closing:
23957  * @stream: a #GOutputStream.
23958  *
23959  * Checks if an output stream is being closed. This can be
23960  * used inside e.g. a flush implementation to see if the
23961  * flush (or other i/o operation) is called from within
23962  * the closing operation.
23963  *
23964  * Returns: %TRUE if @stream is being closed. %FALSE otherwise.
23965  * Since: 2.24
23966  */
23967
23968
23969 /**
23970  * g_output_stream_set_pending:
23971  * @stream: a #GOutputStream.
23972  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23973  *
23974  * Sets @stream to have actions pending. If the pending flag is
23975  * already set or @stream is closed, it will return %FALSE and set
23976  * @error.
23977  *
23978  * Returns: %TRUE if pending was previously unset and is now set.
23979  */
23980
23981
23982 /**
23983  * g_output_stream_splice:
23984  * @stream: a #GOutputStream.
23985  * @source: a #GInputStream.
23986  * @flags: a set of #GOutputStreamSpliceFlags.
23987  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23988  * @error: a #GError location to store the error occurring, or %NULL to ignore.
23989  *
23990  * Splices an input stream into an output stream.
23991  *
23992  * 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.
23993  */
23994
23995
23996 /**
23997  * g_output_stream_splice_async:
23998  * @stream: a #GOutputStream.
23999  * @source: a #GInputStream.
24000  * @flags: a set of #GOutputStreamSpliceFlags.
24001  * @io_priority: the io priority of the request.
24002  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24003  * @callback: (scope async): a #GAsyncReadyCallback.
24004  * @user_data: (closure): user data passed to @callback.
24005  *
24006  * Splices a stream asynchronously.
24007  * When the operation is finished @callback will be called.
24008  * You can then call g_output_stream_splice_finish() to get the
24009  * result of the operation.
24010  *
24011  * For the synchronous, blocking version of this function, see
24012  * g_output_stream_splice().
24013  */
24014
24015
24016 /**
24017  * g_output_stream_splice_finish:
24018  * @stream: a #GOutputStream.
24019  * @result: a #GAsyncResult.
24020  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24021  *
24022  * Finishes an asynchronous stream splice operation.
24023  *
24024  * 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.
24025  */
24026
24027
24028 /**
24029  * g_output_stream_write:
24030  * @stream: a #GOutputStream.
24031  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24032  * @count: the number of bytes to write
24033  * @cancellable: (allow-none): optional cancellable object
24034  * @error: location to store the error occurring, or %NULL to ignore
24035  *
24036  * Tries to write @count bytes from @buffer into the stream. Will block
24037  * during the operation.
24038  *
24039  * If count is 0, returns 0 and does nothing. A value of @count
24040  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24041  *
24042  * On success, the number of bytes written to the stream is returned.
24043  * It is not an error if this is not the same as the requested size, as it
24044  * can happen e.g. on a partial I/O error, or if there is not enough
24045  * storage in the stream. All writes block until at least one byte
24046  * is written or an error occurs; 0 is never returned (unless
24047  * @count is 0).
24048  *
24049  * If @cancellable is not %NULL, then the operation can be cancelled by
24050  * triggering the cancellable object from another thread. If the operation
24051  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24052  * operation was partially finished when the operation was cancelled the
24053  * partial result will be returned, without an error.
24054  *
24055  * On error -1 is returned and @error is set accordingly.
24056  *
24057  * Virtual: write_fn
24058  * Returns: Number of bytes written, or -1 on error
24059  */
24060
24061
24062 /**
24063  * g_output_stream_write_all:
24064  * @stream: a #GOutputStream.
24065  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24066  * @count: the number of bytes to write
24067  * @bytes_written: (out): location to store the number of bytes that was written to the stream
24068  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24069  * @error: location to store the error occurring, or %NULL to ignore
24070  *
24071  * Tries to write @count bytes from @buffer into the stream. Will block
24072  * during the operation.
24073  *
24074  * This function is similar to g_output_stream_write(), except it tries to
24075  * write as many bytes as requested, only stopping on an error.
24076  *
24077  * On a successful write of @count bytes, %TRUE is returned, and @bytes_written
24078  * is set to @count.
24079  *
24080  * If there is an error during the operation %FALSE is returned and @error
24081  * is set to indicate the error status, @bytes_written is updated to contain
24082  * the number of bytes written into the stream before the error occurred.
24083  *
24084  * Returns: %TRUE on success, %FALSE if there was an error
24085  */
24086
24087
24088 /**
24089  * g_output_stream_write_async:
24090  * @stream: A #GOutputStream.
24091  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24092  * @count: the number of bytes to write
24093  * @io_priority: the io priority of the request.
24094  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24095  * @callback: (scope async): callback to call when the request is satisfied
24096  * @user_data: (closure): the data to pass to callback function
24097  *
24098  * Request an asynchronous write of @count bytes from @buffer into
24099  * the stream. When the operation is finished @callback will be called.
24100  * You can then call g_output_stream_write_finish() to get the result of the
24101  * operation.
24102  *
24103  * During an async request no other sync and async calls are allowed,
24104  * and will result in %G_IO_ERROR_PENDING errors.
24105  *
24106  * A value of @count larger than %G_MAXSSIZE will cause a
24107  * %G_IO_ERROR_INVALID_ARGUMENT error.
24108  *
24109  * On success, the number of bytes written will be passed to the
24110  * @callback. It is not an error if this is not the same as the
24111  * requested size, as it can happen e.g. on a partial I/O error,
24112  * but generally we try to write as many bytes as requested.
24113  *
24114  * You are guaranteed that this method will never fail with
24115  * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24116  * method will just wait until this changes.
24117  *
24118  * Any outstanding I/O request with higher priority (lower numerical
24119  * value) will be executed before an outstanding request with lower
24120  * priority. Default priority is %G_PRIORITY_DEFAULT.
24121  *
24122  * The asyncronous methods have a default fallback that uses threads
24123  * to implement asynchronicity, so they are optional for inheriting
24124  * classes. However, if you override one you must override all.
24125  *
24126  * For the synchronous, blocking version of this function, see
24127  * g_output_stream_write().
24128  */
24129
24130
24131 /**
24132  * g_output_stream_write_bytes:
24133  * @stream: a #GOutputStream.
24134  * @bytes: the #GBytes to write
24135  * @cancellable: (allow-none): optional cancellable object
24136  * @error: location to store the error occurring, or %NULL to ignore
24137  *
24138  * Tries to write the data from @bytes into the stream. Will block
24139  * during the operation.
24140  *
24141  * If @bytes is 0-length, returns 0 and does nothing. A #GBytes larger
24142  * than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
24143  *
24144  * On success, the number of bytes written to the stream is returned.
24145  * It is not an error if this is not the same as the requested size, as it
24146  * can happen e.g. on a partial I/O error, or if there is not enough
24147  * storage in the stream. All writes block until at least one byte
24148  * is written or an error occurs; 0 is never returned (unless
24149  * the size of @bytes is 0).
24150  *
24151  * If @cancellable is not %NULL, then the operation can be cancelled by
24152  * triggering the cancellable object from another thread. If the operation
24153  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24154  * operation was partially finished when the operation was cancelled the
24155  * partial result will be returned, without an error.
24156  *
24157  * On error -1 is returned and @error is set accordingly.
24158  *
24159  * Returns: Number of bytes written, or -1 on error
24160  */
24161
24162
24163 /**
24164  * g_output_stream_write_bytes_async:
24165  * @stream: A #GOutputStream.
24166  * @bytes: The bytes to write
24167  * @io_priority: the io priority of the request.
24168  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24169  * @callback: (scope async): callback to call when the request is satisfied
24170  * @user_data: (closure): the data to pass to callback function
24171  *
24172  * Request an asynchronous write of the data in @bytes to the stream.
24173  * When the operation is finished @callback will be called. You can
24174  * then call g_output_stream_write_bytes_finish() to get the result of
24175  * the operation.
24176  *
24177  * During an async request no other sync and async calls are allowed,
24178  * and will result in %G_IO_ERROR_PENDING errors.
24179  *
24180  * A #GBytes larger than %G_MAXSSIZE will cause a
24181  * %G_IO_ERROR_INVALID_ARGUMENT error.
24182  *
24183  * On success, the number of bytes written will be passed to the
24184  * @callback. It is not an error if this is not the same as the
24185  * requested size, as it can happen e.g. on a partial I/O error,
24186  * but generally we try to write as many bytes as requested.
24187  *
24188  * You are guaranteed that this method will never fail with
24189  * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
24190  * method will just wait until this changes.
24191  *
24192  * Any outstanding I/O request with higher priority (lower numerical
24193  * value) will be executed before an outstanding request with lower
24194  * priority. Default priority is %G_PRIORITY_DEFAULT.
24195  *
24196  * For the synchronous, blocking version of this function, see
24197  * g_output_stream_write_bytes().
24198  */
24199
24200
24201 /**
24202  * g_output_stream_write_bytes_finish:
24203  * @stream: a #GOutputStream.
24204  * @result: a #GAsyncResult.
24205  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24206  *
24207  * Finishes a stream write-from-#GBytes operation.
24208  *
24209  * Returns: a #gssize containing the number of bytes written to the stream.
24210  */
24211
24212
24213 /**
24214  * g_output_stream_write_finish:
24215  * @stream: a #GOutputStream.
24216  * @result: a #GAsyncResult.
24217  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24218  *
24219  * Finishes a stream write operation.
24220  *
24221  * Returns: a #gssize containing the number of bytes written to the stream.
24222  */
24223
24224
24225 /**
24226  * g_permission_acquire:
24227  * @permission: a #GPermission instance
24228  * @cancellable: (allow-none): a #GCancellable, or %NULL
24229  * @error: a pointer to a %NULL #GError, or %NULL
24230  *
24231  * Attempts to acquire the permission represented by @permission.
24232  *
24233  * The precise method by which this happens depends on the permission
24234  * and the underlying authentication mechanism.  A simple example is
24235  * that a dialog may appear asking the user to enter their password.
24236  *
24237  * You should check with g_permission_get_can_acquire() before calling
24238  * this function.
24239  *
24240  * If the permission is acquired then %TRUE is returned.  Otherwise,
24241  * %FALSE is returned and @error is set appropriately.
24242  *
24243  * This call is blocking, likely for a very long time (in the case that
24244  * user interaction is required).  See g_permission_acquire_async() for
24245  * the non-blocking version.
24246  *
24247  * Returns: %TRUE if the permission was successfully acquired
24248  * Since: 2.26
24249  */
24250
24251
24252 /**
24253  * g_permission_acquire_async:
24254  * @permission: a #GPermission instance
24255  * @cancellable: (allow-none): a #GCancellable, or %NULL
24256  * @callback: the #GAsyncReadyCallback to call when done
24257  * @user_data: the user data to pass to @callback
24258  *
24259  * Attempts to acquire the permission represented by @permission.
24260  *
24261  * This is the first half of the asynchronous version of
24262  * g_permission_acquire().
24263  *
24264  * Since: 2.26
24265  */
24266
24267
24268 /**
24269  * g_permission_acquire_finish:
24270  * @permission: a #GPermission instance
24271  * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24272  * @error: a pointer to a %NULL #GError, or %NULL
24273  *
24274  * Collects the result of attempting to acquire the permission
24275  * represented by @permission.
24276  *
24277  * This is the second half of the asynchronous version of
24278  * g_permission_acquire().
24279  *
24280  * Returns: %TRUE if the permission was successfully acquired
24281  * Since: 2.26
24282  */
24283
24284
24285 /**
24286  * g_permission_get_allowed:
24287  * @permission: a #GPermission instance
24288  *
24289  * Gets the value of the 'allowed' property.  This property is %TRUE if
24290  * the caller currently has permission to perform the action that
24291  * @permission represents the permission to perform.
24292  *
24293  * Returns: the value of the 'allowed' property
24294  * Since: 2.26
24295  */
24296
24297
24298 /**
24299  * g_permission_get_can_acquire:
24300  * @permission: a #GPermission instance
24301  *
24302  * Gets the value of the 'can-acquire' property.  This property is %TRUE
24303  * if it is generally possible to acquire the permission by calling
24304  * g_permission_acquire().
24305  *
24306  * Returns: the value of the 'can-acquire' property
24307  * Since: 2.26
24308  */
24309
24310
24311 /**
24312  * g_permission_get_can_release:
24313  * @permission: a #GPermission instance
24314  *
24315  * Gets the value of the 'can-release' property.  This property is %TRUE
24316  * if it is generally possible to release the permission by calling
24317  * g_permission_release().
24318  *
24319  * Returns: the value of the 'can-release' property
24320  * Since: 2.26
24321  */
24322
24323
24324 /**
24325  * g_permission_impl_update:
24326  * @permission: a #GPermission instance
24327  * @allowed: the new value for the 'allowed' property
24328  * @can_acquire: the new value for the 'can-acquire' property
24329  * @can_release: the new value for the 'can-release' property
24330  *
24331  * This function is called by the #GPermission implementation to update
24332  * the properties of the permission.  You should never call this
24333  * function except from a #GPermission implementation.
24334  *
24335  * GObject notify signals are generated, as appropriate.
24336  *
24337  * Since: 2.26
24338  */
24339
24340
24341 /**
24342  * g_permission_release:
24343  * @permission: a #GPermission instance
24344  * @cancellable: (allow-none): a #GCancellable, or %NULL
24345  * @error: a pointer to a %NULL #GError, or %NULL
24346  *
24347  * Attempts to release the permission represented by @permission.
24348  *
24349  * The precise method by which this happens depends on the permission
24350  * and the underlying authentication mechanism.  In most cases the
24351  * permission will be dropped immediately without further action.
24352  *
24353  * You should check with g_permission_get_can_release() before calling
24354  * this function.
24355  *
24356  * If the permission is released then %TRUE is returned.  Otherwise,
24357  * %FALSE is returned and @error is set appropriately.
24358  *
24359  * This call is blocking, likely for a very long time (in the case that
24360  * user interaction is required).  See g_permission_release_async() for
24361  * the non-blocking version.
24362  *
24363  * Returns: %TRUE if the permission was successfully released
24364  * Since: 2.26
24365  */
24366
24367
24368 /**
24369  * g_permission_release_async:
24370  * @permission: a #GPermission instance
24371  * @cancellable: (allow-none): a #GCancellable, or %NULL
24372  * @callback: the #GAsyncReadyCallback to call when done
24373  * @user_data: the user data to pass to @callback
24374  *
24375  * Attempts to release the permission represented by @permission.
24376  *
24377  * This is the first half of the asynchronous version of
24378  * g_permission_release().
24379  *
24380  * Since: 2.26
24381  */
24382
24383
24384 /**
24385  * g_permission_release_finish:
24386  * @permission: a #GPermission instance
24387  * @result: the #GAsyncResult given to the #GAsyncReadyCallback
24388  * @error: a pointer to a %NULL #GError, or %NULL
24389  *
24390  * Collects the result of attempting to release the permission
24391  * represented by @permission.
24392  *
24393  * This is the second half of the asynchronous version of
24394  * g_permission_release().
24395  *
24396  * Returns: %TRUE if the permission was successfully released
24397  * Since: 2.26
24398  */
24399
24400
24401 /**
24402  * g_poll_file_monitor_new:
24403  * @file: a #GFile.
24404  *
24405  * Polls @file for changes.
24406  *
24407  * Returns: a new #GFileMonitor for the given #GFile.
24408  */
24409
24410
24411 /**
24412  * g_pollable_input_stream_can_poll:
24413  * @stream: a #GPollableInputStream.
24414  *
24415  * Checks if @stream is actually pollable. Some classes may implement
24416  * #GPollableInputStream but have only certain instances of that class
24417  * be pollable. If this method returns %FALSE, then the behavior of
24418  * other #GPollableInputStream methods is undefined.
24419  *
24420  * For any given stream, the value returned by this method is constant;
24421  * a stream cannot switch from pollable to non-pollable or vice versa.
24422  *
24423  * Returns: %TRUE if @stream is pollable, %FALSE if not.
24424  * Since: 2.28
24425  */
24426
24427
24428 /**
24429  * g_pollable_input_stream_create_source:
24430  * @stream: a #GPollableInputStream.
24431  * @cancellable: (allow-none): a #GCancellable, or %NULL
24432  *
24433  * Creates a #GSource that triggers when @stream can be read, or
24434  * @cancellable is triggered or an error occurs. The callback on the
24435  * source is of the #GPollableSourceFunc type.
24436  *
24437  * As with g_pollable_input_stream_is_readable(), it is possible that
24438  * the stream may not actually be readable even after the source
24439  * triggers, so you should use g_pollable_input_stream_read_nonblocking()
24440  * rather than g_input_stream_read() from the callback.
24441  *
24442  * Returns: (transfer full): a new #GSource
24443  * Since: 2.28
24444  */
24445
24446
24447 /**
24448  * g_pollable_input_stream_is_readable:
24449  * @stream: a #GPollableInputStream.
24450  *
24451  * Checks if @stream can be read.
24452  *
24453  * Note that some stream types may not be able to implement this 100%
24454  * reliably, and it is possible that a call to g_input_stream_read()
24455  * after this returns %TRUE would still block. To guarantee
24456  * non-blocking behavior, you should always use
24457  * g_pollable_input_stream_read_nonblocking(), which will return a
24458  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
24459  *
24460  * 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.
24461  * Since: 2.28
24462  */
24463
24464
24465 /**
24466  * g_pollable_input_stream_read_nonblocking:
24467  * @stream: a #GPollableInputStream
24468  * @buffer: a buffer to read data into (which should be at least @count bytes long).
24469  * @count: the number of bytes you want to read
24470  * @cancellable: (allow-none): a #GCancellable, or %NULL
24471  * @error: #GError for error reporting, or %NULL to ignore.
24472  *
24473  * Attempts to read up to @count bytes from @stream into @buffer, as
24474  * with g_input_stream_read(). If @stream is not currently readable,
24475  * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
24476  * use g_pollable_input_stream_create_source() to create a #GSource
24477  * that will be triggered when @stream is readable.
24478  *
24479  * Note that since this method never blocks, you cannot actually
24480  * use @cancellable to cancel it. However, it will return an error
24481  * if @cancellable has already been cancelled when you call, which
24482  * may happen if you call this method after a source triggers due
24483  * to having been cancelled.
24484  *
24485  * Virtual: read_nonblocking
24486  * Returns: the number of bytes read, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
24487  */
24488
24489
24490 /**
24491  * g_pollable_output_stream_can_poll:
24492  * @stream: a #GPollableOutputStream.
24493  *
24494  * Checks if @stream is actually pollable. Some classes may implement
24495  * #GPollableOutputStream but have only certain instances of that
24496  * class be pollable. If this method returns %FALSE, then the behavior
24497  * of other #GPollableOutputStream methods is undefined.
24498  *
24499  * For any given stream, the value returned by this method is constant;
24500  * a stream cannot switch from pollable to non-pollable or vice versa.
24501  *
24502  * Returns: %TRUE if @stream is pollable, %FALSE if not.
24503  * Since: 2.28
24504  */
24505
24506
24507 /**
24508  * g_pollable_output_stream_create_source:
24509  * @stream: a #GPollableOutputStream.
24510  * @cancellable: (allow-none): a #GCancellable, or %NULL
24511  *
24512  * Creates a #GSource that triggers when @stream can be written, or
24513  * @cancellable is triggered or an error occurs. The callback on the
24514  * source is of the #GPollableSourceFunc type.
24515  *
24516  * As with g_pollable_output_stream_is_writable(), it is possible that
24517  * the stream may not actually be writable even after the source
24518  * triggers, so you should use g_pollable_output_stream_write_nonblocking()
24519  * rather than g_output_stream_write() from the callback.
24520  *
24521  * Returns: (transfer full): a new #GSource
24522  * Since: 2.28
24523  */
24524
24525
24526 /**
24527  * g_pollable_output_stream_is_writable:
24528  * @stream: a #GPollableOutputStream.
24529  *
24530  * Checks if @stream can be written.
24531  *
24532  * Note that some stream types may not be able to implement this 100%
24533  * reliably, and it is possible that a call to g_output_stream_write()
24534  * after this returns %TRUE would still block. To guarantee
24535  * non-blocking behavior, you should always use
24536  * g_pollable_output_stream_write_nonblocking(), which will return a
24537  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
24538  *
24539  * 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.
24540  * Since: 2.28
24541  */
24542
24543
24544 /**
24545  * g_pollable_output_stream_write_nonblocking:
24546  * @stream: a #GPollableOutputStream
24547  * @buffer: (array length=count) (element-type guint8): a buffer to write data from
24548  * @count: the number of bytes you want to write
24549  * @cancellable: (allow-none): a #GCancellable, or %NULL
24550  * @error: #GError for error reporting, or %NULL to ignore.
24551  *
24552  * Attempts to write up to @count bytes from @buffer to @stream, as
24553  * with g_output_stream_write(). If @stream is not currently writable,
24554  * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
24555  * use g_pollable_output_stream_create_source() to create a #GSource
24556  * that will be triggered when @stream is writable.
24557  *
24558  * Note that since this method never blocks, you cannot actually
24559  * use @cancellable to cancel it. However, it will return an error
24560  * if @cancellable has already been cancelled when you call, which
24561  * may happen if you call this method after a source triggers due
24562  * to having been cancelled.
24563  *
24564  * Virtual: write_nonblocking
24565  * Returns: the number of bytes written, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
24566  */
24567
24568
24569 /**
24570  * g_pollable_source_new:
24571  * @pollable_stream: the stream associated with the new source
24572  *
24573  * Utility method for #GPollableInputStream and #GPollableOutputStream
24574  * implementations. Creates a new #GSource that expects a callback of
24575  * type #GPollableSourceFunc. The new source does not actually do
24576  * anything on its own; use g_source_add_child_source() to add other
24577  * sources to it to cause it to trigger.
24578  *
24579  * Returns: (transfer full): the new #GSource.
24580  * Since: 2.28
24581  */
24582
24583
24584 /**
24585  * g_pollable_source_new_full:
24586  * @pollable_stream: (type GObject): the stream associated with the new source
24587  * @child_source: (allow-none): optional child source to attach
24588  * @cancellable: (allow-none): optional #GCancellable to attach
24589  *
24590  * Utility method for #GPollableInputStream and #GPollableOutputStream
24591  * implementations. Creates a new #GSource, as with
24592  * g_pollable_source_new(), but also attaching @child_source (with a
24593  * dummy callback), and @cancellable, if they are non-%NULL.
24594  *
24595  * Returns: (transfer full): the new #GSource.
24596  * Since: 2.34
24597  */
24598
24599
24600 /**
24601  * g_pollable_stream_read:
24602  * @stream: a #GInputStream
24603  * @buffer: a buffer to read data into
24604  * @count: the number of bytes to read
24605  * @blocking: whether to do blocking I/O
24606  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24607  * @error: location to store the error occurring, or %NULL to ignore
24608  *
24609  * Tries to read from @stream, as with g_input_stream_read() (if
24610  * @blocking is %TRUE) or g_pollable_input_stream_read_nonblocking()
24611  * (if @blocking is %FALSE). This can be used to more easily share
24612  * code between blocking and non-blocking implementations of a method.
24613  *
24614  * If @blocking is %FALSE, then @stream must be a
24615  * #GPollableInputStream for which g_pollable_input_stream_can_poll()
24616  * returns %TRUE, or else the behavior is undefined. If @blocking is
24617  * %TRUE, then @stream does not need to be a #GPollableInputStream.
24618  *
24619  * Returns: the number of bytes read, or -1 on error.
24620  * Since: 2.34
24621  */
24622
24623
24624 /**
24625  * g_pollable_stream_write:
24626  * @stream: a #GOutputStream.
24627  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24628  * @count: the number of bytes to write
24629  * @blocking: whether to do blocking I/O
24630  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24631  * @error: location to store the error occurring, or %NULL to ignore
24632  *
24633  * Tries to write to @stream, as with g_output_stream_write() (if
24634  * @blocking is %TRUE) or g_pollable_output_stream_write_nonblocking()
24635  * (if @blocking is %FALSE). This can be used to more easily share
24636  * code between blocking and non-blocking implementations of a method.
24637  *
24638  * If @blocking is %FALSE, then @stream must be a
24639  * #GPollableOutputStream for which
24640  * g_pollable_output_stream_can_poll() returns %TRUE or else the
24641  * behavior is undefined. If @blocking is %TRUE, then @stream does not
24642  * need to be a #GPollableOutputStream.
24643  *
24644  * Returns: the number of bytes written, or -1 on error.
24645  * Since: 2.34
24646  */
24647
24648
24649 /**
24650  * g_pollable_stream_write_all:
24651  * @stream: a #GOutputStream.
24652  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
24653  * @count: the number of bytes to write
24654  * @blocking: whether to do blocking I/O
24655  * @bytes_written: (out): location to store the number of bytes that was written to the stream
24656  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24657  * @error: location to store the error occurring, or %NULL to ignore
24658  *
24659  * Tries to write @count bytes to @stream, as with
24660  * g_output_stream_write_all(), but using g_pollable_stream_write()
24661  * rather than g_output_stream_write().
24662  *
24663  * On a successful write of @count bytes, %TRUE is returned, and
24664  * @bytes_written is set to @count.
24665  *
24666  * If there is an error during the operation (including
24667  * %G_IO_ERROR_WOULD_BLOCK in the non-blocking case), %FALSE is
24668  * returned and @error is set to indicate the error status,
24669  * @bytes_written is updated to contain the number of bytes written
24670  * into the stream before the error occurred.
24671  *
24672  * As with g_pollable_stream_write(), if @blocking is %FALSE, then
24673  * @stream must be a #GPollableOutputStream for which
24674  * g_pollable_output_stream_can_poll() returns %TRUE or else the
24675  * behavior is undefined. If @blocking is %TRUE, then @stream does not
24676  * need to be a #GPollableOutputStream.
24677  *
24678  * Returns: %TRUE on success, %FALSE if there was an error
24679  * Since: 2.34
24680  */
24681
24682
24683 /**
24684  * g_proxy_address_get_destination_hostname:
24685  * @proxy: a #GProxyAddress
24686  *
24687  * Gets @proxy's destination hostname; that is, the name of the host
24688  * that will be connected to via the proxy, not the name of the proxy
24689  * itself.
24690  *
24691  * Returns: the @proxy's destination hostname
24692  * Since: 2.26
24693  */
24694
24695
24696 /**
24697  * g_proxy_address_get_destination_port:
24698  * @proxy: a #GProxyAddress
24699  *
24700  * Gets @proxy's destination port; that is, the port on the
24701  * destination host that will be connected to via the proxy, not the
24702  * port number of the proxy itself.
24703  *
24704  * Returns: the @proxy's destination port
24705  * Since: 2.26
24706  */
24707
24708
24709 /**
24710  * g_proxy_address_get_destination_protocol:
24711  * @proxy: a #GProxyAddress
24712  *
24713  * Gets the protocol that is being spoken to the destination
24714  * server; eg, "http" or "ftp".
24715  *
24716  * Returns: the @proxy's destination protocol
24717  * Since: 2.34
24718  */
24719
24720
24721 /**
24722  * g_proxy_address_get_password:
24723  * @proxy: a #GProxyAddress
24724  *
24725  * Gets @proxy's password.
24726  *
24727  * Returns: the @proxy's password
24728  * Since: 2.26
24729  */
24730
24731
24732 /**
24733  * g_proxy_address_get_protocol:
24734  * @proxy: a #GProxyAddress
24735  *
24736  * Gets @proxy's protocol. eg, "socks" or "http"
24737  *
24738  * Returns: the @proxy's protocol
24739  * Since: 2.26
24740  */
24741
24742
24743 /**
24744  * g_proxy_address_get_uri:
24745  * @proxy: a #GProxyAddress
24746  *
24747  * Gets the proxy URI that @proxy was constructed from.
24748  *
24749  * Returns: the @proxy's URI, or %NULL if unknown
24750  * Since: 2.34
24751  */
24752
24753
24754 /**
24755  * g_proxy_address_get_username:
24756  * @proxy: a #GProxyAddress
24757  *
24758  * Gets @proxy's username.
24759  *
24760  * Returns: the @proxy's username
24761  * Since: 2.26
24762  */
24763
24764
24765 /**
24766  * g_proxy_address_new:
24767  * @inetaddr: The proxy server #GInetAddress.
24768  * @port: The proxy server port.
24769  * @protocol: The proxy protocol to support, in lower case (e.g. socks, http).
24770  * @dest_hostname: The destination hostname the proxy should tunnel to.
24771  * @dest_port: The destination port to tunnel to.
24772  * @username: (allow-none): The username to authenticate to the proxy server (or %NULL).
24773  * @password: (allow-none): The password to authenticate to the proxy server (or %NULL).
24774  *
24775  * Creates a new #GProxyAddress for @inetaddr with @protocol that should
24776  * tunnel through @dest_hostname and @dest_port.
24777  *
24778  * (Note that this method doesn't set the #GProxyAddress:uri or
24779  * #GProxyAddress:destination-protocol fields; use g_object_new()
24780  * directly if you want to set those.)
24781  *
24782  * Returns: a new #GProxyAddress
24783  * Since: 2.26
24784  */
24785
24786
24787 /**
24788  * g_proxy_connect:
24789  * @proxy: a #GProxy
24790  * @connection: a #GIOStream
24791  * @proxy_address: a #GProxyAddress
24792  * @cancellable: (allow-none): a #GCancellable
24793  * @error: return #GError
24794  *
24795  * Given @connection to communicate with a proxy (eg, a
24796  * #GSocketConnection that is connected to the proxy server), this
24797  * does the necessary handshake to connect to @proxy_address, and if
24798  * required, wraps the #GIOStream to handle proxy payload.
24799  *
24800  * Returns: (transfer full): a #GIOStream that will replace @connection. This might be the same as @connection, in which case a reference will be added.
24801  * Since: 2.26
24802  */
24803
24804
24805 /**
24806  * g_proxy_connect_async:
24807  * @proxy: a #GProxy
24808  * @connection: a #GIOStream
24809  * @proxy_address: a #GProxyAddress
24810  * @cancellable: (allow-none): a #GCancellable
24811  * @callback: (scope async): a #GAsyncReadyCallback
24812  * @user_data: (closure): callback data
24813  *
24814  * Asynchronous version of g_proxy_connect().
24815  *
24816  * Since: 2.26
24817  */
24818
24819
24820 /**
24821  * g_proxy_connect_finish:
24822  * @proxy: a #GProxy
24823  * @result: a #GAsyncResult
24824  * @error: return #GError
24825  *
24826  * See g_proxy_connect().
24827  *
24828  * Returns: (transfer full): a #GIOStream.
24829  * Since: 2.26
24830  */
24831
24832
24833 /**
24834  * g_proxy_get_default_for_protocol:
24835  * @protocol: the proxy protocol name (e.g. http, socks, etc)
24836  *
24837  * Lookup "gio-proxy" extension point for a proxy implementation that supports
24838  * specified protocol.
24839  *
24840  * Returns: (transfer full): return a #GProxy or NULL if protocol is not supported.
24841  * Since: 2.26
24842  */
24843
24844
24845 /**
24846  * g_proxy_resolver_get_default:
24847  *
24848  * Gets the default #GProxyResolver for the system.
24849  *
24850  * Returns: (transfer none): the default #GProxyResolver.
24851  * Since: 2.26
24852  */
24853
24854
24855 /**
24856  * g_proxy_resolver_is_supported:
24857  * @resolver: a #GProxyResolver
24858  *
24859  * Checks if @resolver can be used on this system. (This is used
24860  * internally; g_proxy_resolver_get_default() will only return a proxy
24861  * resolver that returns %TRUE for this method.)
24862  *
24863  * Returns: %TRUE if @resolver is supported.
24864  * Since: 2.26
24865  */
24866
24867
24868 /**
24869  * g_proxy_resolver_lookup:
24870  * @resolver: a #GProxyResolver
24871  * @uri: a URI representing the destination to connect to
24872  * @cancellable: (allow-none): a #GCancellable, or %NULL
24873  * @error: return location for a #GError, or %NULL
24874  *
24875  * Looks into the system proxy configuration to determine what proxy,
24876  * if any, to use to connect to @uri. The returned proxy URIs are of the
24877  * form <literal>&lt;protocol&gt;://[user[:password]@]host:port</literal>
24878  * or <literal>direct://</literal>, where &lt;protocol&gt; could be
24879  * http, rtsp, socks or other proxying protocol.
24880  *
24881  * If you don't know what network protocol is being used on the
24882  * socket, you should use <literal>none</literal> as the URI protocol.
24883  * In this case, the resolver might still return a generic proxy type
24884  * (such as SOCKS), but would not return protocol-specific proxy types
24885  * (such as http).
24886  *
24887  * <literal>direct://</literal> is used when no proxy is needed.
24888  * Direct connection should not be attempted unless it is part of the
24889  * returned array of proxies.
24890  *
24891  * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
24892  * Since: 2.26
24893  */
24894
24895
24896 /**
24897  * g_proxy_resolver_lookup_async:
24898  * @resolver: a #GProxyResolver
24899  * @uri: a URI representing the destination to connect to
24900  * @cancellable: (allow-none): a #GCancellable, or %NULL
24901  * @callback: (scope async): callback to call after resolution completes
24902  * @user_data: (closure): data for @callback
24903  *
24904  * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
24905  * details.
24906  *
24907  * Since: 2.26
24908  */
24909
24910
24911 /**
24912  * g_proxy_resolver_lookup_finish:
24913  * @resolver: a #GProxyResolver
24914  * @result: the result passed to your #GAsyncReadyCallback
24915  * @error: return location for a #GError, or %NULL
24916  *
24917  * Call this function to obtain the array of proxy URIs when
24918  * g_proxy_resolver_lookup_async() is complete. See
24919  * g_proxy_resolver_lookup() for more details.
24920  *
24921  * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
24922  * Since: 2.26
24923  */
24924
24925
24926 /**
24927  * g_proxy_supports_hostname:
24928  * @proxy: a #GProxy
24929  *
24930  * Some proxy protocols expect to be passed a hostname, which they
24931  * will resolve to an IP address themselves. Others, like SOCKS4, do
24932  * not allow this. This function will return %FALSE if @proxy is
24933  * implementing such a protocol. When %FALSE is returned, the caller
24934  * should resolve the destination hostname first, and then pass a
24935  * #GProxyAddress containing the stringified IP address to
24936  * g_proxy_connect() or g_proxy_connect_async().
24937  *
24938  * Returns: %TRUE if hostname resolution is supported.
24939  * Since: 2.26
24940  */
24941
24942
24943 /**
24944  * g_remote_action_group_activate_action_full:
24945  * @remote: a #GDBusActionGroup
24946  * @action_name: the name of the action to activate
24947  * @parameter: (allow-none): the optional parameter to the activation
24948  * @platform_data: the platform data to send
24949  *
24950  * Activates the remote action.
24951  *
24952  * This is the same as g_action_group_activate_action() except that it
24953  * allows for provision of "platform data" to be sent along with the
24954  * activation request.  This typically contains details such as the user
24955  * interaction timestamp or startup notification information.
24956  *
24957  * @platform_data must be non-%NULL and must have the type
24958  * %G_VARIANT_TYPE_VARDICT.  If it is floating, it will be consumed.
24959  *
24960  * Since: 2.32
24961  */
24962
24963
24964 /**
24965  * g_remote_action_group_change_action_state_full:
24966  * @remote: a #GRemoteActionGroup
24967  * @action_name: the name of the action to change the state of
24968  * @value: the new requested value for the state
24969  * @platform_data: the platform data to send
24970  *
24971  * Changes the state of a remote action.
24972  *
24973  * This is the same as g_action_group_change_action_state() except that
24974  * it allows for provision of "platform data" to be sent along with the
24975  * state change request.  This typically contains details such as the
24976  * user interaction timestamp or startup notification information.
24977  *
24978  * @platform_data must be non-%NULL and must have the type
24979  * %G_VARIANT_TYPE_VARDICT.  If it is floating, it will be consumed.
24980  *
24981  * Since: 2.32
24982  */
24983
24984
24985 /**
24986  * g_resolver_error_quark:
24987  *
24988  * Gets the #GResolver Error Quark.
24989  *
24990  * Returns: a #GQuark.
24991  * Since: 2.22
24992  */
24993
24994
24995 /**
24996  * g_resolver_free_addresses: (skip)
24997  * @addresses: a #GList of #GInetAddress
24998  *
24999  * Frees @addresses (which should be the return value from
25000  * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
25001  * (This is a convenience method; you can also simply free the results
25002  * by hand.)
25003  *
25004  * Since: 2.22
25005  */
25006
25007
25008 /**
25009  * g_resolver_free_targets: (skip)
25010  * @targets: a #GList of #GSrvTarget
25011  *
25012  * Frees @targets (which should be the return value from
25013  * g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
25014  * (This is a convenience method; you can also simply free the
25015  * results by hand.)
25016  *
25017  * Since: 2.22
25018  */
25019
25020
25021 /**
25022  * g_resolver_get_default:
25023  *
25024  * Gets the default #GResolver. You should unref it when you are done
25025  * with it. #GResolver may use its reference count as a hint about how
25026  * many threads it should allocate for concurrent DNS resolutions.
25027  *
25028  * Returns: (transfer full): the default #GResolver.
25029  * Since: 2.22
25030  */
25031
25032
25033 /**
25034  * g_resolver_lookup_by_address:
25035  * @resolver: a #GResolver
25036  * @address: the address to reverse-resolve
25037  * @cancellable: (allow-none): a #GCancellable, or %NULL
25038  * @error: return location for a #GError, or %NULL
25039  *
25040  * Synchronously reverse-resolves @address to determine its
25041  * associated hostname.
25042  *
25043  * If the DNS resolution fails, @error (if non-%NULL) will be set to
25044  * a value from #GResolverError.
25045  *
25046  * If @cancellable is non-%NULL, it can be used to cancel the
25047  * operation, in which case @error (if non-%NULL) will be set to
25048  * %G_IO_ERROR_CANCELLED.
25049  *
25050  * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25051  * Since: 2.22
25052  */
25053
25054
25055 /**
25056  * g_resolver_lookup_by_address_async:
25057  * @resolver: a #GResolver
25058  * @address: the address to reverse-resolve
25059  * @cancellable: (allow-none): a #GCancellable, or %NULL
25060  * @callback: (scope async): callback to call after resolution completes
25061  * @user_data: (closure): data for @callback
25062  *
25063  * Begins asynchronously reverse-resolving @address to determine its
25064  * associated hostname, and eventually calls @callback, which must
25065  * call g_resolver_lookup_by_address_finish() to get the final result.
25066  *
25067  * Since: 2.22
25068  */
25069
25070
25071 /**
25072  * g_resolver_lookup_by_address_finish:
25073  * @resolver: a #GResolver
25074  * @result: the result passed to your #GAsyncReadyCallback
25075  * @error: return location for a #GError, or %NULL
25076  *
25077  * Retrieves the result of a previous call to
25078  * g_resolver_lookup_by_address_async().
25079  *
25080  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25081  * a value from #GResolverError. If the operation was cancelled,
25082  * @error will be set to %G_IO_ERROR_CANCELLED.
25083  *
25084  * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
25085  * Since: 2.22
25086  */
25087
25088
25089 /**
25090  * g_resolver_lookup_by_name:
25091  * @resolver: a #GResolver
25092  * @hostname: the hostname to look up
25093  * @cancellable: (allow-none): a #GCancellable, or %NULL
25094  * @error: return location for a #GError, or %NULL
25095  *
25096  * Synchronously resolves @hostname to determine its associated IP
25097  * address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
25098  * the textual form of an IP address (in which case this just becomes
25099  * a wrapper around g_inet_address_new_from_string()).
25100  *
25101  * On success, g_resolver_lookup_by_name() will return a #GList of
25102  * #GInetAddress, sorted in order of preference and guaranteed to not
25103  * contain duplicates. That is, if using the result to connect to
25104  * @hostname, you should attempt to connect to the first address
25105  * first, then the second if the first fails, etc. If you are using
25106  * the result to listen on a socket, it is appropriate to add each
25107  * result using e.g. g_socket_listener_add_address().
25108  *
25109  * If the DNS resolution fails, @error (if non-%NULL) will be set to a
25110  * value from #GResolverError.
25111  *
25112  * If @cancellable is non-%NULL, it can be used to cancel the
25113  * operation, in which case @error (if non-%NULL) will be set to
25114  * %G_IO_ERROR_CANCELLED.
25115  *
25116  * If you are planning to connect to a socket on the resolved IP
25117  * address, it may be easier to create a #GNetworkAddress and use its
25118  * #GSocketConnectable interface.
25119  *
25120  * 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.)
25121  * Since: 2.22
25122  */
25123
25124
25125 /**
25126  * g_resolver_lookup_by_name_async:
25127  * @resolver: a #GResolver
25128  * @hostname: the hostname to look up the address of
25129  * @cancellable: (allow-none): a #GCancellable, or %NULL
25130  * @callback: (scope async): callback to call after resolution completes
25131  * @user_data: (closure): data for @callback
25132  *
25133  * Begins asynchronously resolving @hostname to determine its
25134  * associated IP address(es), and eventually calls @callback, which
25135  * must call g_resolver_lookup_by_name_finish() to get the result.
25136  * See g_resolver_lookup_by_name() for more details.
25137  *
25138  * Since: 2.22
25139  */
25140
25141
25142 /**
25143  * g_resolver_lookup_by_name_finish:
25144  * @resolver: a #GResolver
25145  * @result: the result passed to your #GAsyncReadyCallback
25146  * @error: return location for a #GError, or %NULL
25147  *
25148  * Retrieves the result of a call to
25149  * g_resolver_lookup_by_name_async().
25150  *
25151  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25152  * a value from #GResolverError. If the operation was cancelled,
25153  * @error will be set to %G_IO_ERROR_CANCELLED.
25154  *
25155  * Returns: (element-type GInetAddress) (transfer full): a #GList of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name() for more details.
25156  * Since: 2.22
25157  */
25158
25159
25160 /**
25161  * g_resolver_lookup_records:
25162  * @resolver: a #GResolver
25163  * @rrname: the DNS name to lookup the record for
25164  * @record_type: the type of DNS record to lookup
25165  * @cancellable: (allow-none): a #GCancellable, or %NULL
25166  * @error: return location for a #GError, or %NULL
25167  *
25168  * Synchronously performs a DNS record lookup for the given @rrname and returns
25169  * a list of records as #GVariant tuples. See #GResolverRecordType for
25170  * information on what the records contain for each @record_type.
25171  *
25172  * If the DNS resolution fails, @error (if non-%NULL) will be set to
25173  * a value from #GResolverError.
25174  *
25175  * If @cancellable is non-%NULL, it can be used to cancel the
25176  * operation, in which case @error (if non-%NULL) will be set to
25177  * %G_IO_ERROR_CANCELLED.
25178  *
25179  * 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.)
25180  * Since: 2.34
25181  */
25182
25183
25184 /**
25185  * g_resolver_lookup_records_async:
25186  * @resolver: a #GResolver
25187  * @rrname: the DNS name to lookup the record for
25188  * @record_type: the type of DNS record to lookup
25189  * @cancellable: (allow-none): a #GCancellable, or %NULL
25190  * @callback: (scope async): callback to call after resolution completes
25191  * @user_data: (closure): data for @callback
25192  *
25193  * Begins asynchronously performing a DNS lookup for the given
25194  * @rrname, and eventually calls @callback, which must call
25195  * g_resolver_lookup_records_finish() to get the final result. See
25196  * g_resolver_lookup_records() for more details.
25197  *
25198  * Since: 2.34
25199  */
25200
25201
25202 /**
25203  * g_resolver_lookup_records_finish:
25204  * @resolver: a #GResolver
25205  * @result: the result passed to your #GAsyncReadyCallback
25206  * @error: return location for a #GError, or %NULL
25207  *
25208  * Retrieves the result of a previous call to
25209  * g_resolver_lookup_records_async(). Returns a list of records as #GVariant
25210  * tuples. See #GResolverRecordType for information on what the records contain.
25211  *
25212  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25213  * a value from #GResolverError. If the operation was cancelled,
25214  * @error will be set to %G_IO_ERROR_CANCELLED.
25215  *
25216  * 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.)
25217  * Since: 2.34
25218  */
25219
25220
25221 /**
25222  * g_resolver_lookup_service:
25223  * @resolver: a #GResolver
25224  * @service: the service type to look up (eg, "ldap")
25225  * @protocol: the networking protocol to use for @service (eg, "tcp")
25226  * @domain: the DNS domain to look up the service in
25227  * @cancellable: (allow-none): a #GCancellable, or %NULL
25228  * @error: return location for a #GError, or %NULL
25229  *
25230  * Synchronously performs a DNS SRV lookup for the given @service and
25231  * @protocol in the given @domain and returns an array of #GSrvTarget.
25232  * @domain may be an ASCII-only or UTF-8 hostname. Note also that the
25233  * @service and @protocol arguments <emphasis>do not</emphasis>
25234  * include the leading underscore that appears in the actual DNS
25235  * entry.
25236  *
25237  * On success, g_resolver_lookup_service() will return a #GList of
25238  * #GSrvTarget, sorted in order of preference. (That is, you should
25239  * attempt to connect to the first target first, then the second if
25240  * the first fails, etc.)
25241  *
25242  * If the DNS resolution fails, @error (if non-%NULL) will be set to
25243  * a value from #GResolverError.
25244  *
25245  * If @cancellable is non-%NULL, it can be used to cancel the
25246  * operation, in which case @error (if non-%NULL) will be set to
25247  * %G_IO_ERROR_CANCELLED.
25248  *
25249  * If you are planning to connect to the service, it is usually easier
25250  * to create a #GNetworkService and use its #GSocketConnectable
25251  * interface.
25252  *
25253  * 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.)
25254  * Since: 2.22
25255  */
25256
25257
25258 /**
25259  * g_resolver_lookup_service_async:
25260  * @resolver: a #GResolver
25261  * @service: the service type to look up (eg, "ldap")
25262  * @protocol: the networking protocol to use for @service (eg, "tcp")
25263  * @domain: the DNS domain to look up the service in
25264  * @cancellable: (allow-none): a #GCancellable, or %NULL
25265  * @callback: (scope async): callback to call after resolution completes
25266  * @user_data: (closure): data for @callback
25267  *
25268  * Begins asynchronously performing a DNS SRV lookup for the given
25269  * @service and @protocol in the given @domain, and eventually calls
25270  * @callback, which must call g_resolver_lookup_service_finish() to
25271  * get the final result. See g_resolver_lookup_service() for more
25272  * details.
25273  *
25274  * Since: 2.22
25275  */
25276
25277
25278 /**
25279  * g_resolver_lookup_service_finish:
25280  * @resolver: a #GResolver
25281  * @result: the result passed to your #GAsyncReadyCallback
25282  * @error: return location for a #GError, or %NULL
25283  *
25284  * Retrieves the result of a previous call to
25285  * g_resolver_lookup_service_async().
25286  *
25287  * If the DNS resolution failed, @error (if non-%NULL) will be set to
25288  * a value from #GResolverError. If the operation was cancelled,
25289  * @error will be set to %G_IO_ERROR_CANCELLED.
25290  *
25291  * Returns: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, or %NULL on error. See g_resolver_lookup_service() for more details.
25292  * Since: 2.22
25293  */
25294
25295
25296 /**
25297  * g_resolver_set_default:
25298  * @resolver: the new default #GResolver
25299  *
25300  * Sets @resolver to be the application's default resolver (reffing
25301  * @resolver, and unreffing the previous default resolver, if any).
25302  * Future calls to g_resolver_get_default() will return this resolver.
25303  *
25304  * This can be used if an application wants to perform any sort of DNS
25305  * caching or "pinning"; it can implement its own #GResolver that
25306  * calls the original default resolver for DNS operations, and
25307  * implements its own cache policies on top of that, and then set
25308  * itself as the default resolver for all later code to use.
25309  *
25310  * Since: 2.22
25311  */
25312
25313
25314 /**
25315  * g_resource_enumerate_children:
25316  * @resource: A #GResource
25317  * @path: A pathname inside the resource
25318  * @lookup_flags: A #GResourceLookupFlags
25319  * @error: return location for a #GError, or %NULL
25320  *
25321  * Returns all the names of children at the specified @path in the resource.
25322  * The return result is a %NULL terminated list of strings which should
25323  * be released with g_strfreev().
25324  *
25325  * @lookup_flags controls the behaviour of the lookup.
25326  *
25327  * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
25328  * Since: 2.32
25329  */
25330
25331
25332 /**
25333  * g_resource_error_quark:
25334  *
25335  * Gets the #GResource Error Quark.
25336  *
25337  * Returns: a #GQuark
25338  * Since: 2.32
25339  */
25340
25341
25342 /**
25343  * g_resource_get_info:
25344  * @resource: A #GResource
25345  * @path: A pathname inside the resource
25346  * @lookup_flags: A #GResourceLookupFlags
25347  * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
25348  * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
25349  * @error: return location for a #GError, or %NULL
25350  *
25351  * Looks for a file at the specified @path in the resource and
25352  * if found returns information about it.
25353  *
25354  * @lookup_flags controls the behaviour of the lookup.
25355  *
25356  * Returns: %TRUE if the file was found. %FALSE if there were errors
25357  * Since: 2.32
25358  */
25359
25360
25361 /**
25362  * g_resource_load:
25363  * @filename: (type filename): the path of a filename to load, in the GLib filename encoding
25364  * @error: return location for a #GError, or %NULL
25365  *
25366  * Loads a binary resource bundle and creates a #GResource representation of it, allowing
25367  * you to query it for data.
25368  *
25369  * If you want to use this resource in the global resource namespace you need
25370  * to register it with g_resources_register().
25371  *
25372  * Returns: (transfer full): a new #GResource, or %NULL on error
25373  * Since: 2.32
25374  */
25375
25376
25377 /**
25378  * g_resource_lookup_data:
25379  * @resource: A #GResource
25380  * @path: A pathname inside the resource
25381  * @lookup_flags: A #GResourceLookupFlags
25382  * @error: return location for a #GError, or %NULL
25383  *
25384  * Looks for a file at the specified @path in the resource and
25385  * returns a #GBytes that lets you directly access the data in
25386  * memory.
25387  *
25388  * The data is always followed by a zero byte, so you
25389  * can safely use the data as a C string. However, that byte
25390  * is not included in the size of the GBytes.
25391  *
25392  * For uncompressed resource files this is a pointer directly into
25393  * the resource bundle, which is typically in some readonly data section
25394  * in the program binary. For compressed files we allocate memory on
25395  * the heap and automatically uncompress the data.
25396  *
25397  * @lookup_flags controls the behaviour of the lookup.
25398  *
25399  * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
25400  * Since: 2.32
25401  */
25402
25403
25404 /**
25405  * g_resource_new_from_data:
25406  * @data: A #GBytes
25407  * @error: return location for a #GError, or %NULL
25408  *
25409  * Creates a GResource from a reference to the binary resource bundle.
25410  * This will keep a reference to @data while the resource lives, so
25411  * the data should not be modified or freed.
25412  *
25413  * If you want to use this resource in the global resource namespace you need
25414  * to register it with g_resources_register().
25415  *
25416  * Returns: (transfer full): a new #GResource, or %NULL on error
25417  * Since: 2.32
25418  */
25419
25420
25421 /**
25422  * g_resource_open_stream:
25423  * @resource: A #GResource
25424  * @path: A pathname inside the resource
25425  * @lookup_flags: A #GResourceLookupFlags
25426  * @error: return location for a #GError, or %NULL
25427  *
25428  * Looks for a file at the specified @path in the resource and
25429  * returns a #GInputStream that lets you read the data.
25430  *
25431  * @lookup_flags controls the behaviour of the lookup.
25432  *
25433  * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
25434  * Since: 2.32
25435  */
25436
25437
25438 /**
25439  * g_resource_ref:
25440  * @resource: A #GResource
25441  *
25442  * Atomically increments the reference count of @array by one. This
25443  * function is MT-safe and may be called from any thread.
25444  *
25445  * Returns: The passed in #GResource
25446  * Since: 2.32
25447  */
25448
25449
25450 /**
25451  * g_resource_unref:
25452  * @resource: A #GResource
25453  *
25454  * Atomically decrements the reference count of @resource by one. If the
25455  * reference count drops to 0, all memory allocated by the array is
25456  * released. This function is MT-safe and may be called from any
25457  * thread.
25458  *
25459  * Since: 2.32
25460  */
25461
25462
25463 /**
25464  * g_resources_enumerate_children:
25465  * @path: A pathname inside the resource
25466  * @lookup_flags: A #GResourceLookupFlags
25467  * @error: return location for a #GError, or %NULL
25468  *
25469  * Returns all the names of children at the specified @path in the set of
25470  * globally registered resources.
25471  * The return result is a %NULL terminated list of strings which should
25472  * be released with g_strfreev().
25473  *
25474  * @lookup_flags controls the behaviour of the lookup.
25475  *
25476  * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
25477  * Since: 2.32
25478  */
25479
25480
25481 /**
25482  * g_resources_get_info:
25483  * @path: A pathname inside the resource
25484  * @lookup_flags: A #GResourceLookupFlags
25485  * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
25486  * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
25487  * @error: return location for a #GError, or %NULL
25488  *
25489  * Looks for a file at the specified @path in the set of
25490  * globally registered resources and if found returns information about it.
25491  *
25492  * @lookup_flags controls the behaviour of the lookup.
25493  *
25494  * Returns: %TRUE if the file was found. %FALSE if there were errors
25495  * Since: 2.32
25496  */
25497
25498
25499 /**
25500  * g_resources_lookup_data:
25501  * @path: A pathname inside the resource
25502  * @lookup_flags: A #GResourceLookupFlags
25503  * @error: return location for a #GError, or %NULL
25504  *
25505  * Looks for a file at the specified @path in the set of
25506  * globally registered resources and returns a #GBytes that
25507  * lets you directly access the data in memory.
25508  *
25509  * The data is always followed by a zero byte, so you
25510  * can safely use the data as a C string. However, that byte
25511  * is not included in the size of the GBytes.
25512  *
25513  * For uncompressed resource files this is a pointer directly into
25514  * the resource bundle, which is typically in some readonly data section
25515  * in the program binary. For compressed files we allocate memory on
25516  * the heap and automatically uncompress the data.
25517  *
25518  * @lookup_flags controls the behaviour of the lookup.
25519  *
25520  * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
25521  * Since: 2.32
25522  */
25523
25524
25525 /**
25526  * g_resources_open_stream:
25527  * @path: A pathname inside the resource
25528  * @lookup_flags: A #GResourceLookupFlags
25529  * @error: return location for a #GError, or %NULL
25530  *
25531  * Looks for a file at the specified @path in the set of
25532  * globally registered resources and returns a #GInputStream
25533  * that lets you read the data.
25534  *
25535  * @lookup_flags controls the behaviour of the lookup.
25536  *
25537  * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
25538  * Since: 2.32
25539  */
25540
25541
25542 /**
25543  * g_resources_register:
25544  * @resource: A #GResource
25545  *
25546  * Registers the resource with the process-global set of resources.
25547  * Once a resource is registered the files in it can be accessed
25548  * with the global resource lookup functions like g_resources_lookup_data().
25549  *
25550  * Since: 2.32
25551  */
25552
25553
25554 /**
25555  * g_resources_unregister:
25556  * @resource: A #GResource
25557  *
25558  * Unregisters the resource from the process-global set of resources.
25559  *
25560  * Since: 2.32
25561  */
25562
25563
25564 /**
25565  * g_seekable_can_seek:
25566  * @seekable: a #GSeekable.
25567  *
25568  * Tests if the stream supports the #GSeekableIface.
25569  *
25570  * Returns: %TRUE if @seekable can be seeked. %FALSE otherwise.
25571  */
25572
25573
25574 /**
25575  * g_seekable_can_truncate:
25576  * @seekable: a #GSeekable.
25577  *
25578  * Tests if the stream can be truncated.
25579  *
25580  * Returns: %TRUE if the stream can be truncated, %FALSE otherwise.
25581  */
25582
25583
25584 /**
25585  * g_seekable_seek:
25586  * @seekable: a #GSeekable.
25587  * @offset: a #goffset.
25588  * @type: a #GSeekType.
25589  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25590  * @error: a #GError location to store the error occurring, or %NULL to ignore.
25591  *
25592  * Seeks in the stream by the given @offset, modified by @type.
25593  *
25594  * If @cancellable is not %NULL, then the operation can be cancelled by
25595  * triggering the cancellable object from another thread. If the operation
25596  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
25597  *
25598  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
25599  */
25600
25601
25602 /**
25603  * g_seekable_tell:
25604  * @seekable: a #GSeekable.
25605  *
25606  * Tells the current position within the stream.
25607  *
25608  * Returns: the offset from the beginning of the buffer.
25609  */
25610
25611
25612 /**
25613  * g_seekable_truncate:
25614  * @seekable: a #GSeekable.
25615  * @offset: a #goffset.
25616  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25617  * @error: a #GError location to store the error occurring, or %NULL to ignore.
25618  *
25619  * Truncates a stream with a given #offset.
25620  *
25621  * If @cancellable is not %NULL, then the operation can be cancelled by
25622  * triggering the cancellable object from another thread. If the operation
25623  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
25624  * operation was partially finished when the operation was cancelled the
25625  * partial result will be returned, without an error.
25626  *
25627  * Virtual: truncate_fn
25628  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
25629  */
25630
25631
25632 /**
25633  * g_settings_apply:
25634  * @settings: a #GSettings instance
25635  *
25636  * Applies any changes that have been made to the settings.  This
25637  * function does nothing unless @settings is in 'delay-apply' mode;
25638  * see g_settings_delay().  In the normal case settings are always
25639  * applied immediately.
25640  */
25641
25642
25643 /**
25644  * g_settings_backend_changed:
25645  * @backend: a #GSettingsBackend implementation
25646  * @key: the name of the key
25647  * @origin_tag: the origin tag
25648  *
25649  * Signals that a single key has possibly changed.  Backend
25650  * implementations should call this if a key has possibly changed its
25651  * value.
25652  *
25653  * @key must be a valid key (ie starting with a slash, not containing
25654  * '//', and not ending with a slash).
25655  *
25656  * The implementation must call this function during any call to
25657  * g_settings_backend_write(), before the call returns (except in the
25658  * case that no keys are actually changed and it cares to detect this
25659  * fact).  It may not rely on the existence of a mainloop for
25660  * dispatching the signal later.
25661  *
25662  * The implementation may call this function at any other time it likes
25663  * in response to other events (such as changes occurring outside of the
25664  * program).  These calls may originate from a mainloop or may originate
25665  * in response to any other action (including from calls to
25666  * g_settings_backend_write()).
25667  *
25668  * In the case that this call is in response to a call to
25669  * g_settings_backend_write() then @origin_tag must be set to the same
25670  * value that was passed to that call.
25671  *
25672  * Since: 2.26
25673  */
25674
25675
25676 /**
25677  * g_settings_backend_changed_tree:
25678  * @backend: a #GSettingsBackend implementation
25679  * @tree: a #GTree containing the changes
25680  * @origin_tag: the origin tag
25681  *
25682  * This call is a convenience wrapper.  It gets the list of changes from
25683  * @tree, computes the longest common prefix and calls
25684  * g_settings_backend_changed().
25685  *
25686  * Since: 2.26
25687  */
25688
25689
25690 /**
25691  * g_settings_backend_flatten_tree:
25692  * @tree: a #GTree containing the changes
25693  * @path: (out): the location to save the path
25694  * @keys: (out) (transfer container) (array zero-terminated=1): the location to save the relative keys
25695  * @values: (out) (allow-none) (transfer container) (array zero-terminated=1): the location to save the values, or %NULL
25696  *
25697  * Calculate the longest common prefix of all keys in a tree and write
25698  * out an array of the key names relative to that prefix and,
25699  * optionally, the value to store at each of those keys.
25700  *
25701  * You must free the value returned in @path, @keys and @values using
25702  * g_free().  You should not attempt to free or unref the contents of
25703  * @keys or @values.
25704  *
25705  * Since: 2.26
25706  */
25707
25708
25709 /**
25710  * g_settings_backend_get_default:
25711  *
25712  * Returns the default #GSettingsBackend. It is possible to override
25713  * the default by setting the <envar>GSETTINGS_BACKEND</envar>
25714  * environment variable to the name of a settings backend.
25715  *
25716  * The user gets a reference to the backend.
25717  *
25718  * Returns: (transfer full): the default #GSettingsBackend
25719  * Since: 2.28
25720  */
25721
25722
25723 /**
25724  * g_settings_backend_keys_changed:
25725  * @backend: a #GSettingsBackend implementation
25726  * @path: the path containing the changes
25727  * @items: (array zero-terminated=1): the %NULL-terminated list of changed keys
25728  * @origin_tag: the origin tag
25729  *
25730  * Signals that a list of keys have possibly changed.  Backend
25731  * implementations should call this if keys have possibly changed their
25732  * values.
25733  *
25734  * @path must be a valid path (ie starting and ending with a slash and
25735  * not containing '//').  Each string in @items must form a valid key
25736  * name when @path is prefixed to it (ie: each item must not start or
25737  * end with '/' and must not contain '//').
25738  *
25739  * The meaning of this signal is that any of the key names resulting
25740  * from the contatenation of @path with each item in @items may have
25741  * changed.
25742  *
25743  * The same rules for when notifications must occur apply as per
25744  * g_settings_backend_changed().  These two calls can be used
25745  * interchangeably if exactly one item has changed (although in that
25746  * case g_settings_backend_changed() is definitely preferred).
25747  *
25748  * For efficiency reasons, the implementation should strive for @path to
25749  * be as long as possible (ie: the longest common prefix of all of the
25750  * keys that were changed) but this is not strictly required.
25751  *
25752  * Since: 2.26
25753  */
25754
25755
25756 /**
25757  * g_settings_backend_path_changed:
25758  * @backend: a #GSettingsBackend implementation
25759  * @path: the path containing the changes
25760  * @origin_tag: the origin tag
25761  *
25762  * Signals that all keys below a given path may have possibly changed.
25763  * Backend implementations should call this if an entire path of keys
25764  * have possibly changed their values.
25765  *
25766  * @path must be a valid path (ie starting and ending with a slash and
25767  * not containing '//').
25768  *
25769  * The meaning of this signal is that any of the key which has a name
25770  * starting with @path may have changed.
25771  *
25772  * The same rules for when notifications must occur apply as per
25773  * g_settings_backend_changed().  This call might be an appropriate
25774  * reasponse to a 'reset' call but implementations are also free to
25775  * explicitly list the keys that were affected by that call if they can
25776  * easily do so.
25777  *
25778  * For efficiency reasons, the implementation should strive for @path to
25779  * be as long as possible (ie: the longest common prefix of all of the
25780  * keys that were changed) but this is not strictly required.  As an
25781  * example, if this function is called with the path of "/" then every
25782  * single key in the application will be notified of a possible change.
25783  *
25784  * Since: 2.26
25785  */
25786
25787
25788 /**
25789  * g_settings_backend_path_writable_changed:
25790  * @backend: a #GSettingsBackend implementation
25791  * @path: the name of the path
25792  *
25793  * Signals that the writability of all keys below a given path may have
25794  * changed.
25795  *
25796  * Since GSettings performs no locking operations for itself, this call
25797  * will always be made in response to external events.
25798  *
25799  * Since: 2.26
25800  */
25801
25802
25803 /**
25804  * g_settings_backend_writable_changed:
25805  * @backend: a #GSettingsBackend implementation
25806  * @key: the name of the key
25807  *
25808  * Signals that the writability of a single key has possibly changed.
25809  *
25810  * Since GSettings performs no locking operations for itself, this call
25811  * will always be made in response to external events.
25812  *
25813  * Since: 2.26
25814  */
25815
25816
25817 /**
25818  * g_settings_bind:
25819  * @settings: a #GSettings object
25820  * @key: the key to bind
25821  * @object: (type GObject.Object): a #GObject
25822  * @property: the name of the property to bind
25823  * @flags: flags for the binding
25824  *
25825  * Create a binding between the @key in the @settings object
25826  * and the property @property of @object.
25827  *
25828  * The binding uses the default GIO mapping functions to map
25829  * between the settings and property values. These functions
25830  * handle booleans, numeric types and string types in a
25831  * straightforward way. Use g_settings_bind_with_mapping() if
25832  * you need a custom mapping, or map between types that are not
25833  * supported by the default mapping functions.
25834  *
25835  * Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
25836  * function also establishes a binding between the writability of
25837  * @key and the "sensitive" property of @object (if @object has
25838  * a boolean property by that name). See g_settings_bind_writable()
25839  * for more details about writable bindings.
25840  *
25841  * Note that the lifecycle of the binding is tied to the object,
25842  * and that you can have only one binding per object property.
25843  * If you bind the same property twice on the same object, the second
25844  * binding overrides the first one.
25845  *
25846  * Since: 2.26
25847  */
25848
25849
25850 /**
25851  * g_settings_bind_with_mapping: (skip)
25852  * @settings: a #GSettings object
25853  * @key: the key to bind
25854  * @object: (type GObject.Object): a #GObject
25855  * @property: the name of the property to bind
25856  * @flags: flags for the binding
25857  * @get_mapping: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
25858  * @set_mapping: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
25859  * @user_data: data that gets passed to @get_mapping and @set_mapping
25860  * @destroy: #GDestroyNotify function for @user_data
25861  *
25862  * Create a binding between the @key in the @settings object
25863  * and the property @property of @object.
25864  *
25865  * The binding uses the provided mapping functions to map between
25866  * settings and property values.
25867  *
25868  * Note that the lifecycle of the binding is tied to the object,
25869  * and that you can have only one binding per object property.
25870  * If you bind the same property twice on the same object, the second
25871  * binding overrides the first one.
25872  *
25873  * Since: 2.26
25874  */
25875
25876
25877 /**
25878  * g_settings_bind_writable:
25879  * @settings: a #GSettings object
25880  * @key: the key to bind
25881  * @object: (type GObject.Object): a #GObject
25882  * @property: the name of a boolean property to bind
25883  * @inverted: whether to 'invert' the value
25884  *
25885  * Create a binding between the writability of @key in the
25886  * @settings object and the property @property of @object.
25887  * The property must be boolean; "sensitive" or "visible"
25888  * properties of widgets are the most likely candidates.
25889  *
25890  * Writable bindings are always uni-directional; changes of the
25891  * writability of the setting will be propagated to the object
25892  * property, not the other way.
25893  *
25894  * When the @inverted argument is %TRUE, the binding inverts the
25895  * value as it passes from the setting to the object, i.e. @property
25896  * will be set to %TRUE if the key is <emphasis>not</emphasis>
25897  * writable.
25898  *
25899  * Note that the lifecycle of the binding is tied to the object,
25900  * and that you can have only one binding per object property.
25901  * If you bind the same property twice on the same object, the second
25902  * binding overrides the first one.
25903  *
25904  * Since: 2.26
25905  */
25906
25907
25908 /**
25909  * g_settings_create_action:
25910  * @settings: a #GSettings
25911  * @key: the name of a key in @settings
25912  *
25913  * Creates a #GAction corresponding to a given #GSettings key.
25914  *
25915  * The action has the same name as the key.
25916  *
25917  * The value of the key becomes the state of the action and the action
25918  * is enabled when the key is writable.  Changing the state of the
25919  * action results in the key being written to.  Changes to the value or
25920  * writability of the key cause appropriate change notifications to be
25921  * emitted for the action.
25922  *
25923  * For boolean-valued keys, action activations take no parameter and
25924  * result in the toggling of the value.  For all other types,
25925  * activations take the new value for the key (which must have the
25926  * correct type).
25927  *
25928  * Returns: (transfer full): a new #GAction
25929  * Since: 2.32
25930  */
25931
25932
25933 /**
25934  * g_settings_delay:
25935  * @settings: a #GSettings object
25936  *
25937  * Changes the #GSettings object into 'delay-apply' mode. In this
25938  * mode, changes to @settings are not immediately propagated to the
25939  * backend, but kept locally until g_settings_apply() is called.
25940  *
25941  * Since: 2.26
25942  */
25943
25944
25945 /**
25946  * g_settings_get:
25947  * @settings: a #GSettings object
25948  * @key: the key to get the value for
25949  * @format: a #GVariant format string
25950  * @...: arguments as per @format
25951  *
25952  * Gets the value that is stored at @key in @settings.
25953  *
25954  * A convenience function that combines g_settings_get_value() with
25955  * g_variant_get().
25956  *
25957  * It is a programmer error to give a @key that isn't contained in the
25958  * schema for @settings or for the #GVariantType of @format to mismatch
25959  * the type given in the schema.
25960  *
25961  * Since: 2.26
25962  */
25963
25964
25965 /**
25966  * g_settings_get_boolean:
25967  * @settings: a #GSettings object
25968  * @key: the key to get the value for
25969  *
25970  * Gets the value that is stored at @key in @settings.
25971  *
25972  * A convenience variant of g_settings_get() for booleans.
25973  *
25974  * It is a programmer error to give a @key that isn't specified as
25975  * having a boolean type in the schema for @settings.
25976  *
25977  * Returns: a boolean
25978  * Since: 2.26
25979  */
25980
25981
25982 /**
25983  * g_settings_get_child:
25984  * @settings: a #GSettings object
25985  * @name: the name of the 'child' schema
25986  *
25987  * Creates a 'child' settings object which has a base path of
25988  * <replaceable>base-path</replaceable>/@name, where
25989  * <replaceable>base-path</replaceable> is the base path of @settings.
25990  *
25991  * The schema for the child settings object must have been declared
25992  * in the schema of @settings using a <tag class="starttag">child</tag> element.
25993  *
25994  * Returns: (transfer full): a 'child' settings object
25995  * Since: 2.26
25996  */
25997
25998
25999 /**
26000  * g_settings_get_double:
26001  * @settings: a #GSettings object
26002  * @key: the key to get the value for
26003  *
26004  * Gets the value that is stored at @key in @settings.
26005  *
26006  * A convenience variant of g_settings_get() for doubles.
26007  *
26008  * It is a programmer error to give a @key that isn't specified as
26009  * having a 'double' type in the schema for @settings.
26010  *
26011  * Returns: a double
26012  * Since: 2.26
26013  */
26014
26015
26016 /**
26017  * g_settings_get_enum:
26018  * @settings: a #GSettings object
26019  * @key: the key to get the value for
26020  *
26021  * Gets the value that is stored in @settings for @key and converts it
26022  * to the enum value that it represents.
26023  *
26024  * In order to use this function the type of the value must be a string
26025  * and it must be marked in the schema file as an enumerated type.
26026  *
26027  * It is a programmer error to give a @key that isn't contained in the
26028  * schema for @settings or is not marked as an enumerated type.
26029  *
26030  * If the value stored in the configuration database is not a valid
26031  * value for the enumerated type then this function will return the
26032  * default value.
26033  *
26034  * Returns: the enum value
26035  * Since: 2.26
26036  */
26037
26038
26039 /**
26040  * g_settings_get_flags:
26041  * @settings: a #GSettings object
26042  * @key: the key to get the value for
26043  *
26044  * Gets the value that is stored in @settings for @key and converts it
26045  * to the flags value that it represents.
26046  *
26047  * In order to use this function the type of the value must be an array
26048  * of strings and it must be marked in the schema file as an flags type.
26049  *
26050  * It is a programmer error to give a @key that isn't contained in the
26051  * schema for @settings or is not marked as a flags type.
26052  *
26053  * If the value stored in the configuration database is not a valid
26054  * value for the flags type then this function will return the default
26055  * value.
26056  *
26057  * Returns: the flags value
26058  * Since: 2.26
26059  */
26060
26061
26062 /**
26063  * g_settings_get_has_unapplied:
26064  * @settings: a #GSettings object
26065  *
26066  * Returns whether the #GSettings object has any unapplied
26067  * changes.  This can only be the case if it is in 'delayed-apply' mode.
26068  *
26069  * Returns: %TRUE if @settings has unapplied changes
26070  * Since: 2.26
26071  */
26072
26073
26074 /**
26075  * g_settings_get_int:
26076  * @settings: a #GSettings object
26077  * @key: the key to get the value for
26078  *
26079  * Gets the value that is stored at @key in @settings.
26080  *
26081  * A convenience variant of g_settings_get() for 32-bit integers.
26082  *
26083  * It is a programmer error to give a @key that isn't specified as
26084  * having a int32 type in the schema for @settings.
26085  *
26086  * Returns: an integer
26087  * Since: 2.26
26088  */
26089
26090
26091 /**
26092  * g_settings_get_mapped:
26093  * @settings: a #GSettings object
26094  * @key: the key to get the value for
26095  * @mapping: (scope call): the function to map the value in the settings database to the value used by the application
26096  * @user_data: user data for @mapping
26097  *
26098  * Gets the value that is stored at @key in @settings, subject to
26099  * application-level validation/mapping.
26100  *
26101  * You should use this function when the application needs to perform
26102  * some processing on the value of the key (for example, parsing).  The
26103  * @mapping function performs that processing.  If the function
26104  * indicates that the processing was unsuccessful (due to a parse error,
26105  * for example) then the mapping is tried again with another value.
26106  *
26107  * This allows a robust 'fall back to defaults' behaviour to be
26108  * implemented somewhat automatically.
26109  *
26110  * The first value that is tried is the user's setting for the key.  If
26111  * the mapping function fails to map this value, other values may be
26112  * tried in an unspecified order (system or site defaults, translated
26113  * schema default values, untranslated schema default values, etc).
26114  *
26115  * If the mapping function fails for all possible values, one additional
26116  * attempt is made: the mapping function is called with a %NULL value.
26117  * If the mapping function still indicates failure at this point then
26118  * the application will be aborted.
26119  *
26120  * The result parameter for the @mapping function is pointed to a
26121  * #gpointer which is initially set to %NULL.  The same pointer is given
26122  * to each invocation of @mapping.  The final value of that #gpointer is
26123  * what is returned by this function.  %NULL is valid; it is returned
26124  * just as any other value would be.
26125  *
26126  * Returns: (transfer full): the result, which may be %NULL
26127  */
26128
26129
26130 /**
26131  * g_settings_get_range:
26132  * @settings: a #GSettings
26133  * @key: the key to query the range of
26134  *
26135  * Queries the range of a key.
26136  *
26137  * This function will return a #GVariant that fully describes the range
26138  * of values that are valid for @key.
26139  *
26140  * The type of #GVariant returned is <literal>(sv)</literal>.  The
26141  * string describes the type of range restriction in effect.  The type
26142  * and meaning of the value contained in the variant depends on the
26143  * string.
26144  *
26145  * If the string is <literal>'type'</literal> then the variant contains
26146  * an empty array.  The element type of that empty array is the expected
26147  * type of value and all values of that type are valid.
26148  *
26149  * If the string is <literal>'enum'</literal> then the variant contains
26150  * an array enumerating the possible values.  Each item in the array is
26151  * a possible valid value and no other values are valid.
26152  *
26153  * If the string is <literal>'flags'</literal> then the variant contains
26154  * an array.  Each item in the array is a value that may appear zero or
26155  * one times in an array to be used as the value for this key.  For
26156  * example, if the variant contained the array <literal>['x',
26157  * 'y']</literal> then the valid values for the key would be
26158  * <literal>[]</literal>, <literal>['x']</literal>,
26159  * <literal>['y']</literal>, <literal>['x', 'y']</literal> and
26160  * <literal>['y', 'x']</literal>.
26161  *
26162  * Finally, if the string is <literal>'range'</literal> then the variant
26163  * contains a pair of like-typed values -- the minimum and maximum
26164  * permissible values for this key.
26165  *
26166  * This information should not be used by normal programs.  It is
26167  * considered to be a hint for introspection purposes.  Normal programs
26168  * should already know what is permitted by their own schema.  The
26169  * format may change in any way in the future -- but particularly, new
26170  * forms may be added to the possibilities described above.
26171  *
26172  * It is a programmer error to give a @key that isn't contained in the
26173  * schema for @settings.
26174  *
26175  * You should free the returned value with g_variant_unref() when it is
26176  * no longer needed.
26177  *
26178  * Returns: a #GVariant describing the range
26179  * Since: 2.28
26180  */
26181
26182
26183 /**
26184  * g_settings_get_string:
26185  * @settings: a #GSettings object
26186  * @key: the key to get the value for
26187  *
26188  * Gets the value that is stored at @key in @settings.
26189  *
26190  * A convenience variant of g_settings_get() for strings.
26191  *
26192  * It is a programmer error to give a @key that isn't specified as
26193  * having a string type in the schema for @settings.
26194  *
26195  * Returns: a newly-allocated string
26196  * Since: 2.26
26197  */
26198
26199
26200 /**
26201  * g_settings_get_strv:
26202  * @settings: a #GSettings object
26203  * @key: the key to get the value for
26204  *
26205  * A convenience variant of g_settings_get() for string arrays.
26206  *
26207  * It is a programmer error to give a @key that isn't specified as
26208  * having an array of strings type in the schema for @settings.
26209  *
26210  * Returns: (array zero-terminated=1) (transfer full): a newly-allocated, %NULL-terminated array of strings, the value that is stored at @key in @settings.
26211  * Since: 2.26
26212  */
26213
26214
26215 /**
26216  * g_settings_get_uint:
26217  * @settings: a #GSettings object
26218  * @key: the key to get the value for
26219  *
26220  * Gets the value that is stored at @key in @settings.
26221  *
26222  * A convenience variant of g_settings_get() for 32-bit unsigned
26223  * integers.
26224  *
26225  * It is a programmer error to give a @key that isn't specified as
26226  * having a uint32 type in the schema for @settings.
26227  *
26228  * Returns: an unsigned integer
26229  * Since: 2.30
26230  */
26231
26232
26233 /**
26234  * g_settings_get_value:
26235  * @settings: a #GSettings object
26236  * @key: the key to get the value for
26237  *
26238  * Gets the value that is stored in @settings for @key.
26239  *
26240  * It is a programmer error to give a @key that isn't contained in the
26241  * schema for @settings.
26242  *
26243  * Returns: a new #GVariant
26244  * Since: 2.26
26245  */
26246
26247
26248 /**
26249  * g_settings_is_writable:
26250  * @settings: a #GSettings object
26251  * @name: the name of a key
26252  *
26253  * Finds out if a key can be written or not
26254  *
26255  * Returns: %TRUE if the key @name is writable
26256  * Since: 2.26
26257  */
26258
26259
26260 /**
26261  * g_settings_list_children:
26262  * @settings: a #GSettings object
26263  *
26264  * Gets the list of children on @settings.
26265  *
26266  * The list is exactly the list of strings for which it is not an error
26267  * to call g_settings_get_child().
26268  *
26269  * For GSettings objects that are lists, this value can change at any
26270  * time and you should connect to the "children-changed" signal to watch
26271  * for those changes.  Note that there is a race condition here: you may
26272  * request a child after listing it only for it to have been destroyed
26273  * in the meantime.  For this reason, g_settings_get_child() may return
26274  * %NULL even for a child that was listed by this function.
26275  *
26276  * For GSettings objects that are not lists, you should probably not be
26277  * calling this function from "normal" code (since you should already
26278  * know what children are in your schema).  This function may still be
26279  * useful there for introspection reasons, however.
26280  *
26281  * You should free the return value with g_strfreev() when you are done
26282  * with it.
26283  *
26284  * Returns: (transfer full) (element-type utf8): a list of the children on @settings
26285  */
26286
26287
26288 /**
26289  * g_settings_list_keys:
26290  * @settings: a #GSettings object
26291  *
26292  * Introspects the list of keys on @settings.
26293  *
26294  * You should probably not be calling this function from "normal" code
26295  * (since you should already know what keys are in your schema).  This
26296  * function is intended for introspection reasons.
26297  *
26298  * You should free the return value with g_strfreev() when you are done
26299  * with it.
26300  *
26301  * Returns: (transfer full) (element-type utf8): a list of the keys on @settings
26302  */
26303
26304
26305 /**
26306  * g_settings_list_relocatable_schemas:
26307  *
26308  * Gets a list of the relocatable #GSettings schemas installed on the
26309  * system.  These are schemas that do not provide their own path.  It is
26310  * usual to instantiate these schemas directly, but if you want to you
26311  * can use g_settings_new_with_path() to specify the path.
26312  *
26313  * The output of this function, taken together with the output of
26314  * g_settings_list_schemas() represents the complete list of all
26315  * installed schemas.
26316  *
26317  * Returns: (element-type utf8) (transfer none): a list of relocatable #GSettings schemas that are available.  The list must not be modified or freed.
26318  * Since: 2.28
26319  */
26320
26321
26322 /**
26323  * g_settings_list_schemas:
26324  *
26325  * Gets a list of the #GSettings schemas installed on the system.  The
26326  * returned list is exactly the list of schemas for which you may call
26327  * g_settings_new() without adverse effects.
26328  *
26329  * This function does not list the schemas that do not provide their own
26330  * paths (ie: schemas for which you must use
26331  * g_settings_new_with_path()).  See
26332  * g_settings_list_relocatable_schemas() for that.
26333  *
26334  * Returns: (element-type utf8) (transfer none): a list of #GSettings schemas that are available.  The list must not be modified or freed.
26335  * Since: 2.26
26336  */
26337
26338
26339 /**
26340  * g_settings_new:
26341  * @schema_id: the id of the schema
26342  *
26343  * Creates a new #GSettings object with the schema specified by
26344  * @schema_id.
26345  *
26346  * Signals on the newly created #GSettings object will be dispatched
26347  * via the thread-default #GMainContext in effect at the time of the
26348  * call to g_settings_new().  The new #GSettings will hold a reference
26349  * on the context.  See g_main_context_push_thread_default().
26350  *
26351  * Returns: a new #GSettings object
26352  * Since: 2.26
26353  */
26354
26355
26356 /**
26357  * g_settings_new_full:
26358  * @schema: a #GSettingsSchema
26359  * @backend: (allow-none): a #GSettingsBackend
26360  * @path: (allow-none): the path to use
26361  *
26362  * Creates a new #GSettings object with a given schema, backend and
26363  * path.
26364  *
26365  * It should be extremely rare that you ever want to use this function.
26366  * It is made available for advanced use-cases (such as plugin systems
26367  * that want to provide access to schemas loaded from custom locations,
26368  * etc).
26369  *
26370  * At the most basic level, a #GSettings object is a pure composition of
26371  * 4 things: a #GSettingsSchema, a #GSettingsBackend, a path within that
26372  * backend, and a #GMainContext to which signals are dispatched.
26373  *
26374  * This constructor therefore gives you full control over constructing
26375  * #GSettings instances.  The first 4 parameters are given directly as
26376  * @schema, @backend and @path, and the main context is taken from the
26377  * thread-default (as per g_settings_new()).
26378  *
26379  * If @backend is %NULL then the default backend is used.
26380  *
26381  * If @path is %NULL then the path from the schema is used.  It is an
26382  * error f @path is %NULL and the schema has no path of its own or if
26383  * @path is non-%NULL and not equal to the path that the schema does
26384  * have.
26385  *
26386  * Returns: a new #GSettings object
26387  * Since: 2.32
26388  */
26389
26390
26391 /**
26392  * g_settings_new_with_backend:
26393  * @schema_id: the id of the schema
26394  * @backend: the #GSettingsBackend to use
26395  *
26396  * Creates a new #GSettings object with the schema specified by
26397  * @schema_id and a given #GSettingsBackend.
26398  *
26399  * Creating a #GSettings object with a different backend allows accessing
26400  * settings from a database other than the usual one. For example, it may make
26401  * sense to pass a backend corresponding to the "defaults" settings database on
26402  * the system to get a settings object that modifies the system default
26403  * settings instead of the settings for this user.
26404  *
26405  * Returns: a new #GSettings object
26406  * Since: 2.26
26407  */
26408
26409
26410 /**
26411  * g_settings_new_with_backend_and_path:
26412  * @schema_id: the id of the schema
26413  * @backend: the #GSettingsBackend to use
26414  * @path: the path to use
26415  *
26416  * Creates a new #GSettings object with the schema specified by
26417  * @schema_id and a given #GSettingsBackend and path.
26418  *
26419  * This is a mix of g_settings_new_with_backend() and
26420  * g_settings_new_with_path().
26421  *
26422  * Returns: a new #GSettings object
26423  * Since: 2.26
26424  */
26425
26426
26427 /**
26428  * g_settings_new_with_path:
26429  * @schema_id: the id of the schema
26430  * @path: the path to use
26431  *
26432  * Creates a new #GSettings object with the relocatable schema specified
26433  * by @schema_id and a given path.
26434  *
26435  * You only need to do this if you want to directly create a settings
26436  * object with a schema that doesn't have a specified path of its own.
26437  * That's quite rare.
26438  *
26439  * It is a programmer error to call this function for a schema that
26440  * has an explicitly specified path.
26441  *
26442  * Returns: a new #GSettings object
26443  * Since: 2.26
26444  */
26445
26446
26447 /**
26448  * g_settings_range_check:
26449  * @settings: a #GSettings
26450  * @key: the key to check
26451  * @value: the value to check
26452  *
26453  * Checks if the given @value is of the correct type and within the
26454  * permitted range for @key.
26455  *
26456  * This API is not intended to be used by normal programs -- they should
26457  * already know what is permitted by their own schemas.  This API is
26458  * meant to be used by programs such as editors or commandline tools.
26459  *
26460  * It is a programmer error to give a @key that isn't contained in the
26461  * schema for @settings.
26462  *
26463  * Returns: %TRUE if @value is valid for @key
26464  * Since: 2.28
26465  */
26466
26467
26468 /**
26469  * g_settings_reset:
26470  * @settings: a #GSettings object
26471  * @key: the name of a key
26472  *
26473  * Resets @key to its default value.
26474  *
26475  * This call resets the key, as much as possible, to its default value.
26476  * That might the value specified in the schema or the one set by the
26477  * administrator.
26478  */
26479
26480
26481 /**
26482  * g_settings_revert:
26483  * @settings: a #GSettings instance
26484  *
26485  * Reverts all non-applied changes to the settings.  This function
26486  * does nothing unless @settings is in 'delay-apply' mode; see
26487  * g_settings_delay().  In the normal case settings are always applied
26488  * immediately.
26489  *
26490  * Change notifications will be emitted for affected keys.
26491  */
26492
26493
26494 /**
26495  * g_settings_schema_get_id:
26496  * @schema: a #GSettingsSchema
26497  *
26498  * Get the ID of @schema.
26499  *
26500  * Returns: (transfer none): the ID
26501  */
26502
26503
26504 /**
26505  * g_settings_schema_get_path:
26506  * @schema: a #GSettingsSchema
26507  *
26508  * Gets the path associated with @schema, or %NULL.
26509  *
26510  * Schemas may be single-instance or relocatable.  Single-instance
26511  * schemas correspond to exactly one set of keys in the backend
26512  * database: those located at the path returned by this function.
26513  *
26514  * Relocatable schemas can be referenced by other schemas and can
26515  * threfore describe multiple sets of keys at different locations.  For
26516  * relocatable schemas, this function will return %NULL.
26517  *
26518  * Returns: (transfer none): the path of the schema, or %NULL
26519  * Since: 2.32
26520  */
26521
26522
26523 /**
26524  * g_settings_schema_ref:
26525  * @schema: a #GSettingsSchema
26526  *
26527  * Increase the reference count of @schema, returning a new reference.
26528  *
26529  * Returns: a new reference to @schema
26530  * Since: 2.32
26531  */
26532
26533
26534 /**
26535  * g_settings_schema_source_get_default:
26536  *
26537  * Gets the default system schema source.
26538  *
26539  * This function is not required for normal uses of #GSettings but it
26540  * may be useful to authors of plugin management systems or to those who
26541  * want to introspect the content of schemas.
26542  *
26543  * If no schemas are installed, %NULL will be returned.
26544  *
26545  * The returned source may actually consist of multiple schema sources
26546  * from different directories, depending on which directories were given
26547  * in <envar>XDG_DATA_DIRS</envar> and
26548  * <envar>GSETTINGS_SCHEMA_DIR</envar>.  For this reason, all lookups
26549  * performed against the default source should probably be done
26550  * recursively.
26551  *
26552  * Returns: (transfer none): the default schema source
26553  * Since: 2.32
26554  */
26555
26556
26557 /**
26558  * g_settings_schema_source_lookup:
26559  * @source: a #GSettingsSchemaSource
26560  * @schema_id: a schema ID
26561  * @recursive: %TRUE if the lookup should be recursive
26562  *
26563  * Looks up a schema with the identifier @schema_id in @source.
26564  *
26565  * This function is not required for normal uses of #GSettings but it
26566  * may be useful to authors of plugin management systems or to those who
26567  * want to introspect the content of schemas.
26568  *
26569  * If the schema isn't found directly in @source and @recursive is %TRUE
26570  * then the parent sources will also be checked.
26571  *
26572  * If the schema isn't found, %NULL is returned.
26573  *
26574  * Returns: (transfer full): a new #GSettingsSchema
26575  * Since: 2.32
26576  */
26577
26578
26579 /**
26580  * g_settings_schema_source_new_from_directory:
26581  * @directory: the filename of a directory
26582  * @parent: (allow-none): a #GSettingsSchemaSource, or %NULL
26583  * @trusted: %TRUE, if the directory is trusted
26584  * @error: a pointer to a #GError pointer set to %NULL, or %NULL
26585  *
26586  * Attempts to create a new schema source corresponding to the contents
26587  * of the given directory.
26588  *
26589  * This function is not required for normal uses of #GSettings but it
26590  * may be useful to authors of plugin management systems.
26591  *
26592  * The directory should contain a file called
26593  * <filename>gschemas.compiled</filename> as produced by
26594  * <command>glib-compile-schemas</command>.
26595  *
26596  * If @trusted is %TRUE then <filename>gschemas.compiled</filename> is
26597  * trusted not to be corrupted.  This assumption has a performance
26598  * advantage, but can result in crashes or inconsistent behaviour in the
26599  * case of a corrupted file.  Generally, you should set @trusted to
26600  * %TRUE for files installed by the system and to %FALSE for files in
26601  * the home directory.
26602  *
26603  * If @parent is non-%NULL then there are two effects.
26604  *
26605  * First, if g_settings_schema_source_lookup() is called with the
26606  * @recursive flag set to %TRUE and the schema can not be found in the
26607  * source, the lookup will recurse to the parent.
26608  *
26609  * Second, any references to other schemas specified within this
26610  * source (ie: <literal>child</literal> or <literal>extends</literal>)
26611  * references may be resolved from the @parent.
26612  *
26613  * For this second reason, except in very unusual situations, the
26614  * @parent should probably be given as the default schema source, as
26615  * returned by g_settings_schema_source_get_default().
26616  *
26617  * Since: 2.32
26618  */
26619
26620
26621 /**
26622  * g_settings_schema_source_ref:
26623  * @source: a #GSettingsSchemaSource
26624  *
26625  * Increase the reference count of @source, returning a new reference.
26626  *
26627  * Returns: a new reference to @source
26628  * Since: 2.32
26629  */
26630
26631
26632 /**
26633  * g_settings_schema_source_unref:
26634  * @source: a #GSettingsSchemaSource
26635  *
26636  * Decrease the reference count of @source, possibly freeing it.
26637  *
26638  * Since: 2.32
26639  */
26640
26641
26642 /**
26643  * g_settings_schema_unref:
26644  * @schema: a #GSettingsSchema
26645  *
26646  * Decrease the reference count of @schema, possibly freeing it.
26647  *
26648  * Since: 2.32
26649  */
26650
26651
26652 /**
26653  * g_settings_set:
26654  * @settings: a #GSettings object
26655  * @key: the name of the key to set
26656  * @format: a #GVariant format string
26657  * @...: arguments as per @format
26658  *
26659  * Sets @key in @settings to @value.
26660  *
26661  * A convenience function that combines g_settings_set_value() with
26662  * g_variant_new().
26663  *
26664  * It is a programmer error to give a @key that isn't contained in the
26665  * schema for @settings or for the #GVariantType of @format to mismatch
26666  * the type given in the schema.
26667  *
26668  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26669  * Since: 2.26
26670  */
26671
26672
26673 /**
26674  * g_settings_set_boolean:
26675  * @settings: a #GSettings object
26676  * @key: the name of the key to set
26677  * @value: the value to set it to
26678  *
26679  * Sets @key in @settings to @value.
26680  *
26681  * A convenience variant of g_settings_set() for booleans.
26682  *
26683  * It is a programmer error to give a @key that isn't specified as
26684  * having a boolean type in the schema for @settings.
26685  *
26686  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26687  * Since: 2.26
26688  */
26689
26690
26691 /**
26692  * g_settings_set_double:
26693  * @settings: a #GSettings object
26694  * @key: the name of the key to set
26695  * @value: the value to set it to
26696  *
26697  * Sets @key in @settings to @value.
26698  *
26699  * A convenience variant of g_settings_set() for doubles.
26700  *
26701  * It is a programmer error to give a @key that isn't specified as
26702  * having a 'double' type in the schema for @settings.
26703  *
26704  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26705  * Since: 2.26
26706  */
26707
26708
26709 /**
26710  * g_settings_set_enum:
26711  * @settings: a #GSettings object
26712  * @key: a key, within @settings
26713  * @value: an enumerated value
26714  *
26715  * Looks up the enumerated type nick for @value and writes it to @key,
26716  * within @settings.
26717  *
26718  * It is a programmer error to give a @key that isn't contained in the
26719  * schema for @settings or is not marked as an enumerated type, or for
26720  * @value not to be a valid value for the named type.
26721  *
26722  * After performing the write, accessing @key directly with
26723  * g_settings_get_string() will return the 'nick' associated with
26724  * @value.
26725  *
26726  * Returns: %TRUE, if the set succeeds
26727  */
26728
26729
26730 /**
26731  * g_settings_set_flags:
26732  * @settings: a #GSettings object
26733  * @key: a key, within @settings
26734  * @value: a flags value
26735  *
26736  * Looks up the flags type nicks for the bits specified by @value, puts
26737  * them in an array of strings and writes the array to @key, within
26738  * @settings.
26739  *
26740  * It is a programmer error to give a @key that isn't contained in the
26741  * schema for @settings or is not marked as a flags type, or for @value
26742  * to contain any bits that are not value for the named type.
26743  *
26744  * After performing the write, accessing @key directly with
26745  * g_settings_get_strv() will return an array of 'nicks'; one for each
26746  * bit in @value.
26747  *
26748  * Returns: %TRUE, if the set succeeds
26749  */
26750
26751
26752 /**
26753  * g_settings_set_int:
26754  * @settings: a #GSettings object
26755  * @key: the name of the key to set
26756  * @value: the value to set it to
26757  *
26758  * Sets @key in @settings to @value.
26759  *
26760  * A convenience variant of g_settings_set() for 32-bit integers.
26761  *
26762  * It is a programmer error to give a @key that isn't specified as
26763  * having a int32 type in the schema for @settings.
26764  *
26765  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26766  * Since: 2.26
26767  */
26768
26769
26770 /**
26771  * g_settings_set_string:
26772  * @settings: a #GSettings object
26773  * @key: the name of the key to set
26774  * @value: the value to set it to
26775  *
26776  * Sets @key in @settings to @value.
26777  *
26778  * A convenience variant of g_settings_set() for strings.
26779  *
26780  * It is a programmer error to give a @key that isn't specified as
26781  * having a string type in the schema for @settings.
26782  *
26783  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26784  * Since: 2.26
26785  */
26786
26787
26788 /**
26789  * g_settings_set_strv:
26790  * @settings: a #GSettings object
26791  * @key: the name of the key to set
26792  * @value: (allow-none) (array zero-terminated=1): the value to set it to, or %NULL
26793  *
26794  * Sets @key in @settings to @value.
26795  *
26796  * A convenience variant of g_settings_set() for string arrays.  If
26797  * @value is %NULL, then @key is set to be the empty array.
26798  *
26799  * It is a programmer error to give a @key that isn't specified as
26800  * having an array of strings type in the schema for @settings.
26801  *
26802  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26803  * Since: 2.26
26804  */
26805
26806
26807 /**
26808  * g_settings_set_uint:
26809  * @settings: a #GSettings object
26810  * @key: the name of the key to set
26811  * @value: the value to set it to
26812  *
26813  * Sets @key in @settings to @value.
26814  *
26815  * A convenience variant of g_settings_set() for 32-bit unsigned
26816  * integers.
26817  *
26818  * It is a programmer error to give a @key that isn't specified as
26819  * having a uint32 type in the schema for @settings.
26820  *
26821  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26822  * Since: 2.30
26823  */
26824
26825
26826 /**
26827  * g_settings_set_value:
26828  * @settings: a #GSettings object
26829  * @key: the name of the key to set
26830  * @value: a #GVariant of the correct type
26831  *
26832  * Sets @key in @settings to @value.
26833  *
26834  * It is a programmer error to give a @key that isn't contained in the
26835  * schema for @settings or for @value to have the incorrect type, per
26836  * the schema.
26837  *
26838  * If @value is floating then this function consumes the reference.
26839  *
26840  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
26841  * Since: 2.26
26842  */
26843
26844
26845 /**
26846  * g_settings_sync:
26847  *
26848  * Ensures that all pending operations for the given are complete for
26849  * the default backend.
26850  *
26851  * Writes made to a #GSettings are handled asynchronously.  For this
26852  * reason, it is very unlikely that the changes have it to disk by the
26853  * time g_settings_set() returns.
26854  *
26855  * This call will block until all of the writes have made it to the
26856  * backend.  Since the mainloop is not running, no change notifications
26857  * will be dispatched during this call (but some may be queued by the
26858  * time the call is done).
26859  */
26860
26861
26862 /**
26863  * g_settings_unbind:
26864  * @object: the object
26865  * @property: the property whose binding is removed
26866  *
26867  * Removes an existing binding for @property on @object.
26868  *
26869  * Note that bindings are automatically removed when the
26870  * object is finalized, so it is rarely necessary to call this
26871  * function.
26872  *
26873  * Since: 2.26
26874  */
26875
26876
26877 /**
26878  * g_simple_action_group_add_entries:
26879  * @simple: a #GSimpleActionGroup
26880  * @entries: (array length=n_entries): a pointer to the first item in an array of #GActionEntry structs
26881  * @n_entries: the length of @entries, or -1
26882  * @user_data: the user data for signal connections
26883  *
26884  * A convenience function for creating multiple #GSimpleAction instances
26885  * and adding them to the action group.
26886  *
26887  * Since: 2.30
26888  */
26889
26890
26891 /**
26892  * g_simple_action_group_insert:
26893  * @simple: a #GSimpleActionGroup
26894  * @action: a #GAction
26895  *
26896  * Adds an action to the action group.
26897  *
26898  * If the action group already contains an action with the same name as
26899  * @action then the old action is dropped from the group.
26900  *
26901  * The action group takes its own reference on @action.
26902  *
26903  * Since: 2.28
26904  */
26905
26906
26907 /**
26908  * g_simple_action_group_lookup:
26909  * @simple: a #GSimpleActionGroup
26910  * @action_name: the name of an action
26911  *
26912  * Looks up the action with the name @action_name in the group.
26913  *
26914  * If no such action exists, returns %NULL.
26915  *
26916  * Returns: (transfer none): a #GAction, or %NULL
26917  * Since: 2.28
26918  */
26919
26920
26921 /**
26922  * g_simple_action_group_new:
26923  *
26924  * Creates a new, empty, #GSimpleActionGroup.
26925  *
26926  * Returns: a new #GSimpleActionGroup
26927  * Since: 2.28
26928  */
26929
26930
26931 /**
26932  * g_simple_action_group_remove:
26933  * @simple: a #GSimpleActionGroup
26934  * @action_name: the name of the action
26935  *
26936  * Removes the named action from the action group.
26937  *
26938  * If no action of this name is in the group then nothing happens.
26939  *
26940  * Since: 2.28
26941  */
26942
26943
26944 /**
26945  * g_simple_action_new:
26946  * @name: the name of the action
26947  * @parameter_type: (allow-none): the type of parameter to the activate function
26948  *
26949  * Creates a new action.
26950  *
26951  * The created action is stateless.  See g_simple_action_new_stateful().
26952  *
26953  * Returns: a new #GSimpleAction
26954  * Since: 2.28
26955  */
26956
26957
26958 /**
26959  * g_simple_action_new_stateful:
26960  * @name: the name of the action
26961  * @parameter_type: (allow-none): the type of the parameter to the activate function
26962  * @state: the initial state of the action
26963  *
26964  * Creates a new stateful action.
26965  *
26966  * @state is the initial state of the action.  All future state values
26967  * must have the same #GVariantType as the initial state.
26968  *
26969  * If the @state GVariant is floating, it is consumed.
26970  *
26971  * Returns: a new #GSimpleAction
26972  * Since: 2.28
26973  */
26974
26975
26976 /**
26977  * g_simple_action_set_enabled:
26978  * @simple: a #GSimpleAction
26979  * @enabled: whether the action is enabled
26980  *
26981  * Sets the action as enabled or not.
26982  *
26983  * An action must be enabled in order to be activated or in order to
26984  * have its state changed from outside callers.
26985  *
26986  * This should only be called by the implementor of the action.  Users
26987  * of the action should not attempt to modify its enabled flag.
26988  *
26989  * Since: 2.28
26990  */
26991
26992
26993 /**
26994  * g_simple_action_set_state:
26995  * @simple: a #GSimpleAction
26996  * @value: the new #GVariant for the state
26997  *
26998  * Sets the state of the action.
26999  *
27000  * This directly updates the 'state' property to the given value.
27001  *
27002  * This should only be called by the implementor of the action.  Users
27003  * of the action should not attempt to directly modify the 'state'
27004  * property.  Instead, they should call g_action_change_state() to
27005  * request the change.
27006  *
27007  * Since: 2.30
27008  */
27009
27010
27011 /**
27012  * g_simple_async_report_error_in_idle: (skip)
27013  * @object: (allow-none): a #GObject, or %NULL.
27014  * @callback: a #GAsyncReadyCallback.
27015  * @user_data: user data passed to @callback.
27016  * @domain: a #GQuark containing the error domain (usually #G_IO_ERROR).
27017  * @code: a specific error code.
27018  * @format: a formatted error reporting string.
27019  * @...: a list of variables to fill in @format.
27020  *
27021  * Reports an error in an asynchronous function in an idle function by
27022  * directly setting the contents of the #GAsyncResult with the given error
27023  * information.
27024  */
27025
27026
27027 /**
27028  * g_simple_async_report_gerror_in_idle:
27029  * @object: (allow-none): a #GObject, or %NULL
27030  * @callback: (scope async): a #GAsyncReadyCallback.
27031  * @user_data: (closure): user data passed to @callback.
27032  * @error: the #GError to report
27033  *
27034  * Reports an error in an idle function. Similar to
27035  * g_simple_async_report_error_in_idle(), but takes a #GError rather
27036  * than building a new one.
27037  */
27038
27039
27040 /**
27041  * g_simple_async_report_take_gerror_in_idle: (skip)
27042  * @object: (allow-none): a #GObject, or %NULL
27043  * @callback: a #GAsyncReadyCallback.
27044  * @user_data: user data passed to @callback.
27045  * @error: the #GError to report
27046  *
27047  * Reports an error in an idle function. Similar to
27048  * g_simple_async_report_gerror_in_idle(), but takes over the caller's
27049  * ownership of @error, so the caller does not have to free it any more.
27050  *
27051  * Since: 2.28
27052  */
27053
27054
27055 /**
27056  * g_simple_async_result_complete:
27057  * @simple: a #GSimpleAsyncResult.
27058  *
27059  * Completes an asynchronous I/O job immediately. Must be called in
27060  * the thread where the asynchronous result was to be delivered, as it
27061  * invokes the callback directly. If you are in a different thread use
27062  * g_simple_async_result_complete_in_idle().
27063  *
27064  * Calling this function takes a reference to @simple for as long as
27065  * is needed to complete the call.
27066  */
27067
27068
27069 /**
27070  * g_simple_async_result_complete_in_idle:
27071  * @simple: a #GSimpleAsyncResult.
27072  *
27073  * Completes an asynchronous function in an idle handler in the <link
27074  * linkend="g-main-context-push-thread-default">thread-default main
27075  * loop</link> of the thread that @simple was initially created in
27076  * (and re-pushes that context around the invocation of the callback).
27077  *
27078  * Calling this function takes a reference to @simple for as long as
27079  * is needed to complete the call.
27080  */
27081
27082
27083 /**
27084  * g_simple_async_result_get_op_res_gboolean:
27085  * @simple: a #GSimpleAsyncResult.
27086  *
27087  * Gets the operation result boolean from within the asynchronous result.
27088  *
27089  * Returns: %TRUE if the operation's result was %TRUE, %FALSE if the operation's result was %FALSE.
27090  */
27091
27092
27093 /**
27094  * g_simple_async_result_get_op_res_gpointer: (skip)
27095  * @simple: a #GSimpleAsyncResult.
27096  *
27097  * Gets a pointer result as returned by the asynchronous function.
27098  *
27099  * Returns: a pointer from the result.
27100  */
27101
27102
27103 /**
27104  * g_simple_async_result_get_op_res_gssize:
27105  * @simple: a #GSimpleAsyncResult.
27106  *
27107  * Gets a gssize from the asynchronous result.
27108  *
27109  * Returns: a gssize returned from the asynchronous function.
27110  */
27111
27112
27113 /**
27114  * g_simple_async_result_get_source_tag: (skip)
27115  * @simple: a #GSimpleAsyncResult.
27116  *
27117  * Gets the source tag for the #GSimpleAsyncResult.
27118  *
27119  * Returns: a #gpointer to the source object for the #GSimpleAsyncResult.
27120  */
27121
27122
27123 /**
27124  * g_simple_async_result_is_valid:
27125  * @result: the #GAsyncResult passed to the _finish function.
27126  * @source: the #GObject passed to the _finish function.
27127  * @source_tag: the asynchronous function.
27128  *
27129  * Ensures that the data passed to the _finish function of an async
27130  * operation is consistent.  Three checks are performed.
27131  *
27132  * First, @result is checked to ensure that it is really a
27133  * #GSimpleAsyncResult.  Second, @source is checked to ensure that it
27134  * matches the source object of @result.  Third, @source_tag is
27135  * checked to ensure that it is either %NULL (as it is when the result was
27136  * created by g_simple_async_report_error_in_idle() or
27137  * g_simple_async_report_gerror_in_idle()) or equal to the
27138  * @source_tag argument given to g_simple_async_result_new() (which, by
27139  * convention, is a pointer to the _async function corresponding to the
27140  * _finish function from which this function is called).
27141  *
27142  * Returns: #TRUE if all checks passed or #FALSE if any failed.
27143  * Since: 2.20
27144  */
27145
27146
27147 /**
27148  * g_simple_async_result_new:
27149  * @source_object: (allow-none): a #GObject, or %NULL.
27150  * @callback: (scope async): a #GAsyncReadyCallback.
27151  * @user_data: (closure): user data passed to @callback.
27152  * @source_tag: the asynchronous function.
27153  *
27154  * Creates a #GSimpleAsyncResult.
27155  *
27156  * The common convention is to create the #GSimpleAsyncResult in the
27157  * function that starts the asynchronous operation and use that same
27158  * function as the @source_tag.
27159  *
27160  * If your operation supports cancellation with #GCancellable (which it
27161  * probably should) then you should provide the user's cancellable to
27162  * g_simple_async_result_set_check_cancellable() immediately after
27163  * this function returns.
27164  *
27165  * Returns: a #GSimpleAsyncResult.
27166  */
27167
27168
27169 /**
27170  * g_simple_async_result_new_error:
27171  * @source_object: (allow-none): a #GObject, or %NULL.
27172  * @callback: (scope async): a #GAsyncReadyCallback.
27173  * @user_data: (closure): user data passed to @callback.
27174  * @domain: a #GQuark.
27175  * @code: an error code.
27176  * @format: a string with format characters.
27177  * @...: a list of values to insert into @format.
27178  *
27179  * Creates a new #GSimpleAsyncResult with a set error.
27180  *
27181  * Returns: a #GSimpleAsyncResult.
27182  */
27183
27184
27185 /**
27186  * g_simple_async_result_new_from_error:
27187  * @source_object: (allow-none): a #GObject, or %NULL.
27188  * @callback: (scope async): a #GAsyncReadyCallback.
27189  * @user_data: (closure): user data passed to @callback.
27190  * @error: a #GError
27191  *
27192  * Creates a #GSimpleAsyncResult from an error condition.
27193  *
27194  * Returns: a #GSimpleAsyncResult.
27195  */
27196
27197
27198 /**
27199  * g_simple_async_result_new_take_error: (skip)
27200  * @source_object: (allow-none): a #GObject, or %NULL
27201  * @callback: (scope async): a #GAsyncReadyCallback
27202  * @user_data: (closure): user data passed to @callback
27203  * @error: a #GError
27204  *
27205  * Creates a #GSimpleAsyncResult from an error condition, and takes over the
27206  * caller's ownership of @error, so the caller does not need to free it anymore.
27207  *
27208  * Returns: a #GSimpleAsyncResult
27209  * Since: 2.28
27210  */
27211
27212
27213 /**
27214  * g_simple_async_result_propagate_error:
27215  * @simple: a #GSimpleAsyncResult.
27216  * @dest: (out): a location to propagate the error to.
27217  *
27218  * Propagates an error from within the simple asynchronous result to
27219  * a given destination.
27220  *
27221  * If the #GCancellable given to a prior call to
27222  * g_simple_async_result_set_check_cancellable() is cancelled then this
27223  * function will return %TRUE with @dest set appropriately.
27224  *
27225  * Returns: %TRUE if the error was propagated to @dest. %FALSE otherwise.
27226  */
27227
27228
27229 /**
27230  * g_simple_async_result_run_in_thread: (skip)
27231  * @simple: a #GSimpleAsyncResult.
27232  * @func: a #GSimpleAsyncThreadFunc.
27233  * @io_priority: the io priority of the request.
27234  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27235  *
27236  * Runs the asynchronous job in a separate thread and then calls
27237  * g_simple_async_result_complete_in_idle() on @simple to return
27238  * the result to the appropriate main loop.
27239  *
27240  * Calling this function takes a reference to @simple for as long as
27241  * is needed to run the job and report its completion.
27242  */
27243
27244
27245 /**
27246  * g_simple_async_result_set_check_cancellable:
27247  * @simple: a #GSimpleAsyncResult
27248  * @check_cancellable: (allow-none): a #GCancellable to check, or %NULL to unset
27249  *
27250  * Sets a #GCancellable to check before dispatching results.
27251  *
27252  * This function has one very specific purpose: the provided cancellable
27253  * is checked at the time of g_simple_async_result_propagate_error() If
27254  * it is cancelled, these functions will return an "Operation was
27255  * cancelled" error (%G_IO_ERROR_CANCELLED).
27256  *
27257  * Implementors of cancellable asynchronous functions should use this in
27258  * order to provide a guarantee to their callers that cancelling an
27259  * async operation will reliably result in an error being returned for
27260  * that operation (even if a positive result for the operation has
27261  * already been sent as an idle to the main context to be dispatched).
27262  *
27263  * The checking described above is done regardless of any call to the
27264  * unrelated g_simple_async_result_set_handle_cancellation() function.
27265  *
27266  * Since: 2.32
27267  */
27268
27269
27270 /**
27271  * g_simple_async_result_set_error: (skip)
27272  * @simple: a #GSimpleAsyncResult.
27273  * @domain: a #GQuark (usually #G_IO_ERROR).
27274  * @code: an error code.
27275  * @format: a formatted error reporting string.
27276  * @...: a list of variables to fill in @format.
27277  *
27278  * Sets an error within the asynchronous result without a #GError.
27279  */
27280
27281
27282 /**
27283  * g_simple_async_result_set_error_va: (skip)
27284  * @simple: a #GSimpleAsyncResult.
27285  * @domain: a #GQuark (usually #G_IO_ERROR).
27286  * @code: an error code.
27287  * @format: a formatted error reporting string.
27288  * @args: va_list of arguments.
27289  *
27290  * Sets an error within the asynchronous result without a #GError.
27291  * Unless writing a binding, see g_simple_async_result_set_error().
27292  */
27293
27294
27295 /**
27296  * g_simple_async_result_set_from_error:
27297  * @simple: a #GSimpleAsyncResult.
27298  * @error: #GError.
27299  *
27300  * Sets the result from a #GError.
27301  */
27302
27303
27304 /**
27305  * g_simple_async_result_set_handle_cancellation:
27306  * @simple: a #GSimpleAsyncResult.
27307  * @handle_cancellation: a #gboolean.
27308  *
27309  * Sets whether to handle cancellation within the asynchronous operation.
27310  *
27311  * This function has nothing to do with
27312  * g_simple_async_result_set_check_cancellable().  It only refers to the
27313  * #GCancellable passed to g_simple_async_result_run_in_thread().
27314  */
27315
27316
27317 /**
27318  * g_simple_async_result_set_op_res_gboolean:
27319  * @simple: a #GSimpleAsyncResult.
27320  * @op_res: a #gboolean.
27321  *
27322  * Sets the operation result to a boolean within the asynchronous result.
27323  */
27324
27325
27326 /**
27327  * g_simple_async_result_set_op_res_gpointer: (skip)
27328  * @simple: a #GSimpleAsyncResult.
27329  * @op_res: a pointer result from an asynchronous function.
27330  * @destroy_op_res: a #GDestroyNotify function.
27331  *
27332  * Sets the operation result within the asynchronous result to a pointer.
27333  */
27334
27335
27336 /**
27337  * g_simple_async_result_set_op_res_gssize:
27338  * @simple: a #GSimpleAsyncResult.
27339  * @op_res: a #gssize.
27340  *
27341  * Sets the operation result within the asynchronous result to
27342  * the given @op_res.
27343  */
27344
27345
27346 /**
27347  * g_simple_async_result_take_error: (skip)
27348  * @simple: a #GSimpleAsyncResult
27349  * @error: a #GError
27350  *
27351  * Sets the result from @error, and takes over the caller's ownership
27352  * of @error, so the caller does not need to free it any more.
27353  *
27354  * Since: 2.28
27355  */
27356
27357
27358 /**
27359  * g_simple_permission_new:
27360  * @allowed: %TRUE if the action is allowed
27361  *
27362  * Creates a new #GPermission instance that represents an action that is
27363  * either always or never allowed.
27364  *
27365  * Returns: the #GSimplePermission, as a #GPermission
27366  * Since: 2.26
27367  */
27368
27369
27370 /**
27371  * g_simple_proxy_resolver_new:
27372  * @default_proxy: (allow-none): the default proxy to use, eg "socks://192.168.1.1"
27373  * @ignore_hosts: (allow-none): an optional list of hosts/IP addresses to not use a proxy for.
27374  *
27375  * Creates a new #GSimpleProxyResolver. See
27376  * #GSimpleProxyResolver:default-proxy and
27377  * #GSimpleProxyResolver:ignore-hosts for more details on how the
27378  * arguments are interpreted.
27379  *
27380  * Returns: a new #GSimpleProxyResolver
27381  * Since: 2.36
27382  */
27383
27384
27385 /**
27386  * g_simple_proxy_resolver_set_default_proxy:
27387  * @resolver: a #GSimpleProxyResolver
27388  * @default_proxy: the default proxy to use
27389  *
27390  * Sets the default proxy on @resolver, to be used for any URIs that
27391  * don't match #GSimpleProxyResolver:ignore-hosts or a proxy set
27392  * via g_simple_proxy_resolver_set_uri_proxy().
27393  *
27394  * If @default_proxy starts with "<literal>socks://</literal>",
27395  * #GSimpleProxyResolver will treat it as referring to all three of
27396  * the <literal>socks5</literal>, <literal>socks4a</literal>, and
27397  * <literal>socks4</literal> proxy types.
27398  *
27399  * Since: 2.36
27400  */
27401
27402
27403 /**
27404  * g_simple_proxy_resolver_set_uri_proxy:
27405  * @resolver: a #GSimpleProxyResolver
27406  * @uri_scheme: the URI scheme to add a proxy for
27407  * @proxy: the proxy to use for @uri_scheme
27408  *
27409  * Adds a URI-scheme-specific proxy to @resolver; URIs whose scheme
27410  * matches @uri_scheme (and which don't match
27411  * #GSimpleProxyResolver:ignore-hosts) will be proxied via @proxy.
27412  *
27413  * As with #GSimpleProxyResolver:default-proxy, if @proxy starts with
27414  * "<literal>socks://</literal>", #GSimpleProxyResolver will treat it
27415  * as referring to all three of the <literal>socks5</literal>,
27416  * <literal>socks4a</literal>, and <literal>socks4</literal> proxy
27417  * types.
27418  *
27419  * Since: 2.36
27420  */
27421
27422
27423 /**
27424  * g_socket_accept:
27425  * @socket: a #GSocket.
27426  * @cancellable: (allow-none): a %GCancellable or %NULL
27427  * @error: #GError for error reporting, or %NULL to ignore.
27428  *
27429  * Accept incoming connections on a connection-based socket. This removes
27430  * the first outstanding connection request from the listening socket and
27431  * creates a #GSocket object for it.
27432  *
27433  * The @socket must be bound to a local address with g_socket_bind() and
27434  * must be listening for incoming connections (g_socket_listen()).
27435  *
27436  * If there are no outstanding connections then the operation will block
27437  * or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
27438  * To be notified of an incoming connection, wait for the %G_IO_IN condition.
27439  *
27440  * Returns: (transfer full): a new #GSocket, or %NULL on error. Free the returned object with g_object_unref().
27441  * Since: 2.22
27442  */
27443
27444
27445 /**
27446  * g_socket_address_enumerator_next:
27447  * @enumerator: a #GSocketAddressEnumerator
27448  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27449  * @error: a #GError.
27450  *
27451  * Retrieves the next #GSocketAddress from @enumerator. Note that this
27452  * may block for some amount of time. (Eg, a #GNetworkAddress may need
27453  * to do a DNS lookup before it can return an address.) Use
27454  * g_socket_address_enumerator_next_async() if you need to avoid
27455  * blocking.
27456  *
27457  * If @enumerator is expected to yield addresses, but for some reason
27458  * is unable to (eg, because of a DNS error), then the first call to
27459  * g_socket_address_enumerator_next() will return an appropriate error
27460  * in *@error. However, if the first call to
27461  * g_socket_address_enumerator_next() succeeds, then any further
27462  * internal errors (other than @cancellable being triggered) will be
27463  * ignored.
27464  *
27465  * 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.
27466  */
27467
27468
27469 /**
27470  * g_socket_address_enumerator_next_async:
27471  * @enumerator: a #GSocketAddressEnumerator
27472  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27473  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
27474  * @user_data: (closure): the data to pass to callback function
27475  *
27476  * Asynchronously retrieves the next #GSocketAddress from @enumerator
27477  * and then calls @callback, which must call
27478  * g_socket_address_enumerator_next_finish() to get the result.
27479  */
27480
27481
27482 /**
27483  * g_socket_address_enumerator_next_finish:
27484  * @enumerator: a #GSocketAddressEnumerator
27485  * @result: a #GAsyncResult
27486  * @error: a #GError
27487  *
27488  * Retrieves the result of a completed call to
27489  * g_socket_address_enumerator_next_async(). See
27490  * g_socket_address_enumerator_next() for more information about
27491  * error handling.
27492  *
27493  * 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.
27494  */
27495
27496
27497 /**
27498  * g_socket_address_get_family:
27499  * @address: a #GSocketAddress
27500  *
27501  * Gets the socket family type of @address.
27502  *
27503  * Returns: the socket family type of @address.
27504  * Since: 2.22
27505  */
27506
27507
27508 /**
27509  * g_socket_address_get_native_size:
27510  * @address: a #GSocketAddress
27511  *
27512  * Gets the size of @address's native <type>struct sockaddr</type>.
27513  * You can use this to allocate memory to pass to
27514  * g_socket_address_to_native().
27515  *
27516  * Returns: the size of the native <type>struct sockaddr</type> that @address represents
27517  * Since: 2.22
27518  */
27519
27520
27521 /**
27522  * g_socket_address_new_from_native:
27523  * @native: a pointer to a <type>struct sockaddr</type>
27524  * @len: the size of the memory location pointed to by @native
27525  *
27526  * Creates a #GSocketAddress subclass corresponding to the native
27527  * <type>struct sockaddr</type> @native.
27528  *
27529  * Returns: a new #GSocketAddress if @native could successfully be converted, otherwise %NULL.
27530  * Since: 2.22
27531  */
27532
27533
27534 /**
27535  * g_socket_address_to_native:
27536  * @address: a #GSocketAddress
27537  * @dest: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
27538  * @destlen: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
27539  * @error: #GError for error reporting, or %NULL to ignore.
27540  *
27541  * Converts a #GSocketAddress to a native <type>struct
27542  * sockaddr</type>, which can be passed to low-level functions like
27543  * connect() or bind().
27544  *
27545  * If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
27546  * returned. If the address type is not known on the system
27547  * then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
27548  *
27549  * Returns: %TRUE if @dest was filled in, %FALSE on error
27550  * Since: 2.22
27551  */
27552
27553
27554 /**
27555  * g_socket_bind:
27556  * @socket: a #GSocket.
27557  * @address: a #GSocketAddress specifying the local address.
27558  * @allow_reuse: whether to allow reusing this address
27559  * @error: #GError for error reporting, or %NULL to ignore.
27560  *
27561  * When a socket is created it is attached to an address family, but it
27562  * doesn't have an address in this family. g_socket_bind() assigns the
27563  * address (sometimes called name) of the socket.
27564  *
27565  * It is generally required to bind to a local address before you can
27566  * receive connections. (See g_socket_listen() and g_socket_accept() ).
27567  * In certain situations, you may also want to bind a socket that will be
27568  * used to initiate connections, though this is not normally required.
27569  *
27570  * @allow_reuse should be %TRUE for server sockets (sockets that you will
27571  * eventually call g_socket_accept() on), and %FALSE for client sockets.
27572  * (Specifically, if it is %TRUE, then g_socket_bind() will set the
27573  * %SO_REUSEADDR flag on the socket, allowing it to bind @address even if
27574  * that address was previously used by another socket that has not yet been
27575  * fully cleaned-up by the kernel. Failing to set this flag on a server
27576  * socket may cause the bind call to return %G_IO_ERROR_ADDRESS_IN_USE if
27577  * the server program is stopped and then immediately restarted.)
27578  *
27579  * Returns: %TRUE on success, %FALSE on error.
27580  * Since: 2.22
27581  */
27582
27583
27584 /**
27585  * g_socket_check_connect_result:
27586  * @socket: a #GSocket
27587  * @error: #GError for error reporting, or %NULL to ignore.
27588  *
27589  * Checks and resets the pending connect error for the socket.
27590  * This is used to check for errors when g_socket_connect() is
27591  * used in non-blocking mode.
27592  *
27593  * Returns: %TRUE if no error, %FALSE otherwise, setting @error to the error
27594  * Since: 2.22
27595  */
27596
27597
27598 /**
27599  * g_socket_client_add_application_proxy:
27600  * @client: a #GSocketClient
27601  * @protocol: The proxy protocol
27602  *
27603  * Enable proxy protocols to be handled by the application. When the
27604  * indicated proxy protocol is returned by the #GProxyResolver,
27605  * #GSocketClient will consider this protocol as supported but will
27606  * not try to find a #GProxy instance to handle handshaking. The
27607  * application must check for this case by calling
27608  * g_socket_connection_get_remote_address() on the returned
27609  * #GSocketConnection, and seeing if it's a #GProxyAddress of the
27610  * appropriate type, to determine whether or not it needs to handle
27611  * the proxy handshaking itself.
27612  *
27613  * This should be used for proxy protocols that are dialects of
27614  * another protocol such as HTTP proxy. It also allows cohabitation of
27615  * proxy protocols that are reused between protocols. A good example
27616  * is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
27617  * be use as generic socket proxy through the HTTP CONNECT method.
27618  *
27619  * When the proxy is detected as being an application proxy, TLS handshake
27620  * will be skipped. This is required to let the application do the proxy
27621  * specific handshake.
27622  */
27623
27624
27625 /**
27626  * g_socket_client_connect:
27627  * @client: a #GSocketClient.
27628  * @connectable: a #GSocketConnectable specifying the remote address.
27629  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27630  * @error: #GError for error reporting, or %NULL to ignore.
27631  *
27632  * Tries to resolve the @connectable and make a network connection to it.
27633  *
27634  * Upon a successful connection, a new #GSocketConnection is constructed
27635  * and returned.  The caller owns this new object and must drop their
27636  * reference to it when finished with it.
27637  *
27638  * The type of the #GSocketConnection object returned depends on the type of
27639  * the underlying socket that is used. For instance, for a TCP/IP connection
27640  * it will be a #GTcpConnection.
27641  *
27642  * The socket created will be the same family as the address that the
27643  * @connectable resolves to, unless family is set with g_socket_client_set_family()
27644  * or indirectly via g_socket_client_set_local_address(). The socket type
27645  * defaults to %G_SOCKET_TYPE_STREAM but can be set with
27646  * g_socket_client_set_socket_type().
27647  *
27648  * If a local address is specified with g_socket_client_set_local_address() the
27649  * socket will be bound to this address before connecting.
27650  *
27651  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27652  * Since: 2.22
27653  */
27654
27655
27656 /**
27657  * g_socket_client_connect_async:
27658  * @client: a #GSocketClient
27659  * @connectable: a #GSocketConnectable specifying the remote address.
27660  * @cancellable: (allow-none): a #GCancellable, or %NULL
27661  * @callback: (scope async): a #GAsyncReadyCallback
27662  * @user_data: (closure): user data for the callback
27663  *
27664  * This is the asynchronous version of g_socket_client_connect().
27665  *
27666  * When the operation is finished @callback will be
27667  * called. You can then call g_socket_client_connect_finish() to get
27668  * the result of the operation.
27669  *
27670  * Since: 2.22
27671  */
27672
27673
27674 /**
27675  * g_socket_client_connect_finish:
27676  * @client: a #GSocketClient.
27677  * @result: a #GAsyncResult.
27678  * @error: a #GError location to store the error occurring, or %NULL to ignore.
27679  *
27680  * Finishes an async connect operation. See g_socket_client_connect_async()
27681  *
27682  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27683  * Since: 2.22
27684  */
27685
27686
27687 /**
27688  * g_socket_client_connect_to_host:
27689  * @client: a #GSocketClient
27690  * @host_and_port: the name and optionally port of the host to connect to
27691  * @default_port: the default port to connect to
27692  * @cancellable: (allow-none): a #GCancellable, or %NULL
27693  * @error: a pointer to a #GError, or %NULL
27694  *
27695  * This is a helper function for g_socket_client_connect().
27696  *
27697  * Attempts to create a TCP connection to the named host.
27698  *
27699  * @host_and_port may be in any of a number of recognized formats; an IPv6
27700  * address, an IPv4 address, or a domain name (in which case a DNS
27701  * lookup is performed).  Quoting with [] is supported for all address
27702  * types.  A port override may be specified in the usual way with a
27703  * colon.  Ports may be given as decimal numbers or symbolic names (in
27704  * which case an /etc/services lookup is performed).
27705  *
27706  * If no port override is given in @host_and_port then @default_port will be
27707  * used as the port number to connect to.
27708  *
27709  * In general, @host_and_port is expected to be provided by the user (allowing
27710  * them to give the hostname, and a port override if necessary) and
27711  * @default_port is expected to be provided by the application.
27712  *
27713  * In the case that an IP address is given, a single connection
27714  * attempt is made.  In the case that a name is given, multiple
27715  * connection attempts may be made, in turn and according to the
27716  * number of address records in DNS, until a connection succeeds.
27717  *
27718  * Upon a successful connection, a new #GSocketConnection is constructed
27719  * and returned.  The caller owns this new object and must drop their
27720  * reference to it when finished with it.
27721  *
27722  * In the event of any failure (DNS error, service not found, no hosts
27723  * connectable) %NULL is returned and @error (if non-%NULL) is set
27724  * accordingly.
27725  *
27726  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27727  * Since: 2.22
27728  */
27729
27730
27731 /**
27732  * g_socket_client_connect_to_host_async:
27733  * @client: a #GSocketClient
27734  * @host_and_port: the name and optionally the port of the host to connect to
27735  * @default_port: the default port to connect to
27736  * @cancellable: (allow-none): a #GCancellable, or %NULL
27737  * @callback: (scope async): a #GAsyncReadyCallback
27738  * @user_data: (closure): user data for the callback
27739  *
27740  * This is the asynchronous version of g_socket_client_connect_to_host().
27741  *
27742  * When the operation is finished @callback will be
27743  * called. You can then call g_socket_client_connect_to_host_finish() to get
27744  * the result of the operation.
27745  *
27746  * Since: 2.22
27747  */
27748
27749
27750 /**
27751  * g_socket_client_connect_to_host_finish:
27752  * @client: a #GSocketClient.
27753  * @result: a #GAsyncResult.
27754  * @error: a #GError location to store the error occurring, or %NULL to ignore.
27755  *
27756  * Finishes an async connect operation. See g_socket_client_connect_to_host_async()
27757  *
27758  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27759  * Since: 2.22
27760  */
27761
27762
27763 /**
27764  * g_socket_client_connect_to_service:
27765  * @client: a #GSocketConnection
27766  * @domain: a domain name
27767  * @service: the name of the service to connect to
27768  * @cancellable: (allow-none): a #GCancellable, or %NULL
27769  * @error: a pointer to a #GError, or %NULL
27770  *
27771  * Attempts to create a TCP connection to a service.
27772  *
27773  * This call looks up the SRV record for @service at @domain for the
27774  * "tcp" protocol.  It then attempts to connect, in turn, to each of
27775  * the hosts providing the service until either a connection succeeds
27776  * or there are no hosts remaining.
27777  *
27778  * Upon a successful connection, a new #GSocketConnection is constructed
27779  * and returned.  The caller owns this new object and must drop their
27780  * reference to it when finished with it.
27781  *
27782  * In the event of any failure (DNS error, service not found, no hosts
27783  * connectable) %NULL is returned and @error (if non-%NULL) is set
27784  * accordingly.
27785  *
27786  * Returns: (transfer full): a #GSocketConnection if successful, or %NULL on error
27787  */
27788
27789
27790 /**
27791  * g_socket_client_connect_to_service_async:
27792  * @client: a #GSocketClient
27793  * @domain: a domain name
27794  * @service: the name of the service to connect to
27795  * @cancellable: (allow-none): a #GCancellable, or %NULL
27796  * @callback: (scope async): a #GAsyncReadyCallback
27797  * @user_data: (closure): user data for the callback
27798  *
27799  * This is the asynchronous version of
27800  * g_socket_client_connect_to_service().
27801  *
27802  * Since: 2.22
27803  */
27804
27805
27806 /**
27807  * g_socket_client_connect_to_service_finish:
27808  * @client: a #GSocketClient.
27809  * @result: a #GAsyncResult.
27810  * @error: a #GError location to store the error occurring, or %NULL to ignore.
27811  *
27812  * Finishes an async connect operation. See g_socket_client_connect_to_service_async()
27813  *
27814  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27815  * Since: 2.22
27816  */
27817
27818
27819 /**
27820  * g_socket_client_connect_to_uri:
27821  * @client: a #GSocketClient
27822  * @uri: A network URI
27823  * @default_port: the default port to connect to
27824  * @cancellable: (allow-none): a #GCancellable, or %NULL
27825  * @error: a pointer to a #GError, or %NULL
27826  *
27827  * This is a helper function for g_socket_client_connect().
27828  *
27829  * Attempts to create a TCP connection with a network URI.
27830  *
27831  * @uri may be any valid URI containing an "authority" (hostname/port)
27832  * component. If a port is not specified in the URI, @default_port
27833  * will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
27834  * (#GSocketClient does not know to automatically assume TLS for
27835  * certain URI schemes.)
27836  *
27837  * Using this rather than g_socket_client_connect() or
27838  * g_socket_client_connect_to_host() allows #GSocketClient to
27839  * determine when to use application-specific proxy protocols.
27840  *
27841  * Upon a successful connection, a new #GSocketConnection is constructed
27842  * and returned.  The caller owns this new object and must drop their
27843  * reference to it when finished with it.
27844  *
27845  * In the event of any failure (DNS error, service not found, no hosts
27846  * connectable) %NULL is returned and @error (if non-%NULL) is set
27847  * accordingly.
27848  *
27849  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27850  * Since: 2.26
27851  */
27852
27853
27854 /**
27855  * g_socket_client_connect_to_uri_async:
27856  * @client: a #GSocketClient
27857  * @uri: a network uri
27858  * @default_port: the default port to connect to
27859  * @cancellable: (allow-none): a #GCancellable, or %NULL
27860  * @callback: (scope async): a #GAsyncReadyCallback
27861  * @user_data: (closure): user data for the callback
27862  *
27863  * This is the asynchronous version of g_socket_client_connect_to_uri().
27864  *
27865  * When the operation is finished @callback will be
27866  * called. You can then call g_socket_client_connect_to_uri_finish() to get
27867  * the result of the operation.
27868  *
27869  * Since: 2.26
27870  */
27871
27872
27873 /**
27874  * g_socket_client_connect_to_uri_finish:
27875  * @client: a #GSocketClient.
27876  * @result: a #GAsyncResult.
27877  * @error: a #GError location to store the error occurring, or %NULL to ignore.
27878  *
27879  * Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
27880  *
27881  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27882  * Since: 2.26
27883  */
27884
27885
27886 /**
27887  * g_socket_client_get_enable_proxy:
27888  * @client: a #GSocketClient.
27889  *
27890  * Gets the proxy enable state; see g_socket_client_set_enable_proxy()
27891  *
27892  * Returns: whether proxying is enabled
27893  * Since: 2.26
27894  */
27895
27896
27897 /**
27898  * g_socket_client_get_family:
27899  * @client: a #GSocketClient.
27900  *
27901  * Gets the socket family of the socket client.
27902  *
27903  * See g_socket_client_set_family() for details.
27904  *
27905  * Returns: a #GSocketFamily
27906  * Since: 2.22
27907  */
27908
27909
27910 /**
27911  * g_socket_client_get_local_address:
27912  * @client: a #GSocketClient.
27913  *
27914  * Gets the local address of the socket client.
27915  *
27916  * See g_socket_client_set_local_address() for details.
27917  *
27918  * Returns: (transfer none): a #GSocketAddress or %NULL. Do not free.
27919  * Since: 2.22
27920  */
27921
27922
27923 /**
27924  * g_socket_client_get_protocol:
27925  * @client: a #GSocketClient
27926  *
27927  * Gets the protocol name type of the socket client.
27928  *
27929  * See g_socket_client_set_protocol() for details.
27930  *
27931  * Returns: a #GSocketProtocol
27932  * Since: 2.22
27933  */
27934
27935
27936 /**
27937  * g_socket_client_get_proxy_resolver:
27938  * @client: a #GSocketClient.
27939  *
27940  * Gets the #GProxyResolver being used by @client. Normally, this will
27941  * be the resolver returned by g_proxy_resolver_get_default(), but you
27942  * can override it with g_socket_client_set_proxy_resolver().
27943  *
27944  * Returns: (transfer none): The #GProxyResolver being used by @client.
27945  * Since: 2.36
27946  */
27947
27948
27949 /**
27950  * g_socket_client_get_socket_type:
27951  * @client: a #GSocketClient.
27952  *
27953  * Gets the socket type of the socket client.
27954  *
27955  * See g_socket_client_set_socket_type() for details.
27956  *
27957  * Returns: a #GSocketFamily
27958  * Since: 2.22
27959  */
27960
27961
27962 /**
27963  * g_socket_client_get_timeout:
27964  * @client: a #GSocketClient
27965  *
27966  * Gets the I/O timeout time for sockets created by @client.
27967  *
27968  * See g_socket_client_set_timeout() for details.
27969  *
27970  * Returns: the timeout in seconds
27971  * Since: 2.26
27972  */
27973
27974
27975 /**
27976  * g_socket_client_get_tls:
27977  * @client: a #GSocketClient.
27978  *
27979  * Gets whether @client creates TLS connections. See
27980  * g_socket_client_set_tls() for details.
27981  *
27982  * Returns: whether @client uses TLS
27983  * Since: 2.28
27984  */
27985
27986
27987 /**
27988  * g_socket_client_get_tls_validation_flags:
27989  * @client: a #GSocketClient.
27990  *
27991  * Gets the TLS validation flags used creating TLS connections via
27992  * @client.
27993  *
27994  * Returns: the TLS validation flags
27995  * Since: 2.28
27996  */
27997
27998
27999 /**
28000  * g_socket_client_new:
28001  *
28002  * Creates a new #GSocketClient with the default options.
28003  *
28004  * Returns: a #GSocketClient. Free the returned object with g_object_unref().
28005  * Since: 2.22
28006  */
28007
28008
28009 /**
28010  * g_socket_client_set_enable_proxy:
28011  * @client: a #GSocketClient.
28012  * @enable: whether to enable proxies
28013  *
28014  * Sets whether or not @client attempts to make connections via a
28015  * proxy server. When enabled (the default), #GSocketClient will use a
28016  * #GProxyResolver to determine if a proxy protocol such as SOCKS is
28017  * needed, and automatically do the necessary proxy negotiation.
28018  *
28019  * See also g_socket_client_set_proxy_resolver().
28020  *
28021  * Since: 2.26
28022  */
28023
28024
28025 /**
28026  * g_socket_client_set_family:
28027  * @client: a #GSocketClient.
28028  * @family: a #GSocketFamily
28029  *
28030  * Sets the socket family of the socket client.
28031  * If this is set to something other than %G_SOCKET_FAMILY_INVALID
28032  * then the sockets created by this object will be of the specified
28033  * family.
28034  *
28035  * This might be useful for instance if you want to force the local
28036  * connection to be an ipv4 socket, even though the address might
28037  * be an ipv6 mapped to ipv4 address.
28038  *
28039  * Since: 2.22
28040  */
28041
28042
28043 /**
28044  * g_socket_client_set_local_address:
28045  * @client: a #GSocketClient.
28046  * @address: (allow-none): a #GSocketAddress, or %NULL
28047  *
28048  * Sets the local address of the socket client.
28049  * The sockets created by this object will bound to the
28050  * specified address (if not %NULL) before connecting.
28051  *
28052  * This is useful if you want to ensure that the local
28053  * side of the connection is on a specific port, or on
28054  * a specific interface.
28055  *
28056  * Since: 2.22
28057  */
28058
28059
28060 /**
28061  * g_socket_client_set_protocol:
28062  * @client: a #GSocketClient.
28063  * @protocol: a #GSocketProtocol
28064  *
28065  * Sets the protocol of the socket client.
28066  * The sockets created by this object will use of the specified
28067  * protocol.
28068  *
28069  * If @protocol is %0 that means to use the default
28070  * protocol for the socket family and type.
28071  *
28072  * Since: 2.22
28073  */
28074
28075
28076 /**
28077  * g_socket_client_set_proxy_resolver:
28078  * @client: a #GSocketClient.
28079  * @proxy_resolver: (allow-none): a #GProxyResolver, or %NULL for the default.
28080  *
28081  * Overrides the #GProxyResolver used by @client. You can call this if
28082  * you want to use specific proxies, rather than using the system
28083  * default proxy settings.
28084  *
28085  * Note that whether or not the proxy resolver is actually used
28086  * depends on the setting of #GSocketClient:enable-proxy, which is not
28087  * changed by this function (but which is %TRUE by default)
28088  *
28089  * Since: 2.36
28090  */
28091
28092
28093 /**
28094  * g_socket_client_set_socket_type:
28095  * @client: a #GSocketClient.
28096  * @type: a #GSocketType
28097  *
28098  * Sets the socket type of the socket client.
28099  * The sockets created by this object will be of the specified
28100  * type.
28101  *
28102  * It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
28103  * as GSocketClient is used for connection oriented services.
28104  *
28105  * Since: 2.22
28106  */
28107
28108
28109 /**
28110  * g_socket_client_set_timeout:
28111  * @client: a #GSocketClient.
28112  * @timeout: the timeout
28113  *
28114  * Sets the I/O timeout for sockets created by @client. @timeout is a
28115  * time in seconds, or 0 for no timeout (the default).
28116  *
28117  * The timeout value affects the initial connection attempt as well,
28118  * so setting this may cause calls to g_socket_client_connect(), etc,
28119  * to fail with %G_IO_ERROR_TIMED_OUT.
28120  *
28121  * Since: 2.26
28122  */
28123
28124
28125 /**
28126  * g_socket_client_set_tls:
28127  * @client: a #GSocketClient.
28128  * @tls: whether to use TLS
28129  *
28130  * Sets whether @client creates TLS (aka SSL) connections. If @tls is
28131  * %TRUE, @client will wrap its connections in a #GTlsClientConnection
28132  * and perform a TLS handshake when connecting.
28133  *
28134  * Note that since #GSocketClient must return a #GSocketConnection,
28135  * but #GTlsClientConnection is not a #GSocketConnection, this
28136  * actually wraps the resulting #GTlsClientConnection in a
28137  * #GTcpWrapperConnection when returning it. You can use
28138  * g_tcp_wrapper_connection_get_base_io_stream() on the return value
28139  * to extract the #GTlsClientConnection.
28140  *
28141  * If you need to modify the behavior of the TLS handshake (eg, by
28142  * setting a client-side certificate to use, or connecting to the
28143  * #GTlsConnection::accept-certificate signal), you can connect to
28144  * @client's #GSocketClient::event signal and wait for it to be
28145  * emitted with %G_SOCKET_CLIENT_TLS_HANDSHAKING, which will give you
28146  * a chance to see the #GTlsClientConnection before the handshake
28147  * starts.
28148  *
28149  * Since: 2.28
28150  */
28151
28152
28153 /**
28154  * g_socket_client_set_tls_validation_flags:
28155  * @client: a #GSocketClient.
28156  * @flags: the validation flags
28157  *
28158  * Sets the TLS validation flags used when creating TLS connections
28159  * via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
28160  *
28161  * Since: 2.28
28162  */
28163
28164
28165 /**
28166  * g_socket_close:
28167  * @socket: a #GSocket
28168  * @error: #GError for error reporting, or %NULL to ignore.
28169  *
28170  * Closes the socket, shutting down any active connection.
28171  *
28172  * Closing a socket does not wait for all outstanding I/O operations
28173  * to finish, so the caller should not rely on them to be guaranteed
28174  * to complete even if the close returns with no error.
28175  *
28176  * Once the socket is closed, all other operations will return
28177  * %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
28178  * return an error.
28179  *
28180  * Sockets will be automatically closed when the last reference
28181  * is dropped, but you might want to call this function to make sure
28182  * resources are released as early as possible.
28183  *
28184  * Beware that due to the way that TCP works, it is possible for
28185  * recently-sent data to be lost if either you close a socket while the
28186  * %G_IO_IN condition is set, or else if the remote connection tries to
28187  * send something to you after you close the socket but before it has
28188  * finished reading all of the data you sent. There is no easy generic
28189  * way to avoid this problem; the easiest fix is to design the network
28190  * protocol such that the client will never send data "out of turn".
28191  * Another solution is for the server to half-close the connection by
28192  * calling g_socket_shutdown() with only the @shutdown_write flag set,
28193  * and then wait for the client to notice this and close its side of the
28194  * connection, after which the server can safely call g_socket_close().
28195  * (This is what #GTcpConnection does if you call
28196  * g_tcp_connection_set_graceful_disconnect(). But of course, this
28197  * only works if the client will close its connection after the server
28198  * does.)
28199  *
28200  * Returns: %TRUE on success, %FALSE on error
28201  * Since: 2.22
28202  */
28203
28204
28205 /**
28206  * g_socket_condition_check:
28207  * @socket: a #GSocket
28208  * @condition: a #GIOCondition mask to check
28209  *
28210  * Checks on the readiness of @socket to perform operations.
28211  * The operations specified in @condition are checked for and masked
28212  * against the currently-satisfied conditions on @socket. The result
28213  * is returned.
28214  *
28215  * Note that on Windows, it is possible for an operation to return
28216  * %G_IO_ERROR_WOULD_BLOCK even immediately after
28217  * g_socket_condition_check() has claimed that the socket is ready for
28218  * writing. Rather than calling g_socket_condition_check() and then
28219  * writing to the socket if it succeeds, it is generally better to
28220  * simply try writing to the socket right away, and try again later if
28221  * the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
28222  *
28223  * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
28224  * these conditions will always be set in the output if they are true.
28225  *
28226  * This call never blocks.
28227  *
28228  * Returns: the @GIOCondition mask of the current state
28229  * Since: 2.22
28230  */
28231
28232
28233 /**
28234  * g_socket_condition_timed_wait:
28235  * @socket: a #GSocket
28236  * @condition: a #GIOCondition mask to wait for
28237  * @timeout: the maximum time (in microseconds) to wait, or -1
28238  * @cancellable: (allow-none): a #GCancellable, or %NULL
28239  * @error: a #GError pointer, or %NULL
28240  *
28241  * Waits for up to @timeout microseconds for @condition to become true
28242  * on @socket. If the condition is met, %TRUE is returned.
28243  *
28244  * If @cancellable is cancelled before the condition is met, or if
28245  * @timeout (or the socket's #GSocket:timeout) is reached before the
28246  * condition is met, then %FALSE is returned and @error, if non-%NULL,
28247  * is set to the appropriate value (%G_IO_ERROR_CANCELLED or
28248  * %G_IO_ERROR_TIMED_OUT).
28249  *
28250  * If you don't want a timeout, use g_socket_condition_wait().
28251  * (Alternatively, you can pass -1 for @timeout.)
28252  *
28253  * Note that although @timeout is in microseconds for consistency with
28254  * other GLib APIs, this function actually only has millisecond
28255  * resolution, and the behavior is undefined if @timeout is not an
28256  * exact number of milliseconds.
28257  *
28258  * Returns: %TRUE if the condition was met, %FALSE otherwise
28259  * Since: 2.32
28260  */
28261
28262
28263 /**
28264  * g_socket_condition_wait:
28265  * @socket: a #GSocket
28266  * @condition: a #GIOCondition mask to wait for
28267  * @cancellable: (allow-none): a #GCancellable, or %NULL
28268  * @error: a #GError pointer, or %NULL
28269  *
28270  * Waits for @condition to become true on @socket. When the condition
28271  * is met, %TRUE is returned.
28272  *
28273  * If @cancellable is cancelled before the condition is met, or if the
28274  * socket has a timeout set and it is reached before the condition is
28275  * met, then %FALSE is returned and @error, if non-%NULL, is set to
28276  * the appropriate value (%G_IO_ERROR_CANCELLED or
28277  * %G_IO_ERROR_TIMED_OUT).
28278  *
28279  * See also g_socket_condition_timed_wait().
28280  *
28281  * Returns: %TRUE if the condition was met, %FALSE otherwise
28282  * Since: 2.22
28283  */
28284
28285
28286 /**
28287  * g_socket_connect:
28288  * @socket: a #GSocket.
28289  * @address: a #GSocketAddress specifying the remote address.
28290  * @cancellable: (allow-none): a %GCancellable or %NULL
28291  * @error: #GError for error reporting, or %NULL to ignore.
28292  *
28293  * Connect the socket to the specified remote address.
28294  *
28295  * For connection oriented socket this generally means we attempt to make
28296  * a connection to the @address. For a connection-less socket it sets
28297  * the default address for g_socket_send() and discards all incoming datagrams
28298  * from other sources.
28299  *
28300  * Generally connection oriented sockets can only connect once, but
28301  * connection-less sockets can connect multiple times to change the
28302  * default address.
28303  *
28304  * If the connect call needs to do network I/O it will block, unless
28305  * non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
28306  * and the user can be notified of the connection finishing by waiting
28307  * for the G_IO_OUT condition. The result of the connection must then be
28308  * checked with g_socket_check_connect_result().
28309  *
28310  * Returns: %TRUE if connected, %FALSE on error.
28311  * Since: 2.22
28312  */
28313
28314
28315 /**
28316  * g_socket_connectable_enumerate:
28317  * @connectable: a #GSocketConnectable
28318  *
28319  * Creates a #GSocketAddressEnumerator for @connectable.
28320  *
28321  * Returns: (transfer full): a new #GSocketAddressEnumerator.
28322  * Since: 2.22
28323  */
28324
28325
28326 /**
28327  * g_socket_connectable_proxy_enumerate:
28328  * @connectable: a #GSocketConnectable
28329  *
28330  * Creates a #GSocketAddressEnumerator for @connectable that will
28331  * return #GProxyAddress<!-- -->es for addresses that you must connect
28332  * to via a proxy.
28333  *
28334  * If @connectable does not implement
28335  * g_socket_connectable_proxy_enumerate(), this will fall back to
28336  * calling g_socket_connectable_enumerate().
28337  *
28338  * Returns: (transfer full): a new #GSocketAddressEnumerator.
28339  * Since: 2.26
28340  */
28341
28342
28343 /**
28344  * g_socket_connection_connect:
28345  * @connection: a #GSocketConnection
28346  * @address: a #GSocketAddress specifying the remote address.
28347  * @cancellable: (allow-none): a %GCancellable or %NULL
28348  * @error: #GError for error reporting, or %NULL to ignore.
28349  *
28350  * Connect @connection to the specified remote address.
28351  *
28352  * Returns: %TRUE if the connection succeeded, %FALSE on error
28353  * Since: 2.32
28354  */
28355
28356
28357 /**
28358  * g_socket_connection_connect_async:
28359  * @connection: a #GSocketConnection
28360  * @address: a #GSocketAddress specifying the remote address.
28361  * @cancellable: (allow-none): a %GCancellable or %NULL
28362  * @callback: (scope async): a #GAsyncReadyCallback
28363  * @user_data: (closure): user data for the callback
28364  *
28365  * Asynchronously connect @connection to the specified remote address.
28366  *
28367  * This clears the #GSocket:blocking flag on @connection's underlying
28368  * socket if it is currently set.
28369  *
28370  * Use g_socket_connection_connect_finish() to retrieve the result.
28371  *
28372  * Since: 2.32
28373  */
28374
28375
28376 /**
28377  * g_socket_connection_connect_finish:
28378  * @connection: a #GSocketConnection
28379  * @result: the #GAsyncResult
28380  * @error: #GError for error reporting, or %NULL to ignore.
28381  *
28382  * Gets the result of a g_socket_connection_connect_async() call.
28383  *
28384  * Returns: %TRUE if the connection succeeded, %FALSE on error
28385  * Since: 2.32
28386  */
28387
28388
28389 /**
28390  * g_socket_connection_factory_create_connection:
28391  * @socket: a #GSocket
28392  *
28393  * Creates a #GSocketConnection subclass of the right type for
28394  * @socket.
28395  *
28396  * Returns: (transfer full): a #GSocketConnection
28397  * Since: 2.22
28398  */
28399
28400
28401 /**
28402  * g_socket_connection_factory_lookup_type:
28403  * @family: a #GSocketFamily
28404  * @type: a #GSocketType
28405  * @protocol_id: a protocol id
28406  *
28407  * Looks up the #GType to be used when creating socket connections on
28408  * sockets with the specified @family, @type and @protocol_id.
28409  *
28410  * If no type is registered, the #GSocketConnection base type is returned.
28411  *
28412  * Returns: a #GType
28413  * Since: 2.22
28414  */
28415
28416
28417 /**
28418  * g_socket_connection_factory_register_type:
28419  * @g_type: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
28420  * @family: a #GSocketFamily
28421  * @type: a #GSocketType
28422  * @protocol: a protocol id
28423  *
28424  * Looks up the #GType to be used when creating socket connections on
28425  * sockets with the specified @family, @type and @protocol.
28426  *
28427  * If no type is registered, the #GSocketConnection base type is returned.
28428  *
28429  * Since: 2.22
28430  */
28431
28432
28433 /**
28434  * g_socket_connection_get_local_address:
28435  * @connection: a #GSocketConnection
28436  * @error: #GError for error reporting, or %NULL to ignore.
28437  *
28438  * Try to get the local address of a socket connection.
28439  *
28440  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28441  * Since: 2.22
28442  */
28443
28444
28445 /**
28446  * g_socket_connection_get_remote_address:
28447  * @connection: a #GSocketConnection
28448  * @error: #GError for error reporting, or %NULL to ignore.
28449  *
28450  * Try to get the remote address of a socket connection.
28451  *
28452  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28453  * Since: 2.22
28454  */
28455
28456
28457 /**
28458  * g_socket_connection_get_socket:
28459  * @connection: a #GSocketConnection
28460  *
28461  * Gets the underlying #GSocket object of the connection.
28462  * This can be useful if you want to do something unusual on it
28463  * not supported by the #GSocketConnection APIs.
28464  *
28465  * Returns: (transfer none): a #GSocketAddress or %NULL on error.
28466  * Since: 2.22
28467  */
28468
28469
28470 /**
28471  * g_socket_connection_is_connected:
28472  * @connection: a #GSocketConnection
28473  *
28474  * Checks if @connection is connected. This is equivalent to calling
28475  * g_socket_is_connected() on @connection's underlying #GSocket.
28476  *
28477  * Returns: whether @connection is connected
28478  * Since: 2.32
28479  */
28480
28481
28482 /**
28483  * g_socket_control_message_deserialize:
28484  * @level: a socket level
28485  * @type: a socket control message type for the given @level
28486  * @size: the size of the data in bytes
28487  * @data: (array length=size) (element-type guint8): pointer to the message data
28488  *
28489  * Tries to deserialize a socket control message of a given
28490  * @level and @type. This will ask all known (to GType) subclasses
28491  * of #GSocketControlMessage if they can understand this kind
28492  * of message and if so deserialize it into a #GSocketControlMessage.
28493  *
28494  * If there is no implementation for this kind of control message, %NULL
28495  * will be returned.
28496  *
28497  * Returns: (transfer full): the deserialized message or %NULL
28498  * Since: 2.22
28499  */
28500
28501
28502 /**
28503  * g_socket_control_message_get_level:
28504  * @message: a #GSocketControlMessage
28505  *
28506  * Returns the "level" (i.e. the originating protocol) of the control message.
28507  * This is often SOL_SOCKET.
28508  *
28509  * Returns: an integer describing the level
28510  * Since: 2.22
28511  */
28512
28513
28514 /**
28515  * g_socket_control_message_get_msg_type:
28516  * @message: a #GSocketControlMessage
28517  *
28518  * Returns the protocol specific type of the control message.
28519  * For instance, for UNIX fd passing this would be SCM_RIGHTS.
28520  *
28521  * Returns: an integer describing the type of control message
28522  * Since: 2.22
28523  */
28524
28525
28526 /**
28527  * g_socket_control_message_get_size:
28528  * @message: a #GSocketControlMessage
28529  *
28530  * Returns the space required for the control message, not including
28531  * headers or alignment.
28532  *
28533  * Returns: The number of bytes required.
28534  * Since: 2.22
28535  */
28536
28537
28538 /**
28539  * g_socket_control_message_serialize:
28540  * @message: a #GSocketControlMessage
28541  * @data: A buffer to write data to
28542  *
28543  * Converts the data in the message to bytes placed in the
28544  * message.
28545  *
28546  * @data is guaranteed to have enough space to fit the size
28547  * returned by g_socket_control_message_get_size() on this
28548  * object.
28549  *
28550  * Since: 2.22
28551  */
28552
28553
28554 /**
28555  * g_socket_create_source: (skip)
28556  * @socket: a #GSocket
28557  * @condition: a #GIOCondition mask to monitor
28558  * @cancellable: (allow-none): a %GCancellable or %NULL
28559  *
28560  * Creates a %GSource that can be attached to a %GMainContext to monitor
28561  * for the availibility of the specified @condition on the socket.
28562  *
28563  * The callback on the source is of the #GSocketSourceFunc type.
28564  *
28565  * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
28566  * these conditions will always be reported output if they are true.
28567  *
28568  * @cancellable if not %NULL can be used to cancel the source, which will
28569  * cause the source to trigger, reporting the current condition (which
28570  * is likely 0 unless cancellation happened at the same time as a
28571  * condition change). You can check for this in the callback using
28572  * g_cancellable_is_cancelled().
28573  *
28574  * If @socket has a timeout set, and it is reached before @condition
28575  * occurs, the source will then trigger anyway, reporting %G_IO_IN or
28576  * %G_IO_OUT depending on @condition. However, @socket will have been
28577  * marked as having had a timeout, and so the next #GSocket I/O method
28578  * you call will then fail with a %G_IO_ERROR_TIMED_OUT.
28579  *
28580  * Returns: (transfer full): a newly allocated %GSource, free with g_source_unref().
28581  * Since: 2.22
28582  */
28583
28584
28585 /**
28586  * g_socket_get_available_bytes:
28587  * @socket: a #GSocket
28588  *
28589  * Get the amount of data pending in the OS input buffer.
28590  *
28591  * Returns: the number of bytes that can be read from the socket without blocking or -1 on error.
28592  * Since: 2.32
28593  */
28594
28595
28596 /**
28597  * g_socket_get_blocking:
28598  * @socket: a #GSocket.
28599  *
28600  * Gets the blocking mode of the socket. For details on blocking I/O,
28601  * see g_socket_set_blocking().
28602  *
28603  * Returns: %TRUE if blocking I/O is used, %FALSE otherwise.
28604  * Since: 2.22
28605  */
28606
28607
28608 /**
28609  * g_socket_get_broadcast:
28610  * @socket: a #GSocket.
28611  *
28612  * Gets the broadcast setting on @socket; if %TRUE,
28613  * it is possible to send packets to broadcast
28614  * addresses or receive from broadcast addresses.
28615  *
28616  * Returns: the broadcast setting on @socket
28617  * Since: 2.32
28618  */
28619
28620
28621 /**
28622  * g_socket_get_credentials:
28623  * @socket: a #GSocket.
28624  * @error: #GError for error reporting, or %NULL to ignore.
28625  *
28626  * Returns the credentials of the foreign process connected to this
28627  * socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
28628  * sockets).
28629  *
28630  * If this operation isn't supported on the OS, the method fails with
28631  * the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
28632  * by reading the %SO_PEERCRED option on the underlying socket.
28633  *
28634  * Other ways to obtain credentials from a foreign peer includes the
28635  * #GUnixCredentialsMessage type and
28636  * g_unix_connection_send_credentials() /
28637  * g_unix_connection_receive_credentials() functions.
28638  *
28639  * Returns: (transfer full): %NULL if @error is set, otherwise a #GCredentials object that must be freed with g_object_unref().
28640  * Since: 2.26
28641  */
28642
28643
28644 /**
28645  * g_socket_get_family:
28646  * @socket: a #GSocket.
28647  *
28648  * Gets the socket family of the socket.
28649  *
28650  * Returns: a #GSocketFamily
28651  * Since: 2.22
28652  */
28653
28654
28655 /**
28656  * g_socket_get_fd:
28657  * @socket: a #GSocket.
28658  *
28659  * Returns the underlying OS socket object. On unix this
28660  * is a socket file descriptor, and on Windows this is
28661  * a Winsock2 SOCKET handle. This may be useful for
28662  * doing platform specific or otherwise unusual operations
28663  * on the socket.
28664  *
28665  * Returns: the file descriptor of the socket.
28666  * Since: 2.22
28667  */
28668
28669
28670 /**
28671  * g_socket_get_keepalive:
28672  * @socket: a #GSocket.
28673  *
28674  * Gets the keepalive mode of the socket. For details on this,
28675  * see g_socket_set_keepalive().
28676  *
28677  * Returns: %TRUE if keepalive is active, %FALSE otherwise.
28678  * Since: 2.22
28679  */
28680
28681
28682 /**
28683  * g_socket_get_listen_backlog:
28684  * @socket: a #GSocket.
28685  *
28686  * Gets the listen backlog setting of the socket. For details on this,
28687  * see g_socket_set_listen_backlog().
28688  *
28689  * Returns: the maximum number of pending connections.
28690  * Since: 2.22
28691  */
28692
28693
28694 /**
28695  * g_socket_get_local_address:
28696  * @socket: a #GSocket.
28697  * @error: #GError for error reporting, or %NULL to ignore.
28698  *
28699  * Try to get the local address of a bound socket. This is only
28700  * useful if the socket has been bound to a local address,
28701  * either explicitly or implicitly when connecting.
28702  *
28703  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28704  * Since: 2.22
28705  */
28706
28707
28708 /**
28709  * g_socket_get_multicast_loopback:
28710  * @socket: a #GSocket.
28711  *
28712  * Gets the multicast loopback setting on @socket; if %TRUE (the
28713  * default), outgoing multicast packets will be looped back to
28714  * multicast listeners on the same host.
28715  *
28716  * Returns: the multicast loopback setting on @socket
28717  * Since: 2.32
28718  */
28719
28720
28721 /**
28722  * g_socket_get_multicast_ttl:
28723  * @socket: a #GSocket.
28724  *
28725  * Gets the multicast time-to-live setting on @socket; see
28726  * g_socket_set_multicast_ttl() for more details.
28727  *
28728  * Returns: the multicast time-to-live setting on @socket
28729  * Since: 2.32
28730  */
28731
28732
28733 /**
28734  * g_socket_get_option:
28735  * @socket: a #GSocket
28736  * @level: the "API level" of the option (eg, <literal>SOL_SOCKET</literal>)
28737  * @optname: the "name" of the option (eg, <literal>SO_BROADCAST</literal>)
28738  * @value: (out): return location for the option value
28739  * @error: #GError for error reporting, or %NULL to ignore.
28740  *
28741  * Gets the value of an integer-valued option on @socket, as with
28742  * <literal>getsockopt ()</literal>. (If you need to fetch a
28743  * non-integer-valued option, you will need to call
28744  * <literal>getsockopt ()</literal> directly.)
28745  *
28746  * The <link linkend="gio-gnetworking.h"><literal>&lt;gio/gnetworking.h&gt;</literal></link>
28747  * header pulls in system headers that will define most of the
28748  * standard/portable socket options. For unusual socket protocols or
28749  * platform-dependent options, you may need to include additional
28750  * headers.
28751  *
28752  * Note that even for socket options that are a single byte in size,
28753  * @value is still a pointer to a #gint variable, not a #guchar;
28754  * g_socket_get_option() will handle the conversion internally.
28755  *
28756  * Returns: success or failure. On failure, @error will be set, and the system error value (<literal>errno</literal> or <literal>WSAGetLastError ()</literal>) will still be set to the result of the <literal>getsockopt ()</literal> call.
28757  * Since: 2.36
28758  */
28759
28760
28761 /**
28762  * g_socket_get_protocol:
28763  * @socket: a #GSocket.
28764  *
28765  * Gets the socket protocol id the socket was created with.
28766  * In case the protocol is unknown, -1 is returned.
28767  *
28768  * Returns: a protocol id, or -1 if unknown
28769  * Since: 2.22
28770  */
28771
28772
28773 /**
28774  * g_socket_get_remote_address:
28775  * @socket: a #GSocket.
28776  * @error: #GError for error reporting, or %NULL to ignore.
28777  *
28778  * Try to get the remove address of a connected socket. This is only
28779  * useful for connection oriented sockets that have been connected.
28780  *
28781  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
28782  * Since: 2.22
28783  */
28784
28785
28786 /**
28787  * g_socket_get_socket_type:
28788  * @socket: a #GSocket.
28789  *
28790  * Gets the socket type of the socket.
28791  *
28792  * Returns: a #GSocketType
28793  * Since: 2.22
28794  */
28795
28796
28797 /**
28798  * g_socket_get_timeout:
28799  * @socket: a #GSocket.
28800  *
28801  * Gets the timeout setting of the socket. For details on this, see
28802  * g_socket_set_timeout().
28803  *
28804  * Returns: the timeout in seconds
28805  * Since: 2.26
28806  */
28807
28808
28809 /**
28810  * g_socket_get_ttl:
28811  * @socket: a #GSocket.
28812  *
28813  * Gets the unicast time-to-live setting on @socket; see
28814  * g_socket_set_ttl() for more details.
28815  *
28816  * Returns: the time-to-live setting on @socket
28817  * Since: 2.32
28818  */
28819
28820
28821 /**
28822  * g_socket_is_closed:
28823  * @socket: a #GSocket
28824  *
28825  * Checks whether a socket is closed.
28826  *
28827  * Returns: %TRUE if socket is closed, %FALSE otherwise
28828  * Since: 2.22
28829  */
28830
28831
28832 /**
28833  * g_socket_is_connected:
28834  * @socket: a #GSocket.
28835  *
28836  * Check whether the socket is connected. This is only useful for
28837  * connection-oriented sockets.
28838  *
28839  * Returns: %TRUE if socket is connected, %FALSE otherwise.
28840  * Since: 2.22
28841  */
28842
28843
28844 /**
28845  * g_socket_join_multicast_group:
28846  * @socket: a #GSocket.
28847  * @group: a #GInetAddress specifying the group address to join.
28848  * @iface: (allow-none): Name of the interface to use, or %NULL
28849  * @source_specific: %TRUE if source-specific multicast should be used
28850  * @error: #GError for error reporting, or %NULL to ignore.
28851  *
28852  * Registers @socket to receive multicast messages sent to @group.
28853  * @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have
28854  * been bound to an appropriate interface and port with
28855  * g_socket_bind().
28856  *
28857  * If @iface is %NULL, the system will automatically pick an interface
28858  * to bind to based on @group.
28859  *
28860  * If @source_specific is %TRUE, source-specific multicast as defined
28861  * in RFC 4604 is used. Note that on older platforms this may fail
28862  * with a %G_IO_ERROR_NOT_SUPPORTED error.
28863  *
28864  * Returns: %TRUE on success, %FALSE on error.
28865  * Since: 2.32
28866  */
28867
28868
28869 /**
28870  * g_socket_leave_multicast_group:
28871  * @socket: a #GSocket.
28872  * @group: a #GInetAddress specifying the group address to leave.
28873  * @iface: (allow-none): Interface used
28874  * @source_specific: %TRUE if source-specific multicast was used
28875  * @error: #GError for error reporting, or %NULL to ignore.
28876  *
28877  * Removes @socket from the multicast group defined by @group, @iface,
28878  * and @source_specific (which must all have the same values they had
28879  * when you joined the group).
28880  *
28881  * @socket remains bound to its address and port, and can still receive
28882  * unicast messages after calling this.
28883  *
28884  * Returns: %TRUE on success, %FALSE on error.
28885  * Since: 2.32
28886  */
28887
28888
28889 /**
28890  * g_socket_listen:
28891  * @socket: a #GSocket.
28892  * @error: #GError for error reporting, or %NULL to ignore.
28893  *
28894  * Marks the socket as a server socket, i.e. a socket that is used
28895  * to accept incoming requests using g_socket_accept().
28896  *
28897  * Before calling this the socket must be bound to a local address using
28898  * g_socket_bind().
28899  *
28900  * To set the maximum amount of outstanding clients, use
28901  * g_socket_set_listen_backlog().
28902  *
28903  * Returns: %TRUE on success, %FALSE on error.
28904  * Since: 2.22
28905  */
28906
28907
28908 /**
28909  * g_socket_listener_accept:
28910  * @listener: a #GSocketListener
28911  * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL
28912  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28913  * @error: #GError for error reporting, or %NULL to ignore.
28914  *
28915  * Blocks waiting for a client to connect to any of the sockets added
28916  * to the listener. Returns a #GSocketConnection for the socket that was
28917  * accepted.
28918  *
28919  * If @source_object is not %NULL it will be filled out with the source
28920  * object specified when the corresponding socket or address was added
28921  * to the listener.
28922  *
28923  * If @cancellable is not %NULL, then the operation can be cancelled by
28924  * triggering the cancellable object from another thread. If the operation
28925  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
28926  *
28927  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28928  * Since: 2.22
28929  */
28930
28931
28932 /**
28933  * g_socket_listener_accept_async:
28934  * @listener: a #GSocketListener
28935  * @cancellable: (allow-none): a #GCancellable, or %NULL
28936  * @callback: (scope async): a #GAsyncReadyCallback
28937  * @user_data: (closure): user data for the callback
28938  *
28939  * This is the asynchronous version of g_socket_listener_accept().
28940  *
28941  * When the operation is finished @callback will be
28942  * called. You can then call g_socket_listener_accept_socket()
28943  * to get the result of the operation.
28944  *
28945  * Since: 2.22
28946  */
28947
28948
28949 /**
28950  * g_socket_listener_accept_finish:
28951  * @listener: a #GSocketListener
28952  * @result: a #GAsyncResult.
28953  * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
28954  * @error: a #GError location to store the error occurring, or %NULL to ignore.
28955  *
28956  * Finishes an async accept operation. See g_socket_listener_accept_async()
28957  *
28958  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
28959  * Since: 2.22
28960  */
28961
28962
28963 /**
28964  * g_socket_listener_accept_socket:
28965  * @listener: a #GSocketListener
28966  * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL.
28967  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
28968  * @error: #GError for error reporting, or %NULL to ignore.
28969  *
28970  * Blocks waiting for a client to connect to any of the sockets added
28971  * to the listener. Returns the #GSocket that was accepted.
28972  *
28973  * If you want to accept the high-level #GSocketConnection, not a #GSocket,
28974  * which is often the case, then you should use g_socket_listener_accept()
28975  * instead.
28976  *
28977  * If @source_object is not %NULL it will be filled out with the source
28978  * object specified when the corresponding socket or address was added
28979  * to the listener.
28980  *
28981  * If @cancellable is not %NULL, then the operation can be cancelled by
28982  * triggering the cancellable object from another thread. If the operation
28983  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
28984  *
28985  * Returns: (transfer full): a #GSocket on success, %NULL on error.
28986  * Since: 2.22
28987  */
28988
28989
28990 /**
28991  * g_socket_listener_accept_socket_async:
28992  * @listener: a #GSocketListener
28993  * @cancellable: (allow-none): a #GCancellable, or %NULL
28994  * @callback: (scope async): a #GAsyncReadyCallback
28995  * @user_data: (closure): user data for the callback
28996  *
28997  * This is the asynchronous version of g_socket_listener_accept_socket().
28998  *
28999  * When the operation is finished @callback will be
29000  * called. You can then call g_socket_listener_accept_socket_finish()
29001  * to get the result of the operation.
29002  *
29003  * Since: 2.22
29004  */
29005
29006
29007 /**
29008  * g_socket_listener_accept_socket_finish:
29009  * @listener: a #GSocketListener
29010  * @result: a #GAsyncResult.
29011  * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
29012  * @error: a #GError location to store the error occurring, or %NULL to ignore.
29013  *
29014  * Finishes an async accept operation. See g_socket_listener_accept_socket_async()
29015  *
29016  * Returns: (transfer full): a #GSocket on success, %NULL on error.
29017  * Since: 2.22
29018  */
29019
29020
29021 /**
29022  * g_socket_listener_add_address:
29023  * @listener: a #GSocketListener
29024  * @address: a #GSocketAddress
29025  * @type: a #GSocketType
29026  * @protocol: a #GSocketProtocol
29027  * @source_object: (allow-none): Optional #GObject identifying this source
29028  * @effective_address: (out) (allow-none): location to store the address that was bound to, or %NULL.
29029  * @error: #GError for error reporting, or %NULL to ignore.
29030  *
29031  * Creates a socket of type @type and protocol @protocol, binds
29032  * it to @address and adds it to the set of sockets we're accepting
29033  * sockets from.
29034  *
29035  * Note that adding an IPv6 address, depending on the platform,
29036  * may or may not result in a listener that also accepts IPv4
29037  * connections.  For more deterministic behavior, see
29038  * g_socket_listener_add_inet_port().
29039  *
29040  * @source_object will be passed out in the various calls
29041  * to accept to identify this particular source, which is
29042  * useful if you're listening on multiple addresses and do
29043  * different things depending on what address is connected to.
29044  *
29045  * If successful and @effective_address is non-%NULL then it will
29046  * be set to the address that the binding actually occurred at.  This
29047  * is helpful for determining the port number that was used for when
29048  * requesting a binding to port 0 (ie: "any port").  This address, if
29049  * requested, belongs to the caller and must be freed.
29050  *
29051  * Returns: %TRUE on success, %FALSE on error.
29052  * Since: 2.22
29053  */
29054
29055
29056 /**
29057  * g_socket_listener_add_any_inet_port:
29058  * @listener: a #GSocketListener
29059  * @source_object: (allow-none): Optional #GObject identifying this source
29060  * @error: a #GError location to store the error occurring, or %NULL to ignore.
29061  *
29062  * Listens for TCP connections on any available port number for both
29063  * IPv6 and IPv4 (if each is available).
29064  *
29065  * This is useful if you need to have a socket for incoming connections
29066  * but don't care about the specific port number.
29067  *
29068  * @source_object will be passed out in the various calls
29069  * to accept to identify this particular source, which is
29070  * useful if you're listening on multiple addresses and do
29071  * different things depending on what address is connected to.
29072  *
29073  * Returns: the port number, or 0 in case of failure.
29074  * Since: 2.24
29075  */
29076
29077
29078 /**
29079  * g_socket_listener_add_inet_port:
29080  * @listener: a #GSocketListener
29081  * @port: an IP port number (non-zero)
29082  * @source_object: (allow-none): Optional #GObject identifying this source
29083  * @error: #GError for error reporting, or %NULL to ignore.
29084  *
29085  * Helper function for g_socket_listener_add_address() that
29086  * creates a TCP/IP socket listening on IPv4 and IPv6 (if
29087  * supported) on the specified port on all interfaces.
29088  *
29089  * @source_object will be passed out in the various calls
29090  * to accept to identify this particular source, which is
29091  * useful if you're listening on multiple addresses and do
29092  * different things depending on what address is connected to.
29093  *
29094  * Returns: %TRUE on success, %FALSE on error.
29095  * Since: 2.22
29096  */
29097
29098
29099 /**
29100  * g_socket_listener_add_socket:
29101  * @listener: a #GSocketListener
29102  * @socket: a listening #GSocket
29103  * @source_object: (allow-none): Optional #GObject identifying this source
29104  * @error: #GError for error reporting, or %NULL to ignore.
29105  *
29106  * Adds @socket to the set of sockets that we try to accept
29107  * new clients from. The socket must be bound to a local
29108  * address and listened to.
29109  *
29110  * @source_object will be passed out in the various calls
29111  * to accept to identify this particular source, which is
29112  * useful if you're listening on multiple addresses and do
29113  * different things depending on what address is connected to.
29114  *
29115  * Returns: %TRUE on success, %FALSE on error.
29116  * Since: 2.22
29117  */
29118
29119
29120 /**
29121  * g_socket_listener_close:
29122  * @listener: a #GSocketListener
29123  *
29124  * Closes all the sockets in the listener.
29125  *
29126  * Since: 2.22
29127  */
29128
29129
29130 /**
29131  * g_socket_listener_new:
29132  *
29133  * Creates a new #GSocketListener with no sockets to listen for.
29134  * New listeners can be added with e.g. g_socket_listener_add_address()
29135  * or g_socket_listener_add_inet_port().
29136  *
29137  * Returns: a new #GSocketListener.
29138  * Since: 2.22
29139  */
29140
29141
29142 /**
29143  * g_socket_listener_set_backlog:
29144  * @listener: a #GSocketListener
29145  * @listen_backlog: an integer
29146  *
29147  * Sets the listen backlog on the sockets in the listener.
29148  *
29149  * See g_socket_set_listen_backlog() for details
29150  *
29151  * Since: 2.22
29152  */
29153
29154
29155 /**
29156  * g_socket_new:
29157  * @family: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
29158  * @type: the socket type to use.
29159  * @protocol: the id of the protocol to use, or 0 for default.
29160  * @error: #GError for error reporting, or %NULL to ignore.
29161  *
29162  * Creates a new #GSocket with the defined family, type and protocol.
29163  * If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
29164  * for the family and type is used.
29165  *
29166  * The @protocol is a family and type specific int that specifies what
29167  * kind of protocol to use. #GSocketProtocol lists several common ones.
29168  * Many families only support one protocol, and use 0 for this, others
29169  * support several and using 0 means to use the default protocol for
29170  * the family and type.
29171  *
29172  * The protocol id is passed directly to the operating
29173  * system, so you can use protocols not listed in #GSocketProtocol if you
29174  * know the protocol number used for it.
29175  *
29176  * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29177  * Since: 2.22
29178  */
29179
29180
29181 /**
29182  * g_socket_new_from_fd:
29183  * @fd: a native socket file descriptor.
29184  * @error: #GError for error reporting, or %NULL to ignore.
29185  *
29186  * Creates a new #GSocket from a native file descriptor
29187  * or winsock SOCKET handle.
29188  *
29189  * This reads all the settings from the file descriptor so that
29190  * all properties should work. Note that the file descriptor
29191  * will be set to non-blocking mode, independent on the blocking
29192  * mode of the #GSocket.
29193  *
29194  * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
29195  * Since: 2.22
29196  */
29197
29198
29199 /**
29200  * g_socket_receive:
29201  * @socket: a #GSocket
29202  * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
29203  * @size: the number of bytes you want to read from the socket
29204  * @cancellable: (allow-none): a %GCancellable or %NULL
29205  * @error: #GError for error reporting, or %NULL to ignore.
29206  *
29207  * Receive data (up to @size bytes) from a socket. This is mainly used by
29208  * connection-oriented sockets; it is identical to g_socket_receive_from()
29209  * with @address set to %NULL.
29210  *
29211  * For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
29212  * g_socket_receive() will always read either 0 or 1 complete messages from
29213  * the socket. If the received message is too large to fit in @buffer, then
29214  * the data beyond @size bytes will be discarded, without any explicit
29215  * indication that this has occurred.
29216  *
29217  * For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
29218  * number of bytes, up to @size. If more than @size bytes have been
29219  * received, the additional data will be returned in future calls to
29220  * g_socket_receive().
29221  *
29222  * If the socket is in blocking mode the call will block until there
29223  * is some data to receive, the connection is closed, or there is an
29224  * error. If there is no data available and the socket is in
29225  * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29226  * returned. To be notified when data is available, wait for the
29227  * %G_IO_IN condition.
29228  *
29229  * On error -1 is returned and @error is set accordingly.
29230  *
29231  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29232  * Since: 2.22
29233  */
29234
29235
29236 /**
29237  * g_socket_receive_from:
29238  * @socket: a #GSocket
29239  * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29240  * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
29241  * @size: the number of bytes you want to read from the socket
29242  * @cancellable: (allow-none): a %GCancellable or %NULL
29243  * @error: #GError for error reporting, or %NULL to ignore.
29244  *
29245  * Receive data (up to @size bytes) from a socket.
29246  *
29247  * If @address is non-%NULL then @address will be set equal to the
29248  * source address of the received packet.
29249  * @address is owned by the caller.
29250  *
29251  * See g_socket_receive() for additional information.
29252  *
29253  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29254  * Since: 2.22
29255  */
29256
29257
29258 /**
29259  * g_socket_receive_message:
29260  * @socket: a #GSocket
29261  * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
29262  * @vectors: (array length=num_vectors): an array of #GInputVector structs
29263  * @num_vectors: the number of elements in @vectors, or -1
29264  * @messages: (array length=num_messages) (allow-none): a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
29265  * @num_messages: a pointer which will be filled with the number of elements in @messages, or %NULL
29266  * @flags: a pointer to an int containing #GSocketMsgFlags flags
29267  * @cancellable: (allow-none): a %GCancellable or %NULL
29268  * @error: a #GError pointer, or %NULL
29269  *
29270  * Receive data from a socket.  This is the most complicated and
29271  * fully-featured version of this call. For easier use, see
29272  * g_socket_receive() and g_socket_receive_from().
29273  *
29274  * If @address is non-%NULL then @address will be set equal to the
29275  * source address of the received packet.
29276  * @address is owned by the caller.
29277  *
29278  * @vector must point to an array of #GInputVector structs and
29279  * @num_vectors must be the length of this array.  These structs
29280  * describe the buffers that received data will be scattered into.
29281  * If @num_vectors is -1, then @vectors is assumed to be terminated
29282  * by a #GInputVector with a %NULL buffer pointer.
29283  *
29284  * As a special case, if @num_vectors is 0 (in which case, @vectors
29285  * may of course be %NULL), then a single byte is received and
29286  * discarded. This is to facilitate the common practice of sending a
29287  * single '\0' byte for the purposes of transferring ancillary data.
29288  *
29289  * @messages, if non-%NULL, will be set to point to a newly-allocated
29290  * array of #GSocketControlMessage instances or %NULL if no such
29291  * messages was received. These correspond to the control messages
29292  * received from the kernel, one #GSocketControlMessage per message
29293  * from the kernel. This array is %NULL-terminated and must be freed
29294  * by the caller using g_free() after calling g_object_unref() on each
29295  * element. If @messages is %NULL, any control messages received will
29296  * be discarded.
29297  *
29298  * @num_messages, if non-%NULL, will be set to the number of control
29299  * messages received.
29300  *
29301  * If both @messages and @num_messages are non-%NULL, then
29302  * @num_messages gives the number of #GSocketControlMessage instances
29303  * in @messages (ie: not including the %NULL terminator).
29304  *
29305  * @flags is an in/out parameter. The commonly available arguments
29306  * for this are available in the #GSocketMsgFlags enum, but the
29307  * values there are the same as the system values, and the flags
29308  * are passed in as-is, so you can pass in system-specific flags too
29309  * (and g_socket_receive_message() may pass system-specific flags out).
29310  *
29311  * As with g_socket_receive(), data may be discarded if @socket is
29312  * %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
29313  * provide enough buffer space to read a complete message. You can pass
29314  * %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
29315  * removing it from the receive queue, but there is no portable way to find
29316  * out the length of the message other than by reading it into a
29317  * sufficiently-large buffer.
29318  *
29319  * If the socket is in blocking mode the call will block until there
29320  * is some data to receive, the connection is closed, or there is an
29321  * error. If there is no data available and the socket is in
29322  * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
29323  * returned. To be notified when data is available, wait for the
29324  * %G_IO_IN condition.
29325  *
29326  * On error -1 is returned and @error is set accordingly.
29327  *
29328  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29329  * Since: 2.22
29330  */
29331
29332
29333 /**
29334  * g_socket_receive_with_blocking:
29335  * @socket: a #GSocket
29336  * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
29337  * @size: the number of bytes you want to read from the socket
29338  * @blocking: whether to do blocking or non-blocking I/O
29339  * @cancellable: (allow-none): a %GCancellable or %NULL
29340  * @error: #GError for error reporting, or %NULL to ignore.
29341  *
29342  * This behaves exactly the same as g_socket_receive(), except that
29343  * the choice of blocking or non-blocking behavior is determined by
29344  * the @blocking argument rather than by @socket's properties.
29345  *
29346  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
29347  * Since: 2.26
29348  */
29349
29350
29351 /**
29352  * g_socket_send:
29353  * @socket: a #GSocket
29354  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29355  * @size: the number of bytes to send
29356  * @cancellable: (allow-none): a %GCancellable or %NULL
29357  * @error: #GError for error reporting, or %NULL to ignore.
29358  *
29359  * Tries to send @size bytes from @buffer on the socket. This is
29360  * mainly used by connection-oriented sockets; it is identical to
29361  * g_socket_send_to() with @address set to %NULL.
29362  *
29363  * If the socket is in blocking mode the call will block until there is
29364  * space for the data in the socket queue. If there is no space available
29365  * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
29366  * will be returned. To be notified when space is available, wait for the
29367  * %G_IO_OUT condition. Note though that you may still receive
29368  * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
29369  * notified of a %G_IO_OUT condition. (On Windows in particular, this is
29370  * very common due to the way the underlying APIs work.)
29371  *
29372  * On error -1 is returned and @error is set accordingly.
29373  *
29374  * Returns: Number of bytes written (which may be less than @size), or -1 on error
29375  * Since: 2.22
29376  */
29377
29378
29379 /**
29380  * g_socket_send_message:
29381  * @socket: a #GSocket
29382  * @address: (allow-none): a #GSocketAddress, or %NULL
29383  * @vectors: (array length=num_vectors): an array of #GOutputVector structs
29384  * @num_vectors: the number of elements in @vectors, or -1
29385  * @messages: (array length=num_messages) (allow-none): a pointer to an array of #GSocketControlMessages, or %NULL.
29386  * @num_messages: number of elements in @messages, or -1.
29387  * @flags: an int containing #GSocketMsgFlags flags
29388  * @cancellable: (allow-none): a %GCancellable or %NULL
29389  * @error: #GError for error reporting, or %NULL to ignore.
29390  *
29391  * Send data to @address on @socket.  This is the most complicated and
29392  * fully-featured version of this call. For easier use, see
29393  * g_socket_send() and g_socket_send_to().
29394  *
29395  * If @address is %NULL then the message is sent to the default receiver
29396  * (set by g_socket_connect()).
29397  *
29398  * @vectors must point to an array of #GOutputVector structs and
29399  * @num_vectors must be the length of this array. (If @num_vectors is -1,
29400  * then @vectors is assumed to be terminated by a #GOutputVector with a
29401  * %NULL buffer pointer.) The #GOutputVector structs describe the buffers
29402  * that the sent data will be gathered from. Using multiple
29403  * #GOutputVector<!-- -->s is more memory-efficient than manually copying
29404  * data from multiple sources into a single buffer, and more
29405  * network-efficient than making multiple calls to g_socket_send().
29406  *
29407  * @messages, if non-%NULL, is taken to point to an array of @num_messages
29408  * #GSocketControlMessage instances. These correspond to the control
29409  * messages to be sent on the socket.
29410  * If @num_messages is -1 then @messages is treated as a %NULL-terminated
29411  * array.
29412  *
29413  * @flags modify how the message is sent. The commonly available arguments
29414  * for this are available in the #GSocketMsgFlags enum, but the
29415  * values there are the same as the system values, and the flags
29416  * are passed in as-is, so you can pass in system-specific flags too.
29417  *
29418  * If the socket is in blocking mode the call will block until there is
29419  * space for the data in the socket queue. If there is no space available
29420  * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
29421  * will be returned. To be notified when space is available, wait for the
29422  * %G_IO_OUT condition. Note though that you may still receive
29423  * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
29424  * notified of a %G_IO_OUT condition. (On Windows in particular, this is
29425  * very common due to the way the underlying APIs work.)
29426  *
29427  * On error -1 is returned and @error is set accordingly.
29428  *
29429  * Returns: Number of bytes written (which may be less than @size), or -1 on error
29430  * Since: 2.22
29431  */
29432
29433
29434 /**
29435  * g_socket_send_to:
29436  * @socket: a #GSocket
29437  * @address: (allow-none): a #GSocketAddress, or %NULL
29438  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29439  * @size: the number of bytes to send
29440  * @cancellable: (allow-none): a %GCancellable or %NULL
29441  * @error: #GError for error reporting, or %NULL to ignore.
29442  *
29443  * Tries to send @size bytes from @buffer to @address. If @address is
29444  * %NULL then the message is sent to the default receiver (set by
29445  * g_socket_connect()).
29446  *
29447  * See g_socket_send() for additional information.
29448  *
29449  * Returns: Number of bytes written (which may be less than @size), or -1 on error
29450  * Since: 2.22
29451  */
29452
29453
29454 /**
29455  * g_socket_send_with_blocking:
29456  * @socket: a #GSocket
29457  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
29458  * @size: the number of bytes to send
29459  * @blocking: whether to do blocking or non-blocking I/O
29460  * @cancellable: (allow-none): a %GCancellable or %NULL
29461  * @error: #GError for error reporting, or %NULL to ignore.
29462  *
29463  * This behaves exactly the same as g_socket_send(), except that
29464  * the choice of blocking or non-blocking behavior is determined by
29465  * the @blocking argument rather than by @socket's properties.
29466  *
29467  * Returns: Number of bytes written (which may be less than @size), or -1 on error
29468  * Since: 2.26
29469  */
29470
29471
29472 /**
29473  * g_socket_service_is_active:
29474  * @service: a #GSocketService
29475  *
29476  * Check whether the service is active or not. An active
29477  * service will accept new clients that connect, while
29478  * a non-active service will let connecting clients queue
29479  * up until the service is started.
29480  *
29481  * Returns: %TRUE if the service is active, %FALSE otherwise
29482  * Since: 2.22
29483  */
29484
29485
29486 /**
29487  * g_socket_service_new:
29488  *
29489  * Creates a new #GSocketService with no sockets to listen for.
29490  * New listeners can be added with e.g. g_socket_listener_add_address()
29491  * or g_socket_listener_add_inet_port().
29492  *
29493  * Returns: a new #GSocketService.
29494  * Since: 2.22
29495  */
29496
29497
29498 /**
29499  * g_socket_service_start:
29500  * @service: a #GSocketService
29501  *
29502  * Starts the service, i.e. start accepting connections
29503  * from the added sockets when the mainloop runs.
29504  *
29505  * This call is thread-safe, so it may be called from a thread
29506  * handling an incoming client request.
29507  *
29508  * Since: 2.22
29509  */
29510
29511
29512 /**
29513  * g_socket_service_stop:
29514  * @service: a #GSocketService
29515  *
29516  * Stops the service, i.e. stops accepting connections
29517  * from the added sockets when the mainloop runs.
29518  *
29519  * This call is thread-safe, so it may be called from a thread
29520  * handling an incoming client request.
29521  *
29522  * Since: 2.22
29523  */
29524
29525
29526 /**
29527  * g_socket_set_blocking:
29528  * @socket: a #GSocket.
29529  * @blocking: Whether to use blocking I/O or not.
29530  *
29531  * Sets the blocking mode of the socket. In blocking mode
29532  * all operations block until they succeed or there is an error. In
29533  * non-blocking mode all functions return results immediately or
29534  * with a %G_IO_ERROR_WOULD_BLOCK error.
29535  *
29536  * All sockets are created in blocking mode. However, note that the
29537  * platform level socket is always non-blocking, and blocking mode
29538  * is a GSocket level feature.
29539  *
29540  * Since: 2.22
29541  */
29542
29543
29544 /**
29545  * g_socket_set_broadcast:
29546  * @socket: a #GSocket.
29547  * @broadcast: whether @socket should allow sending to and receiving from broadcast addresses
29548  *
29549  * Sets whether @socket should allow sending to and receiving from
29550  * broadcast addresses. This is %FALSE by default.
29551  *
29552  * Since: 2.32
29553  */
29554
29555
29556 /**
29557  * g_socket_set_keepalive:
29558  * @socket: a #GSocket.
29559  * @keepalive: Value for the keepalive flag
29560  *
29561  * Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
29562  * this flag is set on a socket, the system will attempt to verify that the
29563  * remote socket endpoint is still present if a sufficiently long period of
29564  * time passes with no data being exchanged. If the system is unable to
29565  * verify the presence of the remote endpoint, it will automatically close
29566  * the connection.
29567  *
29568  * This option is only functional on certain kinds of sockets. (Notably,
29569  * %G_SOCKET_PROTOCOL_TCP sockets.)
29570  *
29571  * The exact time between pings is system- and protocol-dependent, but will
29572  * normally be at least two hours. Most commonly, you would set this flag
29573  * on a server socket if you want to allow clients to remain idle for long
29574  * periods of time, but also want to ensure that connections are eventually
29575  * garbage-collected if clients crash or become unreachable.
29576  *
29577  * Since: 2.22
29578  */
29579
29580
29581 /**
29582  * g_socket_set_listen_backlog:
29583  * @socket: a #GSocket.
29584  * @backlog: the maximum number of pending connections.
29585  *
29586  * Sets the maximum number of outstanding connections allowed
29587  * when listening on this socket. If more clients than this are
29588  * connecting to the socket and the application is not handling them
29589  * on time then the new connections will be refused.
29590  *
29591  * Note that this must be called before g_socket_listen() and has no
29592  * effect if called after that.
29593  *
29594  * Since: 2.22
29595  */
29596
29597
29598 /**
29599  * g_socket_set_multicast_loopback:
29600  * @socket: a #GSocket.
29601  * @loopback: whether @socket should receive messages sent to its multicast groups from the local host
29602  *
29603  * Sets whether outgoing multicast packets will be received by sockets
29604  * listening on that multicast address on the same host. This is %TRUE
29605  * by default.
29606  *
29607  * Since: 2.32
29608  */
29609
29610
29611 /**
29612  * g_socket_set_multicast_ttl:
29613  * @socket: a #GSocket.
29614  * @ttl: the time-to-live value for all multicast datagrams on @socket
29615  *
29616  * Sets the time-to-live for outgoing multicast datagrams on @socket.
29617  * By default, this is 1, meaning that multicast packets will not leave
29618  * the local network.
29619  *
29620  * Since: 2.32
29621  */
29622
29623
29624 /**
29625  * g_socket_set_option:
29626  * @socket: a #GSocket
29627  * @level: the "API level" of the option (eg, <literal>SOL_SOCKET</literal>)
29628  * @optname: the "name" of the option (eg, <literal>SO_BROADCAST</literal>)
29629  * @value: the value to set the option to
29630  * @error: #GError for error reporting, or %NULL to ignore.
29631  *
29632  * Sets the value of an integer-valued option on @socket, as with
29633  * <literal>setsockopt ()</literal>. (If you need to set a
29634  * non-integer-valued option, you will need to call
29635  * <literal>setsockopt ()</literal> directly.)
29636  *
29637  * The <link linkend="gio-gnetworking.h"><literal>&lt;gio/gnetworking.h&gt;</literal></link>
29638  * header pulls in system headers that will define most of the
29639  * standard/portable socket options. For unusual socket protocols or
29640  * platform-dependent options, you may need to include additional
29641  * headers.
29642  *
29643  * Returns: success or failure. On failure, @error will be set, and the system error value (<literal>errno</literal> or <literal>WSAGetLastError ()</literal>) will still be set to the result of the <literal>setsockopt ()</literal> call.
29644  * Since: 2.36
29645  */
29646
29647
29648 /**
29649  * g_socket_set_timeout:
29650  * @socket: a #GSocket.
29651  * @timeout: the timeout for @socket, in seconds, or 0 for none
29652  *
29653  * Sets the time in seconds after which I/O operations on @socket will
29654  * time out if they have not yet completed.
29655  *
29656  * On a blocking socket, this means that any blocking #GSocket
29657  * operation will time out after @timeout seconds of inactivity,
29658  * returning %G_IO_ERROR_TIMED_OUT.
29659  *
29660  * On a non-blocking socket, calls to g_socket_condition_wait() will
29661  * also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
29662  * created with g_socket_create_source() will trigger after
29663  * @timeout seconds of inactivity, with the requested condition
29664  * set, at which point calling g_socket_receive(), g_socket_send(),
29665  * g_socket_check_connect_result(), etc, will fail with
29666  * %G_IO_ERROR_TIMED_OUT.
29667  *
29668  * If @timeout is 0 (the default), operations will never time out
29669  * on their own.
29670  *
29671  * Note that if an I/O operation is interrupted by a signal, this may
29672  * cause the timeout to be reset.
29673  *
29674  * Since: 2.26
29675  */
29676
29677
29678 /**
29679  * g_socket_set_ttl:
29680  * @socket: a #GSocket.
29681  * @ttl: the time-to-live value for all unicast packets on @socket
29682  *
29683  * Sets the time-to-live for outgoing unicast packets on @socket.
29684  * By default the platform-specific default value is used.
29685  *
29686  * Since: 2.32
29687  */
29688
29689
29690 /**
29691  * g_socket_shutdown:
29692  * @socket: a #GSocket
29693  * @shutdown_read: whether to shut down the read side
29694  * @shutdown_write: whether to shut down the write side
29695  * @error: #GError for error reporting, or %NULL to ignore.
29696  *
29697  * Shut down part of a full-duplex connection.
29698  *
29699  * If @shutdown_read is %TRUE then the receiving side of the connection
29700  * is shut down, and further reading is disallowed.
29701  *
29702  * If @shutdown_write is %TRUE then the sending side of the connection
29703  * is shut down, and further writing is disallowed.
29704  *
29705  * It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
29706  *
29707  * One example where this is used is graceful disconnect for TCP connections
29708  * where you close the sending side, then wait for the other side to close
29709  * the connection, thus ensuring that the other side saw all sent data.
29710  *
29711  * Returns: %TRUE on success, %FALSE on error
29712  * Since: 2.22
29713  */
29714
29715
29716 /**
29717  * g_socket_speaks_ipv4:
29718  * @socket: a #GSocket
29719  *
29720  * Checks if a socket is capable of speaking IPv4.
29721  *
29722  * IPv4 sockets are capable of speaking IPv4.  On some operating systems
29723  * and under some combinations of circumstances IPv6 sockets are also
29724  * capable of speaking IPv4.  See RFC 3493 section 3.7 for more
29725  * information.
29726  *
29727  * No other types of sockets are currently considered as being capable
29728  * of speaking IPv4.
29729  *
29730  * Returns: %TRUE if this socket can be used with IPv4.
29731  * Since: 2.22
29732  */
29733
29734
29735 /**
29736  * g_srv_target_copy:
29737  * @target: a #GSrvTarget
29738  *
29739  * Copies @target
29740  *
29741  * Returns: a copy of @target
29742  * Since: 2.22
29743  */
29744
29745
29746 /**
29747  * g_srv_target_free:
29748  * @target: a #GSrvTarget
29749  *
29750  * Frees @target
29751  *
29752  * Since: 2.22
29753  */
29754
29755
29756 /**
29757  * g_srv_target_get_hostname:
29758  * @target: a #GSrvTarget
29759  *
29760  * Gets @target's hostname (in ASCII form; if you are going to present
29761  * this to the user, you should use g_hostname_is_ascii_encoded() to
29762  * check if it contains encoded Unicode segments, and use
29763  * g_hostname_to_unicode() to convert it if it does.)
29764  *
29765  * Returns: @target's hostname
29766  * Since: 2.22
29767  */
29768
29769
29770 /**
29771  * g_srv_target_get_port:
29772  * @target: a #GSrvTarget
29773  *
29774  * Gets @target's port
29775  *
29776  * Returns: @target's port
29777  * Since: 2.22
29778  */
29779
29780
29781 /**
29782  * g_srv_target_get_priority:
29783  * @target: a #GSrvTarget
29784  *
29785  * Gets @target's priority. You should not need to look at this;
29786  * #GResolver already sorts the targets according to the algorithm in
29787  * RFC 2782.
29788  *
29789  * Returns: @target's priority
29790  * Since: 2.22
29791  */
29792
29793
29794 /**
29795  * g_srv_target_get_weight:
29796  * @target: a #GSrvTarget
29797  *
29798  * Gets @target's weight. You should not need to look at this;
29799  * #GResolver already sorts the targets according to the algorithm in
29800  * RFC 2782.
29801  *
29802  * Returns: @target's weight
29803  * Since: 2.22
29804  */
29805
29806
29807 /**
29808  * g_srv_target_list_sort: (skip)
29809  * @targets: a #GList of #GSrvTarget
29810  *
29811  * Sorts @targets in place according to the algorithm in RFC 2782.
29812  *
29813  * Returns: (transfer full): the head of the sorted list.
29814  * Since: 2.22
29815  */
29816
29817
29818 /**
29819  * g_srv_target_new:
29820  * @hostname: the host that the service is running on
29821  * @port: the port that the service is running on
29822  * @priority: the target's priority
29823  * @weight: the target's weight
29824  *
29825  * Creates a new #GSrvTarget with the given parameters.
29826  *
29827  * You should not need to use this; normally #GSrvTarget<!-- -->s are
29828  * created by #GResolver.
29829  *
29830  * Returns: a new #GSrvTarget.
29831  * Since: 2.22
29832  */
29833
29834
29835 /**
29836  * g_static_resource_fini:
29837  * @static_resource: pointer to a static #GStaticResource
29838  *
29839  * Finalized a GResource initialized by g_static_resource_init().
29840  *
29841  * This is normally used by code generated by
29842  * <link linkend="glib-compile-resources">glib-compile-resources</link>
29843  * and is not typically used by other code.
29844  *
29845  * Since: 2.32
29846  */
29847
29848
29849 /**
29850  * g_static_resource_get_resource:
29851  * @static_resource: pointer to a static #GStaticResource
29852  *
29853  * Gets the GResource that was registered by a call to g_static_resource_init().
29854  *
29855  * This is normally used by code generated by
29856  * <link linkend="glib-compile-resources">glib-compile-resources</link>
29857  * and is not typically used by other code.
29858  *
29859  * Returns: (transfer none): a #GResource
29860  * Since: 2.32
29861  */
29862
29863
29864 /**
29865  * g_static_resource_init:
29866  * @static_resource: pointer to a static #GStaticResource
29867  *
29868  * Initializes a GResource from static data using a
29869  * GStaticResource.
29870  *
29871  * This is normally used by code generated by
29872  * <link linkend="glib-compile-resources">glib-compile-resources</link>
29873  * and is not typically used by other code.
29874  *
29875  * Since: 2.32
29876  */
29877
29878
29879 /**
29880  * g_task_attach_source:
29881  * @task: a #GTask
29882  * @source: the source to attach
29883  * @callback: the callback to invoke when @source triggers
29884  *
29885  * A utility function for dealing with async operations where you need
29886  * to wait for a #GSource to trigger. Attaches @source to @task's
29887  * #GMainContext with @task's <link
29888  * linkend="io-priority">priority</link>, and sets @source's callback
29889  * to @callback, with @task as the callback's
29890  * <literal>user_data</literal>.
29891  *
29892  * This takes a reference on @task until @source is destroyed.
29893  *
29894  * Since: 2.36
29895  */
29896
29897
29898 /**
29899  * g_task_get_cancellable:
29900  * @task: a #GTask
29901  *
29902  * Gets @task's #GCancellable
29903  *
29904  * Returns: (transfer none): @task's #GCancellable
29905  * Since: 2.36
29906  */
29907
29908
29909 /**
29910  * g_task_get_check_cancellable:
29911  * @task: the #GTask
29912  *
29913  * Gets @task's check-cancellable flag. See
29914  * g_task_set_check_cancellable() for more details.
29915  *
29916  * Since: 2.36
29917  */
29918
29919
29920 /**
29921  * g_task_get_context:
29922  * @task: a #GTask
29923  *
29924  * Gets the #GMainContext that @task will return its result in (that
29925  * is, the context that was the <link
29926  * linkend="g-main-context-push-thread-default">thread-default main
29927  * context</link> at the point when @task was created).
29928  *
29929  * This will always return a non-%NULL value, even if the task's
29930  * context is the default #GMainContext.
29931  *
29932  * Returns: (transfer none): @task's #GMainContext
29933  * Since: 2.36
29934  */
29935
29936
29937 /**
29938  * g_task_get_priority:
29939  * @task: a #GTask
29940  *
29941  * Gets @task's priority
29942  *
29943  * Returns: @task's priority
29944  * Since: 2.36
29945  */
29946
29947
29948 /**
29949  * g_task_get_return_on_cancel:
29950  * @task: the #GTask
29951  *
29952  * Gets @task's return-on-cancel flag. See
29953  * g_task_set_return_on_cancel() for more details.
29954  *
29955  * Since: 2.36
29956  */
29957
29958
29959 /**
29960  * g_task_get_source_object:
29961  * @task: a #GTask
29962  *
29963  * Gets the source object from @task. Like
29964  * g_async_result_get_source_object(), but does not ref the object.
29965  *
29966  * Returns: (transfer none) (type GObject): @task's source object, or %NULL
29967  * Since: 2.36
29968  */
29969
29970
29971 /**
29972  * g_task_get_source_tag:
29973  * @task: a #GTask
29974  *
29975  * Gets @task's source tag. See g_task_set_source_tag().
29976  *
29977  * Returns: (transfer none): @task's source tag
29978  * Since: 2.36
29979  */
29980
29981
29982 /**
29983  * g_task_get_task_data:
29984  * @task: a #GTask
29985  *
29986  * Gets @task's <literal>task_data</literal>.
29987  *
29988  * Returns: (transfer none): @task's <literal>task_data</literal>.
29989  * Since: 2.36
29990  */
29991
29992
29993 /**
29994  * g_task_had_error:
29995  * @task: a #GTask.
29996  *
29997  * Tests if @task resulted in an error.
29998  *
29999  * Returns: %TRUE if the task resulted in an error, %FALSE otherwise.
30000  * Since: 2.36
30001  */
30002
30003
30004 /**
30005  * g_task_is_valid:
30006  * @result: (type Gio.AsyncResult): A #GAsyncResult
30007  * @source_object: (allow-none) (type GObject): the source object expected to be associated with the task
30008  *
30009  * Checks that @result is a #GTask, and that @source_object is its
30010  * source object (or that @source_object is %NULL and @result has no
30011  * source object). This can be used in g_return_if_fail() checks.
30012  *
30013  * Returns: %TRUE if @result and @source_object are valid, %FALSE if not
30014  * Since: 2.36
30015  */
30016
30017
30018 /**
30019  * g_task_new:
30020  * @source_object: (allow-none) (type GObject): the #GObject that owns this task, or %NULL.
30021  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
30022  * @callback: (scope async): a #GAsyncReadyCallback.
30023  * @callback_data: (closure): user data passed to @callback.
30024  *
30025  * Creates a #GTask acting on @source_object, which will eventually be
30026  * used to invoke @callback in the current <link
30027  * linkend="g-main-context-push-thread-default">thread-default main
30028  * context</link>.
30029  *
30030  * Call this in the "start" method of your asynchronous method, and
30031  * pass the #GTask around throughout the asynchronous operation. You
30032  * can use g_task_set_task_data() to attach task-specific data to the
30033  * object, which you can retrieve later via g_task_get_task_data().
30034  *
30035  * By default, if @cancellable is cancelled, then the return value of
30036  * the task will always be %G_IO_ERROR_CANCELLED, even if the task had
30037  * already completed before the cancellation. This allows for
30038  * simplified handling in cases where cancellation may imply that
30039  * other objects that the task depends on have been destroyed. If you
30040  * do not want this behavior, you can use
30041  * g_task_set_check_cancellable() to change it.
30042  *
30043  * Returns: a #GTask.
30044  * Since: 2.36
30045  */
30046
30047
30048 /**
30049  * g_task_propagate_boolean:
30050  * @task: a #GTask.
30051  * @error: return location for a #GError
30052  *
30053  * Gets the result of @task as a #gboolean.
30054  *
30055  * If the task resulted in an error, or was cancelled, then this will
30056  * instead return %FALSE and set @error.
30057  *
30058  * Since this method transfers ownership of the return value (or
30059  * error) to the caller, you may only call it once.
30060  *
30061  * Returns: the task result, or %FALSE on error
30062  * Since: 2.36
30063  */
30064
30065
30066 /**
30067  * g_task_propagate_int:
30068  * @task: a #GTask.
30069  * @error: return location for a #GError
30070  *
30071  * Gets the result of @task as an integer (#gssize).
30072  *
30073  * If the task resulted in an error, or was cancelled, then this will
30074  * instead return -1 and set @error.
30075  *
30076  * Since this method transfers ownership of the return value (or
30077  * error) to the caller, you may only call it once.
30078  *
30079  * Returns: the task result, or -1 on error
30080  * Since: 2.36
30081  */
30082
30083
30084 /**
30085  * g_task_propagate_pointer:
30086  * @task: a #GTask
30087  * @error: return location for a #GError
30088  *
30089  * Gets the result of @task as a pointer, and transfers ownership
30090  * of that value to the caller.
30091  *
30092  * If the task resulted in an error, or was cancelled, then this will
30093  * instead return %NULL and set @error.
30094  *
30095  * Since this method transfers ownership of the return value (or
30096  * error) to the caller, you may only call it once.
30097  *
30098  * Returns: (transfer full): the task result, or %NULL on error
30099  * Since: 2.36
30100  */
30101
30102
30103 /**
30104  * g_task_report_error:
30105  * @source_object: (allow-none) (type GObject): the #GObject that owns this task, or %NULL.
30106  * @callback: (scope async): a #GAsyncReadyCallback.
30107  * @callback_data: (closure): user data passed to @callback.
30108  * @source_tag: an opaque pointer indicating the source of this task
30109  * @error: (transfer full): error to report
30110  *
30111  * Creates a #GTask and then immediately calls g_task_return_error()
30112  * on it. Use this in the wrapper function of an asynchronous method
30113  * when you want to avoid even calling the virtual method. You can
30114  * then use g_async_result_is_tagged() in the finish method wrapper to
30115  * check if the result there is tagged as having been created by the
30116  * wrapper method, and deal with it appropriately if so.
30117  *
30118  * See also g_task_report_new_error().
30119  *
30120  * Since: 2.36
30121  */
30122
30123
30124 /**
30125  * g_task_report_new_error:
30126  * @source_object: (allow-none) (type GObject): the #GObject that owns this task, or %NULL.
30127  * @callback: (scope async): a #GAsyncReadyCallback.
30128  * @callback_data: (closure): user data passed to @callback.
30129  * @source_tag: an opaque pointer indicating the source of this task
30130  * @domain: a #GQuark.
30131  * @code: an error code.
30132  * @format: a string with format characters.
30133  * @...: a list of values to insert into @format.
30134  *
30135  * Creates a #GTask and then immediately calls
30136  * g_task_return_new_error() on it. Use this in the wrapper function
30137  * of an asynchronous method when you want to avoid even calling the
30138  * virtual method. You can then use g_async_result_is_tagged() in the
30139  * finish method wrapper to check if the result there is tagged as
30140  * having been created by the wrapper method, and deal with it
30141  * appropriately if so.
30142  *
30143  * See also g_task_report_error().
30144  *
30145  * Since: 2.36
30146  */
30147
30148
30149 /**
30150  * g_task_return_boolean:
30151  * @task: a #GTask.
30152  * @result: the #gboolean result of a task function.
30153  *
30154  * Sets @task's result to @result and completes the task (see
30155  * g_task_return_pointer() for more discussion of exactly what this
30156  * means).
30157  *
30158  * Since: 2.36
30159  */
30160
30161
30162 /**
30163  * g_task_return_error:
30164  * @task: a #GTask.
30165  * @error: (transfer full): the #GError result of a task function.
30166  *
30167  * Sets @task's result to @error (which @task assumes ownership of)
30168  * and completes the task (see g_task_return_pointer() for more
30169  * discussion of exactly what this means).
30170  *
30171  * Note that since the task takes ownership of @error, and since the
30172  * task may be completed before returning from g_task_return_error(),
30173  * you cannot assume that @error is still valid after calling this.
30174  * Call g_error_copy() on the error if you need to keep a local copy
30175  * as well.
30176  *
30177  * See also g_task_return_new_error().
30178  *
30179  * Since: 2.36
30180  */
30181
30182
30183 /**
30184  * g_task_return_error_if_cancelled:
30185  * @task: a #GTask
30186  *
30187  * Checks if @task's #GCancellable has been cancelled, and if so, sets
30188  * @task's error accordingly and completes the task (see
30189  * g_task_return_pointer() for more discussion of exactly what this
30190  * means).
30191  *
30192  * Returns: %TRUE if @task has been cancelled, %FALSE if not
30193  * Since: 2.36
30194  */
30195
30196
30197 /**
30198  * g_task_return_int:
30199  * @task: a #GTask.
30200  * @result: the integer (#gssize) result of a task function.
30201  *
30202  * Sets @task's result to @result and completes the task (see
30203  * g_task_return_pointer() for more discussion of exactly what this
30204  * means).
30205  *
30206  * Since: 2.36
30207  */
30208
30209
30210 /**
30211  * g_task_return_new_error:
30212  * @task: a #GTask.
30213  * @domain: a #GQuark.
30214  * @code: an error code.
30215  * @format: a string with format characters.
30216  * @...: a list of values to insert into @format.
30217  *
30218  * Sets @task's result to a new #GError created from @domain, @code,
30219  * @format, and the remaining arguments, and completes the task (see
30220  * g_task_return_pointer() for more discussion of exactly what this
30221  * means).
30222  *
30223  * See also g_task_return_error().
30224  *
30225  * Since: 2.36
30226  */
30227
30228
30229 /**
30230  * g_task_return_pointer:
30231  * @task: a #GTask
30232  * @result: (allow-none) (transfer full): the pointer result of a task function
30233  * @result_destroy: (allow-none): a #GDestroyNotify function.
30234  *
30235  * Sets @task's result to @result and completes the task. If @result
30236  * is not %NULL, then @result_destroy will be used to free @result if
30237  * the caller does not take ownership of it with
30238  * g_task_propagate_pointer().
30239  *
30240  * "Completes the task" means that for an ordinary asynchronous task
30241  * it will either invoke the task's callback, or else queue that
30242  * callback to be invoked in the proper #GMainContext, or in the next
30243  * iteration of the current #GMainContext. For a task run via
30244  * g_task_run_in_thread() or g_task_run_in_thread_sync(), calling this
30245  * method will save @result to be returned to the caller later, but
30246  * the task will not actually be completed until the #GTaskThreadFunc
30247  * exits.
30248  *
30249  * Note that since the task may be completed before returning from
30250  * g_task_return_pointer(), you cannot assume that @result is still
30251  * valid after calling this, unless you are still holding another
30252  * reference on it.
30253  *
30254  * Since: 2.36
30255  */
30256
30257
30258 /**
30259  * g_task_run_in_thread:
30260  * @task: a #GTask
30261  * @task_func: a #GTaskThreadFunc
30262  *
30263  * Runs @task_func in another thread. When @task_func returns, @task's
30264  * #GAsyncReadyCallback will be invoked in @task's #GMainContext.
30265  *
30266  * This takes a ref on @task until the task completes.
30267  *
30268  * See #GTaskThreadFunc for more details about how @task_func is handled.
30269  *
30270  * Since: 2.36
30271  */
30272
30273
30274 /**
30275  * g_task_run_in_thread_sync:
30276  * @task: a #GTask
30277  * @task_func: a #GTaskThreadFunc
30278  *
30279  * Runs @task_func in another thread, and waits for it to return or be
30280  * cancelled. You can use g_task_propagate_pointer(), etc, afterward
30281  * to get the result of @task_func.
30282  *
30283  * See #GTaskThreadFunc for more details about how @task_func is handled.
30284  *
30285  * Normally this is used with tasks created with a %NULL
30286  * <literal>callback</literal>, but note that even if the task does
30287  * have a callback, it will not be invoked when @task_func returns.
30288  *
30289  * Since: 2.36
30290  */
30291
30292
30293 /**
30294  * g_task_set_check_cancellable:
30295  * @task: the #GTask
30296  * @check_cancellable: whether #GTask will check the state of its #GCancellable for you.
30297  *
30298  * Sets or clears @task's check-cancellable flag. If this is %TRUE
30299  * (the default), then g_task_propagate_pointer(), etc, and
30300  * g_task_had_error() will check the task's #GCancellable first, and
30301  * if it has been cancelled, then they will consider the task to have
30302  * returned an "Operation was cancelled" error
30303  * (%G_IO_ERROR_CANCELLED), regardless of any other error or return
30304  * value the task may have had.
30305  *
30306  * If @check_cancellable is %FALSE, then the #GTask will not check the
30307  * cancellable itself, and it is up to @task's owner to do this (eg,
30308  * via g_task_return_error_if_cancelled()).
30309  *
30310  * If you are using g_task_set_return_on_cancel() as well, then
30311  * you must leave check-cancellable set %TRUE.
30312  *
30313  * Since: 2.36
30314  */
30315
30316
30317 /**
30318  * g_task_set_priority:
30319  * @task: the #GTask
30320  * @priority: the <link linkend="io-priority">priority</link> of the request.
30321  *
30322  * Sets @task's priority. If you do not call this, it will default to
30323  * %G_PRIORITY_DEFAULT.
30324  *
30325  * This will affect the priority of #GSources created with
30326  * g_task_attach_source() and the scheduling of tasks run in threads,
30327  * and can also be explicitly retrieved later via
30328  * g_task_get_priority().
30329  *
30330  * Since: 2.36
30331  */
30332
30333
30334 /**
30335  * g_task_set_return_on_cancel:
30336  * @task: the #GTask
30337  * @return_on_cancel: whether the task returns automatically when it is cancelled.
30338  *
30339  * Sets or clears @task's return-on-cancel flag. This is only
30340  * meaningful for tasks run via g_task_run_in_thread() or
30341  * g_task_run_in_thread_sync().
30342  *
30343  * If @return_on_cancel is %TRUE, then cancelling @task's
30344  * #GCancellable will immediately cause it to return, as though the
30345  * task's #GTaskThreadFunc had called
30346  * g_task_return_error_if_cancelled() and then returned.
30347  *
30348  * This allows you to create a cancellable wrapper around an
30349  * uninterruptable function. The #GTaskThreadFunc just needs to be
30350  * careful that it does not modify any externally-visible state after
30351  * it has been cancelled. To do that, the thread should call
30352  * g_task_set_return_on_cancel() again to (atomically) set
30353  * return-on-cancel %FALSE before making externally-visible changes;
30354  * if the task gets cancelled before the return-on-cancel flag could
30355  * be changed, g_task_set_return_on_cancel() will indicate this by
30356  * returning %FALSE.
30357  *
30358  * You can disable and re-enable this flag multiple times if you wish.
30359  * If the task's #GCancellable is cancelled while return-on-cancel is
30360  * %FALSE, then calling g_task_set_return_on_cancel() to set it %TRUE
30361  * again will cause the task to be cancelled at that point.
30362  *
30363  * If the task's #GCancellable is already cancelled before you call
30364  * g_task_run_in_thread()/g_task_run_in_thread_sync(), then the
30365  * #GTaskThreadFunc will still be run (for consistency), but the task
30366  * will also be completed right away.
30367  *
30368  * Returns: %TRUE if @task's return-on-cancel flag was changed to match @return_on_cancel. %FALSE if @task has already been cancelled.
30369  * Since: 2.36
30370  */
30371
30372
30373 /**
30374  * g_task_set_source_tag:
30375  * @task: the #GTask
30376  * @source_tag: an opaque pointer indicating the source of this task
30377  *
30378  * Sets @task's source tag. You can use this to tag a task return
30379  * value with a particular pointer (usually a pointer to the function
30380  * doing the tagging) and then later check it using
30381  * g_task_get_source_tag() (or g_async_result_is_tagged()) in the
30382  * task's "finish" function, to figure out if the response came from a
30383  * particular place.
30384  *
30385  * Since: 2.36
30386  */
30387
30388
30389 /**
30390  * g_task_set_task_data:
30391  * @task: the #GTask
30392  * @task_data: (allow-none): task-specific data
30393  * @task_data_destroy: (allow-none): #GDestroyNotify for @task_data
30394  *
30395  * Sets @task's task data (freeing the existing task data, if any).
30396  *
30397  * Since: 2.36
30398  */
30399
30400
30401 /**
30402  * g_tcp_connection_get_graceful_disconnect:
30403  * @connection: a #GTcpConnection
30404  *
30405  * Checks if graceful disconnects are used. See
30406  * g_tcp_connection_set_graceful_disconnect().
30407  *
30408  * Returns: %TRUE if graceful disconnect is used on close, %FALSE otherwise
30409  * Since: 2.22
30410  */
30411
30412
30413 /**
30414  * g_tcp_connection_set_graceful_disconnect:
30415  * @connection: a #GTcpConnection
30416  * @graceful_disconnect: Whether to do graceful disconnects or not
30417  *
30418  * This enabled graceful disconnects on close. A graceful disconnect
30419  * means that we signal the receiving end that the connection is terminated
30420  * and wait for it to close the connection before closing the connection.
30421  *
30422  * A graceful disconnect means that we can be sure that we successfully sent
30423  * all the outstanding data to the other end, or get an error reported.
30424  * However, it also means we have to wait for all the data to reach the
30425  * other side and for it to acknowledge this by closing the socket, which may
30426  * take a while. For this reason it is disabled by default.
30427  *
30428  * Since: 2.22
30429  */
30430
30431
30432 /**
30433  * g_tcp_wrapper_connection_get_base_io_stream:
30434  * @conn: a #GTcpWrapperConnection
30435  *
30436  * Get's @conn's base #GIOStream
30437  *
30438  * Returns: (transfer none): @conn's base #GIOStream
30439  */
30440
30441
30442 /**
30443  * g_tcp_wrapper_connection_new:
30444  * @base_io_stream: the #GIOStream to wrap
30445  * @socket: the #GSocket associated with @base_io_stream
30446  *
30447  * Wraps @base_io_stream and @socket together as a #GSocketConnection.
30448  *
30449  * Returns: the new #GSocketConnection.
30450  * Since: 2.28
30451  */
30452
30453
30454 /**
30455  * g_test_dbus_add_service_dir:
30456  * @self: a #GTestDBus
30457  * @path: path to a directory containing .service files
30458  *
30459  * Add a path where dbus-daemon will lookup for .services files. This can't be
30460  * called after g_test_dbus_up().
30461  */
30462
30463
30464 /**
30465  * g_test_dbus_down:
30466  * @self: a #GTestDBus
30467  *
30468  * Stop the session bus started by g_test_dbus_up().
30469  *
30470  * This will wait for the singleton returned by g_bus_get() or g_bus_get_sync()
30471  * is destroyed. This is done to ensure that the next unit test won't get a
30472  * leaked singleton from this test.
30473  */
30474
30475
30476 /**
30477  * g_test_dbus_get_bus_address:
30478  * @self: a #GTestDBus
30479  *
30480  * Get the address on which dbus-daemon is running. if g_test_dbus_up() has not
30481  * been called yet, %NULL is returned. This can be used with
30482  * g_dbus_connection_new_for_address()
30483  *
30484  * Returns: the address of the bus, or %NULL.
30485  */
30486
30487
30488 /**
30489  * g_test_dbus_get_flags:
30490  * @self: a #GTestDBus
30491  *
30492  * Gets the flags of the #GTestDBus object.
30493  *
30494  * Returns: the value of #GTestDBus:flags property
30495  */
30496
30497
30498 /**
30499  * g_test_dbus_new:
30500  * @flags: a #GTestDBusFlags
30501  *
30502  * Create a new #GTestDBus object.
30503  *
30504  * Returns: (transfer full): a new #GTestDBus.
30505  */
30506
30507
30508 /**
30509  * g_test_dbus_stop:
30510  * @self: a #GTestDBus
30511  *
30512  * Stop the session bus started by g_test_dbus_up().
30513  *
30514  * Unlike g_test_dbus_down(), this won't verify the #GDBusConnection
30515  * singleton returned by g_bus_get() or g_bus_get_sync() is destroyed. Unit
30516  * tests wanting to verify behaviour after the session bus has been stopped
30517  * can use this function but should still call g_test_dbus_down() when done.
30518  */
30519
30520
30521 /**
30522  * g_test_dbus_unset:
30523  *
30524  * Unset DISPLAY and DBUS_SESSION_BUS_ADDRESS env variables to ensure the test
30525  * won't use user's session bus.
30526  *
30527  * This is useful for unit tests that want to verify behaviour when no session
30528  * bus is running. It is not necessary to call this if unit test already calls
30529  * g_test_dbus_up() before acquiring the session bus.
30530  */
30531
30532
30533 /**
30534  * g_test_dbus_up:
30535  * @self: a #GTestDBus
30536  *
30537  * Start a dbus-daemon instance and set DBUS_SESSION_BUS_ADDRESS. After this
30538  * call, it is safe for unit tests to start sending messages on the session bus.
30539  *
30540  * If this function is called from setup callback of g_test_add(),
30541  * g_test_dbus_down() must be called in its teardown callback.
30542  *
30543  * If this function is called from unit test's main(), then g_test_dbus_down()
30544  * must be called after g_test_run().
30545  */
30546
30547
30548 /**
30549  * g_themed_icon_append_name:
30550  * @icon: a #GThemedIcon
30551  * @iconname: name of icon to append to list of icons from within @icon.
30552  *
30553  * Append a name to the list of icons from within @icon.
30554  *
30555  * <note><para>
30556  * Note that doing so invalidates the hash computed by prior calls
30557  * to g_icon_hash().
30558  * </para></note>
30559  */
30560
30561
30562 /**
30563  * g_themed_icon_get_names:
30564  * @icon: a #GThemedIcon.
30565  *
30566  * Gets the names of icons from within @icon.
30567  *
30568  * Returns: (transfer none): a list of icon names.
30569  */
30570
30571
30572 /**
30573  * g_themed_icon_new:
30574  * @iconname: a string containing an icon name.
30575  *
30576  * Creates a new themed icon for @iconname.
30577  *
30578  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
30579  */
30580
30581
30582 /**
30583  * g_themed_icon_new_from_names:
30584  * @iconnames: (array length=len): an array of strings containing icon names.
30585  * @len: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
30586  *
30587  * Creates a new themed icon for @iconnames.
30588  *
30589  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon
30590  */
30591
30592
30593 /**
30594  * g_themed_icon_new_with_default_fallbacks:
30595  * @iconname: a string containing an icon name
30596  *
30597  * Creates a new themed icon for @iconname, and all the names
30598  * that can be created by shortening @iconname at '-' characters.
30599  *
30600  * In the following example, @icon1 and @icon2 are equivalent:
30601  * |[
30602  * const char *names[] = {
30603  *   "gnome-dev-cdrom-audio",
30604  *   "gnome-dev-cdrom",
30605  *   "gnome-dev",
30606  *   "gnome"
30607  * };
30608  *
30609  * icon1 = g_themed_icon_new_from_names (names, 4);
30610  * icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
30611  * ]|
30612  *
30613  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
30614  */
30615
30616
30617 /**
30618  * g_themed_icon_prepend_name:
30619  * @icon: a #GThemedIcon
30620  * @iconname: name of icon to prepend to list of icons from within @icon.
30621  *
30622  * Prepend a name to the list of icons from within @icon.
30623  *
30624  * <note><para>
30625  * Note that doing so invalidates the hash computed by prior calls
30626  * to g_icon_hash().
30627  * </para></note>
30628  *
30629  * Since: 2.18
30630  */
30631
30632
30633 /**
30634  * g_threaded_socket_service_new:
30635  * @max_threads: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
30636  *
30637  * Creates a new #GThreadedSocketService with no listeners. Listeners
30638  * must be added with one of the #GSocketListener "add" methods.
30639  *
30640  * Returns: a new #GSocketService.
30641  * Since: 2.22
30642  */
30643
30644
30645 /**
30646  * g_tls_backend_get_certificate_type:
30647  * @backend: the #GTlsBackend
30648  *
30649  * Gets the #GType of @backend's #GTlsCertificate implementation.
30650  *
30651  * Returns: the #GType of @backend's #GTlsCertificate implementation.
30652  * Since: 2.28
30653  */
30654
30655
30656 /**
30657  * g_tls_backend_get_client_connection_type:
30658  * @backend: the #GTlsBackend
30659  *
30660  * Gets the #GType of @backend's #GTlsClientConnection implementation.
30661  *
30662  * Returns: the #GType of @backend's #GTlsClientConnection implementation.
30663  * Since: 2.28
30664  */
30665
30666
30667 /**
30668  * g_tls_backend_get_default:
30669  *
30670  * Gets the default #GTlsBackend for the system.
30671  *
30672  * Returns: (transfer none): a #GTlsBackend
30673  * Since: 2.28
30674  */
30675
30676
30677 /**
30678  * g_tls_backend_get_default_database:
30679  * @backend: the #GTlsBackend
30680  *
30681  * Gets the default #GTlsDatabase used to verify TLS connections.
30682  *
30683  * Returns: (transfer full): the default database, which should be unreffed when done.
30684  * Since: 2.30
30685  */
30686
30687
30688 /**
30689  * g_tls_backend_get_file_database_type:
30690  * @backend: the #GTlsBackend
30691  *
30692  * Gets the #GType of @backend's #GTlsFileDatabase implementation.
30693  *
30694  * Returns: the #GType of backend's #GTlsFileDatabase implementation.
30695  * Since: 2.30
30696  */
30697
30698
30699 /**
30700  * g_tls_backend_get_server_connection_type:
30701  * @backend: the #GTlsBackend
30702  *
30703  * Gets the #GType of @backend's #GTlsServerConnection implementation.
30704  *
30705  * Returns: the #GType of @backend's #GTlsServerConnection implementation.
30706  * Since: 2.28
30707  */
30708
30709
30710 /**
30711  * g_tls_backend_supports_tls:
30712  * @backend: the #GTlsBackend
30713  *
30714  * Checks if TLS is supported; if this returns %FALSE for the default
30715  * #GTlsBackend, it means no "real" TLS backend is available.
30716  *
30717  * Returns: whether or not TLS is supported
30718  * Since: 2.28
30719  */
30720
30721
30722 /**
30723  * g_tls_certificate_get_issuer:
30724  * @cert: a #GTlsCertificate
30725  *
30726  * Gets the #GTlsCertificate representing @cert's issuer, if known
30727  *
30728  * Returns: (transfer none): The certificate of @cert's issuer, or %NULL if @cert is self-signed or signed with an unknown certificate.
30729  * Since: 2.28
30730  */
30731
30732
30733 /**
30734  * g_tls_certificate_is_same:
30735  * @cert_one: first certificate to compare
30736  * @cert_two: second certificate to compare
30737  *
30738  * Check if two #GTlsCertificate objects represent the same certificate.
30739  * The raw DER byte data of the two certificates are checked for equality.
30740  * This has the effect that two certificates may compare equal even if
30741  * their #GTlsCertificate:issuer, #GTlsCertificate:private-key, or
30742  * #GTlsCertificate:private-key-pem properties differ.
30743  *
30744  * Returns: whether the same or not
30745  * Since: 2.34
30746  */
30747
30748
30749 /**
30750  * g_tls_certificate_list_new_from_file:
30751  * @file: file containing PEM-encoded certificates to import
30752  * @error: #GError for error reporting, or %NULL to ignore.
30753  *
30754  * Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
30755  * data in @file. If @file cannot be read or parsed, the function will
30756  * return %NULL and set @error. If @file does not contain any
30757  * PEM-encoded certificates, this will return an empty list and not
30758  * set @error.
30759  *
30760  * 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.
30761  * Since: 2.28
30762  */
30763
30764
30765 /**
30766  * g_tls_certificate_new_from_file:
30767  * @file: file containing a PEM-encoded certificate to import
30768  * @error: #GError for error reporting, or %NULL to ignore.
30769  *
30770  * Creates a #GTlsCertificate from the PEM-encoded data in @file. If
30771  * @file cannot be read or parsed, the function will return %NULL and
30772  * set @error. Otherwise, this behaves like
30773  * g_tls_certificate_new_from_pem().
30774  *
30775  * Returns: the new certificate, or %NULL on error
30776  * Since: 2.28
30777  */
30778
30779
30780 /**
30781  * g_tls_certificate_new_from_files:
30782  * @cert_file: file containing a PEM-encoded certificate to import
30783  * @key_file: file containing a PEM-encoded private key to import
30784  * @error: #GError for error reporting, or %NULL to ignore.
30785  *
30786  * Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
30787  * and @key_file. If either file cannot be read or parsed, the
30788  * function will return %NULL and set @error. Otherwise, this behaves
30789  * like g_tls_certificate_new_from_pem().
30790  *
30791  * Returns: the new certificate, or %NULL on error
30792  * Since: 2.28
30793  */
30794
30795
30796 /**
30797  * g_tls_certificate_new_from_pem:
30798  * @data: PEM-encoded certificate data
30799  * @length: the length of @data, or -1 if it's 0-terminated.
30800  * @error: #GError for error reporting, or %NULL to ignore.
30801  *
30802  * Creates a new #GTlsCertificate from the PEM-encoded data in @data.
30803  * If @data includes both a certificate and a private key, then the
30804  * returned certificate will include the private key data as well. (See
30805  * the #GTlsCertificate:private-key-pem property for information about
30806  * supported formats.)
30807  *
30808  * If @data includes multiple certificates, only the first one will be
30809  * parsed.
30810  *
30811  * Returns: the new certificate, or %NULL if @data is invalid
30812  * Since: 2.28
30813  */
30814
30815
30816 /**
30817  * g_tls_certificate_verify:
30818  * @cert: a #GTlsCertificate
30819  * @identity: (allow-none): the expected peer identity
30820  * @trusted_ca: (allow-none): the certificate of a trusted authority
30821  *
30822  * This verifies @cert and returns a set of #GTlsCertificateFlags
30823  * indicating any problems found with it. This can be used to verify a
30824  * certificate outside the context of making a connection, or to
30825  * check a certificate against a CA that is not part of the system
30826  * CA database.
30827  *
30828  * If @identity is not %NULL, @cert's name(s) will be compared against
30829  * it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
30830  * value if it does not match. If @identity is %NULL, that bit will
30831  * never be set in the return value.
30832  *
30833  * If @trusted_ca is not %NULL, then @cert (or one of the certificates
30834  * in its chain) must be signed by it, or else
30835  * %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
30836  * @trusted_ca is %NULL, that bit will never be set in the return
30837  * value.
30838  *
30839  * (All other #GTlsCertificateFlags values will always be set or unset
30840  * as appropriate.)
30841  *
30842  * Returns: the appropriate #GTlsCertificateFlags
30843  * Since: 2.28
30844  */
30845
30846
30847 /**
30848  * g_tls_client_connection_get_accepted_cas:
30849  * @conn: the #GTlsClientConnection
30850  *
30851  * Gets the list of distinguished names of the Certificate Authorities
30852  * that the server will accept certificates from. This will be set
30853  * during the TLS handshake if the server requests a certificate.
30854  * Otherwise, it will be %NULL.
30855  *
30856  * Each item in the list is a #GByteArray which contains the complete
30857  * subject DN of the certificate authority.
30858  *
30859  * 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().
30860  * Since: 2.28
30861  */
30862
30863
30864 /**
30865  * g_tls_client_connection_get_server_identity:
30866  * @conn: the #GTlsClientConnection
30867  *
30868  * Gets @conn's expected server identity
30869  *
30870  * Returns: (transfer none): a #GSocketConnectable describing the expected server identity, or %NULL if the expected identity is not known.
30871  * Since: 2.28
30872  */
30873
30874
30875 /**
30876  * g_tls_client_connection_get_use_ssl3:
30877  * @conn: the #GTlsClientConnection
30878  *
30879  * Gets whether @conn will use SSL 3.0 rather than the
30880  * highest-supported version of TLS; see
30881  * g_tls_client_connection_set_use_ssl3().
30882  *
30883  * Returns: whether @conn will use SSL 3.0
30884  * Since: 2.28
30885  */
30886
30887
30888 /**
30889  * g_tls_client_connection_get_validation_flags:
30890  * @conn: the #GTlsClientConnection
30891  *
30892  * Gets @conn's validation flags
30893  *
30894  * Returns: the validation flags
30895  * Since: 2.28
30896  */
30897
30898
30899 /**
30900  * g_tls_client_connection_new:
30901  * @base_io_stream: the #GIOStream to wrap
30902  * @server_identity: (allow-none): the expected identity of the server
30903  * @error: #GError for error reporting, or %NULL to ignore.
30904  *
30905  * Creates a new #GTlsClientConnection wrapping @base_io_stream (which
30906  * must have pollable input and output streams) which is assumed to
30907  * communicate with the server identified by @server_identity.
30908  *
30909  * Returns: (transfer full) (type GTlsClientConnection): the new #GTlsClientConnection, or %NULL on error
30910  * Since: 2.28
30911  */
30912
30913
30914 /**
30915  * g_tls_client_connection_set_server_identity:
30916  * @conn: the #GTlsClientConnection
30917  * @identity: a #GSocketConnectable describing the expected server identity
30918  *
30919  * Sets @conn's expected server identity, which is used both to tell
30920  * servers on virtual hosts which certificate to present, and also
30921  * to let @conn know what name to look for in the certificate when
30922  * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
30923  *
30924  * Since: 2.28
30925  */
30926
30927
30928 /**
30929  * g_tls_client_connection_set_use_ssl3:
30930  * @conn: the #GTlsClientConnection
30931  * @use_ssl3: whether to use SSL 3.0
30932  *
30933  * If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
30934  * trying to properly negotiate the right version of TLS or SSL to use.
30935  * This can be used when talking to servers that do not implement the
30936  * fallbacks correctly and which will therefore fail to handshake with
30937  * a "modern" TLS handshake attempt.
30938  *
30939  * Since: 2.28
30940  */
30941
30942
30943 /**
30944  * g_tls_client_connection_set_validation_flags:
30945  * @conn: the #GTlsClientConnection
30946  * @flags: the #GTlsCertificateFlags to use
30947  *
30948  * Sets @conn's validation flags, to override the default set of
30949  * checks performed when validating a server certificate. By default,
30950  * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
30951  *
30952  * Since: 2.28
30953  */
30954
30955
30956 /**
30957  * g_tls_connection_emit_accept_certificate:
30958  * @conn: a #GTlsConnection
30959  * @peer_cert: the peer's #GTlsCertificate
30960  * @errors: the problems with @peer_cert
30961  *
30962  * Used by #GTlsConnection implementations to emit the
30963  * #GTlsConnection::accept-certificate signal.
30964  *
30965  * Returns: %TRUE if one of the signal handlers has returned %TRUE to accept @peer_cert
30966  * Since: 2.28
30967  */
30968
30969
30970 /**
30971  * g_tls_connection_get_certificate:
30972  * @conn: a #GTlsConnection
30973  *
30974  * Gets @conn's certificate, as set by
30975  * g_tls_connection_set_certificate().
30976  *
30977  * Returns: (transfer none): @conn's certificate, or %NULL
30978  * Since: 2.28
30979  */
30980
30981
30982 /**
30983  * g_tls_connection_get_database:
30984  * @conn: a #GTlsConnection
30985  *
30986  * Gets the certificate database that @conn uses to verify
30987  * peer certificates. See g_tls_connection_set_database().
30988  *
30989  * Returns: (transfer none): the certificate database that @conn uses or %NULL
30990  * Since: 2.30
30991  */
30992
30993
30994 /**
30995  * g_tls_connection_get_interaction:
30996  * @conn: a connection
30997  *
30998  * Get the object that will be used to interact with the user. It will be used
30999  * for things like prompting the user for passwords. If %NULL is returned, then
31000  * no user interaction will occur for this connection.
31001  *
31002  * Returns: (transfer none): The interaction object.
31003  * Since: 2.30
31004  */
31005
31006
31007 /**
31008  * g_tls_connection_get_peer_certificate:
31009  * @conn: a #GTlsConnection
31010  *
31011  * Gets @conn's peer's certificate after the handshake has completed.
31012  * (It is not set during the emission of
31013  * #GTlsConnection::accept-certificate.)
31014  *
31015  * Returns: (transfer none): @conn's peer's certificate, or %NULL
31016  * Since: 2.28
31017  */
31018
31019
31020 /**
31021  * g_tls_connection_get_peer_certificate_errors:
31022  * @conn: a #GTlsConnection
31023  *
31024  * Gets the errors associated with validating @conn's peer's
31025  * certificate, after the handshake has completed. (It is not set
31026  * during the emission of #GTlsConnection::accept-certificate.)
31027  *
31028  * Returns: @conn's peer's certificate errors
31029  * Since: 2.28
31030  */
31031
31032
31033 /**
31034  * g_tls_connection_get_rehandshake_mode:
31035  * @conn: a #GTlsConnection
31036  *
31037  * Gets @conn rehandshaking mode. See
31038  * g_tls_connection_set_rehandshake_mode() for details.
31039  *
31040  * Returns: @conn's rehandshaking mode
31041  * Since: 2.28
31042  */
31043
31044
31045 /**
31046  * g_tls_connection_get_require_close_notify:
31047  * @conn: a #GTlsConnection
31048  *
31049  * Tests whether or not @conn expects a proper TLS close notification
31050  * when the connection is closed. See
31051  * g_tls_connection_set_require_close_notify() for details.
31052  *
31053  * Returns: %TRUE if @conn requires a proper TLS close notification.
31054  * Since: 2.28
31055  */
31056
31057
31058 /**
31059  * g_tls_connection_get_use_system_certdb:
31060  * @conn: a #GTlsConnection
31061  *
31062  * Gets whether @conn uses the system certificate database to verify
31063  * peer certificates. See g_tls_connection_set_use_system_certdb().
31064  *
31065  * Returns: whether @conn uses the system certificate database
31066  * Deprecated: 2.30: Use g_tls_connection_get_database() instead
31067  */
31068
31069
31070 /**
31071  * g_tls_connection_handshake:
31072  * @conn: a #GTlsConnection
31073  * @cancellable: (allow-none): a #GCancellable, or %NULL
31074  * @error: a #GError, or %NULL
31075  *
31076  * Attempts a TLS handshake on @conn.
31077  *
31078  * On the client side, it is never necessary to call this method;
31079  * although the connection needs to perform a handshake after
31080  * connecting (or after sending a "STARTTLS"-type command) and may
31081  * need to rehandshake later if the server requests it,
31082  * #GTlsConnection will handle this for you automatically when you try
31083  * to send or receive data on the connection. However, you can call
31084  * g_tls_connection_handshake() manually if you want to know for sure
31085  * whether the initial handshake succeeded or failed (as opposed to
31086  * just immediately trying to write to @conn's output stream, in which
31087  * case if it fails, it may not be possible to tell if it failed
31088  * before or after completing the handshake).
31089  *
31090  * Likewise, on the server side, although a handshake is necessary at
31091  * the beginning of the communication, you do not need to call this
31092  * function explicitly unless you want clearer error reporting.
31093  * However, you may call g_tls_connection_handshake() later on to
31094  * renegotiate parameters (encryption methods, etc) with the client.
31095  *
31096  * #GTlsConnection::accept_certificate may be emitted during the
31097  * handshake.
31098  *
31099  * Returns: success or failure
31100  * Since: 2.28
31101  */
31102
31103
31104 /**
31105  * g_tls_connection_handshake_async:
31106  * @conn: a #GTlsConnection
31107  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
31108  * @cancellable: (allow-none): a #GCancellable, or %NULL
31109  * @callback: callback to call when the handshake is complete
31110  * @user_data: the data to pass to the callback function
31111  *
31112  * Asynchronously performs a TLS handshake on @conn. See
31113  * g_tls_connection_handshake() for more information.
31114  *
31115  * Since: 2.28
31116  */
31117
31118
31119 /**
31120  * g_tls_connection_handshake_finish:
31121  * @conn: a #GTlsConnection
31122  * @result: a #GAsyncResult.
31123  * @error: a #GError pointer, or %NULL
31124  *
31125  * Finish an asynchronous TLS handshake operation. See
31126  * g_tls_connection_handshake() for more information.
31127  *
31128  * Returns: %TRUE on success, %FALSE on failure, in which case @error will be set.
31129  * Since: 2.28
31130  */
31131
31132
31133 /**
31134  * g_tls_connection_set_certificate:
31135  * @conn: a #GTlsConnection
31136  * @certificate: the certificate to use for @conn
31137  *
31138  * This sets the certificate that @conn will present to its peer
31139  * during the TLS handshake. For a #GTlsServerConnection, it is
31140  * mandatory to set this, and that will normally be done at construct
31141  * time.
31142  *
31143  * For a #GTlsClientConnection, this is optional. If a handshake fails
31144  * with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
31145  * requires a certificate, and if you try connecting again, you should
31146  * call this method first. You can call
31147  * g_tls_client_connection_get_accepted_cas() on the failed connection
31148  * to get a list of Certificate Authorities that the server will
31149  * accept certificates from.
31150  *
31151  * (It is also possible that a server will allow the connection with
31152  * or without a certificate; in that case, if you don't provide a
31153  * certificate, you can tell that the server requested one by the fact
31154  * that g_tls_client_connection_get_accepted_cas() will return
31155  * non-%NULL.)
31156  *
31157  * Since: 2.28
31158  */
31159
31160
31161 /**
31162  * g_tls_connection_set_database:
31163  * @conn: a #GTlsConnection
31164  * @database: a #GTlsDatabase
31165  *
31166  * Sets the certificate database that is used to verify peer certificates.
31167  * This is set to the default database by default. See
31168  * g_tls_backend_get_default_database(). If set to %NULL, then
31169  * peer certificate validation will always set the
31170  * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
31171  * #GTlsConnection::accept-certificate will always be emitted on
31172  * client-side connections, unless that bit is not set in
31173  * #GTlsClientConnection:validation-flags).
31174  *
31175  * Since: 2.30
31176  */
31177
31178
31179 /**
31180  * g_tls_connection_set_interaction:
31181  * @conn: a connection
31182  * @interaction: (allow-none): an interaction object, or %NULL
31183  *
31184  * Set the object that will be used to interact with the user. It will be used
31185  * for things like prompting the user for passwords.
31186  *
31187  * The @interaction argument will normally be a derived subclass of
31188  * #GTlsInteraction. %NULL can also be provided if no user interaction
31189  * should occur for this connection.
31190  *
31191  * Since: 2.30
31192  */
31193
31194
31195 /**
31196  * g_tls_connection_set_rehandshake_mode:
31197  * @conn: a #GTlsConnection
31198  * @mode: the rehandshaking mode
31199  *
31200  * Sets how @conn behaves with respect to rehandshaking requests.
31201  *
31202  * %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
31203  * rehandshake after the initial handshake is complete. (For a client,
31204  * this means it will refuse rehandshake requests from the server, and
31205  * for a server, this means it will close the connection with an error
31206  * if the client attempts to rehandshake.)
31207  *
31208  * %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
31209  * rehandshake only if the other end of the connection supports the
31210  * TLS <literal>renegotiation_info</literal> extension. This is the
31211  * default behavior, but means that rehandshaking will not work
31212  * against older implementations that do not support that extension.
31213  *
31214  * %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
31215  * rehandshaking even without the
31216  * <literal>renegotiation_info</literal> extension. On the server side
31217  * in particular, this is not recommended, since it leaves the server
31218  * open to certain attacks. However, this mode is necessary if you
31219  * need to allow renegotiation with older client software.
31220  *
31221  * Since: 2.28
31222  */
31223
31224
31225 /**
31226  * g_tls_connection_set_require_close_notify:
31227  * @conn: a #GTlsConnection
31228  * @require_close_notify: whether or not to require close notification
31229  *
31230  * Sets whether or not @conn expects a proper TLS close notification
31231  * before the connection is closed. If this is %TRUE (the default),
31232  * then @conn will expect to receive a TLS close notification from its
31233  * peer before the connection is closed, and will return a
31234  * %G_TLS_ERROR_EOF error if the connection is closed without proper
31235  * notification (since this may indicate a network error, or
31236  * man-in-the-middle attack).
31237  *
31238  * In some protocols, the application will know whether or not the
31239  * connection was closed cleanly based on application-level data
31240  * (because the application-level data includes a length field, or is
31241  * somehow self-delimiting); in this case, the close notify is
31242  * redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
31243  * in TLS 1.0 it is technically an error, but often done anyway.) You
31244  * can use g_tls_connection_set_require_close_notify() to tell @conn
31245  * to allow an "unannounced" connection close, in which case the close
31246  * will show up as a 0-length read, as in a non-TLS
31247  * #GSocketConnection, and it is up to the application to check that
31248  * the data has been fully received.
31249  *
31250  * Note that this only affects the behavior when the peer closes the
31251  * connection; when the application calls g_io_stream_close() itself
31252  * on @conn, this will send a close notification regardless of the
31253  * setting of this property. If you explicitly want to do an unclean
31254  * close, you can close @conn's #GTlsConnection:base-io-stream rather
31255  * than closing @conn itself.
31256  *
31257  * Since: 2.28
31258  */
31259
31260
31261 /**
31262  * g_tls_connection_set_use_system_certdb:
31263  * @conn: a #GTlsConnection
31264  * @use_system_certdb: whether to use the system certificate database
31265  *
31266  * Sets whether @conn uses the system certificate database to verify
31267  * peer certificates. This is %TRUE by default. If set to %FALSE, then
31268  * peer certificate validation will always set the
31269  * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
31270  * #GTlsConnection::accept-certificate will always be emitted on
31271  * client-side connections, unless that bit is not set in
31272  * #GTlsClientConnection:validation-flags).
31273  *
31274  * Deprecated: 2.30: Use g_tls_connection_set_database() instead
31275  */
31276
31277
31278 /**
31279  * g_tls_database_create_certificate_handle:
31280  * @self: a #GTlsDatabase
31281  * @certificate: certificate for which to create a handle.
31282  *
31283  * Create a handle string for the certificate. The database will only be able
31284  * to create a handle for certificates that originate from the database. In
31285  * cases where the database cannot create a handle for a certificate, %NULL
31286  * will be returned.
31287  *
31288  * This handle should be stable across various instances of the application,
31289  * and between applications. If a certificate is modified in the database,
31290  * then it is not guaranteed that this handle will continue to point to it.
31291  *
31292  * Returns: (allow-none): a newly allocated string containing the handle.
31293  * Since: 2.30
31294  */
31295
31296
31297 /**
31298  * g_tls_database_lookup_certificate_for_handle:
31299  * @self: a #GTlsDatabase
31300  * @handle: a certificate handle
31301  * @interaction: (allow-none): used to interact with the user if necessary
31302  * @flags: Flags which affect the lookup.
31303  * @cancellable: (allow-none): a #GCancellable, or %NULL
31304  * @error: (allow-none): a #GError, or %NULL
31305  *
31306  * Lookup a certificate by its handle.
31307  *
31308  * The handle should have been created by calling
31309  * g_tls_database_create_certificate_handle() on a #GTlsDatabase object of
31310  * the same TLS backend. The handle is designed to remain valid across
31311  * instantiations of the database.
31312  *
31313  * If the handle is no longer valid, or does not point to a certificate in
31314  * this database, then %NULL will be returned.
31315  *
31316  * This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
31317  * the lookup operation asynchronously.
31318  *
31319  * Returns: (transfer full) (allow-none): a newly allocated #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31320  * Since: 2.30
31321  */
31322
31323
31324 /**
31325  * g_tls_database_lookup_certificate_for_handle_async:
31326  * @self: a #GTlsDatabase
31327  * @handle: a certificate handle
31328  * @interaction: (allow-none): used to interact with the user if necessary
31329  * @flags: Flags which affect the lookup.
31330  * @cancellable: (allow-none): a #GCancellable, or %NULL
31331  * @callback: callback to call when the operation completes
31332  * @user_data: the data to pass to the callback function
31333  *
31334  * Asynchronously lookup a certificate by its handle in the database. See
31335  * g_tls_database_lookup_certificate_for_handle() for more information.
31336  *
31337  * Since: 2.30
31338  */
31339
31340
31341 /**
31342  * g_tls_database_lookup_certificate_for_handle_finish:
31343  * @self: a #GTlsDatabase
31344  * @result: a #GAsyncResult.
31345  * @error: a #GError pointer, or %NULL
31346  *
31347  * Finish an asynchronous lookup of a certificate by its handle. See
31348  * g_tls_database_lookup_certificate_handle() for more information.
31349  *
31350  * If the handle is no longer valid, or does not point to a certificate in
31351  * this database, then %NULL will be returned.
31352  *
31353  * Returns: (transfer full): a newly allocated #GTlsCertificate object. Use g_object_unref() to release the certificate.
31354  * Since: 2.30
31355  */
31356
31357
31358 /**
31359  * g_tls_database_lookup_certificate_issuer:
31360  * @self: a #GTlsDatabase
31361  * @certificate: a #GTlsCertificate
31362  * @interaction: (allow-none): used to interact with the user if necessary
31363  * @flags: flags which affect the lookup operation
31364  * @cancellable: (allow-none): a #GCancellable, or %NULL
31365  * @error: (allow-none): a #GError, or %NULL
31366  *
31367  * Lookup the issuer of @certificate in the database.
31368  *
31369  * The %issuer property
31370  * of @certificate is not modified, and the two certificates are not hooked
31371  * into a chain.
31372  *
31373  * This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
31374  * the lookup operation asynchronously.
31375  *
31376  * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31377  * Since: 2.30
31378  */
31379
31380
31381 /**
31382  * g_tls_database_lookup_certificate_issuer_async:
31383  * @self: a #GTlsDatabase
31384  * @certificate: a #GTlsCertificate
31385  * @interaction: (allow-none): used to interact with the user if necessary
31386  * @flags: flags which affect the lookup operation
31387  * @cancellable: (allow-none): a #GCancellable, or %NULL
31388  * @callback: callback to call when the operation completes
31389  * @user_data: the data to pass to the callback function
31390  *
31391  * Asynchronously lookup the issuer of @certificate in the database. See
31392  * g_tls_database_lookup_certificate_issuer() for more information.
31393  *
31394  * Since: 2.30
31395  */
31396
31397
31398 /**
31399  * g_tls_database_lookup_certificate_issuer_finish:
31400  * @self: a #GTlsDatabase
31401  * @result: a #GAsyncResult.
31402  * @error: a #GError pointer, or %NULL
31403  *
31404  * Finish an asynchronous lookup issuer operation. See
31405  * g_tls_database_lookup_certificate_issuer() for more information.
31406  *
31407  * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
31408  * Since: 2.30
31409  */
31410
31411
31412 /**
31413  * g_tls_database_lookup_certificates_issued_by:
31414  * @self: a #GTlsDatabase
31415  * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
31416  * @interaction: (allow-none): used to interact with the user if necessary
31417  * @flags: Flags which affect the lookup operation.
31418  * @cancellable: (allow-none): a #GCancellable, or %NULL
31419  * @error: (allow-none): a #GError, or %NULL
31420  *
31421  * Lookup certificates issued by this issuer in the database.
31422  *
31423  * This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
31424  * the lookup operation asynchronously.
31425  *
31426  * 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.
31427  * Since: 2.30
31428  */
31429
31430
31431 /**
31432  * g_tls_database_lookup_certificates_issued_by_async:
31433  * @self: a #GTlsDatabase
31434  * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
31435  * @interaction: (allow-none): used to interact with the user if necessary
31436  * @flags: Flags which affect the lookup operation.
31437  * @cancellable: (allow-none): a #GCancellable, or %NULL
31438  * @callback: callback to call when the operation completes
31439  * @user_data: the data to pass to the callback function
31440  *
31441  * Asynchronously lookup certificates issued by this issuer in the database. See
31442  * g_tls_database_lookup_certificates_issued_by() for more information.
31443  *
31444  * The database may choose to hold a reference to the issuer byte array for the duration
31445  * of of this asynchronous operation. The byte array should not be modified during
31446  * this time.
31447  *
31448  * Since: 2.30
31449  */
31450
31451
31452 /**
31453  * g_tls_database_lookup_certificates_issued_by_finish:
31454  * @self: a #GTlsDatabase
31455  * @result: a #GAsyncResult.
31456  * @error: a #GError pointer, or %NULL
31457  *
31458  * Finish an asynchronous lookup of certificates. See
31459  * g_tls_database_lookup_certificates_issued_by() for more information.
31460  *
31461  * 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.
31462  * Since: 2.30
31463  */
31464
31465
31466 /**
31467  * g_tls_database_verify_chain:
31468  * @self: a #GTlsDatabase
31469  * @chain: a #GTlsCertificate chain
31470  * @purpose: the purpose that this certificate chain will be used for.
31471  * @identity: (allow-none): the expected peer identity
31472  * @interaction: (allow-none): used to interact with the user if necessary
31473  * @flags: additional verify flags
31474  * @cancellable: (allow-none): a #GCancellable, or %NULL
31475  * @error: (allow-none): a #GError, or %NULL
31476  *
31477  * Verify's a certificate chain after looking up and adding any missing
31478  * certificates to the chain.
31479  *
31480  * @chain is a chain of #GTlsCertificate objects each pointing to the next
31481  * certificate in the chain by its %issuer property. The chain may initially
31482  * consist of one or more certificates. After the verification process is
31483  * complete, @chain may be modified by adding missing certificates, or removing
31484  * extra certificates. If a certificate anchor was found, then it is added to
31485  * the @chain.
31486  *
31487  * @purpose describes the purpose (or usage) for which the certificate
31488  * is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
31489  * which means that the certificate is being used to authenticate a server
31490  * (and we are acting as the client).
31491  *
31492  * The @identity is used to check for pinned certificates (trust exceptions)
31493  * in the database. These will override the normal verification process on a
31494  * host by host basis.
31495  *
31496  * Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
31497  * used.
31498  *
31499  * This function can block, use g_tls_database_verify_chain_async() to perform
31500  * the verification operation asynchronously.
31501  *
31502  * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
31503  * Since: 2.30
31504  */
31505
31506
31507 /**
31508  * g_tls_database_verify_chain_async:
31509  * @self: a #GTlsDatabase
31510  * @chain: a #GTlsCertificate chain
31511  * @purpose: the purpose that this certificate chain will be used for.
31512  * @identity: (allow-none): the expected peer identity
31513  * @interaction: (allow-none): used to interact with the user if necessary
31514  * @flags: additional verify flags
31515  * @cancellable: (allow-none): a #GCancellable, or %NULL
31516  * @callback: callback to call when the operation completes
31517  * @user_data: the data to pass to the callback function
31518  *
31519  * Asynchronously verify's a certificate chain after looking up and adding
31520  * any missing certificates to the chain. See g_tls_database_verify_chain()
31521  * for more information.
31522  *
31523  * Since: 2.30
31524  */
31525
31526
31527 /**
31528  * g_tls_database_verify_chain_finish:
31529  * @self: a #GTlsDatabase
31530  * @result: a #GAsyncResult.
31531  * @error: a #GError pointer, or %NULL
31532  *
31533  * Finish an asynchronous verify chain operation. See
31534  * g_tls_database_verify_chain() for more information. *
31535  *
31536  * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
31537  * Since: 2.30
31538  */
31539
31540
31541 /**
31542  * g_tls_error_quark:
31543  *
31544  * Gets the TLS error quark.
31545  *
31546  * Returns: a #GQuark.
31547  * Since: 2.28
31548  */
31549
31550
31551 /**
31552  * g_tls_file_database_new:
31553  * @anchors: filename of anchor certificate authorities.
31554  * @error: #GError for error reporting, or %NULL to ignore.
31555  *
31556  * Creates a new #GTlsFileDatabase which uses anchor certificate authorities
31557  * in @anchors to verify certificate chains.
31558  *
31559  * The certificates in @anchors must be PEM encoded.
31560  *
31561  * Returns: (transfer full) (type GTlsFileDatabase): the new #GTlsFileDatabase, or %NULL on error
31562  * Since: 2.30
31563  */
31564
31565
31566 /**
31567  * g_tls_interaction_ask_password:
31568  * @interaction: a #GTlsInteraction object
31569  * @password: a #GTlsPassword object
31570  * @cancellable: an optional #GCancellable cancellation object
31571  * @error: an optional location to place an error on failure
31572  *
31573  * Run synchronous interaction to ask the user for a password. In general,
31574  * g_tls_interaction_invoke_ask_password() should be used instead of this
31575  * function.
31576  *
31577  * Derived subclasses usually implement a password prompt, although they may
31578  * also choose to provide a password from elsewhere. The @password value will
31579  * be filled in and then @callback will be called. Alternatively the user may
31580  * abort this password request, which will usually abort the TLS connection.
31581  *
31582  * If the interaction is cancelled by the cancellation object, or by the
31583  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31584  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31585  * not support immediate cancellation.
31586  *
31587  * Returns: The status of the ask password interaction.
31588  * Since: 2.30
31589  */
31590
31591
31592 /**
31593  * g_tls_interaction_ask_password_async:
31594  * @interaction: a #GTlsInteraction object
31595  * @password: a #GTlsPassword object
31596  * @cancellable: an optional #GCancellable cancellation object
31597  * @callback: (allow-none): will be called when the interaction completes
31598  * @user_data: (allow-none): data to pass to the @callback
31599  *
31600  * Run asynchronous interaction to ask the user for a password. In general,
31601  * g_tls_interaction_invoke_ask_password() should be used instead of this
31602  * function.
31603  *
31604  * Derived subclasses usually implement a password prompt, although they may
31605  * also choose to provide a password from elsewhere. The @password value will
31606  * be filled in and then @callback will be called. Alternatively the user may
31607  * abort this password request, which will usually abort the TLS connection.
31608  *
31609  * If the interaction is cancelled by the cancellation object, or by the
31610  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31611  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31612  * not support immediate cancellation.
31613  *
31614  * Certain implementations may not support immediate cancellation.
31615  *
31616  * Since: 2.30
31617  */
31618
31619
31620 /**
31621  * g_tls_interaction_ask_password_finish:
31622  * @interaction: a #GTlsInteraction object
31623  * @result: the result passed to the callback
31624  * @error: an optional location to place an error on failure
31625  *
31626  * Complete an ask password user interaction request. This should be once
31627  * the g_tls_interaction_ask_password_async() completion callback is called.
31628  *
31629  * If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
31630  * to g_tls_interaction_ask_password() will have its password filled in.
31631  *
31632  * If the interaction is cancelled by the cancellation object, or by the
31633  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31634  * contains a %G_IO_ERROR_CANCELLED error code.
31635  *
31636  * Returns: The status of the ask password interaction.
31637  * Since: 2.30
31638  */
31639
31640
31641 /**
31642  * g_tls_interaction_invoke_ask_password:
31643  * @interaction: a #GTlsInteraction object
31644  * @password: a #GTlsPassword object
31645  * @cancellable: an optional #GCancellable cancellation object
31646  * @error: an optional location to place an error on failure
31647  *
31648  * Invoke the interaction to ask the user for a password. It invokes this
31649  * interaction in the main loop, specifically the #GMainContext returned by
31650  * g_main_context_get_thread_default() when the interaction is created. This
31651  * is called by called by #GTlsConnection or #GTlsDatabase to ask the user
31652  * for a password.
31653  *
31654  * Derived subclasses usually implement a password prompt, although they may
31655  * also choose to provide a password from elsewhere. The @password value will
31656  * be filled in and then @callback will be called. Alternatively the user may
31657  * abort this password request, which will usually abort the TLS connection.
31658  *
31659  * The implementation can either be a synchronous (eg: modal dialog) or an
31660  * asynchronous one (eg: modeless dialog). This function will take care of
31661  * calling which ever one correctly.
31662  *
31663  * If the interaction is cancelled by the cancellation object, or by the
31664  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
31665  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
31666  * not support immediate cancellation.
31667  *
31668  * Returns: The status of the ask password interaction.
31669  * Since: 2.30
31670  */
31671
31672
31673 /**
31674  * g_tls_password_get_description:
31675  * @password: a #GTlsPassword object
31676  *
31677  * Get a description string about what the password will be used for.
31678  *
31679  * Returns: The description of the password.
31680  * Since: 2.30
31681  */
31682
31683
31684 /**
31685  * g_tls_password_get_flags:
31686  * @password: a #GTlsPassword object
31687  *
31688  * Get flags about the password.
31689  *
31690  * Returns: The flags about the password.
31691  * Since: 2.30
31692  */
31693
31694
31695 /**
31696  * g_tls_password_get_value:
31697  * @password: a #GTlsPassword object
31698  * @length: (allow-none): location to place the length of the password.
31699  *
31700  * Get the password value. If @length is not %NULL then it will be
31701  * filled in with the length of the password value. (Note that the
31702  * password value is not nul-terminated, so you can only pass %NULL
31703  * for @length in contexts where you know the password will have a
31704  * certain fixed length.)
31705  *
31706  * Returns: The password value (owned by the password object).
31707  * Since: 2.30
31708  */
31709
31710
31711 /**
31712  * g_tls_password_get_warning:
31713  * @password: a #GTlsPassword object
31714  *
31715  * Get a user readable translated warning. Usually this warning is a
31716  * representation of the password flags returned from
31717  * g_tls_password_get_flags().
31718  *
31719  * Returns: The warning.
31720  * Since: 2.30
31721  */
31722
31723
31724 /**
31725  * g_tls_password_new:
31726  * @flags: the password flags
31727  * @description: description of what the password is for
31728  *
31729  * Create a new #GTlsPassword object.
31730  *
31731  * Returns: (transfer full): The newly allocated password object
31732  */
31733
31734
31735 /**
31736  * g_tls_password_set_description:
31737  * @password: a #GTlsPassword object
31738  * @description: The description of the password
31739  *
31740  * Set a description string about what the password will be used for.
31741  *
31742  * Since: 2.30
31743  */
31744
31745
31746 /**
31747  * g_tls_password_set_flags:
31748  * @password: a #GTlsPassword object
31749  * @flags: The flags about the password
31750  *
31751  * Set flags about the password.
31752  *
31753  * Since: 2.30
31754  */
31755
31756
31757 /**
31758  * g_tls_password_set_value:
31759  * @password: a #GTlsPassword object
31760  * @value: the new password value
31761  * @length: the length of the password, or -1
31762  *
31763  * Set the value for this password. The @value will be copied by the password
31764  * object.
31765  *
31766  * Specify the @length, for a non-nul-terminated password. Pass -1 as
31767  * @length if using a nul-terminated password, and @length will be
31768  * calculated automatically. (Note that the terminating nul is not
31769  * considered part of the password in this case.)
31770  *
31771  * Since: 2.30
31772  */
31773
31774
31775 /**
31776  * g_tls_password_set_value_full:
31777  * @password: a #GTlsPassword object
31778  * @value: the value for the password
31779  * @length: the length of the password, or -1
31780  * @destroy: (allow-none): a function to use to free the password.
31781  *
31782  * Provide the value for this password.
31783  *
31784  * The @value will be owned by the password object, and later freed using
31785  * the @destroy function callback.
31786  *
31787  * Specify the @length, for a non-nul-terminated password. Pass -1 as
31788  * @length if using a nul-terminated password, and @length will be
31789  * calculated automatically. (Note that the terminating nul is not
31790  * considered part of the password in this case.)
31791  *
31792  * Virtual: set_value
31793  * Since: 2.30
31794  */
31795
31796
31797 /**
31798  * g_tls_password_set_warning:
31799  * @password: a #GTlsPassword object
31800  * @warning: The user readable warning
31801  *
31802  * Set a user readable translated warning. Usually this warning is a
31803  * representation of the password flags returned from
31804  * g_tls_password_get_flags().
31805  *
31806  * Since: 2.30
31807  */
31808
31809
31810 /**
31811  * g_tls_server_connection_new:
31812  * @base_io_stream: the #GIOStream to wrap
31813  * @certificate: (allow-none): the default server certificate, or %NULL
31814  * @error: #GError for error reporting, or %NULL to ignore.
31815  *
31816  * Creates a new #GTlsServerConnection wrapping @base_io_stream (which
31817  * must have pollable input and output streams).
31818  *
31819  * Returns: (transfer full) (type GTlsServerConnection): the new #GTlsServerConnection, or %NULL on error
31820  * Since: 2.28
31821  */
31822
31823
31824 /**
31825  * g_unix_connection_receive_credentials:
31826  * @connection: A #GUnixConnection.
31827  * @cancellable: (allow-none): A #GCancellable or %NULL.
31828  * @error: Return location for error or %NULL.
31829  *
31830  * Receives credentials from the sending end of the connection.  The
31831  * sending end has to call g_unix_connection_send_credentials() (or
31832  * similar) for this to work.
31833  *
31834  * As well as reading the credentials this also reads (and discards) a
31835  * single byte from the stream, as this is required for credentials
31836  * passing to work on some implementations.
31837  *
31838  * Other ways to exchange credentials with a foreign peer includes the
31839  * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
31840  *
31841  * Returns: (transfer full): Received credentials on success (free with g_object_unref()), %NULL if @error is set.
31842  * Since: 2.26
31843  */
31844
31845
31846 /**
31847  * g_unix_connection_receive_credentials_async:
31848  * @connection: A #GUnixConnection.
31849  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31850  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
31851  * @user_data: (closure): the data to pass to callback function
31852  *
31853  * Asynchronously receive credentials.
31854  *
31855  * For more details, see g_unix_connection_receive_credentials() which is
31856  * the synchronous version of this call.
31857  *
31858  * When the operation is finished, @callback will be called. You can then call
31859  * g_unix_connection_receive_credentials_finish() to get the result of the operation.
31860  *
31861  * Since: 2.32
31862  */
31863
31864
31865 /**
31866  * g_unix_connection_receive_credentials_finish:
31867  * @connection: A #GUnixConnection.
31868  * @result: a #GAsyncResult.
31869  * @error: a #GError, or %NULL
31870  *
31871  * Finishes an asynchronous receive credentials operation started with
31872  * g_unix_connection_receive_credentials_async().
31873  *
31874  * Returns: (transfer full): a #GCredentials, or %NULL on error. Free the returned object with g_object_unref().
31875  * Since: 2.32
31876  */
31877
31878
31879 /**
31880  * g_unix_connection_receive_fd:
31881  * @connection: a #GUnixConnection
31882  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
31883  * @error: (allow-none): #GError for error reporting, or %NULL to ignore
31884  *
31885  * Receives a file descriptor from the sending end of the connection.
31886  * The sending end has to call g_unix_connection_send_fd() for this
31887  * to work.
31888  *
31889  * As well as reading the fd this also reads a single byte from the
31890  * stream, as this is required for fd passing to work on some
31891  * implementations.
31892  *
31893  * Returns: a file descriptor on success, -1 on error.
31894  * Since: 2.22
31895  */
31896
31897
31898 /**
31899  * g_unix_connection_send_credentials:
31900  * @connection: A #GUnixConnection.
31901  * @cancellable: (allow-none): A #GCancellable or %NULL.
31902  * @error: Return location for error or %NULL.
31903  *
31904  * Passes the credentials of the current user the receiving side
31905  * of the connection. The receiving end has to call
31906  * g_unix_connection_receive_credentials() (or similar) to accept the
31907  * credentials.
31908  *
31909  * As well as sending the credentials this also writes a single NUL
31910  * byte to the stream, as this is required for credentials passing to
31911  * work on some implementations.
31912  *
31913  * Other ways to exchange credentials with a foreign peer includes the
31914  * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
31915  *
31916  * Returns: %TRUE on success, %FALSE if @error is set.
31917  * Since: 2.26
31918  */
31919
31920
31921 /**
31922  * g_unix_connection_send_credentials_async:
31923  * @connection: A #GUnixConnection.
31924  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31925  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
31926  * @user_data: (closure): the data to pass to callback function
31927  *
31928  * Asynchronously send credentials.
31929  *
31930  * For more details, see g_unix_connection_send_credentials() which is
31931  * the synchronous version of this call.
31932  *
31933  * When the operation is finished, @callback will be called. You can then call
31934  * g_unix_connection_send_credentials_finish() to get the result of the operation.
31935  *
31936  * Since: 2.32
31937  */
31938
31939
31940 /**
31941  * g_unix_connection_send_credentials_finish:
31942  * @connection: A #GUnixConnection.
31943  * @result: a #GAsyncResult.
31944  * @error: a #GError, or %NULL
31945  *
31946  * Finishes an asynchronous send credentials operation started with
31947  * g_unix_connection_send_credentials_async().
31948  *
31949  * Returns: %TRUE if the operation was successful, otherwise %FALSE.
31950  * Since: 2.32
31951  */
31952
31953
31954 /**
31955  * g_unix_connection_send_fd:
31956  * @connection: a #GUnixConnection
31957  * @fd: a file descriptor
31958  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31959  * @error: (allow-none): #GError for error reporting, or %NULL to ignore.
31960  *
31961  * Passes a file descriptor to the receiving side of the
31962  * connection. The receiving end has to call g_unix_connection_receive_fd()
31963  * to accept the file descriptor.
31964  *
31965  * As well as sending the fd this also writes a single byte to the
31966  * stream, as this is required for fd passing to work on some
31967  * implementations.
31968  *
31969  * Returns: a %TRUE on success, %NULL on error.
31970  * Since: 2.22
31971  */
31972
31973
31974 /**
31975  * g_unix_credentials_message_get_credentials:
31976  * @message: A #GUnixCredentialsMessage.
31977  *
31978  * Gets the credentials stored in @message.
31979  *
31980  * Returns: (transfer none): A #GCredentials instance. Do not free, it is owned by @message.
31981  * Since: 2.26
31982  */
31983
31984
31985 /**
31986  * g_unix_credentials_message_is_supported:
31987  *
31988  * Checks if passing #GCredentials on a #GSocket is supported on this platform.
31989  *
31990  * Returns: %TRUE if supported, %FALSE otherwise
31991  * Since: 2.26
31992  */
31993
31994
31995 /**
31996  * g_unix_credentials_message_new:
31997  *
31998  * Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
31999  *
32000  * Returns: a new #GUnixCredentialsMessage
32001  * Since: 2.26
32002  */
32003
32004
32005 /**
32006  * g_unix_credentials_message_new_with_credentials:
32007  * @credentials: A #GCredentials object.
32008  *
32009  * Creates a new #GUnixCredentialsMessage holding @credentials.
32010  *
32011  * Returns: a new #GUnixCredentialsMessage
32012  * Since: 2.26
32013  */
32014
32015
32016 /**
32017  * g_unix_fd_list_append:
32018  * @list: a #GUnixFDList
32019  * @fd: a valid open file descriptor
32020  * @error: a #GError pointer
32021  *
32022  * Adds a file descriptor to @list.
32023  *
32024  * The file descriptor is duplicated using dup(). You keep your copy
32025  * of the descriptor and the copy contained in @list will be closed
32026  * when @list is finalized.
32027  *
32028  * A possible cause of failure is exceeding the per-process or
32029  * system-wide file descriptor limit.
32030  *
32031  * The index of the file descriptor in the list is returned.  If you use
32032  * this index with g_unix_fd_list_get() then you will receive back a
32033  * duplicated copy of the same file descriptor.
32034  *
32035  * Returns: the index of the appended fd in case of success, else -1 (and @error is set)
32036  * Since: 2.24
32037  */
32038
32039
32040 /**
32041  * g_unix_fd_list_get:
32042  * @list: a #GUnixFDList
32043  * @index_: the index into the list
32044  * @error: a #GError pointer
32045  *
32046  * Gets a file descriptor out of @list.
32047  *
32048  * @index_ specifies the index of the file descriptor to get.  It is a
32049  * programmer error for @index_ to be out of range; see
32050  * g_unix_fd_list_get_length().
32051  *
32052  * The file descriptor is duplicated using dup() and set as
32053  * close-on-exec before being returned.  You must call close() on it
32054  * when you are done.
32055  *
32056  * A possible cause of failure is exceeding the per-process or
32057  * system-wide file descriptor limit.
32058  *
32059  * Returns: the file descriptor, or -1 in case of error
32060  * Since: 2.24
32061  */
32062
32063
32064 /**
32065  * g_unix_fd_list_get_length:
32066  * @list: a #GUnixFDList
32067  *
32068  * Gets the length of @list (ie: the number of file descriptors
32069  * contained within).
32070  *
32071  * Returns: the length of @list
32072  * Since: 2.24
32073  */
32074
32075
32076 /**
32077  * g_unix_fd_list_new:
32078  *
32079  * Creates a new #GUnixFDList containing no file descriptors.
32080  *
32081  * Returns: a new #GUnixFDList
32082  * Since: 2.24
32083  */
32084
32085
32086 /**
32087  * g_unix_fd_list_new_from_array:
32088  * @fds: (array length=n_fds): the initial list of file descriptors
32089  * @n_fds: the length of #fds, or -1
32090  *
32091  * Creates a new #GUnixFDList containing the file descriptors given in
32092  * @fds.  The file descriptors become the property of the new list and
32093  * may no longer be used by the caller.  The array itself is owned by
32094  * the caller.
32095  *
32096  * Each file descriptor in the array should be set to close-on-exec.
32097  *
32098  * If @n_fds is -1 then @fds must be terminated with -1.
32099  *
32100  * Returns: a new #GUnixFDList
32101  * Since: 2.24
32102  */
32103
32104
32105 /**
32106  * g_unix_fd_list_peek_fds:
32107  * @list: a #GUnixFDList
32108  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
32109  *
32110  * Returns the array of file descriptors that is contained in this
32111  * object.
32112  *
32113  * After this call, the descriptors remain the property of @list.  The
32114  * caller must not close them and must not free the array.  The array is
32115  * valid only until @list is changed in any way.
32116  *
32117  * If @length is non-%NULL then it is set to the number of file
32118  * descriptors in the returned array. The returned array is also
32119  * terminated with -1.
32120  *
32121  * This function never returns %NULL. In case there are no file
32122  * descriptors contained in @list, an empty array is returned.
32123  *
32124  * Returns: (array length=length) (transfer none): an array of file descriptors
32125  * Since: 2.24
32126  */
32127
32128
32129 /**
32130  * g_unix_fd_list_steal_fds:
32131  * @list: a #GUnixFDList
32132  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
32133  *
32134  * Returns the array of file descriptors that is contained in this
32135  * object.
32136  *
32137  * After this call, the descriptors are no longer contained in
32138  * @list. Further calls will return an empty list (unless more
32139  * descriptors have been added).
32140  *
32141  * The return result of this function must be freed with g_free().
32142  * The caller is also responsible for closing all of the file
32143  * descriptors.  The file descriptors in the array are set to
32144  * close-on-exec.
32145  *
32146  * If @length is non-%NULL then it is set to the number of file
32147  * descriptors in the returned array. The returned array is also
32148  * terminated with -1.
32149  *
32150  * This function never returns %NULL. In case there are no file
32151  * descriptors contained in @list, an empty array is returned.
32152  *
32153  * Returns: (array length=length) (transfer full): an array of file descriptors
32154  * Since: 2.24
32155  */
32156
32157
32158 /**
32159  * g_unix_fd_message_append_fd:
32160  * @message: a #GUnixFDMessage
32161  * @fd: a valid open file descriptor
32162  * @error: a #GError pointer
32163  *
32164  * Adds a file descriptor to @message.
32165  *
32166  * The file descriptor is duplicated using dup(). You keep your copy
32167  * of the descriptor and the copy contained in @message will be closed
32168  * when @message is finalized.
32169  *
32170  * A possible cause of failure is exceeding the per-process or
32171  * system-wide file descriptor limit.
32172  *
32173  * Returns: %TRUE in case of success, else %FALSE (and @error is set)
32174  * Since: 2.22
32175  */
32176
32177
32178 /**
32179  * g_unix_fd_message_get_fd_list:
32180  * @message: a #GUnixFDMessage
32181  *
32182  * Gets the #GUnixFDList contained in @message.  This function does not
32183  * return a reference to the caller, but the returned list is valid for
32184  * the lifetime of @message.
32185  *
32186  * Returns: (transfer none): the #GUnixFDList from @message
32187  * Since: 2.24
32188  */
32189
32190
32191 /**
32192  * g_unix_fd_message_new:
32193  *
32194  * Creates a new #GUnixFDMessage containing an empty file descriptor
32195  * list.
32196  *
32197  * Returns: a new #GUnixFDMessage
32198  * Since: 2.22
32199  */
32200
32201
32202 /**
32203  * g_unix_fd_message_new_with_fd_list:
32204  * @fd_list: a #GUnixFDList
32205  *
32206  * Creates a new #GUnixFDMessage containing @list.
32207  *
32208  * Returns: a new #GUnixFDMessage
32209  * Since: 2.24
32210  */
32211
32212
32213 /**
32214  * g_unix_fd_message_steal_fds:
32215  * @message: a #GUnixFDMessage
32216  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
32217  *
32218  * Returns the array of file descriptors that is contained in this
32219  * object.
32220  *
32221  * After this call, the descriptors are no longer contained in
32222  * @message. Further calls will return an empty list (unless more
32223  * descriptors have been added).
32224  *
32225  * The return result of this function must be freed with g_free().
32226  * The caller is also responsible for closing all of the file
32227  * descriptors.
32228  *
32229  * If @length is non-%NULL then it is set to the number of file
32230  * descriptors in the returned array. The returned array is also
32231  * terminated with -1.
32232  *
32233  * This function never returns %NULL. In case there are no file
32234  * descriptors contained in @message, an empty array is returned.
32235  *
32236  * Returns: (array length=length) (transfer full): an array of file descriptors
32237  * Since: 2.22
32238  */
32239
32240
32241 /**
32242  * g_unix_input_stream_get_close_fd:
32243  * @stream: a #GUnixInputStream
32244  *
32245  * Returns whether the file descriptor of @stream will be
32246  * closed when the stream is closed.
32247  *
32248  * Returns: %TRUE if the file descriptor is closed when done
32249  * Since: 2.20
32250  */
32251
32252
32253 /**
32254  * g_unix_input_stream_get_fd:
32255  * @stream: a #GUnixInputStream
32256  *
32257  * Return the UNIX file descriptor that the stream reads from.
32258  *
32259  * Returns: The file descriptor of @stream
32260  * Since: 2.20
32261  */
32262
32263
32264 /**
32265  * g_unix_input_stream_new:
32266  * @fd: a UNIX file descriptor
32267  * @close_fd: %TRUE to close the file descriptor when done
32268  *
32269  * Creates a new #GUnixInputStream for the given @fd.
32270  *
32271  * If @close_fd is %TRUE, the file descriptor will be closed
32272  * when the stream is closed.
32273  *
32274  * Returns: a new #GUnixInputStream
32275  */
32276
32277
32278 /**
32279  * g_unix_input_stream_set_close_fd:
32280  * @stream: a #GUnixInputStream
32281  * @close_fd: %TRUE to close the file descriptor when done
32282  *
32283  * Sets whether the file descriptor of @stream shall be closed
32284  * when the stream is closed.
32285  *
32286  * Since: 2.20
32287  */
32288
32289
32290 /**
32291  * g_unix_is_mount_path_system_internal:
32292  * @mount_path: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
32293  *
32294  * Determines if @mount_path is considered an implementation of the
32295  * OS. This is primarily used for hiding mountable and mounted volumes
32296  * that only are used in the OS and has little to no relevance to the
32297  * casual user.
32298  *
32299  * Returns: %TRUE if @mount_path is considered an implementation detail of the OS.
32300  */
32301
32302
32303 /**
32304  * g_unix_mount_at: (skip)
32305  * @mount_path: path for a possible unix mount.
32306  * @time_read: (out) (allow-none): guint64 to contain a timestamp.
32307  *
32308  * Gets a #GUnixMountEntry for a given mount path. If @time_read
32309  * is set, it will be filled with a unix timestamp for checking
32310  * if the mounts have changed since with g_unix_mounts_changed_since().
32311  *
32312  * Returns: (transfer full): a #GUnixMountEntry.
32313  */
32314
32315
32316 /**
32317  * g_unix_mount_compare:
32318  * @mount1: first #GUnixMountEntry to compare.
32319  * @mount2: second #GUnixMountEntry to compare.
32320  *
32321  * Compares two unix mounts.
32322  *
32323  * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
32324  */
32325
32326
32327 /**
32328  * g_unix_mount_free:
32329  * @mount_entry: a #GUnixMountEntry.
32330  *
32331  * Frees a unix mount.
32332  */
32333
32334
32335 /**
32336  * g_unix_mount_get_device_path:
32337  * @mount_entry: a #GUnixMount.
32338  *
32339  * Gets the device path for a unix mount.
32340  *
32341  * Returns: a string containing the device path.
32342  */
32343
32344
32345 /**
32346  * g_unix_mount_get_fs_type:
32347  * @mount_entry: a #GUnixMount.
32348  *
32349  * Gets the filesystem type for the unix mount.
32350  *
32351  * Returns: a string containing the file system type.
32352  */
32353
32354
32355 /**
32356  * g_unix_mount_get_mount_path:
32357  * @mount_entry: input #GUnixMountEntry to get the mount path for.
32358  *
32359  * Gets the mount path for a unix mount.
32360  *
32361  * Returns: the mount path for @mount_entry.
32362  */
32363
32364
32365 /**
32366  * g_unix_mount_guess_can_eject:
32367  * @mount_entry: a #GUnixMountEntry
32368  *
32369  * Guesses whether a Unix mount can be ejected.
32370  *
32371  * Returns: %TRUE if @mount_entry is deemed to be ejectable.
32372  */
32373
32374
32375 /**
32376  * g_unix_mount_guess_icon:
32377  * @mount_entry: a #GUnixMountEntry
32378  *
32379  * Guesses the icon of a Unix mount.
32380  *
32381  * Returns: (transfer full): a #GIcon
32382  */
32383
32384
32385 /**
32386  * g_unix_mount_guess_name:
32387  * @mount_entry: a #GUnixMountEntry
32388  *
32389  * Guesses the name of a Unix mount.
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_guess_should_display:
32398  * @mount_entry: a #GUnixMountEntry
32399  *
32400  * Guesses whether a Unix mount should be displayed in the UI.
32401  *
32402  * Returns: %TRUE if @mount_entry is deemed to be displayable.
32403  */
32404
32405
32406 /**
32407  * g_unix_mount_guess_symbolic_icon:
32408  * @mount_entry: a #GUnixMountEntry
32409  *
32410  * Guesses the symbolic icon of a Unix mount.
32411  *
32412  * Returns: (transfer full): a #GIcon
32413  * Since: 2.34
32414  */
32415
32416
32417 /**
32418  * g_unix_mount_is_readonly:
32419  * @mount_entry: a #GUnixMount.
32420  *
32421  * Checks if a unix mount is mounted read only.
32422  *
32423  * Returns: %TRUE if @mount_entry is read only.
32424  */
32425
32426
32427 /**
32428  * g_unix_mount_is_system_internal:
32429  * @mount_entry: a #GUnixMount.
32430  *
32431  * Checks if a unix mount is a system path.
32432  *
32433  * Returns: %TRUE if the unix mount is for a system path.
32434  */
32435
32436
32437 /**
32438  * g_unix_mount_monitor_new:
32439  *
32440  * Gets a new #GUnixMountMonitor. The default rate limit for which the
32441  * monitor will report consecutive changes for the mount and mount
32442  * point entry files is the default for a #GFileMonitor. Use
32443  * g_unix_mount_monitor_set_rate_limit() to change this.
32444  *
32445  * Returns: a #GUnixMountMonitor.
32446  */
32447
32448
32449 /**
32450  * g_unix_mount_monitor_set_rate_limit:
32451  * @mount_monitor: a #GUnixMountMonitor
32452  * @limit_msec: a integer with the limit in milliseconds to poll for changes.
32453  *
32454  * Sets the rate limit to which the @mount_monitor will report
32455  * consecutive change events to the mount and mount point entry files.
32456  *
32457  * Since: 2.18
32458  */
32459
32460
32461 /**
32462  * g_unix_mount_point_compare:
32463  * @mount1: a #GUnixMount.
32464  * @mount2: a #GUnixMount.
32465  *
32466  * Compares two unix mount points.
32467  *
32468  * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
32469  */
32470
32471
32472 /**
32473  * g_unix_mount_point_free:
32474  * @mount_point: unix mount point to free.
32475  *
32476  * Frees a unix mount point.
32477  */
32478
32479
32480 /**
32481  * g_unix_mount_point_get_device_path:
32482  * @mount_point: a #GUnixMountPoint.
32483  *
32484  * Gets the device path for a unix mount point.
32485  *
32486  * Returns: a string containing the device path.
32487  */
32488
32489
32490 /**
32491  * g_unix_mount_point_get_fs_type:
32492  * @mount_point: a #GUnixMountPoint.
32493  *
32494  * Gets the file system type for the mount point.
32495  *
32496  * Returns: a string containing the file system type.
32497  */
32498
32499
32500 /**
32501  * g_unix_mount_point_get_mount_path:
32502  * @mount_point: a #GUnixMountPoint.
32503  *
32504  * Gets the mount path for a unix mount point.
32505  *
32506  * Returns: a string containing the mount path.
32507  */
32508
32509
32510 /**
32511  * g_unix_mount_point_get_options:
32512  * @mount_point: a #GUnixMountPoint.
32513  *
32514  * Gets the options for the mount point.
32515  *
32516  * Returns: a string containing the options.
32517  * Since: 2.32
32518  */
32519
32520
32521 /**
32522  * g_unix_mount_point_guess_can_eject:
32523  * @mount_point: a #GUnixMountPoint
32524  *
32525  * Guesses whether a Unix mount point can be ejected.
32526  *
32527  * Returns: %TRUE if @mount_point is deemed to be ejectable.
32528  */
32529
32530
32531 /**
32532  * g_unix_mount_point_guess_icon:
32533  * @mount_point: a #GUnixMountPoint
32534  *
32535  * Guesses the icon of a Unix mount point.
32536  *
32537  * Returns: (transfer full): a #GIcon
32538  */
32539
32540
32541 /**
32542  * g_unix_mount_point_guess_name:
32543  * @mount_point: a #GUnixMountPoint
32544  *
32545  * Guesses the name of a Unix mount point.
32546  * The result is a translated string.
32547  *
32548  * Returns: A newly allocated string that must be freed with g_free()
32549  */
32550
32551
32552 /**
32553  * g_unix_mount_point_guess_symbolic_icon:
32554  * @mount_point: a #GUnixMountPoint
32555  *
32556  * Guesses the symbolic icon of a Unix mount point.
32557  *
32558  * Returns: (transfer full): a #GIcon
32559  * Since: 2.34
32560  */
32561
32562
32563 /**
32564  * g_unix_mount_point_is_loopback:
32565  * @mount_point: a #GUnixMountPoint.
32566  *
32567  * Checks if a unix mount point is a loopback device.
32568  *
32569  * Returns: %TRUE if the mount point is a loopback. %FALSE otherwise.
32570  */
32571
32572
32573 /**
32574  * g_unix_mount_point_is_readonly:
32575  * @mount_point: a #GUnixMountPoint.
32576  *
32577  * Checks if a unix mount point is read only.
32578  *
32579  * Returns: %TRUE if a mount point is read only.
32580  */
32581
32582
32583 /**
32584  * g_unix_mount_point_is_user_mountable:
32585  * @mount_point: a #GUnixMountPoint.
32586  *
32587  * Checks if a unix mount point is mountable by the user.
32588  *
32589  * Returns: %TRUE if the mount point is user mountable.
32590  */
32591
32592
32593 /**
32594  * g_unix_mount_points_changed_since:
32595  * @time: guint64 to contain a timestamp.
32596  *
32597  * Checks if the unix mount points have changed since a given unix time.
32598  *
32599  * Returns: %TRUE if the mount points have changed since @time.
32600  */
32601
32602
32603 /**
32604  * g_unix_mount_points_get: (skip)
32605  * @time_read: (out) (allow-none): guint64 to contain a timestamp.
32606  *
32607  * Gets a #GList of #GUnixMountPoint containing the unix mount points.
32608  * If @time_read is set, it will be filled with the mount timestamp,
32609  * allowing for checking if the mounts have changed with
32610  * g_unix_mount_points_changed_since().
32611  *
32612  * Returns: (element-type GUnixMountPoint) (transfer full): a #GList of the UNIX mountpoints.
32613  */
32614
32615
32616 /**
32617  * g_unix_mounts_changed_since:
32618  * @time: guint64 to contain a timestamp.
32619  *
32620  * Checks if the unix mounts have changed since a given unix time.
32621  *
32622  * Returns: %TRUE if the mounts have changed since @time.
32623  */
32624
32625
32626 /**
32627  * g_unix_mounts_get: (skip)
32628  * @time_read: (out) (allow-none): guint64 to contain a timestamp, or %NULL
32629  *
32630  * Gets a #GList of #GUnixMountEntry containing the unix mounts.
32631  * If @time_read is set, it will be filled with the mount
32632  * timestamp, allowing for checking if the mounts have changed
32633  * with g_unix_mounts_changed_since().
32634  *
32635  * Returns: (element-type GUnixMountEntry) (transfer full): a #GList of the UNIX mounts.
32636  */
32637
32638
32639 /**
32640  * g_unix_output_stream_get_close_fd:
32641  * @stream: a #GUnixOutputStream
32642  *
32643  * Returns whether the file descriptor of @stream will be
32644  * closed when the stream is closed.
32645  *
32646  * Returns: %TRUE if the file descriptor is closed when done
32647  * Since: 2.20
32648  */
32649
32650
32651 /**
32652  * g_unix_output_stream_get_fd:
32653  * @stream: a #GUnixOutputStream
32654  *
32655  * Return the UNIX file descriptor that the stream writes to.
32656  *
32657  * Returns: The file descriptor of @stream
32658  * Since: 2.20
32659  */
32660
32661
32662 /**
32663  * g_unix_output_stream_new:
32664  * @fd: a UNIX file descriptor
32665  * @close_fd: %TRUE to close the file descriptor when done
32666  *
32667  * Creates a new #GUnixOutputStream for the given @fd.
32668  *
32669  * If @close_fd, is %TRUE, the file descriptor will be closed when
32670  * the output stream is destroyed.
32671  *
32672  * Returns: a new #GOutputStream
32673  */
32674
32675
32676 /**
32677  * g_unix_output_stream_set_close_fd:
32678  * @stream: a #GUnixOutputStream
32679  * @close_fd: %TRUE to close the file descriptor when done
32680  *
32681  * Sets whether the file descriptor of @stream shall be closed
32682  * when the stream is closed.
32683  *
32684  * Since: 2.20
32685  */
32686
32687
32688 /**
32689  * g_unix_socket_address_abstract_names_supported:
32690  *
32691  * Checks if abstract UNIX domain socket names are supported.
32692  *
32693  * Returns: %TRUE if supported, %FALSE otherwise
32694  * Since: 2.22
32695  */
32696
32697
32698 /**
32699  * g_unix_socket_address_get_address_type:
32700  * @address: a #GInetSocketAddress
32701  *
32702  * Gets @address's type.
32703  *
32704  * Returns: a #GUnixSocketAddressType
32705  * Since: 2.26
32706  */
32707
32708
32709 /**
32710  * g_unix_socket_address_get_is_abstract:
32711  * @address: a #GInetSocketAddress
32712  *
32713  * Tests if @address is abstract.
32714  *
32715  * Returns: %TRUE if the address is abstract, %FALSE otherwise
32716  * Since: 2.22
32717  * Deprecated: Use g_unix_socket_address_get_address_type()
32718  */
32719
32720
32721 /**
32722  * g_unix_socket_address_get_path:
32723  * @address: a #GInetSocketAddress
32724  *
32725  * Gets @address's path, or for abstract sockets the "name".
32726  *
32727  * Guaranteed to be zero-terminated, but an abstract socket
32728  * may contain embedded zeros, and thus you should use
32729  * g_unix_socket_address_get_path_len() to get the true length
32730  * of this string.
32731  *
32732  * Returns: the path for @address
32733  * Since: 2.22
32734  */
32735
32736
32737 /**
32738  * g_unix_socket_address_get_path_len:
32739  * @address: a #GInetSocketAddress
32740  *
32741  * Gets the length of @address's path.
32742  *
32743  * For details, see g_unix_socket_address_get_path().
32744  *
32745  * Returns: the length of the path
32746  * Since: 2.22
32747  */
32748
32749
32750 /**
32751  * g_unix_socket_address_new:
32752  * @path: the socket path
32753  *
32754  * Creates a new #GUnixSocketAddress for @path.
32755  *
32756  * To create abstract socket addresses, on systems that support that,
32757  * use g_unix_socket_address_new_abstract().
32758  *
32759  * Returns: a new #GUnixSocketAddress
32760  * Since: 2.22
32761  */
32762
32763
32764 /**
32765  * g_unix_socket_address_new_abstract:
32766  * @path: (array length=path_len) (element-type gchar): the abstract name
32767  * @path_len: the length of @path, or -1
32768  *
32769  * Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
32770  * #GUnixSocketAddress for @path.
32771  *
32772  * Returns: a new #GUnixSocketAddress
32773  * Deprecated: Use g_unix_socket_address_new_with_type().
32774  */
32775
32776
32777 /**
32778  * g_unix_socket_address_new_with_type:
32779  * @path: (array length=path_len) (element-type gchar): the name
32780  * @path_len: the length of @path, or -1
32781  * @type: a #GUnixSocketAddressType
32782  *
32783  * Creates a new #GUnixSocketAddress of type @type with name @path.
32784  *
32785  * If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
32786  * calling g_unix_socket_address_new().
32787  *
32788  * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
32789  * bytes of @path will be copied to the socket's path, and only those
32790  * bytes will be considered part of the name. (If @path_len is -1,
32791  * then @path is assumed to be NUL-terminated.) For example, if @path
32792  * was "test", then calling g_socket_address_get_native_size() on the
32793  * returned socket would return 7 (2 bytes of overhead, 1 byte for the
32794  * abstract-socket indicator byte, and 4 bytes for the name "test").
32795  *
32796  * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
32797  * @path_len bytes of @path will be copied to the socket's path, the
32798  * rest of the path will be padded with 0 bytes, and the entire
32799  * zero-padded buffer will be considered the name. (As above, if
32800  * @path_len is -1, then @path is assumed to be NUL-terminated.) In
32801  * this case, g_socket_address_get_native_size() will always return
32802  * the full size of a <literal>struct sockaddr_un</literal>, although
32803  * g_unix_socket_address_get_path_len() will still return just the
32804  * length of @path.
32805  *
32806  * %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
32807  * %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
32808  * when connecting to a server created by another process, you must
32809  * use the appropriate type corresponding to how that process created
32810  * its listening socket.
32811  *
32812  * Returns: a new #GUnixSocketAddress
32813  * Since: 2.26
32814  */
32815
32816
32817 /**
32818  * g_vfs_get_default:
32819  *
32820  * Gets the default #GVfs for the system.
32821  *
32822  * Returns: (transfer none): a #GVfs.
32823  */
32824
32825
32826 /**
32827  * g_vfs_get_file_for_path:
32828  * @vfs: a #GVfs.
32829  * @path: a string containing a VFS path.
32830  *
32831  * Gets a #GFile for @path.
32832  *
32833  * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
32834  */
32835
32836
32837 /**
32838  * g_vfs_get_file_for_uri:
32839  * @vfs: a#GVfs.
32840  * @uri: a string containing a URI
32841  *
32842  * Gets a #GFile for @uri.
32843  *
32844  * This operation never fails, but the returned object
32845  * might not support any I/O operation if the URI
32846  * is malformed or if the URI scheme is not supported.
32847  *
32848  * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
32849  */
32850
32851
32852 /**
32853  * g_vfs_get_local:
32854  *
32855  * Gets the local #GVfs for the system.
32856  *
32857  * Returns: (transfer none): a #GVfs.
32858  */
32859
32860
32861 /**
32862  * g_vfs_get_supported_uri_schemes:
32863  * @vfs: a #GVfs.
32864  *
32865  * Gets a list of URI schemes supported by @vfs.
32866  *
32867  * Returns: (transfer none): a %NULL-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
32868  */
32869
32870
32871 /**
32872  * g_vfs_is_active:
32873  * @vfs: a #GVfs.
32874  *
32875  * Checks if the VFS is active.
32876  *
32877  * Returns: %TRUE if construction of the @vfs was successful and it is now active.
32878  */
32879
32880
32881 /**
32882  * g_vfs_parse_name:
32883  * @vfs: a #GVfs.
32884  * @parse_name: a string to be parsed by the VFS module.
32885  *
32886  * This operation never fails, but the returned object might
32887  * not support any I/O operations if the @parse_name cannot
32888  * be parsed by the #GVfs module.
32889  *
32890  * Returns: (transfer full): a #GFile for the given @parse_name. Free the returned object with g_object_unref().
32891  */
32892
32893
32894 /**
32895  * g_volume_can_eject:
32896  * @volume: a #GVolume.
32897  *
32898  * Checks if a volume can be ejected.
32899  *
32900  * Returns: %TRUE if the @volume can be ejected. %FALSE otherwise.
32901  */
32902
32903
32904 /**
32905  * g_volume_can_mount:
32906  * @volume: a #GVolume.
32907  *
32908  * Checks if a volume can be mounted.
32909  *
32910  * Returns: %TRUE if the @volume can be mounted. %FALSE otherwise.
32911  */
32912
32913
32914 /**
32915  * g_volume_eject:
32916  * @volume: a #GVolume.
32917  * @flags: flags affecting the unmount if required for eject
32918  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32919  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32920  * @user_data: user data that gets passed to @callback
32921  *
32922  * Ejects a volume. This is an asynchronous operation, and is
32923  * finished by calling g_volume_eject_finish() with the @volume
32924  * and #GAsyncResult returned in the @callback.
32925  *
32926  * Deprecated: 2.22: Use g_volume_eject_with_operation() instead.
32927  */
32928
32929
32930 /**
32931  * g_volume_eject_finish:
32932  * @volume: pointer to a #GVolume.
32933  * @result: a #GAsyncResult.
32934  * @error: a #GError location to store an error, or %NULL to ignore
32935  *
32936  * Finishes ejecting a volume. If any errors occurred during the operation,
32937  * @error will be set to contain the errors and %FALSE will be returned.
32938  *
32939  * Returns: %TRUE, %FALSE if operation failed.
32940  * Deprecated: 2.22: Use g_volume_eject_with_operation_finish() instead.
32941  */
32942
32943
32944 /**
32945  * g_volume_eject_with_operation:
32946  * @volume: a #GVolume.
32947  * @flags: flags affecting the unmount if required for eject
32948  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
32949  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
32950  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
32951  * @user_data: user data passed to @callback.
32952  *
32953  * Ejects a volume. This is an asynchronous operation, and is
32954  * finished by calling g_volume_eject_with_operation_finish() with the @volume
32955  * and #GAsyncResult data returned in the @callback.
32956  *
32957  * Since: 2.22
32958  */
32959
32960
32961 /**
32962  * g_volume_eject_with_operation_finish:
32963  * @volume: a #GVolume.
32964  * @result: a #GAsyncResult.
32965  * @error: a #GError location to store the error occurring, or %NULL to ignore.
32966  *
32967  * Finishes ejecting a volume. If any errors occurred during the operation,
32968  * @error will be set to contain the errors and %FALSE will be returned.
32969  *
32970  * Returns: %TRUE if the volume was successfully ejected. %FALSE otherwise.
32971  * Since: 2.22
32972  */
32973
32974
32975 /**
32976  * g_volume_enumerate_identifiers:
32977  * @volume: a #GVolume
32978  *
32979  * Gets the kinds of <link linkend="volume-identifier">identifiers</link>
32980  * that @volume has. Use g_volume_get_identifier() to obtain
32981  * the identifiers themselves.
32982  *
32983  * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
32984  */
32985
32986
32987 /**
32988  * g_volume_get_activation_root:
32989  * @volume: a #GVolume
32990  *
32991  * Gets the activation root for a #GVolume if it is known ahead of
32992  * mount time. Returns %NULL otherwise. If not %NULL and if @volume
32993  * is mounted, then the result of g_mount_get_root() on the
32994  * #GMount object obtained from g_volume_get_mount() will always
32995  * either be equal or a prefix of what this function returns. In
32996  * other words, in code
32997  *
32998  * <programlisting>
32999  *   GMount *mount;
33000  *   GFile *mount_root
33001  *   GFile *volume_activation_root;
33002  *
33003  *   mount = g_volume_get_mount (volume); /&ast; mounted, so never NULL &ast;/
33004  *   mount_root = g_mount_get_root (mount);
33005  *   volume_activation_root = g_volume_get_activation_root(volume); /&ast; assume not NULL &ast;/
33006  * </programlisting>
33007  *
33008  * then the expression
33009  *
33010  * <programlisting>
33011  *   (g_file_has_prefix (volume_activation_root, mount_root) ||
33012  *       g_file_equal (volume_activation_root, mount_root))
33013  * </programlisting>
33014  *
33015  * will always be %TRUE.
33016  *
33017  * Activation roots are typically used in #GVolumeMonitor
33018  * implementations to find the underlying mount to shadow, see
33019  * g_mount_is_shadowed() for more details.
33020  *
33021  * Returns: (transfer full): the activation root of @volume or %NULL. Use g_object_unref() to free.
33022  * Since: 2.18
33023  */
33024
33025
33026 /**
33027  * g_volume_get_drive:
33028  * @volume: a #GVolume.
33029  *
33030  * Gets the drive for the @volume.
33031  *
33032  * 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.
33033  */
33034
33035
33036 /**
33037  * g_volume_get_icon:
33038  * @volume: a #GVolume.
33039  *
33040  * Gets the icon for @volume.
33041  *
33042  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
33043  */
33044
33045
33046 /**
33047  * g_volume_get_identifier:
33048  * @volume: a #GVolume
33049  * @kind: the kind of identifier to return
33050  *
33051  * Gets the identifier of the given kind for @volume.
33052  * See the <link linkend="volume-identifier">introduction</link>
33053  * for more information about volume identifiers.
33054  *
33055  * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GVolume doesn't have this kind of identifier
33056  */
33057
33058
33059 /**
33060  * g_volume_get_mount:
33061  * @volume: a #GVolume.
33062  *
33063  * Gets the mount for the @volume.
33064  *
33065  * 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.
33066  */
33067
33068
33069 /**
33070  * g_volume_get_name:
33071  * @volume: a #GVolume.
33072  *
33073  * Gets the name of @volume.
33074  *
33075  * Returns: the name for the given @volume. The returned string should be freed with g_free() when no longer needed.
33076  */
33077
33078
33079 /**
33080  * g_volume_get_sort_key:
33081  * @volume: A #GVolume.
33082  *
33083  * Gets the sort key for @volume, if any.
33084  *
33085  * Returns: Sorting key for @volume or %NULL if no such key is available.
33086  * Since: 2.32
33087  */
33088
33089
33090 /**
33091  * g_volume_get_symbolic_icon:
33092  * @volume: a #GVolume.
33093  *
33094  * Gets the symbolic icon for @volume.
33095  *
33096  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
33097  * Since: 2.34
33098  */
33099
33100
33101 /**
33102  * g_volume_get_uuid:
33103  * @volume: a #GVolume.
33104  *
33105  * Gets the UUID for the @volume. The reference is typically based on
33106  * the file system UUID for the volume in question and should be
33107  * considered an opaque string. Returns %NULL if there is no UUID
33108  * available.
33109  *
33110  * 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.
33111  */
33112
33113
33114 /**
33115  * g_volume_monitor_adopt_orphan_mount:
33116  * @mount: a #GMount object to find a parent for
33117  *
33118  * This function should be called by any #GVolumeMonitor
33119  * implementation when a new #GMount object is created that is not
33120  * associated with a #GVolume object. It must be called just before
33121  * emitting the @mount_added signal.
33122  *
33123  * If the return value is not %NULL, the caller must associate the
33124  * returned #GVolume object with the #GMount. This involves returning
33125  * it in its g_mount_get_volume() implementation. The caller must
33126  * also listen for the "removed" signal on the returned object
33127  * and give up its reference when handling that signal
33128  *
33129  * Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
33130  * the implementor must take a reference to @mount and return it in
33131  * its g_volume_get_mount() implemented. Also, the implementor must
33132  * listen for the "unmounted" signal on @mount and give up its
33133  * reference upon handling that signal.
33134  *
33135  * There are two main use cases for this function.
33136  *
33137  * One is when implementing a user space file system driver that reads
33138  * blocks of a block device that is already represented by the native
33139  * volume monitor (for example a CD Audio file system driver). Such
33140  * a driver will generate its own #GMount object that needs to be
33141  * associated with the #GVolume object that represents the volume.
33142  *
33143  * The other is for implementing a #GVolumeMonitor whose sole purpose
33144  * is to return #GVolume objects representing entries in the users
33145  * "favorite servers" list or similar.
33146  *
33147  * Returns: (transfer full): the #GVolume object that is the parent for @mount or %NULL if no wants to adopt the #GMount.
33148  * 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.
33149  */
33150
33151
33152 /**
33153  * g_volume_monitor_get:
33154  *
33155  * Gets the volume monitor used by gio.
33156  *
33157  * Returns: (transfer full): a reference to the #GVolumeMonitor used by gio. Call g_object_unref() when done with it.
33158  */
33159
33160
33161 /**
33162  * g_volume_monitor_get_connected_drives:
33163  * @volume_monitor: a #GVolumeMonitor.
33164  *
33165  * Gets a list of drives connected to the system.
33166  *
33167  * The returned list should be freed with g_list_free(), after
33168  * its elements have been unreffed with g_object_unref().
33169  *
33170  * Returns: (element-type GDrive) (transfer full): a #GList of connected #GDrive objects.
33171  */
33172
33173
33174 /**
33175  * g_volume_monitor_get_mount_for_uuid:
33176  * @volume_monitor: a #GVolumeMonitor.
33177  * @uuid: the UUID to look for
33178  *
33179  * Finds a #GMount object by its UUID (see g_mount_get_uuid())
33180  *
33181  * Returns: (transfer full): a #GMount or %NULL if no such mount is available. Free the returned object with g_object_unref().
33182  */
33183
33184
33185 /**
33186  * g_volume_monitor_get_mounts:
33187  * @volume_monitor: a #GVolumeMonitor.
33188  *
33189  * Gets a list of the mounts on the system.
33190  *
33191  * The returned list should be freed with g_list_free(), after
33192  * its elements have been unreffed with g_object_unref().
33193  *
33194  * Returns: (element-type GMount) (transfer full): a #GList of #GMount objects.
33195  */
33196
33197
33198 /**
33199  * g_volume_monitor_get_volume_for_uuid:
33200  * @volume_monitor: a #GVolumeMonitor.
33201  * @uuid: the UUID to look for
33202  *
33203  * Finds a #GVolume object by its UUID (see g_volume_get_uuid())
33204  *
33205  * Returns: (transfer full): a #GVolume or %NULL if no such volume is available. Free the returned object with g_object_unref().
33206  */
33207
33208
33209 /**
33210  * g_volume_monitor_get_volumes:
33211  * @volume_monitor: a #GVolumeMonitor.
33212  *
33213  * Gets a list of the volumes on the system.
33214  *
33215  * The returned list should be freed with g_list_free(), after
33216  * its elements have been unreffed with g_object_unref().
33217  *
33218  * Returns: (element-type GVolume) (transfer full): a #GList of #GVolume objects.
33219  */
33220
33221
33222 /**
33223  * g_volume_mount:
33224  * @volume: a #GVolume.
33225  * @flags: flags affecting the operation
33226  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
33227  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
33228  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
33229  * @user_data: user data that gets passed to @callback
33230  *
33231  * Mounts a volume. This is an asynchronous operation, and is
33232  * finished by calling g_volume_mount_finish() with the @volume
33233  * and #GAsyncResult returned in the @callback.
33234  *
33235  * Virtual: mount_fn
33236  */
33237
33238
33239 /**
33240  * g_volume_mount_finish:
33241  * @volume: a #GVolume
33242  * @result: a #GAsyncResult
33243  * @error: a #GError location to store an error, or %NULL to ignore
33244  *
33245  * Finishes mounting a volume. If any errors occurred during the operation,
33246  * @error will be set to contain the errors and %FALSE will be returned.
33247  *
33248  * If the mount operation succeeded, g_volume_get_mount() on @volume
33249  * is guaranteed to return the mount right after calling this
33250  * function; there's no need to listen for the 'mount-added' signal on
33251  * #GVolumeMonitor.
33252  *
33253  * Returns: %TRUE, %FALSE if operation failed.
33254  */
33255
33256
33257 /**
33258  * g_volume_should_automount:
33259  * @volume: a #GVolume
33260  *
33261  * Returns whether the volume should be automatically mounted.
33262  *
33263  * Returns: %TRUE if the volume should be automatically mounted.
33264  */
33265
33266
33267 /**
33268  * g_win32_input_stream_get_close_handle:
33269  * @stream: a #GWin32InputStream
33270  *
33271  * Returns whether the handle of @stream will be
33272  * closed when the stream is closed.
33273  *
33274  * Returns: %TRUE if the handle is closed when done
33275  * Since: 2.26
33276  */
33277
33278
33279 /**
33280  * g_win32_input_stream_get_handle:
33281  * @stream: a #GWin32InputStream
33282  *
33283  * Return the Windows file handle that the stream reads from.
33284  *
33285  * Returns: The file handle of @stream
33286  * Since: 2.26
33287  */
33288
33289
33290 /**
33291  * g_win32_input_stream_new:
33292  * @handle: a Win32 file handle
33293  * @close_handle: %TRUE to close the handle when done
33294  *
33295  * Creates a new #GWin32InputStream for the given @handle.
33296  *
33297  * If @close_handle is %TRUE, the handle will be closed
33298  * when the stream is closed.
33299  *
33300  * Note that "handle" here means a Win32 HANDLE, not a "file descriptor"
33301  * as used in the Windows C libraries.
33302  *
33303  * Returns: a new #GWin32InputStream
33304  */
33305
33306
33307 /**
33308  * g_win32_input_stream_set_close_handle:
33309  * @stream: a #GWin32InputStream
33310  * @close_handle: %TRUE to close the handle when done
33311  *
33312  * Sets whether the handle of @stream shall be closed
33313  * when the stream is closed.
33314  *
33315  * Since: 2.26
33316  */
33317
33318
33319 /**
33320  * g_win32_output_stream_get_close_handle:
33321  * @stream: a #GWin32OutputStream
33322  *
33323  * Returns whether the handle of @stream will be closed when the
33324  * stream is closed.
33325  *
33326  * Returns: %TRUE if the handle is closed when done
33327  * Since: 2.26
33328  */
33329
33330
33331 /**
33332  * g_win32_output_stream_get_handle:
33333  * @stream: a #GWin32OutputStream
33334  *
33335  * Return the Windows handle that the stream writes to.
33336  *
33337  * Returns: The handle descriptor of @stream
33338  * Since: 2.26
33339  */
33340
33341
33342 /**
33343  * g_win32_output_stream_new:
33344  * @handle: a Win32 file handle
33345  * @close_handle: %TRUE to close the handle when done
33346  *
33347  * Creates a new #GWin32OutputStream for the given @handle.
33348  *
33349  * If @close_handle, is %TRUE, the handle will be closed when the
33350  * output stream is destroyed.
33351  *
33352  * Returns: a new #GOutputStream
33353  * Since: 2.26
33354  */
33355
33356
33357 /**
33358  * g_win32_output_stream_set_close_handle:
33359  * @stream: a #GWin32OutputStream
33360  * @close_handle: %TRUE to close the handle when done
33361  *
33362  * Sets whether the handle of @stream shall be closed when the stream
33363  * is closed.
33364  *
33365  * Since: 2.26
33366  */
33367
33368
33369 /**
33370  * g_zlib_compressor_get_file_info:
33371  * @compressor: a #GZlibCompressor
33372  *
33373  * Returns the #GZlibCompressor:file-info property.
33374  *
33375  * Returns: (transfer none): a #GFileInfo, or %NULL
33376  * Since: 2.26
33377  */
33378
33379
33380 /**
33381  * g_zlib_compressor_new:
33382  * @format: The format to use for the compressed data
33383  * @level: compression level (0-9), -1 for default
33384  *
33385  * Creates a new #GZlibCompressor.
33386  *
33387  * Returns: a new #GZlibCompressor
33388  * Since: 2.24
33389  */
33390
33391
33392 /**
33393  * g_zlib_compressor_set_file_info:
33394  * @compressor: a #GZlibCompressor
33395  * @file_info: (allow-none): a #GFileInfo
33396  *
33397  * Sets @file_info in @compressor. If non-%NULL, and @compressor's
33398  * #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
33399  * it will be used to set the file name and modification time in
33400  * the GZIP header of the compressed data.
33401  *
33402  * Note: it is an error to call this function while a compression is in
33403  * progress; it may only be called immediately after creation of @compressor,
33404  * or after resetting it with g_converter_reset().
33405  *
33406  * Since: 2.26
33407  */
33408
33409
33410 /**
33411  * g_zlib_decompressor_get_file_info:
33412  * @decompressor: a #GZlibDecompressor
33413  *
33414  * Retrieves the #GFileInfo constructed from the GZIP header data
33415  * of compressed data processed by @compressor, or %NULL if @decompressor's
33416  * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
33417  * or the header data was not fully processed yet, or it not present in the
33418  * data stream at all.
33419  *
33420  * Returns: (transfer none): a #GFileInfo, or %NULL
33421  * Since: 2.26
33422  */
33423
33424
33425 /**
33426  * g_zlib_decompressor_new:
33427  * @format: The format to use for the compressed data
33428  *
33429  * Creates a new #GZlibDecompressor.
33430  *
33431  * Returns: a new #GZlibDecompressor
33432  * Since: 2.24
33433  */
33434
33435
33436 /**
33437  * get_all_desktop_entries_for_mime_type:
33438  * @mime_type: a mime type.
33439  * @except: NULL or a strv list
33440  *
33441  * Returns all the desktop ids for @mime_type. The desktop files
33442  * are listed in an order so that default applications are listed before
33443  * non-default ones, and handlers for inherited mimetypes are listed
33444  * after the base ones.
33445  *
33446  * Optionally doesn't list the desktop ids given in the @except
33447  *
33448  * Returns: a #GList containing the desktop ids which claim to handle @mime_type.
33449  */
33450
33451
33452 /**
33453  * mime_info_cache_reload:
33454  * @dir: directory path which needs reloading.
33455  *
33456  * Reload the mime information for the @dir.
33457  */
33458
33459
33460
33461 /************************************************************/
33462 /* THIS FILE IS GENERATED DO NOT EDIT */
33463 /************************************************************/