Update glib annotations to 2.33.1
[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  *
245  * Virtual function table for #GApplication.
246  *
247  * Since: 2.28
248  */
249
250
251 /**
252  * GApplicationCommandLineClass:
253  *
254  * The <structname>GApplicationCommandLineClass</structname> structure
255  * contains private data only
256  *
257  * Since: 2.28
258  */
259
260
261 /**
262  * GCancellable::cancelled:
263  * @cancellable: a #GCancellable.
264  *
265  * Emitted when the operation has been cancelled.
266  *
267  * Can be used by implementations of cancellable operations. If the
268  * operation is cancelled from another thread, the signal will be
269  * emitted in the thread that cancelled the operation, not the
270  * thread that is running the operation.
271  *
272  * Note that disconnecting from this signal (or any signal) in a
273  * multi-threaded program is prone to race conditions. For instance
274  * it is possible that a signal handler may be invoked even
275  * <emphasis>after</emphasis> a call to
276  * g_signal_handler_disconnect() for that handler has already
277  * returned.
278  *
279  * There is also a problem when cancellation happen
280  * right before connecting to the signal. If this happens the
281  * signal will unexpectedly not be emitted, and checking before
282  * connecting to the signal leaves a race condition where this is
283  * still happening.
284  *
285  * In order to make it safe and easy to connect handlers there
286  * are two helper functions: g_cancellable_connect() and
287  * g_cancellable_disconnect() which protect against problems
288  * like this.
289  *
290  * An example of how to us this:
291  * |[
292  *     /<!-- -->* Make sure we don't do any unnecessary work if already cancelled *<!-- -->/
293  *     if (g_cancellable_set_error_if_cancelled (cancellable))
294  *       return;
295  *
296  *     /<!-- -->* Set up all the data needed to be able to
297  *      * handle cancellation of the operation *<!-- -->/
298  *     my_data = my_data_new (...);
299  *
300  *     id = 0;
301  *     if (cancellable)
302  *       id = g_cancellable_connect (cancellable,
303  *                            G_CALLBACK (cancelled_handler)
304  *                            data, NULL);
305  *
306  *     /<!-- -->* cancellable operation here... *<!-- -->/
307  *
308  *     g_cancellable_disconnect (cancellable, id);
309  *
310  *     /<!-- -->* cancelled_handler is never called after this, it
311  *      * is now safe to free the data *<!-- -->/
312  *     my_data_free (my_data);
313  * ]|
314  *
315  * Note that the cancelled signal is emitted in the thread that
316  * the user cancelled from, which may be the main thread. So, the
317  * cancellable signal should not do something that can block.
318  */
319
320
321 /**
322  * GCharsetConverter:
323  *
324  * Conversions between character sets.
325  */
326
327
328 /**
329  * GCredentials:
330  *
331  * The #GCredentials structure contains only private data and
332  * should only be accessed using the provided API.
333  *
334  * Since: 2.26
335  */
336
337
338 /**
339  * GCredentialsClass:
340  *
341  * Class structure for #GCredentials.
342  *
343  * Since: 2.26
344  */
345
346
347 /**
348  * GDBusAuthMechanism:credentials:
349  *
350  * If authenticating as a server, this property contains the
351  * received credentials, if any.
352  *
353  * If authenticating as a client, the property contains the
354  * credentials that were sent, if any.
355  */
356
357
358 /**
359  * GDBusAuthObserver:
360  *
361  * The #GDBusAuthObserver structure contains only private data and
362  * should only be accessed using the provided API.
363  *
364  * Since: 2.26
365  */
366
367
368 /**
369  * GDBusAuthObserver::allow-mechanism:
370  * @observer: The #GDBusAuthObserver emitting the signal.
371  * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
372  *
373  * Emitted to check if @mechanism is allowed to be used.
374  *
375  * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
376  * Since: 2.34
377  */
378
379
380 /**
381  * GDBusAuthObserver::authorize-authenticated-peer:
382  * @observer: The #GDBusAuthObserver emitting the signal.
383  * @stream: A #GIOStream for the #GDBusConnection.
384  * @credentials: (allow-none): Credentials received from the peer or %NULL.
385  *
386  * Emitted to check if a peer that is successfully authenticated
387  * is authorized.
388  *
389  * Returns: %TRUE if the peer is authorized, %FALSE if not.
390  * Since: 2.26
391  */
392
393
394 /**
395  * GDBusAuthObserverClass:
396  * @authorize_authenticated_peer: Signal class handler for the #GDBusAuthObserver::authorize-authenticated-peer signal.
397  *
398  * Class structure for #GDBusAuthObserverClass.
399  *
400  * Since: 2.26
401  */
402
403
404 /**
405  * GDBusConnection:
406  *
407  * The #GDBusConnection structure contains only private data and
408  * should only be accessed using the provided API.
409  *
410  * Since: 2.26
411  */
412
413
414 /**
415  * GDBusConnection::closed:
416  * @connection: The #GDBusConnection emitting the signal.
417  * @remote_peer_vanished: %TRUE if @connection is closed because the remote peer closed its end of the connection.
418  * @error: A #GError with more details about the event or %NULL.
419  *
420  * Emitted when the connection is closed.
421  *
422  * The cause of this event can be
423  * <itemizedlist>
424  * <listitem><para>
425  *    If g_dbus_connection_close() is called. In this case
426  *    @remote_peer_vanished is set to %FALSE and @error is %NULL.
427  * </para></listitem>
428  * <listitem><para>
429  *    If the remote peer closes the connection. In this case
430  *    @remote_peer_vanished is set to %TRUE and @error is set.
431  * </para></listitem>
432  * <listitem><para>
433  *    If the remote peer sends invalid or malformed data. In this
434  *    case @remote_peer_vanished is set to %FALSE and @error
435  *    is set.
436  * </para></listitem>
437  * </itemizedlist>
438  *
439  * Upon receiving this signal, you should give up your reference to
440  * @connection. You are guaranteed that this signal is emitted only
441  * once.
442  *
443  * Since: 2.26
444  */
445
446
447 /**
448  * GDBusConnection:address:
449  *
450  * A D-Bus address specifying potential endpoints that can be used
451  * when establishing the connection.
452  *
453  * Since: 2.26
454  */
455
456
457 /**
458  * GDBusConnection:authentication-observer:
459  *
460  * A #GDBusAuthObserver object to assist in the authentication process or %NULL.
461  *
462  * Since: 2.26
463  */
464
465
466 /**
467  * GDBusConnection:capabilities:
468  *
469  * Flags from the #GDBusCapabilityFlags enumeration
470  * representing connection features negotiated with the other peer.
471  *
472  * Since: 2.26
473  */
474
475
476 /**
477  * GDBusConnection:closed:
478  *
479  * A boolean specifying whether the connection has been closed.
480  *
481  * Since: 2.26
482  */
483
484
485 /**
486  * GDBusConnection:exit-on-close:
487  *
488  * A boolean specifying whether the process will be terminated (by
489  * calling <literal>raise(SIGTERM)</literal>) if the connection
490  * is closed by the remote peer.
491  *
492  * Note that #GDBusConnection objects returned by g_bus_get_finish() and
493  * g_bus_get_sync() will (usually) have this property set to %TRUE.
494  *
495  * Since: 2.26
496  */
497
498
499 /**
500  * GDBusConnection:flags:
501  *
502  * Flags from the #GDBusConnectionFlags enumeration.
503  *
504  * Since: 2.26
505  */
506
507
508 /**
509  * GDBusConnection:guid:
510  *
511  * The GUID of the peer performing the role of server when
512  * authenticating.
513  *
514  * If you are constructing a #GDBusConnection and pass
515  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER in the
516  * #GDBusConnection:flags property then you MUST also set this
517  * property to a valid guid.
518  *
519  * If you are constructing a #GDBusConnection and pass
520  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT in the
521  * #GDBusConnection:flags property you will be able to read the GUID
522  * of the other peer here after the connection has been successfully
523  * initialized.
524  *
525  * Since: 2.26
526  */
527
528
529 /**
530  * GDBusConnection:locked:
531  *
532  * A boolean specifying whether the message is locked.
533  *
534  * Since: 2.26
535  */
536
537
538 /**
539  * GDBusConnection:stream:
540  *
541  * The underlying #GIOStream used for I/O.
542  *
543  * If this is passed on construction and is a #GSocketConnection,
544  * then the corresponding #GSocket will be put into non-blocking mode.
545  *
546  * While the #GDBusConnection is active, it will interact with this
547  * stream from a worker thread, so it is not safe to interact with
548  * the stream directly.
549  *
550  * Since: 2.26
551  */
552
553
554 /**
555  * GDBusConnection:unique-name:
556  *
557  * The unique name as assigned by the message bus or %NULL if the
558  * connection is not open or not a message bus connection.
559  *
560  * Since: 2.26
561  */
562
563
564 /**
565  * GDBusConnectionClass:
566  * @closed: Signal class handler for the #GDBusConnection::closed signal.
567  *
568  * Class structure for #GDBusConnection.
569  *
570  * Since: 2.26
571  */
572
573
574 /**
575  * GDBusInterfaceSkeleton::g-authorize-method:
576  * @interface: The #GDBusInterfaceSkeleton emitting the signal.
577  * @invocation: A #GDBusMethodInvocation.
578  *
579  * Emitted when a method is invoked by a remote caller and used to
580  * determine if the method call is authorized.
581  *
582  * Note that this signal is emitted in a thread dedicated to
583  * handling the method call so handlers are allowed to perform
584  * blocking IO. This means that it is appropriate to call
585  * e.g. <ulink
586  * url="http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#polkit-authority-check-authorization-sync">polkit_authority_check_authorization_sync()</ulink>
587  * with the <ulink
588  * 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.
589  *
590  * If %FALSE is returned then no further handlers are run and the
591  * signal handler must take a reference to @invocation and finish
592  * handling the call (e.g. return an error via
593  * g_dbus_method_invocation_return_error()).
594  *
595  * Otherwise, if %TRUE is returned, signal emission continues. If no
596  * handlers return %FALSE, then the method is dispatched. If
597  * @interface has an enclosing #GDBusObjectSkeleton, then the
598  * #GDBusObjectSkeleton::authorize-method signal handlers run before
599  * the handlers for this signal.
600  *
601  * The default class handler just returns %TRUE.
602  *
603  * Please note that the common case is optimized: if no signals
604  * handlers are connected and the default class handler isn't
605  * overridden (for both @interface and the enclosing
606  * #GDBusObjectSkeleton, if any) and #GDBusInterfaceSkeleton:g-flags does
607  * not have the
608  * %G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD
609  * flags set, no dedicated thread is ever used and the call will be
610  * handled in the same thread as the object that @interface belongs
611  * to was exported in.
612  *
613  * Returns: %TRUE if the call is authorized, %FALSE otherwise.
614  * Since: 2.30
615  */
616
617
618 /**
619  * GDBusInterfaceSkeleton:g-flags:
620  *
621  * Flags from the #GDBusInterfaceSkeletonFlags enumeration.
622  *
623  * Since: 2.30
624  */
625
626
627 /**
628  * GDBusMessage:
629  *
630  * The #GDBusMessage structure contains only private data and should
631  * only be accessed using the provided API.
632  *
633  * Since: 2.26
634  */
635
636
637 /**
638  * GDBusMessageClass:
639  *
640  * Class structure for #GDBusMessage.
641  *
642  * Since: 2.26
643  */
644
645
646 /**
647  * GDBusMethodInvocation:
648  *
649  * The #GDBusMethodInvocation structure contains only private data and
650  * should only be accessed using the provided API.
651  *
652  * Since: 2.26
653  */
654
655
656 /**
657  * GDBusMethodInvocationClass:
658  *
659  * Class structure for #GDBusMethodInvocation.
660  *
661  * Since: 2.26
662  */
663
664
665 /**
666  * GDBusObject::interface-added:
667  * @object: The #GDBusObject emitting the signal.
668  * @interface: The #GDBusInterface that was added.
669  *
670  * Emitted when @interface is added to @object.
671  *
672  * Since: 2.30
673  */
674
675
676 /**
677  * GDBusObject::interface-removed:
678  * @object: The #GDBusObject emitting the signal.
679  * @interface: The #GDBusInterface that was removed.
680  *
681  * Emitted when @interface is removed from @object.
682  *
683  * Since: 2.30
684  */
685
686
687 /**
688  * GDBusObjectManager::interface-added:
689  * @manager: The #GDBusObjectManager emitting the signal.
690  * @object: The #GDBusObject on which an interface was added.
691  * @interface: The #GDBusInterface that was added.
692  *
693  * Emitted when @interface is added to @object.
694  *
695  * This signal exists purely as a convenience to avoid having to
696  * connect signals to all objects managed by @manager.
697  *
698  * Since: 2.30
699  */
700
701
702 /**
703  * GDBusObjectManager::interface-removed:
704  * @manager: The #GDBusObjectManager emitting the signal.
705  * @object: The #GDBusObject on which an interface was removed.
706  * @interface: The #GDBusInterface that was removed.
707  *
708  * Emitted when @interface has been removed from @object.
709  *
710  * This signal exists purely as a convenience to avoid having to
711  * connect signals to all objects managed by @manager.
712  *
713  * Since: 2.30
714  */
715
716
717 /**
718  * GDBusObjectManager::object-added:
719  * @manager: The #GDBusObjectManager emitting the signal.
720  * @object: The #GDBusObject that was added.
721  *
722  * Emitted when @object is added to @manager.
723  *
724  * Since: 2.30
725  */
726
727
728 /**
729  * GDBusObjectManager::object-removed:
730  * @manager: The #GDBusObjectManager emitting the signal.
731  * @object: The #GDBusObject that was removed.
732  *
733  * Emitted when @object is removed from @manager.
734  *
735  * Since: 2.30
736  */
737
738
739 /**
740  * GDBusObjectManagerClient::interface-proxy-properties-changed:
741  * @manager: The #GDBusObjectManagerClient emitting the signal.
742  * @object_proxy: The #GDBusObjectProxy on which an interface has properties that are changing.
743  * @interface_proxy: The #GDBusProxy that has properties that are changing.
744  * @changed_properties: A #GVariant containing the properties that changed.
745  * @invalidated_properties: A %NULL terminated array of properties that was invalidated.
746  *
747  * Emitted when one or more D-Bus properties on proxy changes. The
748  * local cache has already been updated when this signal fires. Note
749  * that both @changed_properties and @invalidated_properties are
750  * guaranteed to never be %NULL (either may be empty though).
751  *
752  * This signal exists purely as a convenience to avoid having to
753  * connect signals to all interface proxies managed by @manager.
754  *
755  * This signal is emitted in the
756  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
757  * that @manager was constructed in.
758  *
759  * Since: 2.30
760  */
761
762
763 /**
764  * GDBusObjectManagerClient::interface-proxy-signal:
765  * @manager: The #GDBusObjectManagerClient emitting the signal.
766  * @object_proxy: The #GDBusObjectProxy on which an interface is emitting a D-Bus signal.
767  * @interface_proxy: The #GDBusProxy that is emitting a D-Bus signal.
768  * @sender_name: The sender of the signal or NULL if the connection is not a bus connection.
769  * @signal_name: The signal name.
770  * @parameters: A #GVariant tuple with parameters for the signal.
771  *
772  * Emitted when a D-Bus signal is received on @interface_proxy.
773  *
774  * This signal exists purely as a convenience to avoid having to
775  * connect signals to all interface proxies managed by @manager.
776  *
777  * This signal is emitted in the
778  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
779  * that @manager was constructed in.
780  *
781  * Since: 2.30
782  */
783
784
785 /**
786  * GDBusObjectManagerClient:bus-type:
787  *
788  * If this property is not %G_BUS_TYPE_NONE, then
789  * #GDBusObjectManagerClient:connection must be %NULL and will be set to the
790  * #GDBusConnection obtained by calling g_bus_get() with the value
791  * of this property.
792  *
793  * Since: 2.30
794  */
795
796
797 /**
798  * GDBusObjectManagerClient:connection:
799  *
800  * The #GDBusConnection to use.
801  *
802  * Since: 2.30
803  */
804
805
806 /**
807  * GDBusObjectManagerClient:flags:
808  *
809  * Flags from the #GDBusObjectManagerClientFlags enumeration.
810  *
811  * Since: 2.30
812  */
813
814
815 /**
816  * GDBusObjectManagerClient:get-proxy-type-destroy-notify:
817  *
818  * A #GDestroyNotify for the #gpointer user_data in #GDBusObjectManagerClient:get-proxy-type-user-data.
819  *
820  * Since: 2.30
821  */
822
823
824 /**
825  * GDBusObjectManagerClient:get-proxy-type-func:
826  *
827  * The #GDBusProxyTypeFunc to use when determining what #GType to
828  * use for interface proxies or %NULL.
829  *
830  * Since: 2.30
831  */
832
833
834 /**
835  * GDBusObjectManagerClient:get-proxy-type-user-data:
836  *
837  * The #gpointer user_data to pass to #GDBusObjectManagerClient:get-proxy-type-func.
838  *
839  * Since: 2.30
840  */
841
842
843 /**
844  * GDBusObjectManagerClient:name:
845  *
846  * The well-known name or unique name that the manager is for.
847  *
848  * Since: 2.30
849  */
850
851
852 /**
853  * GDBusObjectManagerClient:name-owner:
854  *
855  * The unique name that owns #GDBusObjectManagerClient:name or %NULL if
856  * no-one is currently owning the name. Connect to the
857  * #GObject::notify signal to track changes to this property.
858  *
859  * Since: 2.30
860  */
861
862
863 /**
864  * GDBusObjectManagerClient:object-path:
865  *
866  * The object path the manager is for.
867  *
868  * Since: 2.30
869  */
870
871
872 /**
873  * GDBusObjectManagerServer:connection:
874  *
875  * The #GDBusConnection to export objects on.
876  *
877  * Since: 2.30
878  */
879
880
881 /**
882  * GDBusObjectManagerServer:object-path:
883  *
884  * The object path to register the manager object at.
885  *
886  * Since: 2.30
887  */
888
889
890 /**
891  * GDBusObjectProxy:g-connection:
892  *
893  * The connection of the proxy.
894  *
895  * Since: 2.30
896  */
897
898
899 /**
900  * GDBusObjectProxy:g-object-path:
901  *
902  * The object path of the proxy.
903  *
904  * Since: 2.30
905  */
906
907
908 /**
909  * GDBusObjectSkeleton::authorize-method:
910  * @object: The #GDBusObjectSkeleton emitting the signal.
911  * @interface: The #GDBusInterfaceSkeleton that @invocation is for.
912  * @invocation: A #GDBusMethodInvocation.
913  *
914  * Emitted when a method is invoked by a remote caller and used to
915  * determine if the method call is authorized.
916  *
917  * This signal is like #GDBusInterfaceSkeleton<!-- -->'s
918  * #GDBusInterfaceSkeleton::g-authorize-method signal, except that it is
919  * for the enclosing object.
920  *
921  * The default class handler just returns %TRUE.
922  *
923  * Returns: %TRUE if the call is authorized, %FALSE otherwise.
924  * Since: 2.30
925  */
926
927
928 /**
929  * GDBusObjectSkeleton:g-object-path:
930  *
931  * The object path where the object is exported.
932  *
933  * Since: 2.30
934  */
935
936
937 /**
938  * GDBusProxy::g-properties-changed:
939  * @proxy: The #GDBusProxy emitting the signal.
940  * @changed_properties: A #GVariant containing the properties that changed
941  * @invalidated_properties: A %NULL terminated array of properties that was invalidated
942  *
943  * Emitted when one or more D-Bus properties on @proxy changes. The
944  * local cache has already been updated when this signal fires. Note
945  * that both @changed_properties and @invalidated_properties are
946  * guaranteed to never be %NULL (either may be empty though).
947  *
948  * If the proxy has the flag
949  * %G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES set, then
950  * @invalidated_properties will always be empty.
951  *
952  * This signal corresponds to the
953  * <literal>PropertiesChanged</literal> D-Bus signal on the
954  * <literal>org.freedesktop.DBus.Properties</literal> interface.
955  *
956  * Since: 2.26
957  */
958
959
960 /**
961  * GDBusProxy::g-signal:
962  * @proxy: The #GDBusProxy emitting the signal.
963  * @sender_name: (allow-none): The sender of the signal or %NULL if the connection is not a bus connection.
964  * @signal_name: The name of the signal.
965  * @parameters: A #GVariant tuple with parameters for the signal.
966  *
967  * Emitted when a signal from the remote object and interface that @proxy is for, has been received.
968  *
969  * Since: 2.26
970  */
971
972
973 /**
974  * GDBusProxy:g-bus-type:
975  *
976  * If this property is not %G_BUS_TYPE_NONE, then
977  * #GDBusProxy:g-connection must be %NULL and will be set to the
978  * #GDBusConnection obtained by calling g_bus_get() with the value
979  * of this property.
980  *
981  * Since: 2.26
982  */
983
984
985 /**
986  * GDBusProxy:g-connection:
987  *
988  * The #GDBusConnection the proxy is for.
989  *
990  * Since: 2.26
991  */
992
993
994 /**
995  * GDBusProxy:g-default-timeout:
996  *
997  * The timeout to use if -1 (specifying default timeout) is passed
998  * as @timeout_msec in the g_dbus_proxy_call() and
999  * g_dbus_proxy_call_sync() functions.
1000  *
1001  * This allows applications to set a proxy-wide timeout for all
1002  * remote method invocations on the proxy. If this property is -1,
1003  * the default timeout (typically 25 seconds) is used. If set to
1004  * %G_MAXINT, then no timeout is used.
1005  *
1006  * Since: 2.26
1007  */
1008
1009
1010 /**
1011  * GDBusProxy:g-flags:
1012  *
1013  * Flags from the #GDBusProxyFlags enumeration.
1014  *
1015  * Since: 2.26
1016  */
1017
1018
1019 /**
1020  * GDBusProxy:g-interface-info:
1021  *
1022  * Ensure that interactions with this proxy conform to the given
1023  * interface. This is mainly to ensure that malformed data received
1024  * from the other peer is ignored. The given #GDBusInterfaceInfo is
1025  * said to be the <emphasis>expected interface</emphasis>.
1026  *
1027  * The checks performed are:
1028  * <itemizedlist>
1029  *   <listitem><para>
1030  *     When completing a method call, if the type signature of
1031  *     the reply message isn't what's expected, the reply is
1032  *     discarded and the #GError is set to %G_IO_ERROR_INVALID_ARGUMENT.
1033  *   </para></listitem>
1034  *   <listitem><para>
1035  *     Received signals that have a type signature mismatch are dropped and
1036  *     a warning is logged via g_warning().
1037  *   </para></listitem>
1038  *   <listitem><para>
1039  *     Properties received via the initial <literal>GetAll()</literal> call
1040  *     or via the <literal>::PropertiesChanged</literal> signal (on the
1041  *     <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties">org.freedesktop.DBus.Properties</ulink> interface) or
1042  *     set using g_dbus_proxy_set_cached_property() with a type signature
1043  *     mismatch are ignored and a warning is logged via g_warning().
1044  *   </para></listitem>
1045  * </itemizedlist>
1046  * Note that these checks are never done on methods, signals and
1047  * properties that are not referenced in the given
1048  * #GDBusInterfaceInfo, since extending a D-Bus interface on the
1049  * service-side is not considered an ABI break.
1050  *
1051  * Since: 2.26
1052  */
1053
1054
1055 /**
1056  * GDBusProxy:g-interface-name:
1057  *
1058  * The D-Bus interface name the proxy is for.
1059  *
1060  * Since: 2.26
1061  */
1062
1063
1064 /**
1065  * GDBusProxy:g-name:
1066  *
1067  * The well-known or unique name that the proxy is for.
1068  *
1069  * Since: 2.26
1070  */
1071
1072
1073 /**
1074  * GDBusProxy:g-name-owner:
1075  *
1076  * The unique name that owns #GDBusProxy:g-name or %NULL if no-one
1077  * currently owns that name. You may connect to #GObject::notify signal to
1078  * track changes to this property.
1079  *
1080  * Since: 2.26
1081  */
1082
1083
1084 /**
1085  * GDBusProxy:g-object-path:
1086  *
1087  * The object path the proxy is for.
1088  *
1089  * Since: 2.26
1090  */
1091
1092
1093 /**
1094  * GDBusServer:
1095  *
1096  * The #GDBusServer structure contains only private data and
1097  * should only be accessed using the provided API.
1098  *
1099  * Since: 2.26
1100  */
1101
1102
1103 /**
1104  * GDBusServer::new-connection:
1105  * @server: The #GDBusServer emitting the signal.
1106  * @connection: A #GDBusConnection for the new connection.
1107  *
1108  * Emitted when a new authenticated connection has been made. Use
1109  * g_dbus_connection_get_peer_credentials() to figure out what
1110  * identity (if any), was authenticated.
1111  *
1112  * If you want to accept the connection, take a reference to the
1113  * @connection object and return %TRUE. When you are done with the
1114  * connection call g_dbus_connection_close() and give up your
1115  * reference. Note that the other peer may disconnect at any time -
1116  * a typical thing to do when accepting a connection is to listen to
1117  * the #GDBusConnection::closed signal.
1118  *
1119  * If #GDBusServer:flags contains %G_DBUS_SERVER_FLAGS_RUN_IN_THREAD
1120  * then the signal is emitted in a new thread dedicated to the
1121  * connection. Otherwise the signal is emitted in the <link
1122  * linkend="g-main-context-push-thread-default">thread-default main
1123  * loop</link> of the thread that @server was constructed in.
1124  *
1125  * You are guaranteed that signal handlers for this signal runs
1126  * before incoming messages on @connection are processed. This means
1127  * that it's suitable to call g_dbus_connection_register_object() or
1128  * similar from the signal handler.
1129  *
1130  * Returns: %TRUE to claim @connection, %FALSE to let other handlers run.
1131  * Since: 2.26
1132  */
1133
1134
1135 /**
1136  * GDBusServer:active:
1137  *
1138  * Whether the server is currently active.
1139  *
1140  * Since: 2.26
1141  */
1142
1143
1144 /**
1145  * GDBusServer:address:
1146  *
1147  * The D-Bus address to listen on.
1148  *
1149  * Since: 2.26
1150  */
1151
1152
1153 /**
1154  * GDBusServer:authentication-observer:
1155  *
1156  * A #GDBusAuthObserver object to assist in the authentication process or %NULL.
1157  *
1158  * Since: 2.26
1159  */
1160
1161
1162 /**
1163  * GDBusServer:client-address:
1164  *
1165  * The D-Bus address that clients can use.
1166  *
1167  * Since: 2.26
1168  */
1169
1170
1171 /**
1172  * GDBusServer:flags:
1173  *
1174  * Flags from the #GDBusServerFlags enumeration.
1175  *
1176  * Since: 2.26
1177  */
1178
1179
1180 /**
1181  * GDBusServer:guid:
1182  *
1183  * The guid of the server.
1184  *
1185  * Since: 2.26
1186  */
1187
1188
1189 /**
1190  * GDBusServerClass:
1191  * @new_connection: Signal class handler for the #GDBusServer::new-connection signal.
1192  *
1193  * Class structure for #GDBusServer.
1194  *
1195  * Since: 2.26
1196  */
1197
1198
1199 /**
1200  * GDataOutputStream:byte-order:
1201  *
1202  * Determines the byte ordering that is used when writing
1203  * multi-byte entities (such as integers) to the stream.
1204  */
1205
1206
1207 /**
1208  * GDataStream:byte-order:
1209  *
1210  * The ::byte-order property determines the byte ordering that
1211  * is used when reading multi-byte entities (such as integers)
1212  * from the stream.
1213  */
1214
1215
1216 /**
1217  * GDataStream:newline-type:
1218  *
1219  * The :newline-type property determines what is considered
1220  * as a line ending when reading complete lines from the stream.
1221  */
1222
1223
1224 /**
1225  * GDesktopAppInfo:
1226  *
1227  * Information about an installed application from a desktop file.
1228  */
1229
1230
1231 /**
1232  * GDesktopAppInfo:filename:
1233  *
1234  * The origin filename of this #GDesktopAppInfo
1235  */
1236
1237
1238 /**
1239  * GDrive::changed:
1240  * @drive: a #GDrive.
1241  *
1242  * Emitted when the drive's state has changed.
1243  */
1244
1245
1246 /**
1247  * GDrive::disconnected:
1248  * @drive: a #GDrive.
1249  *
1250  * This signal is emitted when the #GDrive have been
1251  * disconnected. If the recipient is holding references to the
1252  * object they should release them so the object can be
1253  * finalized.
1254  */
1255
1256
1257 /**
1258  * GDrive::eject-button:
1259  * @drive: a #GDrive.
1260  *
1261  * Emitted when the physical eject button (if any) of a drive has
1262  * been pressed.
1263  */
1264
1265
1266 /**
1267  * GDrive::stop-button:
1268  * @drive: a #GDrive.
1269  *
1270  * Emitted when the physical stop button (if any) of a drive has
1271  * been pressed.
1272  *
1273  * Since: 2.22
1274  */
1275
1276
1277 /**
1278  * GFileIcon:file:
1279  *
1280  * The file containing the icon.
1281  */
1282
1283
1284 /**
1285  * GFileMonitor::changed:
1286  * @monitor: a #GFileMonitor.
1287  * @file: a #GFile.
1288  * @other_file: (allow-none): a #GFile or #NULL.
1289  * @event_type: a #GFileMonitorEvent.
1290  *
1291  * Emitted when @file has been changed.
1292  *
1293  * If using #G_FILE_MONITOR_SEND_MOVED flag and @event_type is
1294  * #G_FILE_MONITOR_EVENT_MOVED, @file will be set to a #GFile containing the
1295  * old path, and @other_file will be set to a #GFile containing the new path.
1296  *
1297  * In all the other cases, @other_file will be set to #NULL.
1298  */
1299
1300
1301 /**
1302  * GFilenameCompleter::got-completion-data:
1303  *
1304  * Emitted when the file name completion information comes available.
1305  */
1306
1307
1308 /**
1309  * GIOModuleScope:
1310  *
1311  * Represents a scope for loading IO modules. A scope can be used for blocking
1312  * duplicate modules, or blocking a module you don't want to load.
1313  *
1314  * The scope can be used with g_io_modules_load_all_in_directory_with_scope()
1315  * or g_io_modules_scan_all_in_directory_with_scope().
1316  *
1317  * Since: 2.30
1318  */
1319
1320
1321 /**
1322  * GInetAddress:
1323  *
1324  * An IPv4 or IPv6 internet address.
1325  */
1326
1327
1328 /**
1329  * GInetAddress:is-any:
1330  *
1331  * Whether this is the "any" address for its family.
1332  * See g_inet_address_get_is_any().
1333  *
1334  * Since: 2.22
1335  */
1336
1337
1338 /**
1339  * GInetAddress:is-link-local:
1340  *
1341  * Whether this is a link-local address.
1342  * See g_inet_address_get_is_link_local().
1343  *
1344  * Since: 2.22
1345  */
1346
1347
1348 /**
1349  * GInetAddress:is-loopback:
1350  *
1351  * Whether this is the loopback address for its family.
1352  * See g_inet_address_get_is_loopback().
1353  *
1354  * Since: 2.22
1355  */
1356
1357
1358 /**
1359  * GInetAddress:is-mc-global:
1360  *
1361  * Whether this is a global multicast address.
1362  * See g_inet_address_get_is_mc_global().
1363  *
1364  * Since: 2.22
1365  */
1366
1367
1368 /**
1369  * GInetAddress:is-mc-link-local:
1370  *
1371  * Whether this is a link-local multicast address.
1372  * See g_inet_address_get_is_mc_link_local().
1373  *
1374  * Since: 2.22
1375  */
1376
1377
1378 /**
1379  * GInetAddress:is-mc-node-local:
1380  *
1381  * Whether this is a node-local multicast address.
1382  * See g_inet_address_get_is_mc_node_local().
1383  *
1384  * Since: 2.22
1385  */
1386
1387
1388 /**
1389  * GInetAddress:is-mc-org-local:
1390  *
1391  * Whether this is an organization-local multicast address.
1392  * See g_inet_address_get_is_mc_org_local().
1393  *
1394  * Since: 2.22
1395  */
1396
1397
1398 /**
1399  * GInetAddress:is-mc-site-local:
1400  *
1401  * Whether this is a site-local multicast address.
1402  * See g_inet_address_get_is_mc_site_local().
1403  *
1404  * Since: 2.22
1405  */
1406
1407
1408 /**
1409  * GInetAddress:is-multicast:
1410  *
1411  * Whether this is a multicast address.
1412  * See g_inet_address_get_is_multicast().
1413  *
1414  * Since: 2.22
1415  */
1416
1417
1418 /**
1419  * GInetAddress:is-site-local:
1420  *
1421  * Whether this is a site-local address.
1422  * See g_inet_address_get_is_loopback().
1423  *
1424  * Since: 2.22
1425  */
1426
1427
1428 /**
1429  * GInetAddressMask:
1430  *
1431  * A combination of an IPv4 or IPv6 base address and a length,
1432  * representing a range of IP addresses.
1433  *
1434  * Since: 2.32
1435  */
1436
1437
1438 /**
1439  * GInetSocketAddress:
1440  *
1441  * An IPv4 or IPv6 socket address, corresponding to a <type>struct
1442  * sockaddr_in</type> or <type>struct sockaddr_in6</type>.
1443  */
1444
1445
1446 /**
1447  * GInetSocketAddress:flowinfo:
1448  *
1449  * The <literal>sin6_flowinfo</literal> field, for IPv6 addresses.
1450  *
1451  * Since: 2.32
1452  */
1453
1454
1455 /**
1456  * GInetSocketAddress:scope_id:
1457  *
1458  * The <literal>sin6_scope_id</literal> field, for IPv6 addresses.
1459  *
1460  * Since: 2.32
1461  */
1462
1463
1464 /**
1465  * GMemoryOutputStream:data:
1466  *
1467  * Pointer to buffer where data will be written.
1468  *
1469  * Since: 2.24
1470  */
1471
1472
1473 /**
1474  * GMemoryOutputStream:data-size:
1475  *
1476  * Size of data written to the buffer.
1477  *
1478  * Since: 2.24
1479  */
1480
1481
1482 /**
1483  * GMemoryOutputStream:destroy-function: (skip)
1484  *
1485  * Function called with the buffer as argument when the stream is destroyed.
1486  *
1487  * Since: 2.24
1488  */
1489
1490
1491 /**
1492  * GMemoryOutputStream:realloc-function: (skip)
1493  *
1494  * Function with realloc semantics called to enlarge the buffer.
1495  *
1496  * Since: 2.24
1497  */
1498
1499
1500 /**
1501  * GMemoryOutputStream:size:
1502  *
1503  * Current size of the data buffer.
1504  *
1505  * Since: 2.24
1506  */
1507
1508
1509 /**
1510  * GMenu:
1511  *
1512  * #GMenu is an opaque structure type.  You must access it using the
1513  * functions below.
1514  *
1515  * Since: 2.32
1516  */
1517
1518
1519 /**
1520  * GMenuAttributeIter:
1521  *
1522  * #GMenuAttributeIter is an opaque structure type.  You must access it
1523  * using the functions below.
1524  *
1525  * Since: 2.32
1526  */
1527
1528
1529 /**
1530  * GMenuItem:
1531  *
1532  * #GMenuItem is an opaque structure type.  You must access it using the
1533  * functions below.
1534  *
1535  * Since: 2.32
1536  */
1537
1538
1539 /**
1540  * GMenuLinkIter:
1541  *
1542  * #GMenuLinkIter is an opaque structure type.  You must access it using
1543  * the functions below.
1544  *
1545  * Since: 2.32
1546  */
1547
1548
1549 /**
1550  * GMenuModel:
1551  *
1552  * #GMenuModel is an opaque structure type.  You must access it using the
1553  * functions below.
1554  *
1555  * Since: 2.32
1556  */
1557
1558
1559 /**
1560  * GMenuModel::items-changed:
1561  * @model: the #GMenuModel that is changing
1562  * @position: the position of the change
1563  * @removed: the number of items removed
1564  * @added: the number of items added
1565  *
1566  * Emitted when a change has occured to the menu.
1567  *
1568  * The only changes that can occur to a menu is that items are removed
1569  * or added.  Items may not change (except by being removed and added
1570  * back in the same location).  This signal is capable of describing
1571  * both of those changes (at the same time).
1572  *
1573  * The signal means that starting at the index @position, @removed
1574  * items were removed and @added items were added in their place.  If
1575  * @removed is zero then only items were added.  If @added is zero
1576  * then only items were removed.
1577  *
1578  * As an example, if the menu contains items a, b, c, d (in that
1579  * order) and the signal (2, 1, 3) occurs then the new composition of
1580  * the menu will be a, b, _, _, _, d (with each _ representing some
1581  * new item).
1582  *
1583  * Signal handlers may query the model (particularly the added items)
1584  * and expect to see the results of the modification that is being
1585  * reported.  The signal is emitted after the modification.
1586  */
1587
1588
1589 /**
1590  * GMount::changed:
1591  * @mount: the object on which the signal is emitted
1592  *
1593  * Emitted when the mount has been changed.
1594  */
1595
1596
1597 /**
1598  * GMount::pre-unmount:
1599  * @mount: the object on which the signal is emitted
1600  *
1601  * This signal is emitted when the #GMount is about to be
1602  * unmounted.
1603  *
1604  * Since: 2.22
1605  */
1606
1607
1608 /**
1609  * GMount::unmounted:
1610  * @mount: the object on which the signal is emitted
1611  *
1612  * This signal is emitted when the #GMount have been
1613  * unmounted. If the recipient is holding references to the
1614  * object they should release them so the object can be
1615  * finalized.
1616  */
1617
1618
1619 /**
1620  * GMountOperation::aborted:
1621  *
1622  * Emitted by the backend when e.g. a device becomes unavailable
1623  * while a mount operation is in progress.
1624  *
1625  * Implementations of GMountOperation should handle this signal
1626  * by dismissing open password dialogs.
1627  *
1628  * Since: 2.20
1629  */
1630
1631
1632 /**
1633  * GMountOperation::ask-password:
1634  * @op: a #GMountOperation requesting a password.
1635  * @message: string containing a message to display to the user.
1636  * @default_user: string containing the default user name.
1637  * @default_domain: string containing the default domain.
1638  * @flags: a set of #GAskPasswordFlags.
1639  *
1640  * Emitted when a mount operation asks the user for a password.
1641  *
1642  * If the message contains a line break, the first line should be
1643  * presented as a heading. For example, it may be used as the
1644  * primary text in a #GtkMessageDialog.
1645  */
1646
1647
1648 /**
1649  * GMountOperation::ask-question:
1650  * @op: a #GMountOperation asking a question.
1651  * @message: string containing a message to display to the user.
1652  * @choices: an array of strings for each possible choice.
1653  *
1654  * Emitted when asking the user a question and gives a list of
1655  * choices for the user to choose from.
1656  *
1657  * If the message contains a line break, the first line should be
1658  * presented as a heading. For example, it may be used as the
1659  * primary text in a #GtkMessageDialog.
1660  */
1661
1662
1663 /**
1664  * GMountOperation::reply:
1665  * @op: a #GMountOperation.
1666  * @result: a #GMountOperationResult indicating how the request was handled
1667  *
1668  * Emitted when the user has replied to the mount operation.
1669  */
1670
1671
1672 /**
1673  * GMountOperation::show-processes:
1674  * @op: a #GMountOperation.
1675  * @message: string containing a message to display to the user.
1676  * @processes: (element-type GPid): an array of #GPid for processes blocking the operation.
1677  * @choices: an array of strings for each possible choice.
1678  *
1679  * Emitted when one or more processes are blocking an operation
1680  * e.g. unmounting/ejecting a #GMount or stopping a #GDrive.
1681  *
1682  * Note that this signal may be emitted several times to update the
1683  * list of blocking processes as processes close files. The
1684  * application should only respond with g_mount_operation_reply() to
1685  * the latest signal (setting #GMountOperation:choice to the choice
1686  * the user made).
1687  *
1688  * If the message contains a line break, the first line should be
1689  * presented as a heading. For example, it may be used as the
1690  * primary text in a #GtkMessageDialog.
1691  *
1692  * Since: 2.22
1693  */
1694
1695
1696 /**
1697  * GMountOperation:anonymous:
1698  *
1699  * Whether to use an anonymous user when authenticating.
1700  */
1701
1702
1703 /**
1704  * GMountOperation:choice:
1705  *
1706  * The index of the user's choice when a question is asked during the
1707  * mount operation. See the #GMountOperation::ask-question signal.
1708  */
1709
1710
1711 /**
1712  * GMountOperation:domain:
1713  *
1714  * The domain to use for the mount operation.
1715  */
1716
1717
1718 /**
1719  * GMountOperation:password:
1720  *
1721  * The password that is used for authentication when carrying out
1722  * the mount operation.
1723  */
1724
1725
1726 /**
1727  * GMountOperation:password-save:
1728  *
1729  * Determines if and how the password information should be saved.
1730  */
1731
1732
1733 /**
1734  * GMountOperation:username:
1735  *
1736  * The user name that is used for authentication when carrying out
1737  * the mount operation.
1738  */
1739
1740
1741 /**
1742  * GNetworkAddress:
1743  *
1744  * A #GSocketConnectable for resolving a hostname and connecting to
1745  * that host.
1746  */
1747
1748
1749 /**
1750  * GNetworkMonitor:
1751  *
1752  * #GNetworkMonitor monitors the status of network connections and
1753  * indicates when a possibly-user-visible change has occurred.
1754  *
1755  * Since: 2.32
1756  */
1757
1758
1759 /**
1760  * GNetworkMonitor::network-changed:
1761  * @monitor: a #GNetworkMonitor
1762  * @available: the current value of #GNetworkMonitor:network-available
1763  *
1764  * Emitted when the network configuration changes. If @available is
1765  * %TRUE, then some hosts may be reachable that were not reachable
1766  * before, while others that were reachable before may no longer be
1767  * reachable. If @available is %FALSE, then no remote hosts are
1768  * reachable.
1769  *
1770  * Since: 2.32
1771  */
1772
1773
1774 /**
1775  * GNetworkMonitor:network-available:
1776  *
1777  * Whether the network is considered available. That is, whether the
1778  * system has a default route for at least one of IPv4 or IPv6.
1779  *
1780  * Real-world networks are of course much more complicated than
1781  * this; the machine may be connected to a wifi hotspot that
1782  * requires payment before allowing traffic through, or may be
1783  * connected to a functioning router that has lost its own upstream
1784  * connectivity. Some hosts might only be accessible when a VPN is
1785  * active. Other hosts might only be accessible when the VPN is
1786  * <emphasis>not</emphasis> active. Thus, it is best to use
1787  * g_network_monitor_can_reach() or
1788  * g_network_monitor_can_reach_async() to test for reachability on a
1789  * host-by-host basis. (On the other hand, when the property is
1790  * %FALSE, the application can reasonably expect that no remote
1791  * hosts at all are reachable, and should indicate this to the user
1792  * in its UI.)
1793  *
1794  * See also #GNetworkMonitor::network-changed.
1795  *
1796  * Since: 2.32
1797  */
1798
1799
1800 /**
1801  * GNetworkService:
1802  *
1803  * A #GSocketConnectable for resolving a SRV record and connecting to
1804  * that service.
1805  */
1806
1807
1808 /**
1809  * GPermission:
1810  *
1811  * #GPermission is an opaque data structure and can only be accessed
1812  * using the following functions.
1813  */
1814
1815
1816 /**
1817  * GPermission:allowed:
1818  *
1819  * %TRUE if the caller currently has permission to perform the action that
1820  * @permission represents the permission to perform.
1821  */
1822
1823
1824 /**
1825  * GPermission:can-acquire:
1826  *
1827  * %TRUE if it is generally possible to acquire the permission by calling
1828  * g_permission_acquire().
1829  */
1830
1831
1832 /**
1833  * GPermission:can-release:
1834  *
1835  * %TRUE if it is generally possible to release the permission by calling
1836  * g_permission_release().
1837  */
1838
1839
1840 /**
1841  * GProxyAddress:
1842  *
1843  * A #GInetSocketAddress representing a connection via a proxy server
1844  *
1845  * Since: 2.26
1846  */
1847
1848
1849 /**
1850  * GProxyAddress:destination-protocol:
1851  *
1852  * The protocol being spoke to the destination host, or %NULL if
1853  * the #GProxyAddress doesn't know.
1854  *
1855  * Since: 2.34
1856  */
1857
1858
1859 /**
1860  * GProxyAddress:uri:
1861  *
1862  * The URI string that the proxy was constructed from (or %NULL
1863  * if the creator didn't specify this).
1864  *
1865  * Since: 2.34
1866  */
1867
1868
1869 /**
1870  * GRemoteActionGroupInterface:
1871  * @activate_action_full: the virtual function pointer for g_remote_action_group_activate_action_full()
1872  * @change_action_state_full: the virtual function pointer for g_remote_action_group_change_action_state_full()
1873  *
1874  * The virtual function table for #GRemoteActionGroup.
1875  *
1876  * Since: 2.32
1877  */
1878
1879
1880 /**
1881  * GResolver:
1882  *
1883  * The object that handles DNS resolution. Use g_resolver_get_default()
1884  * to get the default resolver.
1885  */
1886
1887
1888 /**
1889  * GResolver::reload:
1890  * @resolver: a #GResolver
1891  *
1892  * Emitted when the resolver notices that the system resolver
1893  * configuration has changed.
1894  */
1895
1896
1897 /**
1898  * GSettings::change-event:
1899  * @settings: the object on which the signal was emitted
1900  * @keys: (array length=n_keys) (element-type GQuark) (allow-none): an array of #GQuark<!-- -->s for the changed keys, or %NULL
1901  * @n_keys: the length of the @keys array, or 0
1902  *
1903  * The "change-event" signal is emitted once per change event that
1904  * affects this settings object.  You should connect to this signal
1905  * only if you are interested in viewing groups of changes before they
1906  * are split out into multiple emissions of the "changed" signal.
1907  * For most use cases it is more appropriate to use the "changed" signal.
1908  *
1909  * In the event that the change event applies to one or more specified
1910  * keys, @keys will be an array of #GQuark of length @n_keys.  In the
1911  * event that the change event applies to the #GSettings object as a
1912  * whole (ie: potentially every key has been changed) then @keys will
1913  * be %NULL and @n_keys will be 0.
1914  *
1915  * The default handler for this signal invokes the "changed" signal
1916  * for each affected key.  If any other connected handler returns
1917  * %TRUE then this default functionality will be suppressed.
1918  *
1919  * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
1920  */
1921
1922
1923 /**
1924  * GSettings::changed:
1925  * @settings: the object on which the signal was emitted
1926  * @key: the name of the key that changed
1927  *
1928  * The "changed" signal is emitted when a key has potentially changed.
1929  * You should call one of the g_settings_get() calls to check the new
1930  * value.
1931  *
1932  * This signal supports detailed connections.  You can connect to the
1933  * detailed signal "changed::x" in order to only receive callbacks
1934  * when key "x" changes.
1935  */
1936
1937
1938 /**
1939  * GSettings::writable-change-event:
1940  * @settings: the object on which the signal was emitted
1941  * @key: the quark of the key, or 0
1942  *
1943  * The "writable-change-event" signal is emitted once per writability
1944  * change event that affects this settings object.  You should connect
1945  * to this signal if you are interested in viewing groups of changes
1946  * before they are split out into multiple emissions of the
1947  * "writable-changed" signal.  For most use cases it is more
1948  * appropriate to use the "writable-changed" signal.
1949  *
1950  * In the event that the writability change applies only to a single
1951  * key, @key will be set to the #GQuark for that key.  In the event
1952  * that the writability change affects the entire settings object,
1953  * @key will be 0.
1954  *
1955  * The default handler for this signal invokes the "writable-changed"
1956  * and "changed" signals for each affected key.  This is done because
1957  * changes in writability might also imply changes in value (if for
1958  * example, a new mandatory setting is introduced).  If any other
1959  * connected handler returns %TRUE then this default functionality
1960  * will be suppressed.
1961  *
1962  * Returns: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
1963  */
1964
1965
1966 /**
1967  * GSettings::writable-changed:
1968  * @settings: the object on which the signal was emitted
1969  * @key: the key
1970  *
1971  * The "writable-changed" signal is emitted when the writability of a
1972  * key has potentially changed.  You should call
1973  * g_settings_is_writable() in order to determine the new status.
1974  *
1975  * This signal supports detailed connections.  You can connect to the
1976  * detailed signal "writable-changed::x" in order to only receive
1977  * callbacks when the writability of "x" changes.
1978  */
1979
1980
1981 /**
1982  * GSettings:context:
1983  *
1984  * The name of the context that the settings are stored in.
1985  */
1986
1987
1988 /**
1989  * GSettings:delay-apply:
1990  *
1991  * Whether the #GSettings object is in 'delay-apply' mode. See
1992  * g_settings_delay() for details.
1993  *
1994  * Since: 2.28
1995  */
1996
1997
1998 /**
1999  * GSettings:has-unapplied:
2000  *
2001  * If this property is %TRUE, the #GSettings object has outstanding
2002  * changes that will be applied when g_settings_apply() is called.
2003  */
2004
2005
2006 /**
2007  * GSettings:path:
2008  *
2009  * The path within the backend where the settings are stored.
2010  */
2011
2012
2013 /**
2014  * GSettings:schema:
2015  *
2016  * The name of the schema that describes the types of keys
2017  * for this #GSettings object.
2018  *
2019  * The type of this property is *not* #GSettingsSchema.
2020  * #GSettingsSchema has only existed since version 2.32 and
2021  * unfortunately this name was used in previous versions to refer to
2022  * the schema ID rather than the schema itself.  Take care to use the
2023  * 'settings-schema' property if you wish to pass in a
2024  * #GSettingsSchema.
2025  *
2026  * Deprecated: 2.32:Use the 'schema-id' property instead.  In a future version, this property may instead refer to a #GSettingsSchema.
2027  */
2028
2029
2030 /**
2031  * GSettings:schema-id:
2032  *
2033  * The name of the schema that describes the types of keys
2034  * for this #GSettings object.
2035  */
2036
2037
2038 /**
2039  * GSettings:settings-schema:
2040  *
2041  * The #GSettingsSchema describing the types of keys for this
2042  * #GSettings object.
2043  *
2044  * Ideally, this property would be called 'schema'.  #GSettingsSchema
2045  * has only existed since version 2.32, however, and before then the
2046  * 'schema' property was used to refer to the ID of the schema rather
2047  * than the schema itself.  Take care.
2048  */
2049
2050
2051 /**
2052  * GSettingsSchema:
2053  *
2054  * This is an opaque structure type.  You may not access it directly.
2055  *
2056  * Since: 2.32
2057  */
2058
2059
2060 /**
2061  * GSettingsSchemaSource:
2062  *
2063  * This is an opaque structure type.  You may not access it directly.
2064  *
2065  * Since: 2.32
2066  */
2067
2068
2069 /**
2070  * GSimpleAction::activate:
2071  * @simple: the #GSimpleAction
2072  * @parameter: (allow-none): the parameter to the activation
2073  *
2074  * Indicates that the action was just activated.
2075  *
2076  * @parameter will always be of the expected type.  In the event that
2077  * an incorrect type was given, no signal will be emitted.
2078  *
2079  * Since: 2.28
2080  */
2081
2082
2083 /**
2084  * GSimpleAction::change-state:
2085  * @simple: the #GSimpleAction
2086  * @value: (allow-none): the requested value for the state
2087  *
2088  * Indicates that the action just received a request to change its
2089  * state.
2090  *
2091  * @value will always be of the correct state type.  In the event that
2092  * an incorrect type was given, no signal will be emitted.
2093  *
2094  * If no handler is connected to this signal then the default
2095  * behaviour is to call g_simple_action_set_state() to set the state
2096  * to the requested value.  If you connect a signal handler then no
2097  * default action is taken.  If the state should change then you must
2098  * call g_simple_action_set_state() from the handler.
2099  *
2100  * <example>
2101  * <title>Example 'change-state' handler</title>
2102  * <programlisting>
2103  * static void
2104  * change_volume_state (GSimpleAction *action,
2105  *                      GVariant      *value,
2106  *                      gpointer       user_data)
2107  * {
2108  *   gint requested;
2109  *
2110  *   requested = g_variant_get_int32 (value);
2111  *
2112  *   // Volume only goes from 0 to 10
2113  *   if (0 <= requested && requested <= 10)
2114  *     g_simple_action_set_state (action, value);
2115  * }
2116  * </programlisting>
2117  * </example>
2118  *
2119  * The handler need not set the state to the requested value.  It
2120  * could set it to any value at all, or take some other action.
2121  *
2122  * Since: 2.30
2123  */
2124
2125
2126 /**
2127  * GSimpleAction:enabled:
2128  *
2129  * If @action is currently enabled.
2130  *
2131  * If the action is disabled then calls to g_action_activate() and
2132  * g_action_change_state() have no effect.
2133  *
2134  * Since: 2.28
2135  */
2136
2137
2138 /**
2139  * GSimpleAction:name:
2140  *
2141  * The name of the action.  This is mostly meaningful for identifying
2142  * the action once it has been added to a #GSimpleActionGroup.
2143  *
2144  * Since: 2.28
2145  */
2146
2147
2148 /**
2149  * GSimpleAction:parameter-type:
2150  *
2151  * The type of the parameter that must be given when activating the
2152  * action.
2153  *
2154  * Since: 2.28
2155  */
2156
2157
2158 /**
2159  * GSimpleAction:state:
2160  *
2161  * The state of the action, or %NULL if the action is stateless.
2162  *
2163  * Since: 2.28
2164  */
2165
2166
2167 /**
2168  * GSimpleAction:state-type:
2169  *
2170  * The #GVariantType of the state that the action has, or %NULL if the
2171  * action is stateless.
2172  *
2173  * Since: 2.28
2174  */
2175
2176
2177 /**
2178  * GSimplePermission:
2179  *
2180  * #GSimplePermission is an opaque data structure.  There are no methods
2181  * except for those defined by #GPermission.
2182  */
2183
2184
2185 /**
2186  * GSocket:broadcast:
2187  *
2188  * Whether the socket should allow sending to and receiving from broadcast addresses.
2189  *
2190  * Since: 2.32
2191  */
2192
2193
2194 /**
2195  * GSocket:multicast-loopback:
2196  *
2197  * Whether outgoing multicast packets loop back to the local host.
2198  *
2199  * Since: 2.32
2200  */
2201
2202
2203 /**
2204  * GSocket:multicast-ttl:
2205  *
2206  * Time-to-live out outgoing multicast packets
2207  *
2208  * Since: 2.32
2209  */
2210
2211
2212 /**
2213  * GSocket:timeout:
2214  *
2215  * The timeout in seconds on socket I/O
2216  *
2217  * Since: 2.26
2218  */
2219
2220
2221 /**
2222  * GSocket:ttl:
2223  *
2224  * Time-to-live for outgoing unicast packets
2225  *
2226  * Since: 2.32
2227  */
2228
2229
2230 /**
2231  * GSocketAddress:
2232  *
2233  * A socket endpoint address, corresponding to <type>struct sockaddr</type>
2234  * or one of its subtypes.
2235  */
2236
2237
2238 /**
2239  * GSocketClient::event:
2240  * @client: the #GSocketClient
2241  * @event: the event that is occurring
2242  * @connectable: the #GSocketConnectable that @event is occurring on
2243  * @connection: the current representation of the connection
2244  *
2245  * Emitted when @client's activity on @connectable changes state.
2246  * Among other things, this can be used to provide progress
2247  * information about a network connection in the UI. The meanings of
2248  * the different @event values are as follows:
2249  *
2250  * <variablelist>
2251  *   <varlistentry>
2252  *     <term>%G_SOCKET_CLIENT_RESOLVING:</term>
2253  *     <listitem><para>
2254  *       @client is about to look up @connectable in DNS.
2255  *       @connection will be %NULL.
2256  *     </para></listitem>
2257  *   </varlistentry>
2258  *   <varlistentry>
2259  *     <term>%G_SOCKET_CLIENT_RESOLVED:</term>
2260  *     <listitem><para>
2261  *       @client has successfully resolved @connectable in DNS.
2262  *       @connection will be %NULL.
2263  *     </para></listitem>
2264  *   </varlistentry>
2265  *   <varlistentry>
2266  *     <term>%G_SOCKET_CLIENT_CONNECTING:</term>
2267  *     <listitem><para>
2268  *       @client is about to make a connection to a remote host;
2269  *       either a proxy server or the destination server itself.
2270  *       @connection is the #GSocketConnection, which is not yet
2271  *       connected.
2272  *     </para></listitem>
2273  *   </varlistentry>
2274  *   <varlistentry>
2275  *     <term>%G_SOCKET_CLIENT_CONNECTED:</term>
2276  *     <listitem><para>
2277  *       @client has successfully connected to a remote host.
2278  *       @connection is the connected #GSocketConnection.
2279  *     </para></listitem>
2280  *   </varlistentry>
2281  *   <varlistentry>
2282  *     <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATING:</term>
2283  *     <listitem><para>
2284  *       @client is about to negotiate with a proxy to get it to
2285  *       connect to @connectable. @connection is the
2286  *       #GSocketConnection to the proxy server.
2287  *     </para></listitem>
2288  *   </varlistentry>
2289  *   <varlistentry>
2290  *     <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATED:</term>
2291  *     <listitem><para>
2292  *       @client has negotiated a connection to @connectable through
2293  *       a proxy server. @connection is the stream returned from
2294  *       g_proxy_connect(), which may or may not be a
2295  *       #GSocketConnection.
2296  *     </para></listitem>
2297  *   </varlistentry>
2298  *   <varlistentry>
2299  *     <term>%G_SOCKET_CLIENT_TLS_HANDSHAKING:</term>
2300  *     <listitem><para>
2301  *       @client is about to begin a TLS handshake. @connection is a
2302  *       #GTlsClientConnection.
2303  *     </para></listitem>
2304  *   </varlistentry>
2305  *   <varlistentry>
2306  *     <term>%G_SOCKET_CLIENT_TLS_HANDSHAKED:</term>
2307  *     <listitem><para>
2308  *       @client has successfully completed the TLS handshake.
2309  *       @connection is a #GTlsClientConnection.
2310  *     </para></listitem>
2311  *   </varlistentry>
2312  *   <varlistentry>
2313  *     <term>%G_SOCKET_CLIENT_COMPLETE:</term>
2314  *     <listitem><para>
2315  *       @client has either successfully connected to @connectable
2316  *       (in which case @connection is the #GSocketConnection that
2317  *       it will be returning to the caller) or has failed (in which
2318  *       case @connection is %NULL and the client is about to return
2319  *       an error).
2320  *     </para></listitem>
2321  *   </varlistentry>
2322  * </variablelist>
2323  *
2324  * Each event except %G_SOCKET_CLIENT_COMPLETE may be emitted
2325  * multiple times (or not at all) for a given connectable (in
2326  * particular, if @client ends up attempting to connect to more than
2327  * one address). However, if @client emits the #GSocketClient::event
2328  * signal at all for a given connectable, that it will always emit
2329  * it with %G_SOCKET_CLIENT_COMPLETE when it is done.
2330  *
2331  * Note that there may be additional #GSocketClientEvent values in
2332  * the future; unrecognized @event values should be ignored.
2333  *
2334  * Since: 2.32
2335  */
2336
2337
2338 /**
2339  * GSocketService::incoming:
2340  * @service: the #GSocketService
2341  * @connection: a new #GSocketConnection object
2342  * @source_object: (allow-none): the source_object passed to g_socket_listener_add_address()
2343  *
2344  * The ::incoming signal is emitted when a new incoming connection
2345  * to @service needs to be handled. The handler must initiate the
2346  * handling of @connection, but may not block; in essence,
2347  * asynchronous operations must be used.
2348  *
2349  * @connection will be unreffed once the signal handler returns,
2350  * so you need to ref it yourself if you are planning to use it.
2351  *
2352  * Returns: %TRUE to stop other handlers from being called
2353  * Since: 2.22
2354  */
2355
2356
2357 /**
2358  * GSrvTarget:
2359  *
2360  * A single target host/port that a network service is running on.
2361  */
2362
2363
2364 /**
2365  * GTestDBus:
2366  *
2367  * The #GTestDBus structure contains only private data and
2368  * should only be accessed using the provided API.
2369  *
2370  * Since: 2.34
2371  */
2372
2373
2374 /**
2375  * GTestDBus:flags:
2376  *
2377  * #GTestDBusFlags specifying the behaviour of the dbus session
2378  *
2379  * Since: 2.34
2380  */
2381
2382
2383 /**
2384  * GThemedIcon:name:
2385  *
2386  * The icon name.
2387  */
2388
2389
2390 /**
2391  * GThemedIcon:names:
2392  *
2393  * A %NULL-terminated array of icon names.
2394  */
2395
2396
2397 /**
2398  * GThemedIcon:use-default-fallbacks:
2399  *
2400  * Whether to use the default fallbacks found by shortening the icon name
2401  * at '-' characters. If the "names" array has more than one element,
2402  * ignores any past the first.
2403  *
2404  * For example, if the icon name was "gnome-dev-cdrom-audio", the array
2405  * would become
2406  * |[
2407  * {
2408  *   "gnome-dev-cdrom-audio",
2409  *   "gnome-dev-cdrom",
2410  *   "gnome-dev",
2411  *   "gnome",
2412  *   NULL
2413  * };
2414  * ]|
2415  */
2416
2417
2418 /**
2419  * GThreadedSocketService::run:
2420  * @service: the #GThreadedSocketService.
2421  * @connection: a new #GSocketConnection object.
2422  * @source_object: the source_object passed to g_socket_listener_add_address().
2423  *
2424  * The ::run signal is emitted in a worker thread in response to an
2425  * incoming connection. This thread is dedicated to handling
2426  * @connection and may perform blocking IO. The signal handler need
2427  * not return until the connection is closed.
2428  *
2429  * Returns: %TRUE to stop further signal handlers from being called
2430  */
2431
2432
2433 /**
2434  * GTlsBackend:
2435  *
2436  * TLS (Transport Layer Security, aka SSL) backend. This is an
2437  * internal type used to coordinate the different classes implemented
2438  * by a TLS backend.
2439  *
2440  * Since: 2.28
2441  */
2442
2443
2444 /**
2445  * GTlsCertificate:
2446  *
2447  * Abstract base class for TLS certificate types.
2448  *
2449  * Since: 2.28
2450  */
2451
2452
2453 /**
2454  * GTlsCertificate:certificate:
2455  *
2456  * The DER (binary) encoded representation of the certificate's
2457  * public key. This property and the
2458  * #GTlsCertificate:certificate-pem property represent the same
2459  * data, just in different forms.
2460  *
2461  * Since: 2.28
2462  */
2463
2464
2465 /**
2466  * GTlsCertificate:certificate-pem:
2467  *
2468  * The PEM (ASCII) encoded representation of the certificate's
2469  * public key. This property and the #GTlsCertificate:certificate
2470  * property represent the same data, just in different forms.
2471  *
2472  * Since: 2.28
2473  */
2474
2475
2476 /**
2477  * GTlsCertificate:issuer:
2478  *
2479  * A #GTlsCertificate representing the entity that issued this
2480  * certificate. If %NULL, this means that the certificate is either
2481  * self-signed, or else the certificate of the issuer is not
2482  * available.
2483  *
2484  * Since: 2.28
2485  */
2486
2487
2488 /**
2489  * GTlsCertificate:private-key:
2490  *
2491  * The DER (binary) encoded representation of the certificate's
2492  * private key, in either PKCS#1 format or unencrypted PKCS#8
2493  * format. This property (or the #GTlsCertificate:private-key-pem
2494  * property) can be set when constructing a key (eg, from a file),
2495  * but cannot be read.
2496  *
2497  * PKCS#8 format is supported since 2.32; earlier releases only
2498  * support PKCS#1. You can use the <literal>openssl rsa</literal>
2499  * tool to convert PKCS#8 keys to PKCS#1.
2500  *
2501  * Since: 2.28
2502  */
2503
2504
2505 /**
2506  * GTlsCertificate:private-key-pem:
2507  *
2508  * The PEM (ASCII) encoded representation of the certificate's
2509  * private key in either PKCS#1 format ("<literal>BEGIN RSA PRIVATE
2510  * KEY</literal>") or unencrypted PKCS#8 format ("<literal>BEGIN
2511  * PRIVATE KEY</literal>"). This property (or the
2512  * #GTlsCertificate:private-key property) can be set when
2513  * constructing a key (eg, from a file), but cannot be read.
2514  *
2515  * PKCS#8 format is supported since 2.32; earlier releases only
2516  * support PKCS#1. You can use the <literal>openssl rsa</literal>
2517  * tool to convert PKCS#8 keys to PKCS#1.
2518  *
2519  * Since: 2.28
2520  */
2521
2522
2523 /**
2524  * GTlsClientConnection:
2525  *
2526  * Abstract base class for the backend-specific client connection
2527  * type.
2528  *
2529  * Since: 2.28
2530  */
2531
2532
2533 /**
2534  * GTlsClientConnection:accepted-cas:
2535  *
2536  * A list of the distinguished names of the Certificate Authorities
2537  * that the server will accept client certificates signed by. If the
2538  * server requests a client certificate during the handshake, then
2539  * this property will be set after the handshake completes.
2540  *
2541  * Each item in the list is a #GByteArray which contains the complete
2542  * subject DN of the certificate authority.
2543  *
2544  * Since: 2.28
2545  */
2546
2547
2548 /**
2549  * GTlsClientConnection:server-identity:
2550  *
2551  * A #GSocketConnectable describing the identity of the server that
2552  * is expected on the other end of the connection.
2553  *
2554  * If the %G_TLS_CERTIFICATE_BAD_IDENTITY flag is set in
2555  * #GTlsClientConnection:validation-flags, this object will be used
2556  * to determine the expected identify of the remote end of the
2557  * connection; if #GTlsClientConnection:server-identity is not set,
2558  * or does not match the identity presented by the server, then the
2559  * %G_TLS_CERTIFICATE_BAD_IDENTITY validation will fail.
2560  *
2561  * In addition to its use in verifying the server certificate,
2562  * this is also used to give a hint to the server about what
2563  * certificate we expect, which is useful for servers that serve
2564  * virtual hosts.
2565  *
2566  * Since: 2.28
2567  */
2568
2569
2570 /**
2571  * GTlsClientConnection:use-ssl3:
2572  *
2573  * If %TRUE, tells the connection to use SSL 3.0 rather than trying
2574  * to negotiate the best version of TLS or SSL to use. This can be
2575  * used when talking to servers that don't implement version
2576  * negotiation correctly and therefore refuse to handshake at all with
2577  * a "modern" TLS handshake.
2578  *
2579  * Since: 2.28
2580  */
2581
2582
2583 /**
2584  * GTlsClientConnection:validation-flags:
2585  *
2586  * What steps to perform when validating a certificate received from
2587  * a server. Server certificates that fail to validate in all of the
2588  * ways indicated here will be rejected unless the application
2589  * overrides the default via #GTlsConnection::accept-certificate.
2590  *
2591  * Since: 2.28
2592  */
2593
2594
2595 /**
2596  * GTlsConnection:
2597  *
2598  * Abstract base class for the backend-specific #GTlsClientConnection
2599  * and #GTlsServerConnection types.
2600  *
2601  * Since: 2.28
2602  */
2603
2604
2605 /**
2606  * GTlsConnection::accept-certificate:
2607  * @conn: a #GTlsConnection
2608  * @peer_cert: the peer's #GTlsCertificate
2609  * @errors: the problems with @peer_cert.
2610  *
2611  * Emitted during the TLS handshake after the peer certificate has
2612  * been received. You can examine @peer_cert's certification path by
2613  * calling g_tls_certificate_get_issuer() on it.
2614  *
2615  * For a client-side connection, @peer_cert is the server's
2616  * certificate, and the signal will only be emitted if the
2617  * certificate was not acceptable according to @conn's
2618  * #GTlsClientConnection:validation_flags. If you would like the
2619  * certificate to be accepted despite @errors, return %TRUE from the
2620  * signal handler. Otherwise, if no handler accepts the certificate,
2621  * the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE.
2622  *
2623  * For a server-side connection, @peer_cert is the certificate
2624  * presented by the client, if this was requested via the server's
2625  * #GTlsServerConnection:authentication_mode. On the server side,
2626  * the signal is always emitted when the client presents a
2627  * certificate, and the certificate will only be accepted if a
2628  * handler returns %TRUE.
2629  *
2630  * Note that if this signal is emitted as part of asynchronous I/O
2631  * in the main thread, then you should not attempt to interact with
2632  * the user before returning from the signal handler. If you want to
2633  * let the user decide whether or not to accept the certificate, you
2634  * would have to return %FALSE from the signal handler on the first
2635  * attempt, and then after the connection attempt returns a
2636  * %G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if
2637  * the user decides to accept the certificate, remember that fact,
2638  * create a new connection, and return %TRUE from the signal handler
2639  * the next time.
2640  *
2641  * If you are doing I/O in another thread, you do not
2642  * need to worry about this, and can simply block in the signal
2643  * handler until the UI thread returns an answer.
2644  *
2645  * 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.
2646  * Since: 2.28
2647  */
2648
2649
2650 /**
2651  * GTlsConnection:base-io-stream:
2652  *
2653  * The #GIOStream that the connection wraps
2654  *
2655  * Since: 2.28
2656  */
2657
2658
2659 /**
2660  * GTlsConnection:certificate:
2661  *
2662  * The connection's certificate; see
2663  * g_tls_connection_set_certificate().
2664  *
2665  * Since: 2.28
2666  */
2667
2668
2669 /**
2670  * GTlsConnection:database:
2671  *
2672  * The certificate database to use when verifying this TLS connection.
2673  * If no cerificate database is set, then the default database will be
2674  * used. See g_tls_backend_get_default_database().
2675  *
2676  * Since: 2.30
2677  */
2678
2679
2680 /**
2681  * GTlsConnection:interaction:
2682  *
2683  * A #GTlsInteraction object to be used when the connection or certificate
2684  * database need to interact with the user. This will be used to prompt the
2685  * user for passwords where necessary.
2686  *
2687  * Since: 2.30
2688  */
2689
2690
2691 /**
2692  * GTlsConnection:peer-certificate:
2693  *
2694  * The connection's peer's certificate, after the TLS handshake has
2695  * completed and the certificate has been accepted. Note in
2696  * particular that this is not yet set during the emission of
2697  * #GTlsConnection::accept-certificate.
2698  *
2699  * (You can watch for a #GObject::notify signal on this property to
2700  * detect when a handshake has occurred.)
2701  *
2702  * Since: 2.28
2703  */
2704
2705
2706 /**
2707  * GTlsConnection:peer-certificate-errors:
2708  *
2709  * The errors noticed-and-ignored while verifying
2710  * #GTlsConnection:peer-certificate. Normally this should be 0, but
2711  * it may not be if #GTlsClientConnection:validation-flags is not
2712  * %G_TLS_CERTIFICATE_VALIDATE_ALL, or if
2713  * #GTlsConnection::accept-certificate overrode the default
2714  * behavior.
2715  *
2716  * Since: 2.28
2717  */
2718
2719
2720 /**
2721  * GTlsConnection:rehandshake-mode:
2722  *
2723  * The rehandshaking mode. See
2724  * g_tls_connection_set_rehandshake_mode().
2725  *
2726  * Since: 2.28
2727  */
2728
2729
2730 /**
2731  * GTlsConnection:require-close-notify:
2732  *
2733  * Whether or not proper TLS close notification is required.
2734  * See g_tls_connection_set_require_close_notify().
2735  *
2736  * Since: 2.28
2737  */
2738
2739
2740 /**
2741  * GTlsConnection:use-system-certdb:
2742  *
2743  * Whether or not the system certificate database will be used to
2744  * verify peer certificates. See
2745  * g_tls_connection_set_use_system_certdb().
2746  *
2747  * Deprecated: 2.30: Use GTlsConnection:database instead
2748  */
2749
2750
2751 /**
2752  * GTlsDatabase:
2753  *
2754  * Abstract base class for the backend-specific database types.
2755  *
2756  * Since: 2.30
2757  */
2758
2759
2760 /**
2761  * GTlsFileDatabase:
2762  *
2763  * Implemented by a #GTlsDatabase which allows you to load certificates
2764  * from a file.
2765  *
2766  * Since: 2.30
2767  */
2768
2769
2770 /**
2771  * GTlsFileDatabase:anchors:
2772  *
2773  * The path to a file containing PEM encoded certificate authority
2774  * root anchors. The certificates in this file will be treated as
2775  * root authorities for the purpose of verifying other certificates
2776  * via the g_tls_database_verify_chain() operation.
2777  *
2778  * Since: 2.30
2779  */
2780
2781
2782 /**
2783  * GTlsInteraction:
2784  *
2785  * An object representing interaction that the TLS connection and database
2786  * might have with the user.
2787  *
2788  * Since: 2.30
2789  */
2790
2791
2792 /**
2793  * GTlsInteractionClass:
2794  * @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.
2795  * @ask_password_async: ask for a password asynchronously.
2796  * @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.
2797  *
2798  * The class for #GTlsInteraction. Derived classes implement the various
2799  * virtual interaction methods to handle TLS interactions.
2800  *
2801  * Derived classes can choose to implement whichever interactions methods they'd
2802  * like to support by overriding those virtual methods in their class
2803  * initialization function. If a derived class implements an async method,
2804  * it must also implement the corresponding finish method.
2805  *
2806  * The synchronous interaction methods should implement to display modal dialogs,
2807  * and the asynchronous methods to display modeless dialogs.
2808  *
2809  * If the user cancels an interaction, then the result should be
2810  * %G_TLS_INTERACTION_FAILED and the error should be set with a domain of
2811  * %G_IO_ERROR and code of %G_IO_ERROR_CANCELLED.
2812  *
2813  * Since: 2.30
2814  */
2815
2816
2817 /**
2818  * GTlsPassword:
2819  *
2820  * An abstract interface representing a password used in TLS. Often used in
2821  * user interaction such as unlocking a key storage token.
2822  *
2823  * Since: 2.30
2824  */
2825
2826
2827 /**
2828  * GTlsServerConnection:authentication-mode:
2829  *
2830  * The #GTlsAuthenticationMode for the server. This can be changed
2831  * before calling g_tls_connection_handshake() if you want to
2832  * rehandshake with a different mode from the initial handshake.
2833  *
2834  * Since: 2.28
2835  */
2836
2837
2838 /**
2839  * GUnixCredentialsMessage:credentials:
2840  *
2841  * The credentials stored in the message.
2842  *
2843  * Since: 2.26
2844  */
2845
2846
2847 /**
2848  * GUnixInputStream:close-fd:
2849  *
2850  * Whether to close the file descriptor when the stream is closed.
2851  *
2852  * Since: 2.20
2853  */
2854
2855
2856 /**
2857  * GUnixInputStream:fd:
2858  *
2859  * The file descriptor that the stream reads from.
2860  *
2861  * Since: 2.20
2862  */
2863
2864
2865 /**
2866  * GUnixMountMonitor::mountpoints-changed:
2867  * @monitor: the object on which the signal is emitted
2868  *
2869  * Emitted when the unix mount points have changed.
2870  */
2871
2872
2873 /**
2874  * GUnixMountMonitor::mounts-changed:
2875  * @monitor: the object on which the signal is emitted
2876  *
2877  * Emitted when the unix mounts have changed.
2878  */
2879
2880
2881 /**
2882  * GUnixOutputStream:close-fd:
2883  *
2884  * Whether to close the file descriptor when the stream is closed.
2885  *
2886  * Since: 2.20
2887  */
2888
2889
2890 /**
2891  * GUnixOutputStream:fd:
2892  *
2893  * The file descriptor that the stream writes to.
2894  *
2895  * Since: 2.20
2896  */
2897
2898
2899 /**
2900  * GUnixSocketAddress:
2901  *
2902  * A UNIX-domain (local) socket address, corresponding to a
2903  * <type>struct sockaddr_un</type>.
2904  */
2905
2906
2907 /**
2908  * GUnixSocketAddress:abstract:
2909  *
2910  * Whether or not this is an abstract address
2911  *
2912  * Deprecated: Use #GUnixSocketAddress:address-type, which distinguishes between zero-padded and non-zero-padded abstract addresses.
2913  */
2914
2915
2916 /**
2917  * GVolume::changed:
2918  *
2919  * Emitted when the volume has been changed.
2920  */
2921
2922
2923 /**
2924  * GVolume::removed:
2925  *
2926  * This signal is emitted when the #GVolume have been removed. If
2927  * the recipient is holding references to the object they should
2928  * release them so the object can be finalized.
2929  */
2930
2931
2932 /**
2933  * GVolumeMonitor::drive-changed:
2934  * @volume_monitor: The volume monitor emitting the signal.
2935  * @drive: the drive that changed
2936  *
2937  * Emitted when a drive changes.
2938  */
2939
2940
2941 /**
2942  * GVolumeMonitor::drive-connected:
2943  * @volume_monitor: The volume monitor emitting the signal.
2944  * @drive: a #GDrive that was connected.
2945  *
2946  * Emitted when a drive is connected to the system.
2947  */
2948
2949
2950 /**
2951  * GVolumeMonitor::drive-disconnected:
2952  * @volume_monitor: The volume monitor emitting the signal.
2953  * @drive: a #GDrive that was disconnected.
2954  *
2955  * Emitted when a drive is disconnected from the system.
2956  */
2957
2958
2959 /**
2960  * GVolumeMonitor::drive-eject-button:
2961  * @volume_monitor: The volume monitor emitting the signal.
2962  * @drive: the drive where the eject button was pressed
2963  *
2964  * Emitted when the eject button is pressed on @drive.
2965  *
2966  * Since: 2.18
2967  */
2968
2969
2970 /**
2971  * GVolumeMonitor::drive-stop-button:
2972  * @volume_monitor: The volume monitor emitting the signal.
2973  * @drive: the drive where the stop button was pressed
2974  *
2975  * Emitted when the stop button is pressed on @drive.
2976  *
2977  * Since: 2.22
2978  */
2979
2980
2981 /**
2982  * GVolumeMonitor::mount-added:
2983  * @volume_monitor: The volume monitor emitting the signal.
2984  * @mount: a #GMount that was added.
2985  *
2986  * Emitted when a mount is added.
2987  */
2988
2989
2990 /**
2991  * GVolumeMonitor::mount-changed:
2992  * @volume_monitor: The volume monitor emitting the signal.
2993  * @mount: a #GMount that changed.
2994  *
2995  * Emitted when a mount changes.
2996  */
2997
2998
2999 /**
3000  * GVolumeMonitor::mount-pre-unmount:
3001  * @volume_monitor: The volume monitor emitting the signal.
3002  * @mount: a #GMount that is being unmounted.
3003  *
3004  * Emitted when a mount is about to be removed.
3005  */
3006
3007
3008 /**
3009  * GVolumeMonitor::mount-removed:
3010  * @volume_monitor: The volume monitor emitting the signal.
3011  * @mount: a #GMount that was removed.
3012  *
3013  * Emitted when a mount is removed.
3014  */
3015
3016
3017 /**
3018  * GVolumeMonitor::volume-added:
3019  * @volume_monitor: The volume monitor emitting the signal.
3020  * @volume: a #GVolume that was added.
3021  *
3022  * Emitted when a mountable volume is added to the system.
3023  */
3024
3025
3026 /**
3027  * GVolumeMonitor::volume-changed:
3028  * @volume_monitor: The volume monitor emitting the signal.
3029  * @volume: a #GVolume that changed.
3030  *
3031  * Emitted when mountable volume is changed.
3032  */
3033
3034
3035 /**
3036  * GVolumeMonitor::volume-removed:
3037  * @volume_monitor: The volume monitor emitting the signal.
3038  * @volume: a #GVolume that was removed.
3039  *
3040  * Emitted when a mountable volume is removed from the system.
3041  */
3042
3043
3044 /**
3045  * GWin32InputStream:close-handle:
3046  *
3047  * Whether to close the file handle when the stream is closed.
3048  *
3049  * Since: 2.26
3050  */
3051
3052
3053 /**
3054  * GWin32InputStream:handle:
3055  *
3056  * The handle that the stream reads from.
3057  *
3058  * Since: 2.26
3059  */
3060
3061
3062 /**
3063  * GWin32OutputStream:close-handle:
3064  *
3065  * Whether to close the file handle when the stream is closed.
3066  *
3067  * Since: 2.26
3068  */
3069
3070
3071 /**
3072  * GWin32OutputStream:handle:
3073  *
3074  * The file handle that the stream writes to.
3075  *
3076  * Since: 2.26
3077  */
3078
3079
3080 /**
3081  * GZlibCompressor:
3082  *
3083  * Zlib decompression
3084  */
3085
3086
3087 /**
3088  * GZlibCompressor:file-info:
3089  *
3090  * If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is
3091  * %G_ZLIB_COMPRESSOR_FORMAT_GZIP, the compressor will write the file name
3092  * and modification time from the file info to the the GZIP header.
3093  *
3094  * Since: 2.26
3095  */
3096
3097
3098 /**
3099  * GZlibDecompressor:
3100  *
3101  * Zlib decompression
3102  */
3103
3104
3105 /**
3106  * GZlibDecompressor:file-info:
3107  *
3108  * A #GFileInfo containing the information found in the GZIP header
3109  * of the data stream processed, or %NULL if the header was not yet
3110  * fully processed, is not present at all, or the compressor's
3111  * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP.
3112  *
3113  * Since: 2.26
3114  */
3115
3116
3117 /**
3118  * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT:
3119  *
3120  * The purpose used to verify the client certificate in a TLS connection.
3121  * Used by TLS servers.
3122  */
3123
3124
3125 /**
3126  * G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER:
3127  *
3128  * The purpose used to verify the server certificate in a TLS connection. This
3129  * is the most common purpose in use. Used by TLS clients.
3130  */
3131
3132
3133 /**
3134  * G_TYPE_SETTINGS_SCHEMA:
3135  *
3136  * A boxed #GType corresponding to #GSettingsSchema.
3137  *
3138  * Since: 2.32
3139  */
3140
3141
3142 /**
3143  * G_TYPE_SETTINGS_SCHEMA_SOURCE:
3144  *
3145  * A boxed #GType corresponding to #GSettingsSchemaSource.
3146  *
3147  * Since: 2.32
3148  */
3149
3150
3151 /**
3152  * SECTION:extensionpoints
3153  * @short_description: Extension Points
3154  * @include: gio.h
3155  * @see_also: <link linkend="extending-gio">Extending GIO</link>
3156  *
3157  * #GIOExtensionPoint provides a mechanism for modules to extend the
3158  * functionality of the library or application that loaded it in an
3159  * organized fashion.
3160  *
3161  * An extension point is identified by a name, and it may optionally
3162  * require that any implementation must by of a certain type (or derived
3163  * thereof). Use g_io_extension_point_register() to register an
3164  * extension point, and g_io_extension_point_set_required_type() to
3165  * set a required type.
3166  *
3167  * A module can implement an extension point by specifying the #GType
3168  * that implements the functionality. Additionally, each implementation
3169  * of an extension point has a name, and a priority. Use
3170  * g_io_extension_point_implement() to implement an extension point.
3171  *
3172  *  |[
3173  *  GIOExtensionPoint *ep;
3174  *
3175  *  /&ast; Register an extension point &ast;/
3176  *  ep = g_io_extension_point_register ("my-extension-point");
3177  *  g_io_extension_point_set_required_type (ep, MY_TYPE_EXAMPLE);
3178  *  ]|
3179  *
3180  *  |[
3181  *  /&ast; Implement an extension point &ast;/
3182  *  G_DEFINE_TYPE (MyExampleImpl, my_example_impl, MY_TYPE_EXAMPLE);
3183  *  g_io_extension_point_implement ("my-extension-point",
3184  *                                  my_example_impl_get_type (),
3185  *                                  "my-example",
3186  *                                  10);
3187  *  ]|
3188  *
3189  *  It is up to the code that registered the extension point how
3190  *  it uses the implementations that have been associated with it.
3191  *  Depending on the use case, it may use all implementations, or
3192  *  only the one with the highest priority, or pick a specific
3193  *  one by name.
3194  *
3195  *  To avoid opening all modules just to find out what extension
3196  *  points they implement, GIO makes use of a caching mechanism,
3197  *  see <link linkend="gio-querymodules">gio-querymodules</link>.
3198  *  You are expected to run this command after installing a
3199  *  GIO module.
3200  *
3201  *  The <envar>GIO_EXTRA_MODULES</envar> environment variable can be
3202  *  used to specify additional directories to automatically load modules
3203  *  from. This environment variable has the same syntax as the
3204  *  <envar>PATH</envar>. If two modules have the same base name in different
3205  *  directories, then the latter one will be ignored. If additional
3206  *  directories are specified GIO will load modules from the built-in
3207  *  directory last.
3208  */
3209
3210
3211 /**
3212  * SECTION:gaction
3213  * @title: GAction
3214  * @short_description: An action interface
3215  *
3216  * #GAction represents a single named action.
3217  *
3218  * The main interface to an action is that it can be activated with
3219  * g_action_activate().  This results in the 'activate' signal being
3220  * emitted.  An activation has a #GVariant parameter (which may be
3221  * %NULL).  The correct type for the parameter is determined by a static
3222  * parameter type (which is given at construction time).
3223  *
3224  * An action may optionally have a state, in which case the state may be
3225  * set with g_action_change_state().  This call takes a #GVariant.  The
3226  * correct type for the state is determined by a static state type
3227  * (which is given at construction time).
3228  *
3229  * The state may have a hint associated with it, specifying its valid
3230  * range.
3231  *
3232  * #GAction is merely the interface to the concept of an action, as
3233  * described above.  Various implementations of actions exist, including
3234  * #GSimpleAction and #GtkAction.
3235  *
3236  * In all cases, the implementing class is responsible for storing the
3237  * name of the action, the parameter type, the enabled state, the
3238  * optional state type and the state and emitting the appropriate
3239  * signals when these change.  The implementor responsible for filtering
3240  * calls to g_action_activate() and g_action_change_state() for type
3241  * safety and for the state being enabled.
3242  *
3243  * Probably the only useful thing to do with a #GAction is to put it
3244  * inside of a #GSimpleActionGroup.
3245  */
3246
3247
3248 /**
3249  * SECTION:gactiongroup
3250  * @title: GActionGroup
3251  * @short_description: A group of actions
3252  * @see_also: #GAction
3253  *
3254  * #GActionGroup represents a group of actions. Actions can be used to
3255  * expose functionality in a structured way, either from one part of a
3256  * program to another, or to the outside world. Action groups are often
3257  * used together with a #GMenuModel that provides additional
3258  * representation data for displaying the actions to the user, e.g. in
3259  * a menu.
3260  *
3261  * The main way to interact with the actions in a GActionGroup is to
3262  * activate them with g_action_group_activate_action(). Activating an
3263  * action may require a #GVariant parameter. The required type of the
3264  * parameter can be inquired with g_action_group_get_action_parameter_type().
3265  * Actions may be disabled, see g_action_group_get_action_enabled().
3266  * Activating a disabled action has no effect.
3267  *
3268  * Actions may optionally have a state in the form of a #GVariant. The
3269  * current state of an action can be inquired with
3270  * g_action_group_get_action_state(). Activating a stateful action may
3271  * change its state, but it is also possible to set the state by calling
3272  * g_action_group_change_action_state().
3273  *
3274  * As typical example, consider a text editing application which has an
3275  * option to change the current font to 'bold'. A good way to represent
3276  * this would be a stateful action, with a boolean state. Activating the
3277  * action would toggle the state.
3278  *
3279  * Each action in the group has a unique name (which is a string).  All
3280  * method calls, except g_action_group_list_actions() take the name of
3281  * an action as an argument.
3282  *
3283  * The #GActionGroup API is meant to be the 'public' API to the action
3284  * group.  The calls here are exactly the interaction that 'external
3285  * forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have
3286  * with actions.  'Internal' APIs (ie: ones meant only to be accessed by
3287  * the action group implementation) are found on subclasses.  This is
3288  * why you will find - for example - g_action_group_get_action_enabled()
3289  * but not an equivalent <function>set()</function> call.
3290  *
3291  * Signals are emitted on the action group in response to state changes
3292  * on individual actions.
3293  *
3294  * Implementations of #GActionGroup should provide implementations for
3295  * the virtual functions g_action_group_list_actions() and
3296  * g_action_group_query_action().  The other virtual functions should
3297  * not be implemented - their "wrappers" are actually implemented with
3298  * calls to g_action_group_query_action().
3299  */
3300
3301
3302 /**
3303  * SECTION:gactiongroupexporter
3304  * @title: GActionGroup exporter
3305  * @short_description: Export GActionGroups on D-Bus
3306  * @see_also: #GActionGroup, #GDBusActionGroup
3307  *
3308  * These functions support exporting a #GActionGroup on D-Bus.
3309  * The D-Bus interface that is used is a private implementation
3310  * detail.
3311  *
3312  * To access an exported #GActionGroup remotely, use
3313  * g_dbus_action_group_get() to obtain a #GDBusActionGroup.
3314  */
3315
3316
3317 /**
3318  * SECTION:gactionmap
3319  * @title: GActionMap
3320  * @short_description: Interface for action containers
3321  *
3322  * The GActionMap interface is implemented by #GActionGroup
3323  * implementations that operate by containing a number of
3324  * named #GAction instances, such as #GSimpleActionGroup.
3325  *
3326  * One useful application of this interface is to map the
3327  * names of actions from various action groups to unique,
3328  * prefixed names (e.g. by prepending "app." or "win.").
3329  * This is the motivation for the 'Map' part of the interface
3330  * name.
3331  *
3332  * Since: 2.32
3333  */
3334
3335
3336 /**
3337  * SECTION:gappinfo
3338  * @short_description: Application information and launch contexts
3339  * @include: gio/gio.h
3340  *
3341  * #GAppInfo and #GAppLaunchContext are used for describing and launching
3342  * applications installed on the system.
3343  *
3344  * As of GLib 2.20, URIs will always be converted to POSIX paths
3345  * (using g_file_get_path()) when using g_app_info_launch() even if
3346  * the application requested an URI and not a POSIX path. For example
3347  * for an desktop-file based application with Exec key <literal>totem
3348  * &percnt;U</literal> and a single URI,
3349  * <literal>sftp://foo/file.avi</literal>, then
3350  * <literal>/home/user/.gvfs/sftp on foo/file.avi</literal> will be
3351  * passed. This will only work if a set of suitable GIO extensions
3352  * (such as gvfs 2.26 compiled with FUSE support), is available and
3353  * operational; if this is not the case, the URI will be passed
3354  * unmodified to the application. Some URIs, such as
3355  * <literal>mailto:</literal>, of course cannot be mapped to a POSIX
3356  * path (in gvfs there's no FUSE mount for it); such URIs will be
3357  * passed unmodified to the application.
3358  *
3359  * Specifically for gvfs 2.26 and later, the POSIX URI will be mapped
3360  * back to the GIO URI in the #GFile constructors (since gvfs
3361  * implements the #GVfs extension point). As such, if the application
3362  * needs to examine the URI, it needs to use g_file_get_uri() or
3363  * similar on #GFile. In other words, an application cannot assume
3364  * that the URI passed to e.g. g_file_new_for_commandline_arg() is
3365  * equal to the result of g_file_get_uri(). The following snippet
3366  * illustrates this:
3367  *
3368  * <programlisting>
3369  * GFile *f;
3370  * char *uri;
3371  *
3372  * file = g_file_new_for_commandline_arg (uri_from_commandline);
3373  *
3374  * uri = g_file_get_uri (file);
3375  * strcmp (uri, uri_from_commandline) == 0; // FALSE
3376  * g_free (uri);
3377  *
3378  * if (g_file_has_uri_scheme (file, "cdda"))
3379  *   {
3380  *     // do something special with uri
3381  *   }
3382  * g_object_unref (file);
3383  * </programlisting>
3384  *
3385  * This code will work when both <literal>cdda://sr0/Track
3386  * 1.wav</literal> and <literal>/home/user/.gvfs/cdda on sr0/Track
3387  * 1.wav</literal> is passed to the application. It should be noted
3388  * that it's generally not safe for applications to rely on the format
3389  * of a particular URIs. Different launcher applications (e.g. file
3390  * managers) may have different ideas of what a given URI means.
3391  */
3392
3393
3394 /**
3395  * SECTION:gapplication
3396  * @title: GApplication
3397  * @short_description: Core application class
3398  *
3399  * A #GApplication is the foundation of an application.  It wraps some
3400  * low-level platform-specific services and is intended to act as the
3401  * foundation for higher-level application classes such as
3402  * #GtkApplication or #MxApplication.  In general, you should not use
3403  * this class outside of a higher level framework.
3404  *
3405  * GApplication provides convenient life cycle management by maintaining
3406  * a <firstterm>use count</firstterm> for the primary application instance.
3407  * The use count can be changed using g_application_hold() and
3408  * g_application_release(). If it drops to zero, the application exits.
3409  * Higher-level classes such as #GtkApplication employ the use count to
3410  * ensure that the application stays alive as long as it has any opened
3411  * windows.
3412  *
3413  * Another feature that GApplication (optionally) provides is process
3414  * uniqueness.  Applications can make use of this functionality by
3415  * providing a unique application ID.  If given, only one application
3416  * with this ID can be running at a time per session.  The session
3417  * concept is platform-dependent, but corresponds roughly to a graphical
3418  * desktop login.  When your application is launched again, its
3419  * arguments are passed through platform communication to the already
3420  * running program.  The already running instance of the program is
3421  * called the <firstterm>primary instance</firstterm>; for non-unique
3422  * applications this is the always the current instance.
3423  * On Linux, the D-Bus session bus is used for communication.
3424  *
3425  * If used, the expected form of an application identifier is very close
3426  * to that of of a
3427  * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-interface">DBus bus name</ulink>.
3428  * Examples include: "com.example.MyApp", "org.example.internal-apps.Calculator".
3429  * For details on valid application identifiers, see g_application_id_is_valid().
3430  *
3431  * On Linux, the application identifier is claimed as a well-known bus name
3432  * on the user's session bus.  This means that the uniqueness of your
3433  * application is scoped to the current session.  It also means that your
3434  * application may provide additional services (through registration of other
3435  * object paths) at that bus name.  The registration of these object paths
3436  * should be done with the shared GDBus session bus.  Note that due to the
3437  * internal architecture of GDBus, method calls can be dispatched at any time
3438  * (even if a main loop is not running).  For this reason, you must ensure that
3439  * any object paths that you wish to register are registered before #GApplication
3440  * attempts to acquire the bus name of your application (which happens in
3441  * g_application_register()).  Unfortunately, this means that you cannot use
3442  * g_application_get_is_remote() to decide if you want to register object paths.
3443  *
3444  * GApplication also implements the #GActionGroup and #GActionMap
3445  * interfaces and lets you easily export actions by adding them with
3446  * g_action_map_add_action(). When invoking an action by calling
3447  * g_action_group_activate_action() on the application, it is always
3448  * invoked in the primary instance. The actions are also exported on
3449  * the session bus, and GIO provides the #GDBusActionGroup wrapper to
3450  * conveniently access them remotely. GIO provides a #GDBusMenuModel wrapper
3451  * for remote access to exported #GMenuModels.
3452  *
3453  * There is a number of different entry points into a GApplication:
3454  * <itemizedlist>
3455  * <listitem>via 'Activate' (i.e. just starting the application)</listitem>
3456  * <listitem>via 'Open' (i.e. opening some files)</listitem>
3457  * <listitem>by handling a command-line</listitem>
3458  * <listitem>via activating an action</listitem>
3459  * </itemizedlist>
3460  * The #GApplication::startup signal lets you handle the application
3461  * initialization for all of these in a single place.
3462  *
3463  * Regardless of which of these entry points is used to start the application,
3464  * GApplication passes some <firstterm id="platform-data">platform
3465  * data</firstterm> from the launching instance to the primary instance,
3466  * in the form of a #GVariant dictionary mapping strings to variants.
3467  * To use platform data, override the @before_emit or @after_emit virtual
3468  * functions in your #GApplication subclass. When dealing with
3469  * #GApplicationCommandLine objects, the platform data is directly
3470  * available via g_application_command_line_get_cwd(),
3471  * g_application_command_line_get_environ() and
3472  * g_application_command_line_get_platform_data().
3473  *
3474  * As the name indicates, the platform data may vary depending on the
3475  * operating system, but it always includes the current directory (key
3476  * "cwd"), and optionally the environment (ie the set of environment
3477  * variables and their values) of the calling process (key "environ").
3478  * The environment is only added to the platform data if the
3479  * %G_APPLICATION_SEND_ENVIRONMENT flag is set. #GApplication subclasses
3480  * can add their own platform data by overriding the @add_platform_data
3481  * virtual function. For instance, #GtkApplication adds startup notification
3482  * data in this way.
3483  *
3484  * To parse commandline arguments you may handle the
3485  * #GApplication::command-line signal or override the local_command_line()
3486  * vfunc, to parse them in either the primary instance or the local instance,
3487  * respectively.
3488  *
3489  * <example id="gapplication-example-open"><title>Opening files with a GApplication</title>
3490  * <programlisting>
3491  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-open.c">
3492  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3493  * </xi:include>
3494  * </programlisting>
3495  * </example>
3496  *
3497  * <example id="gapplication-example-actions"><title>A GApplication with actions</title>
3498  * <programlisting>
3499  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-actions.c">
3500  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3501  * </xi:include>
3502  * </programlisting>
3503  * </example>
3504  *
3505  * <example id="gapplication-example-menu"><title>A GApplication with menus</title>
3506  * <programlisting>
3507  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-menu.c">
3508  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3509  * </xi:include>
3510  * </programlisting>
3511  * </example>
3512  */
3513
3514
3515 /**
3516  * SECTION:gapplicationcommandline
3517  * @title: GApplicationCommandLine
3518  * @short_description: A command-line invocation of an application
3519  * @see_also: #GApplication
3520  *
3521  * #GApplicationCommandLine represents a command-line invocation of
3522  * an application.  It is created by #GApplication and emitted
3523  * in the #GApplication::command-line signal and virtual function.
3524  *
3525  * The class contains the list of arguments that the program was invoked
3526  * with.  It is also possible to query if the commandline invocation was
3527  * local (ie: the current process is running in direct response to the
3528  * invocation) or remote (ie: some other process forwarded the
3529  * commandline to this process).
3530  *
3531  * The GApplicationCommandLine object can provide the @argc and @argv
3532  * parameters for use with the #GOptionContext command-line parsing API,
3533  * with the g_application_command_line_get_arguments() function. See
3534  * <xref linkend="gapplication-example-cmdline3"/> for an example.
3535  *
3536  * The exit status of the originally-invoked process may be set and
3537  * messages can be printed to stdout or stderr of that process.  The
3538  * lifecycle of the originally-invoked process is tied to the lifecycle
3539  * of this object (ie: the process exits when the last reference is
3540  * dropped).
3541  *
3542  * The main use for #GApplicationCommandLine (and the
3543  * #GApplication::command-line signal) is 'Emacs server' like use cases:
3544  * You can set the <envar>EDITOR</envar> environment variable to have
3545  * e.g. git use your favourite editor to edit commit messages, and if you
3546  * already have an instance of the editor running, the editing will happen
3547  * in the running instance, instead of opening a new one. An important
3548  * aspect of this use case is that the process that gets started by git
3549  * does not return until the editing is done.
3550  *
3551  * <example id="gapplication-example-cmdline"><title>Handling commandline arguments with GApplication</title>
3552  * <para>
3553  * A simple example where the commandline is completely handled
3554  * in the #GApplication::command-line handler. The launching instance exits
3555  * once the signal handler in the primary instance has returned, and the
3556  * return value of the signal handler becomes the exit status of the launching
3557  * instance.
3558  * </para>
3559  * <programlisting>
3560  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline.c">
3561  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3562  * </xi:include>
3563  * </programlisting>
3564  * </example>
3565  *
3566  * <example id="gapplication-example-cmdline2"><title>Split commandline handling</title>
3567  * <para>
3568  * An example of split commandline handling. Options that start with
3569  * <literal>--local-</literal> are handled locally, all other options are
3570  * passed to the #GApplication::command-line handler which runs in the primary
3571  * instance.
3572  * </para>
3573  * <programlisting>
3574  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline2.c">
3575  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3576  * </xi:include>
3577  * </programlisting>
3578  * </example>
3579  *
3580  * <example id="gapplication-example-cmdline3"><title>Deferred commandline handling</title>
3581  * <para>
3582  * An example of deferred commandline handling. Here, the commandline is
3583  * not completely handled before the #GApplication::command-line handler
3584  * returns. Instead, we keep a reference to the GApplicationCommandLine
3585  * object and handle it later(in this example, in an idle). Note that it
3586  * is necessary to hold the application until you are done with the
3587  * commandline.
3588  * </para>
3589  * <para>
3590  * This example also shows how to use #GOptionContext for parsing the
3591  * commandline arguments. Note that it is necessary to disable the
3592  * built-in help-handling of #GOptionContext, since it calls exit()
3593  * after printing help, which is not what you want to happen in
3594  * the primary instance.
3595  * </para>
3596  * <programlisting>
3597  * <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline3.c">
3598  *   <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
3599  * </xi:include>
3600  * </programlisting>
3601  * </example>
3602  */
3603
3604
3605 /**
3606  * SECTION:gasyncinitable
3607  * @short_description: Asynchronously failable object initialization interface
3608  * @include: gio/gio.h
3609  * @see_also: #GInitable
3610  *
3611  * This is the asynchronous version of #GInitable; it behaves the same
3612  * in all ways except that initialization is asynchronous. For more details
3613  * see the descriptions on #GInitable.
3614  *
3615  * A class may implement both the #GInitable and #GAsyncInitable interfaces.
3616  *
3617  * Users of objects implementing this are not intended to use the interface
3618  * method directly; instead it will be used automatically in various ways.
3619  * For C applications you generally just call g_async_initable_new_async()
3620  * directly, or indirectly via a foo_thing_new_async() wrapper. This will call
3621  * g_async_initable_init_async() under the cover, calling back with %NULL and
3622  * a set %GError on failure.
3623  *
3624  * A typical implementation might look something like this:
3625  *
3626  * |[
3627  * enum {
3628  *    NOT_INITIALIZED,
3629  *    INITIALIZING,
3630  *    INITIALIZED
3631  * };
3632  *
3633  * static void
3634  * _foo_ready_cb (Foo *self)
3635  * {
3636  *   GList *l;
3637  *
3638  *   self->priv->state = INITIALIZED;
3639  *
3640  *   for (l = self->priv->init_results; l != NULL; l = l->next)
3641  *     {
3642  *       GSimpleAsyncResult *simple = l->data;
3643  *
3644  *       if (!self->priv->success)
3645  *         g_simple_async_result_set_error (simple, ...);
3646  *
3647  *       g_simple_async_result_complete (simple);
3648  *       g_object_unref (simple);
3649  *     }
3650  *
3651  *   g_list_free (self->priv->init_results);
3652  *   self->priv->init_results = NULL;
3653  * }
3654  *
3655  * static void
3656  * foo_init_async (GAsyncInitable       *initable,
3657  *                 int                   io_priority,
3658  *                 GCancellable         *cancellable,
3659  *                 GAsyncReadyCallback   callback,
3660  *                 gpointer              user_data)
3661  * {
3662  *   Foo *self = FOO (initable);
3663  *   GSimpleAsyncResult *simple;
3664  *
3665  *   simple = g_simple_async_result_new (G_OBJECT (initable)
3666  *                                       callback,
3667  *                                       user_data,
3668  *                                       foo_init_async);
3669  *
3670  *   switch (self->priv->state)
3671  *     {
3672  *       case NOT_INITIALIZED:
3673  *         _foo_get_ready (self);
3674  *         self->priv->init_results = g_list_append (self->priv->init_results,
3675  *                                                   simple);
3676  *         self->priv->state = INITIALIZING;
3677  *         break;
3678  *       case INITIALIZING:
3679  *         self->priv->init_results = g_list_append (self->priv->init_results,
3680  *                                                   simple);
3681  *         break;
3682  *       case INITIALIZED:
3683  *         if (!self->priv->success)
3684  *           g_simple_async_result_set_error (simple, ...);
3685  *
3686  *         g_simple_async_result_complete_in_idle (simple);
3687  *         g_object_unref (simple);
3688  *         break;
3689  *     }
3690  * }
3691  *
3692  * static gboolean
3693  * foo_init_finish (GAsyncInitable       *initable,
3694  *                  GAsyncResult         *result,
3695  *                  GError              **error)
3696  * {
3697  *   g_return_val_if_fail (g_simple_async_result_is_valid (result,
3698  *       G_OBJECT (initable), foo_init_async), FALSE);
3699  *
3700  *   if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
3701  *           error))
3702  *     return FALSE;
3703  *
3704  *   return TRUE;
3705  * }
3706  *
3707  * static void
3708  * foo_async_initable_iface_init (gpointer g_iface,
3709  *                                gpointer data)
3710  * {
3711  *   GAsyncInitableIface *iface = g_iface;
3712  *
3713  *   iface->init_async = foo_init_async;
3714  *   iface->init_finish = foo_init_finish;
3715  * }
3716  * ]|
3717  */
3718
3719
3720 /**
3721  * SECTION:gasyncresult
3722  * @short_description: Asynchronous Function Results
3723  * @include: gio/gio.h
3724  * @see_also: #GSimpleAsyncResult
3725  *
3726  * Provides a base class for implementing asynchronous function results.
3727  *
3728  * Asynchronous operations are broken up into two separate operations
3729  * which are chained together by a #GAsyncReadyCallback. To begin
3730  * an asynchronous operation, provide a #GAsyncReadyCallback to the
3731  * asynchronous function. This callback will be triggered when the
3732  * operation has completed, and will be passed a #GAsyncResult instance
3733  * filled with the details of the operation's success or failure, the
3734  * object the asynchronous function was started for and any error codes
3735  * returned. The asynchronous callback function is then expected to call
3736  * the corresponding "_finish()" function, passing the object the
3737  * function was called for, the #GAsyncResult instance, and (optionally)
3738  * an @error to grab any error conditions that may have occurred.
3739  *
3740  * The "_finish()" function for an operation takes the generic result
3741  * (of type #GAsyncResult) and returns the specific result that the
3742  * operation in question yields (e.g. a #GFileEnumerator for a
3743  * "enumerate children" operation). If the result or error status of the
3744  * operation is not needed, there is no need to call the "_finish()"
3745  * function; GIO will take care of cleaning up the result and error
3746  * information after the #GAsyncReadyCallback returns. You can pass
3747  * %NULL for the #GAsyncReadyCallback if you don't need to take any
3748  * action at all after the operation completes. Applications may also
3749  * take a reference to the #GAsyncResult and call "_finish()" later;
3750  * however, the "_finish()" function may be called at most once.
3751  *
3752  * Example of a typical asynchronous operation flow:
3753  * |[
3754  * void _theoretical_frobnitz_async (Theoretical         *t,
3755  *                                   GCancellable        *c,
3756  *                                   GAsyncReadyCallback *cb,
3757  *                                   gpointer             u);
3758  *
3759  * gboolean _theoretical_frobnitz_finish (Theoretical   *t,
3760  *                                        GAsyncResult  *res,
3761  *                                        GError       **e);
3762  *
3763  * static void
3764  * frobnitz_result_func (GObject      *source_object,
3765  *               GAsyncResult *res,
3766  *               gpointer      user_data)
3767  * {
3768  *   gboolean success = FALSE;
3769  *
3770  *   success = _theoretical_frobnitz_finish (source_object, res, NULL);
3771  *
3772  *   if (success)
3773  *     g_printf ("Hurray!\n");
3774  *   else
3775  *     g_printf ("Uh oh!\n");
3776  *
3777  *   /<!-- -->* ... *<!-- -->/
3778  *
3779  * }
3780  *
3781  * int main (int argc, void *argv[])
3782  * {
3783  *    /<!-- -->* ... *<!-- -->/
3784  *
3785  *    _theoretical_frobnitz_async (theoretical_data,
3786  *                                 NULL,
3787  *                                 frobnitz_result_func,
3788  *                                 NULL);
3789  *
3790  *    /<!-- -->* ... *<!-- -->/
3791  * }
3792  * ]|
3793  *
3794  * The callback for an asynchronous operation is called only once, and is
3795  * always called, even in the case of a cancelled operation. On cancellation
3796  * the result is a %G_IO_ERROR_CANCELLED error.
3797  */
3798
3799
3800 /**
3801  * SECTION:gbufferedinputstream
3802  * @short_description: Buffered Input Stream
3803  * @include: gio/gio.h
3804  * @see_also: #GFilterInputStream, #GInputStream
3805  *
3806  * Buffered input stream implements #GFilterInputStream and provides
3807  * for buffered reads.
3808  *
3809  * By default, #GBufferedInputStream's buffer size is set at 4 kilobytes.
3810  *
3811  * To create a buffered input stream, use g_buffered_input_stream_new(),
3812  * or g_buffered_input_stream_new_sized() to specify the buffer's size at
3813  * construction.
3814  *
3815  * To get the size of a buffer within a buffered input stream, use
3816  * g_buffered_input_stream_get_buffer_size(). To change the size of a
3817  * buffered input stream's buffer, use
3818  * g_buffered_input_stream_set_buffer_size(). Note that the buffer's size
3819  * cannot be reduced below the size of the data within the buffer.
3820  */
3821
3822
3823 /**
3824  * SECTION:gbufferedoutputstream
3825  * @short_description: Buffered Output Stream
3826  * @include: gio/gio.h
3827  * @see_also: #GFilterOutputStream, #GOutputStream
3828  *
3829  * Buffered output stream implements #GFilterOutputStream and provides
3830  * for buffered writes.
3831  *
3832  * By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes.
3833  *
3834  * To create a buffered output stream, use g_buffered_output_stream_new(),
3835  * or g_buffered_output_stream_new_sized() to specify the buffer's size
3836  * at construction.
3837  *
3838  * To get the size of a buffer within a buffered input stream, use
3839  * g_buffered_output_stream_get_buffer_size(). To change the size of a
3840  * buffered output stream's buffer, use
3841  * g_buffered_output_stream_set_buffer_size(). Note that the buffer's
3842  * size cannot be reduced below the size of the data within the buffer.
3843  */
3844
3845
3846 /**
3847  * SECTION:gcancellable
3848  * @short_description: Thread-safe Operation Cancellation Stack
3849  * @include: gio/gio.h
3850  *
3851  * GCancellable is a thread-safe operation cancellation stack used
3852  * throughout GIO to allow for cancellation of synchronous and
3853  * asynchronous operations.
3854  */
3855
3856
3857 /**
3858  * SECTION:gcharsetconverter
3859  * @short_description: Convert between charsets
3860  * @include: gio/gio.h
3861  *
3862  * #GCharsetConverter is an implementation of #GConverter based on
3863  * GIConv.
3864  */
3865
3866
3867 /**
3868  * SECTION:gcontenttype
3869  * @short_description: Platform-specific content typing
3870  * @include: gio/gio.h
3871  *
3872  * A content type is a platform specific string that defines the type
3873  * 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".
3874  * On Win32 it is an extension string like ".doc", ".txt" or a perceived
3875  * string like "audio". Such strings can be looked up in the registry at
3876  * HKEY_CLASSES_ROOT.
3877  */
3878
3879
3880 /**
3881  * SECTION:gconverter
3882  * @short_description: Data conversion interface
3883  * @include: gio/gio.h
3884  * @see_also: #GInputStream, #GOutputStream
3885  *
3886  * #GConverter is implemented by objects that convert
3887  * binary data in various ways. The conversion can be
3888  * stateful and may fail at any place.
3889  *
3890  * Some example conversions are: character set conversion,
3891  * compression, decompression and regular expression
3892  * replace.
3893  *
3894  * Since: 2.24
3895  */
3896
3897
3898 /**
3899  * SECTION:gconverterinputstream
3900  * @short_description: Converter Input Stream
3901  * @include: gio/gio.h
3902  * @see_also: #GInputStream, #GConverter
3903  *
3904  * Converter input stream implements #GInputStream and allows
3905  * conversion of data of various types during reading.
3906  *
3907  * As of GLib 2.34, #GConverterInputStream implements
3908  * #GPollableInputStream.
3909  */
3910
3911
3912 /**
3913  * SECTION:gconverteroutputstream
3914  * @short_description: Converter Output Stream
3915  * @include: gio/gio.h
3916  * @see_also: #GOutputStream, #GConverter
3917  *
3918  * Converter output stream implements #GOutputStream and allows
3919  * conversion of data of various types during reading.
3920  *
3921  * As of GLib 2.34, #GConverterOutputStream implements
3922  * #GPollableOutputStream.
3923  */
3924
3925
3926 /**
3927  * SECTION:gcredentials
3928  * @short_description: An object containing credentials
3929  * @include: gio/gio.h
3930  *
3931  * The #GCredentials type is a reference-counted wrapper for native
3932  * credentials. This information is typically used for identifying,
3933  * authenticating and authorizing other processes.
3934  *
3935  * Some operating systems supports looking up the credentials of the
3936  * remote peer of a communication endpoint - see e.g.
3937  * g_socket_get_credentials().
3938  *
3939  * Some operating systems supports securely sending and receiving
3940  * credentials over a Unix Domain Socket, see
3941  * #GUnixCredentialsMessage, g_unix_connection_send_credentials() and
3942  * g_unix_connection_receive_credentials() for details.
3943  *
3944  * On Linux, the native credential type is a <type>struct ucred</type>
3945  * - see the
3946  * <citerefentry><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry>
3947  * man page for details. This corresponds to
3948  * %G_CREDENTIALS_TYPE_LINUX_UCRED.
3949  *
3950  * On FreeBSD, the native credential type is a <type>struct cmsgcred</type>.
3951  * This corresponds to %G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED.
3952  *
3953  * On OpenBSD, the native credential type is a <type>struct sockpeercred</type>.
3954  * This corresponds to %G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED.
3955  */
3956
3957
3958 /**
3959  * SECTION:gdatainputstream
3960  * @short_description: Data Input Stream
3961  * @include: gio/gio.h
3962  * @see_also: #GInputStream
3963  *
3964  * Data input stream implements #GInputStream and includes functions for
3965  * reading structured data directly from a binary input stream.
3966  */
3967
3968
3969 /**
3970  * SECTION:gdataoutputstream
3971  * @short_description: Data Output Stream
3972  * @include: gio/gio.h
3973  * @see_also: #GOutputStream
3974  *
3975  * Data output stream implements #GOutputStream and includes functions for
3976  * writing data directly to an output stream.
3977  */
3978
3979
3980 /**
3981  * SECTION:gdbusactiongroup
3982  * @title: GDBusActionGroup
3983  * @short_description: A D-Bus GActionGroup implementation
3984  * @see_also: <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
3985  *
3986  * #GDBusActionGroup is an implementation of the #GActionGroup
3987  * interface that can be used as a proxy for an action group
3988  * that is exported over D-Bus with g_dbus_connection_export_action_group().
3989  */
3990
3991
3992 /**
3993  * SECTION:gdbusaddress
3994  * @title: D-Bus Addresses
3995  * @short_description: D-Bus connection endpoints
3996  * @include: gio/gio.h
3997  *
3998  * Routines for working with D-Bus addresses. A D-Bus address is a string
3999  * like "unix:tmpdir=/tmp/my-app-name". The exact format of addresses
4000  * is explained in detail in the <link linkend="http://dbus.freedesktop.org/doc/dbus-specification.html&num;addresses">D-Bus specification</link>.
4001  */
4002
4003
4004 /**
4005  * SECTION:gdbusauthobserver
4006  * @short_description: Object used for authenticating connections
4007  * @include: gio/gio.h
4008  *
4009  * The #GDBusAuthObserver type provides a mechanism for participating
4010  * in how a #GDBusServer (or a #GDBusConnection) authenticates remote
4011  * peers. Simply instantiate a #GDBusAuthObserver and connect to the
4012  * signals you are interested in. Note that new signals may be added
4013  * in the future
4014  *
4015  * For example, if you only want to allow D-Bus connections from
4016  * processes owned by the same uid as the server, you would use a
4017  * signal handler like the following:
4018  * <example id="auth-observer"><title>Controlling Authentication</title><programlisting>
4019  * static gboolean
4020  * on_authorize_authenticated_peer (GDBusAuthObserver *observer,
4021  *                                  GIOStream         *stream,
4022  *                                  GCredentials      *credentials,
4023  *                                  gpointer           user_data)
4024  * {
4025  *   gboolean authorized;
4026  *
4027  *   authorized = FALSE;
4028  *   if (credentials != NULL)
4029  *     {
4030  *       GCredentials *own_credentials;
4031  *       own_credentials = g_credentials_new ();
4032  *       if (g_credentials_is_same_user (credentials, own_credentials, NULL))
4033  *         authorized = TRUE;
4034  *       g_object_unref (own_credentials);
4035  *     }
4036  *
4037  *   return authorized;
4038  * }
4039  * </programlisting></example>
4040  */
4041
4042
4043 /**
4044  * SECTION:gdbusconnection
4045  * @short_description: D-Bus Connections
4046  * @include: gio/gio.h
4047  *
4048  * The #GDBusConnection type is used for D-Bus connections to remote
4049  * peers such as a message buses. It is a low-level API that offers a
4050  * lot of flexibility. For instance, it lets you establish a connection
4051  * over any transport that can by represented as an #GIOStream.
4052  *
4053  * This class is rarely used directly in D-Bus clients. If you are writing
4054  * an D-Bus client, it is often easier to use the g_bus_own_name(),
4055  * g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs.
4056  *
4057  * As an exception to the usual GLib rule that a particular object must not be
4058  * used by two threads at the same time, #GDBusConnection's methods may be
4059  * called from any thread<footnote>
4060  * <para>
4061  *   This is so that g_bus_get() and g_bus_get_sync() can safely return the
4062  *   same #GDBusConnection when called from any thread.
4063  * </para>
4064  * </footnote>.
4065  *
4066  * Most of the ways to obtain a #GDBusConnection automatically initialize it
4067  * (i.e. connect to D-Bus): for instance, g_dbus_connection_new() and
4068  * g_bus_get(), and the synchronous versions of those methods, give you an
4069  * initialized connection. Language bindings for GIO should use
4070  * g_initable_new() or g_async_initable_new_async(), which also initialize the
4071  * connection.
4072  *
4073  * If you construct an uninitialized #GDBusConnection, such as via
4074  * g_object_new(), you must initialize it via g_initable_init() or
4075  * g_async_initable_init_async() before using its methods or properties.
4076  * Calling methods or accessing properties on a #GDBusConnection that has not
4077  * completed initialization successfully is considered to be invalid, and leads
4078  * to undefined behaviour. In particular, if initialization fails with a
4079  * #GError, the only valid thing you can do with that #GDBusConnection is to
4080  * free it with g_object_unref().
4081  *
4082  * <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>
4083  *
4084  * <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>
4085  *
4086  * <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>
4087  *
4088  * <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>
4089  */
4090
4091
4092 /**
4093  * SECTION:gdbuserror
4094  * @title: GDBusError
4095  * @short_description: Mapping D-Bus errors to and from GError
4096  * @include: gio/gio.h
4097  *
4098  * All facilities that return errors from remote methods (such as
4099  * g_dbus_connection_call_sync()) use #GError to represent both D-Bus
4100  * errors (e.g. errors returned from the other peer) and locally
4101  * in-process generated errors.
4102  *
4103  * To check if a returned #GError is an error from a remote peer, use
4104  * g_dbus_error_is_remote_error(). To get the actual D-Bus error name,
4105  * use g_dbus_error_get_remote_error(). Before presenting an error,
4106  * always use g_dbus_error_strip_remote_error().
4107  *
4108  * In addition, facilities used to return errors to a remote peer also
4109  * use #GError. See g_dbus_method_invocation_return_error() for
4110  * discussion about how the D-Bus error name is set.
4111  *
4112  * Applications can associate a #GError error domain with a set of D-Bus errors in order to
4113  * automatically map from D-Bus errors to #GError and back. This
4114  * is typically done in the function returning the #GQuark for the
4115  * error domain:
4116  * <example id="error-registration"><title>Error Registration</title><programlisting>
4117  * /<!-- -->* foo-bar-error.h: *<!-- -->/
4118  *
4119  * #define FOO_BAR_ERROR (foo_bar_error_quark ())
4120  * GQuark foo_bar_error_quark (void);
4121  *
4122  * typedef enum
4123  * {
4124  *   FOO_BAR_ERROR_FAILED,
4125  *   FOO_BAR_ERROR_ANOTHER_ERROR,
4126  *   FOO_BAR_ERROR_SOME_THIRD_ERROR,
4127  * } FooBarError;
4128  *
4129  * /<!-- -->* foo-bar-error.c: *<!-- -->/
4130  *
4131  * static const GDBusErrorEntry foo_bar_error_entries[] =
4132  * {
4133  *   {FOO_BAR_ERROR_FAILED,           "org.project.Foo.Bar.Error.Failed"},
4134  *   {FOO_BAR_ERROR_ANOTHER_ERROR,    "org.project.Foo.Bar.Error.AnotherError"},
4135  *   {FOO_BAR_ERROR_SOME_THIRD_ERROR, "org.project.Foo.Bar.Error.SomeThirdError"},
4136  * };
4137  *
4138  * GQuark
4139  * foo_bar_error_quark (void)
4140  * {
4141  *   static volatile gsize quark_volatile = 0;
4142  *   g_dbus_error_register_error_domain ("foo-bar-error-quark",
4143  *                                       &quark_volatile,
4144  *                                       foo_bar_error_entries,
4145  *                                       G_N_ELEMENTS (foo_bar_error_entries));
4146  *   G_STATIC_ASSERT (G_N_ELEMENTS (foo_bar_error_entries) - 1 == FOO_BAR_ERROR_SOME_THIRD_ERROR);
4147  *   return (GQuark) quark_volatile;
4148  * }
4149  * </programlisting></example>
4150  * With this setup, a D-Bus peer can transparently pass e.g. %FOO_BAR_ERROR_ANOTHER_ERROR and
4151  * other peers will see the D-Bus error name <literal>org.project.Foo.Bar.Error.AnotherError</literal>.
4152  * If the other peer is using GDBus, the peer will see also %FOO_BAR_ERROR_ANOTHER_ERROR instead
4153  * of %G_IO_ERROR_DBUS_ERROR. Note that GDBus clients can still recover
4154  * <literal>org.project.Foo.Bar.Error.AnotherError</literal> using g_dbus_error_get_remote_error().
4155  *
4156  * Note that errors in the %G_DBUS_ERROR error domain is intended only
4157  * for returning errors from a remote message bus process. Errors
4158  * generated locally in-process by e.g. #GDBusConnection is from the
4159  * %G_IO_ERROR domain.
4160  */
4161
4162
4163 /**
4164  * SECTION:gdbusinterface
4165  * @short_description: Base type for D-Bus interfaces
4166  * @include: gio/gio.h
4167  *
4168  * The #GDBusInterface type is the base type for D-Bus interfaces both
4169  * on the service side (see #GDBusInterfaceSkeleton) and client side
4170  * (see #GDBusProxy).
4171  */
4172
4173
4174 /**
4175  * SECTION:gdbusinterfaceskeleton
4176  * @short_description: Service-side D-Bus interface
4177  * @include: gio/gio.h
4178  *
4179  * Abstract base class for D-Bus interfaces on the service side.
4180  */
4181
4182
4183 /**
4184  * SECTION:gdbusintrospection
4185  * @title: D-Bus Introspection Data
4186  * @short_description: Node and interface description data structures
4187  * @include: gio/gio.h
4188  *
4189  * Various data structures and convenience routines to parse and
4190  * generate D-Bus introspection XML. Introspection information is
4191  * used when registering objects with g_dbus_connection_register_object().
4192  *
4193  * The format of D-Bus introspection XML is specified in the
4194  * <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format">D-Bus specification</ulink>.
4195  */
4196
4197
4198 /**
4199  * SECTION:gdbusmenumodel
4200  * @title: GDBusMenuModel
4201  * @short_description: A D-Bus GMenuModel implementation
4202  * @see_also: <link linkend="gio-GMenuModel-exporter">GMenuModel Exporter</link>
4203  *
4204  * #GDBusMenuModel is an implementation of #GMenuModel that can be used
4205  * as a proxy for a menu model that is exported over D-Bus with
4206  * g_dbus_connection_export_menu_model().
4207  */
4208
4209
4210 /**
4211  * SECTION:gdbusmessage
4212  * @short_description: D-Bus Message
4213  * @include: gio/gio.h
4214  *
4215  * A type for representing D-Bus messages that can be sent or received
4216  * on a #GDBusConnection.
4217  */
4218
4219
4220 /**
4221  * SECTION:gdbusmethodinvocation
4222  * @short_description: Object for handling remote calls
4223  * @include: gio/gio.h
4224  *
4225  * Instances of the #GDBusMethodInvocation class are used when
4226  * handling D-Bus method calls. It provides a way to asynchronously
4227  * return results and errors.
4228  *
4229  * The normal way to obtain a #GDBusMethodInvocation object is to receive
4230  * it as an argument to the handle_method_call() function in a
4231  * #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object().
4232  */
4233
4234
4235 /**
4236  * SECTION:gdbusnameowning
4237  * @title: Owning Bus Names
4238  * @short_description: Simple API for owning bus names
4239  * @include: gio/gio.h
4240  *
4241  * Convenience API for owning bus names.
4242  *
4243  * <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>
4244  */
4245
4246
4247 /**
4248  * SECTION:gdbusnamewatching
4249  * @title: Watching Bus Names
4250  * @short_description: Simple API for watching bus names
4251  * @include: gio/gio.h
4252  *
4253  * Convenience API for watching bus names.
4254  *
4255  * <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>
4256  */
4257
4258
4259 /**
4260  * SECTION:gdbusobject
4261  * @short_description: Base type for D-Bus objects
4262  * @include: gio/gio.h
4263  *
4264  * The #GDBusObject type is the base type for D-Bus objects on both
4265  * the service side (see #GDBusObjectSkeleton) and the client side
4266  * (see #GDBusObjectProxy). It is essentially just a container of
4267  * interfaces.
4268  */
4269
4270
4271 /**
4272  * SECTION:gdbusobjectmanager
4273  * @short_description: Base type for D-Bus object managers
4274  * @include: gio/gio.h
4275  *
4276  * The #GDBusObjectManager type is the base type for service- and
4277  * client-side implementations of the standardized <ulink
4278  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4279  * interface.
4280  *
4281  * See #GDBusObjectManagerClient for the client-side implementation
4282  * and #GDBusObjectManagerServer for the service-side implementation.
4283  */
4284
4285
4286 /**
4287  * SECTION:gdbusobjectmanagerclient
4288  * @short_description: Client-side object manager
4289  * @include: gio/gio.h
4290  *
4291  * #GDBusObjectManagerClient is used to create, monitor and delete object
4292  * proxies for remote objects exported by a #GDBusObjectManagerServer (or any
4293  * code implementing the <ulink
4294  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4295  * interface).
4296  *
4297  * Once an instance of this type has been created, you can connect to
4298  * the #GDBusObjectManager::object-added and
4299  * #GDBusObjectManager::object-removed signals and inspect the
4300  * #GDBusObjectProxy objects returned by
4301  * g_dbus_object_manager_get_objects().
4302  *
4303  * If the name for a #GDBusObjectManagerClient is not owned by anyone at
4304  * object construction time, the default behavior is to request the
4305  * message bus to launch an owner for the name. This behavior can be
4306  * disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
4307  * flag. It's also worth noting that this only works if the name of
4308  * interest is activatable in the first place. E.g. in some cases it
4309  * is not possible to launch an owner for the requested name. In this
4310  * case, #GDBusObjectManagerClient object construction still succeeds but
4311  * there will be no object proxies
4312  * (e.g. g_dbus_object_manager_get_objects() returns the empty list) and
4313  * the #GDBusObjectManagerClient:name-owner property is %NULL.
4314  *
4315  * The owner of the requested name can come and go (for example
4316  * consider a system service being restarted) â€“ #GDBusObjectManagerClient
4317  * handles this case too; simply connect to the #GObject::notify
4318  * signal to watch for changes on the #GDBusObjectManagerClient:name-owner
4319  * property. When the name owner vanishes, the behavior is that
4320  * #GDBusObjectManagerClient:name-owner is set to %NULL (this includes
4321  * emission of the #GObject::notify signal) and then
4322  * #GDBusObjectManager::object-removed signals are synthesized
4323  * for all currently existing object proxies. Since
4324  * #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can
4325  * use this information to disambiguate a synthesized signal from a
4326  * genuine signal caused by object removal on the remote
4327  * #GDBusObjectManager. Similarly, when a new name owner appears,
4328  * #GDBusObjectManager::object-added signals are synthesized
4329  * while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all
4330  * object proxies have been added, the #GDBusObjectManagerClient:name-owner
4331  * is set to the new name owner (this includes emission of the
4332  * #GObject::notify signal).  Furthermore, you are guaranteed that
4333  * #GDBusObjectManagerClient:name-owner will alternate between a name owner
4334  * (e.g. <literal>:1.42</literal>) and %NULL even in the case where
4335  * the name of interest is atomically replaced
4336  *
4337  * Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy
4338  * instances. All signals (including the
4339  * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
4340  * signal) delivered to #GDBusProxy instances are guaranteed to
4341  * originate from the name owner. This guarantee along with the
4342  * behavior described above, means that certain race conditions
4343  * including the <emphasis><quote>half the proxy is from the old owner
4344  * and the other half is from the new owner</quote></emphasis> problem
4345  * cannot happen.
4346  *
4347  * To avoid having the application connect to signals on the returned
4348  * #GDBusObjectProxy and #GDBusProxy objects, the
4349  * #GDBusObject::interface-added,
4350  * #GDBusObject::interface-removed,
4351  * #GDBusProxy::g-properties-changed and
4352  * #GDBusProxy::g-signal signals
4353  * are also emitted on the #GDBusObjectManagerClient instance managing these
4354  * objects. The signals emitted are
4355  * #GDBusObjectManager::interface-added,
4356  * #GDBusObjectManager::interface-removed,
4357  * #GDBusObjectManagerClient::interface-proxy-properties-changed and
4358  * #GDBusObjectManagerClient::interface-proxy-signal.
4359  *
4360  * Note that all callbacks and signals are emitted in the
4361  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4362  * that the #GDBusObjectManagerClient object was constructed
4363  * in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects
4364  * originating from the #GDBusObjectManagerClient object will be created in
4365  * the same context and, consequently, will deliver signals in the
4366  * same main loop.
4367  */
4368
4369
4370 /**
4371  * SECTION:gdbusobjectmanagerserver
4372  * @short_description: Service-side object manager
4373  * @include: gio/gio.h
4374  *
4375  * #GDBusObjectManagerServer is used to export #GDBusObject instances using
4376  * the standardized <ulink
4377  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
4378  * interface. For example, remote D-Bus clients can get all objects
4379  * and properties in a single call. Additionally, any change in the
4380  * object hierarchy is broadcast using signals. This means that D-Bus
4381  * clients can keep caches up to date by only listening to D-Bus
4382  * signals.
4383  *
4384  * See #GDBusObjectManagerClient for the client-side code that is
4385  * intended to be used with #GDBusObjectManagerServer or any D-Bus
4386  * object implementing the org.freedesktop.DBus.ObjectManager
4387  * interface.
4388  */
4389
4390
4391 /**
4392  * SECTION:gdbusobjectproxy
4393  * @short_description: Client-side D-Bus object
4394  * @include: gio/gio.h
4395  *
4396  * A #GDBusObjectProxy is an object used to represent a remote object
4397  * with one or more D-Bus interfaces. Normally, you don't instantiate
4398  * a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient
4399  * is used to obtain it.
4400  *
4401  * Since: 2.30
4402  */
4403
4404
4405 /**
4406  * SECTION:gdbusobjectskeleton
4407  * @short_description: Service-side D-Bus object
4408  * @include: gio/gio.h
4409  *
4410  * A #GDBusObjectSkeleton instance is essentially a group of D-Bus
4411  * interfaces. The set of exported interfaces on the object may be
4412  * dynamic and change at runtime.
4413  *
4414  * This type is intended to be used with #GDBusObjectManager.
4415  */
4416
4417
4418 /**
4419  * SECTION:gdbusproxy
4420  * @short_description: Client-side D-Bus interface proxy
4421  * @include: gio/gio.h
4422  *
4423  * #GDBusProxy is a base class used for proxies to access a D-Bus
4424  * interface on a remote object. A #GDBusProxy can be constructed for
4425  * both well-known and unique names.
4426  *
4427  * By default, #GDBusProxy will cache all properties (and listen to
4428  * changes) of the remote object, and proxy all signals that gets
4429  * emitted. This behaviour can be changed by passing suitable
4430  * #GDBusProxyFlags when the proxy is created. If the proxy is for a
4431  * well-known name, the property cache is flushed when the name owner
4432  * vanishes and reloaded when a name owner appears.
4433  *
4434  * If a #GDBusProxy is used for a well-known name, the owner of the
4435  * name is tracked and can be read from
4436  * #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to
4437  * get notified of changes. Additionally, only signals and property
4438  * changes emitted from the current name owner are considered and
4439  * calls are always sent to the current name owner. This avoids a
4440  * number of race conditions when the name is lost by one owner and
4441  * claimed by another. However, if no name owner currently exists,
4442  * then calls will be sent to the well-known name which may result in
4443  * the message bus launching an owner (unless
4444  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set).
4445  *
4446  * The generic #GDBusProxy::g-properties-changed and
4447  * #GDBusProxy::g-signal signals are not very convenient to work
4448  * with. Therefore, the recommended way of working with proxies is to
4449  * subclass #GDBusProxy, and have more natural properties and signals
4450  * in your derived class. See <xref linkend="gdbus-example-gdbus-codegen"/>
4451  * for how this can easily be done using the
4452  * <command><link linkend="gdbus-codegen">gdbus-codegen</link></command>
4453  * tool.
4454  *
4455  * A #GDBusProxy instance can be used from multiple threads but note
4456  * that all signals (e.g. #GDBusProxy::g-signal, #GDBusProxy::g-properties-changed
4457  * and #GObject::notify) are emitted in the
4458  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4459  * of the thread where the instance was constructed.
4460  *
4461  * <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>
4462  */
4463
4464
4465 /**
4466  * SECTION:gdbusserver
4467  * @short_description: Helper for accepting connections
4468  * @include: gio/gio.h
4469  *
4470  * #GDBusServer is a helper for listening to and accepting D-Bus
4471  * connections. This can be used to create a new D-Bus server, allowing two
4472  * peers to use the D-Bus protocol for their own specialized communication.
4473  * A server instance provided in this way will not perform message routing or
4474  * implement the org.freedesktop.DBus interface.
4475  *
4476  * To just export an object on a well-known name on a message bus, such as the
4477  * session or system bus, you should instead use g_bus_own_name().
4478  *
4479  * <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>
4480  */
4481
4482
4483 /**
4484  * SECTION:gdbusutils
4485  * @title: D-Bus Utilities
4486  * @short_description: Various utilities related to D-Bus.
4487  * @include: gio/gio.h
4488  *
4489  * Various utility routines related to D-Bus.
4490  */
4491
4492
4493 /**
4494  * SECTION:gdesktopappinfo
4495  * @title: GDesktopAppInfo
4496  * @short_description: Application information from desktop files
4497  * @include: gio/gdesktopappinfo.h
4498  *
4499  * #GDesktopAppInfo is an implementation of #GAppInfo based on
4500  * desktop files.
4501  *
4502  * Note that <filename>&lt;gio/gdesktopappinfo.h&gt;</filename> belongs to
4503  * the UNIX-specific GIO interfaces, thus you have to use the
4504  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4505  */
4506
4507
4508 /**
4509  * SECTION:gdrive
4510  * @short_description: Drive management
4511  * @include: gio/gio.h
4512  *
4513  * #GDrive - this represent a piece of hardware connected to the machine.
4514  * It's generally only created for removable hardware or hardware with
4515  * removable media.
4516  *
4517  * #GDrive is a container class for #GVolume objects that stem from
4518  * the same piece of media. As such, #GDrive abstracts a drive with
4519  * (or without) removable media and provides operations for querying
4520  * whether media is available, determing whether media change is
4521  * automatically detected and ejecting the media.
4522  *
4523  * If the #GDrive reports that media isn't automatically detected, one
4524  * can poll for media; typically one should not do this periodically
4525  * as a poll for media operation is potententially expensive and may
4526  * spin up the drive creating noise.
4527  *
4528  * #GDrive supports starting and stopping drives with authentication
4529  * support for the former. This can be used to support a diverse set
4530  * of use cases including connecting/disconnecting iSCSI devices,
4531  * powering down external disk enclosures and starting/stopping
4532  * multi-disk devices such as RAID devices. Note that the actual
4533  * semantics and side-effects of starting/stopping a #GDrive may vary
4534  * according to implementation. To choose the correct verbs in e.g. a
4535  * file manager, use g_drive_get_start_stop_type().
4536  *
4537  * For porting from GnomeVFS note that there is no equivalent of
4538  * #GDrive in that API.
4539  */
4540
4541
4542 /**
4543  * SECTION:gemblem
4544  * @short_description: An object for emblems
4545  * @include: gio/gio.h
4546  * @see_also: #GIcon, #GEmblemedIcon, #GLoadableIcon, #GThemedIcon
4547  *
4548  * #GEmblem is an implementation of #GIcon that supports
4549  * having an emblem, which is an icon with additional properties.
4550  * It can than be added to a #GEmblemedIcon.
4551  *
4552  * Currently, only metainformation about the emblem's origin is
4553  * supported. More may be added in the future.
4554  */
4555
4556
4557 /**
4558  * SECTION:gemblemedicon
4559  * @short_description: Icon with emblems
4560  * @include: gio/gio.h
4561  * @see_also: #GIcon, #GLoadableIcon, #GThemedIcon, #GEmblem
4562  *
4563  * #GEmblemedIcon is an implementation of #GIcon that supports
4564  * adding an emblem to an icon. Adding multiple emblems to an
4565  * icon is ensured via g_emblemed_icon_add_emblem().
4566  *
4567  * Note that #GEmblemedIcon allows no control over the position
4568  * of the emblems. See also #GEmblem for more information.
4569  */
4570
4571
4572 /**
4573  * SECTION:gfile
4574  * @short_description: File and Directory Handling
4575  * @include: gio/gio.h
4576  * @see_also: #GFileInfo, #GFileEnumerator
4577  *
4578  * #GFile is a high level abstraction for manipulating files on a
4579  * virtual file system. #GFile<!-- -->s are lightweight, immutable
4580  * objects that do no I/O upon creation. It is necessary to understand that
4581  * #GFile objects do not represent files, merely an identifier for a file. All
4582  * file content I/O is implemented as streaming operations (see #GInputStream and
4583  * #GOutputStream).
4584  *
4585  * To construct a #GFile, you can use:
4586  * g_file_new_for_path() if you have a path.
4587  * g_file_new_for_uri() if you have a URI.
4588  * g_file_new_for_commandline_arg() for a command line argument.
4589  * g_file_new_tmp() to create a temporary file from a template.
4590  * g_file_parse_name() from a utf8 string gotten from g_file_get_parse_name().
4591  *
4592  * One way to think of a #GFile is as an abstraction of a pathname. For normal
4593  * files the system pathname is what is stored internally, but as #GFile<!-- -->s
4594  * are extensible it could also be something else that corresponds to a pathname
4595  * in a userspace implementation of a filesystem.
4596  *
4597  * #GFile<!-- -->s make up hierarchies of directories and files that correspond to the
4598  * files on a filesystem. You can move through the file system with #GFile using
4599  * g_file_get_parent() to get an identifier for the parent directory, g_file_get_child()
4600  * to get a child within a directory, g_file_resolve_relative_path() to resolve a relative
4601  * path between two #GFile<!-- -->s. There can be multiple hierarchies, so you may not
4602  * end up at the same root if you repeatedly call g_file_get_parent() on two different
4603  * files.
4604  *
4605  * All #GFile<!-- -->s have a basename (get with g_file_get_basename()). These names
4606  * are byte strings that are used to identify the file on the filesystem (relative to
4607  * its parent directory) and there is no guarantees that they have any particular charset
4608  * encoding or even make any sense at all. If you want to use filenames in a user
4609  * interface you should use the display name that you can get by requesting the
4610  * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info().
4611  * This is guaranteed to be in utf8 and can be used in a user interface. But always
4612  * store the real basename or the #GFile to use to actually access the file, because
4613  * there is no way to go from a display name to the actual name.
4614  *
4615  * Using #GFile as an identifier has the same weaknesses as using a path in that
4616  * there may be multiple aliases for the same file. For instance, hard or
4617  * soft links may cause two different #GFile<!-- -->s to refer to the same file.
4618  * Other possible causes for aliases are: case insensitive filesystems, short
4619  * and long names on Fat/NTFS, or bind mounts in Linux. If you want to check if
4620  * two #GFile<!-- -->s point to the same file you can query for the
4621  * %G_FILE_ATTRIBUTE_ID_FILE attribute. Note that #GFile does some trivial
4622  * canonicalization of pathnames passed in, so that trivial differences in the
4623  * path string used at creation (duplicated slashes, slash at end of path, "."
4624  * or ".." path segments, etc) does not create different #GFile<!-- -->s.
4625  *
4626  * Many #GFile operations have both synchronous and asynchronous versions
4627  * to suit your application. Asynchronous versions of synchronous functions
4628  * simply have _async() appended to their function names. The asynchronous
4629  * I/O functions call a #GAsyncReadyCallback which is then used to finalize
4630  * the operation, producing a GAsyncResult which is then passed to the
4631  * function's matching _finish() operation.
4632  *
4633  * Some #GFile operations do not have synchronous analogs, as they may
4634  * take a very long time to finish, and blocking may leave an application
4635  * unusable. Notable cases include:
4636  * g_file_mount_mountable() to mount a mountable file.
4637  * g_file_unmount_mountable_with_operation() to unmount a mountable file.
4638  * g_file_eject_mountable_with_operation() to eject a mountable file.
4639  *
4640  * <para id="gfile-etag"><indexterm><primary>entity tag</primary></indexterm>
4641  * One notable feature of #GFile<!-- -->s are entity tags, or "etags" for
4642  * short. Entity tags are somewhat like a more abstract version of the
4643  * traditional mtime, and can be used to quickly determine if the file has
4644  * been modified from the version on the file system. See the HTTP 1.1
4645  * <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">specification</ulink>
4646  * for HTTP Etag headers, which are a very similar concept.
4647  * </para>
4648  */
4649
4650
4651 /**
4652  * SECTION:gfileattribute
4653  * @short_description: Key-Value Paired File Attributes
4654  * @include: gio/gio.h
4655  * @see_also: #GFile, #GFileInfo
4656  *
4657  * File attributes in GIO consist of a list of key-value pairs.
4658  *
4659  * Keys are strings that contain a key namespace and a key name, separated
4660  * by a colon, e.g. "namespace:keyname". Namespaces are included to sort
4661  * key-value pairs by namespaces for relevance. Keys can be retrived
4662  * using wildcards, e.g. "standard::*" will return all of the keys in the
4663  * "standard" namespace.
4664  *
4665  * The list of possible attributes for a filesystem (pointed to by a #GFile) is
4666  * available as a #GFileAttributeInfoList. This list is queryable by key names
4667  * as indicated earlier.
4668  *
4669  * Information is stored within the list in #GFileAttributeInfo structures.
4670  * The info structure can store different types, listed in the enum
4671  * #GFileAttributeType. Upon creation of a #GFileAttributeInfo, the type will
4672  * be set to %G_FILE_ATTRIBUTE_TYPE_INVALID.
4673  *
4674  * Classes that implement #GFileIface will create a #GFileAttributeInfoList and
4675  * install default keys and values for their given file system, architecture,
4676  * and other possible implementation details (e.g., on a UNIX system, a file
4677  * attribute key will be registered for the user id for a given file).
4678  *
4679  * <para>
4680  * <table>
4681  * <title>GFileAttributes Default Namespaces</title>
4682  * <tgroup cols='2' align='left'><thead>
4683  * <row><entry>Namspace</entry><entry>Description</entry></row>
4684  * </thead>
4685  * <tbody>
4686  * <row><entry>"standard"</entry><entry>The "Standard" namespace. General file
4687  * information that any application may need should be put in this namespace.
4688  * Examples include the file's name, type, and size.</entry></row>
4689  * <row><entry>"etag"</entry><entry>The <link linkend="gfile-etag">"Entity Tag"</link>
4690  * namespace. Currently, the only key in this namespace is "value", which contains
4691  * the value of the current entity tag.</entry></row>
4692  * <row><entry>"id"</entry><entry>The "Identification" namespace. This
4693  * namespace is used by file managers and applications that list directories
4694  * to check for loops and to uniquely identify files.</entry></row>
4695  * <row><entry>"access"</entry><entry>The "Access" namespace. Used to check
4696  * if a user has the proper privilidges to access files and perform
4697  * file operations. Keys in this namespace are made to be generic
4698  * and easily understood, e.g. the "can_read" key is %TRUE if
4699  * the current user has permission to read the file. UNIX permissions and
4700  * NTFS ACLs in Windows should be mapped to these values.</entry></row>
4701  * <row><entry>"mountable"</entry><entry>The "Mountable" namespace. Includes
4702  * simple boolean keys for checking if a file or path supports mount operations, e.g.
4703  * mount, unmount, eject. These are used for files of type %G_FILE_TYPE_MOUNTABLE.</entry></row>
4704  * <row><entry>"time"</entry><entry>The "Time" namespace. Includes file
4705  * access, changed, created times. </entry></row>
4706  * <row><entry>"unix"</entry><entry>The "Unix" namespace. Includes UNIX-specific
4707  * information and may not be available for all files. Examples include
4708  * the UNIX "UID", "GID", etc.</entry></row>
4709  * <row><entry>"dos"</entry><entry>The "DOS" namespace. Includes DOS-specific
4710  * information and may not be available for all files. Examples include
4711  * "is_system" for checking if a file is marked as a system file, and "is_archive"
4712  * for checking if a file is marked as an archive file.</entry></row>
4713  * <row><entry>"owner"</entry><entry>The "Owner" namespace. Includes information
4714  * about who owns a file. May not be available for all file systems. Examples include
4715  * "user" for getting the user name of the file owner. This information is often mapped from
4716  * some backend specific data such as a unix UID.</entry></row>
4717  * <row><entry>"thumbnail"</entry><entry>The "Thumbnail" namespace. Includes
4718  * information about file thumbnails and their location within the file system. Examples of
4719  * keys in this namespace include "path" to get the location of a thumbnail, and "failed"
4720  * to check if thumbnailing of the file failed.</entry></row>
4721  * <row><entry>"filesystem"</entry><entry>The "Filesystem" namespace. Gets information
4722  * about the file system where a file is located, such as its type, how much
4723  * space is left available, and the overall size of the file system.</entry></row>
4724  * <row><entry>"gvfs"</entry><entry>The "GVFS" namespace. Keys in this namespace
4725  * contain information about the current GVFS backend in use. </entry></row>
4726  * <row><entry>"xattr"</entry><entry>The "xattr" namespace. Gets information
4727  * about extended user attributes. See attr(5). The "user." prefix of the
4728  * extended user attribute name is stripped away when constructing keys in
4729  * this namespace, e.g. "xattr::mime_type" for the extended attribute with
4730  * the name "user.mime_type". Note that this information is only available
4731  * if GLib has been built with extended attribute support.</entry></row>
4732  * <row><entry>"xattr-sys"</entry><entry>The "xattr-sys" namespace.
4733  * Gets information about extended attributes which are not user-specific.
4734  * See attr(5). Note that this information is only available if GLib
4735  * has been built with extended attribute support.</entry></row>
4736  * <row><entry>"selinux"</entry><entry>The "SELinux" namespace. Includes
4737  * information about the SELinux context of files. Note that this information
4738  * is only available if GLib has been built with SELinux support.</entry></row>
4739  * </tbody>
4740  * </tgroup>
4741  * </table>
4742  * </para>
4743  *
4744  * Please note that these are not all of the possible namespaces.
4745  * More namespaces can be added from GIO modules or by individual applications.
4746  * For more information about writing GIO modules, see #GIOModule.
4747  *
4748  * <!-- TODO: Implementation note about using extended attributes on supported
4749  * file systems -->
4750  *
4751  * <para><table>
4752  * <title>GFileAttributes Built-in Keys and Value Types</title>
4753  * <tgroup cols='3' align='left'><thead>
4754  * <row><entry>Enum Value</entry><entry>Namespace:Key</entry><entry>Value Type</entry></row>
4755  * </thead><tbody>
4756  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TYPE</entry><entry>standard::type</entry><entry>uint32 (#GFileType)</entry></row>
4757  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN</entry><entry>standard::is-hidden</entry><entry>boolean</entry></row>
4758  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP</entry><entry>standard::is-backup</entry><entry>boolean</entry></row>
4759  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK</entry><entry>standard::is-symlink</entry><entry>boolean</entry></row>
4760  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL</entry><entry>standard::is-virtual</entry><entry>boolean</entry></row>
4761  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_NAME</entry><entry>standard::name</entry><entry>byte string</entry></row>
4762  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME</entry><entry>standard::display-name</entry><entry>string</entry></row>
4763  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME</entry><entry>standard::edit-name</entry><entry>string</entry></row>
4764  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ICON</entry><entry>standard::icon</entry><entry>object (#GIcon)</entry></row>
4765  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE</entry><entry>standard::content-type</entry><entry>string</entry></row>
4766  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE</entry><entry>standard::fast-content-type</entry><entry>string</entry></row>
4767  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SIZE</entry><entry>standard::size</entry><entry>uint64</entry></row>
4768  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE</entry><entry>standard::allocated-size</entry><entry>uint64</entry></row>
4769  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET</entry><entry>standard::symlink-target</entry><entry>byte string</entry></row>
4770  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_TARGET_URI</entry><entry>standard::target-uri</entry><entry>string</entry></row>
4771  * <row><entry>%G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER</entry><entry>standard::sort-order</entry><entry>int32</entry></row>
4772  * <row><entry>%G_FILE_ATTRIBUTE_ETAG_VALUE</entry><entry>etag::value</entry><entry>string</entry></row>
4773  * <row><entry>%G_FILE_ATTRIBUTE_ID_FILE</entry><entry>id::file</entry><entry>string</entry></row>
4774  * <row><entry>%G_FILE_ATTRIBUTE_ID_FILESYSTEM</entry><entry>id::filesystem</entry><entry>string</entry></row>
4775  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_READ</entry><entry>access::can-read</entry><entry>boolean</entry></row>
4776  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE</entry><entry>access::can-write</entry><entry>boolean</entry></row>
4777  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE</entry><entry>access::can-execute</entry><entry>boolean</entry></row>
4778  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE</entry><entry>access::can-delete</entry><entry>boolean</entry></row>
4779  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH</entry><entry>access::can-trash</entry><entry>boolean</entry></row>
4780  * <row><entry>%G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME</entry><entry>access::can-rename</entry><entry>boolean</entry></row>
4781  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT</entry><entry>mountable::can-mount</entry><entry>boolean</entry></row>
4782  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT</entry><entry>mountable::can-unmount</entry><entry>boolean</entry></row>
4783  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT</entry><entry>mountable::can-eject</entry><entry>boolean</entry></row>
4784  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE</entry><entry>mountable::unix-device</entry><entry>uint32</entry></row>
4785  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE</entry><entry>mountable::unix-device-file</entry><entry>string</entry></row>
4786  * <row><entry>%G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI</entry><entry>mountable::hal-udi</entry><entry>string</entry></row>
4787  * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED</entry><entry>time::modified</entry><entry>uint64</entry></row>
4788  * <row><entry>%G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC</entry><entry>time::modified-usec</entry><entry>uint32</entry></row>
4789  * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS</entry><entry>time::access</entry><entry>uint64</entry></row>
4790  * <row><entry>%G_FILE_ATTRIBUTE_TIME_ACCESS_USEC</entry><entry>time::access-usec</entry><entry>uint32</entry></row>
4791  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED</entry><entry>time::changed</entry><entry>uint64</entry></row>
4792  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CHANGED_USEC</entry><entry>time::changed-usec</entry><entry>uint32</entry></row>
4793  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED</entry><entry>time::created</entry><entry>uint64</entry></row>
4794  * <row><entry>%G_FILE_ATTRIBUTE_TIME_CREATED_USEC</entry><entry>time::created-usec</entry><entry>uint32</entry></row>
4795  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_DEVICE</entry><entry>unix::device</entry><entry>uint32</entry></row>
4796  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_INODE</entry><entry>unix::inode</entry><entry>uint64</entry></row>
4797  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_MODE</entry><entry>unix::mode</entry><entry>uint32</entry></row>
4798  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_NLINK</entry><entry>unix::nlink</entry><entry>uint32</entry></row>
4799  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_UID</entry><entry>unix::uid</entry><entry>uint32</entry></row>
4800  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_GID</entry><entry>unix::gid</entry><entry>uint32</entry></row>
4801  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_RDEV</entry><entry>unix::rdev</entry><entry>uint32</entry></row>
4802  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE</entry><entry>unix::block-size</entry><entry>uint32</entry></row>
4803  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_BLOCKS</entry><entry>unix::blocks</entry><entry>uint64</entry></row>
4804  * <row><entry>%G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT</entry><entry>unix::is-mountpoint</entry><entry>boolean</entry></row>
4805  * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE</entry><entry>dos::is-archive</entry><entry>boolean</entry></row>
4806  * <row><entry>%G_FILE_ATTRIBUTE_DOS_IS_SYSTEM</entry><entry>dos::is-system</entry><entry>boolean</entry></row>
4807  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER</entry><entry>owner::user</entry><entry>string</entry></row>
4808  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_USER_REAL</entry><entry>owner::user-real</entry><entry>string</entry></row>
4809  * <row><entry>%G_FILE_ATTRIBUTE_OWNER_GROUP</entry><entry>owner::group</entry><entry>string</entry></row>
4810  * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAIL_PATH</entry><entry>thumbnail::path</entry><entry>bytestring</entry></row>
4811  * <row><entry>%G_FILE_ATTRIBUTE_THUMBNAILING_FAILED</entry><entry>thumbnail::failed</entry><entry>boolean</entry></row>
4812  * <row><entry>%G_FILE_ATTRIBUTE_PREVIEW_ICON</entry><entry>preview::icon</entry><entry>object (#GIcon)</entry></row>
4813  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_SIZE</entry><entry>filesystem::size</entry><entry>uint64</entry></row>
4814  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_FREE</entry><entry>filesystem::free</entry><entry>uint64</entry></row>
4815  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_USED</entry><entry>filesystem::used</entry><entry>uint64</entry></row>
4816  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_TYPE</entry><entry>filesystem::type</entry><entry>string</entry></row>
4817  * <row><entry>%G_FILE_ATTRIBUTE_FILESYSTEM_READONLY</entry><entry>filesystem::readonly</entry><entry>boolean</entry></row>
4818  * <row><entry>%G_FILE_ATTRIBUTE_GVFS_BACKEND</entry><entry>gvfs::backend</entry><entry>string</entry></row>
4819  * <row><entry>%G_FILE_ATTRIBUTE_SELINUX_CONTEXT</entry><entry>selinux::context</entry><entry>string</entry></row>
4820  * </tbody></tgroup></table></para>
4821  *
4822  * Note that there are no predefined keys in the "xattr" and "xattr-sys"
4823  * namespaces. Keys for the "xattr" namespace are constructed by stripping
4824  * away the "user." prefix from the extended user attribute, and prepending
4825  * "xattr::". Keys for the "xattr-sys" namespace are constructed by
4826  * concatenating "xattr-sys::" with the extended attribute name. All extended
4827  * attribute values are returned as hex-encoded strings in which bytes outside
4828  * the ASCII range are encoded as hexadecimal escape sequences of the form
4829  * \x<replaceable>nn</replaceable>.
4830  */
4831
4832
4833 /**
4834  * SECTION:gfiledescriptorbased
4835  * @short_description: Interface for file descriptor based IO
4836  * @include: gio/gfiledescriptorbased.h
4837  * @see_also: #GInputStream, #GOutputStream
4838  *
4839  * #GFileDescriptorBased is implemented by streams (implementations of
4840  * #GInputStream or #GOutputStream) that are based on file descriptors.
4841  *
4842  * Note that <filename>&lt;gio/gfiledescriptorbased.h&gt;</filename> belongs to
4843  * the UNIX-specific GIO interfaces, thus you have to use the
4844  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
4845  *
4846  * Since: 2.24
4847  */
4848
4849
4850 /**
4851  * SECTION:gfileenumerator
4852  * @short_description: Enumerated Files Routines
4853  * @include: gio/gio.h
4854  *
4855  * #GFileEnumerator allows you to operate on a set of #GFile<!-- -->s,
4856  * returning a #GFileInfo structure for each file enumerated (e.g.
4857  * g_file_enumerate_children() will return a #GFileEnumerator for each
4858  * of the children within a directory).
4859  *
4860  * To get the next file's information from a #GFileEnumerator, use
4861  * g_file_enumerator_next_file() or its asynchronous version,
4862  * g_file_enumerator_next_files_async(). Note that the asynchronous
4863  * version will return a list of #GFileInfo<!---->s, whereas the
4864  * synchronous will only return the next file in the enumerator.
4865  *
4866  * To close a #GFileEnumerator, use g_file_enumerator_close(), or
4867  * its asynchronous version, g_file_enumerator_close_async(). Once
4868  * a #GFileEnumerator is closed, no further actions may be performed
4869  * on it, and it should be freed with g_object_unref().
4870  */
4871
4872
4873 /**
4874  * SECTION:gfileicon
4875  * @short_description: Icons pointing to an image file
4876  * @include: gio/gio.h
4877  * @see_also: #GIcon, #GLoadableIcon
4878  *
4879  * #GFileIcon specifies an icon by pointing to an image file
4880  * to be used as icon.
4881  */
4882
4883
4884 /**
4885  * SECTION:gfileinfo
4886  * @short_description: File Information and Attributes
4887  * @include: gio/gio.h
4888  * @see_also: #GFile, <link linkend="gio-GFileAttribute">GFileAttribute</link>
4889  *
4890  * Functionality for manipulating basic metadata for files. #GFileInfo
4891  * implements methods for getting information that all files should
4892  * contain, and allows for manipulation of extended attributes.
4893  *
4894  * See <link linkend="gio-GFileAttribute">GFileAttribute</link> for more
4895  * information on how GIO handles file attributes.
4896  *
4897  * To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
4898  * async variant). To obtain a #GFileInfo for a file input or output
4899  * stream, use g_file_input_stream_query_info() or
4900  * g_file_output_stream_query_info() (or their async variants).
4901  *
4902  * To change the actual attributes of a file, you should then set the
4903  * attribute in the #GFileInfo and call g_file_set_attributes_from_info()
4904  * or g_file_set_attributes_async() on a GFile.
4905  *
4906  * However, not all attributes can be changed in the file. For instance,
4907  * the actual size of a file cannot be changed via g_file_info_set_size().
4908  * You may call g_file_query_settable_attributes() and
4909  * g_file_query_writable_namespaces() to discover the settable attributes
4910  * of a particular file at runtime.
4911  *
4912  * #GFileAttributeMatcher allows for searching through a #GFileInfo for
4913  * attributes.
4914  */
4915
4916
4917 /**
4918  * SECTION:gfileinputstream
4919  * @short_description: File input streaming operations
4920  * @include: gio/gio.h
4921  * @see_also: #GInputStream, #GDataInputStream, #GSeekable
4922  *
4923  * GFileInputStream provides input streams that take their
4924  * content from a file.
4925  *
4926  * GFileInputStream implements #GSeekable, which allows the input
4927  * stream to jump to arbitrary positions in the file, provided the
4928  * filesystem of the file allows it. To find the position of a file
4929  * input stream, use g_seekable_tell(). To find out if a file input
4930  * stream supports seeking, use g_seekable_can_seek().
4931  * To position a file input stream, use g_seekable_seek().
4932  */
4933
4934
4935 /**
4936  * SECTION:gfileiostream
4937  * @short_description: File read and write streaming operations
4938  * @include: gio/gio.h
4939  * @see_also: #GIOStream, #GFileInputStream, #GFileOutputStream, #GSeekable
4940  *
4941  * GFileIOStream provides io streams that both read and write to the same
4942  * file handle.
4943  *
4944  * GFileIOStream implements #GSeekable, which allows the io
4945  * stream to jump to arbitrary positions in the file and to truncate
4946  * the file, provided the filesystem of the file supports these
4947  * operations.
4948  *
4949  * To find the position of a file io stream, use
4950  * g_seekable_tell().
4951  *
4952  * To find out if a file io stream supports seeking, use g_seekable_can_seek().
4953  * To position a file io stream, use g_seekable_seek().
4954  * To find out if a file io stream supports truncating, use
4955  * g_seekable_can_truncate(). To truncate a file io
4956  * stream, use g_seekable_truncate().
4957  *
4958  * The default implementation of all the #GFileIOStream operations
4959  * and the implementation of #GSeekable just call into the same operations
4960  * on the output stream.
4961  *
4962  * Since: 2.22
4963  */
4964
4965
4966 /**
4967  * SECTION:gfilemonitor
4968  * @short_description: File Monitor
4969  * @include: gio/gio.h
4970  *
4971  * Monitors a file or directory for changes.
4972  *
4973  * To obtain a #GFileMonitor for a file or directory, use
4974  * g_file_monitor(), g_file_monitor_file(), or
4975  * g_file_monitor_directory().
4976  *
4977  * To get informed about changes to the file or directory you are
4978  * monitoring, connect to the #GFileMonitor::changed signal. The
4979  * signal will be emitted in the <link
4980  * linkend="g-main-context-push-thread-default">thread-default main
4981  * context</link> of the thread that the monitor was created in
4982  * (though if the global default main context is blocked, this may
4983  * cause notifications to be blocked even if the thread-default
4984  * context is still running).
4985  */
4986
4987
4988 /**
4989  * SECTION:gfilenamecompleter
4990  * @short_description: Filename Completer
4991  * @include: gio/gio.h
4992  *
4993  * Completes partial file and directory names given a partial string by
4994  * looking in the file system for clues. Can return a list of possible
4995  * completion strings for widget implementations.
4996  */
4997
4998
4999 /**
5000  * SECTION:gfileoutputstream
5001  * @short_description: File output streaming operations
5002  * @include: gio/gio.h
5003  * @see_also: #GOutputStream, #GDataOutputStream, #GSeekable
5004  *
5005  * GFileOutputStream provides output streams that write their
5006  * content to a file.
5007  *
5008  * GFileOutputStream implements #GSeekable, which allows the output
5009  * stream to jump to arbitrary positions in the file and to truncate
5010  * the file, provided the filesystem of the file supports these
5011  * operations.
5012  *
5013  * To find the position of a file output stream, use g_seekable_tell().
5014  * To find out if a file output stream supports seeking, use
5015  * g_seekable_can_seek().To position a file output stream, use
5016  * g_seekable_seek(). To find out if a file output stream supports
5017  * truncating, use g_seekable_can_truncate(). To truncate a file output
5018  * stream, use g_seekable_truncate().
5019  */
5020
5021
5022 /**
5023  * SECTION:gfilterinputstream
5024  * @short_description: Filter Input Stream
5025  * @include: gio/gio.h
5026  *
5027  * Base class for input stream implementations that perform some
5028  * kind of filtering operation on a base stream. Typical examples
5029  * of filtering operations are character set conversion, compression
5030  * and byte order flipping.
5031  */
5032
5033
5034 /**
5035  * SECTION:gfilteroutputstream
5036  * @short_description: Filter Output Stream
5037  * @include: gio/gio.h
5038  *
5039  * Base class for output stream implementations that perform some
5040  * kind of filtering operation on a base stream. Typical examples
5041  * of filtering operations are character set conversion, compression
5042  * and byte order flipping.
5043  */
5044
5045
5046 /**
5047  * SECTION:gicon
5048  * @short_description: Interface for icons
5049  * @include: gio/gio.h
5050  *
5051  * #GIcon is a very minimal interface for icons. It provides functions
5052  * for checking the equality of two icons, hashing of icons and
5053  * serializing an icon to and from strings.
5054  *
5055  * #GIcon does not provide the actual pixmap for the icon as this is out
5056  * of GIO's scope, however implementations of #GIcon may contain the name
5057  * of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
5058  *
5059  * To obtain a hash of a #GIcon, see g_icon_hash().
5060  *
5061  * To check if two #GIcons are equal, see g_icon_equal().
5062  *
5063  * For serializing a #GIcon, use g_icon_to_string() and
5064  * g_icon_new_for_string().
5065  *
5066  * If your application or library provides one or more #GIcon
5067  * implementations you need to ensure that each #GType is registered
5068  * with the type system prior to calling g_icon_new_for_string().
5069  */
5070
5071
5072 /**
5073  * SECTION:ginetaddress
5074  * @short_description: An IPv4/IPv6 address
5075  *
5076  * #GInetAddress represents an IPv4 or IPv6 internet address. Use
5077  * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
5078  * look up the #GInetAddress for a hostname. Use
5079  * g_resolver_lookup_by_address() or
5080  * g_resolver_lookup_by_address_async() to look up the hostname for a
5081  * #GInetAddress.
5082  *
5083  * To actually connect to a remote host, you will need a
5084  * #GInetSocketAddress (which includes a #GInetAddress as well as a
5085  * port number).
5086  */
5087
5088
5089 /**
5090  * SECTION:ginetaddressmask
5091  * @short_description: An IPv4/IPv6 address mask
5092  *
5093  * #GInetAddressMask represents a range of IPv4 or IPv6 addresses
5094  * described by a base address and a length indicating how many bits
5095  * of the base address are relevant for matching purposes. These are
5096  * often given in string form. Eg, "10.0.0.0/8", or "fe80::/10".
5097  */
5098
5099
5100 /**
5101  * SECTION:ginetsocketaddress
5102  * @short_description: Internet GSocketAddress
5103  *
5104  * An IPv4 or IPv6 socket address; that is, the combination of a
5105  * #GInetAddress and a port number.
5106  */
5107
5108
5109 /**
5110  * SECTION:ginitable
5111  * @short_description: Failable object initialization interface
5112  * @include: gio/gio.h
5113  * @see_also: #GAsyncInitable
5114  *
5115  * #GInitable is implemented by objects that can fail during
5116  * initialization. If an object implements this interface then
5117  * it must be initialized as the first thing after construction,
5118  * either via g_initable_init() or g_async_initable_init_async()
5119  * (the latter is only available if it also implements #GAsyncInitable).
5120  *
5121  * If the object is not initialized, or initialization returns with an
5122  * error, then all operations on the object except g_object_ref() and
5123  * g_object_unref() are considered to be invalid, and have undefined
5124  * behaviour. They will often fail with g_critical() or g_warning(), but
5125  * this must not be relied on.
5126  *
5127  * Users of objects implementing this are not intended to use
5128  * the interface method directly, instead it will be used automatically
5129  * in various ways. For C applications you generally just call
5130  * g_initable_new() directly, or indirectly via a foo_thing_new() wrapper.
5131  * This will call g_initable_init() under the cover, returning %NULL and
5132  * setting a #GError on failure (at which point the instance is
5133  * unreferenced).
5134  *
5135  * For bindings in languages where the native constructor supports
5136  * exceptions the binding could check for objects implemention %GInitable
5137  * during normal construction and automatically initialize them, throwing
5138  * an exception on failure.
5139  */
5140
5141
5142 /**
5143  * SECTION:ginputstream
5144  * @short_description: Base class for implementing streaming input
5145  * @include: gio/gio.h
5146  *
5147  * #GInputStream has functions to read from a stream (g_input_stream_read()),
5148  * to close a stream (g_input_stream_close()) and to skip some content
5149  * (g_input_stream_skip()).
5150  *
5151  * To copy the content of an input stream to an output stream without
5152  * manually handling the reads and writes, use g_output_stream_splice().
5153  *
5154  * All of these functions have async variants too.
5155  */
5156
5157
5158 /**
5159  * SECTION:gioerror
5160  * @short_description: Error helper functions
5161  * @include: gio/gio.h
5162  *
5163  * Contains helper functions for reporting errors to the user.
5164  */
5165
5166
5167 /**
5168  * SECTION:giomodule
5169  * @short_description: Loadable GIO Modules
5170  * @include: gio/gio.h
5171  *
5172  * Provides an interface and default functions for loading and unloading
5173  * modules. This is used internally to make GIO extensible, but can also
5174  * be used by others to implement module loading.
5175  */
5176
5177
5178 /**
5179  * SECTION:gioscheduler
5180  * @short_description: I/O Scheduler
5181  * @include: gio/gio.h
5182  *
5183  * Schedules asynchronous I/O operations. #GIOScheduler integrates
5184  * into the main event loop (#GMainLoop) and uses threads.
5185  *
5186  * <para id="io-priority"><indexterm><primary>I/O priority</primary></indexterm>
5187  * Each I/O operation has a priority, and the scheduler uses the priorities
5188  * to determine the order in which operations are executed. They are
5189  * <emphasis>not</emphasis> used to determine system-wide I/O scheduling.
5190  * Priorities are integers, with lower numbers indicating higher priority.
5191  * It is recommended to choose priorities between %G_PRIORITY_LOW and
5192  * %G_PRIORITY_HIGH, with %G_PRIORITY_DEFAULT as a default.
5193  * </para>
5194  */
5195
5196
5197 /**
5198  * SECTION:giostream
5199  * @short_description: Base class for implementing read/write streams
5200  * @include: gio/gio.h
5201  * @see_also: #GInputStream, #GOutputStream
5202  *
5203  * GIOStream represents an object that has both read and write streams.
5204  * Generally the two streams acts as separate input and output streams,
5205  * but they share some common resources and state. For instance, for
5206  * seekable streams they may use the same position in both streams.
5207  *
5208  * Examples of #GIOStream objects are #GSocketConnection which represents
5209  * a two-way network connection, and #GFileIOStream which represent a
5210  * file handle opened in read-write mode.
5211  *
5212  * To do the actual reading and writing you need to get the substreams
5213  * with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
5214  *
5215  * The #GIOStream object owns the input and the output streams, not the other
5216  * way around, so keeping the substreams alive will not keep the #GIOStream
5217  * object alive. If the #GIOStream object is freed it will be closed, thus
5218  * closing the substream, so even if the substreams stay alive they will
5219  * always just return a %G_IO_ERROR_CLOSED for all operations.
5220  *
5221  * To close a stream use g_io_stream_close() which will close the common
5222  * stream object and also the individual substreams. You can also close
5223  * the substreams themselves. In most cases this only marks the
5224  * substream as closed, so further I/O on it fails. However, some streams
5225  * may support "half-closed" states where one direction of the stream
5226  * is actually shut down.
5227  *
5228  * Since: 2.22
5229  */
5230
5231
5232 /**
5233  * SECTION:gloadableicon
5234  * @short_description: Loadable Icons
5235  * @include: gio/gio.h
5236  * @see_also: #GIcon, #GThemedIcon
5237  *
5238  * Extends the #GIcon interface and adds the ability to
5239  * load icons from streams.
5240  */
5241
5242
5243 /**
5244  * SECTION:gmemoryinputstream
5245  * @short_description: Streaming input operations on memory chunks
5246  * @include: gio/gio.h
5247  * @see_also: #GMemoryOutputStream
5248  *
5249  * #GMemoryInputStream is a class for using arbitrary
5250  * memory chunks as input for GIO streaming input operations.
5251  *
5252  * As of GLib 2.34, #GMemoryInputStream implements
5253  * #GPollableInputStream.
5254  */
5255
5256
5257 /**
5258  * SECTION:gmemoryoutputstream
5259  * @short_description: Streaming output operations on memory chunks
5260  * @include: gio/gio.h
5261  * @see_also: #GMemoryInputStream
5262  *
5263  * #GMemoryOutputStream is a class for using arbitrary
5264  * memory chunks as output for GIO streaming output operations.
5265  *
5266  * As of GLib 2.34, #GMemoryOutputStream implements
5267  * #GPollableOutputStream.
5268  */
5269
5270
5271 /**
5272  * SECTION:gmenu
5273  * @title: GMenu
5274  * @short_description: A simple implementation of GMenuModel
5275  *
5276  * #GMenu is a simple implementation of #GMenuModel.
5277  * You populate a #GMenu by adding #GMenuItem instances to it.
5278  *
5279  * There are some convenience functions to allow you to directly
5280  * add items (avoiding #GMenuItem) for the common cases. To add
5281  * a regular item, use g_menu_insert(). To add a section, use
5282  * g_menu_insert_section(). To add a submenu, use
5283  * g_menu_insert_submenu().
5284  */
5285
5286
5287 /**
5288  * SECTION:gmenuexporter
5289  * @title: GMenuModel exporter
5290  * @short_description: Export GMenuModels on D-Bus
5291  * @see_also: #GMenuModel, #GDBusMenuModel
5292  *
5293  * These functions support exporting a #GMenuModel on D-Bus.
5294  * The D-Bus interface that is used is a private implementation
5295  * detail.
5296  *
5297  * To access an exported #GMenuModel remotely, use
5298  * g_dbus_menu_model_get() to obtain a #GDBusMenuModel.
5299  */
5300
5301
5302 /**
5303  * SECTION:gmenumodel
5304  * @title: GMenuModel
5305  * @short_description: An abstract class representing the contents of a menu
5306  * @see_also: #GActionGroup
5307  *
5308  * #GMenuModel represents the contents of a menu -- an ordered list of
5309  * menu items. The items are associated with actions, which can be
5310  * activated through them. Items can be grouped in sections, and may
5311  * have submenus associated with them. Both items and sections usually
5312  * have some representation data, such as labels or icons. The type of
5313  * the associated action (ie whether it is stateful, and what kind of
5314  * state it has) can influence the representation of the item.
5315  *
5316  * The conceptual model of menus in #GMenuModel is hierarchical:
5317  * sections and submenus are again represented by #GMenuModels.
5318  * Menus themselves do not define their own roles. Rather, the role
5319  * of a particular #GMenuModel is defined by the item that references
5320  * it (or, in the case of the 'root' menu, is defined by the context
5321  * in which it is used).
5322  *
5323  * As an example, consider the visible portions of the menu in
5324  * <xref linkend="menu-example"/>.
5325  *
5326  * <figure id="menu-example">
5327  *   <title>An example menu</title>
5328  *   <graphic fileref="menu-example.png" format="PNG"></graphic>
5329  * </figure>
5330  *
5331  * There are 8 "menus" visible in the screenshot: one menubar, two
5332  * submenus and 5 sections:
5333  * <itemizedlist>
5334  * <listitem>the toplevel menubar (containing 4 items)</listitem>
5335  * <listitem>the View submenu (containing 3 sections)</listitem>
5336  * <listitem>the first section of the View submenu (containing 2 items)</listitem>
5337  * <listitem>the second section of the View submenu (containing 1 item)</listitem>
5338  * <listitem>the final section of the View submenu (containing 1 item)</listitem>
5339  * <listitem>the Highlight Mode submenu (containing 2 sections)</listitem>
5340  * <listitem>the Sources section (containing 2 items)</listitem>
5341  * <listitem>the Markup section (containing 2 items)</listitem>
5342  * </itemizedlist>
5343  *
5344  * <xref linkend="menu-model"/> illustrates the conceptual connection between
5345  * these 8 menus. Each large block in the figure represents a menu and the
5346  * smaller blocks within the large block represent items in that menu. Some
5347  * items contain references to other menus.
5348  *
5349  * <figure id="menu-model">
5350  *   <title>A menu model</title>
5351  *   <graphic fileref="menu-model.png" format="PNG"></graphic>
5352  * </figure>
5353  *
5354  * Notice that the separators visible in <xref linkend="menu-example"/>
5355  * appear nowhere in <xref linkend="menu-model"/>. This is because
5356  * separators are not explicitly represented in the menu model. Instead,
5357  * a separator is inserted between any two non-empty sections of a menu.
5358  * Section items can have labels just like any other item. In that case,
5359  * a display system may show a section header instead of a separator.
5360  *
5361  * The motivation for this abstract model of application controls is
5362  * that modern user interfaces tend to make these controls available
5363  * outside the application. Examples include global menus, jumplists,
5364  * dash boards, etc. To support such uses, it is necessary to 'export'
5365  * information about actions and their representation in menus, which
5366  * is exactly what the
5367  * <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
5368  * and the
5369  * <link linkend="gio-GMenuModel-exporter">GMenuModel exporter</link>
5370  * do for #GActionGroup and #GMenuModel. The client-side counterparts
5371  * to make use of the exported information are #GDBusActionGroup and
5372  * #GDBusMenuModel.
5373  *
5374  * The API of #GMenuModel is very generic, with iterators for the
5375  * attributes and links of an item, see g_menu_model_iterate_item_attributes()
5376  * and g_menu_model_iterate_item_links(). The 'standard' attributes and
5377  * link types have predefined names: %G_MENU_ATTRIBUTE_LABEL,
5378  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, %G_MENU_LINK_SECTION
5379  * and %G_MENU_LINK_SUBMENU.
5380  *
5381  * Items in a #GMenuModel represent active controls if they refer to
5382  * an action that can get activated when the user interacts with the
5383  * menu item. The reference to the action is encoded by the string id
5384  * in the %G_MENU_ATTRIBUTE_ACTION attribute. An action id uniquely
5385  * identifies an action in an action group. Which action group(s) provide
5386  * actions depends on the context in which the menu model is used.
5387  * E.g. when the model is exported as the application menu of a
5388  * #GtkApplication, actions can be application-wide or window-specific
5389  * (and thus come from two different action groups). By convention, the
5390  * application-wide actions have names that start with "app.", while the
5391  * names of window-specific actions start with "win.".
5392  *
5393  * While a wide variety of stateful actions is possible, the following
5394  * is the minimum that is expected to be supported by all users of exported
5395  * menu information:
5396  * <itemizedlist>
5397  * <listitem>an action with no parameter type and no state</listitem>
5398  * <listitem>an action with no parameter type and boolean state</listitem>
5399  * <listitem>an action with string parameter type and string state</listitem>
5400  * </itemizedlist>
5401  *
5402  * <formalpara><title>Stateless</title>
5403  * <para>
5404  * A stateless action typically corresponds to an ordinary menu item.
5405  * </para>
5406  * <para>
5407  * Selecting such a menu item will activate the action (with no parameter).
5408  * </para>
5409  * </formalpara>
5410  *
5411  * <formalpara><title>Boolean State</title>
5412  * <para>
5413  * An action with a boolean state will most typically be used with a "toggle"
5414  * or "switch" menu item. The state can be set directly, but activating the
5415  * action (with no parameter) results in the state being toggled.
5416  * </para>
5417  * <para>
5418  * Selecting a toggle menu item will activate the action. The menu item should
5419  * be rendered as "checked" when the state is true.
5420  * </para>
5421  * </formalpara>
5422  *
5423  * <formalpara><title>String Parameter and State</title>
5424  * <para>
5425  * Actions with string parameters and state will most typically be used to
5426  * represent an enumerated choice over the items available for a group of
5427  * radio menu items. Activating the action with a string parameter is
5428  * equivalent to setting that parameter as the state.
5429  * </para>
5430  * <para>
5431  * Radio menu items, in addition to being associated with the action, will
5432  * have a target value. Selecting that menu item will result in activation
5433  * of the action with the target value as the parameter. The menu item should
5434  * be rendered as "selected" when the state of the action is equal to the
5435  * target value of the menu item.
5436  * </para>
5437  * </formalpara>
5438  */
5439
5440
5441 /**
5442  * SECTION:gmount
5443  * @short_description: Mount management
5444  * @include: gio/gio.h
5445  * @see_also: GVolume, GUnixMountEntry, GUnixMountPoint
5446  *
5447  * The #GMount interface represents user-visible mounts. Note, when
5448  * porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume.
5449  *
5450  * #GMount is a "mounted" filesystem that you can access. Mounted is in
5451  * quotes because it's not the same as a unix mount, it might be a gvfs
5452  * mount, but you can still access the files on it if you use GIO. Might or
5453  * might not be related to a volume object.
5454  *
5455  * Unmounting a #GMount instance is an asynchronous operation. For
5456  * more information about asynchronous operations, see #GAsyncResult
5457  * and #GSimpleAsyncResult. To unmount a #GMount instance, first call
5458  * g_mount_unmount_with_operation() with (at least) the #GMount instance and a
5459  * #GAsyncReadyCallback.  The callback will be fired when the
5460  * operation has resolved (either with success or failure), and a
5461  * #GAsyncReady structure will be passed to the callback.  That
5462  * callback should then call g_mount_unmount_with_operation_finish() with the #GMount
5463  * and the #GAsyncReady data to see if the operation was completed
5464  * successfully.  If an @error is present when g_mount_unmount_with_operation_finish()
5465  * is called, then it will be filled with any error information.
5466  */
5467
5468
5469 /**
5470  * SECTION:gmountoperation
5471  * @short_description: Object used for authentication and user interaction
5472  * @include: gio/gio.h
5473  *
5474  * #GMountOperation provides a mechanism for interacting with the user.
5475  * It can be used for authenticating mountable operations, such as loop
5476  * mounting files, hard drive partitions or server locations. It can
5477  * also be used to ask the user questions or show a list of applications
5478  * preventing unmount or eject operations from completing.
5479  *
5480  * Note that #GMountOperation is used for more than just #GMount
5481  * objects â€“ for example it is also used in g_drive_start() and
5482  * g_drive_stop().
5483  *
5484  * Users should instantiate a subclass of this that implements all the
5485  * various callbacks to show the required dialogs, such as
5486  * #GtkMountOperation. If no user interaction is desired (for example
5487  * when automounting filesystems at login time), usually %NULL can be
5488  * passed, see each method taking a #GMountOperation for details.
5489  */
5490
5491
5492 /**
5493  * SECTION:gnetworkaddress
5494  * @short_description: A GSocketConnectable for resolving hostnames
5495  * @include: gio/gio.h
5496  *
5497  * #GNetworkAddress provides an easy way to resolve a hostname and
5498  * then attempt to connect to that host, handling the possibility of
5499  * multiple IP addresses and multiple address families.
5500  *
5501  * See #GSocketConnectable for and example of using the connectable
5502  * interface.
5503  */
5504
5505
5506 /**
5507  * SECTION:gnetworkmonitor
5508  * @title: GNetworkMonitor
5509  * @short_description: Network status monitor
5510  * @include: gio/gio.h
5511  *
5512  * #GNetworkMonitor provides an easy-to-use cross-platform API
5513  * for monitoring network connectivity. On Linux, the implementation
5514  * is based on the kernels netlink interface.
5515  */
5516
5517
5518 /**
5519  * SECTION:gnetworkservice
5520  * @short_description: A GSocketConnectable for resolving SRV records
5521  * @include: gio/gio.h
5522  *
5523  * Like #GNetworkAddress does with hostnames, #GNetworkService
5524  * provides an easy way to resolve a SRV record, and then attempt to
5525  * connect to one of the hosts that implements that service, handling
5526  * service priority/weighting, multiple IP addresses, and multiple
5527  * address families.
5528  *
5529  * See #GSrvTarget for more information about SRV records, and see
5530  * #GSocketConnectable for and example of using the connectable
5531  * interface.
5532  */
5533
5534
5535 /**
5536  * SECTION:goutputstream
5537  * @short_description: Base class for implementing streaming output
5538  * @include: gio/gio.h
5539  *
5540  * #GOutputStream has functions to write to a stream (g_output_stream_write()),
5541  * to close a stream (g_output_stream_close()) and to flush pending writes
5542  * (g_output_stream_flush()).
5543  *
5544  * To copy the content of an input stream to an output stream without
5545  * manually handling the reads and writes, use g_output_stream_splice().
5546  *
5547  * All of these functions have async variants too.
5548  */
5549
5550
5551 /**
5552  * SECTION:gpermission
5553  * @title: GPermission
5554  * @short_description: An object representing the permission to perform a certain action
5555  *
5556  * A #GPermission represents the status of the caller's permission to
5557  * perform a certain action.
5558  *
5559  * You can query if the action is currently allowed and if it is
5560  * possible to acquire the permission so that the action will be allowed
5561  * in the future.
5562  *
5563  * There is also an API to actually acquire the permission and one to
5564  * release it.
5565  *
5566  * As an example, a #GPermission might represent the ability for the
5567  * user to write to a #GSettings object.  This #GPermission object could
5568  * then be used to decide if it is appropriate to show a "Click here to
5569  * unlock" button in a dialog and to provide the mechanism to invoke
5570  * when that button is clicked.
5571  */
5572
5573
5574 /**
5575  * SECTION:gpollableinputstream
5576  * @short_description: Interface for pollable input streams
5577  * @include: gio/gio.h
5578  * @see_also: #GInputStream, #GPollableOutputStream, #GFileDescriptorBased
5579  *
5580  * #GPollableInputStream is implemented by #GInputStream<!-- -->s that
5581  * can be polled for readiness to read. This can be used when
5582  * interfacing with a non-GIO API that expects
5583  * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5584  *
5585  * Since: 2.28
5586  */
5587
5588
5589 /**
5590  * SECTION:gpollableoutputstream
5591  * @short_description: Interface for pollable output streams
5592  * @include: gio/gio.h
5593  * @see_also: #GOutputStream, #GFileDescriptorBased, #GPollableInputStream
5594  *
5595  * #GPollableOutputStream is implemented by #GOutputStream<!-- -->s that
5596  * can be polled for readiness to write. This can be used when
5597  * interfacing with a non-GIO API that expects
5598  * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
5599  *
5600  * Since: 2.28
5601  */
5602
5603
5604 /**
5605  * SECTION:gpollableutils
5606  * @short_description: #GPollableInputStream / #GPollableOutputStream utilities
5607  * @include: gio/gio.h
5608  *
5609  * Utility functions for #GPollableInputStream and
5610  * #GPollableOutputStream implementations.
5611  */
5612
5613
5614 /**
5615  * SECTION:gproxy
5616  * @short_description: Interface for proxy handling
5617  *
5618  * A #GProxy handles connecting to a remote host via a given type of
5619  * proxy server. It is implemented by the 'gio-proxy' extension point.
5620  * The extensions are named after their proxy protocol name. As an
5621  * example, a SOCKS5 proxy implementation can be retrieved with the
5622  * name 'socks5' using the function
5623  * g_io_extension_point_get_extension_by_name().
5624  *
5625  * Since: 2.26
5626  */
5627
5628
5629 /**
5630  * SECTION:gproxyaddress
5631  * @short_description: An internet address with proxy information
5632  *
5633  * Support for proxied #GInetSocketAddress.
5634  */
5635
5636
5637 /**
5638  * SECTION:gproxyresolver
5639  * @short_description: Asynchronous and cancellable network proxy resolver
5640  * @include: gio/gio.h
5641  *
5642  * #GProxyResolver provides synchronous and asynchronous network proxy
5643  * resolution. #GProxyResolver is used within #GSocketClient through
5644  * the method g_socket_connectable_proxy_enumerate().
5645  */
5646
5647
5648 /**
5649  * SECTION:gremoteactiongroup
5650  * @title: GRemoteActionGroup
5651  * @short_description: a #GActionGroup that interacts with other processes
5652  *
5653  * The GRemoteActionGroup interface is implemented by #GActionGroup
5654  * instances that either transmit action invocations to other processes
5655  * or receive action invocations in the local process from other
5656  * processes.
5657  *
5658  * The interface has <literal>_full</literal> variants of the two
5659  * methods on #GActionGroup used to activate actions:
5660  * g_action_group_activate_action() and
5661  * g_action_group_change_action_state().  These variants allow a
5662  * "platform data" #GVariant to be specified: a dictionary providing
5663  * context for the action invocation (for example: timestamps, startup
5664  * notification IDs, etc).
5665  *
5666  * #GDBusActionGroup implements #GRemoteActionGroup.  This provides a
5667  * mechanism to send platform data for action invocations over D-Bus.
5668  *
5669  * Additionally, g_dbus_connection_export_action_group() will check if
5670  * the exported #GActionGroup implements #GRemoteActionGroup and use the
5671  * <literal>_full</literal> variants of the calls if available.  This
5672  * provides a mechanism by which to receive platform data for action
5673  * invocations that arrive by way of D-Bus.
5674  *
5675  * Since: 2.32
5676  */
5677
5678
5679 /**
5680  * SECTION:gresolver
5681  * @short_description: Asynchronous and cancellable DNS resolver
5682  * @include: gio/gio.h
5683  *
5684  * #GResolver provides cancellable synchronous and asynchronous DNS
5685  * resolution, for hostnames (g_resolver_lookup_by_address(),
5686  * g_resolver_lookup_by_name() and their async variants) and SRV
5687  * (service) records (g_resolver_lookup_service()).
5688  *
5689  * #GNetworkAddress and #GNetworkService provide wrappers around
5690  * #GResolver functionality that also implement #GSocketConnectable,
5691  * making it easy to connect to a remote host/service.
5692  */
5693
5694
5695 /**
5696  * SECTION:gresource
5697  * @short_description: Resource framework
5698  * @include: gio/gio.h
5699  *
5700  * Applications and libraries often contain binary or textual data that is really part of the
5701  * application, rather than user data. For instance #GtkBuilder .ui files, splashscreen images,
5702  * GMenu markup xml, CSS files, icons, etc. These are often shipped as files in <filename>$datadir/appname</filename>, or
5703  * manually included as literal strings in the code.
5704  *
5705  * The #GResource API and the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5706  * provide a convenient and efficient alternative to this which has some nice properties. You
5707  * maintain the files as normal files, so its easy to edit them, but during the build the files
5708  * are combined into a binary bundle that is linked into the executable. This means that loading
5709  * the resource files are efficient (as they are already in memory, shared with other instances) and
5710  * simple (no need to check for things like I/O errors or locate the files in the filesystem). It
5711  * also makes it easier to create relocatable applications.
5712  *
5713  * Resource files can also be marked as compressed. Such files will be included in the resource bundle
5714  * in a compressed form, but will be automatically uncompressed when the resource is used. This
5715  * is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away.
5716  *
5717  * Resource files can also be marked to be preprocessed, by setting the value of the
5718  * <literal>preprocess</literal> attribute to a comma-separated list of preprocessing options.
5719  * The only options currently supported are:
5720  *
5721  * <literal>xml-stripblanks</literal> which will use <command>xmllint</command> to strip
5722  * ignorable whitespace from the xml file. For this to work, the <envar>XMLLINT</envar>
5723  * environment variable must be set to the full path to the xmllint executable, or xmllint
5724  * must be in the PATH; otherwise the preprocessing step is skipped.
5725  *
5726  * <literal>to-pixdata</literal> which will use <command>gdk-pixbuf-pixdata</command> to convert
5727  * images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside
5728  * the resource file, rather than an (uncompressed) copy if it. For this, the gdk-pixbuf-pixdata
5729  * program must be in the PATH, or the <envar>GDK_PIXBUF_PIXDATA</envar> environment variable must be
5730  * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will
5731  * abort.
5732  *
5733  * Resource bundles are created by the <link linkend="glib-compile-resources">glib-compile-resources</link> program
5734  * which takes an xml file that describes the bundle, and a set of files that the xml references. These
5735  * are combined into a binary resource bundle.
5736  *
5737  * <example id="resource-example"><title>Example resource description</title>
5738  * <programlisting><![CDATA[
5739  * <?xml version="1.0" encoding="UTF-8"?>
5740  * <gresources>
5741  *   <gresource prefix="/org/gtk/Example">
5742  *     <file>data/splashscreen.png</file>
5743  *     <file compressed="true">dialog.ui</file>
5744  *     <file preprocess="xml-stripblanks">menumarkup.xml</file>
5745  *   </gresource>
5746  * </gresources>
5747  * ]]></programlisting></example>
5748  *
5749  * This will create a resource bundle with the following files:
5750  * <programlisting><![CDATA[
5751  * /org/gtk/Example/data/splashscreen.png
5752  * /org/gtk/Example/dialog.ui
5753  * /org/gtk/Example/menumarkup.xml
5754  * ]]></programlisting>
5755  *
5756  * Note that all resources in the process share the same namespace, so use java-style
5757  * path prefixes (like in the above example) to avoid conflicts.
5758  *
5759  * You can then use <link linkend="glib-compile-resources">glib-compile-resources</link> to compile the xml to a
5760  * binary bundle that you can load with g_resource_load(). However, its more common to use the --generate-source and
5761  * --generate-header arguments to create a source file and header to link directly into your application.
5762  *
5763  * Once a #GResource has been created and registered all the data in it can be accessed globally in the process by
5764  * using API calls like g_resources_open_stream() to stream the data or g_resources_lookup_data() to get a direct pointer
5765  * to the data. You can also use uris like "resource:///org/gtk/Example/data/splashscreen.png" with #GFile to access
5766  * the resource data.
5767  *
5768  * There are two forms of the generated source, the default version uses the compiler support for constructor
5769  * and destructor functions (where available) to automatically create and register the #GResource on startup
5770  * or library load time. If you pass --manual-register two functions to register/unregister the resource is instead
5771  * created. This requires an explicit initialization call in your application/library, but it works on all platforms,
5772  * even on the minor ones where this is not available. (Constructor support is available for at least Win32, MacOS and Linux.)
5773  *
5774  * Note that resource data can point directly into the data segment of e.g. a library, so if you are unloading libraries
5775  * during runtime you need to be very careful with keeping around pointers to data from a resource, as this goes away
5776  * when the library is unloaded. However, in practice this is not generally a problem, since most resource accesses
5777  * is for your own resources, and resource data is often used once, during parsing, and then released.
5778  *
5779  * Since: 2.32
5780  */
5781
5782
5783 /**
5784  * SECTION:gseekable
5785  * @short_description: Stream seeking interface
5786  * @include: gio/gio.h
5787  * @see_also: #GInputStream, #GOutputStream
5788  *
5789  * #GSeekable is implemented by streams (implementations of
5790  * #GInputStream or #GOutputStream) that support seeking.
5791  */
5792
5793
5794 /**
5795  * SECTION:gsettings
5796  * @short_description: High-level API for application settings
5797  *
5798  * The #GSettings class provides a convenient API for storing and retrieving
5799  * application settings.
5800  *
5801  * Reads and writes can be considered to be non-blocking.  Reading
5802  * settings with #GSettings is typically extremely fast: on
5803  * approximately the same order of magnitude (but slower than) a
5804  * #GHashTable lookup.  Writing settings is also extremely fast in terms
5805  * of time to return to your application, but can be extremely expensive
5806  * for other threads and other processes.  Many settings backends
5807  * (including dconf) have lazy initialisation which means in the common
5808  * case of the user using their computer without modifying any settings
5809  * a lot of work can be avoided.  For dconf, the D-Bus service doesn't
5810  * even need to be started in this case.  For this reason, you should
5811  * only ever modify #GSettings keys in response to explicit user action.
5812  * Particular care should be paid to ensure that modifications are not
5813  * made during startup -- for example, when setting the initial value
5814  * of preferences widgets.  The built-in g_settings_bind() functionality
5815  * is careful not to write settings in response to notify signals as a
5816  * result of modifications that it makes to widgets.
5817  *
5818  * When creating a GSettings instance, you have to specify a schema
5819  * that describes the keys in your settings and their types and default
5820  * values, as well as some other information.
5821  *
5822  * Normally, a schema has as fixed path that determines where the settings
5823  * are stored in the conceptual global tree of settings. However, schemas
5824  * can also be 'relocatable', i.e. not equipped with a fixed path. This is
5825  * useful e.g. when the schema describes an 'account', and you want to be
5826  * able to store a arbitrary number of accounts.
5827  *
5828  * Paths must start with and end with a forward slash character ('/')
5829  * and must not contain two sequential slash characters.  Paths should
5830  * be chosen based on a domain name associated with the program or
5831  * library to which the settings belong.  Examples of paths are
5832  * "/org/gtk/settings/file-chooser/" and "/ca/desrt/dconf-editor/".
5833  * Paths should not start with "/apps/", "/desktop/" or "/system/" as
5834  * they often did in GConf.
5835  *
5836  * Unlike other configuration systems (like GConf), GSettings does not
5837  * restrict keys to basic types like strings and numbers. GSettings stores
5838  * values as #GVariant, and allows any #GVariantType for keys. Key names
5839  * are restricted to lowercase characters, numbers and '-'. Furthermore,
5840  * the names must begin with a lowercase character, must not end
5841  * with a '-', and must not contain consecutive dashes.
5842  *
5843  * Similar to GConf, the default values in GSettings schemas can be
5844  * localized, but the localized values are stored in gettext catalogs
5845  * and looked up with the domain that is specified in the
5846  * <tag class="attribute">gettext-domain</tag> attribute of the
5847  * <tag class="starttag">schemalist</tag> or <tag class="starttag">schema</tag>
5848  * elements and the category that is specified in the l10n attribute of the
5849  * <tag class="starttag">key</tag> element.
5850  *
5851  * GSettings uses schemas in a compact binary form that is created
5852  * by the <link linkend="glib-compile-schemas">glib-compile-schemas</link>
5853  * utility. The input is a schema description in an XML format that can be
5854  * described by the following DTD:
5855  * |[<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>]|
5856  *
5857  * glib-compile-schemas expects schema files to have the extension <filename>.gschema.xml</filename>
5858  *
5859  * At runtime, schemas are identified by their id (as specified
5860  * in the <tag class="attribute">id</tag> attribute of the
5861  * <tag class="starttag">schema</tag> element). The
5862  * convention for schema ids is to use a dotted name, similar in
5863  * style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular,
5864  * if the settings are for a specific service that owns a D-Bus bus name,
5865  * the D-Bus bus name and schema id should match. For schemas which deal
5866  * with settings not associated with one named application, the id should
5867  * not use StudlyCaps, e.g. "org.gnome.font-rendering".
5868  *
5869  * In addition to #GVariant types, keys can have types that have enumerated
5870  * types. These can be described by a <tag class="starttag">choice</tag>,
5871  * <tag class="starttag">enum</tag> or <tag class="starttag">flags</tag> element, see
5872  * <xref linkend="schema-enumerated"/>. The underlying type of
5873  * such a key is string, but you can use g_settings_get_enum(),
5874  * g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags()
5875  * access the numeric values corresponding to the string value of enum
5876  * and flags keys.
5877  *
5878  * <example id="schema-default-values"><title>Default values</title>
5879  * <programlisting><![CDATA[
5880  * <schemalist>
5881  *   <schema id="org.gtk.Test" path="/org/gtk/Test/" gettext-domain="test">
5882  *
5883  *     <key name="greeting" type="s">
5884  *       <default l10n="messages">"Hello, earthlings"</default>
5885  *       <summary>A greeting</summary>
5886  *       <description>
5887  *         Greeting of the invading martians
5888  *       </description>
5889  *     </key>
5890  *
5891  *     <key name="box" type="(ii)">
5892  *       <default>(20,30)</default>
5893  *     </key>
5894  *
5895  *   </schema>
5896  * </schemalist>
5897  * ]]></programlisting></example>
5898  *
5899  * <example id="schema-enumerated"><title>Ranges, choices and enumerated types</title>
5900  * <programlisting><![CDATA[
5901  * <schemalist>
5902  *
5903  *   <enum id="org.gtk.Test.myenum">
5904  *     <value nick="first" value="1"/>
5905  *     <value nick="second" value="2"/>
5906  *   </enum>
5907  *
5908  *   <flags id="org.gtk.Test.myflags">
5909  *     <value nick="flag1" value="1"/>
5910  *     <value nick="flag2" value="2"/>
5911  *     <value nick="flag3" value="4"/>
5912  *   </flags>
5913  *
5914  *   <schema id="org.gtk.Test">
5915  *
5916  *     <key name="key-with-range" type="i">
5917  *       <range min="1" max="100"/>
5918  *       <default>10</default>
5919  *     </key>
5920  *
5921  *     <key name="key-with-choices" type="s">
5922  *       <choices>
5923  *         <choice value='Elisabeth'/>
5924  *         <choice value='Annabeth'/>
5925  *         <choice value='Joe'/>
5926  *       </choices>
5927  *       <aliases>
5928  *         <alias value='Anna' target='Annabeth'/>
5929  *         <alias value='Beth' target='Elisabeth'/>
5930  *       </aliases>
5931  *       <default>'Joe'</default>
5932  *     </key>
5933  *
5934  *     <key name='enumerated-key' enum='org.gtk.Test.myenum'>
5935  *       <default>'first'</default>
5936  *     </key>
5937  *
5938  *     <key name='flags-key' flags='org.gtk.Test.myflags'>
5939  *       <default>["flag1",flag2"]</default>
5940  *     </key>
5941  *   </schema>
5942  * </schemalist>
5943  * ]]></programlisting></example>
5944  *
5945  * <refsect2>
5946  *   <title>Vendor overrides</title>
5947  *   <para>
5948  *     Default values are defined in the schemas that get installed by
5949  *     an application. Sometimes, it is necessary for a vendor or distributor
5950  *     to adjust these defaults. Since patching the XML source for the schema
5951  *     is inconvenient and error-prone,
5952  *     <link linkend="glib-compile-schemas">glib-compile-schemas</link> reads
5953  *     so-called 'vendor override' files. These are keyfiles in the same
5954  *     directory as the XML schema sources which can override default values.
5955  *     The schema id serves as the group name in the key file, and the values
5956  *     are expected in serialized GVariant form, as in the following example:
5957  *     <informalexample><programlisting>
5958  *     [org.gtk.Example]
5959  *     key1='string'
5960  *     key2=1.5
5961  *     </programlisting></informalexample>
5962  *   </para>
5963  *   <para>
5964  *     glib-compile-schemas expects schema files to have the extension
5965  *     <filename>.gschema.override</filename>
5966  *   </para>
5967  * </refsect2>
5968  *
5969  * <refsect2>
5970  *   <title>Binding</title>
5971  *   <para>
5972  *     A very convenient feature of GSettings lets you bind #GObject properties
5973  *     directly to settings, using g_settings_bind(). Once a GObject property
5974  *     has been bound to a setting, changes on either side are automatically
5975  *     propagated to the other side. GSettings handles details like
5976  *     mapping between GObject and GVariant types, and preventing infinite
5977  *     cycles.
5978  *   </para>
5979  *   <para>
5980  *     This makes it very easy to hook up a preferences dialog to the
5981  *     underlying settings. To make this even more convenient, GSettings
5982  *     looks for a boolean property with the name "sensitivity" and
5983  *     automatically binds it to the writability of the bound setting.
5984  *     If this 'magic' gets in the way, it can be suppressed with the
5985  *     #G_SETTINGS_BIND_NO_SENSITIVITY flag.
5986  *   </para>
5987  * </refsect2>
5988  */
5989
5990
5991 /**
5992  * SECTION:gsettingsbackend
5993  * @title: GSettingsBackend
5994  * @short_description: Interface for settings backend implementations
5995  * @include: gio/gsettingsbackend.h
5996  * @see_also: #GSettings, #GIOExtensionPoint
5997  *
5998  * The #GSettingsBackend interface defines a generic interface for
5999  * non-strictly-typed data that is stored in a hierarchy. To implement
6000  * an alternative storage backend for #GSettings, you need to implement
6001  * the #GSettingsBackend interface and then make it implement the
6002  * extension point #G_SETTINGS_BACKEND_EXTENSION_POINT_NAME.
6003  *
6004  * The interface defines methods for reading and writing values, a
6005  * method for determining if writing of certain values will fail
6006  * (lockdown) and a change notification mechanism.
6007  *
6008  * The semantics of the interface are very precisely defined and
6009  * implementations must carefully adhere to the expectations of
6010  * callers that are documented on each of the interface methods.
6011  *
6012  * Some of the GSettingsBackend functions accept or return a #GTree.
6013  * These trees always have strings as keys and #GVariant as values.
6014  * g_settings_backend_create_tree() is a convenience function to create
6015  * suitable trees.
6016  *
6017  * <note><para>
6018  * The #GSettingsBackend API is exported to allow third-party
6019  * implementations, but does not carry the same stability guarantees
6020  * as the public GIO API. For this reason, you have to define the
6021  * C preprocessor symbol #G_SETTINGS_ENABLE_BACKEND before including
6022  * <filename>gio/gsettingsbackend.h</filename>
6023  * </para></note>
6024  */
6025
6026
6027 /**
6028  * SECTION:gsettingsschema
6029  * @short_description: introspecting and controlling the loading of #GSettings schemas
6030  *
6031  * The #GSettingsSchemaSource and #GSettingsSchema APIs provide a
6032  * mechanism for advanced control over the loading of schemas and a
6033  * mechanism for introspecting their content.
6034  *
6035  * Plugin loading systems that wish to provide plugins a way to access
6036  * settings face the problem of how to make the schemas for these
6037  * settings visible to GSettings.  Typically, a plugin will want to ship
6038  * the schema along with itself and it won't be installed into the
6039  * standard system directories for schemas.
6040  *
6041  * #GSettingsSchemaSource provides a mechanism for dealing with this by
6042  * allowing the creation of a new 'schema source' from which schemas can
6043  * be acquired.  This schema source can then become part of the metadata
6044  * associated with the plugin and queried whenever the plugin requires
6045  * access to some settings.
6046  *
6047  * Consider the following example:
6048  *
6049  * |[
6050  * typedef struct
6051  * {
6052  *    ...
6053  *    GSettingsSchemaSource *schema_source;
6054  *    ...
6055  * } Plugin;
6056  *
6057  * Plugin *
6058  * initialise_plugin (const gchar *dir)
6059  * {
6060  *   Plugin *plugin;
6061  *
6062  *   ...
6063  *
6064  *   plugin->schema_source =
6065  *     g_settings_new_schema_source_from_directory (dir,
6066  *       g_settings_schema_source_get_default (), FALSE, NULL);
6067  *
6068  *   ...
6069  *
6070  *   return plugin;
6071  * }
6072  *
6073  * ...
6074  *
6075  * GSettings *
6076  * plugin_get_settings (Plugin      *plugin,
6077  *                      const gchar *schema_id)
6078  * {
6079  *   GSettingsSchema *schema;
6080  *
6081  *   if (schema_id == NULL)
6082  *     schema_id = plugin->identifier;
6083  *
6084  *   schema = g_settings_schema_source_lookup (plugin->schema_source,
6085  *                                             schema_id, FALSE);
6086  *
6087  *   if (schema == NULL)
6088  *     {
6089  *       ... disable the plugin or abort, etc ...
6090  *     }
6091  *
6092  *   return g_settings_new_full (schema, NULL, NULL);
6093  * }
6094  * ]|
6095  *
6096  * The code above shows how hooks should be added to the code that
6097  * initialises (or enables) the plugin to create the schema source and
6098  * how an API can be added to the plugin system to provide a convenient
6099  * way for the plugin to access its settings, using the schemas that it
6100  * ships.
6101  *
6102  * From the standpoint of the plugin, it would need to ensure that it
6103  * ships a gschemas.compiled file as part of itself, and then simply do
6104  * the following:
6105  *
6106  * |[
6107  * {
6108  *   GSettings *settings;
6109  *   gint some_value;
6110  *
6111  *   settings = plugin_get_settings (self, NULL);
6112  *   some_value = g_settings_get_int (settings, "some-value");
6113  *   ...
6114  * }
6115  * ]|
6116  *
6117  * It's also possible that the plugin system expects the schema source
6118  * files (ie: .gschema.xml files) instead of a gschemas.compiled file.
6119  * In that case, the plugin loading system must compile the schemas for
6120  * itself before attempting to create the settings source.
6121  *
6122  * Since: 2.32
6123  */
6124
6125
6126 /**
6127  * SECTION:gsimpleaction
6128  * @title: GSimpleAction
6129  * @short_description: A simple GAction implementation
6130  *
6131  * A #GSimpleAction is the obvious simple implementation of the #GAction
6132  * interface. This is the easiest way to create an action for purposes of
6133  * adding it to a #GSimpleActionGroup.
6134  *
6135  * See also #GtkAction.
6136  */
6137
6138
6139 /**
6140  * SECTION:gsimpleactiongroup
6141  * @title: GSimpleActionGroup
6142  * @short_description: A simple GActionGroup implementation
6143  *
6144  * #GSimpleActionGroup is a hash table filled with #GAction objects,
6145  * implementing the #GActionGroup and #GActionMap interfaces.
6146  */
6147
6148
6149 /**
6150  * SECTION:gsimpleasyncresult
6151  * @short_description: Simple asynchronous results implementation
6152  * @include: gio/gio.h
6153  * @see_also: #GAsyncResult
6154  *
6155  * Implements #GAsyncResult for simple cases. Most of the time, this
6156  * will be all an application needs, and will be used transparently.
6157  * Because of this, #GSimpleAsyncResult is used throughout GIO for
6158  * handling asynchronous functions.
6159  *
6160  * GSimpleAsyncResult handles #GAsyncReadyCallback<!-- -->s, error
6161  * reporting, operation cancellation and the final state of an operation,
6162  * completely transparent to the application. Results can be returned
6163  * as a pointer e.g. for functions that return data that is collected
6164  * asynchronously, a boolean value for checking the success or failure
6165  * of an operation, or a #gssize for operations which return the number
6166  * of bytes modified by the operation; all of the simple return cases
6167  * are covered.
6168  *
6169  * Most of the time, an application will not need to know of the details
6170  * of this API; it is handled transparently, and any necessary operations
6171  * are handled by #GAsyncResult's interface. However, if implementing a
6172  * new GIO module, for writing language bindings, or for complex
6173  * applications that need better control of how asynchronous operations
6174  * are completed, it is important to understand this functionality.
6175  *
6176  * GSimpleAsyncResults are tagged with the calling function to ensure
6177  * that asynchronous functions and their finishing functions are used
6178  * together correctly.
6179  *
6180  * To create a new #GSimpleAsyncResult, call g_simple_async_result_new().
6181  * If the result needs to be created for a #GError, use
6182  * g_simple_async_result_new_from_error() or
6183  * g_simple_async_result_new_take_error(). If a #GError is not available
6184  * (e.g. the asynchronous operation's doesn't take a #GError argument),
6185  * but the result still needs to be created for an error condition, use
6186  * g_simple_async_result_new_error() (or g_simple_async_result_set_error_va()
6187  * if your application or binding requires passing a variable argument list
6188  * directly), and the error can then be propagated through the use of
6189  * g_simple_async_result_propagate_error().
6190  *
6191  * An asynchronous operation can be made to ignore a cancellation event by
6192  * calling g_simple_async_result_set_handle_cancellation() with a
6193  * #GSimpleAsyncResult for the operation and %FALSE. This is useful for
6194  * operations that are dangerous to cancel, such as close (which would
6195  * cause a leak if cancelled before being run).
6196  *
6197  * GSimpleAsyncResult can integrate into GLib's event loop, #GMainLoop,
6198  * or it can use #GThread<!-- -->s.
6199  * g_simple_async_result_complete() will finish an I/O task directly
6200  * from the point where it is called. g_simple_async_result_complete_in_idle()
6201  * will finish it from an idle handler in the <link
6202  * linkend="g-main-context-push-thread-default">thread-default main
6203  * context</link>. g_simple_async_result_run_in_thread() will run the
6204  * job in a separate thread and then deliver the result to the
6205  * thread-default main context.
6206  *
6207  * To set the results of an asynchronous function,
6208  * g_simple_async_result_set_op_res_gpointer(),
6209  * g_simple_async_result_set_op_res_gboolean(), and
6210  * g_simple_async_result_set_op_res_gssize()
6211  * are provided, setting the operation's result to a gpointer, gboolean, or
6212  * gssize, respectively.
6213  *
6214  * Likewise, to get the result of an asynchronous function,
6215  * g_simple_async_result_get_op_res_gpointer(),
6216  * g_simple_async_result_get_op_res_gboolean(), and
6217  * g_simple_async_result_get_op_res_gssize() are
6218  * provided, getting the operation's result as a gpointer, gboolean, and
6219  * gssize, respectively.
6220  *
6221  * For the details of the requirements implementations must respect, see
6222  * #GAsyncResult.  A typical implementation of an asynchronous operation
6223  * using GSimpleAsyncResult looks something like this:
6224  *
6225  * |[
6226  * static void
6227  * baked_cb (Cake    *cake,
6228  *           gpointer user_data)
6229  * {
6230  *   /&ast; In this example, this callback is not given a reference to the cake, so
6231  *    &ast; the GSimpleAsyncResult has to take a reference to it.
6232  *    &ast;/
6233  *   GSimpleAsyncResult *result = user_data;
6234  *
6235  *   if (cake == NULL)
6236  *     g_simple_async_result_set_error (result,
6237  *                                      BAKER_ERRORS,
6238  *                                      BAKER_ERROR_NO_FLOUR,
6239  *                                      "Go to the supermarket");
6240  *   else
6241  *     g_simple_async_result_set_op_res_gpointer (result,
6242  *                                                g_object_ref (cake),
6243  *                                                g_object_unref);
6244  *
6245  *
6246  *   /&ast; In this example, we assume that baked_cb is called as a callback from
6247  *    &ast; the mainloop, so it's safe to complete the operation synchronously here.
6248  *    &ast; If, however, _baker_prepare_cake () might call its callback without
6249  *    &ast; first returning to the mainloop â€” inadvisable, but some APIs do so â€”
6250  *    &ast; we would need to use g_simple_async_result_complete_in_idle().
6251  *    &ast;/
6252  *   g_simple_async_result_complete (result);
6253  *   g_object_unref (result);
6254  * }
6255  *
6256  * void
6257  * baker_bake_cake_async (Baker              *self,
6258  *                        guint               radius,
6259  *                        GAsyncReadyCallback callback,
6260  *                        gpointer            user_data)
6261  * {
6262  *   GSimpleAsyncResult *simple;
6263  *   Cake               *cake;
6264  *
6265  *   if (radius < 3)
6266  *     {
6267  *       g_simple_async_report_error_in_idle (G_OBJECT (self),
6268  *                                            callback,
6269  *                                            user_data,
6270  *                                            BAKER_ERRORS,
6271  *                                            BAKER_ERROR_TOO_SMALL,
6272  *                                            "%ucm radius cakes are silly",
6273  *                                            radius);
6274  *       return;
6275  *     }
6276  *
6277  *   simple = g_simple_async_result_new (G_OBJECT (self),
6278  *                                       callback,
6279  *                                       user_data,
6280  *                                       baker_bake_cake_async);
6281  *   cake = _baker_get_cached_cake (self, radius);
6282  *
6283  *   if (cake != NULL)
6284  *     {
6285  *       g_simple_async_result_set_op_res_gpointer (simple,
6286  *                                                  g_object_ref (cake),
6287  *                                                  g_object_unref);
6288  *       g_simple_async_result_complete_in_idle (simple);
6289  *       g_object_unref (simple);
6290  *       /&ast; Drop the reference returned by _baker_get_cached_cake(); the
6291  *        &ast; GSimpleAsyncResult has taken its own reference.
6292  *        &ast;/
6293  *       g_object_unref (cake);
6294  *       return;
6295  *     }
6296  *
6297  *   _baker_prepare_cake (self, radius, baked_cb, simple);
6298  * }
6299  *
6300  * Cake *
6301  * baker_bake_cake_finish (Baker        *self,
6302  *                         GAsyncResult *result,
6303  *                         GError      **error)
6304  * {
6305  *   GSimpleAsyncResult *simple;
6306  *   Cake               *cake;
6307  *
6308  *   g_return_val_if_fail (g_simple_async_result_is_valid (result,
6309  *                                                         G_OBJECT (self),
6310  *                                                         baker_bake_cake_async),
6311  *                         NULL);
6312  *
6313  *   simple = (GSimpleAsyncResult *) result;
6314  *
6315  *   if (g_simple_async_result_propagate_error (simple, error))
6316  *     return NULL;
6317  *
6318  *   cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
6319  *   return g_object_ref (cake);
6320  * }
6321  * ]|
6322  */
6323
6324
6325 /**
6326  * SECTION:gsimplepermission
6327  * @title: GSimplePermission
6328  * @short_description: A GPermission that doesn't change value
6329  *
6330  * #GSimplePermission is a trivial implementation of #GPermission that
6331  * represents a permission that is either always or never allowed.  The
6332  * value is given at construction and doesn't change.
6333  *
6334  * Calling request or release will result in errors.
6335  */
6336
6337
6338 /**
6339  * SECTION:gsocket
6340  * @short_description: Low-level socket object
6341  * @include: gio/gio.h
6342  * @see_also: #GInitable
6343  *
6344  * A #GSocket is a low-level networking primitive. It is a more or less
6345  * direct mapping of the BSD socket API in a portable GObject based API.
6346  * It supports both the UNIX socket implementations and winsock2 on Windows.
6347  *
6348  * #GSocket is the platform independent base upon which the higher level
6349  * network primitives are based. Applications are not typically meant to
6350  * use it directly, but rather through classes like #GSocketClient,
6351  * #GSocketService and #GSocketConnection. However there may be cases where
6352  * direct use of #GSocket is useful.
6353  *
6354  * #GSocket implements the #GInitable interface, so if it is manually constructed
6355  * by e.g. g_object_new() you must call g_initable_init() and check the
6356  * results before using the object. This is done automatically in
6357  * g_socket_new() and g_socket_new_from_fd(), so these functions can return
6358  * %NULL.
6359  *
6360  * Sockets operate in two general modes, blocking or non-blocking. When
6361  * in blocking mode all operations block until the requested operation
6362  * is finished or there is an error. In non-blocking mode all calls that
6363  * would block return immediately with a %G_IO_ERROR_WOULD_BLOCK error.
6364  * To know when a call would successfully run you can call g_socket_condition_check(),
6365  * or g_socket_condition_wait(). You can also use g_socket_create_source() and
6366  * attach it to a #GMainContext to get callbacks when I/O is possible.
6367  * Note that all sockets are always set to non blocking mode in the system, and
6368  * blocking mode is emulated in GSocket.
6369  *
6370  * When working in non-blocking mode applications should always be able to
6371  * handle getting a %G_IO_ERROR_WOULD_BLOCK error even when some other
6372  * function said that I/O was possible. This can easily happen in case
6373  * of a race condition in the application, but it can also happen for other
6374  * reasons. For instance, on Windows a socket is always seen as writable
6375  * until a write returns %G_IO_ERROR_WOULD_BLOCK.
6376  *
6377  * #GSocket<!-- -->s can be either connection oriented or datagram based.
6378  * For connection oriented types you must first establish a connection by
6379  * either connecting to an address or accepting a connection from another
6380  * address. For connectionless socket types the target/source address is
6381  * specified or received in each I/O operation.
6382  *
6383  * All socket file descriptors are set to be close-on-exec.
6384  *
6385  * Note that creating a #GSocket causes the signal %SIGPIPE to be
6386  * ignored for the remainder of the program. If you are writing a
6387  * command-line utility that uses #GSocket, you may need to take into
6388  * account the fact that your program will not automatically be killed
6389  * if it tries to write to %stdout after it has been closed.
6390  *
6391  * Since: 2.22
6392  */
6393
6394
6395 /**
6396  * SECTION:gsocketaddress
6397  * @short_description: Abstract base class representing endpoints for socket communication
6398  *
6399  * #GSocketAddress is the equivalent of <type>struct sockaddr</type>
6400  * in the BSD sockets API. This is an abstract class; use
6401  * #GInetSocketAddress for internet sockets, or #GUnixSocketAddress
6402  * for UNIX domain sockets.
6403  */
6404
6405
6406 /**
6407  * SECTION:gsocketclient
6408  * @short_description: Helper for connecting to a network service
6409  * @include: gio/gio.h
6410  * @see_also: #GSocketConnection, #GSocketListener
6411  *
6412  * #GSocketClient is a lightweight high-level utility class for connecting to
6413  * a network host using a connection oriented socket type.
6414  *
6415  * You create a #GSocketClient object, set any options you want, and then
6416  * call a sync or async connect operation, which returns a #GSocketConnection
6417  * subclass on success.
6418  *
6419  * The type of the #GSocketConnection object returned depends on the type of
6420  * the underlying socket that is in use. For instance, for a TCP/IP connection
6421  * it will be a #GTcpConnection.
6422  *
6423  * As #GSocketClient is a lightweight object, you don't need to cache it. You
6424  * can just create a new one any time you need one.
6425  *
6426  * Since: 2.22
6427  */
6428
6429
6430 /**
6431  * SECTION:gsocketconnectable
6432  * @short_description: Interface for potential socket endpoints
6433  *
6434  * Objects that describe one or more potential socket endpoints
6435  * implement #GSocketConnectable. Callers can then use
6436  * g_socket_connectable_enumerate() to get a #GSocketAddressEnumerator
6437  * to try out each socket address in turn until one succeeds, as shown
6438  * in the sample code below.
6439  *
6440  * |[
6441  * MyConnectionType *
6442  * connect_to_host (const char    *hostname,
6443  *                  guint16        port,
6444  *                  GCancellable  *cancellable,
6445  *                  GError       **error)
6446  * {
6447  *   MyConnection *conn = NULL;
6448  *   GSocketConnectable *addr;
6449  *   GSocketAddressEnumerator *enumerator;
6450  *   GSocketAddress *sockaddr;
6451  *   GError *conn_error = NULL;
6452  *
6453  *   addr = g_network_address_new ("www.gnome.org", 80);
6454  *   enumerator = g_socket_connectable_enumerate (addr);
6455  *   g_object_unref (addr);
6456  *
6457  *   /<!-- -->* Try each sockaddr until we succeed. Record the first
6458  *    * connection error, but not any further ones (since they'll probably
6459  *    * be basically the same as the first).
6460  *    *<!-- -->/
6461  *   while (!conn && (sockaddr = g_socket_address_enumerator_next (enumerator, cancellable, error))
6462  *     {
6463  *       conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error);
6464  *       g_object_unref (sockaddr);
6465  *     }
6466  *   g_object_unref (enumerator);
6467  *
6468  *   if (conn)
6469  *     {
6470  *       if (conn_error)
6471  *         {
6472  *           /<!-- -->* We couldn't connect to the first address, but we succeeded
6473  *            * in connecting to a later address.
6474  *            *<!-- -->/
6475  *           g_error_free (conn_error);
6476  *         }
6477  *       return conn;
6478  *     }
6479  *   else if (error)
6480  *     {
6481  *       /<!-- -->* Either the initial lookup failed, or else the caller
6482  *        * cancelled us.
6483  *        *<!-- -->/
6484  *       if (conn_error)
6485  *         g_error_free (conn_error);
6486  *       return NULL;
6487  *     }
6488  *   else
6489  *     {
6490  *       g_error_propagate (error, conn_error);
6491  *       return NULL;
6492  *     }
6493  * }
6494  * ]|
6495  */
6496
6497
6498 /**
6499  * SECTION:gsocketconnection
6500  * @short_description: A socket connection
6501  * @include: gio/gio.h
6502  * @see_also: #GIOStream, #GSocketClient, #GSocketListener
6503  *
6504  * #GSocketConnection is a #GIOStream for a connected socket. They
6505  * can be created either by #GSocketClient when connecting to a host,
6506  * or by #GSocketListener when accepting a new client.
6507  *
6508  * The type of the #GSocketConnection object returned from these calls
6509  * depends on the type of the underlying socket that is in use. For
6510  * instance, for a TCP/IP connection it will be a #GTcpConnection.
6511  *
6512  * Choosing what type of object to construct is done with the socket
6513  * connection factory, and it is possible for 3rd parties to register
6514  * custom socket connection types for specific combination of socket
6515  * family/type/protocol using g_socket_connection_factory_register_type().
6516  *
6517  * Since: 2.22
6518  */
6519
6520
6521 /**
6522  * SECTION:gsocketcontrolmessage
6523  * @title: GSocketControlMessage
6524  * @short_description: A GSocket control message
6525  * @see_also: #GSocket.
6526  *
6527  * A #GSocketControlMessage is a special-purpose utility message that
6528  * can be sent to or received from a #GSocket. These types of
6529  * messages are often called "ancillary data".
6530  *
6531  * The message can represent some sort of special instruction to or
6532  * information from the socket or can represent a special kind of
6533  * transfer to the peer (for example, sending a file description over
6534  * a UNIX socket).
6535  *
6536  * These messages are sent with g_socket_send_message() and received
6537  * with g_socket_receive_message().
6538  *
6539  * To extend the set of control message that can be sent, subclass this
6540  * class and override the get_size, get_level, get_type and serialize
6541  * methods.
6542  *
6543  * To extend the set of control messages that can be received, subclass
6544  * this class and implement the deserialize method. Also, make sure your
6545  * class is registered with the GType typesystem before calling
6546  * g_socket_receive_message() to read such a message.
6547  *
6548  * Since: 2.22
6549  */
6550
6551
6552 /**
6553  * SECTION:gsocketlistener
6554  * @title: GSocketListener
6555  * @short_description: Helper for accepting network client connections
6556  * @see_also: #GThreadedSocketService, #GSocketService.
6557  *
6558  * A #GSocketListener is an object that keeps track of a set
6559  * of server sockets and helps you accept sockets from any of the
6560  * socket, either sync or async.
6561  *
6562  * If you want to implement a network server, also look at #GSocketService
6563  * and #GThreadedSocketService which are subclass of #GSocketListener
6564  * that makes this even easier.
6565  *
6566  * Since: 2.22
6567  */
6568
6569
6570 /**
6571  * SECTION:gsocketservice
6572  * @title: GSocketService
6573  * @short_description: Make it easy to implement a network service
6574  * @see_also: #GThreadedSocketService, #GSocketListener.
6575  *
6576  * A #GSocketService is an object that represents a service that
6577  * is provided to the network or over local sockets.  When a new
6578  * connection is made to the service the #GSocketService::incoming
6579  * signal is emitted.
6580  *
6581  * A #GSocketService is a subclass of #GSocketListener and you need
6582  * to add the addresses you want to accept connections on with the
6583  * #GSocketListener APIs.
6584  *
6585  * There are two options for implementing a network service based on
6586  * #GSocketService. The first is to create the service using
6587  * g_socket_service_new() and to connect to the #GSocketService::incoming
6588  * signal. The second is to subclass #GSocketService and override the
6589  * default signal handler implementation.
6590  *
6591  * In either case, the handler must immediately return, or else it
6592  * will block additional incoming connections from being serviced.
6593  * If you are interested in writing connection handlers that contain
6594  * blocking code then see #GThreadedSocketService.
6595  *
6596  * The socket service runs on the main loop of the <link
6597  * linkend="g-main-context-push-thread-default-context">thread-default
6598  * context</link> of the thread it is created in, and is not
6599  * threadsafe in general. However, the calls to start and stop the
6600  * service are thread-safe so these can be used from threads that
6601  * handle incoming clients.
6602  *
6603  * Since: 2.22
6604  */
6605
6606
6607 /**
6608  * SECTION:gsrvtarget
6609  * @short_description: DNS SRV record target
6610  * @include: gio/gio.h
6611  *
6612  * SRV (service) records are used by some network protocols to provide
6613  * service-specific aliasing and load-balancing. For example, XMPP
6614  * (Jabber) uses SRV records to locate the XMPP server for a domain;
6615  * rather than connecting directly to "example.com" or assuming a
6616  * specific server hostname like "xmpp.example.com", an XMPP client
6617  * would look up the "xmpp-client" SRV record for "example.com", and
6618  * then connect to whatever host was pointed to by that record.
6619  *
6620  * You can use g_resolver_lookup_service() or
6621  * g_resolver_lookup_service_async() to find the #GSrvTarget<!-- -->s
6622  * for a given service. However, if you are simply planning to connect
6623  * to the remote service, you can use #GNetworkService's
6624  * #GSocketConnectable interface and not need to worry about
6625  * #GSrvTarget at all.
6626  */
6627
6628
6629 /**
6630  * SECTION:gtcpconnection
6631  * @title: GTcpConnection
6632  * @short_description: A TCP GSocketConnection
6633  * @see_also: #GSocketConnection.
6634  *
6635  * This is the subclass of #GSocketConnection that is created
6636  * for TCP/IP sockets.
6637  *
6638  * Since: 2.22
6639  */
6640
6641
6642 /**
6643  * SECTION:gtcpwrapperconnection
6644  * @title: GTcpWrapperConnection
6645  * @short_description: wrapper for non-GSocketConnection-based, GSocket-based GIOStreams
6646  * @see_also: #GSocketConnection.
6647  *
6648  * A #GTcpWrapperConnection can be used to wrap a #GIOStream that is
6649  * based on a #GSocket, but which is not actually a
6650  * #GSocketConnection. This is used by #GSocketClient so that it can
6651  * always return a #GSocketConnection, even when the connection it has
6652  * actually created is not directly a #GSocketConnection.
6653  *
6654  * Since: 2.28
6655  */
6656
6657
6658 /**
6659  * SECTION:gtestdbus
6660  * @short_description: D-Bus testing helper
6661  * @include: gio/gio.h
6662  *
6663  * Helper to test D-Bus code wihtout messing up with user' session bus.
6664  */
6665
6666
6667 /**
6668  * SECTION:gthemedicon
6669  * @short_description: Icon theming support
6670  * @include: gio/gio.h
6671  * @see_also: #GIcon, #GLoadableIcon
6672  *
6673  * #GThemedIcon is an implementation of #GIcon that supports icon themes.
6674  * #GThemedIcon contains a list of all of the icons present in an icon
6675  * theme, so that icons can be looked up quickly. #GThemedIcon does
6676  * not provide actual pixmaps for icons, just the icon names.
6677  * Ideally something like gtk_icon_theme_choose_icon() should be used to
6678  * resolve the list of names so that fallback icons work nicely with
6679  * themes that inherit other themes.
6680  */
6681
6682
6683 /**
6684  * SECTION:gthreadedsocketservice
6685  * @title: GThreadedSocketService
6686  * @short_description: A threaded GSocketService
6687  * @see_also: #GSocketService.
6688  *
6689  * A #GThreadedSocketService is a simple subclass of #GSocketService
6690  * that handles incoming connections by creating a worker thread and
6691  * dispatching the connection to it by emitting the
6692  * #GThreadedSocketService::run signal in the new thread.
6693  *
6694  * The signal handler may perform blocking IO and need not return
6695  * until the connection is closed.
6696  *
6697  * The service is implemented using a thread pool, so there is a
6698  * limited amount of threads available to serve incoming requests.
6699  * The service automatically stops the #GSocketService from accepting
6700  * new connections when all threads are busy.
6701  *
6702  * As with #GSocketService, you may connect to #GThreadedSocketService::run,
6703  * or subclass and override the default handler.
6704  */
6705
6706
6707 /**
6708  * SECTION:gtls
6709  * @title: TLS Overview
6710  * @short_description: TLS (aka SSL) support for GSocketConnection
6711  * @include: gio/gio.h
6712  *
6713  * #GTlsConnection and related classes provide TLS (Transport Layer
6714  * Security, previously known as SSL, Secure Sockets Layer) support for
6715  * gio-based network streams.
6716  *
6717  * In the simplest case, for a client connection, you can just set the
6718  * #GSocketClient:tls flag on a #GSocketClient, and then any
6719  * connections created by that client will have TLS negotiated
6720  * automatically, using appropriate default settings, and rejecting
6721  * any invalid or self-signed certificates (unless you change that
6722  * default by setting the #GSocketClient:tls-validation-flags
6723  * property). The returned object will be a #GTcpWrapperConnection,
6724  * which wraps the underlying #GTlsClientConnection.
6725  *
6726  * For greater control, you can create your own #GTlsClientConnection,
6727  * wrapping a #GSocketConnection (or an arbitrary #GIOStream with
6728  * pollable input and output streams) and then connect to its signals,
6729  * such as #GTlsConnection::accept-certificate, before starting the
6730  * handshake.
6731  *
6732  * Server-side TLS is similar, using #GTlsServerConnection. At the
6733  * moment, there is no support for automatically wrapping server-side
6734  * connections in the way #GSocketClient does for client-side
6735  * connections.
6736  */
6737
6738
6739 /**
6740  * SECTION:gtlsbackend
6741  * @title: GTlsBackend
6742  * @short_description: TLS backend implementation
6743  * @include: gio/gio.h
6744  *
6745  *
6746  */
6747
6748
6749 /**
6750  * SECTION:gtlscertificate
6751  * @title: GTlsCertificate
6752  * @short_description: TLS certificate
6753  * @see_also: #GTlsConnection
6754  *
6755  * A certificate used for TLS authentication and encryption.
6756  * This can represent either a public key only (eg, the certificate
6757  * received by a client from a server), or the combination of
6758  * a public key and a private key (which is needed when acting as a
6759  * #GTlsServerConnection).
6760  *
6761  * Since: 2.28
6762  */
6763
6764
6765 /**
6766  * SECTION:gtlsclientconnection
6767  * @short_description: TLS client-side connection
6768  * @include: gio/gio.h
6769  *
6770  * #GTlsClientConnection is the client-side subclass of
6771  * #GTlsConnection, representing a client-side TLS connection.
6772  */
6773
6774
6775 /**
6776  * SECTION:gtlsconnection
6777  * @short_description: TLS connection type
6778  * @include: gio/gio.h
6779  *
6780  * #GTlsConnection is the base TLS connection class type, which wraps
6781  * a #GIOStream and provides TLS encryption on top of it. Its
6782  * subclasses, #GTlsClientConnection and #GTlsServerConnection,
6783  * implement client-side and server-side TLS, respectively.
6784  *
6785  * Since: 2.28
6786  */
6787
6788
6789 /**
6790  * SECTION:gtlsdatabase
6791  * @short_description: TLS database type
6792  * @include: gio/gio.h
6793  *
6794  * #GTlsDatabase is used to lookup certificates and other information
6795  * from a certificate or key store. It is an abstract base class which
6796  * TLS library specific subtypes override.
6797  *
6798  * Most common client applications will not directly interact with
6799  * #GTlsDatabase. It is used internally by #GTlsConnection.
6800  *
6801  * Since: 2.30
6802  */
6803
6804
6805 /**
6806  * SECTION:gtlsfiledatabase
6807  * @short_description: TLS file based database type
6808  * @include: gio/gio.h
6809  *
6810  * #GTlsFileDatabase is implemented by #GTlsDatabase objects which load
6811  * their certificate information from a file. It is in interface which
6812  * TLS library specific subtypes implement.
6813  *
6814  * Since: 2.30
6815  */
6816
6817
6818 /**
6819  * SECTION:gtlsinteraction
6820  * @short_description: Interaction with the user during TLS operations.
6821  * @include: gio/gio.h
6822  *
6823  * #GTlsInteraction provides a mechanism for the TLS connection and database
6824  * code to interact with the user. It can be used to ask the user for passwords.
6825  *
6826  * To use a #GTlsInteraction with a TLS connection use
6827  * g_tls_connection_set_interaction().
6828  *
6829  * Callers should instantiate a derived class that implements the various
6830  * interaction methods to show the required dialogs.
6831  *
6832  * Callers should use the 'invoke' functions like
6833  * g_tls_interaction_invoke_ask_password() to run interaction methods. These
6834  * functions make sure that the interaction is invoked in the main loop
6835  * and not in the current thread, if the current thread is not running the
6836  * main loop.
6837  *
6838  * Derived classes can choose to implement whichever interactions methods they'd
6839  * like to support by overriding those virtual methods in their class
6840  * initialization function. Any interactions not implemented will return
6841  * %G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method,
6842  * it must also implement the corresponding finish method.
6843  */
6844
6845
6846 /**
6847  * SECTION:gtlspassword
6848  * @title: GTlsPassword
6849  * @short_description: TLS Passwords for prompting
6850  * @include: gio/gio.h
6851  *
6852  * Holds a password used in TLS.
6853  */
6854
6855
6856 /**
6857  * SECTION:gtlsserverconnection
6858  * @short_description: TLS server-side connection
6859  * @include: gio/gio.h
6860  *
6861  * #GTlsServerConnection is the server-side subclass of #GTlsConnection,
6862  * representing a server-side TLS connection.
6863  *
6864  * Since: 2.28
6865  */
6866
6867
6868 /**
6869  * SECTION:gunixconnection
6870  * @title: GUnixConnection
6871  * @short_description: A UNIX domain GSocketConnection
6872  * @include: gio/gunixconnection.h
6873  * @see_also: #GSocketConnection.
6874  *
6875  * This is the subclass of #GSocketConnection that is created
6876  * for UNIX domain sockets.
6877  *
6878  * It contains functions to do some of the UNIX socket specific
6879  * functionality like passing file descriptors.
6880  *
6881  * Note that <filename>&lt;gio/gunixconnection.h&gt;</filename> belongs to
6882  * the UNIX-specific GIO interfaces, thus you have to use the
6883  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6884  *
6885  * Since: 2.22
6886  */
6887
6888
6889 /**
6890  * SECTION:gunixcredentialsmessage
6891  * @title: GUnixCredentialsMessage
6892  * @short_description: A GSocketControlMessage containing credentials
6893  * @include: gio/gunixcredentialsmessage.h
6894  * @see_also: #GUnixConnection, #GSocketControlMessage
6895  *
6896  * This #GSocketControlMessage contains a #GCredentials instance.  It
6897  * may be sent using g_socket_send_message() and received using
6898  * g_socket_receive_message() over UNIX sockets (ie: sockets in the
6899  * %G_SOCKET_FAMILY_UNIX family).
6900  *
6901  * For an easier way to send and receive credentials over
6902  * stream-oriented UNIX sockets, see
6903  * g_unix_connection_send_credentials() and
6904  * g_unix_connection_receive_credentials(). To receive credentials of
6905  * a foreign process connected to a socket, use
6906  * g_socket_get_credentials().
6907  */
6908
6909
6910 /**
6911  * SECTION:gunixfdlist
6912  * @title: GUnixFDList
6913  * @short_description: An object containing a set of UNIX file descriptors
6914  * @include: gio/gunixfdlist.h
6915  * @see_also: #GUnixFDMessage
6916  *
6917  * A #GUnixFDList contains a list of file descriptors.  It owns the file
6918  * descriptors that it contains, closing them when finalized.
6919  *
6920  * It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in
6921  * the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message()
6922  * and received using g_socket_receive_message().
6923  *
6924  * Note that <filename>&lt;gio/gunixfdlist.h&gt;</filename> belongs to
6925  * the UNIX-specific GIO interfaces, thus you have to use the
6926  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6927  */
6928
6929
6930 /**
6931  * SECTION:gunixfdmessage
6932  * @title: GUnixFDMessage
6933  * @short_description: A GSocketControlMessage containing a GUnixFDList
6934  * @include: gio/gunixfdmessage.h
6935  * @see_also: #GUnixConnection, #GUnixFDList, #GSocketControlMessage
6936  *
6937  * This #GSocketControlMessage contains a #GUnixFDList.
6938  * It may be sent using g_socket_send_message() and received using
6939  * g_socket_receive_message() over UNIX sockets (ie: sockets in the
6940  * %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied
6941  * between processes by the kernel.
6942  *
6943  * For an easier way to send and receive file descriptors over
6944  * stream-oriented UNIX sockets, see g_unix_connection_send_fd() and
6945  * g_unix_connection_receive_fd().
6946  *
6947  * Note that <filename>&lt;gio/gunixfdmessage.h&gt;</filename> belongs to
6948  * the UNIX-specific GIO interfaces, thus you have to use the
6949  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6950  */
6951
6952
6953 /**
6954  * SECTION:gunixinputstream
6955  * @short_description: Streaming input operations for UNIX file descriptors
6956  * @include: gio/gunixinputstream.h
6957  * @see_also: #GInputStream
6958  *
6959  * #GUnixInputStream implements #GInputStream for reading from a UNIX
6960  * file descriptor, including asynchronous operations. (If the file
6961  * descriptor refers to a socket or pipe, this will use poll() to do
6962  * asynchronous I/O. If it refers to a regular file, it will fall back
6963  * to doing asynchronous I/O in another thread.)
6964  *
6965  * Note that <filename>&lt;gio/gunixinputstream.h&gt;</filename> belongs
6966  * to the UNIX-specific GIO interfaces, thus you have to use the
6967  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6968  */
6969
6970
6971 /**
6972  * SECTION:gunixmounts
6973  * @include: gio/gunixmounts.h
6974  * @short_description: UNIX mounts
6975  *
6976  * Routines for managing mounted UNIX mount points and paths.
6977  *
6978  * Note that <filename>&lt;gio/gunixmounts.h&gt;</filename> belongs to the
6979  * UNIX-specific GIO interfaces, thus you have to use the
6980  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6981  */
6982
6983
6984 /**
6985  * SECTION:gunixoutputstream
6986  * @short_description: Streaming output operations for UNIX file descriptors
6987  * @include: gio/gunixoutputstream.h
6988  * @see_also: #GOutputStream
6989  *
6990  * #GUnixOutputStream implements #GOutputStream for writing to a UNIX
6991  * file descriptor, including asynchronous operations. (If the file
6992  * descriptor refers to a socket or pipe, this will use poll() to do
6993  * asynchronous I/O. If it refers to a regular file, it will fall back
6994  * to doing asynchronous I/O in another thread.)
6995  *
6996  * Note that <filename>&lt;gio/gunixoutputstream.h&gt;</filename> belongs
6997  * to the UNIX-specific GIO interfaces, thus you have to use the
6998  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
6999  */
7000
7001
7002 /**
7003  * SECTION:gunixsocketaddress
7004  * @short_description: UNIX GSocketAddress
7005  * @include: gio/gunixsocketaddress.h
7006  *
7007  * Support for UNIX-domain (also known as local) sockets.
7008  *
7009  * UNIX domain sockets are generally visible in the filesystem.
7010  * However, some systems support abstract socket names which are not
7011  * visible in the filesystem and not affected by the filesystem
7012  * permissions, visibility, etc. Currently this is only supported
7013  * under Linux. If you attempt to use abstract sockets on other
7014  * systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED
7015  * errors. You can use g_unix_socket_address_abstract_names_supported()
7016  * to see if abstract names are supported.
7017  *
7018  * Note that <filename>&lt;gio/gunixsocketaddress.h&gt;</filename> belongs to
7019  * the UNIX-specific GIO interfaces, thus you have to use the
7020  * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7021  */
7022
7023
7024 /**
7025  * SECTION:gvfs
7026  * @short_description: Virtual File System
7027  * @include: gio/gio.h
7028  *
7029  * Entry point for using GIO functionality.
7030  */
7031
7032
7033 /**
7034  * SECTION:gvolume
7035  * @short_description: Volume management
7036  * @include: gio/gio.h
7037  *
7038  * The #GVolume interface represents user-visible objects that can be
7039  * mounted. Note, when porting from GnomeVFS, #GVolume is the moral
7040  * equivalent of #GnomeVFSDrive.
7041  *
7042  * Mounting a #GVolume instance is an asynchronous operation. For more
7043  * information about asynchronous operations, see #GAsyncResult and
7044  * #GSimpleAsyncResult. To mount a #GVolume, first call
7045  * g_volume_mount() with (at least) the #GVolume instance, optionally
7046  * a #GMountOperation object and a #GAsyncReadyCallback.
7047  *
7048  * Typically, one will only want to pass %NULL for the
7049  * #GMountOperation if automounting all volumes when a desktop session
7050  * starts since it's not desirable to put up a lot of dialogs asking
7051  * for credentials.
7052  *
7053  * The callback will be fired when the operation has resolved (either
7054  * with success or failure), and a #GAsyncReady structure will be
7055  * passed to the callback.  That callback should then call
7056  * g_volume_mount_finish() with the #GVolume instance and the
7057  * #GAsyncReady data to see if the operation was completed
7058  * successfully.  If an @error is present when g_volume_mount_finish()
7059  * is called, then it will be filled with any error information.
7060  *
7061  * <para id="volume-identifier">
7062  * It is sometimes necessary to directly access the underlying
7063  * operating system object behind a volume (e.g. for passing a volume
7064  * to an application via the commandline). For this purpose, GIO
7065  * allows to obtain an 'identifier' for the volume. There can be
7066  * different kinds of identifiers, such as Hal UDIs, filesystem labels,
7067  * traditional Unix devices (e.g. <filename>/dev/sda2</filename>),
7068  * uuids. GIO uses predefind strings as names for the different kinds
7069  * of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI,
7070  * #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier()
7071  * to obtain an identifier for a volume.
7072  * </para>
7073  *
7074  * Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
7075  * when the gvfs hal volume monitor is in use. Other volume monitors
7076  * will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
7077  * identifier, which can be used to obtain a hal device by means of
7078  * libhal_manager_find_device_string_match().
7079  */
7080
7081
7082 /**
7083  * SECTION:gvolumemonitor
7084  * @short_description: Volume Monitor
7085  * @include: gio/gio.h
7086  * @see_also: #GFileMonitor
7087  *
7088  * #GVolumeMonitor is for listing the user interesting devices and volumes
7089  * on the computer. In other words, what a file selector or file manager
7090  * would show in a sidebar.
7091  *
7092  * #GVolumeMonitor is not <link
7093  * linkend="g-main-context-push-thread-default">thread-default-context
7094  * aware</link>, and so should not be used other than from the main
7095  * thread, with no thread-default-context active.
7096  */
7097
7098
7099 /**
7100  * SECTION:gwin32inputstream
7101  * @short_description: Streaming input operations for Windows file handles
7102  * @include: gio/gwin32inputstream.h
7103  * @see_also: #GInputStream
7104  *
7105  * #GWin32InputStream implements #GInputStream for reading from a
7106  * Windows file handle.
7107  *
7108  * Note that <filename>&lt;gio/gwin32inputstream.h&gt;</filename> belongs
7109  * to the Windows-specific GIO interfaces, thus you have to use the
7110  * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7111  */
7112
7113
7114 /**
7115  * SECTION:gwin32outputstream
7116  * @short_description: Streaming output operations for Windows file handles
7117  * @include: gio/gwin32outputstream.h
7118  * @see_also: #GOutputStream
7119  *
7120  * #GWin32OutputStream implements #GOutputStream for writing to a
7121  * Windows file handle.
7122  *
7123  * Note that <filename>&lt;gio/gwin32outputstream.h&gt;</filename> belongs
7124  * to the Windows-specific GIO interfaces, thus you have to use the
7125  * <filename>gio-windows-2.0.pc</filename> pkg-config file when using it.
7126  */
7127
7128
7129 /**
7130  * SECTION:gzcompressor
7131  * @short_description: Zlib compressor
7132  * @include: gio/gio.h
7133  *
7134  * #GZlibCompressor is an implementation of #GConverter that
7135  * compresses data using zlib.
7136  */
7137
7138
7139 /**
7140  * SECTION:gzdecompressor
7141  * @short_description: Zlib decompressor
7142  * @include: gio/gio.h
7143  *
7144  * #GZlibDecompressor is an implementation of #GConverter that
7145  * decompresses data compressed with zlib.
7146  */
7147
7148
7149 /**
7150  * _g_io_module_get_default:
7151  * @extension_point: the name of an extension point
7152  * @envvar: (allow-none): the name of an environment variable to override the default implementation.
7153  * @verify_func: (allow-none): a function to call to verify that a given implementation is usable in the current environment.
7154  *
7155  * Retrieves the default object implementing @extension_point.
7156  *
7157  * If @envvar is not %NULL, and the environment variable with that
7158  * name is set, then the implementation it specifies will be tried
7159  * first. After that, or if @envvar is not set, all other
7160  * implementations will be tried in order of decreasing priority.
7161  *
7162  * If an extension point implementation implements #GInitable, then
7163  * that implementation will only be used if it initializes
7164  * successfully. Otherwise, if @verify_func is not %NULL, then it will
7165  * be called on each candidate implementation after construction, to
7166  * check if it is actually usable or not.
7167  *
7168  * The result is cached after it is generated the first time, and
7169  * the function is thread-safe.
7170  *
7171  * Returns: (transfer none): an object implementing @extension_point, or %NULL if there are no usable implementations.
7172  */
7173
7174
7175 /**
7176  * g_action_activate:
7177  * @action: a #GAction
7178  * @parameter: (allow-none): the parameter to the activation
7179  *
7180  * Activates the action.
7181  *
7182  * @parameter must be the correct type of parameter for the action (ie:
7183  * the parameter type given at construction time).  If the parameter
7184  * type was %NULL then @parameter must also be %NULL.
7185  *
7186  * Since: 2.28
7187  */
7188
7189
7190 /**
7191  * g_action_change_state:
7192  * @action: a #GAction
7193  * @value: the new state
7194  *
7195  * Request for the state of @action to be changed to @value.
7196  *
7197  * The action must be stateful and @value must be of the correct type.
7198  * See g_action_get_state_type().
7199  *
7200  * This call merely requests a change.  The action may refuse to change
7201  * its state or may change its state to something other than @value.
7202  * See g_action_get_state_hint().
7203  *
7204  * If the @value GVariant is floating, it is consumed.
7205  *
7206  * Since: 2.30
7207  */
7208
7209
7210 /**
7211  * g_action_get_enabled:
7212  * @action: a #GAction
7213  *
7214  * Checks if @action is currently enabled.
7215  *
7216  * An action must be enabled in order to be activated or in order to
7217  * have its state changed from outside callers.
7218  *
7219  * Returns: whether the action is enabled
7220  * Since: 2.28
7221  */
7222
7223
7224 /**
7225  * g_action_get_name:
7226  * @action: a #GAction
7227  *
7228  * Queries the name of @action.
7229  *
7230  * Returns: the name of the action
7231  * Since: 2.28
7232  */
7233
7234
7235 /**
7236  * g_action_get_parameter_type:
7237  * @action: a #GAction
7238  *
7239  * Queries the type of the parameter that must be given when activating
7240  * @action.
7241  *
7242  * When activating the action using g_action_activate(), the #GVariant
7243  * given to that function must be of the type returned by this function.
7244  *
7245  * In the case that this function returns %NULL, you must not give any
7246  * #GVariant, but %NULL instead.
7247  *
7248  * Returns: (allow-none): the parameter type
7249  * Since: 2.28
7250  */
7251
7252
7253 /**
7254  * g_action_get_state:
7255  * @action: a #GAction
7256  *
7257  * Queries the current state of @action.
7258  *
7259  * If the action is not stateful then %NULL will be returned.  If the
7260  * action is stateful then the type of the return value is the type
7261  * given by g_action_get_state_type().
7262  *
7263  * The return value (if non-%NULL) should be freed with
7264  * g_variant_unref() when it is no longer required.
7265  *
7266  * Returns: (transfer full): the current state of the action
7267  * Since: 2.28
7268  */
7269
7270
7271 /**
7272  * g_action_get_state_hint:
7273  * @action: a #GAction
7274  *
7275  * Requests a hint about the valid range of values for the state of
7276  * @action.
7277  *
7278  * If %NULL is returned it either means that the action is not stateful
7279  * or that there is no hint about the valid range of values for the
7280  * state of the action.
7281  *
7282  * If a #GVariant array is returned then each item in the array is a
7283  * possible value for the state.  If a #GVariant pair (ie: two-tuple) is
7284  * returned then the tuple specifies the inclusive lower and upper bound
7285  * of valid values for the state.
7286  *
7287  * In any case, the information is merely a hint.  It may be possible to
7288  * have a state value outside of the hinted range and setting a value
7289  * within the range may fail.
7290  *
7291  * The return value (if non-%NULL) should be freed with
7292  * g_variant_unref() when it is no longer required.
7293  *
7294  * Returns: (transfer full): the state range hint
7295  * Since: 2.28
7296  */
7297
7298
7299 /**
7300  * g_action_get_state_type:
7301  * @action: a #GAction
7302  *
7303  * Queries the type of the state of @action.
7304  *
7305  * If the action is stateful (e.g. created with
7306  * g_simple_action_new_stateful()) then this function returns the
7307  * #GVariantType of the state.  This is the type of the initial value
7308  * given as the state. All calls to g_action_change_state() must give a
7309  * #GVariant of this type and g_action_get_state() will return a
7310  * #GVariant of the same type.
7311  *
7312  * If the action is not stateful (e.g. created with g_simple_action_new())
7313  * then this function will return %NULL. In that case, g_action_get_state()
7314  * will return %NULL and you must not call g_action_change_state().
7315  *
7316  * Returns: (allow-none): the state type, if the action is stateful
7317  * Since: 2.28
7318  */
7319
7320
7321 /**
7322  * g_action_group_action_added:
7323  * @action_group: a #GActionGroup
7324  * @action_name: the name of an action in the group
7325  *
7326  * Emits the #GActionGroup::action-added signal on @action_group.
7327  *
7328  * This function should only be called by #GActionGroup implementations.
7329  *
7330  * Since: 2.28
7331  */
7332
7333
7334 /**
7335  * g_action_group_action_enabled_changed:
7336  * @action_group: a #GActionGroup
7337  * @action_name: the name of an action in the group
7338  * @enabled: whether or not the action is now enabled
7339  *
7340  * Emits the #GActionGroup::action-enabled-changed signal on @action_group.
7341  *
7342  * This function should only be called by #GActionGroup implementations.
7343  *
7344  * Since: 2.28
7345  */
7346
7347
7348 /**
7349  * g_action_group_action_removed:
7350  * @action_group: a #GActionGroup
7351  * @action_name: the name of an action in the group
7352  *
7353  * Emits the #GActionGroup::action-removed signal on @action_group.
7354  *
7355  * This function should only be called by #GActionGroup implementations.
7356  *
7357  * Since: 2.28
7358  */
7359
7360
7361 /**
7362  * g_action_group_action_state_changed:
7363  * @action_group: a #GActionGroup
7364  * @action_name: the name of an action in the group
7365  * @state: the new state of the named action
7366  *
7367  * Emits the #GActionGroup::action-state-changed signal on @action_group.
7368  *
7369  * This function should only be called by #GActionGroup implementations.
7370  *
7371  * Since: 2.28
7372  */
7373
7374
7375 /**
7376  * g_action_group_activate_action:
7377  * @action_group: a #GActionGroup
7378  * @action_name: the name of the action to activate
7379  * @parameter: (allow-none): parameters to the activation
7380  *
7381  * Activate the named action within @action_group.
7382  *
7383  * If the action is expecting a parameter, then the correct type of
7384  * parameter must be given as @parameter.  If the action is expecting no
7385  * parameters then @parameter must be %NULL.  See
7386  * g_action_group_get_action_parameter_type().
7387  *
7388  * Since: 2.28
7389  */
7390
7391
7392 /**
7393  * g_action_group_change_action_state:
7394  * @action_group: a #GActionGroup
7395  * @action_name: the name of the action to request the change on
7396  * @value: the new state
7397  *
7398  * Request for the state of the named action within @action_group to be
7399  * changed to @value.
7400  *
7401  * The action must be stateful and @value must be of the correct type.
7402  * See g_action_group_get_action_state_type().
7403  *
7404  * This call merely requests a change.  The action may refuse to change
7405  * its state or may change its state to something other than @value.
7406  * See g_action_group_get_action_state_hint().
7407  *
7408  * If the @value GVariant is floating, it is consumed.
7409  *
7410  * Since: 2.28
7411  */
7412
7413
7414 /**
7415  * g_action_group_get_action_enabled:
7416  * @action_group: a #GActionGroup
7417  * @action_name: the name of the action to query
7418  *
7419  * Checks if the named action within @action_group is currently enabled.
7420  *
7421  * An action must be enabled in order to be activated or in order to
7422  * have its state changed from outside callers.
7423  *
7424  * Returns: whether or not the action is currently enabled
7425  * Since: 2.28
7426  */
7427
7428
7429 /**
7430  * g_action_group_get_action_parameter_type:
7431  * @action_group: a #GActionGroup
7432  * @action_name: the name of the action to query
7433  *
7434  * Queries the type of the parameter that must be given when activating
7435  * the named action within @action_group.
7436  *
7437  * When activating the action using g_action_group_activate_action(),
7438  * the #GVariant given to that function must be of the type returned
7439  * by this function.
7440  *
7441  * In the case that this function returns %NULL, you must not give any
7442  * #GVariant, but %NULL instead.
7443  *
7444  * The parameter type of a particular action will never change but it is
7445  * possible for an action to be removed and for a new action to be added
7446  * with the same name but a different parameter type.
7447  *
7448  * Returns: the parameter type
7449  * Since: 2.28
7450  */
7451
7452
7453 /**
7454  * g_action_group_get_action_state:
7455  * @action_group: a #GActionGroup
7456  * @action_name: the name of the action to query
7457  *
7458  * Queries the current state of the named action within @action_group.
7459  *
7460  * If the action is not stateful then %NULL will be returned.  If the
7461  * action is stateful then the type of the return value is the type
7462  * given by g_action_group_get_action_state_type().
7463  *
7464  * The return value (if non-%NULL) should be freed with
7465  * g_variant_unref() when it is no longer required.
7466  *
7467  * Returns: (allow-none): the current state of the action
7468  * Since: 2.28
7469  */
7470
7471
7472 /**
7473  * g_action_group_get_action_state_hint:
7474  * @action_group: a #GActionGroup
7475  * @action_name: the name of the action to query
7476  *
7477  * Requests a hint about the valid range of values for the state of the
7478  * named action within @action_group.
7479  *
7480  * If %NULL is returned it either means that the action is not stateful
7481  * or that there is no hint about the valid range of values for the
7482  * state of the action.
7483  *
7484  * If a #GVariant array is returned then each item in the array is a
7485  * possible value for the state.  If a #GVariant pair (ie: two-tuple) is
7486  * returned then the tuple specifies the inclusive lower and upper bound
7487  * of valid values for the state.
7488  *
7489  * In any case, the information is merely a hint.  It may be possible to
7490  * have a state value outside of the hinted range and setting a value
7491  * within the range may fail.
7492  *
7493  * The return value (if non-%NULL) should be freed with
7494  * g_variant_unref() when it is no longer required.
7495  *
7496  * Returns: (transfer full): the state range hint
7497  * Since: 2.28
7498  */
7499
7500
7501 /**
7502  * g_action_group_get_action_state_type:
7503  * @action_group: a #GActionGroup
7504  * @action_name: the name of the action to query
7505  *
7506  * Queries the type of the state of the named action within
7507  * @action_group.
7508  *
7509  * If the action is stateful then this function returns the
7510  * #GVariantType of the state.  All calls to
7511  * g_action_group_change_action_state() must give a #GVariant of this
7512  * type and g_action_group_get_action_state() will return a #GVariant
7513  * of the same type.
7514  *
7515  * If the action is not stateful then this function will return %NULL.
7516  * In that case, g_action_group_get_action_state() will return %NULL
7517  * and you must not call g_action_group_change_action_state().
7518  *
7519  * The state type of a particular action will never change but it is
7520  * possible for an action to be removed and for a new action to be added
7521  * with the same name but a different state type.
7522  *
7523  * Returns: (transfer full): the state type, if the action is stateful
7524  * Since: 2.28
7525  */
7526
7527
7528 /**
7529  * g_action_group_has_action:
7530  * @action_group: a #GActionGroup
7531  * @action_name: the name of the action to check for
7532  *
7533  * Checks if the named action exists within @action_group.
7534  *
7535  * Returns: whether the named action exists
7536  * Since: 2.28
7537  */
7538
7539
7540 /**
7541  * g_action_group_list_actions:
7542  * @action_group: a #GActionGroup
7543  *
7544  * Lists the actions contained within @action_group.
7545  *
7546  * The caller is responsible for freeing the list with g_strfreev() when
7547  * it is no longer required.
7548  *
7549  * Returns: (transfer full): a %NULL-terminated array of the names of the actions in the groupb
7550  * Since: 2.28
7551  */
7552
7553
7554 /**
7555  * g_action_group_query_action:
7556  * @action_group: a #GActionGroup
7557  * @action_name: the name of an action in the group
7558  * @enabled: (out): if the action is presently enabled
7559  * @parameter_type: (out) (allow-none): the parameter type, or %NULL if none needed
7560  * @state_type: (out) (allow-none): the state type, or %NULL if stateless
7561  * @state_hint: (out) (allow-none): the state hint, or %NULL if none
7562  * @state: (out) (allow-none): the current state, or %NULL if stateless
7563  *
7564  * Queries all aspects of the named action within an @action_group.
7565  *
7566  * This function acquires the information available from
7567  * g_action_group_has_action(), g_action_group_get_action_enabled(),
7568  * g_action_group_get_action_parameter_type(),
7569  * g_action_group_get_action_state_type(),
7570  * g_action_group_get_action_state_hint() and
7571  * g_action_group_get_action_state() with a single function call.
7572  *
7573  * This provides two main benefits.
7574  *
7575  * The first is the improvement in efficiency that comes with not having
7576  * to perform repeated lookups of the action in order to discover
7577  * different things about it.  The second is that implementing
7578  * #GActionGroup can now be done by only overriding this one virtual
7579  * function.
7580  *
7581  * The interface provides a default implementation of this function that
7582  * calls the individual functions, as required, to fetch the
7583  * information.  The interface also provides default implementations of
7584  * those functions that call this function.  All implementations,
7585  * therefore, must override either this function or all of the others.
7586  *
7587  * If the action exists, %TRUE is returned and any of the requested
7588  * fields (as indicated by having a non-%NULL reference passed in) are
7589  * filled.  If the action doesn't exist, %FALSE is returned and the
7590  * fields may or may not have been modified.
7591  *
7592  * Returns: %TRUE if the action exists, else %FALSE
7593  * Since: 2.32
7594  */
7595
7596
7597 /**
7598  * g_action_map_add_action:
7599  * @action_map: a #GActionMap
7600  * @action: a #GAction
7601  *
7602  * Adds an action to the @action_map.
7603  *
7604  * If the action map already contains an action with the same name
7605  * as @action then the old action is dropped from the action map.
7606  *
7607  * The action map takes its own reference on @action.
7608  *
7609  * Since: 2.32
7610  */
7611
7612
7613 /**
7614  * g_action_map_add_action_entries:
7615  * @action_map: a #GActionMap
7616  * @entries: a pointer to the first item in an array of #GActionEntry structs
7617  * @n_entries: the length of @entries, or -1 if @entries is %NULL-terminated
7618  * @user_data: the user data for signal connections
7619  *
7620  * A convenience function for creating multiple #GSimpleAction instances
7621  * and adding them to a #GActionMap.
7622  *
7623  * Each action is constructed as per one #GActionEntry.
7624  *
7625  * <example>
7626  * <title>Using g_action_map_add_action_entries()</title>
7627  * <programlisting>
7628  * static void
7629  * activate_quit (GSimpleAction *simple,
7630  *                GVariant      *parameter,
7631  *                gpointer       user_data)
7632  * {
7633  *   exit (0);
7634  * }
7635  *
7636  * static void
7637  * activate_print_string (GSimpleAction *simple,
7638  *                        GVariant      *parameter,
7639  *                        gpointer       user_data)
7640  * {
7641  *   g_print ("%s\n", g_variant_get_string (parameter, NULL));
7642  * }
7643  *
7644  * static GActionGroup *
7645  * create_action_group (void)
7646  * {
7647  *   const GActionEntry entries[] = {
7648  *     { "quit",         activate_quit              },
7649  *     { "print-string", activate_print_string, "s" }
7650  *   };
7651  *   GSimpleActionGroup *group;
7652  *
7653  *   group = g_simple_action_group_new ();
7654  *   g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
7655  *
7656  *   return G_ACTION_GROUP (group);
7657  * }
7658  * </programlisting>
7659  * </example>
7660  *
7661  * Since: 2.32
7662  */
7663
7664
7665 /**
7666  * g_action_map_lookup_action:
7667  * @action_map: a #GActionMap
7668  * @action_name: the name of an action
7669  *
7670  * Looks up the action with the name @action_name in @action_map.
7671  *
7672  * If no such action exists, returns %NULL.
7673  *
7674  * Returns: (transfer none): a #GAction, or %NULL
7675  * Since: 2.32
7676  */
7677
7678
7679 /**
7680  * g_action_map_remove_action:
7681  * @action_map: a #GActionMap
7682  * @action_name: the name of the action
7683  *
7684  * Removes the named action from the action map.
7685  *
7686  * If no action of this name is in the map then nothing happens.
7687  *
7688  * Since: 2.32
7689  */
7690
7691
7692 /**
7693  * g_app_info_add_supports_type:
7694  * @appinfo: a #GAppInfo.
7695  * @content_type: a string.
7696  * @error: a #GError.
7697  *
7698  * Adds a content type to the application information to indicate the
7699  * application is capable of opening files with the given content type.
7700  *
7701  * Returns: %TRUE on success, %FALSE on error.
7702  */
7703
7704
7705 /**
7706  * g_app_info_can_delete:
7707  * @appinfo: a #GAppInfo
7708  *
7709  * Obtains the information whether the #GAppInfo can be deleted.
7710  * See g_app_info_delete().
7711  *
7712  * Returns: %TRUE if @appinfo can be deleted
7713  * Since: 2.20
7714  */
7715
7716
7717 /**
7718  * g_app_info_can_remove_supports_type:
7719  * @appinfo: a #GAppInfo.
7720  *
7721  * Checks if a supported content type can be removed from an application.
7722  *
7723  * Returns: %TRUE if it is possible to remove supported content types from a given @appinfo, %FALSE if not.
7724  */
7725
7726
7727 /**
7728  * g_app_info_create_from_commandline:
7729  * @commandline: the commandline to use
7730  * @application_name: (allow-none): the application name, or %NULL to use @commandline
7731  * @flags: flags that can specify details of the created #GAppInfo
7732  * @error: a #GError location to store the error occurring, %NULL to ignore.
7733  *
7734  * Creates a new #GAppInfo from the given information.
7735  *
7736  * Returns: (transfer full): new #GAppInfo for given command.
7737  */
7738
7739
7740 /**
7741  * g_app_info_delete:
7742  * @appinfo: a #GAppInfo
7743  *
7744  * Tries to delete a #GAppInfo.
7745  *
7746  * On some platforms, there may be a difference between user-defined
7747  * #GAppInfo<!-- -->s which can be deleted, and system-wide ones which
7748  * cannot. See g_app_info_can_delete().
7749  *
7750  * Virtual: do_delete
7751  * Returns: %TRUE if @appinfo has been deleted
7752  * Since: 2.20
7753  */
7754
7755
7756 /**
7757  * g_app_info_dup:
7758  * @appinfo: a #GAppInfo.
7759  *
7760  * Creates a duplicate of a #GAppInfo.
7761  *
7762  * Returns: (transfer full): a duplicate of @appinfo.
7763  */
7764
7765
7766 /**
7767  * g_app_info_equal:
7768  * @appinfo1: the first #GAppInfo.
7769  * @appinfo2: the second #GAppInfo.
7770  *
7771  * Checks if two #GAppInfo<!-- -->s are equal.
7772  *
7773  * Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
7774  */
7775
7776
7777 /**
7778  * g_app_info_get_all:
7779  *
7780  * Gets a list of all of the applications currently registered
7781  * on this system.
7782  *
7783  * For desktop files, this includes applications that have
7784  * <literal>NoDisplay=true</literal> set or are excluded from
7785  * display by means of <literal>OnlyShowIn</literal> or
7786  * <literal>NotShowIn</literal>. See g_app_info_should_show().
7787  * The returned list does not include applications which have
7788  * the <literal>Hidden</literal> key set.
7789  *
7790  * Returns: (element-type GAppInfo) (transfer full): a newly allocated #GList of references to #GAppInfo<!---->s.
7791  */
7792
7793
7794 /**
7795  * g_app_info_get_all_for_type:
7796  * @content_type: the content type to find a #GAppInfo for
7797  *
7798  * Gets a list of all #GAppInfos for a given content type,
7799  * including the recommended and fallback #GAppInfos. See
7800  * g_app_info_get_recommended_for_type() and
7801  * g_app_info_get_fallback_for_type().
7802  *
7803  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
7804  */
7805
7806
7807 /**
7808  * g_app_info_get_commandline:
7809  * @appinfo: a #GAppInfo
7810  *
7811  * Gets the commandline with which the application will be
7812  * started.
7813  *
7814  * Returns: a string containing the @appinfo's commandline, or %NULL if this information is not available
7815  * Since: 2.20
7816  */
7817
7818
7819 /**
7820  * g_app_info_get_default_for_type:
7821  * @content_type: the content type to find a #GAppInfo for
7822  * @must_support_uris: if %TRUE, the #GAppInfo is expected to support URIs
7823  *
7824  * Gets the default #GAppInfo for a given content type.
7825  *
7826  * Returns: (transfer full): #GAppInfo for given @content_type or %NULL on error.
7827  */
7828
7829
7830 /**
7831  * g_app_info_get_default_for_uri_scheme:
7832  * @uri_scheme: a string containing a URI scheme.
7833  *
7834  * Gets the default application for handling URIs with
7835  * the given URI scheme. A URI scheme is the initial part
7836  * of the URI, up to but not including the ':', e.g. "http",
7837  * "ftp" or "sip".
7838  *
7839  * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
7840  */
7841
7842
7843 /**
7844  * g_app_info_get_description:
7845  * @appinfo: a #GAppInfo.
7846  *
7847  * Gets a human-readable description of an installed application.
7848  *
7849  * Returns: a string containing a description of the application @appinfo, or %NULL if none.
7850  */
7851
7852
7853 /**
7854  * g_app_info_get_display_name:
7855  * @appinfo: a #GAppInfo.
7856  *
7857  * Gets the display name of the application. The display name is often more
7858  * descriptive to the user than the name itself.
7859  *
7860  * Returns: the display name of the application for @appinfo, or the name if no display name is available.
7861  * Since: 2.24
7862  */
7863
7864
7865 /**
7866  * g_app_info_get_executable:
7867  * @appinfo: a #GAppInfo
7868  *
7869  * Gets the executable's name for the installed application.
7870  *
7871  * Returns: a string containing the @appinfo's application binaries name
7872  */
7873
7874
7875 /**
7876  * g_app_info_get_fallback_for_type:
7877  * @content_type: the content type to find a #GAppInfo for
7878  *
7879  * Gets a list of fallback #GAppInfos for a given content type, i.e.
7880  * those applications which claim to support the given content type
7881  * by MIME type subclassing and not directly.
7882  *
7883  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
7884  * Since: 2.28
7885  */
7886
7887
7888 /**
7889  * g_app_info_get_icon:
7890  * @appinfo: a #GAppInfo.
7891  *
7892  * Gets the icon for the application.
7893  *
7894  * Returns: (transfer none): the default #GIcon for @appinfo or %NULL if there is no default icon.
7895  */
7896
7897
7898 /**
7899  * g_app_info_get_id:
7900  * @appinfo: a #GAppInfo.
7901  *
7902  * Gets the ID of an application. An id is a string that
7903  * identifies the application. The exact format of the id is
7904  * platform dependent. For instance, on Unix this is the
7905  * desktop file id from the xdg menu specification.
7906  *
7907  * Note that the returned ID may be %NULL, depending on how
7908  * the @appinfo has been constructed.
7909  *
7910  * Returns: a string containing the application's ID.
7911  */
7912
7913
7914 /**
7915  * g_app_info_get_name:
7916  * @appinfo: a #GAppInfo.
7917  *
7918  * Gets the installed name of the application.
7919  *
7920  * Returns: the name of the application for @appinfo.
7921  */
7922
7923
7924 /**
7925  * g_app_info_get_recommended_for_type:
7926  * @content_type: the content type to find a #GAppInfo for
7927  *
7928  * Gets a list of recommended #GAppInfos for a given content type, i.e.
7929  * those applications which claim to support the given content type exactly,
7930  * and not by MIME type subclassing.
7931  * Note that the first application of the list is the last used one, i.e.
7932  * the last one for which g_app_info_set_as_last_used_for_type() has been
7933  * called.
7934  *
7935  * Returns: (element-type GAppInfo) (transfer full): #GList of #GAppInfos for given @content_type or %NULL on error.
7936  * Since: 2.28
7937  */
7938
7939
7940 /**
7941  * g_app_info_launch:
7942  * @appinfo: a #GAppInfo
7943  * @files: (element-type GFile): a #GList of #GFile objects
7944  * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
7945  * @error: a #GError
7946  *
7947  * Launches the application. Passes @files to the launched application
7948  * as arguments, using the optional @launch_context to get information
7949  * about the details of the launcher (like what screen it is on).
7950  * On error, @error will be set accordingly.
7951  *
7952  * To launch the application without arguments pass a %NULL @files list.
7953  *
7954  * Note that even if the launch is successful the application launched
7955  * can fail to start if it runs into problems during startup. There is
7956  * no way to detect this.
7957  *
7958  * Some URIs can be changed when passed through a GFile (for instance
7959  * unsupported URIs with strange formats like mailto:), so if you have
7960  * a textual URI you want to pass in as argument, consider using
7961  * g_app_info_launch_uris() instead.
7962  *
7963  * The launched application inherits the environment of the launching
7964  * process, but it can be modified with g_app_launch_context_setenv() and
7965  * g_app_launch_context_unsetenv().
7966  *
7967  * On UNIX, this function sets the <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>
7968  * environment variable with the path of the launched desktop file and
7969  * <envar>GIO_LAUNCHED_DESKTOP_FILE_PID</envar> to the process
7970  * id of the launched process. This can be used to ignore
7971  * <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>, should it be inherited
7972  * by further processes. The <envar>DISPLAY</envar> and
7973  * <envar>DESKTOP_STARTUP_ID</envar> environment variables are also
7974  * set, based on information provided in @launch_context.
7975  *
7976  * Returns: %TRUE on successful launch, %FALSE otherwise.
7977  */
7978
7979
7980 /**
7981  * g_app_info_launch_default_for_uri:
7982  * @uri: the uri to show
7983  * @launch_context: (allow-none): an optional #GAppLaunchContext.
7984  * @error: a #GError.
7985  *
7986  * Utility function that launches the default application
7987  * registered to handle the specified uri. Synchronous I/O
7988  * is done on the uri to detect the type of the file if
7989  * required.
7990  *
7991  * Returns: %TRUE on success, %FALSE on error.
7992  */
7993
7994
7995 /**
7996  * g_app_info_launch_uris:
7997  * @appinfo: a #GAppInfo
7998  * @uris: (element-type utf8): a #GList containing URIs to launch.
7999  * @launch_context: (allow-none): a #GAppLaunchContext or %NULL
8000  * @error: a #GError
8001  *
8002  * Launches the application. This passes the @uris to the launched application
8003  * as arguments, using the optional @launch_context to get information
8004  * about the details of the launcher (like what screen it is on).
8005  * On error, @error will be set accordingly.
8006  *
8007  * To launch the application without arguments pass a %NULL @uris list.
8008  *
8009  * Note that even if the launch is successful the application launched
8010  * can fail to start if it runs into problems during startup. There is
8011  * no way to detect this.
8012  *
8013  * Returns: %TRUE on successful launch, %FALSE otherwise.
8014  */
8015
8016
8017 /**
8018  * g_app_info_remove_supports_type:
8019  * @appinfo: a #GAppInfo.
8020  * @content_type: a string.
8021  * @error: a #GError.
8022  *
8023  * Removes a supported type from an application, if possible.
8024  *
8025  * Returns: %TRUE on success, %FALSE on error.
8026  */
8027
8028
8029 /**
8030  * g_app_info_reset_type_associations:
8031  * @content_type: a content type
8032  *
8033  * Removes all changes to the type associations done by
8034  * g_app_info_set_as_default_for_type(),
8035  * g_app_info_set_as_default_for_extension(),
8036  * g_app_info_add_supports_type() or
8037  * g_app_info_remove_supports_type().
8038  *
8039  * Since: 2.20
8040  */
8041
8042
8043 /**
8044  * g_app_info_set_as_default_for_extension:
8045  * @appinfo: a #GAppInfo.
8046  * @extension: a string containing the file extension (without the dot).
8047  * @error: a #GError.
8048  *
8049  * Sets the application as the default handler for the given file extension.
8050  *
8051  * Returns: %TRUE on success, %FALSE on error.
8052  */
8053
8054
8055 /**
8056  * g_app_info_set_as_default_for_type:
8057  * @appinfo: a #GAppInfo.
8058  * @content_type: the content type.
8059  * @error: a #GError.
8060  *
8061  * Sets the application as the default handler for a given type.
8062  *
8063  * Returns: %TRUE on success, %FALSE on error.
8064  */
8065
8066
8067 /**
8068  * g_app_info_set_as_last_used_for_type:
8069  * @appinfo: a #GAppInfo.
8070  * @content_type: the content type.
8071  * @error: a #GError.
8072  *
8073  * Sets the application as the last used application for a given type.
8074  * This will make the application appear as first in the list returned
8075  * by g_app_info_get_recommended_for_type(), regardless of the default
8076  * application for that content type.
8077  *
8078  * Returns: %TRUE on success, %FALSE on error.
8079  */
8080
8081
8082 /**
8083  * g_app_info_should_show:
8084  * @appinfo: a #GAppInfo.
8085  *
8086  * Checks if the application info should be shown in menus that
8087  * list available applications.
8088  *
8089  * Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise.
8090  */
8091
8092
8093 /**
8094  * g_app_info_supports_files:
8095  * @appinfo: a #GAppInfo.
8096  *
8097  * Checks if the application accepts files as arguments.
8098  *
8099  * Returns: %TRUE if the @appinfo supports files.
8100  */
8101
8102
8103 /**
8104  * g_app_info_supports_uris:
8105  * @appinfo: a #GAppInfo.
8106  *
8107  * Checks if the application supports reading files and directories from URIs.
8108  *
8109  * Returns: %TRUE if the @appinfo supports URIs.
8110  */
8111
8112
8113 /**
8114  * g_app_launch_context_get_display:
8115  * @context: a #GAppLaunchContext
8116  * @info: a #GAppInfo
8117  * @files: (element-type GFile): a #GList of #GFile objects
8118  *
8119  * Gets the display string for the @context. This is used to ensure new
8120  * applications are started on the same display as the launching
8121  * application, by setting the <envar>DISPLAY</envar> environment variable.
8122  *
8123  * Returns: a display string for the display.
8124  */
8125
8126
8127 /**
8128  * g_app_launch_context_get_environment:
8129  * @context: a #GAppLaunchContext
8130  *
8131  * Gets the complete environment variable list to be passed to
8132  * the child process when @context is used to launch an application.
8133  * This is a %NULL-terminated array of strings, where each string has
8134  * the form <literal>KEY=VALUE</literal>.
8135  *
8136  * Returns: (array zero-terminated=1) (transfer full): the child's environment
8137  * Since: 2.32
8138  */
8139
8140
8141 /**
8142  * g_app_launch_context_get_startup_notify_id:
8143  * @context: a #GAppLaunchContext
8144  * @info: a #GAppInfo
8145  * @files: (element-type GFile): a #GList of of #GFile objects
8146  *
8147  * Initiates startup notification for the application and returns the
8148  * <envar>DESKTOP_STARTUP_ID</envar> for the launched operation,
8149  * if supported.
8150  *
8151  * Startup notification IDs are defined in the <ulink
8152  * url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
8153  * FreeDesktop.Org Startup Notifications standard</ulink>.
8154  *
8155  * Returns: a startup notification ID for the application, or %NULL if not supported.
8156  */
8157
8158
8159 /**
8160  * g_app_launch_context_launch_failed:
8161  * @context: a #GAppLaunchContext.
8162  * @startup_notify_id: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
8163  *
8164  * Called when an application has failed to launch, so that it can cancel
8165  * the application startup notification started in g_app_launch_context_get_startup_notify_id().
8166  */
8167
8168
8169 /**
8170  * g_app_launch_context_new:
8171  *
8172  * Creates a new application launch context. This is not normally used,
8173  * instead you instantiate a subclass of this, such as #GdkAppLaunchContext.
8174  *
8175  * Returns: a #GAppLaunchContext.
8176  */
8177
8178
8179 /**
8180  * g_app_launch_context_setenv:
8181  * @context: a #GAppLaunchContext
8182  * @variable: the environment variable to set
8183  * @value: the value for to set the variable to.
8184  *
8185  * Arranges for @variable to be set to @value in the child's
8186  * environment when @context is used to launch an application.
8187  *
8188  * Since: 2.32
8189  */
8190
8191
8192 /**
8193  * g_app_launch_context_unsetenv:
8194  * @context: a #GAppLaunchContext
8195  * @variable: the environment variable to remove
8196  *
8197  * Arranges for @variable to be unset in the child's environment
8198  * when @context is used to launch an application.
8199  *
8200  * Since: 2.32
8201  */
8202
8203
8204 /**
8205  * g_application_activate:
8206  * @application: a #GApplication
8207  *
8208  * Activates the application.
8209  *
8210  * In essence, this results in the #GApplication::activate signal being
8211  * emitted in the primary instance.
8212  *
8213  * The application must be registered before calling this function.
8214  *
8215  * Since: 2.28
8216  */
8217
8218
8219 /**
8220  * g_application_command_line_get_arguments:
8221  * @cmdline: a #GApplicationCommandLine
8222  * @argc: (out) (allow-none): the length of the arguments array, or %NULL
8223  *
8224  * Gets the list of arguments that was passed on the command line.
8225  *
8226  * The strings in the array may contain non-utf8 data.
8227  *
8228  * The return value is %NULL-terminated and should be freed using
8229  * g_strfreev().
8230  *
8231  * Returns: (array length=argc) (transfer full): the string array containing the arguments (the argv)
8232  * Since: 2.28
8233  */
8234
8235
8236 /**
8237  * g_application_command_line_get_cwd:
8238  * @cmdline: a #GApplicationCommandLine
8239  *
8240  * Gets the working directory of the command line invocation.
8241  * The string may contain non-utf8 data.
8242  *
8243  * It is possible that the remote application did not send a working
8244  * directory, so this may be %NULL.
8245  *
8246  * The return value should not be modified or freed and is valid for as
8247  * long as @cmdline exists.
8248  *
8249  * Returns: the current directory, or %NULL
8250  * Since: 2.28
8251  */
8252
8253
8254 /**
8255  * g_application_command_line_get_environ:
8256  * @cmdline: a #GApplicationCommandLine
8257  *
8258  * Gets the contents of the 'environ' variable of the command line
8259  * invocation, as would be returned by g_get_environ(), ie as a
8260  * %NULL-terminated list of strings in the form 'NAME=VALUE'.
8261  * The strings may contain non-utf8 data.
8262  *
8263  * The remote application usually does not send an environment.  Use
8264  * %G_APPLICATION_SEND_ENVIRONMENT to affect that.  Even with this flag
8265  * set it is possible that the environment is still not available (due
8266  * to invocation messages from other applications).
8267  *
8268  * The return value should not be modified or freed and is valid for as
8269  * long as @cmdline exists.
8270  *
8271  * See g_application_command_line_getenv() if you are only interested
8272  * in the value of a single environment variable.
8273  *
8274  * Returns: (array zero-terminated=1) (transfer none): the environment strings, or %NULL if they were not sent
8275  * Since: 2.28
8276  */
8277
8278
8279 /**
8280  * g_application_command_line_get_exit_status:
8281  * @cmdline: a #GApplicationCommandLine
8282  *
8283  * Gets the exit status of @cmdline.  See
8284  * g_application_command_line_set_exit_status() for more information.
8285  *
8286  * Returns: the exit status
8287  * Since: 2.28
8288  */
8289
8290
8291 /**
8292  * g_application_command_line_get_is_remote:
8293  * @cmdline: a #GApplicationCommandLine
8294  *
8295  * Determines if @cmdline represents a remote invocation.
8296  *
8297  * Returns: %TRUE if the invocation was remote
8298  * Since: 2.28
8299  */
8300
8301
8302 /**
8303  * g_application_command_line_get_platform_data:
8304  * @cmdline: #GApplicationCommandLine
8305  *
8306  * Gets the platform data associated with the invocation of @cmdline.
8307  *
8308  * This is a #GVariant dictionary containing information about the
8309  * context in which the invocation occurred.  It typically contains
8310  * information like the current working directory and the startup
8311  * notification ID.
8312  *
8313  * For local invocation, it will be %NULL.
8314  *
8315  * Returns: (allow-none): the platform data, or %NULL
8316  * Since: 2.28
8317  */
8318
8319
8320 /**
8321  * g_application_command_line_getenv:
8322  * @cmdline: a #GApplicationCommandLine
8323  * @name: the environment variable to get
8324  *
8325  * Gets the value of a particular environment variable of the command
8326  * line invocation, as would be returned by g_getenv().  The strings may
8327  * contain non-utf8 data.
8328  *
8329  * The remote application usually does not send an environment.  Use
8330  * %G_APPLICATION_SEND_ENVIRONMENT to affect that.  Even with this flag
8331  * set it is possible that the environment is still not available (due
8332  * to invocation messages from other applications).
8333  *
8334  * The return value should not be modified or freed and is valid for as
8335  * long as @cmdline exists.
8336  *
8337  * Returns: the value of the variable, or %NULL if unset or unsent
8338  * Since: 2.28
8339  */
8340
8341
8342 /**
8343  * g_application_command_line_print:
8344  * @cmdline: a #GApplicationCommandLine
8345  * @format: a printf-style format string
8346  * @...: arguments, as per @format
8347  *
8348  * Formats a message and prints it using the stdout print handler in the
8349  * invoking process.
8350  *
8351  * If @cmdline is a local invocation then this is exactly equivalent to
8352  * g_print().  If @cmdline is remote then this is equivalent to calling
8353  * g_print() in the invoking process.
8354  *
8355  * Since: 2.28
8356  */
8357
8358
8359 /**
8360  * g_application_command_line_printerr:
8361  * @cmdline: a #GApplicationCommandLine
8362  * @format: a printf-style format string
8363  * @...: arguments, as per @format
8364  *
8365  * Formats a message and prints it using the stderr print handler in the
8366  * invoking process.
8367  *
8368  * If @cmdline is a local invocation then this is exactly equivalent to
8369  * g_printerr().  If @cmdline is remote then this is equivalent to
8370  * calling g_printerr() in the invoking process.
8371  *
8372  * Since: 2.28
8373  */
8374
8375
8376 /**
8377  * g_application_command_line_set_exit_status:
8378  * @cmdline: a #GApplicationCommandLine
8379  * @exit_status: the exit status
8380  *
8381  * Sets the exit status that will be used when the invoking process
8382  * exits.
8383  *
8384  * The return value of the #GApplication::command-line signal is
8385  * passed to this function when the handler returns.  This is the usual
8386  * way of setting the exit status.
8387  *
8388  * In the event that you want the remote invocation to continue running
8389  * and want to decide on the exit status in the future, you can use this
8390  * call.  For the case of a remote invocation, the remote process will
8391  * typically exit when the last reference is dropped on @cmdline.  The
8392  * exit status of the remote process will be equal to the last value
8393  * that was set with this function.
8394  *
8395  * In the case that the commandline invocation is local, the situation
8396  * is slightly more complicated.  If the commandline invocation results
8397  * in the mainloop running (ie: because the use-count of the application
8398  * increased to a non-zero value) then the application is considered to
8399  * have been 'successful' in a certain sense, and the exit status is
8400  * always zero.  If the application use count is zero, though, the exit
8401  * status of the local #GApplicationCommandLine is used.
8402  *
8403  * Since: 2.28
8404  */
8405
8406
8407 /**
8408  * g_application_get_application_id:
8409  * @application: a #GApplication
8410  *
8411  * Gets the unique identifier for @application.
8412  *
8413  * Returns: the identifier for @application, owned by @application
8414  * Since: 2.28
8415  */
8416
8417
8418 /**
8419  * g_application_get_dbus_connection:
8420  * @application: a #GApplication
8421  *
8422  * Gets the #GDBusConnection being used by the application, or %NULL.
8423  *
8424  * If #GApplication is using its D-Bus backend then this function will
8425  * return the #GDBusConnection being used for uniqueness and
8426  * communication with the desktop environment and other instances of the
8427  * application.
8428  *
8429  * If #GApplication is not using D-Bus then this function will return
8430  * %NULL.  This includes the situation where the D-Bus backend would
8431  * normally be in use but we were unable to connect to the bus.
8432  *
8433  * This function must not be called before the application has been
8434  * registered.  See g_application_get_is_registered().
8435  *
8436  * Returns: (transfer none): a #GDBusConnection, or %NULL
8437  * Since: 2.34
8438  */
8439
8440
8441 /**
8442  * g_application_get_dbus_object_path:
8443  * @application: a #GApplication
8444  *
8445  * Gets the D-Bus object path being used by the application, or %NULL.
8446  *
8447  * If #GApplication is using its D-Bus backend then this function will
8448  * return the D-Bus object path that #GApplication is using.  If the
8449  * application is the primary instance then there is an object published
8450  * at this path.  If the application is not the primary instance then
8451  * the result of this function is undefined.
8452  *
8453  * If #GApplication is not using D-Bus then this function will return
8454  * %NULL.  This includes the situation where the D-Bus backend would
8455  * normally be in use but we were unable to connect to the bus.
8456  *
8457  * This function must not be called before the application has been
8458  * registered.  See g_application_get_is_registered().
8459  *
8460  * Returns: the object path, or %NULL
8461  * Since: 2.34
8462  */
8463
8464
8465 /**
8466  * g_application_get_default:
8467  *
8468  * Returns the default #GApplication instance for this process.
8469  *
8470  * Normally there is only one #GApplication per process and it becomes
8471  * the default when it is created.  You can exercise more control over
8472  * this by using g_application_set_default().
8473  *
8474  * If there is no default application then %NULL is returned.
8475  *
8476  * Returns: (transfer none): the default application for this process, or %NULL
8477  * Since: 2.32
8478  */
8479
8480
8481 /**
8482  * g_application_get_flags:
8483  * @application: a #GApplication
8484  *
8485  * Gets the flags for @application.
8486  *
8487  * See #GApplicationFlags.
8488  *
8489  * Returns: the flags for @application
8490  * Since: 2.28
8491  */
8492
8493
8494 /**
8495  * g_application_get_inactivity_timeout:
8496  * @application: a #GApplication
8497  *
8498  * Gets the current inactivity timeout for the application.
8499  *
8500  * This is the amount of time (in milliseconds) after the last call to
8501  * g_application_release() before the application stops running.
8502  *
8503  * Returns: the timeout, in milliseconds
8504  * Since: 2.28
8505  */
8506
8507
8508 /**
8509  * g_application_get_is_registered:
8510  * @application: a #GApplication
8511  *
8512  * Checks if @application is registered.
8513  *
8514  * An application is registered if g_application_register() has been
8515  * successfully called.
8516  *
8517  * Returns: %TRUE if @application is registered
8518  * Since: 2.28
8519  */
8520
8521
8522 /**
8523  * g_application_get_is_remote:
8524  * @application: a #GApplication
8525  *
8526  * Checks if @application is remote.
8527  *
8528  * If @application is remote then it means that another instance of
8529  * application already exists (the 'primary' instance).  Calls to
8530  * perform actions on @application will result in the actions being
8531  * performed by the primary instance.
8532  *
8533  * The value of this property cannot be accessed before
8534  * g_application_register() has been called.  See
8535  * g_application_get_is_registered().
8536  *
8537  * Returns: %TRUE if @application is remote
8538  * Since: 2.28
8539  */
8540
8541
8542 /**
8543  * g_application_hold:
8544  * @application: a #GApplication
8545  *
8546  * Increases the use count of @application.
8547  *
8548  * Use this function to indicate that the application has a reason to
8549  * continue to run.  For example, g_application_hold() is called by GTK+
8550  * when a toplevel window is on the screen.
8551  *
8552  * To cancel the hold, call g_application_release().
8553  */
8554
8555
8556 /**
8557  * g_application_id_is_valid:
8558  * @application_id: a potential application identifier
8559  *
8560  * Checks if @application_id is a valid application identifier.
8561  *
8562  * A valid ID is required for calls to g_application_new() and
8563  * g_application_set_application_id().
8564  *
8565  * For convenience, the restrictions on application identifiers are
8566  * reproduced here:
8567  * <itemizedlist>
8568  *   <listitem>Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-." and must not begin with a digit.</listitem>
8569  *   <listitem>Application identifiers must contain at least one '.' (period) character (and thus at least three elements).</listitem>
8570  *   <listitem>Application identifiers must not begin or end with a '.' (period) character.</listitem>
8571  *   <listitem>Application identifiers must not contain consecutive '.' (period) characters.</listitem>
8572  *   <listitem>Application identifiers must not exceed 255 characters.</listitem>
8573  * </itemizedlist>
8574  *
8575  * Returns: %TRUE if @application_id is valid
8576  */
8577
8578
8579 /**
8580  * g_application_new:
8581  * @application_id: (allow-none): the application id
8582  * @flags: the application flags
8583  *
8584  * Creates a new #GApplication instance.
8585  *
8586  * This function calls g_type_init() for you.
8587  *
8588  * If non-%NULL, the application id must be valid.  See
8589  * g_application_id_is_valid().
8590  *
8591  * If no application ID is given then some features of #GApplication
8592  * (most notably application uniqueness) will be disabled.
8593  *
8594  * Returns: a new #GApplication instance
8595  */
8596
8597
8598 /**
8599  * g_application_open:
8600  * @application: a #GApplication
8601  * @files: (array length=n_files): an array of #GFiles to open
8602  * @n_files: the length of the @files array
8603  * @hint: a hint (or ""), but never %NULL
8604  *
8605  * Opens the given files.
8606  *
8607  * In essence, this results in the #GApplication::open signal being emitted
8608  * in the primary instance.
8609  *
8610  * @n_files must be greater than zero.
8611  *
8612  * @hint is simply passed through to the ::open signal.  It is
8613  * intended to be used by applications that have multiple modes for
8614  * opening files (eg: "view" vs "edit", etc).  Unless you have a need
8615  * for this functionality, you should use "".
8616  *
8617  * The application must be registered before calling this function
8618  * and it must have the %G_APPLICATION_HANDLES_OPEN flag set.
8619  *
8620  * Since: 2.28
8621  */
8622
8623
8624 /**
8625  * g_application_quit:
8626  * @application: a #GApplication
8627  *
8628  * Immediately quits the application.
8629  *
8630  * Upon return to the mainloop, g_application_run() will return,
8631  * calling only the 'shutdown' function before doing so.
8632  *
8633  * The hold count is ignored.
8634  *
8635  * The result of calling g_application_run() again after it returns is
8636  * unspecified.
8637  *
8638  * Since: 2.32
8639  */
8640
8641
8642 /**
8643  * g_application_register:
8644  * @application: a #GApplication
8645  * @cancellable: (allow-none): a #GCancellable, or %NULL
8646  * @error: a pointer to a NULL #GError, or %NULL
8647  *
8648  * Attempts registration of the application.
8649  *
8650  * This is the point at which the application discovers if it is the
8651  * primary instance or merely acting as a remote for an already-existing
8652  * primary instance.  This is implemented by attempting to acquire the
8653  * application identifier as a unique bus name on the session bus using
8654  * GDBus.
8655  *
8656  * If there is no application ID or if %G_APPLICATION_NON_UNIQUE was
8657  * given, then this process will always become the primary instance.
8658  *
8659  * Due to the internal architecture of GDBus, method calls can be
8660  * dispatched at any time (even if a main loop is not running).  For
8661  * this reason, you must ensure that any object paths that you wish to
8662  * register are registered before calling this function.
8663  *
8664  * If the application has already been registered then %TRUE is
8665  * returned with no work performed.
8666  *
8667  * The #GApplication::startup signal is emitted if registration succeeds
8668  * and @application is the primary instance (including the non-unique
8669  * case).
8670  *
8671  * In the event of an error (such as @cancellable being cancelled, or a
8672  * failure to connect to the session bus), %FALSE is returned and @error
8673  * is set appropriately.
8674  *
8675  * Note: the return value of this function is not an indicator that this
8676  * instance is or is not the primary instance of the application.  See
8677  * g_application_get_is_remote() for that.
8678  *
8679  * Returns: %TRUE if registration succeeded
8680  * Since: 2.28
8681  */
8682
8683
8684 /**
8685  * g_application_release:
8686  * @application: a #GApplication
8687  *
8688  * Decrease the use count of @application.
8689  *
8690  * When the use count reaches zero, the application will stop running.
8691  *
8692  * Never call this function except to cancel the effect of a previous
8693  * call to g_application_hold().
8694  */
8695
8696
8697 /**
8698  * g_application_run:
8699  * @application: a #GApplication
8700  * @argc: the argc from main() (or 0 if @argv is %NULL)
8701  * @argv: (array length=argc) (allow-none): the argv from main(), or %NULL
8702  *
8703  * Runs the application.
8704  *
8705  * This function is intended to be run from main() and its return value
8706  * is intended to be returned by main(). Although you are expected to pass
8707  * the @argc, @argv parameters from main() to this function, it is possible
8708  * to pass %NULL if @argv is not available or commandline handling is not
8709  * required.
8710  *
8711  * First, the local_command_line() virtual function is invoked.
8712  * This function always runs on the local instance. It gets passed a pointer
8713  * to a %NULL-terminated copy of @argv and is expected to remove the arguments
8714  * that it handled (shifting up remaining arguments). See
8715  * <xref linkend="gapplication-example-cmdline2"/> for an example of
8716  * parsing @argv manually. Alternatively, you may use the #GOptionContext API,
8717  * after setting <literal>argc = g_strv_length (argv);</literal>.
8718  *
8719  * The last argument to local_command_line() is a pointer to the @status
8720  * variable which can used to set the exit status that is returned from
8721  * g_application_run().
8722  *
8723  * If local_command_line() returns %TRUE, the command line is expected
8724  * to be completely handled, including possibly registering as the primary
8725  * instance, calling g_application_activate() or g_application_open(), etc.
8726  *
8727  * If local_command_line() returns %FALSE then the application is registered
8728  * and the #GApplication::command-line signal is emitted in the primary
8729  * instance (which may or may not be this instance). The signal handler
8730  * gets passed a #GApplicationCommandLine object that (among other things)
8731  * contains the remaining commandline arguments that have not been handled
8732  * by local_command_line().
8733  *
8734  * If the application has the %G_APPLICATION_HANDLES_COMMAND_LINE
8735  * flag set then the default implementation of local_command_line()
8736  * always returns %FALSE immediately, resulting in the commandline
8737  * always being handled in the primary instance.
8738  *
8739  * Otherwise, the default implementation of local_command_line() tries
8740  * to do a couple of things that are probably reasonable for most
8741  * applications.  First, g_application_register() is called to attempt
8742  * to register the application.  If that works, then the command line
8743  * arguments are inspected.  If no commandline arguments are given, then
8744  * g_application_activate() is called.  If commandline arguments are
8745  * given and the %G_APPLICATION_HANDLES_OPEN flag is set then they
8746  * are assumed to be filenames and g_application_open() is called.
8747  *
8748  * If you need to handle commandline arguments that are not filenames,
8749  * and you don't mind commandline handling to happen in the primary
8750  * instance, you should set %G_APPLICATION_HANDLES_COMMAND_LINE and
8751  * process the commandline arguments in your #GApplication::command-line
8752  * signal handler, either manually or using the #GOptionContext API.
8753  *
8754  * If you are interested in doing more complicated local handling of the
8755  * commandline then you should implement your own #GApplication subclass
8756  * and override local_command_line(). In this case, you most likely want
8757  * to return %TRUE from your local_command_line() implementation to
8758  * suppress the default handling. See
8759  * <xref linkend="gapplication-example-cmdline2"/> for an example.
8760  *
8761  * If, after the above is done, the use count of the application is zero
8762  * then the exit status is returned immediately.  If the use count is
8763  * non-zero then the default main context is iterated until the use count
8764  * falls to zero, at which point 0 is returned.
8765  *
8766  * If the %G_APPLICATION_IS_SERVICE flag is set, then the exiting at
8767  * use count of zero is delayed for a while (ie: the instance stays
8768  * around to provide its <emphasis>service</emphasis> to others).
8769  *
8770  * Returns: the exit status
8771  * Since: 2.28
8772  */
8773
8774
8775 /**
8776  * g_application_set_action_group:
8777  * @application: a #GApplication
8778  * @action_group: (allow-none): a #GActionGroup, or %NULL
8779  *
8780  * This used to be how actions were associated with a #GApplication.
8781  * Now there is #GActionMap for that.
8782  *
8783  * Since: 2.28
8784  * 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.
8785  */
8786
8787
8788 /**
8789  * g_application_set_application_id:
8790  * @application: a #GApplication
8791  * @application_id: (allow-none): the identifier for @application
8792  *
8793  * Sets the unique identifier for @application.
8794  *
8795  * The application id can only be modified if @application has not yet
8796  * been registered.
8797  *
8798  * If non-%NULL, the application id must be valid.  See
8799  * g_application_id_is_valid().
8800  *
8801  * Since: 2.28
8802  */
8803
8804
8805 /**
8806  * g_application_set_default:
8807  * @application: (allow-none): the application to set as default, or %NULL
8808  *
8809  * Sets or unsets the default application for the process, as returned
8810  * by g_application_get_default().
8811  *
8812  * This function does not take its own reference on @application.  If
8813  * @application is destroyed then the default application will revert
8814  * back to %NULL.
8815  *
8816  * Since: 2.32
8817  */
8818
8819
8820 /**
8821  * g_application_set_flags:
8822  * @application: a #GApplication
8823  * @flags: the flags for @application
8824  *
8825  * Sets the flags for @application.
8826  *
8827  * The flags can only be modified if @application has not yet been
8828  * registered.
8829  *
8830  * See #GApplicationFlags.
8831  *
8832  * Since: 2.28
8833  */
8834
8835
8836 /**
8837  * g_application_set_inactivity_timeout:
8838  * @application: a #GApplication
8839  * @inactivity_timeout: the timeout, in milliseconds
8840  *
8841  * Sets the current inactivity timeout for the application.
8842  *
8843  * This is the amount of time (in milliseconds) after the last call to
8844  * g_application_release() before the application stops running.
8845  *
8846  * This call has no side effects of its own.  The value set here is only
8847  * used for next time g_application_release() drops the use count to
8848  * zero.  Any timeouts currently in progress are not impacted.
8849  *
8850  * Since: 2.28
8851  */
8852
8853
8854 /**
8855  * g_async_initable_init_async:
8856  * @initable: a #GAsyncInitable.
8857  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
8858  * @cancellable: optional #GCancellable object, %NULL to ignore.
8859  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
8860  * @user_data: the data to pass to callback function
8861  *
8862  * Starts asynchronous initialization of the object implementing the
8863  * interface. This must be done before any real use of the object after
8864  * initial construction. If the object also implements #GInitable you can
8865  * optionally call g_initable_init() instead.
8866  *
8867  * When the initialization is finished, @callback will be called. You can
8868  * then call g_async_initable_init_finish() to get the result of the
8869  * initialization.
8870  *
8871  * Implementations may also support cancellation. If @cancellable is not
8872  * %NULL, then initialization can be cancelled by triggering the cancellable
8873  * object from another thread. If the operation was cancelled, the error
8874  * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL, and
8875  * the object doesn't support cancellable initialization, the error
8876  * %G_IO_ERROR_NOT_SUPPORTED will be returned.
8877  *
8878  * As with #GInitable, if the object is not initialized, or initialization
8879  * returns with an error, then all operations on the object except
8880  * g_object_ref() and g_object_unref() are considered to be invalid, and
8881  * have undefined behaviour. They will often fail with g_critical() or
8882  * g_warning(), but this must not be relied on.
8883  *
8884  * Implementations of this method must be idempotent: i.e. multiple calls
8885  * to this function with the same argument should return the same results.
8886  * Only the first call initializes the object; further calls return the result
8887  * of the first call. This is so that it's safe to implement the singleton
8888  * pattern in the GObject constructor function.
8889  *
8890  * For classes that also support the #GInitable interface, the default
8891  * implementation of this method will run the g_initable_init() function
8892  * in a thread, so if you want to support asynchronous initialization via
8893  * threads, just implement the #GAsyncInitable interface without overriding
8894  * any interface methods.
8895  *
8896  * Since: 2.22
8897  */
8898
8899
8900 /**
8901  * g_async_initable_init_finish:
8902  * @initable: a #GAsyncInitable.
8903  * @res: a #GAsyncResult.
8904  * @error: a #GError location to store the error occurring, or %NULL to ignore.
8905  *
8906  * Finishes asynchronous initialization and returns the result.
8907  * See g_async_initable_init_async().
8908  *
8909  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
8910  * Since: 2.22
8911  */
8912
8913
8914 /**
8915  * g_async_initable_new_async:
8916  * @object_type: a #GType supporting #GAsyncInitable.
8917  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
8918  * @cancellable: optional #GCancellable object, %NULL to ignore.
8919  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
8920  * @user_data: the data to pass to callback function
8921  * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
8922  * @...: the value of the first property, followed by other property value pairs, and ended by %NULL.
8923  *
8924  * Helper function for constructing #GAsyncInitable object. This is
8925  * similar to g_object_new() but also initializes the object asynchronously.
8926  *
8927  * When the initialization is finished, @callback will be called. You can
8928  * then call g_async_initable_new_finish() to get the new object and check
8929  * for any errors.
8930  *
8931  * Since: 2.22
8932  */
8933
8934
8935 /**
8936  * g_async_initable_new_finish:
8937  * @initable: the #GAsyncInitable from the callback
8938  * @res: the #GAsyncResult from the callback
8939  * @error: return location for errors, or %NULL to ignore
8940  *
8941  * Finishes the async construction for the various g_async_initable_new
8942  * calls, returning the created object or %NULL on error.
8943  *
8944  * Returns: (transfer full): a newly created #GObject, or %NULL on error. Free with g_object_unref().
8945  * Since: 2.22
8946  */
8947
8948
8949 /**
8950  * g_async_initable_new_valist_async:
8951  * @object_type: a #GType supporting #GAsyncInitable.
8952  * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
8953  * @var_args: The var args list generated from @first_property_name.
8954  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
8955  * @cancellable: optional #GCancellable object, %NULL to ignore.
8956  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
8957  * @user_data: the data to pass to callback function
8958  *
8959  * Helper function for constructing #GAsyncInitable object. This is
8960  * similar to g_object_new_valist() but also initializes the object
8961  * asynchronously.
8962  *
8963  * When the initialization is finished, @callback will be called. You can
8964  * then call g_async_initable_new_finish() to get the new object and check
8965  * for any errors.
8966  *
8967  * Since: 2.22
8968  */
8969
8970
8971 /**
8972  * g_async_initable_newv_async:
8973  * @object_type: a #GType supporting #GAsyncInitable.
8974  * @n_parameters: the number of parameters in @parameters
8975  * @parameters: the parameters to use to construct the object
8976  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the operation.
8977  * @cancellable: optional #GCancellable object, %NULL to ignore.
8978  * @callback: a #GAsyncReadyCallback to call when the initialization is finished
8979  * @user_data: the data to pass to callback function
8980  *
8981  * Helper function for constructing #GAsyncInitable object. This is
8982  * similar to g_object_newv() but also initializes the object asynchronously.
8983  *
8984  * When the initialization is finished, @callback will be called. You can
8985  * then call g_async_initable_new_finish() to get the new object and check
8986  * for any errors.
8987  *
8988  * Since: 2.22
8989  */
8990
8991
8992 /**
8993  * g_async_result_get_source_object:
8994  * @res: a #GAsyncResult
8995  *
8996  * Gets the source object from a #GAsyncResult.
8997  *
8998  * Returns: (transfer full): a new reference to the source object for the @res, or %NULL if there is none.
8999  */
9000
9001
9002 /**
9003  * g_async_result_get_user_data:
9004  * @res: a #GAsyncResult.
9005  *
9006  * Gets the user data from a #GAsyncResult.
9007  *
9008  * Returns: (transfer full): the user data for @res.
9009  */
9010
9011
9012 /**
9013  * g_buffered_input_stream_fill:
9014  * @stream: a #GBufferedInputStream
9015  * @count: the number of bytes that will be read from the stream
9016  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
9017  * @error: location to store the error occurring, or %NULL to ignore
9018  *
9019  * Tries to read @count bytes from the stream into the buffer.
9020  * Will block during this read.
9021  *
9022  * If @count is zero, returns zero and does nothing. A value of @count
9023  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
9024  *
9025  * On success, the number of bytes read into the buffer is returned.
9026  * It is not an error if this is not the same as the requested size, as it
9027  * can happen e.g. near the end of a file. Zero is returned on end of file
9028  * (or if @count is zero),  but never otherwise.
9029  *
9030  * If @count is -1 then the attempted read size is equal to the number of
9031  * bytes that are required to fill the buffer.
9032  *
9033  * If @cancellable is not %NULL, then the operation can be cancelled by
9034  * triggering the cancellable object from another thread. If the operation
9035  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
9036  * operation was partially finished when the operation was cancelled the
9037  * partial result will be returned, without an error.
9038  *
9039  * On error -1 is returned and @error is set accordingly.
9040  *
9041  * For the asynchronous, non-blocking, version of this function, see
9042  * g_buffered_input_stream_fill_async().
9043  *
9044  * Returns: the number of bytes read into @stream's buffer, up to @count, or -1 on error.
9045  */
9046
9047
9048 /**
9049  * g_buffered_input_stream_fill_async:
9050  * @stream: a #GBufferedInputStream
9051  * @count: the number of bytes that will be read from the stream
9052  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
9053  * @cancellable: (allow-none): optional #GCancellable object
9054  * @callback: (scope async): a #GAsyncReadyCallback
9055  * @user_data: (closure): a #gpointer
9056  *
9057  * Reads data into @stream's buffer asynchronously, up to @count size.
9058  * @io_priority can be used to prioritize reads. For the synchronous
9059  * version of this function, see g_buffered_input_stream_fill().
9060  *
9061  * If @count is -1 then the attempted read size is equal to the number
9062  * of bytes that are required to fill the buffer.
9063  */
9064
9065
9066 /**
9067  * g_buffered_input_stream_fill_finish:
9068  * @stream: a #GBufferedInputStream
9069  * @result: a #GAsyncResult
9070  * @error: a #GError
9071  *
9072  * Finishes an asynchronous read.
9073  *
9074  * Returns: a #gssize of the read stream, or %-1 on an error.
9075  */
9076
9077
9078 /**
9079  * g_buffered_input_stream_get_available:
9080  * @stream: #GBufferedInputStream
9081  *
9082  * Gets the size of the available data within the stream.
9083  *
9084  * Returns: size of the available stream.
9085  */
9086
9087
9088 /**
9089  * g_buffered_input_stream_get_buffer_size:
9090  * @stream: a #GBufferedInputStream
9091  *
9092  * Gets the size of the input buffer.
9093  *
9094  * Returns: the current buffer size.
9095  */
9096
9097
9098 /**
9099  * g_buffered_input_stream_new:
9100  * @base_stream: a #GInputStream
9101  *
9102  * Creates a new #GInputStream from the given @base_stream, with
9103  * a buffer set to the default size (4 kilobytes).
9104  *
9105  * Returns: a #GInputStream for the given @base_stream.
9106  */
9107
9108
9109 /**
9110  * g_buffered_input_stream_new_sized:
9111  * @base_stream: a #GInputStream
9112  * @size: a #gsize
9113  *
9114  * Creates a new #GBufferedInputStream from the given @base_stream,
9115  * with a buffer set to @size.
9116  *
9117  * Returns: a #GInputStream.
9118  */
9119
9120
9121 /**
9122  * g_buffered_input_stream_peek:
9123  * @stream: a #GBufferedInputStream
9124  * @buffer: (array length=count) (element-type guint8): a pointer to an allocated chunk of memory
9125  * @offset: a #gsize
9126  * @count: a #gsize
9127  *
9128  * Peeks in the buffer, copying data of size @count into @buffer,
9129  * offset @offset bytes.
9130  *
9131  * Returns: a #gsize of the number of bytes peeked, or -1 on error.
9132  */
9133
9134
9135 /**
9136  * g_buffered_input_stream_peek_buffer:
9137  * @stream: a #GBufferedInputStream
9138  * @count: (out): a #gsize to get the number of bytes available in the buffer
9139  *
9140  * Returns the buffer with the currently available bytes. The returned
9141  * buffer must not be modified and will become invalid when reading from
9142  * the stream or filling the buffer.
9143  *
9144  * Returns: (array length=count) (element-type guint8) (transfer none): read-only buffer
9145  */
9146
9147
9148 /**
9149  * g_buffered_input_stream_read_byte:
9150  * @stream: a #GBufferedInputStream
9151  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
9152  * @error: location to store the error occurring, or %NULL to ignore
9153  *
9154  * Tries to read a single byte from the stream or the buffer. Will block
9155  * during this read.
9156  *
9157  * On success, the byte read from the stream is returned. On end of stream
9158  * -1 is returned but it's not an exceptional error and @error is not set.
9159  *
9160  * If @cancellable is not %NULL, then the operation can be cancelled by
9161  * triggering the cancellable object from another thread. If the operation
9162  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
9163  * operation was partially finished when the operation was cancelled the
9164  * partial result will be returned, without an error.
9165  *
9166  * On error -1 is returned and @error is set accordingly.
9167  *
9168  * Returns: the byte read from the @stream, or -1 on end of stream or error.
9169  */
9170
9171
9172 /**
9173  * g_buffered_input_stream_set_buffer_size:
9174  * @stream: a #GBufferedInputStream
9175  * @size: a #gsize
9176  *
9177  * Sets the size of the internal buffer of @stream to @size, or to the
9178  * size of the contents of the buffer. The buffer can never be resized
9179  * smaller than its current contents.
9180  */
9181
9182
9183 /**
9184  * g_buffered_output_stream_get_auto_grow:
9185  * @stream: a #GBufferedOutputStream.
9186  *
9187  * Checks if the buffer automatically grows as data is added.
9188  *
9189  * Returns: %TRUE if the @stream's buffer automatically grows, %FALSE otherwise.
9190  */
9191
9192
9193 /**
9194  * g_buffered_output_stream_get_buffer_size:
9195  * @stream: a #GBufferedOutputStream.
9196  *
9197  * Gets the size of the buffer in the @stream.
9198  *
9199  * Returns: the current size of the buffer.
9200  */
9201
9202
9203 /**
9204  * g_buffered_output_stream_new:
9205  * @base_stream: a #GOutputStream.
9206  *
9207  * Creates a new buffered output stream for a base stream.
9208  *
9209  * Returns: a #GOutputStream for the given @base_stream.
9210  */
9211
9212
9213 /**
9214  * g_buffered_output_stream_new_sized:
9215  * @base_stream: a #GOutputStream.
9216  * @size: a #gsize.
9217  *
9218  * Creates a new buffered output stream with a given buffer size.
9219  *
9220  * Returns: a #GOutputStream with an internal buffer set to @size.
9221  */
9222
9223
9224 /**
9225  * g_buffered_output_stream_set_auto_grow:
9226  * @stream: a #GBufferedOutputStream.
9227  * @auto_grow: a #gboolean.
9228  *
9229  * Sets whether or not the @stream's buffer should automatically grow.
9230  * If @auto_grow is true, then each write will just make the buffer
9231  * larger, and you must manually flush the buffer to actually write out
9232  * the data to the underlying stream.
9233  */
9234
9235
9236 /**
9237  * g_buffered_output_stream_set_buffer_size:
9238  * @stream: a #GBufferedOutputStream.
9239  * @size: a #gsize.
9240  *
9241  * Sets the size of the internal buffer to @size.
9242  */
9243
9244
9245 /**
9246  * g_bus_get:
9247  * @bus_type: A #GBusType.
9248  * @cancellable: (allow-none): A #GCancellable or %NULL.
9249  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
9250  * @user_data: The data to pass to @callback.
9251  *
9252  * Asynchronously connects to the message bus specified by @bus_type.
9253  *
9254  * When the operation is finished, @callback will be invoked. You can
9255  * then call g_bus_get_finish() to get the result of the operation.
9256  *
9257  * This is a asynchronous failable function. See g_bus_get_sync() for
9258  * the synchronous version.
9259  *
9260  * Since: 2.26
9261  */
9262
9263
9264 /**
9265  * g_bus_get_finish:
9266  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get().
9267  * @error: Return location for error or %NULL.
9268  *
9269  * Finishes an operation started with g_bus_get().
9270  *
9271  * The returned object is a singleton, that is, shared with other
9272  * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
9273  * event that you need a private message bus connection, use
9274  * g_dbus_address_get_for_bus_sync() and
9275  * g_dbus_connection_new_for_address().
9276  *
9277  * Note that the returned #GDBusConnection object will (usually) have
9278  * the #GDBusConnection:exit-on-close property set to %TRUE.
9279  *
9280  * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
9281  * Since: 2.26
9282  */
9283
9284
9285 /**
9286  * g_bus_get_sync:
9287  * @bus_type: A #GBusType.
9288  * @cancellable: (allow-none): A #GCancellable or %NULL.
9289  * @error: Return location for error or %NULL.
9290  *
9291  * Synchronously connects to the message bus specified by @bus_type.
9292  * Note that the returned object may shared with other callers,
9293  * e.g. if two separate parts of a process calls this function with
9294  * the same @bus_type, they will share the same object.
9295  *
9296  * This is a synchronous failable function. See g_bus_get() and
9297  * g_bus_get_finish() for the asynchronous version.
9298  *
9299  * The returned object is a singleton, that is, shared with other
9300  * callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
9301  * event that you need a private message bus connection, use
9302  * g_dbus_address_get_for_bus_sync() and
9303  * g_dbus_connection_new_for_address().
9304  *
9305  * Note that the returned #GDBusConnection object will (usually) have
9306  * the #GDBusConnection:exit-on-close property set to %TRUE.
9307  *
9308  * Returns: (transfer full): A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
9309  * Since: 2.26
9310  */
9311
9312
9313 /**
9314  * g_bus_own_name:
9315  * @bus_type: The type of bus to own a name on.
9316  * @name: The well-known name to own.
9317  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
9318  * @bus_acquired_handler: (allow-none): Handler to invoke when connected to the bus of type @bus_type or %NULL.
9319  * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
9320  * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
9321  * @user_data: User data to pass to handlers.
9322  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
9323  *
9324  * Starts acquiring @name on the bus specified by @bus_type and calls
9325  * @name_acquired_handler and @name_lost_handler when the name is
9326  * acquired respectively lost. Callbacks will be invoked in the <link
9327  * linkend="g-main-context-push-thread-default">thread-default main
9328  * loop</link> of the thread you are calling this function from.
9329  *
9330  * You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
9331  * callbacks will be invoked after calling this function - there are three
9332  * possible cases:
9333  * <itemizedlist>
9334  *   <listitem><para>
9335  *     @name_lost_handler with a %NULL connection (if a connection to the bus can't be made).
9336  *   </para></listitem>
9337  *   <listitem><para>
9338  *     @bus_acquired_handler then @name_lost_handler (if the name can't be obtained)
9339  *   </para></listitem>
9340  *   <listitem><para>
9341  *     @bus_acquired_handler then @name_acquired_handler (if the name was obtained).
9342  *   </para></listitem>
9343  * </itemizedlist>
9344  * When you are done owning the name, just call g_bus_unown_name()
9345  * with the owner id this function returns.
9346  *
9347  * If the name is acquired or lost (for example another application
9348  * could acquire the name if you allow replacement or the application
9349  * currently owning the name exits), the handlers are also invoked. If the
9350  * #GDBusConnection that is used for attempting to own the name
9351  * closes, then @name_lost_handler is invoked since it is no
9352  * longer possible for other processes to access the process.
9353  *
9354  * You cannot use g_bus_own_name() several times for the same name (unless
9355  * interleaved with calls to g_bus_unown_name()) - only the first call
9356  * will work.
9357  *
9358  * Another guarantee is that invocations of @name_acquired_handler
9359  * and @name_lost_handler are guaranteed to alternate; that
9360  * is, if @name_acquired_handler is invoked then you are
9361  * guaranteed that the next time one of the handlers is invoked, it
9362  * will be @name_lost_handler. The reverse is also true.
9363  *
9364  * If you plan on exporting objects (using e.g.
9365  * g_dbus_connection_register_object()), note that it is generally too late
9366  * to export the objects in @name_acquired_handler. Instead, you can do this
9367  * in @bus_acquired_handler since you are guaranteed that this will run
9368  * before @name is requested from the bus.
9369  *
9370  * This behavior makes it very simple to write applications that wants
9371  * to own names and export objects, see <xref linkend="gdbus-owning-names"/>.
9372  * Simply register objects to be exported in @bus_acquired_handler and
9373  * unregister the objects (if any) in @name_lost_handler.
9374  *
9375  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
9376  * Since: 2.26
9377  */
9378
9379
9380 /**
9381  * g_bus_own_name_on_connection:
9382  * @connection: A #GDBusConnection.
9383  * @name: The well-known name to own.
9384  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
9385  * @name_acquired_handler: (allow-none): Handler to invoke when @name is acquired or %NULL.
9386  * @name_lost_handler: (allow-none): Handler to invoke when @name is lost or %NULL.
9387  * @user_data: User data to pass to handlers.
9388  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
9389  *
9390  * Like g_bus_own_name() but takes a #GDBusConnection instead of a
9391  * #GBusType.
9392  *
9393  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
9394  * Since: 2.26
9395  */
9396
9397
9398 /**
9399  * g_bus_own_name_on_connection_with_closures:
9400  * @connection: A #GDBusConnection.
9401  * @name: The well-known name to own.
9402  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
9403  * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
9404  * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
9405  *
9406  * Version of g_bus_own_name_on_connection() using closures instead of callbacks for
9407  * easier binding in other languages.
9408  *
9409  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
9410  * Rename to: g_bus_own_name_on_connection
9411  * Since: 2.26
9412  */
9413
9414
9415 /**
9416  * g_bus_own_name_with_closures:
9417  * @bus_type: The type of bus to own a name on.
9418  * @name: The well-known name to own.
9419  * @flags: A set of flags from the #GBusNameOwnerFlags enumeration.
9420  * @bus_acquired_closure: (allow-none): #GClosure to invoke when connected to the bus of type @bus_type or %NULL.
9421  * @name_acquired_closure: (allow-none): #GClosure to invoke when @name is acquired or %NULL.
9422  * @name_lost_closure: (allow-none): #GClosure to invoke when @name is lost or %NULL.
9423  *
9424  * Version of g_bus_own_name() using closures instead of callbacks for
9425  * easier binding in other languages.
9426  *
9427  * Returns: An identifier (never 0) that an be used with g_bus_unown_name() to stop owning the name.
9428  * Rename to: g_bus_own_name
9429  * Since: 2.26
9430  */
9431
9432
9433 /**
9434  * g_bus_unown_name:
9435  * @owner_id: An identifier obtained from g_bus_own_name()
9436  *
9437  * Stops owning a name.
9438  *
9439  * Since: 2.26
9440  */
9441
9442
9443 /**
9444  * g_bus_unwatch_name:
9445  * @watcher_id: An identifier obtained from g_bus_watch_name()
9446  *
9447  * Stops watching a name.
9448  *
9449  * Since: 2.26
9450  */
9451
9452
9453 /**
9454  * g_bus_watch_name:
9455  * @bus_type: The type of bus to watch a name on.
9456  * @name: The name (well-known or unique) to watch.
9457  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
9458  * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
9459  * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
9460  * @user_data: User data to pass to handlers.
9461  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
9462  *
9463  * Starts watching @name on the bus specified by @bus_type and calls
9464  * @name_appeared_handler and @name_vanished_handler when the name is
9465  * known to have a owner respectively known to lose its
9466  * owner. Callbacks will be invoked in the <link
9467  * linkend="g-main-context-push-thread-default">thread-default main
9468  * loop</link> of the thread you are calling this function from.
9469  *
9470  * You are guaranteed that one of the handlers will be invoked after
9471  * calling this function. When you are done watching the name, just
9472  * call g_bus_unwatch_name() with the watcher id this function
9473  * returns.
9474  *
9475  * If the name vanishes or appears (for example the application owning
9476  * the name could restart), the handlers are also invoked. If the
9477  * #GDBusConnection that is used for watching the name disconnects, then
9478  * @name_vanished_handler is invoked since it is no longer
9479  * possible to access the name.
9480  *
9481  * Another guarantee is that invocations of @name_appeared_handler
9482  * and @name_vanished_handler are guaranteed to alternate; that
9483  * is, if @name_appeared_handler is invoked then you are
9484  * guaranteed that the next time one of the handlers is invoked, it
9485  * will be @name_vanished_handler. The reverse is also true.
9486  *
9487  * This behavior makes it very simple to write applications that wants
9488  * to take action when a certain name exists, see <xref
9489  * linkend="gdbus-watching-names"/>. Basically, the application
9490  * should create object proxies in @name_appeared_handler and destroy
9491  * them again (if any) in @name_vanished_handler.
9492  *
9493  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
9494  * Since: 2.26
9495  */
9496
9497
9498 /**
9499  * g_bus_watch_name_on_connection:
9500  * @connection: A #GDBusConnection.
9501  * @name: The name (well-known or unique) to watch.
9502  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
9503  * @name_appeared_handler: (allow-none): Handler to invoke when @name is known to exist or %NULL.
9504  * @name_vanished_handler: (allow-none): Handler to invoke when @name is known to not exist or %NULL.
9505  * @user_data: User data to pass to handlers.
9506  * @user_data_free_func: (allow-none): Function for freeing @user_data or %NULL.
9507  *
9508  * Like g_bus_watch_name() but takes a #GDBusConnection instead of a
9509  * #GBusType.
9510  *
9511  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
9512  * Since: 2.26
9513  */
9514
9515
9516 /**
9517  * g_bus_watch_name_on_connection_with_closures:
9518  * @connection: A #GDBusConnection.
9519  * @name: The name (well-known or unique) to watch.
9520  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
9521  * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
9522  * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
9523  *
9524  * Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
9525  * easier binding in other languages.
9526  *
9527  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
9528  * Rename to: g_bus_watch_name_on_connection
9529  * Since: 2.26
9530  */
9531
9532
9533 /**
9534  * g_bus_watch_name_with_closures:
9535  * @bus_type: The type of bus to watch a name on.
9536  * @name: The name (well-known or unique) to watch.
9537  * @flags: Flags from the #GBusNameWatcherFlags enumeration.
9538  * @name_appeared_closure: (allow-none): #GClosure to invoke when @name is known to exist or %NULL.
9539  * @name_vanished_closure: (allow-none): #GClosure to invoke when @name is known to not exist or %NULL.
9540  *
9541  * Version of g_bus_watch_name() using closures instead of callbacks for
9542  * easier binding in other languages.
9543  *
9544  * Returns: An identifier (never 0) that an be used with g_bus_unwatch_name() to stop watching the name.
9545  * Rename to: g_bus_watch_name
9546  * Since: 2.26
9547  */
9548
9549
9550 /**
9551  * g_cancellable_cancel:
9552  * @cancellable: a #GCancellable object.
9553  *
9554  * Will set @cancellable to cancelled, and will emit the
9555  * #GCancellable::cancelled signal. (However, see the warning about
9556  * race conditions in the documentation for that signal if you are
9557  * planning to connect to it.)
9558  *
9559  * This function is thread-safe. In other words, you can safely call
9560  * it from a thread other than the one running the operation that was
9561  * passed the @cancellable.
9562  *
9563  * The convention within gio is that cancelling an asynchronous
9564  * operation causes it to complete asynchronously. That is, if you
9565  * cancel the operation from the same thread in which it is running,
9566  * then the operation's #GAsyncReadyCallback will not be invoked until
9567  * the application returns to the main loop.
9568  */
9569
9570
9571 /**
9572  * g_cancellable_connect:
9573  * @cancellable: A #GCancellable.
9574  * @callback: The #GCallback to connect.
9575  * @data: Data to pass to @callback.
9576  * @data_destroy_func: (allow-none): Free function for @data or %NULL.
9577  *
9578  * Convenience function to connect to the #GCancellable::cancelled
9579  * signal. Also handles the race condition that may happen
9580  * if the cancellable is cancelled right before connecting.
9581  *
9582  * @callback is called at most once, either directly at the
9583  * time of the connect if @cancellable is already cancelled,
9584  * or when @cancellable is cancelled in some thread.
9585  *
9586  * @data_destroy_func will be called when the handler is
9587  * disconnected, or immediately if the cancellable is already
9588  * cancelled.
9589  *
9590  * See #GCancellable::cancelled for details on how to use this.
9591  *
9592  * Returns: The id of the signal handler or 0 if @cancellable has already been cancelled.
9593  * Since: 2.22
9594  */
9595
9596
9597 /**
9598  * g_cancellable_disconnect:
9599  * @cancellable: (allow-none): A #GCancellable or %NULL.
9600  * @handler_id: Handler id of the handler to be disconnected, or %0.
9601  *
9602  * Disconnects a handler from a cancellable instance similar to
9603  * g_signal_handler_disconnect().  Additionally, in the event that a
9604  * signal handler is currently running, this call will block until the
9605  * handler has finished.  Calling this function from a
9606  * #GCancellable::cancelled signal handler will therefore result in a
9607  * deadlock.
9608  *
9609  * This avoids a race condition where a thread cancels at the
9610  * same time as the cancellable operation is finished and the
9611  * signal handler is removed. See #GCancellable::cancelled for
9612  * details on how to use this.
9613  *
9614  * If @cancellable is %NULL or @handler_id is %0 this function does
9615  * nothing.
9616  *
9617  * Since: 2.22
9618  */
9619
9620
9621 /**
9622  * g_cancellable_get_current:
9623  *
9624  * Gets the top cancellable from the stack.
9625  *
9626  * Returns: (transfer none): a #GCancellable from the top of the stack, or %NULL if the stack is empty.
9627  */
9628
9629
9630 /**
9631  * g_cancellable_get_fd:
9632  * @cancellable: a #GCancellable.
9633  *
9634  * Gets the file descriptor for a cancellable job. This can be used to
9635  * implement cancellable operations on Unix systems. The returned fd will
9636  * turn readable when @cancellable is cancelled.
9637  *
9638  * You are not supposed to read from the fd yourself, just check for
9639  * readable status. Reading to unset the readable status is done
9640  * with g_cancellable_reset().
9641  *
9642  * After a successful return from this function, you should use
9643  * g_cancellable_release_fd() to free up resources allocated for
9644  * the returned file descriptor.
9645  *
9646  * See also g_cancellable_make_pollfd().
9647  *
9648  * Returns: A valid file descriptor. %-1 if the file descriptor is not supported, or on errors.
9649  */
9650
9651
9652 /**
9653  * g_cancellable_is_cancelled:
9654  * @cancellable: (allow-none): a #GCancellable or %NULL
9655  *
9656  * Checks if a cancellable job has been cancelled.
9657  *
9658  * Returns: %TRUE if @cancellable is cancelled, FALSE if called with %NULL or if item is not cancelled.
9659  */
9660
9661
9662 /**
9663  * g_cancellable_make_pollfd:
9664  * @cancellable: (allow-none): a #GCancellable or %NULL
9665  * @pollfd: a pointer to a #GPollFD
9666  *
9667  * Creates a #GPollFD corresponding to @cancellable; this can be passed
9668  * to g_poll() and used to poll for cancellation. This is useful both
9669  * for unix systems without a native poll and for portability to
9670  * windows.
9671  *
9672  * When this function returns %TRUE, you should use
9673  * g_cancellable_release_fd() to free up resources allocated for the
9674  * @pollfd. After a %FALSE return, do not call g_cancellable_release_fd().
9675  *
9676  * If this function returns %FALSE, either no @cancellable was given or
9677  * resource limits prevent this function from allocating the necessary
9678  * structures for polling. (On Linux, you will likely have reached
9679  * the maximum number of file descriptors.) The suggested way to handle
9680  * these cases is to ignore the @cancellable.
9681  *
9682  * You are not supposed to read from the fd yourself, just check for
9683  * readable status. Reading to unset the readable status is done
9684  * with g_cancellable_reset().
9685  *
9686  * Returns: %TRUE if @pollfd was successfully initialized, %FALSE on failure to prepare the cancellable.
9687  * Since: 2.22
9688  */
9689
9690
9691 /**
9692  * g_cancellable_new:
9693  *
9694  * Creates a new #GCancellable object.
9695  *
9696  * Applications that want to start one or more operations
9697  * that should be cancellable should create a #GCancellable
9698  * and pass it to the operations.
9699  *
9700  * One #GCancellable can be used in multiple consecutive
9701  * operations or in multiple concurrent operations.
9702  *
9703  * Returns: a #GCancellable.
9704  */
9705
9706
9707 /**
9708  * g_cancellable_pop_current:
9709  * @cancellable: a #GCancellable object
9710  *
9711  * Pops @cancellable off the cancellable stack (verifying that @cancellable
9712  * is on the top of the stack).
9713  */
9714
9715
9716 /**
9717  * g_cancellable_push_current:
9718  * @cancellable: a #GCancellable object
9719  *
9720  * Pushes @cancellable onto the cancellable stack. The current
9721  * cancellable can then be received using g_cancellable_get_current().
9722  *
9723  * This is useful when implementing cancellable operations in
9724  * code that does not allow you to pass down the cancellable object.
9725  *
9726  * This is typically called automatically by e.g. #GFile operations,
9727  * so you rarely have to call this yourself.
9728  */
9729
9730
9731 /**
9732  * g_cancellable_release_fd:
9733  * @cancellable: a #GCancellable
9734  *
9735  * Releases a resources previously allocated by g_cancellable_get_fd()
9736  * or g_cancellable_make_pollfd().
9737  *
9738  * For compatibility reasons with older releases, calling this function
9739  * is not strictly required, the resources will be automatically freed
9740  * when the @cancellable is finalized. However, the @cancellable will
9741  * block scarce file descriptors until it is finalized if this function
9742  * is not called. This can cause the application to run out of file
9743  * descriptors when many #GCancellables are used at the same time.
9744  *
9745  * Since: 2.22
9746  */
9747
9748
9749 /**
9750  * g_cancellable_reset:
9751  * @cancellable: a #GCancellable object.
9752  *
9753  * Resets @cancellable to its uncancelled state.
9754  *
9755  * If cancellable is currently in use by any cancellable operation
9756  * then the behavior of this function is undefined.
9757  */
9758
9759
9760 /**
9761  * g_cancellable_set_error_if_cancelled:
9762  * @cancellable: (allow-none): a #GCancellable or %NULL
9763  * @error: #GError to append error state to
9764  *
9765  * If the @cancellable is cancelled, sets the error to notify
9766  * that the operation was cancelled.
9767  *
9768  * Returns: %TRUE if @cancellable was cancelled, %FALSE if it was not
9769  */
9770
9771
9772 /**
9773  * g_cancellable_source_new: (skip)
9774  * @cancellable: (allow-none): a #GCancellable, or %NULL
9775  *
9776  * Creates a source that triggers if @cancellable is cancelled and
9777  * calls its callback of type #GCancellableSourceFunc. This is
9778  * primarily useful for attaching to another (non-cancellable) source
9779  * with g_source_add_child_source() to add cancellability to it.
9780  *
9781  * For convenience, you can call this with a %NULL #GCancellable,
9782  * in which case the source will never trigger.
9783  *
9784  * Returns: (transfer full): the new #GSource.
9785  * Since: 2.28
9786  */
9787
9788
9789 /**
9790  * g_charset_converter_get_num_fallbacks:
9791  * @converter: a #GCharsetConverter
9792  *
9793  * Gets the number of fallbacks that @converter has applied so far.
9794  *
9795  * Returns: the number of fallbacks that @converter has applied
9796  * Since: 2.24
9797  */
9798
9799
9800 /**
9801  * g_charset_converter_get_use_fallback:
9802  * @converter: a #GCharsetConverter
9803  *
9804  * Gets the #GCharsetConverter:use-fallback property.
9805  *
9806  * Returns: %TRUE if fallbacks are used by @converter
9807  * Since: 2.24
9808  */
9809
9810
9811 /**
9812  * g_charset_converter_new:
9813  * @to_charset: destination charset
9814  * @from_charset: source charset
9815  * @error: #GError for error reporting, or %NULL to ignore.
9816  *
9817  * Creates a new #GCharsetConverter.
9818  *
9819  * Returns: a new #GCharsetConverter or %NULL on error.
9820  * Since: 2.24
9821  */
9822
9823
9824 /**
9825  * g_charset_converter_set_use_fallback:
9826  * @converter: a #GCharsetConverter
9827  * @use_fallback: %TRUE to use fallbacks
9828  *
9829  * Sets the #GCharsetConverter:use-fallback property.
9830  *
9831  * Since: 2.24
9832  */
9833
9834
9835 /**
9836  * g_content_type_can_be_executable:
9837  * @type: a content type string
9838  *
9839  * Checks if a content type can be executable. Note that for instance
9840  * things like text files can be executables (i.e. scripts and batch files).
9841  *
9842  * Returns: %TRUE if the file type corresponds to a type that can be executable, %FALSE otherwise.
9843  */
9844
9845
9846 /**
9847  * g_content_type_equals:
9848  * @type1: a content type string
9849  * @type2: a content type string
9850  *
9851  * Compares two content types for equality.
9852  *
9853  * Returns: %TRUE if the two strings are identical or equivalent, %FALSE otherwise.
9854  */
9855
9856
9857 /**
9858  * g_content_type_from_mime_type:
9859  * @mime_type: a mime type string
9860  *
9861  * Tries to find a content type based on the mime type name.
9862  *
9863  * Returns: (allow-none): Newly allocated string with content type or %NULL. Free with g_free()
9864  * Since: 2.18
9865  */
9866
9867
9868 /**
9869  * g_content_type_get_description:
9870  * @type: a content type string
9871  *
9872  * Gets the human readable description of the content type.
9873  *
9874  * Returns: a short description of the content type @type. Free the returned string with g_free()
9875  */
9876
9877
9878 /**
9879  * g_content_type_get_icon:
9880  * @type: a content type string
9881  *
9882  * Gets the icon for a content type.
9883  *
9884  * Returns: (transfer full): #GIcon corresponding to the content type. Free the returned object with g_object_unref()
9885  */
9886
9887
9888 /**
9889  * g_content_type_get_mime_type:
9890  * @type: a content type string
9891  *
9892  * Gets the mime type for the content type, if one is registered.
9893  *
9894  * Returns: (allow-none): the registered mime type for the given @type, or %NULL if unknown.
9895  */
9896
9897
9898 /**
9899  * g_content_type_guess:
9900  * @filename: (allow-none): a string, or %NULL
9901  * @data: (allow-none) (array length=data_size): a stream of data, or %NULL
9902  * @data_size: the size of @data
9903  * @result_uncertain: (allow-none) (out): return location for the certainty of the result, or %NULL
9904  *
9905  * Guesses the content type based on example data. If the function is
9906  * uncertain, @result_uncertain will be set to %TRUE. Either @filename
9907  * or @data may be %NULL, in which case the guess will be based solely
9908  * on the other argument.
9909  *
9910  * Returns: a string indicating a guessed content type for the given data. Free with g_free()
9911  */
9912
9913
9914 /**
9915  * g_content_type_guess_for_tree:
9916  * @root: the root of the tree to guess a type for
9917  *
9918  * Tries to guess the type of the tree with root @root, by
9919  * looking at the files it contains. The result is an array
9920  * of content types, with the best guess coming first.
9921  *
9922  * The types returned all have the form x-content/foo, e.g.
9923  * x-content/audio-cdda (for audio CDs) or x-content/image-dcf
9924  * (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
9925  * specification for more on x-content types.
9926  *
9927  * This function is useful in the implementation of
9928  * g_mount_guess_content_type().
9929  *
9930  * Returns: (transfer full) (array zero-terminated=1): an %NULL-terminated array of zero or more content types. Free with g_strfreev()
9931  * Since: 2.18
9932  */
9933
9934
9935 /**
9936  * g_content_type_is_a:
9937  * @type: a content type string
9938  * @supertype: a content type string
9939  *
9940  * Determines if @type is a subset of @supertype.
9941  *
9942  * Returns: %TRUE if @type is a kind of @supertype, %FALSE otherwise.
9943  */
9944
9945
9946 /**
9947  * g_content_type_is_unknown:
9948  * @type: a content type string
9949  *
9950  * Checks if the content type is the generic "unknown" type.
9951  * On UNIX this is the "application/octet-stream" mimetype,
9952  * while on win32 it is "*".
9953  *
9954  * Returns: %TRUE if the type is the unknown type.
9955  */
9956
9957
9958 /**
9959  * g_content_types_get_registered:
9960  *
9961  * Gets a list of strings containing all the registered content types
9962  * known to the system. The list and its data should be freed using
9963  * <programlisting>
9964  * g_list_free_full (list, g_free);
9965  * </programlisting>
9966  *
9967  * Returns: (element-type utf8) (transfer full): #GList of the registered content types
9968  */
9969
9970
9971 /**
9972  * g_converter_convert:
9973  * @converter: a #GConverter.
9974  * @inbuf: (array length=inbuf_size) (element-type guint8): the buffer containing the data to convert.
9975  * @inbuf_size: the number of bytes in @inbuf
9976  * @outbuf: a buffer to write converted data in.
9977  * @outbuf_size: the number of bytes in @outbuf, must be at least one
9978  * @flags: a #GConverterFlags controlling the conversion details
9979  * @bytes_read: (out): will be set to the number of bytes read from @inbuf on success
9980  * @bytes_written: (out): will be set to the number of bytes written to @outbuf on success
9981  * @error: location to store the error occurring, or %NULL to ignore
9982  *
9983  * This is the main operation used when converting data. It is to be called
9984  * multiple times in a loop, and each time it will do some work, i.e.
9985  * producing some output (in @outbuf) or consuming some input (from @inbuf) or
9986  * both. If its not possible to do any work an error is returned.
9987  *
9988  * Note that a single call may not consume all input (or any input at all).
9989  * Also a call may produce output even if given no input, due to state stored
9990  * in the converter producing output.
9991  *
9992  * If any data was either produced or consumed, and then an error happens, then
9993  * only the successful conversion is reported and the error is returned on the
9994  * next call.
9995  *
9996  * A full conversion loop involves calling this method repeatedly, each time
9997  * giving it new input and space output space. When there is no more input
9998  * data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
9999  * The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
10000  * each time until all data is consumed and all output is produced, then
10001  * %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
10002  * may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
10003  * in a decompression converter where the end of data is detectable from the
10004  * data (and there might even be other data after the end of the compressed data).
10005  *
10006  * When some data has successfully been converted @bytes_read and is set to
10007  * the number of bytes read from @inbuf, and @bytes_written is set to indicate
10008  * how many bytes was written to @outbuf. If there are more data to output
10009  * or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
10010  * %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
10011  * then %G_CONVERTER_FINISHED is returned.
10012  *
10013  * On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
10014  * Some errors need special handling:
10015  *
10016  * %G_IO_ERROR_NO_SPACE is returned if there is not enough space
10017  * to write the resulting converted data, the application should
10018  * call the function again with a larger @outbuf to continue.
10019  *
10020  * %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
10021  * input to fully determine what the conversion should produce,
10022  * and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
10023  * example with an incomplete multibyte sequence when converting text,
10024  * or when a regexp matches up to the end of the input (and may match
10025  * further input). It may also happen when @inbuf_size is zero and
10026  * there is no more data to produce.
10027  *
10028  * When this happens the application should read more input and then
10029  * call the function again. If further input shows that there is no
10030  * more data call the function again with the same data but with
10031  * the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
10032  * to finish as e.g. in the regexp match case (or, to fail again with
10033  * %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
10034  * input is actually partial).
10035  *
10036  * After g_converter_convert() has returned %G_CONVERTER_FINISHED the
10037  * converter object is in an invalid state where its not allowed
10038  * to call g_converter_convert() anymore. At this time you can only
10039  * free the object or call g_converter_reset() to reset it to the
10040  * initial state.
10041  *
10042  * If the flag %G_CONVERTER_FLUSH is set then conversion is modified
10043  * to try to write out all internal state to the output. The application
10044  * has to call the function multiple times with the flag set, and when
10045  * the available input has been consumed and all internal state has
10046  * been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
10047  * really at the end) is returned instead of %G_CONVERTER_CONVERTED.
10048  * This is somewhat similar to what happens at the end of the input stream,
10049  * but done in the middle of the data.
10050  *
10051  * This has different meanings for different conversions. For instance
10052  * in a compression converter it would mean that we flush all the
10053  * compression state into output such that if you uncompress the
10054  * compressed data you get back all the input data. Doing this may
10055  * make the final file larger due to padding though. Another example
10056  * is a regexp conversion, where if you at the end of the flushed data
10057  * have a match, but there is also a potential longer match. In the
10058  * non-flushed case we would ask for more input, but when flushing we
10059  * treat this as the end of input and do the match.
10060  *
10061  * Flushing is not always possible (like if a charset converter flushes
10062  * at a partial multibyte sequence). Converters are supposed to try
10063  * to produce as much output as possible and then return an error
10064  * (typically %G_IO_ERROR_PARTIAL_INPUT).
10065  *
10066  * Returns: a #GConverterResult, %G_CONVERTER_ERROR on error.
10067  * Since: 2.24
10068  */
10069
10070
10071 /**
10072  * g_converter_input_stream_get_converter:
10073  * @converter_stream: a #GConverterInputStream
10074  *
10075  * Gets the #GConverter that is used by @converter_stream.
10076  *
10077  * Returns: (transfer none): the converter of the converter input stream
10078  * Since: 2.24
10079  */
10080
10081
10082 /**
10083  * g_converter_input_stream_new:
10084  * @base_stream: a #GInputStream
10085  * @converter: a #GConverter
10086  *
10087  * Creates a new converter input stream for the @base_stream.
10088  *
10089  * Returns: a new #GInputStream.
10090  */
10091
10092
10093 /**
10094  * g_converter_output_stream_get_converter:
10095  * @converter_stream: a #GConverterOutputStream
10096  *
10097  * Gets the #GConverter that is used by @converter_stream.
10098  *
10099  * Returns: (transfer none): the converter of the converter output stream
10100  * Since: 2.24
10101  */
10102
10103
10104 /**
10105  * g_converter_output_stream_new:
10106  * @base_stream: a #GOutputStream
10107  * @converter: a #GConverter
10108  *
10109  * Creates a new converter output stream for the @base_stream.
10110  *
10111  * Returns: a new #GOutputStream.
10112  */
10113
10114
10115 /**
10116  * g_converter_reset:
10117  * @converter: a #GConverter.
10118  *
10119  * Resets all internal state in the converter, making it behave
10120  * as if it was just created. If the converter has any internal
10121  * state that would produce output then that output is lost.
10122  *
10123  * Since: 2.24
10124  */
10125
10126
10127 /**
10128  * g_credentials_get_native: (skip)
10129  * @credentials: A #GCredentials.
10130  * @native_type: The type of native credentials to get.
10131  *
10132  * Gets a pointer to native credentials of type @native_type from
10133  * @credentials.
10134  *
10135  * It is a programming error (which will cause an warning to be
10136  * logged) to use this method if there is no #GCredentials support for
10137  * the OS or if @native_type isn't supported by the OS.
10138  *
10139  * 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.
10140  * Since: 2.26
10141  */
10142
10143
10144 /**
10145  * g_credentials_get_unix_user:
10146  * @credentials: A #GCredentials
10147  * @error: Return location for error or %NULL.
10148  *
10149  * Tries to get the UNIX user identifier from @credentials. This
10150  * method is only available on UNIX platforms.
10151  *
10152  * This operation can fail if #GCredentials is not supported on the
10153  * OS or if the native credentials type does not contain information
10154  * about the UNIX user.
10155  *
10156  * Returns: The UNIX user identifier or -1 if @error is set.
10157  * Since: 2.26
10158  */
10159
10160
10161 /**
10162  * g_credentials_is_same_user:
10163  * @credentials: A #GCredentials.
10164  * @other_credentials: A #GCredentials.
10165  * @error: Return location for error or %NULL.
10166  *
10167  * Checks if @credentials and @other_credentials is the same user.
10168  *
10169  * This operation can fail if #GCredentials is not supported on the
10170  * the OS.
10171  *
10172  * Returns: %TRUE if @credentials and @other_credentials has the same user, %FALSE otherwise or if @error is set.
10173  * Since: 2.26
10174  */
10175
10176
10177 /**
10178  * g_credentials_new:
10179  *
10180  * Creates a new #GCredentials object with credentials matching the
10181  * the current process.
10182  *
10183  * Returns: A #GCredentials. Free with g_object_unref().
10184  * Since: 2.26
10185  */
10186
10187
10188 /**
10189  * g_credentials_set_native:
10190  * @credentials: A #GCredentials.
10191  * @native_type: The type of native credentials to set.
10192  * @native: A pointer to native credentials.
10193  *
10194  * Copies the native credentials of type @native_type from @native
10195  * into @credentials.
10196  *
10197  * It is a programming error (which will cause an warning to be
10198  * logged) to use this method if there is no #GCredentials support for
10199  * the OS or if @native_type isn't supported by the OS.
10200  *
10201  * Since: 2.26
10202  */
10203
10204
10205 /**
10206  * g_credentials_set_unix_user:
10207  * @credentials: A #GCredentials.
10208  * @uid: The UNIX user identifier to set.
10209  * @error: Return location for error or %NULL.
10210  *
10211  * Tries to set the UNIX user identifier on @credentials. This method
10212  * is only available on UNIX platforms.
10213  *
10214  * This operation can fail if #GCredentials is not supported on the
10215  * OS or if the native credentials type does not contain information
10216  * about the UNIX user.
10217  *
10218  * Returns: %TRUE if @uid was set, %FALSE if error is set.
10219  * Since: 2.26
10220  */
10221
10222
10223 /**
10224  * g_credentials_to_string:
10225  * @credentials: A #GCredentials object.
10226  *
10227  * Creates a human-readable textual representation of @credentials
10228  * that can be used in logging and debug messages. The format of the
10229  * returned string may change in future GLib release.
10230  *
10231  * Returns: A string that should be freed with g_free().
10232  * Since: 2.26
10233  */
10234
10235
10236 /**
10237  * g_data_input_stream_get_byte_order:
10238  * @stream: a given #GDataInputStream.
10239  *
10240  * Gets the byte order for the data input stream.
10241  *
10242  * Returns: the @stream's current #GDataStreamByteOrder.
10243  */
10244
10245
10246 /**
10247  * g_data_input_stream_get_newline_type:
10248  * @stream: a given #GDataInputStream.
10249  *
10250  * Gets the current newline type for the @stream.
10251  *
10252  * Returns: #GDataStreamNewlineType for the given @stream.
10253  */
10254
10255
10256 /**
10257  * g_data_input_stream_new:
10258  * @base_stream: a #GInputStream.
10259  *
10260  * Creates a new data input stream for the @base_stream.
10261  *
10262  * Returns: a new #GDataInputStream.
10263  */
10264
10265
10266 /**
10267  * g_data_input_stream_read_byte:
10268  * @stream: a given #GDataInputStream.
10269  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10270  * @error: #GError for error reporting.
10271  *
10272  * Reads an unsigned 8-bit/1-byte value from @stream.
10273  *
10274  * Returns: an unsigned 8-bit/1-byte value read from the @stream or %0 if an error occurred.
10275  */
10276
10277
10278 /**
10279  * g_data_input_stream_read_int16:
10280  * @stream: a given #GDataInputStream.
10281  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10282  * @error: #GError for error reporting.
10283  *
10284  * Reads a 16-bit/2-byte value from @stream.
10285  *
10286  * In order to get the correct byte order for this read operation,
10287  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
10288  *
10289  * Returns: a signed 16-bit/2-byte value read from @stream or %0 if an error occurred.
10290  */
10291
10292
10293 /**
10294  * g_data_input_stream_read_int32:
10295  * @stream: a given #GDataInputStream.
10296  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10297  * @error: #GError for error reporting.
10298  *
10299  * Reads a signed 32-bit/4-byte value from @stream.
10300  *
10301  * In order to get the correct byte order for this read operation,
10302  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
10303  *
10304  * If @cancellable is not %NULL, then the operation can be cancelled by
10305  * triggering the cancellable object from another thread. If the operation
10306  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10307  *
10308  * Returns: a signed 32-bit/4-byte value read from the @stream or %0 if an error occurred.
10309  */
10310
10311
10312 /**
10313  * g_data_input_stream_read_int64:
10314  * @stream: a given #GDataInputStream.
10315  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10316  * @error: #GError for error reporting.
10317  *
10318  * Reads a 64-bit/8-byte value from @stream.
10319  *
10320  * In order to get the correct byte order for this read operation,
10321  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
10322  *
10323  * If @cancellable is not %NULL, then the operation can be cancelled by
10324  * triggering the cancellable object from another thread. If the operation
10325  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10326  *
10327  * Returns: a signed 64-bit/8-byte value read from @stream or %0 if an error occurred.
10328  */
10329
10330
10331 /**
10332  * g_data_input_stream_read_line:
10333  * @stream: a given #GDataInputStream.
10334  * @length: (out): a #gsize to get the length of the data read in.
10335  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10336  * @error: #GError for error reporting.
10337  *
10338  * Reads a line from the data input stream.  Note that no encoding
10339  * checks or conversion is performed; the input is not guaranteed to
10340  * be UTF-8, and may in fact have embedded NUL characters.
10341  *
10342  * If @cancellable is not %NULL, then the operation can be cancelled by
10343  * triggering the cancellable object from another thread. If the operation
10344  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10345  *
10346  * 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.
10347  */
10348
10349
10350 /**
10351  * g_data_input_stream_read_line_async:
10352  * @stream: a given #GDataInputStream.
10353  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
10354  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10355  * @callback: (scope async): callback to call when the request is satisfied.
10356  * @user_data: (closure): the data to pass to callback function.
10357  *
10358  * The asynchronous version of g_data_input_stream_read_line().  It is
10359  * an error to have two outstanding calls to this function.
10360  *
10361  * When the operation is finished, @callback will be called. You
10362  * can then call g_data_input_stream_read_line_finish() to get
10363  * the result of the operation.
10364  *
10365  * Since: 2.20
10366  */
10367
10368
10369 /**
10370  * g_data_input_stream_read_line_finish:
10371  * @stream: a given #GDataInputStream.
10372  * @result: the #GAsyncResult that was provided to the callback.
10373  * @length: (out): a #gsize to get the length of the data read in.
10374  * @error: #GError for error reporting.
10375  *
10376  * Finish an asynchronous call started by
10377  * g_data_input_stream_read_line_async().  Note the warning about
10378  * string encoding in g_data_input_stream_read_line() applies here as
10379  * well.
10380  *
10381  * 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.
10382  * Since: 2.20
10383  */
10384
10385
10386 /**
10387  * g_data_input_stream_read_line_finish_utf8:
10388  * @stream: a given #GDataInputStream.
10389  * @result: the #GAsyncResult that was provided to the callback.
10390  * @length: (out): a #gsize to get the length of the data read in.
10391  * @error: #GError for error reporting.
10392  *
10393  * Finish an asynchronous call started by
10394  * g_data_input_stream_read_line_async().
10395  *
10396  * 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.
10397  * Since: 2.30
10398  */
10399
10400
10401 /**
10402  * g_data_input_stream_read_line_utf8:
10403  * @stream: a given #GDataInputStream.
10404  * @length: (out): a #gsize to get the length of the data read in.
10405  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10406  * @error: #GError for error reporting.
10407  *
10408  * Reads a UTF-8 encoded line from the data input stream.
10409  *
10410  * If @cancellable is not %NULL, then the operation can be cancelled by
10411  * triggering the cancellable object from another thread. If the operation
10412  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10413  *
10414  * 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.
10415  * Since: 2.30
10416  */
10417
10418
10419 /**
10420  * g_data_input_stream_read_uint16:
10421  * @stream: a given #GDataInputStream.
10422  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10423  * @error: #GError for error reporting.
10424  *
10425  * Reads an unsigned 16-bit/2-byte value from @stream.
10426  *
10427  * In order to get the correct byte order for this read operation,
10428  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
10429  *
10430  * Returns: an unsigned 16-bit/2-byte value read from the @stream or %0 if an error occurred.
10431  */
10432
10433
10434 /**
10435  * g_data_input_stream_read_uint32:
10436  * @stream: a given #GDataInputStream.
10437  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10438  * @error: #GError for error reporting.
10439  *
10440  * Reads an unsigned 32-bit/4-byte value from @stream.
10441  *
10442  * In order to get the correct byte order for this read operation,
10443  * see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
10444  *
10445  * If @cancellable is not %NULL, then the operation can be cancelled by
10446  * triggering the cancellable object from another thread. If the operation
10447  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10448  *
10449  * Returns: an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred.
10450  */
10451
10452
10453 /**
10454  * g_data_input_stream_read_uint64:
10455  * @stream: a given #GDataInputStream.
10456  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10457  * @error: #GError for error reporting.
10458  *
10459  * Reads an unsigned 64-bit/8-byte value from @stream.
10460  *
10461  * In order to get the correct byte order for this read operation,
10462  * see g_data_input_stream_get_byte_order().
10463  *
10464  * If @cancellable is not %NULL, then the operation can be cancelled by
10465  * triggering the cancellable object from another thread. If the operation
10466  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10467  *
10468  * Returns: an unsigned 64-bit/8-byte read from @stream or %0 if an error occurred.
10469  */
10470
10471
10472 /**
10473  * g_data_input_stream_read_until:
10474  * @stream: a given #GDataInputStream.
10475  * @stop_chars: characters to terminate the read.
10476  * @length: (out): a #gsize to get the length of the data read in.
10477  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10478  * @error: #GError for error reporting.
10479  *
10480  * Reads a string from the data input stream, up to the first
10481  * occurrence of any of the stop characters.
10482  *
10483  * Note that, in contrast to g_data_input_stream_read_until_async(),
10484  * this function consumes the stop character that it finds.
10485  *
10486  * Don't use this function in new code.  Its functionality is
10487  * inconsistent with g_data_input_stream_read_until_async().  Both
10488  * functions will be marked as deprecated in a future release.  Use
10489  * g_data_input_stream_read_upto() instead, but note that that function
10490  * does not consume the stop character.
10491  *
10492  * 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.
10493  */
10494
10495
10496 /**
10497  * g_data_input_stream_read_until_async:
10498  * @stream: a given #GDataInputStream.
10499  * @stop_chars: characters to terminate the read.
10500  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
10501  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10502  * @callback: (scope async): callback to call when the request is satisfied.
10503  * @user_data: (closure): the data to pass to callback function.
10504  *
10505  * The asynchronous version of g_data_input_stream_read_until().
10506  * It is an error to have two outstanding calls to this function.
10507  *
10508  * Note that, in contrast to g_data_input_stream_read_until(),
10509  * this function does not consume the stop character that it finds.  You
10510  * must read it for yourself.
10511  *
10512  * When the operation is finished, @callback will be called. You
10513  * can then call g_data_input_stream_read_until_finish() to get
10514  * the result of the operation.
10515  *
10516  * Don't use this function in new code.  Its functionality is
10517  * inconsistent with g_data_input_stream_read_until().  Both functions
10518  * will be marked as deprecated in a future release.  Use
10519  * g_data_input_stream_read_upto_async() instead.
10520  *
10521  * Since: 2.20
10522  */
10523
10524
10525 /**
10526  * g_data_input_stream_read_until_finish:
10527  * @stream: a given #GDataInputStream.
10528  * @result: the #GAsyncResult that was provided to the callback.
10529  * @length: (out): a #gsize to get the length of the data read in.
10530  * @error: #GError for error reporting.
10531  *
10532  * Finish an asynchronous call started by
10533  * g_data_input_stream_read_until_async().
10534  *
10535  * Since: 2.20
10536  * 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.
10537  */
10538
10539
10540 /**
10541  * g_data_input_stream_read_upto:
10542  * @stream: a #GDataInputStream
10543  * @stop_chars: characters to terminate the read
10544  * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
10545  * @length: (out): a #gsize to get the length of the data read in
10546  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
10547  * @error: #GError for error reporting
10548  *
10549  * Reads a string from the data input stream, up to the first
10550  * occurrence of any of the stop characters.
10551  *
10552  * In contrast to g_data_input_stream_read_until(), this function
10553  * does <emphasis>not</emphasis> consume the stop character. You have
10554  * to use g_data_input_stream_read_byte() to get it before calling
10555  * g_data_input_stream_read_upto() again.
10556  *
10557  * Note that @stop_chars may contain '\0' if @stop_chars_len is
10558  * specified.
10559  *
10560  * 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
10561  * Since: 2.26
10562  */
10563
10564
10565 /**
10566  * g_data_input_stream_read_upto_async:
10567  * @stream: a #GDataInputStream
10568  * @stop_chars: characters to terminate the read
10569  * @stop_chars_len: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
10570  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
10571  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
10572  * @callback: (scope async): callback to call when the request is satisfied
10573  * @user_data: (closure): the data to pass to callback function
10574  *
10575  * The asynchronous version of g_data_input_stream_read_upto().
10576  * It is an error to have two outstanding calls to this function.
10577  *
10578  * In contrast to g_data_input_stream_read_until(), this function
10579  * does <emphasis>not</emphasis> consume the stop character. You have
10580  * to use g_data_input_stream_read_byte() to get it before calling
10581  * g_data_input_stream_read_upto() again.
10582  *
10583  * Note that @stop_chars may contain '\0' if @stop_chars_len is
10584  * specified.
10585  *
10586  * When the operation is finished, @callback will be called. You
10587  * can then call g_data_input_stream_read_upto_finish() to get
10588  * the result of the operation.
10589  *
10590  * Since: 2.26
10591  */
10592
10593
10594 /**
10595  * g_data_input_stream_read_upto_finish:
10596  * @stream: a #GDataInputStream
10597  * @result: the #GAsyncResult that was provided to the callback
10598  * @length: (out): a #gsize to get the length of the data read in
10599  * @error: #GError for error reporting
10600  *
10601  * Finish an asynchronous call started by
10602  * g_data_input_stream_read_upto_async().
10603  *
10604  * Note that this function does <emphasis>not</emphasis> consume the
10605  * stop character. You have to use g_data_input_stream_read_byte() to
10606  * get it before calling g_data_input_stream_read_upto_async() again.
10607  *
10608  * 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.
10609  * Since: 2.24
10610  */
10611
10612
10613 /**
10614  * g_data_input_stream_set_byte_order:
10615  * @stream: a given #GDataInputStream.
10616  * @order: a #GDataStreamByteOrder to set.
10617  *
10618  * This function sets the byte order for the given @stream. All subsequent
10619  * reads from the @stream will be read in the given @order.
10620  */
10621
10622
10623 /**
10624  * g_data_input_stream_set_newline_type:
10625  * @stream: a #GDataInputStream.
10626  * @type: the type of new line return as #GDataStreamNewlineType.
10627  *
10628  * Sets the newline type for the @stream.
10629  *
10630  * Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
10631  * chunk ends in "CR" we must read an additional byte to know if this is "CR" or
10632  * "CR LF", and this might block if there is no more data available.
10633  */
10634
10635
10636 /**
10637  * g_data_output_stream_get_byte_order:
10638  * @stream: a #GDataOutputStream.
10639  *
10640  * Gets the byte order for the stream.
10641  *
10642  * Returns: the #GDataStreamByteOrder for the @stream.
10643  */
10644
10645
10646 /**
10647  * g_data_output_stream_new:
10648  * @base_stream: a #GOutputStream.
10649  *
10650  * Creates a new data output stream for @base_stream.
10651  *
10652  * Returns: #GDataOutputStream.
10653  */
10654
10655
10656 /**
10657  * g_data_output_stream_put_byte:
10658  * @stream: a #GDataOutputStream.
10659  * @data: a #guchar.
10660  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10661  * @error: a #GError, %NULL to ignore.
10662  *
10663  * Puts a byte into the output stream.
10664  *
10665  * Returns: %TRUE if @data was successfully added to the @stream.
10666  */
10667
10668
10669 /**
10670  * g_data_output_stream_put_int16:
10671  * @stream: a #GDataOutputStream.
10672  * @data: a #gint16.
10673  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10674  * @error: a #GError, %NULL to ignore.
10675  *
10676  * Puts a signed 16-bit integer into the output stream.
10677  *
10678  * Returns: %TRUE if @data was successfully added to the @stream.
10679  */
10680
10681
10682 /**
10683  * g_data_output_stream_put_int32:
10684  * @stream: a #GDataOutputStream.
10685  * @data: a #gint32.
10686  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10687  * @error: a #GError, %NULL to ignore.
10688  *
10689  * Puts a signed 32-bit integer into the output stream.
10690  *
10691  * Returns: %TRUE if @data was successfully added to the @stream.
10692  */
10693
10694
10695 /**
10696  * g_data_output_stream_put_int64:
10697  * @stream: a #GDataOutputStream.
10698  * @data: a #gint64.
10699  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10700  * @error: a #GError, %NULL to ignore.
10701  *
10702  * Puts a signed 64-bit integer into the stream.
10703  *
10704  * Returns: %TRUE if @data was successfully added to the @stream.
10705  */
10706
10707
10708 /**
10709  * g_data_output_stream_put_string:
10710  * @stream: a #GDataOutputStream.
10711  * @str: a string.
10712  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10713  * @error: a #GError, %NULL to ignore.
10714  *
10715  * Puts a string into the output stream.
10716  *
10717  * Returns: %TRUE if @string was successfully added to the @stream.
10718  */
10719
10720
10721 /**
10722  * g_data_output_stream_put_uint16:
10723  * @stream: a #GDataOutputStream.
10724  * @data: a #guint16.
10725  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10726  * @error: a #GError, %NULL to ignore.
10727  *
10728  * Puts an unsigned 16-bit integer into the output stream.
10729  *
10730  * Returns: %TRUE if @data was successfully added to the @stream.
10731  */
10732
10733
10734 /**
10735  * g_data_output_stream_put_uint32:
10736  * @stream: a #GDataOutputStream.
10737  * @data: a #guint32.
10738  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10739  * @error: a #GError, %NULL to ignore.
10740  *
10741  * Puts an unsigned 32-bit integer into the stream.
10742  *
10743  * Returns: %TRUE if @data was successfully added to the @stream.
10744  */
10745
10746
10747 /**
10748  * g_data_output_stream_put_uint64:
10749  * @stream: a #GDataOutputStream.
10750  * @data: a #guint64.
10751  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
10752  * @error: a #GError, %NULL to ignore.
10753  *
10754  * Puts an unsigned 64-bit integer into the stream.
10755  *
10756  * Returns: %TRUE if @data was successfully added to the @stream.
10757  */
10758
10759
10760 /**
10761  * g_data_output_stream_set_byte_order:
10762  * @stream: a #GDataOutputStream.
10763  * @order: a %GDataStreamByteOrder.
10764  *
10765  * Sets the byte order of the data output stream to @order.
10766  */
10767
10768
10769 /**
10770  * g_dbus_action_group_get:
10771  * @connection: A #GDBusConnection
10772  * @bus_name: the bus name which exports the action group
10773  * @object_path: the object path at which the action group is exported
10774  *
10775  * Obtains a #GDBusActionGroup for the action group which is exported at
10776  * the given @bus_name and @object_path.
10777  *
10778  * The thread default main context is taken at the time of this call.
10779  * All signals on the menu model (and any linked models) are reported
10780  * with respect to this context.  All calls on the returned menu model
10781  * (and linked models) must also originate from this same context, with
10782  * the thread default main context unchanged.
10783  *
10784  * This call is non-blocking.  The returned action group may or may not
10785  * already be filled in.  The correct thing to do is connect the signals
10786  * for the action group to monitor for changes and then to call
10787  * g_action_group_list_actions() to get the initial list.
10788  *
10789  * Returns: (transfer full): a #GDBusActionGroup
10790  * Since: 2.32
10791  */
10792
10793
10794 /**
10795  * g_dbus_address_get_for_bus_sync:
10796  * @bus_type: A #GBusType.
10797  * @cancellable: (allow-none): A #GCancellable or %NULL.
10798  * @error: Return location for error or %NULL.
10799  *
10800  * Synchronously looks up the D-Bus address for the well-known message
10801  * bus instance specified by @bus_type. This may involve using various
10802  * platform specific mechanisms.
10803  *
10804  * Returns: A valid D-Bus address string for @bus_type or %NULL if @error is set.
10805  * Since: 2.26
10806  */
10807
10808
10809 /**
10810  * g_dbus_address_get_stream:
10811  * @address: A valid D-Bus address.
10812  * @cancellable: (allow-none): A #GCancellable or %NULL.
10813  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
10814  * @user_data: Data to pass to @callback.
10815  *
10816  * Asynchronously connects to an endpoint specified by @address and
10817  * sets up the connection so it is in a state to run the client-side
10818  * of the D-Bus authentication conversation.
10819  *
10820  * When the operation is finished, @callback will be invoked. You can
10821  * then call g_dbus_address_get_stream_finish() to get the result of
10822  * the operation.
10823  *
10824  * This is an asynchronous failable function. See
10825  * g_dbus_address_get_stream_sync() for the synchronous version.
10826  *
10827  * Since: 2.26
10828  */
10829
10830
10831 /**
10832  * g_dbus_address_get_stream_finish:
10833  * @res: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
10834  * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
10835  * @error: Return location for error or %NULL.
10836  *
10837  * Finishes an operation started with g_dbus_address_get_stream().
10838  *
10839  * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
10840  * Since: 2.26
10841  */
10842
10843
10844 /**
10845  * g_dbus_address_get_stream_sync:
10846  * @address: A valid D-Bus address.
10847  * @out_guid: %NULL or return location to store the GUID extracted from @address, if any.
10848  * @cancellable: (allow-none): A #GCancellable or %NULL.
10849  * @error: Return location for error or %NULL.
10850  *
10851  * Synchronously connects to an endpoint specified by @address and
10852  * sets up the connection so it is in a state to run the client-side
10853  * of the D-Bus authentication conversation.
10854  *
10855  * This is a synchronous failable function. See
10856  * g_dbus_address_get_stream() for the asynchronous version.
10857  *
10858  * Returns: (transfer full): A #GIOStream or %NULL if @error is set.
10859  * Since: 2.26
10860  */
10861
10862
10863 /**
10864  * g_dbus_annotation_info_lookup:
10865  * @annotations: (array zero-terminated=1) (allow-none): A %NULL-terminated array of annotations or %NULL.
10866  * @name: The name of the annotation to look up.
10867  *
10868  * Looks up the value of an annotation.
10869  *
10870  * This cost of this function is O(n) in number of annotations.
10871  *
10872  * Returns: The value or %NULL if not found. Do not free, it is owned by @annotations.
10873  * Since: 2.26
10874  */
10875
10876
10877 /**
10878  * g_dbus_annotation_info_ref:
10879  * @info: A #GDBusNodeInfo
10880  *
10881  * If @info is statically allocated does nothing. Otherwise increases
10882  * the reference count.
10883  *
10884  * Returns: The same @info.
10885  * Since: 2.26
10886  */
10887
10888
10889 /**
10890  * g_dbus_annotation_info_unref:
10891  * @info: A #GDBusAnnotationInfo.
10892  *
10893  * If @info is statically allocated, does nothing. Otherwise decreases
10894  * the reference count of @info. When its reference count drops to 0,
10895  * the memory used is freed.
10896  *
10897  * Since: 2.26
10898  */
10899
10900
10901 /**
10902  * g_dbus_arg_info_ref:
10903  * @info: A #GDBusArgInfo
10904  *
10905  * If @info is statically allocated does nothing. Otherwise increases
10906  * the reference count.
10907  *
10908  * Returns: The same @info.
10909  * Since: 2.26
10910  */
10911
10912
10913 /**
10914  * g_dbus_arg_info_unref:
10915  * @info: A #GDBusArgInfo.
10916  *
10917  * If @info is statically allocated, does nothing. Otherwise decreases
10918  * the reference count of @info. When its reference count drops to 0,
10919  * the memory used is freed.
10920  *
10921  * Since: 2.26
10922  */
10923
10924
10925 /**
10926  * g_dbus_auth_observer_allow_mechanism:
10927  * @observer: A #GDBusAuthObserver.
10928  * @mechanism: The name of the mechanism, e.g. <literal>DBUS_COOKIE_SHA1</literal>.
10929  *
10930  * Emits the #GDBusAuthObserver::allow-mechanism signal on @observer.
10931  *
10932  * Returns: %TRUE if @mechanism can be used to authenticate the other peer, %FALSE if not.
10933  * Since: 2.34
10934  */
10935
10936
10937 /**
10938  * g_dbus_auth_observer_authorize_authenticated_peer:
10939  * @observer: A #GDBusAuthObserver.
10940  * @stream: A #GIOStream for the #GDBusConnection.
10941  * @credentials: (allow-none): Credentials received from the peer or %NULL.
10942  *
10943  * Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
10944  *
10945  * Returns: %TRUE if the peer is authorized, %FALSE if not.
10946  * Since: 2.26
10947  */
10948
10949
10950 /**
10951  * g_dbus_auth_observer_new:
10952  *
10953  * Creates a new #GDBusAuthObserver object.
10954  *
10955  * Returns: A #GDBusAuthObserver. Free with g_object_unref().
10956  * Since: 2.26
10957  */
10958
10959
10960 /**
10961  * g_dbus_connection_add_filter:
10962  * @connection: A #GDBusConnection.
10963  * @filter_function: A filter function.
10964  * @user_data: User data to pass to @filter_function.
10965  * @user_data_free_func: Function to free @user_data with when filter is removed or %NULL.
10966  *
10967  * Adds a message filter. Filters are handlers that are run on all
10968  * incoming and outgoing messages, prior to standard dispatch. Filters
10969  * are run in the order that they were added.  The same handler can be
10970  * added as a filter more than once, in which case it will be run more
10971  * than once.  Filters added during a filter callback won't be run on
10972  * the message being processed. Filter functions are allowed to modify
10973  * and even drop messages.
10974  *
10975  * Note that filters are run in a dedicated message handling thread so
10976  * they can't block and, generally, can't do anything but signal a
10977  * worker thread. Also note that filters are rarely needed - use API
10978  * such as g_dbus_connection_send_message_with_reply(),
10979  * g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
10980  *
10981  * If a filter consumes an incoming message the message is not
10982  * dispatched anywhere else - not even the standard dispatch machinery
10983  * (that API such as g_dbus_connection_signal_subscribe() and
10984  * g_dbus_connection_send_message_with_reply() relies on) will see the
10985  * message. Similary, if a filter consumes an outgoing message, the
10986  * message will not be sent to the other peer.
10987  *
10988  * Returns: A filter identifier that can be used with g_dbus_connection_remove_filter().
10989  * Since: 2.26
10990  */
10991
10992
10993 /**
10994  * g_dbus_connection_call:
10995  * @connection: A #GDBusConnection.
10996  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
10997  * @object_path: Path of remote object.
10998  * @interface_name: D-Bus interface to invoke method on.
10999  * @method_name: The name of the method to invoke.
11000  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
11001  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
11002  * @flags: Flags from the #GDBusCallFlags enumeration.
11003  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
11004  * @cancellable: (allow-none): A #GCancellable or %NULL.
11005  * @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.
11006  * @user_data: The data to pass to @callback.
11007  *
11008  * Asynchronously invokes the @method_name method on the
11009  * @interface_name D-Bus interface on the remote object at
11010  * @object_path owned by @bus_name.
11011  *
11012  * If @connection is closed then the operation will fail with
11013  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
11014  * fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
11015  * not compatible with the D-Bus protocol, the operation fails with
11016  * %G_IO_ERROR_INVALID_ARGUMENT.
11017  *
11018  * If @reply_type is non-%NULL then the reply will be checked for having this type and an
11019  * error will be raised if it does not match.  Said another way, if you give a @reply_type
11020  * then any non-%NULL return value will be of this type.
11021  *
11022  * If the @parameters #GVariant is floating, it is consumed. This allows
11023  * convenient 'inline' use of g_variant_new(), e.g.:
11024  * |[
11025  *  g_dbus_connection_call (connection,
11026  *                          "org.freedesktop.StringThings",
11027  *                          "/org/freedesktop/StringThings",
11028  *                          "org.freedesktop.StringThings",
11029  *                          "TwoStrings",
11030  *                          g_variant_new ("(ss)",
11031  *                                         "Thing One",
11032  *                                         "Thing Two"),
11033  *                          NULL,
11034  *                          G_DBUS_CALL_FLAGS_NONE,
11035  *                          -1,
11036  *                          NULL,
11037  *                          (GAsyncReadyCallback) two_strings_done,
11038  *                          NULL);
11039  * ]|
11040  *
11041  * This is an asynchronous method. When the operation is finished, @callback will be invoked
11042  * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
11043  * of the thread you are calling this method from. You can then call
11044  * g_dbus_connection_call_finish() to get the result of the operation.
11045  * See g_dbus_connection_call_sync() for the synchronous version of this
11046  * function.
11047  *
11048  * If @callback is %NULL then the D-Bus method call message will be sent with
11049  * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
11050  *
11051  * Since: 2.26
11052  */
11053
11054
11055 /**
11056  * g_dbus_connection_call_finish:
11057  * @connection: A #GDBusConnection.
11058  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
11059  * @error: Return location for error or %NULL.
11060  *
11061  * Finishes an operation started with g_dbus_connection_call().
11062  *
11063  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
11064  * Since: 2.26
11065  */
11066
11067
11068 /**
11069  * g_dbus_connection_call_sync:
11070  * @connection: A #GDBusConnection.
11071  * @bus_name: A unique or well-known bus name.
11072  * @object_path: Path of remote object.
11073  * @interface_name: D-Bus interface to invoke method on.
11074  * @method_name: The name of the method to invoke.
11075  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
11076  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
11077  * @flags: Flags from the #GDBusCallFlags enumeration.
11078  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
11079  * @cancellable: (allow-none): A #GCancellable or %NULL.
11080  * @error: Return location for error or %NULL.
11081  *
11082  * Synchronously invokes the @method_name method on the
11083  * @interface_name D-Bus interface on the remote object at
11084  * @object_path owned by @bus_name.
11085  *
11086  * If @connection is closed then the operation will fail with
11087  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
11088  * operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
11089  * contains a value not compatible with the D-Bus protocol, the operation
11090  * fails with %G_IO_ERROR_INVALID_ARGUMENT.
11091  *
11092  * If @reply_type is non-%NULL then the reply will be checked for having
11093  * this type and an error will be raised if it does not match.  Said
11094  * another way, if you give a @reply_type then any non-%NULL return
11095  * value will be of this type.
11096  *
11097  * If the @parameters #GVariant is floating, it is consumed.
11098  * This allows convenient 'inline' use of g_variant_new(), e.g.:
11099  * |[
11100  *  g_dbus_connection_call_sync (connection,
11101  *                               "org.freedesktop.StringThings",
11102  *                               "/org/freedesktop/StringThings",
11103  *                               "org.freedesktop.StringThings",
11104  *                               "TwoStrings",
11105  *                               g_variant_new ("(ss)",
11106  *                                              "Thing One",
11107  *                                              "Thing Two"),
11108  *                               NULL,
11109  *                               G_DBUS_CALL_FLAGS_NONE,
11110  *                               -1,
11111  *                               NULL,
11112  *                               &amp;error);
11113  * ]|
11114  *
11115  * The calling thread is blocked until a reply is received. See
11116  * g_dbus_connection_call() for the asynchronous version of
11117  * this method.
11118  *
11119  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
11120  * Since: 2.26
11121  */
11122
11123
11124 /**
11125  * g_dbus_connection_call_with_unix_fd_list:
11126  * @connection: A #GDBusConnection.
11127  * @bus_name: (allow-none): A unique or well-known bus name or %NULL if @connection is not a message bus connection.
11128  * @object_path: Path of remote object.
11129  * @interface_name: D-Bus interface to invoke method on.
11130  * @method_name: The name of the method to invoke.
11131  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
11132  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
11133  * @flags: Flags from the #GDBusCallFlags enumeration.
11134  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
11135  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
11136  * @cancellable: (allow-none): A #GCancellable or %NULL.
11137  * @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.
11138  * @user_data: The data to pass to @callback.
11139  *
11140  * Like g_dbus_connection_call() but also takes a #GUnixFDList object.
11141  *
11142  * This method is only available on UNIX.
11143  *
11144  * Since: 2.30
11145  */
11146
11147
11148 /**
11149  * g_dbus_connection_call_with_unix_fd_list_finish:
11150  * @connection: A #GDBusConnection.
11151  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
11152  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
11153  * @error: Return location for error or %NULL.
11154  *
11155  * Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
11156  *
11157  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
11158  * Since: 2.30
11159  */
11160
11161
11162 /**
11163  * g_dbus_connection_call_with_unix_fd_list_sync:
11164  * @connection: A #GDBusConnection.
11165  * @bus_name: A unique or well-known bus name.
11166  * @object_path: Path of remote object.
11167  * @interface_name: D-Bus interface to invoke method on.
11168  * @method_name: The name of the method to invoke.
11169  * @parameters: (allow-none): A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
11170  * @reply_type: (allow-none): The expected type of the reply, or %NULL.
11171  * @flags: Flags from the #GDBusCallFlags enumeration.
11172  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
11173  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
11174  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
11175  * @cancellable: (allow-none): A #GCancellable or %NULL.
11176  * @error: Return location for error or %NULL.
11177  *
11178  * Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
11179  *
11180  * This method is only available on UNIX.
11181  *
11182  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
11183  * Since: 2.30
11184  */
11185
11186
11187 /**
11188  * g_dbus_connection_close:
11189  * @connection: A #GDBusConnection.
11190  * @cancellable: (allow-none): A #GCancellable or %NULL.
11191  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
11192  * @user_data: The data to pass to @callback.
11193  *
11194  * Closes @connection. Note that this never causes the process to
11195  * exit (this might only happen if the other end of a shared message
11196  * bus connection disconnects, see #GDBusConnection:exit-on-close).
11197  *
11198  * Once the connection is closed, operations such as sending a message
11199  * will return with the error %G_IO_ERROR_CLOSED. Closing a connection
11200  * will not automatically flush the connection so queued messages may
11201  * be lost. Use g_dbus_connection_flush() if you need such guarantees.
11202  *
11203  * If @connection is already closed, this method fails with
11204  * %G_IO_ERROR_CLOSED.
11205  *
11206  * When @connection has been closed, the #GDBusConnection::closed
11207  * signal is emitted in the <link
11208  * linkend="g-main-context-push-thread-default">thread-default main
11209  * loop</link> of the thread that @connection was constructed in.
11210  *
11211  * This is an asynchronous method. When the operation is finished,
11212  * @callback will be invoked in the <link
11213  * linkend="g-main-context-push-thread-default">thread-default main
11214  * loop</link> of the thread you are calling this method from. You can
11215  * then call g_dbus_connection_close_finish() to get the result of the
11216  * operation.  See g_dbus_connection_close_sync() for the synchronous
11217  * version.
11218  *
11219  * Since: 2.26
11220  */
11221
11222
11223 /**
11224  * g_dbus_connection_close_finish:
11225  * @connection: A #GDBusConnection.
11226  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
11227  * @error: Return location for error or %NULL.
11228  *
11229  * Finishes an operation started with g_dbus_connection_close().
11230  *
11231  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
11232  * Since: 2.26
11233  */
11234
11235
11236 /**
11237  * g_dbus_connection_close_sync:
11238  * @connection: A #GDBusConnection.
11239  * @cancellable: (allow-none): A #GCancellable or %NULL.
11240  * @error: Return location for error or %NULL.
11241  *
11242  * Synchronously closees @connection. The calling thread is blocked
11243  * until this is done. See g_dbus_connection_close() for the
11244  * asynchronous version of this method and more details about what it
11245  * does.
11246  *
11247  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
11248  * Since: 2.26
11249  */
11250
11251
11252 /**
11253  * g_dbus_connection_emit_signal:
11254  * @connection: A #GDBusConnection.
11255  * @destination_bus_name: (allow-none): The unique bus name for the destination for the signal or %NULL to emit to all listeners.
11256  * @object_path: Path of remote object.
11257  * @interface_name: D-Bus interface to emit a signal on.
11258  * @signal_name: The name of the signal to emit.
11259  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
11260  * @error: Return location for error or %NULL.
11261  *
11262  * Emits a signal.
11263  *
11264  * If the parameters GVariant is floating, it is consumed.
11265  *
11266  * This can only fail if @parameters is not compatible with the D-Bus protocol.
11267  *
11268  * Returns: %TRUE unless @error is set.
11269  * Since: 2.26
11270  */
11271
11272
11273 /**
11274  * g_dbus_connection_export_action_group:
11275  * @connection: a #GDBusConnection
11276  * @object_path: a D-Bus object path
11277  * @action_group: a #GActionGroup
11278  * @error: a pointer to a %NULL #GError, or %NULL
11279  *
11280  * Exports @action_group on @connection at @object_path.
11281  *
11282  * The implemented D-Bus API should be considered private.  It is
11283  * subject to change in the future.
11284  *
11285  * A given object path can only have one action group exported on it.
11286  * If this constraint is violated, the export will fail and 0 will be
11287  * returned (with @error set accordingly).
11288  *
11289  * You can unexport the action group using
11290  * g_dbus_connection_unexport_action_group() with the return value of
11291  * this function.
11292  *
11293  * The thread default main context is taken at the time of this call.
11294  * All incoming action activations and state change requests are
11295  * reported from this context.  Any changes on the action group that
11296  * cause it to emit signals must also come from this same context.
11297  * Since incoming action activations and state change requests are
11298  * rather likely to cause changes on the action group, this effectively
11299  * limits a given action group to being exported from only one main
11300  * context.
11301  *
11302  * Returns: the ID of the export (never zero), or 0 in case of failure
11303  * Since: 2.32
11304  */
11305
11306
11307 /**
11308  * g_dbus_connection_export_menu_model:
11309  * @connection: a #GDBusConnection
11310  * @object_path: a D-Bus object path
11311  * @menu: a #GMenuModel
11312  * @error: return location for an error, or %NULL
11313  *
11314  * Exports @menu on @connection at @object_path.
11315  *
11316  * The implemented D-Bus API should be considered private.
11317  * It is subject to change in the future.
11318  *
11319  * An object path can only have one action group exported on it. If this
11320  * constraint is violated, the export will fail and 0 will be
11321  * returned (with @error set accordingly).
11322  *
11323  * You can unexport the menu model using
11324  * g_dbus_connection_unexport_menu_model() with the return value of
11325  * this function.
11326  *
11327  * Returns: the ID of the export (never zero), or 0 in case of failure
11328  * Since: 2.32
11329  */
11330
11331
11332 /**
11333  * g_dbus_connection_flush:
11334  * @connection: A #GDBusConnection.
11335  * @cancellable: (allow-none): A #GCancellable or %NULL.
11336  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
11337  * @user_data: The data to pass to @callback.
11338  *
11339  * Asynchronously flushes @connection, that is, writes all queued
11340  * outgoing message to the transport and then flushes the transport
11341  * (using g_output_stream_flush_async()). This is useful in programs
11342  * that wants to emit a D-Bus signal and then exit
11343  * immediately. Without flushing the connection, there is no guarantee
11344  * that the message has been sent to the networking buffers in the OS
11345  * kernel.
11346  *
11347  * This is an asynchronous method. When the operation is finished,
11348  * @callback will be invoked in the <link
11349  * linkend="g-main-context-push-thread-default">thread-default main
11350  * loop</link> of the thread you are calling this method from. You can
11351  * then call g_dbus_connection_flush_finish() to get the result of the
11352  * operation.  See g_dbus_connection_flush_sync() for the synchronous
11353  * version.
11354  *
11355  * Since: 2.26
11356  */
11357
11358
11359 /**
11360  * g_dbus_connection_flush_finish:
11361  * @connection: A #GDBusConnection.
11362  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
11363  * @error: Return location for error or %NULL.
11364  *
11365  * Finishes an operation started with g_dbus_connection_flush().
11366  *
11367  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
11368  * Since: 2.26
11369  */
11370
11371
11372 /**
11373  * g_dbus_connection_flush_sync:
11374  * @connection: A #GDBusConnection.
11375  * @cancellable: (allow-none): A #GCancellable or %NULL.
11376  * @error: Return location for error or %NULL.
11377  *
11378  * Synchronously flushes @connection. The calling thread is blocked
11379  * until this is done. See g_dbus_connection_flush() for the
11380  * asynchronous version of this method and more details about what it
11381  * does.
11382  *
11383  * Returns: %TRUE if the operation succeeded, %FALSE if @error is set.
11384  * Since: 2.26
11385  */
11386
11387
11388 /**
11389  * g_dbus_connection_get_capabilities:
11390  * @connection: A #GDBusConnection.
11391  *
11392  * Gets the capabilities negotiated with the remote peer
11393  *
11394  * Returns: Zero or more flags from the #GDBusCapabilityFlags enumeration.
11395  * Since: 2.26
11396  */
11397
11398
11399 /**
11400  * g_dbus_connection_get_exit_on_close:
11401  * @connection: A #GDBusConnection.
11402  *
11403  * Gets whether the process is terminated when @connection is
11404  * closed by the remote peer. See
11405  * #GDBusConnection:exit-on-close for more details.
11406  *
11407  * Returns: Whether the process is terminated when @connection is closed by the remote peer.
11408  * Since: 2.26
11409  */
11410
11411
11412 /**
11413  * g_dbus_connection_get_guid:
11414  * @connection: A #GDBusConnection.
11415  *
11416  * The GUID of the peer performing the role of server when
11417  * authenticating. See #GDBusConnection:guid for more details.
11418  *
11419  * Returns: The GUID. Do not free this string, it is owned by @connection.
11420  * Since: 2.26
11421  */
11422
11423
11424 /**
11425  * g_dbus_connection_get_peer_credentials:
11426  * @connection: A #GDBusConnection.
11427  *
11428  * Gets the credentials of the authenticated peer. This will always
11429  * return %NULL unless @connection acted as a server
11430  * (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
11431  * when set up and the client passed credentials as part of the
11432  * authentication process.
11433  *
11434  * In a message bus setup, the message bus is always the server and
11435  * each application is a client. So this method will always return
11436  * %NULL for message bus clients.
11437  *
11438  * Returns: (transfer none): A #GCredentials or %NULL if not available. Do not free this object, it is owned by @connection.
11439  * Since: 2.26
11440  */
11441
11442
11443 /**
11444  * g_dbus_connection_get_stream:
11445  * @connection: a #GDBusConnection
11446  *
11447  * Gets the underlying stream used for IO.
11448  *
11449  * While the #GDBusConnection is active, it will interact with this
11450  * stream from a worker thread, so it is not safe to interact with
11451  * the stream directly.
11452  *
11453  * Returns: (transfer none): the stream used for IO
11454  * Since: 2.26
11455  */
11456
11457
11458 /**
11459  * g_dbus_connection_get_unique_name:
11460  * @connection: A #GDBusConnection.
11461  *
11462  * Gets the unique name of @connection as assigned by the message
11463  * bus. This can also be used to figure out if @connection is a
11464  * message bus connection.
11465  *
11466  * Returns: The unique name or %NULL if @connection is not a message bus connection. Do not free this string, it is owned by @connection.
11467  * Since: 2.26
11468  */
11469
11470
11471 /**
11472  * g_dbus_connection_is_closed:
11473  * @connection: A #GDBusConnection.
11474  *
11475  * Gets whether @connection is closed.
11476  *
11477  * Returns: %TRUE if the connection is closed, %FALSE otherwise.
11478  * Since: 2.26
11479  */
11480
11481
11482 /**
11483  * g_dbus_connection_new:
11484  * @stream: A #GIOStream.
11485  * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
11486  * @flags: Flags describing how to make the connection.
11487  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
11488  * @cancellable: (allow-none): A #GCancellable or %NULL.
11489  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
11490  * @user_data: The data to pass to @callback.
11491  *
11492  * Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
11493  * with the end represented by @stream.
11494  *
11495  * If @stream is a #GSocketConnection, then the corresponding #GSocket
11496  * will be put into non-blocking mode.
11497  *
11498  * The D-Bus connection will interact with @stream from a worker thread.
11499  * As a result, the caller should not interact with @stream after this
11500  * method has been called, except by calling g_object_unref() on it.
11501  *
11502  * If @observer is not %NULL it may be used to control the
11503  * authentication process.
11504  *
11505  * When the operation is finished, @callback will be invoked. You can
11506  * then call g_dbus_connection_new_finish() to get the result of the
11507  * operation.
11508  *
11509  * This is a asynchronous failable constructor. See
11510  * g_dbus_connection_new_sync() for the synchronous
11511  * version.
11512  *
11513  * Since: 2.26
11514  */
11515
11516
11517 /**
11518  * g_dbus_connection_new_finish:
11519  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
11520  * @error: Return location for error or %NULL.
11521  *
11522  * Finishes an operation started with g_dbus_connection_new().
11523  *
11524  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
11525  * Since: 2.26
11526  */
11527
11528
11529 /**
11530  * g_dbus_connection_new_for_address:
11531  * @address: A D-Bus address.
11532  * @flags: Flags describing how to make the connection.
11533  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
11534  * @cancellable: (allow-none): A #GCancellable or %NULL.
11535  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
11536  * @user_data: The data to pass to @callback.
11537  *
11538  * Asynchronously connects and sets up a D-Bus client connection for
11539  * exchanging D-Bus messages with an endpoint specified by @address
11540  * which must be in the D-Bus address format.
11541  *
11542  * This constructor can only be used to initiate client-side
11543  * connections - use g_dbus_connection_new() if you need to act as the
11544  * server. In particular, @flags cannot contain the
11545  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
11546  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
11547  *
11548  * When the operation is finished, @callback will be invoked. You can
11549  * then call g_dbus_connection_new_finish() to get the result of the
11550  * operation.
11551  *
11552  * If @observer is not %NULL it may be used to control the
11553  * authentication process.
11554  *
11555  * This is a asynchronous failable constructor. See
11556  * g_dbus_connection_new_for_address_sync() for the synchronous
11557  * version.
11558  *
11559  * Since: 2.26
11560  */
11561
11562
11563 /**
11564  * g_dbus_connection_new_for_address_finish:
11565  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
11566  * @error: Return location for error or %NULL.
11567  *
11568  * Finishes an operation started with g_dbus_connection_new_for_address().
11569  *
11570  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
11571  * Since: 2.26
11572  */
11573
11574
11575 /**
11576  * g_dbus_connection_new_for_address_sync:
11577  * @address: A D-Bus address.
11578  * @flags: Flags describing how to make the connection.
11579  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
11580  * @cancellable: (allow-none): A #GCancellable or %NULL.
11581  * @error: Return location for error or %NULL.
11582  *
11583  * Synchronously connects and sets up a D-Bus client connection for
11584  * exchanging D-Bus messages with an endpoint specified by @address
11585  * which must be in the D-Bus address format.
11586  *
11587  * This constructor can only be used to initiate client-side
11588  * connections - use g_dbus_connection_new_sync() if you need to act
11589  * as the server. In particular, @flags cannot contain the
11590  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
11591  * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
11592  *
11593  * This is a synchronous failable constructor. See
11594  * g_dbus_connection_new_for_address() for the asynchronous version.
11595  *
11596  * If @observer is not %NULL it may be used to control the
11597  * authentication process.
11598  *
11599  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
11600  * Since: 2.26
11601  */
11602
11603
11604 /**
11605  * g_dbus_connection_new_sync:
11606  * @stream: A #GIOStream.
11607  * @guid: (allow-none): The GUID to use if a authenticating as a server or %NULL.
11608  * @flags: Flags describing how to make the connection.
11609  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
11610  * @cancellable: (allow-none): A #GCancellable or %NULL.
11611  * @error: Return location for error or %NULL.
11612  *
11613  * Synchronously sets up a D-Bus connection for exchanging D-Bus messages
11614  * with the end represented by @stream.
11615  *
11616  * If @stream is a #GSocketConnection, then the corresponding #GSocket
11617  * will be put into non-blocking mode.
11618  *
11619  * The D-Bus connection will interact with @stream from a worker thread.
11620  * As a result, the caller should not interact with @stream after this
11621  * method has been called, except by calling g_object_unref() on it.
11622  *
11623  * If @observer is not %NULL it may be used to control the
11624  * authentication process.
11625  *
11626  * This is a synchronous failable constructor. See
11627  * g_dbus_connection_new() for the asynchronous version.
11628  *
11629  * Returns: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
11630  * Since: 2.26
11631  */
11632
11633
11634 /**
11635  * g_dbus_connection_register_object:
11636  * @connection: A #GDBusConnection.
11637  * @object_path: The object path to register at.
11638  * @interface_info: Introspection data for the interface.
11639  * @vtable: (allow-none): A #GDBusInterfaceVTable to call into or %NULL.
11640  * @user_data: (allow-none): Data to pass to functions in @vtable.
11641  * @user_data_free_func: Function to call when the object path is unregistered.
11642  * @error: Return location for error or %NULL.
11643  *
11644  * Registers callbacks for exported objects at @object_path with the
11645  * D-Bus interface that is described in @interface_info.
11646  *
11647  * Calls to functions in @vtable (and @user_data_free_func) will
11648  * happen in the <link linkend="g-main-context-push-thread-default">thread-default main
11649  * loop</link> of the thread you are calling this method from.
11650  *
11651  * Note that all #GVariant values passed to functions in @vtable will match
11652  * the signature given in @interface_info - if a remote caller passes
11653  * incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
11654  * is returned to the remote caller.
11655  *
11656  * Additionally, if the remote caller attempts to invoke methods or
11657  * access properties not mentioned in @interface_info the
11658  * <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
11659  * <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
11660  * are returned to the caller.
11661  *
11662  * It is considered a programming error if the
11663  * #GDBusInterfaceGetPropertyFunc function in @vtable returns a
11664  * #GVariant of incorrect type.
11665  *
11666  * If an existing callback is already registered at @object_path and
11667  * @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
11668  *
11669  * GDBus automatically implements the standard D-Bus interfaces
11670  * org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
11671  * and org.freedesktop.Peer, so you don't have to implement those for
11672  * the objects you export. You <emphasis>can</emphasis> implement
11673  * org.freedesktop.DBus.Properties yourself, e.g. to handle getting
11674  * and setting of properties asynchronously.
11675  *
11676  * Note that the reference count on @interface_info will be
11677  * incremented by 1 (unless allocated statically, e.g. if the
11678  * reference count is -1, see g_dbus_interface_info_ref()) for as long
11679  * as the object is exported. Also note that @vtable will be copied.
11680  *
11681  * See <xref linkend="gdbus-server"/> for an example of how to use this method.
11682  *
11683  * Returns: 0 if @error is set, otherwise a registration id (never 0) that can be used with g_dbus_connection_unregister_object() .
11684  * Since: 2.26
11685  */
11686
11687
11688 /**
11689  * g_dbus_connection_register_subtree:
11690  * @connection: A #GDBusConnection.
11691  * @object_path: The object path to register the subtree at.
11692  * @vtable: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
11693  * @flags: Flags used to fine tune the behavior of the subtree.
11694  * @user_data: Data to pass to functions in @vtable.
11695  * @user_data_free_func: Function to call when the subtree is unregistered.
11696  * @error: Return location for error or %NULL.
11697  *
11698  * Registers a whole subtree of <quote>dynamic</quote> objects.
11699  *
11700  * The @enumerate and @introspection functions in @vtable are used to
11701  * convey, to remote callers, what nodes exist in the subtree rooted
11702  * by @object_path.
11703  *
11704  * When handling remote calls into any node in the subtree, first the
11705  * @enumerate function is used to check if the node exists. If the node exists
11706  * or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
11707  * the @introspection function is used to check if the node supports the
11708  * requested method. If so, the @dispatch function is used to determine
11709  * where to dispatch the call. The collected #GDBusInterfaceVTable and
11710  * #gpointer will be used to call into the interface vtable for processing
11711  * the request.
11712  *
11713  * All calls into user-provided code will be invoked in the <link
11714  * linkend="g-main-context-push-thread-default">thread-default main
11715  * loop</link> of the thread you are calling this method from.
11716  *
11717  * If an existing subtree is already registered at @object_path or
11718  * then @error is set to #G_IO_ERROR_EXISTS.
11719  *
11720  * Note that it is valid to register regular objects (using
11721  * g_dbus_connection_register_object()) in a subtree registered with
11722  * g_dbus_connection_register_subtree() - if so, the subtree handler
11723  * is tried as the last resort. One way to think about a subtree
11724  * handler is to consider it a <quote>fallback handler</quote>
11725  * for object paths not registered via g_dbus_connection_register_object()
11726  * or other bindings.
11727  *
11728  * Note that @vtable will be copied so you cannot change it after
11729  * registration.
11730  *
11731  * See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
11732  *
11733  * Returns: 0 if @error is set, otherwise a subtree registration id (never 0) that can be used with g_dbus_connection_unregister_subtree() .
11734  * Since: 2.26
11735  */
11736
11737
11738 /**
11739  * g_dbus_connection_remove_filter:
11740  * @connection: a #GDBusConnection
11741  * @filter_id: an identifier obtained from g_dbus_connection_add_filter()
11742  *
11743  * Removes a filter.
11744  *
11745  * Since: 2.26
11746  */
11747
11748
11749 /**
11750  * g_dbus_connection_send_message:
11751  * @connection: A #GDBusConnection.
11752  * @message: A #GDBusMessage
11753  * @flags: Flags affecting how the message is sent.
11754  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
11755  * @error: Return location for error or %NULL.
11756  *
11757  * Asynchronously sends @message to the peer represented by @connection.
11758  *
11759  * Unless @flags contain the
11760  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
11761  * will be assigned by @connection and set on @message via
11762  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
11763  * serial number used will be written to this location prior to
11764  * submitting the message to the underlying transport.
11765  *
11766  * If @connection is closed then the operation will fail with
11767  * %G_IO_ERROR_CLOSED. If @message is not well-formed,
11768  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
11769  *
11770  * See <xref linkend="gdbus-server"/> and <xref
11771  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
11772  * low-level API to send and receive UNIX file descriptors.
11773  *
11774  * Note that @message must be unlocked, unless @flags contain the
11775  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
11776  *
11777  * Returns: %TRUE if the message was well-formed and queued for transmission, %FALSE if @error is set.
11778  * Since: 2.26
11779  */
11780
11781
11782 /**
11783  * g_dbus_connection_send_message_with_reply:
11784  * @connection: A #GDBusConnection.
11785  * @message: A #GDBusMessage.
11786  * @flags: Flags affecting how the message is sent.
11787  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
11788  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
11789  * @cancellable: (allow-none): A #GCancellable or %NULL.
11790  * @callback: (allow-none): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
11791  * @user_data: The data to pass to @callback.
11792  *
11793  * Asynchronously sends @message to the peer represented by @connection.
11794  *
11795  * Unless @flags contain the
11796  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
11797  * will be assigned by @connection and set on @message via
11798  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
11799  * serial number used will be written to this location prior to
11800  * submitting the message to the underlying transport.
11801  *
11802  * If @connection is closed then the operation will fail with
11803  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
11804  * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
11805  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
11806  *
11807  * This is an asynchronous method. When the operation is finished, @callback will be invoked
11808  * in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
11809  * of the thread you are calling this method from. You can then call
11810  * g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
11811  * See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
11812  *
11813  * Note that @message must be unlocked, unless @flags contain the
11814  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
11815  *
11816  * See <xref linkend="gdbus-server"/> and <xref
11817  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
11818  * low-level API to send and receive UNIX file descriptors.
11819  *
11820  * Since: 2.26
11821  */
11822
11823
11824 /**
11825  * g_dbus_connection_send_message_with_reply_finish:
11826  * @connection: a #GDBusConnection
11827  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
11828  * @error: Return location for error or %NULL.
11829  *
11830  * Finishes an operation started with g_dbus_connection_send_message_with_reply().
11831  *
11832  * Note that @error is only set if a local in-process error
11833  * occurred. That is to say that the returned #GDBusMessage object may
11834  * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
11835  * g_dbus_message_to_gerror() to transcode this to a #GError.
11836  *
11837  * See <xref linkend="gdbus-server"/> and <xref
11838  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
11839  * low-level API to send and receive UNIX file descriptors.
11840  *
11841  * Returns: (transfer full): A locked #GDBusMessage or %NULL if @error is set.
11842  * Since: 2.26
11843  */
11844
11845
11846 /**
11847  * g_dbus_connection_send_message_with_reply_sync:
11848  * @connection: A #GDBusConnection.
11849  * @message: A #GDBusMessage.
11850  * @flags: Flags affecting how the message is sent.
11851  * @timeout_msec: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
11852  * @out_serial: (out) (allow-none): Return location for serial number assigned to @message when sending it or %NULL.
11853  * @cancellable: (allow-none): A #GCancellable or %NULL.
11854  * @error: Return location for error or %NULL.
11855  *
11856  * Synchronously sends @message to the peer represented by @connection
11857  * and blocks the calling thread until a reply is received or the
11858  * timeout is reached. See g_dbus_connection_send_message_with_reply()
11859  * for the asynchronous version of this method.
11860  *
11861  * Unless @flags contain the
11862  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
11863  * will be assigned by @connection and set on @message via
11864  * g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
11865  * serial number used will be written to this location prior to
11866  * submitting the message to the underlying transport.
11867  *
11868  * If @connection is closed then the operation will fail with
11869  * %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
11870  * fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
11871  * the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
11872  *
11873  * Note that @error is only set if a local in-process error
11874  * occurred. That is to say that the returned #GDBusMessage object may
11875  * be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
11876  * g_dbus_message_to_gerror() to transcode this to a #GError.
11877  *
11878  * See <xref linkend="gdbus-server"/> and <xref
11879  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
11880  * low-level API to send and receive UNIX file descriptors.
11881  *
11882  * Note that @message must be unlocked, unless @flags contain the
11883  * %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
11884  *
11885  * Returns: (transfer full): A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
11886  * Since: 2.26
11887  */
11888
11889
11890 /**
11891  * g_dbus_connection_set_exit_on_close:
11892  * @connection: A #GDBusConnection.
11893  * @exit_on_close: Whether the process should be terminated when @connection is closed by the remote peer.
11894  *
11895  * Sets whether the process should be terminated when @connection is
11896  * closed by the remote peer. See #GDBusConnection:exit-on-close for
11897  * more details.
11898  *
11899  * Note that this function should be used with care. Most modern UNIX
11900  * desktops tie the notion of a user session the session bus, and expect
11901  * all of a users applications to quit when their bus connection goes away.
11902  * If you are setting @exit_on_close to %FALSE for the shared session
11903  * bus connection, you should make sure that your application exits
11904  * when the user session ends.
11905  *
11906  * Since: 2.26
11907  */
11908
11909
11910 /**
11911  * g_dbus_connection_signal_subscribe:
11912  * @connection: A #GDBusConnection.
11913  * @sender: (allow-none): Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
11914  * @interface_name: (allow-none): D-Bus interface name to match on or %NULL to match on all interfaces.
11915  * @member: (allow-none): D-Bus signal name to match on or %NULL to match on all signals.
11916  * @object_path: (allow-none): Object path to match on or %NULL to match on all object paths.
11917  * @arg0: (allow-none): Contents of first string argument to match on or %NULL to match on all kinds of arguments.
11918  * @flags: Flags describing how to subscribe to the signal (currently unused).
11919  * @callback: Callback to invoke when there is a signal matching the requested data.
11920  * @user_data: User data to pass to @callback.
11921  * @user_data_free_func: (allow-none): Function to free @user_data with when subscription is removed or %NULL.
11922  *
11923  * Subscribes to signals on @connection and invokes @callback with a
11924  * whenever the signal is received. Note that @callback
11925  * will be invoked in the <link
11926  * linkend="g-main-context-push-thread-default">thread-default main
11927  * loop</link> of the thread you are calling this method from.
11928  *
11929  * If @connection is not a message bus connection, @sender must be
11930  * %NULL.
11931  *
11932  * If @sender is a well-known name note that @callback is invoked with
11933  * the unique name for the owner of @sender, not the well-known name
11934  * as one would expect. This is because the message bus rewrites the
11935  * name. As such, to avoid certain race conditions, users should be
11936  * tracking the name owner of the well-known name and use that when
11937  * processing the received signal.
11938  *
11939  * Returns: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
11940  * Since: 2.26
11941  */
11942
11943
11944 /**
11945  * g_dbus_connection_signal_unsubscribe:
11946  * @connection: A #GDBusConnection.
11947  * @subscription_id: A subscription id obtained from g_dbus_connection_signal_subscribe().
11948  *
11949  * Unsubscribes from signals.
11950  *
11951  * Since: 2.26
11952  */
11953
11954
11955 /**
11956  * g_dbus_connection_start_message_processing:
11957  * @connection: A #GDBusConnection.
11958  *
11959  * If @connection was created with
11960  * %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
11961  * starts processing messages. Does nothing on if @connection wasn't
11962  * created with this flag or if the method has already been called.
11963  *
11964  * Since: 2.26
11965  */
11966
11967
11968 /**
11969  * g_dbus_connection_unexport_action_group:
11970  * @connection: a #GDBusConnection
11971  * @export_id: the ID from g_dbus_connection_export_action_group()
11972  *
11973  * Reverses the effect of a previous call to
11974  * g_dbus_connection_export_action_group().
11975  *
11976  * It is an error to call this function with an ID that wasn't returned
11977  * from g_dbus_connection_export_action_group() or to call it with the
11978  * same ID more than once.
11979  *
11980  * Since: 2.32
11981  */
11982
11983
11984 /**
11985  * g_dbus_connection_unexport_menu_model:
11986  * @connection: a #GDBusConnection
11987  * @export_id: the ID from g_dbus_connection_export_menu_model()
11988  *
11989  * Reverses the effect of a previous call to
11990  * g_dbus_connection_export_menu_model().
11991  *
11992  * It is an error to call this function with an ID that wasn't returned
11993  * from g_dbus_connection_export_menu_model() or to call it with the
11994  * same ID more than once.
11995  *
11996  * Since: 2.32
11997  */
11998
11999
12000 /**
12001  * g_dbus_connection_unregister_object:
12002  * @connection: A #GDBusConnection.
12003  * @registration_id: A registration id obtained from g_dbus_connection_register_object().
12004  *
12005  * Unregisters an object.
12006  *
12007  * Returns: %TRUE if the object was unregistered, %FALSE otherwise.
12008  * Since: 2.26
12009  */
12010
12011
12012 /**
12013  * g_dbus_connection_unregister_subtree:
12014  * @connection: A #GDBusConnection.
12015  * @registration_id: A subtree registration id obtained from g_dbus_connection_register_subtree().
12016  *
12017  * Unregisters a subtree.
12018  *
12019  * Returns: %TRUE if the subtree was unregistered, %FALSE otherwise.
12020  * Since: 2.26
12021  */
12022
12023
12024 /**
12025  * g_dbus_error_encode_gerror:
12026  * @error: A #GError.
12027  *
12028  * Creates a D-Bus error name to use for @error. If @error matches
12029  * a registered error (cf. g_dbus_error_register_error()), the corresponding
12030  * D-Bus error name will be returned.
12031  *
12032  * Otherwise the a name of the form
12033  * <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
12034  * will be used. This allows other GDBus applications to map the error
12035  * on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
12036  *
12037  * This function is typically only used in object mappings to put a
12038  * #GError on the wire. Regular applications should not use it.
12039  *
12040  * Returns: A D-Bus error name (never %NULL). Free with g_free().
12041  * Since: 2.26
12042  */
12043
12044
12045 /**
12046  * g_dbus_error_get_remote_error:
12047  * @error: A #GError.
12048  *
12049  * Gets the D-Bus error name used for @error, if any.
12050  *
12051  * This function is guaranteed to return a D-Bus error name for all
12052  * #GError<!-- -->s returned from functions handling remote method
12053  * calls (e.g. g_dbus_connection_call_finish()) unless
12054  * g_dbus_error_strip_remote_error() has been used on @error.
12055  *
12056  * Returns: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
12057  * Since: 2.26
12058  */
12059
12060
12061 /**
12062  * g_dbus_error_is_remote_error:
12063  * @error: A #GError.
12064  *
12065  * Checks if @error represents an error received via D-Bus from a remote peer. If so,
12066  * use g_dbus_error_get_remote_error() to get the name of the error.
12067  *
12068  * Returns: %TRUE if @error represents an error from a remote peer, %FALSE otherwise.
12069  * Since: 2.26
12070  */
12071
12072
12073 /**
12074  * g_dbus_error_new_for_dbus_error:
12075  * @dbus_error_name: D-Bus error name.
12076  * @dbus_error_message: D-Bus error message.
12077  *
12078  * Creates a #GError based on the contents of @dbus_error_name and
12079  * @dbus_error_message.
12080  *
12081  * Errors registered with g_dbus_error_register_error() will be looked
12082  * up using @dbus_error_name and if a match is found, the error domain
12083  * and code is used. Applications can use g_dbus_error_get_remote_error()
12084  * to recover @dbus_error_name.
12085  *
12086  * If a match against a registered error is not found and the D-Bus
12087  * error name is in a form as returned by g_dbus_error_encode_gerror()
12088  * the error domain and code encoded in the name is used to
12089  * create the #GError. Also, @dbus_error_name is added to the error message
12090  * such that it can be recovered with g_dbus_error_get_remote_error().
12091  *
12092  * Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
12093  * in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
12094  * added to the error message such that it can be recovered with
12095  * g_dbus_error_get_remote_error().
12096  *
12097  * In all three cases, @dbus_error_name can always be recovered from the
12098  * returned #GError using the g_dbus_error_get_remote_error() function
12099  * (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
12100  *
12101  * This function is typically only used in object mappings to prepare
12102  * #GError instances for applications. Regular applications should not use
12103  * it.
12104  *
12105  * Returns: An allocated #GError. Free with g_error_free().
12106  * Since: 2.26
12107  */
12108
12109
12110 /**
12111  * g_dbus_error_register_error:
12112  * @error_domain: A #GQuark for a error domain.
12113  * @error_code: An error code.
12114  * @dbus_error_name: A D-Bus error name.
12115  *
12116  * Creates an association to map between @dbus_error_name and
12117  * #GError<!-- -->s specified by @error_domain and @error_code.
12118  *
12119  * This is typically done in the routine that returns the #GQuark for
12120  * an error domain.
12121  *
12122  * Returns: %TRUE if the association was created, %FALSE if it already exists.
12123  * Since: 2.26
12124  */
12125
12126
12127 /**
12128  * g_dbus_error_register_error_domain:
12129  * @error_domain_quark_name: The error domain name.
12130  * @quark_volatile: A pointer where to store the #GQuark.
12131  * @entries: A pointer to @num_entries #GDBusErrorEntry struct items.
12132  * @num_entries: Number of items to register.
12133  *
12134  * Helper function for associating a #GError error domain with D-Bus error names.
12135  *
12136  * Since: 2.26
12137  */
12138
12139
12140 /**
12141  * g_dbus_error_set_dbus_error:
12142  * @error: A pointer to a #GError or %NULL.
12143  * @dbus_error_name: D-Bus error name.
12144  * @dbus_error_message: D-Bus error message.
12145  * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
12146  * @...: Arguments for @format.
12147  *
12148  * Does nothing if @error is %NULL. Otherwise sets *@error to
12149  * a new #GError created with g_dbus_error_new_for_dbus_error()
12150  * with @dbus_error_message prepend with @format (unless %NULL).
12151  *
12152  * Since: 2.26
12153  */
12154
12155
12156 /**
12157  * g_dbus_error_set_dbus_error_valist:
12158  * @error: A pointer to a #GError or %NULL.
12159  * @dbus_error_name: D-Bus error name.
12160  * @dbus_error_message: D-Bus error message.
12161  * @format: (allow-none): printf()-style format to prepend to @dbus_error_message or %NULL.
12162  * @var_args: Arguments for @format.
12163  *
12164  * Like g_dbus_error_set_dbus_error() but intended for language bindings.
12165  *
12166  * Since: 2.26
12167  */
12168
12169
12170 /**
12171  * g_dbus_error_strip_remote_error:
12172  * @error: A #GError.
12173  *
12174  * Looks for extra information in the error message used to recover
12175  * the D-Bus error name and strips it if found. If stripped, the
12176  * message field in @error will correspond exactly to what was
12177  * received on the wire.
12178  *
12179  * This is typically used when presenting errors to the end user.
12180  *
12181  * Returns: %TRUE if information was stripped, %FALSE otherwise.
12182  * Since: 2.26
12183  */
12184
12185
12186 /**
12187  * g_dbus_error_unregister_error:
12188  * @error_domain: A #GQuark for a error domain.
12189  * @error_code: An error code.
12190  * @dbus_error_name: A D-Bus error name.
12191  *
12192  * Destroys an association previously set up with g_dbus_error_register_error().
12193  *
12194  * Returns: %TRUE if the association was destroyed, %FALSE if it wasn't found.
12195  * Since: 2.26
12196  */
12197
12198
12199 /**
12200  * g_dbus_generate_guid:
12201  *
12202  * Generate a D-Bus GUID that can be used with
12203  * e.g. g_dbus_connection_new().
12204  *
12205  * See the D-Bus specification regarding what strings are valid D-Bus
12206  * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
12207  *
12208  * Returns: A valid D-Bus GUID. Free with g_free().
12209  * Since: 2.26
12210  */
12211
12212
12213 /**
12214  * g_dbus_gvalue_to_gvariant:
12215  * @gvalue: A #GValue to convert to a #GVariant.
12216  * @type: A #GVariantType.
12217  *
12218  * Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
12219  *
12220  * The conversion is using the following rules:
12221  * <table frame='all'>
12222  *   <title>#GValue / #GVariant conversion rules</title>
12223  *   <tgroup cols='2' align='left' colsep='1' rowsep='1'>
12224  *     <thead>
12225  *       <row>
12226  *         <entry>If the #GType for @gvalue is...</entry>
12227  *         <entry>... then @type must be</entry>
12228  *       </row>
12229  *     </thead>
12230  *     <tbody>
12231  *       <row>
12232  *         <entry>#G_TYPE_STRING</entry>
12233  *         <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>
12234  *       </row>
12235  *       <row>
12236  *         <entry>#G_TYPE_STRV</entry>
12237  *         <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>
12238  *       </row>
12239  *       <row>
12240  *         <entry>#G_TYPE_BOOLEAN</entry>
12241  *         <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
12242  *       </row>
12243  *       <row>
12244  *         <entry>#G_TYPE_UCHAR</entry>
12245  *         <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
12246  *       </row>
12247  *       <row>
12248  *         <entry>#G_TYPE_INT</entry>
12249  *         <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
12250  *       </row>
12251  *       <row>
12252  *         <entry>#G_TYPE_UINT</entry>
12253  *         <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
12254  *       </row>
12255  *       <row>
12256  *         <entry>#G_TYPE_INT64</entry>
12257  *         <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
12258  *       </row>
12259  *       <row>
12260  *         <entry>#G_TYPE_UINT64</entry>
12261  *         <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
12262  *       </row>
12263  *       <row>
12264  *         <entry>#G_TYPE_DOUBLE</entry>
12265  *         <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
12266  *       </row>
12267  *       <row>
12268  *         <entry>#G_TYPE_VARIANT</entry>
12269  *         <entry>Any #GVariantType</entry>
12270  *       </row>
12271  *     </tbody>
12272  *   </tgroup>
12273  * </table>
12274  * This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
12275  * is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
12276  * also fail for any #GType (including e.g. #G_TYPE_OBJECT and
12277  * #G_TYPE_BOXED derived-types) not in the table above.
12278  *
12279  * Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
12280  * %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
12281  * %NULL) for @type is returned (e.g. 0 for scalar types, the empty
12282  * string for string types, <literal>'/'</literal> for object path
12283  * types, the empty array for any array type and so on).
12284  *
12285  * See the g_dbus_gvariant_to_gvalue() function for how to convert a
12286  * #GVariant to a #GValue.
12287  *
12288  * Returns: A #GVariant (never floating) of #GVariantType @type holding the data from @gvalue or %NULL in case of failure. Free with g_variant_unref().
12289  * Since: 2.30
12290  */
12291
12292
12293 /**
12294  * g_dbus_gvariant_to_gvalue:
12295  * @value: A #GVariant.
12296  * @out_gvalue: Return location pointing to a zero-filled (uninitialized) #GValue.
12297  *
12298  * Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
12299  *
12300  * The rules specified in the g_dbus_gvalue_to_gvariant() function are
12301  * used - this function is essentially its reverse form.
12302  *
12303  * The conversion never fails - a valid #GValue is always returned in
12304  * @out_gvalue.
12305  *
12306  * Since: 2.30
12307  */
12308
12309
12310 /**
12311  * g_dbus_interface_dup_object:
12312  * @interface_: An exported D-Bus interface.
12313  *
12314  * Gets the #GDBusObject that @interface_ belongs to, if any.
12315  *
12316  * Returns: (transfer full): A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
12317  * Since: 2.32
12318  * Rename to: g_dbus_interface_get_object
12319  */
12320
12321
12322 /**
12323  * g_dbus_interface_get_info:
12324  * @interface_: An exported D-Bus interface.
12325  *
12326  * Gets D-Bus introspection information for the D-Bus interface
12327  * implemented by @interface_.
12328  *
12329  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
12330  * Since: 2.30
12331  */
12332
12333
12334 /**
12335  * g_dbus_interface_get_object: (skip)
12336  * @interface_: An exported D-Bus interface.
12337  *
12338  * Gets the #GDBusObject that @interface_ belongs to, if any.
12339  *
12340  * <warning>It is not safe to use the returned object if @interface_
12341  * or the returned object is being used from other threads. See
12342  * g_dbus_interface_dup_object() for a thread-safe
12343  * alternative.</warning>
12344  *
12345  * Returns: (transfer none): A #GDBusObject or %NULL. The returned reference belongs to @interface_ and should not be freed.
12346  * Since: 2.30
12347  */
12348
12349
12350 /**
12351  * g_dbus_interface_info_cache_build:
12352  * @info: A #GDBusInterfaceInfo.
12353  *
12354  * Builds a lookup-cache to speed up
12355  * g_dbus_interface_info_lookup_method(),
12356  * g_dbus_interface_info_lookup_signal() and
12357  * g_dbus_interface_info_lookup_property().
12358  *
12359  * If this has already been called with @info, the existing cache is
12360  * used and its use count is increased.
12361  *
12362  * Note that @info cannot be modified until
12363  * g_dbus_interface_info_cache_release() is called.
12364  *
12365  * Since: 2.30
12366  */
12367
12368
12369 /**
12370  * g_dbus_interface_info_cache_release:
12371  * @info: A GDBusInterfaceInfo
12372  *
12373  * Decrements the usage count for the cache for @info built by
12374  * g_dbus_interface_info_cache_build() (if any) and frees the
12375  * resources used by the cache if the usage count drops to zero.
12376  *
12377  * Since: 2.30
12378  */
12379
12380
12381 /**
12382  * g_dbus_interface_info_generate_xml:
12383  * @info: A #GDBusNodeInfo
12384  * @indent: Indentation level.
12385  * @string_builder: (out): A #GString to to append XML data to.
12386  *
12387  * Appends an XML representation of @info (and its children) to @string_builder.
12388  *
12389  * This function is typically used for generating introspection XML
12390  * documents at run-time for handling the
12391  * <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
12392  * method.
12393  *
12394  * Since: 2.26
12395  */
12396
12397
12398 /**
12399  * g_dbus_interface_info_lookup_method:
12400  * @info: A #GDBusInterfaceInfo.
12401  * @name: A D-Bus method name (typically in CamelCase)
12402  *
12403  * Looks up information about a method.
12404  *
12405  * This cost of this function is O(n) in number of methods unless
12406  * g_dbus_interface_info_cache_build() has been used on @info.
12407  *
12408  * Returns: (transfer none): A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
12409  * Since: 2.26
12410  */
12411
12412
12413 /**
12414  * g_dbus_interface_info_lookup_property:
12415  * @info: A #GDBusInterfaceInfo.
12416  * @name: A D-Bus property name (typically in CamelCase).
12417  *
12418  * Looks up information about a property.
12419  *
12420  * This cost of this function is O(n) in number of properties unless
12421  * g_dbus_interface_info_cache_build() has been used on @info.
12422  *
12423  * Returns: (transfer none): A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
12424  * Since: 2.26
12425  */
12426
12427
12428 /**
12429  * g_dbus_interface_info_lookup_signal:
12430  * @info: A #GDBusInterfaceInfo.
12431  * @name: A D-Bus signal name (typically in CamelCase)
12432  *
12433  * Looks up information about a signal.
12434  *
12435  * This cost of this function is O(n) in number of signals unless
12436  * g_dbus_interface_info_cache_build() has been used on @info.
12437  *
12438  * Returns: (transfer none): A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
12439  * Since: 2.26
12440  */
12441
12442
12443 /**
12444  * g_dbus_interface_info_ref:
12445  * @info: A #GDBusInterfaceInfo
12446  *
12447  * If @info is statically allocated does nothing. Otherwise increases
12448  * the reference count.
12449  *
12450  * Returns: The same @info.
12451  * Since: 2.26
12452  */
12453
12454
12455 /**
12456  * g_dbus_interface_info_unref:
12457  * @info: A #GDBusInterfaceInfo.
12458  *
12459  * If @info is statically allocated, does nothing. Otherwise decreases
12460  * the reference count of @info. When its reference count drops to 0,
12461  * the memory used is freed.
12462  *
12463  * Since: 2.26
12464  */
12465
12466
12467 /**
12468  * g_dbus_interface_set_object:
12469  * @interface_: An exported D-Bus interface.
12470  * @object: (allow-none): A #GDBusObject or %NULL.
12471  *
12472  * Sets the #GDBusObject for @interface_ to @object.
12473  *
12474  * Note that @interface_ will hold a weak reference to @object.
12475  *
12476  * Since: 2.30
12477  */
12478
12479
12480 /**
12481  * g_dbus_interface_skeleton_export:
12482  * @interface_: The D-Bus interface to export.
12483  * @connection: A #GDBusConnection to export @interface_ on.
12484  * @object_path: The path to export the interface at.
12485  * @error: Return location for error or %NULL.
12486  *
12487  * Exports @interface_ at @object_path on @connection.
12488  *
12489  * This can be called multiple times to export the same @interface_
12490  * onto multiple connections however the @object_path provided must be
12491  * the same for all connections.
12492  *
12493  * Use g_dbus_interface_skeleton_unexport() to unexport the object.
12494  *
12495  * Returns: %TRUE if the interface was exported on @connection, otherwise %FALSE with @error set.
12496  * Since: 2.30
12497  */
12498
12499
12500 /**
12501  * g_dbus_interface_skeleton_flush:
12502  * @interface_: A #GDBusInterfaceSkeleton.
12503  *
12504  * If @interface_ has outstanding changes, request for these changes to be
12505  * emitted immediately.
12506  *
12507  * For example, an exported D-Bus interface may queue up property
12508  * changes and emit the
12509  * <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
12510  * signal later (e.g. in an idle handler). This technique is useful
12511  * for collapsing multiple property changes into one.
12512  *
12513  * Since: 2.30
12514  */
12515
12516
12517 /**
12518  * g_dbus_interface_skeleton_get_connection:
12519  * @interface_: A #GDBusInterfaceSkeleton.
12520  *
12521  * Gets the first connection that @interface_ is exported on, if any.
12522  *
12523  * Returns: (transfer none): A #GDBusConnection or %NULL if @interface_ is not exported anywhere. Do not free, the object belongs to @interface_.
12524  * Since: 2.30
12525  */
12526
12527
12528 /**
12529  * g_dbus_interface_skeleton_get_connections:
12530  * @interface_: A #GDBusInterfaceSkeleton.
12531  *
12532  * Gets a list of the connections that @interface_ is exported on.
12533  *
12534  * 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().
12535  * Since: 2.32
12536  */
12537
12538
12539 /**
12540  * g_dbus_interface_skeleton_get_flags:
12541  * @interface_: A #GDBusInterfaceSkeleton.
12542  *
12543  * Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
12544  * of @interface_
12545  *
12546  * Returns: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
12547  * Since: 2.30
12548  */
12549
12550
12551 /**
12552  * g_dbus_interface_skeleton_get_info:
12553  * @interface_: A #GDBusInterfaceSkeleton.
12554  *
12555  * Gets D-Bus introspection information for the D-Bus interface
12556  * implemented by @interface_.
12557  *
12558  * Returns: (transfer none): A #GDBusInterfaceInfo (never %NULL). Do not free.
12559  * Since: 2.30
12560  */
12561
12562
12563 /**
12564  * g_dbus_interface_skeleton_get_object_path:
12565  * @interface_: A #GDBusInterfaceSkeleton.
12566  *
12567  * Gets the object path that @interface_ is exported on, if any.
12568  *
12569  * Returns: A string owned by @interface_ or %NULL if @interface_ is not exported anywhere. Do not free, the string belongs to @interface_.
12570  * Since: 2.30
12571  */
12572
12573
12574 /**
12575  * g_dbus_interface_skeleton_get_properties:
12576  * @interface_: A #GDBusInterfaceSkeleton.
12577  *
12578  * Gets all D-Bus properties for @interface_.
12579  *
12580  * Returns: (transfer full): A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
12581  * Since: 2.30
12582  */
12583
12584
12585 /**
12586  * g_dbus_interface_skeleton_get_vtable: (skip)
12587  * @interface_: A #GDBusInterfaceSkeleton.
12588  *
12589  * Gets the interface vtable for the D-Bus interface implemented by
12590  * @interface_. The returned function pointers should expect @interface_
12591  * itself to be passed as @user_data.
12592  *
12593  * Returns: A #GDBusInterfaceVTable (never %NULL).
12594  * Since: 2.30
12595  */
12596
12597
12598 /**
12599  * g_dbus_interface_skeleton_has_connection:
12600  * @interface_: A #GDBusInterfaceSkeleton.
12601  * @connection: A #GDBusConnection.
12602  *
12603  * Checks if @interface_ is export on @connection.
12604  *
12605  * Returns: %TRUE if @interface_ is exported on @connection, %FALSE otherwise.
12606  * Since: 2.32
12607  */
12608
12609
12610 /**
12611  * g_dbus_interface_skeleton_set_flags:
12612  * @interface_: A #GDBusInterfaceSkeleton.
12613  * @flags: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
12614  *
12615  * Sets flags describing what the behavior of @skeleton should be.
12616  *
12617  * Since: 2.30
12618  */
12619
12620
12621 /**
12622  * g_dbus_interface_skeleton_unexport:
12623  * @interface_: A #GDBusInterfaceSkeleton.
12624  *
12625  * Stops exporting @interface_ on all connections it is exported on.
12626  *
12627  * To unexport @interface_ from only a single connection, use
12628  * g_dbus_interface_skeleton_unexport_from_connection()
12629  *
12630  * Since: 2.30
12631  */
12632
12633
12634 /**
12635  * g_dbus_interface_skeleton_unexport_from_connection:
12636  * @interface_: A #GDBusInterfaceSkeleton.
12637  * @connection: A #GDBusConnection.
12638  *
12639  * Stops exporting @interface_ on @connection.
12640  *
12641  * To stop exporting on all connections the interface is exported on,
12642  * use g_dbus_interface_skeleton_unexport().
12643  *
12644  * Since: 2.32
12645  */
12646
12647
12648 /**
12649  * g_dbus_is_address:
12650  * @string: A string.
12651  *
12652  * Checks if @string is a D-Bus address.
12653  *
12654  * This doesn't check if @string is actually supported by #GDBusServer
12655  * or #GDBusConnection - use g_dbus_is_supported_address() to do more
12656  * checks.
12657  *
12658  * Returns: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
12659  * Since: 2.26
12660  */
12661
12662
12663 /**
12664  * g_dbus_is_guid:
12665  * @string: The string to check.
12666  *
12667  * Checks if @string is a D-Bus GUID.
12668  *
12669  * See the D-Bus specification regarding what strings are valid D-Bus
12670  * GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
12671  *
12672  * Returns: %TRUE if @string is a guid, %FALSE otherwise.
12673  * Since: 2.26
12674  */
12675
12676
12677 /**
12678  * g_dbus_is_interface_name:
12679  * @string: The string to check.
12680  *
12681  * Checks if @string is a valid D-Bus interface name.
12682  *
12683  * Returns: %TRUE if valid, %FALSE otherwise.
12684  * Since: 2.26
12685  */
12686
12687
12688 /**
12689  * g_dbus_is_member_name:
12690  * @string: The string to check.
12691  *
12692  * Checks if @string is a valid D-Bus member (e.g. signal or method) name.
12693  *
12694  * Returns: %TRUE if valid, %FALSE otherwise.
12695  * Since: 2.26
12696  */
12697
12698
12699 /**
12700  * g_dbus_is_name:
12701  * @string: The string to check.
12702  *
12703  * Checks if @string is a valid D-Bus bus name (either unique or well-known).
12704  *
12705  * Returns: %TRUE if valid, %FALSE otherwise.
12706  * Since: 2.26
12707  */
12708
12709
12710 /**
12711  * g_dbus_is_supported_address:
12712  * @string: A string.
12713  * @error: Return location for error or %NULL.
12714  *
12715  * Like g_dbus_is_address() but also checks if the library suppors the
12716  * transports in @string and that key/value pairs for each transport
12717  * are valid.
12718  *
12719  * Returns: %TRUE if @string is a valid D-Bus address that is supported by this library, %FALSE if @error is set.
12720  * Since: 2.26
12721  */
12722
12723
12724 /**
12725  * g_dbus_is_unique_name:
12726  * @string: The string to check.
12727  *
12728  * Checks if @string is a valid D-Bus unique bus name.
12729  *
12730  * Returns: %TRUE if valid, %FALSE otherwise.
12731  * Since: 2.26
12732  */
12733
12734
12735 /**
12736  * g_dbus_menu_model_get:
12737  * @connection: a #GDBusConnection
12738  * @bus_name: the bus name which exports the menu model
12739  * @object_path: the object path at which the menu model is exported
12740  *
12741  * Obtains a #GDBusMenuModel for the menu model which is exported
12742  * at the given @bus_name and @object_path.
12743  *
12744  * The thread default main context is taken at the time of this call.
12745  * All signals on the menu model (and any linked models) are reported
12746  * with respect to this context.  All calls on the returned menu model
12747  * (and linked models) must also originate from this same context, with
12748  * the thread default main context unchanged.
12749  *
12750  * Returns: (transfer full): a #GDBusMenuModel object. Free with g_object_unref().
12751  * Since: 2.32
12752  */
12753
12754
12755 /**
12756  * g_dbus_message_bytes_needed:
12757  * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
12758  * @blob_len: The length of @blob (must be at least 16).
12759  * @error: Return location for error or %NULL.
12760  *
12761  * Utility function to calculate how many bytes are needed to
12762  * completely deserialize the D-Bus message stored at @blob.
12763  *
12764  * 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).
12765  * Since: 2.26
12766  */
12767
12768
12769 /**
12770  * g_dbus_message_copy:
12771  * @message: A #GDBusMessage.
12772  * @error: Return location for error or %NULL.
12773  *
12774  * Copies @message. The copy is a deep copy and the returned
12775  * #GDBusMessage is completely identical except that it is guaranteed
12776  * to not be locked.
12777  *
12778  * This operation can fail if e.g. @message contains file descriptors
12779  * and the per-process or system-wide open files limit is reached.
12780  *
12781  * Returns: (transfer full): A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
12782  * Since: 2.26
12783  */
12784
12785
12786 /**
12787  * g_dbus_message_get_arg0:
12788  * @message: A #GDBusMessage.
12789  *
12790  * Convenience to get the first item in the body of @message.
12791  *
12792  * Returns: The string item or %NULL if the first item in the body of @message is not a string.
12793  * Since: 2.26
12794  */
12795
12796
12797 /**
12798  * g_dbus_message_get_body:
12799  * @message: A #GDBusMessage.
12800  *
12801  * Gets the body of a message.
12802  *
12803  * Returns: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
12804  * Since: 2.26
12805  */
12806
12807
12808 /**
12809  * g_dbus_message_get_byte_order:
12810  * @message: A #GDBusMessage.
12811  *
12812  * Gets the byte order of @message.
12813  *
12814  * Returns: The byte order.
12815  */
12816
12817
12818 /**
12819  * g_dbus_message_get_destination:
12820  * @message: A #GDBusMessage.
12821  *
12822  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
12823  *
12824  * Returns: The value.
12825  * Since: 2.26
12826  */
12827
12828
12829 /**
12830  * g_dbus_message_get_error_name:
12831  * @message: A #GDBusMessage.
12832  *
12833  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
12834  *
12835  * Returns: The value.
12836  * Since: 2.26
12837  */
12838
12839
12840 /**
12841  * g_dbus_message_get_flags:
12842  * @message: A #GDBusMessage.
12843  *
12844  * Gets the flags for @message.
12845  *
12846  * Returns: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
12847  * Since: 2.26
12848  */
12849
12850
12851 /**
12852  * g_dbus_message_get_header:
12853  * @message: A #GDBusMessage.
12854  * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
12855  *
12856  * Gets a header field on @message.
12857  *
12858  * Returns: A #GVariant with the value if the header was found, %NULL otherwise. Do not free, it is owned by @message.
12859  * Since: 2.26
12860  */
12861
12862
12863 /**
12864  * g_dbus_message_get_header_fields:
12865  * @message: A #GDBusMessage.
12866  *
12867  * Gets an array of all header fields on @message that are set.
12868  *
12869  * 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().
12870  * Since: 2.26
12871  */
12872
12873
12874 /**
12875  * g_dbus_message_get_interface:
12876  * @message: A #GDBusMessage.
12877  *
12878  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
12879  *
12880  * Returns: The value.
12881  * Since: 2.26
12882  */
12883
12884
12885 /**
12886  * g_dbus_message_get_locked:
12887  * @message: A #GDBusMessage.
12888  *
12889  * Checks whether @message is locked. To monitor changes to this
12890  * value, conncet to the #GObject::notify signal to listen for changes
12891  * on the #GDBusMessage:locked property.
12892  *
12893  * Returns: %TRUE if @message is locked, %FALSE otherwise.
12894  * Since: 2.26
12895  */
12896
12897
12898 /**
12899  * g_dbus_message_get_member:
12900  * @message: A #GDBusMessage.
12901  *
12902  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
12903  *
12904  * Returns: The value.
12905  * Since: 2.26
12906  */
12907
12908
12909 /**
12910  * g_dbus_message_get_message_type:
12911  * @message: A #GDBusMessage.
12912  *
12913  * Gets the type of @message.
12914  *
12915  * Returns: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
12916  * Since: 2.26
12917  */
12918
12919
12920 /**
12921  * g_dbus_message_get_num_unix_fds:
12922  * @message: A #GDBusMessage.
12923  *
12924  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
12925  *
12926  * Returns: The value.
12927  * Since: 2.26
12928  */
12929
12930
12931 /**
12932  * g_dbus_message_get_path:
12933  * @message: A #GDBusMessage.
12934  *
12935  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
12936  *
12937  * Returns: The value.
12938  * Since: 2.26
12939  */
12940
12941
12942 /**
12943  * g_dbus_message_get_reply_serial:
12944  * @message: A #GDBusMessage.
12945  *
12946  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
12947  *
12948  * Returns: The value.
12949  * Since: 2.26
12950  */
12951
12952
12953 /**
12954  * g_dbus_message_get_sender:
12955  * @message: A #GDBusMessage.
12956  *
12957  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
12958  *
12959  * Returns: The value.
12960  * Since: 2.26
12961  */
12962
12963
12964 /**
12965  * g_dbus_message_get_serial:
12966  * @message: A #GDBusMessage.
12967  *
12968  * Gets the serial for @message.
12969  *
12970  * Returns: A #guint32.
12971  * Since: 2.26
12972  */
12973
12974
12975 /**
12976  * g_dbus_message_get_signature:
12977  * @message: A #GDBusMessage.
12978  *
12979  * Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
12980  *
12981  * Returns: The value.
12982  * Since: 2.26
12983  */
12984
12985
12986 /**
12987  * g_dbus_message_get_unix_fd_list:
12988  * @message: A #GDBusMessage.
12989  *
12990  * Gets the UNIX file descriptors associated with @message, if any.
12991  *
12992  * This method is only available on UNIX.
12993  *
12994  * Returns: (transfer none): A #GUnixFDList or %NULL if no file descriptors are associated. Do not free, this object is owned by @message.
12995  * Since: 2.26
12996  */
12997
12998
12999 /**
13000  * g_dbus_message_lock:
13001  * @message: A #GDBusMessage.
13002  *
13003  * If @message is locked, does nothing. Otherwise locks the message.
13004  *
13005  * Since: 2.26
13006  */
13007
13008
13009 /**
13010  * g_dbus_message_new:
13011  *
13012  * Creates a new empty #GDBusMessage.
13013  *
13014  * Returns: A #GDBusMessage. Free with g_object_unref().
13015  * Since: 2.26
13016  */
13017
13018
13019 /**
13020  * g_dbus_message_new_from_blob:
13021  * @blob: (array length=blob_len) (element-type guint8): A blob represent a binary D-Bus message.
13022  * @blob_len: The length of @blob.
13023  * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
13024  * @error: Return location for error or %NULL.
13025  *
13026  * Creates a new #GDBusMessage from the data stored at @blob. The byte
13027  * order that the message was in can be retrieved using
13028  * g_dbus_message_get_byte_order().
13029  *
13030  * Returns: A new #GDBusMessage or %NULL if @error is set. Free with g_object_unref().
13031  * Since: 2.26
13032  */
13033
13034
13035 /**
13036  * g_dbus_message_new_method_call:
13037  * @name: (allow-none): A valid D-Bus name or %NULL.
13038  * @path: A valid object path.
13039  * @interface_: (allow-none): A valid D-Bus interface name or %NULL.
13040  * @method: A valid method name.
13041  *
13042  * Creates a new #GDBusMessage for a method call.
13043  *
13044  * Returns: A #GDBusMessage. Free with g_object_unref().
13045  * Since: 2.26
13046  */
13047
13048
13049 /**
13050  * g_dbus_message_new_method_error:
13051  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
13052  * @error_name: A valid D-Bus error name.
13053  * @error_message_format: The D-Bus error message in a printf() format.
13054  * @...: Arguments for @error_message_format.
13055  *
13056  * Creates a new #GDBusMessage that is an error reply to @method_call_message.
13057  *
13058  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
13059  * Since: 2.26
13060  */
13061
13062
13063 /**
13064  * g_dbus_message_new_method_error_literal:
13065  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
13066  * @error_name: A valid D-Bus error name.
13067  * @error_message: The D-Bus error message.
13068  *
13069  * Creates a new #GDBusMessage that is an error reply to @method_call_message.
13070  *
13071  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
13072  * Since: 2.26
13073  */
13074
13075
13076 /**
13077  * g_dbus_message_new_method_error_valist:
13078  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
13079  * @error_name: A valid D-Bus error name.
13080  * @error_message_format: The D-Bus error message in a printf() format.
13081  * @var_args: Arguments for @error_message_format.
13082  *
13083  * Like g_dbus_message_new_method_error() but intended for language bindings.
13084  *
13085  * Returns: (transfer full): A #GDBusMessage. Free with g_object_unref().
13086  * Since: 2.26
13087  */
13088
13089
13090 /**
13091  * g_dbus_message_new_method_reply:
13092  * @method_call_message: A message of type %G_DBUS_MESSAGE_TYPE_METHOD_CALL to create a reply message to.
13093  *
13094  * Creates a new #GDBusMessage that is a reply to @method_call_message.
13095  *
13096  * Returns: (transfer full): #GDBusMessage. Free with g_object_unref().
13097  * Since: 2.26
13098  */
13099
13100
13101 /**
13102  * g_dbus_message_new_signal:
13103  * @path: A valid object path.
13104  * @interface_: A valid D-Bus interface name.
13105  * @signal: A valid signal name.
13106  *
13107  * Creates a new #GDBusMessage for a signal emission.
13108  *
13109  * Returns: A #GDBusMessage. Free with g_object_unref().
13110  * Since: 2.26
13111  */
13112
13113
13114 /**
13115  * g_dbus_message_print:
13116  * @message: A #GDBusMessage.
13117  * @indent: Indentation level.
13118  *
13119  * Produces a human-readable multi-line description of @message.
13120  *
13121  * The contents of the description has no ABI guarantees, the contents
13122  * and formatting is subject to change at any time. Typical output
13123  * looks something like this:
13124  * <programlisting>
13125  * Type&colon;    method-call
13126  * Flags&colon;   none
13127  * Version&colon; 0
13128  * Serial&colon;  4
13129  * Headers&colon;
13130  *   path -> objectpath '/org/gtk/GDBus/TestObject'
13131  *   interface -> 'org.gtk.GDBus.TestInterface'
13132  *   member -> 'GimmeStdout'
13133  *   destination -> ':1.146'
13134  * Body&colon; ()
13135  * UNIX File Descriptors:
13136  *   (none)
13137  * </programlisting>
13138  * or
13139  * <programlisting>
13140  * Type&colon;    method-return
13141  * Flags&colon;   no-reply-expected
13142  * Version&colon; 0
13143  * Serial&colon;  477
13144  * Headers&colon;
13145  *   reply-serial -> uint32 4
13146  *   destination -> ':1.159'
13147  *   sender -> ':1.146'
13148  *   num-unix-fds -> uint32 1
13149  * Body&colon; ()
13150  * UNIX File Descriptors&colon;
13151  *   fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
13152  * </programlisting>
13153  *
13154  * Returns: A string that should be freed with g_free().
13155  * Since: 2.26
13156  */
13157
13158
13159 /**
13160  * g_dbus_message_set_body:
13161  * @message: A #GDBusMessage.
13162  * @body: Either %NULL or a #GVariant that is a tuple.
13163  *
13164  * Sets the body @message. As a side-effect the
13165  * %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
13166  * type string of @body (or cleared if @body is %NULL).
13167  *
13168  * If @body is floating, @message assumes ownership of @body.
13169  *
13170  * Since: 2.26
13171  */
13172
13173
13174 /**
13175  * g_dbus_message_set_byte_order:
13176  * @message: A #GDBusMessage.
13177  * @byte_order: The byte order.
13178  *
13179  * Sets the byte order of @message.
13180  */
13181
13182
13183 /**
13184  * g_dbus_message_set_destination:
13185  * @message: A #GDBusMessage.
13186  * @value: The value to set.
13187  *
13188  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
13189  *
13190  * Since: 2.26
13191  */
13192
13193
13194 /**
13195  * g_dbus_message_set_error_name:
13196  * @message: A #GDBusMessage.
13197  * @value: The value to set.
13198  *
13199  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
13200  *
13201  * Since: 2.26
13202  */
13203
13204
13205 /**
13206  * g_dbus_message_set_flags:
13207  * @message: A #GDBusMessage.
13208  * @flags: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
13209  *
13210  * Sets the flags to set on @message.
13211  *
13212  * Since: 2.26
13213  */
13214
13215
13216 /**
13217  * g_dbus_message_set_header:
13218  * @message: A #GDBusMessage.
13219  * @header_field: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
13220  * @value: (allow-none): A #GVariant to set the header field or %NULL to clear the header field.
13221  *
13222  * Sets a header field on @message.
13223  *
13224  * If @value is floating, @message assumes ownership of @value.
13225  *
13226  * Since: 2.26
13227  */
13228
13229
13230 /**
13231  * g_dbus_message_set_interface:
13232  * @message: A #GDBusMessage.
13233  * @value: The value to set.
13234  *
13235  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
13236  *
13237  * Since: 2.26
13238  */
13239
13240
13241 /**
13242  * g_dbus_message_set_member:
13243  * @message: A #GDBusMessage.
13244  * @value: The value to set.
13245  *
13246  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
13247  *
13248  * Since: 2.26
13249  */
13250
13251
13252 /**
13253  * g_dbus_message_set_message_type:
13254  * @message: A #GDBusMessage.
13255  * @type: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
13256  *
13257  * Sets @message to be of @type.
13258  *
13259  * Since: 2.26
13260  */
13261
13262
13263 /**
13264  * g_dbus_message_set_num_unix_fds:
13265  * @message: A #GDBusMessage.
13266  * @value: The value to set.
13267  *
13268  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
13269  *
13270  * Since: 2.26
13271  */
13272
13273
13274 /**
13275  * g_dbus_message_set_path:
13276  * @message: A #GDBusMessage.
13277  * @value: The value to set.
13278  *
13279  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
13280  *
13281  * Since: 2.26
13282  */
13283
13284
13285 /**
13286  * g_dbus_message_set_reply_serial:
13287  * @message: A #GDBusMessage.
13288  * @value: The value to set.
13289  *
13290  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
13291  *
13292  * Since: 2.26
13293  */
13294
13295
13296 /**
13297  * g_dbus_message_set_sender:
13298  * @message: A #GDBusMessage.
13299  * @value: The value to set.
13300  *
13301  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
13302  *
13303  * Since: 2.26
13304  */
13305
13306
13307 /**
13308  * g_dbus_message_set_serial:
13309  * @message: A #GDBusMessage.
13310  * @serial: A #guint32.
13311  *
13312  * Sets the serial for @message.
13313  *
13314  * Since: 2.26
13315  */
13316
13317
13318 /**
13319  * g_dbus_message_set_signature:
13320  * @message: A #GDBusMessage.
13321  * @value: The value to set.
13322  *
13323  * Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
13324  *
13325  * Since: 2.26
13326  */
13327
13328
13329 /**
13330  * g_dbus_message_set_unix_fd_list:
13331  * @message: A #GDBusMessage.
13332  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
13333  *
13334  * Sets the UNIX file descriptors associated with @message. As a
13335  * side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
13336  * field is set to the number of fds in @fd_list (or cleared if
13337  * @fd_list is %NULL).
13338  *
13339  * This method is only available on UNIX.
13340  *
13341  * Since: 2.26
13342  */
13343
13344
13345 /**
13346  * g_dbus_message_to_blob:
13347  * @message: A #GDBusMessage.
13348  * @out_size: Return location for size of generated blob.
13349  * @capabilities: A #GDBusCapabilityFlags describing what protocol features are supported.
13350  * @error: Return location for error.
13351  *
13352  * Serializes @message to a blob. The byte order returned by
13353  * g_dbus_message_get_byte_order() will be used.
13354  *
13355  * 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().
13356  * Since: 2.26
13357  */
13358
13359
13360 /**
13361  * g_dbus_message_to_gerror:
13362  * @message: A #GDBusMessage.
13363  * @error: The #GError to set.
13364  *
13365  * If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
13366  * nothing and returns %FALSE.
13367  *
13368  * Otherwise this method encodes the error in @message as a #GError
13369  * using g_dbus_error_set_dbus_error() using the information in the
13370  * %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
13371  * well as the first string item in @message's body.
13372  *
13373  * Returns: %TRUE if @error was set, %FALSE otherwise.
13374  * Since: 2.26
13375  */
13376
13377
13378 /**
13379  * g_dbus_method_info_ref:
13380  * @info: A #GDBusMethodInfo
13381  *
13382  * If @info is statically allocated does nothing. Otherwise increases
13383  * the reference count.
13384  *
13385  * Returns: The same @info.
13386  * Since: 2.26
13387  */
13388
13389
13390 /**
13391  * g_dbus_method_info_unref:
13392  * @info: A #GDBusMethodInfo.
13393  *
13394  * If @info is statically allocated, does nothing. Otherwise decreases
13395  * the reference count of @info. When its reference count drops to 0,
13396  * the memory used is freed.
13397  *
13398  * Since: 2.26
13399  */
13400
13401
13402 /**
13403  * g_dbus_method_invocation_get_connection:
13404  * @invocation: A #GDBusMethodInvocation.
13405  *
13406  * Gets the #GDBusConnection the method was invoked on.
13407  *
13408  * Returns: (transfer none): A #GDBusConnection. Do not free, it is owned by @invocation.
13409  * Since: 2.26
13410  */
13411
13412
13413 /**
13414  * g_dbus_method_invocation_get_interface_name:
13415  * @invocation: A #GDBusMethodInvocation.
13416  *
13417  * Gets the name of the D-Bus interface the method was invoked on.
13418  *
13419  * Returns: A string. Do not free, it is owned by @invocation.
13420  * Since: 2.26
13421  */
13422
13423
13424 /**
13425  * g_dbus_method_invocation_get_message:
13426  * @invocation: A #GDBusMethodInvocation.
13427  *
13428  * Gets the #GDBusMessage for the method invocation. This is useful if
13429  * you need to use low-level protocol features, such as UNIX file
13430  * descriptor passing, that cannot be properly expressed in the
13431  * #GVariant API.
13432  *
13433  * See <xref linkend="gdbus-server"/> and <xref
13434  * linkend="gdbus-unix-fd-client"/> for an example of how to use this
13435  * low-level API to send and receive UNIX file descriptors.
13436  *
13437  * Returns: (transfer none): #GDBusMessage. Do not free, it is owned by @invocation.
13438  * Since: 2.26
13439  */
13440
13441
13442 /**
13443  * g_dbus_method_invocation_get_method_info:
13444  * @invocation: A #GDBusMethodInvocation.
13445  *
13446  * Gets information about the method call, if any.
13447  *
13448  * Returns: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
13449  * Since: 2.26
13450  */
13451
13452
13453 /**
13454  * g_dbus_method_invocation_get_method_name:
13455  * @invocation: A #GDBusMethodInvocation.
13456  *
13457  * Gets the name of the method that was invoked.
13458  *
13459  * Returns: A string. Do not free, it is owned by @invocation.
13460  * Since: 2.26
13461  */
13462
13463
13464 /**
13465  * g_dbus_method_invocation_get_object_path:
13466  * @invocation: A #GDBusMethodInvocation.
13467  *
13468  * Gets the object path the method was invoked on.
13469  *
13470  * Returns: A string. Do not free, it is owned by @invocation.
13471  * Since: 2.26
13472  */
13473
13474
13475 /**
13476  * g_dbus_method_invocation_get_parameters:
13477  * @invocation: A #GDBusMethodInvocation.
13478  *
13479  * Gets the parameters of the method invocation. If there are no input
13480  * parameters then this will return a GVariant with 0 children rather than NULL.
13481  *
13482  * Returns: (transfer none): A #GVariant tuple. Do not unref this because it is owned by @invocation.
13483  * Since: 2.26
13484  */
13485
13486
13487 /**
13488  * g_dbus_method_invocation_get_sender:
13489  * @invocation: A #GDBusMethodInvocation.
13490  *
13491  * Gets the bus name that invoked the method.
13492  *
13493  * Returns: A string. Do not free, it is owned by @invocation.
13494  * Since: 2.26
13495  */
13496
13497
13498 /**
13499  * g_dbus_method_invocation_get_user_data: (skip)
13500  * @invocation: A #GDBusMethodInvocation.
13501  *
13502  * Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
13503  *
13504  * Returns: A #gpointer.
13505  * Since: 2.26
13506  */
13507
13508
13509 /**
13510  * g_dbus_method_invocation_return_dbus_error:
13511  * @invocation: (transfer full): A #GDBusMethodInvocation.
13512  * @error_name: A valid D-Bus error name.
13513  * @error_message: A valid D-Bus error message.
13514  *
13515  * Finishes handling a D-Bus method call by returning an error.
13516  *
13517  * This method will free @invocation, you cannot use it afterwards.
13518  *
13519  * Since: 2.26
13520  */
13521
13522
13523 /**
13524  * g_dbus_method_invocation_return_error:
13525  * @invocation: (transfer full): A #GDBusMethodInvocation.
13526  * @domain: A #GQuark for the #GError error domain.
13527  * @code: The error code.
13528  * @format: printf()-style format.
13529  * @...: Parameters for @format.
13530  *
13531  * Finishes handling a D-Bus method call by returning an error.
13532  *
13533  * See g_dbus_error_encode_gerror() for details about what error name
13534  * will be returned on the wire. In a nutshell, if the given error is
13535  * registered using g_dbus_error_register_error() the name given
13536  * during registration is used. Otherwise, a name of the form
13537  * <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
13538  * used. This provides transparent mapping of #GError between
13539  * applications using GDBus.
13540  *
13541  * If you are writing an application intended to be portable,
13542  * <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
13543  * or use g_dbus_method_invocation_return_dbus_error().
13544  *
13545  * This method will free @invocation, you cannot use it afterwards.
13546  *
13547  * Since: 2.26
13548  */
13549
13550
13551 /**
13552  * g_dbus_method_invocation_return_error_literal:
13553  * @invocation: (transfer full): A #GDBusMethodInvocation.
13554  * @domain: A #GQuark for the #GError error domain.
13555  * @code: The error code.
13556  * @message: The error message.
13557  *
13558  * Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
13559  *
13560  * This method will free @invocation, you cannot use it afterwards.
13561  *
13562  * Since: 2.26
13563  */
13564
13565
13566 /**
13567  * g_dbus_method_invocation_return_error_valist:
13568  * @invocation: (transfer full): A #GDBusMethodInvocation.
13569  * @domain: A #GQuark for the #GError error domain.
13570  * @code: The error code.
13571  * @format: printf()-style format.
13572  * @var_args: #va_list of parameters for @format.
13573  *
13574  * Like g_dbus_method_invocation_return_error() but intended for
13575  * language bindings.
13576  *
13577  * This method will free @invocation, you cannot use it afterwards.
13578  *
13579  * Since: 2.26
13580  */
13581
13582
13583 /**
13584  * g_dbus_method_invocation_return_gerror:
13585  * @invocation: (transfer full): A #GDBusMethodInvocation.
13586  * @error: A #GError.
13587  *
13588  * Like g_dbus_method_invocation_return_error() but takes a #GError
13589  * instead of the error domain, error code and message.
13590  *
13591  * This method will free @invocation, you cannot use it afterwards.
13592  *
13593  * Since: 2.26
13594  */
13595
13596
13597 /**
13598  * g_dbus_method_invocation_return_value:
13599  * @invocation: (transfer full): A #GDBusMethodInvocation.
13600  * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
13601  *
13602  * Finishes handling a D-Bus method call by returning @parameters.
13603  * If the @parameters GVariant is floating, it is consumed.
13604  *
13605  * It is an error if @parameters is not of the right format.
13606  *
13607  * This method will free @invocation, you cannot use it afterwards.
13608  *
13609  * Since: 2.26
13610  */
13611
13612
13613 /**
13614  * g_dbus_method_invocation_return_value_with_unix_fd_list:
13615  * @invocation: (transfer full): A #GDBusMethodInvocation.
13616  * @parameters: (allow-none): A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
13617  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
13618  *
13619  * Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
13620  *
13621  * This method is only available on UNIX.
13622  *
13623  * This method will free @invocation, you cannot use it afterwards.
13624  *
13625  * Since: 2.30
13626  */
13627
13628
13629 /**
13630  * g_dbus_method_invocation_take_error: (skip)
13631  * @invocation: (transfer full): A #GDBusMethodInvocation.
13632  * @error: (transfer full): A #GError.
13633  *
13634  * Like g_dbus_method_invocation_return_gerror() but takes ownership
13635  * of @error so the caller does not need to free it.
13636  *
13637  * This method will free @invocation, you cannot use it afterwards.
13638  *
13639  * Since: 2.30
13640  */
13641
13642
13643 /**
13644  * g_dbus_node_info_generate_xml:
13645  * @info: A #GDBusNodeInfo.
13646  * @indent: Indentation level.
13647  * @string_builder: (out): A #GString to to append XML data to.
13648  *
13649  * Appends an XML representation of @info (and its children) to @string_builder.
13650  *
13651  * This function is typically used for generating introspection XML documents at run-time for
13652  * handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
13653  *
13654  * Since: 2.26
13655  */
13656
13657
13658 /**
13659  * g_dbus_node_info_lookup_interface:
13660  * @info: A #GDBusNodeInfo.
13661  * @name: A D-Bus interface name.
13662  *
13663  * Looks up information about an interface.
13664  *
13665  * This cost of this function is O(n) in number of interfaces.
13666  *
13667  * Returns: (transfer none): A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
13668  * Since: 2.26
13669  */
13670
13671
13672 /**
13673  * g_dbus_node_info_new_for_xml:
13674  * @xml_data: Valid D-Bus introspection XML.
13675  * @error: Return location for error.
13676  *
13677  * Parses @xml_data and returns a #GDBusNodeInfo representing the data.
13678  *
13679  * Note that this routine is using a
13680  * <link linkend="glib-Simple-XML-Subset-Parser.description">GMarkup</link>-based
13681  * parser that only accepts a subset of valid XML documents.
13682  *
13683  * Returns: A #GDBusNodeInfo structure or %NULL if @error is set. Free with g_dbus_node_info_unref().
13684  * Since: 2.26
13685  */
13686
13687
13688 /**
13689  * g_dbus_node_info_ref:
13690  * @info: A #GDBusNodeInfo
13691  *
13692  * If @info is statically allocated does nothing. Otherwise increases
13693  * the reference count.
13694  *
13695  * Returns: The same @info.
13696  * Since: 2.26
13697  */
13698
13699
13700 /**
13701  * g_dbus_node_info_unref:
13702  * @info: A #GDBusNodeInfo.
13703  *
13704  * If @info is statically allocated, does nothing. Otherwise decreases
13705  * the reference count of @info. When its reference count drops to 0,
13706  * the memory used is freed.
13707  *
13708  * Since: 2.26
13709  */
13710
13711
13712 /**
13713  * g_dbus_object_get_interface:
13714  * @object: A #GDBusObject.
13715  * @interface_name: A D-Bus interface name.
13716  *
13717  * Gets the D-Bus interface with name @interface_name associated with
13718  * @object, if any.
13719  *
13720  * Returns: (transfer full): %NULL if not found, otherwise a #GDBusInterface that must be freed with g_object_unref().
13721  * Since: 2.30
13722  */
13723
13724
13725 /**
13726  * g_dbus_object_get_interfaces:
13727  * @object: A #GDBusObject.
13728  *
13729  * Gets the D-Bus interfaces associated with @object.
13730  *
13731  * 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().
13732  * Since: 2.30
13733  */
13734
13735
13736 /**
13737  * g_dbus_object_get_object_path:
13738  * @object: A #GDBusObject.
13739  *
13740  * Gets the object path for @object.
13741  *
13742  * Returns: A string owned by @object. Do not free.
13743  * Since: 2.30
13744  */
13745
13746
13747 /**
13748  * g_dbus_object_manager_client_get_connection:
13749  * @manager: A #GDBusObjectManagerClient
13750  *
13751  * Gets the #GDBusConnection used by @manager.
13752  *
13753  * Returns: (transfer none): A #GDBusConnection object. Do not free, the object belongs to @manager.
13754  * Since: 2.30
13755  */
13756
13757
13758 /**
13759  * g_dbus_object_manager_client_get_flags:
13760  * @manager: A #GDBusObjectManagerClient
13761  *
13762  * Gets the flags that @manager was constructed with.
13763  *
13764  * Returns: Zero of more flags from the #GDBusObjectManagerClientFlags enumeration.
13765  * Since: 2.30
13766  */
13767
13768
13769 /**
13770  * g_dbus_object_manager_client_get_name:
13771  * @manager: A #GDBusObjectManagerClient
13772  *
13773  * Gets the name that @manager is for.
13774  *
13775  * Returns: A unique or well-known name. Do not free, the string belongs to @manager.
13776  * Since: 2.30
13777  */
13778
13779
13780 /**
13781  * g_dbus_object_manager_client_get_name_owner:
13782  * @manager: A #GDBusObjectManagerClient.
13783  *
13784  * The unique name that owns the name that @manager is for or %NULL if
13785  * no-one currently owns that name. You can connect to the
13786  * #GObject::notify signal to track changes to the
13787  * #GDBusObjectManagerClient:name-owner property.
13788  *
13789  * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
13790  * Since: 2.30
13791  */
13792
13793
13794 /**
13795  * g_dbus_object_manager_client_new:
13796  * @connection: A #GDBusConnection.
13797  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
13798  * @name: The owner of the control object (unique or well-known name).
13799  * @object_path: The object path of the control object.
13800  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
13801  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
13802  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
13803  * @cancellable: (allow-none): A #GCancellable or %NULL
13804  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13805  * @user_data: The data to pass to @callback.
13806  *
13807  * Asynchronously creates a new #GDBusObjectManagerClient object.
13808  *
13809  * This is an asynchronous failable constructor. When the result is
13810  * ready, @callback will be invoked in the
13811  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
13812  * of the thread you are calling this method from. You can
13813  * then call g_dbus_object_manager_client_new_finish() to get the result. See
13814  * g_dbus_object_manager_client_new_sync() for the synchronous version.
13815  *
13816  * Since: 2.30
13817  */
13818
13819
13820 /**
13821  * g_dbus_object_manager_client_new_finish:
13822  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
13823  * @error: Return location for error or %NULL.
13824  *
13825  * Finishes an operation started with g_dbus_object_manager_client_new().
13826  *
13827  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
13828  * Since: 2.30
13829  */
13830
13831
13832 /**
13833  * g_dbus_object_manager_client_new_for_bus:
13834  * @bus_type: A #GBusType.
13835  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
13836  * @name: The owner of the control object (unique or well-known name).
13837  * @object_path: The object path of the control object.
13838  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
13839  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
13840  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
13841  * @cancellable: (allow-none): A #GCancellable or %NULL
13842  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
13843  * @user_data: The data to pass to @callback.
13844  *
13845  * Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
13846  * #GDBusConnection.
13847  *
13848  * This is an asynchronous failable constructor. When the result is
13849  * ready, @callback will be invoked in the
13850  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
13851  * of the thread you are calling this method from. You can
13852  * then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
13853  * g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
13854  *
13855  * Since: 2.30
13856  */
13857
13858
13859 /**
13860  * g_dbus_object_manager_client_new_for_bus_finish:
13861  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
13862  * @error: Return location for error or %NULL.
13863  *
13864  * Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
13865  *
13866  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
13867  * Since: 2.30
13868  */
13869
13870
13871 /**
13872  * g_dbus_object_manager_client_new_for_bus_sync:
13873  * @bus_type: A #GBusType.
13874  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
13875  * @name: The owner of the control object (unique or well-known name).
13876  * @object_path: The object path of the control object.
13877  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
13878  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
13879  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
13880  * @cancellable: (allow-none): A #GCancellable or %NULL
13881  * @error: Return location for error or %NULL.
13882  *
13883  * Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
13884  * of a #GDBusConnection.
13885  *
13886  * This is a synchronous failable constructor - the calling thread is
13887  * blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
13888  * for the asynchronous version.
13889  *
13890  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
13891  * Since: 2.30
13892  */
13893
13894
13895 /**
13896  * g_dbus_object_manager_client_new_sync:
13897  * @connection: A #GDBusConnection.
13898  * @flags: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
13899  * @name: The owner of the control object (unique or well-known name).
13900  * @object_path: The object path of the control object.
13901  * @get_proxy_type_func: (allow-none): A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
13902  * @get_proxy_type_user_data: User data to pass to @get_proxy_type_func.
13903  * @get_proxy_type_destroy_notify: (allow-none): Free function for @get_proxy_type_user_data or %NULL.
13904  * @cancellable: (allow-none): A #GCancellable or %NULL
13905  * @error: Return location for error or %NULL.
13906  *
13907  * Creates a new #GDBusObjectManagerClient object.
13908  *
13909  * This is a synchronous failable constructor - the calling thread is
13910  * blocked until a reply is received. See g_dbus_object_manager_client_new()
13911  * for the asynchronous version.
13912  *
13913  * Returns: (transfer full) (type GDBusObjectManagerClient): A #GDBusObjectManagerClient object or %NULL if @error is set. Free with g_object_unref().
13914  * Since: 2.30
13915  */
13916
13917
13918 /**
13919  * g_dbus_object_manager_get_interface:
13920  * @manager: A #GDBusObjectManager.
13921  * @object_path: Object path to lookup.
13922  * @interface_name: D-Bus interface name to lookup.
13923  *
13924  * Gets the interface proxy for @interface_name at @object_path, if
13925  * any.
13926  *
13927  * Returns: (transfer full): A #GDBusInterface instance or %NULL. Free with g_object_unref().
13928  * Since: 2.30
13929  */
13930
13931
13932 /**
13933  * g_dbus_object_manager_get_object:
13934  * @manager: A #GDBusObjectManager.
13935  * @object_path: Object path to lookup.
13936  *
13937  * Gets the #GDBusObjectProxy at @object_path, if any.
13938  *
13939  * Returns: (transfer full): A #GDBusObject or %NULL. Free with g_object_unref().
13940  * Since: 2.30
13941  */
13942
13943
13944 /**
13945  * g_dbus_object_manager_get_object_path:
13946  * @manager: A #GDBusObjectManager.
13947  *
13948  * Gets the object path that @manager is for.
13949  *
13950  * Returns: A string owned by @manager. Do not free.
13951  * Since: 2.30
13952  */
13953
13954
13955 /**
13956  * g_dbus_object_manager_get_objects:
13957  * @manager: A #GDBusObjectManager.
13958  *
13959  * Gets all #GDBusObject objects known to @manager.
13960  *
13961  * 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().
13962  * Since: 2.30
13963  */
13964
13965
13966 /**
13967  * g_dbus_object_manager_server_export:
13968  * @manager: A #GDBusObjectManagerServer.
13969  * @object: A #GDBusObjectSkeleton.
13970  *
13971  * Exports @object on @manager.
13972  *
13973  * If there is already a #GDBusObject exported at the object path,
13974  * then the old object is removed.
13975  *
13976  * The object path for @object must be in the hierarchy rooted by the
13977  * object path for @manager.
13978  *
13979  * Note that @manager will take a reference on @object for as long as
13980  * it is exported.
13981  *
13982  * Since: 2.30
13983  */
13984
13985
13986 /**
13987  * g_dbus_object_manager_server_export_uniquely:
13988  * @manager: A #GDBusObjectManagerServer.
13989  * @object: An object.
13990  *
13991  * Like g_dbus_object_manager_server_export() but appends a string of
13992  * the form <literal>_N</literal> (with N being a natural number) to
13993  * @object<!-- -->'s object path if an object with the given path
13994  * already exists. As such, the #GDBusObjectProxy:g-object-path property
13995  * of @object may be modified.
13996  *
13997  * Since: 2.30
13998  */
13999
14000
14001 /**
14002  * g_dbus_object_manager_server_get_connection:
14003  * @manager: A #GDBusObjectManagerServer
14004  *
14005  * Gets the #GDBusConnection used by @manager.
14006  *
14007  * 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().
14008  * Since: 2.30
14009  */
14010
14011
14012 /**
14013  * g_dbus_object_manager_server_new:
14014  * @object_path: The object path to export the manager object at.
14015  *
14016  * Creates a new #GDBusObjectManagerServer object.
14017  *
14018  * The returned server isn't yet exported on any connection. To do so,
14019  * use g_dbus_object_manager_server_set_connection(). Normally you
14020  * want to export all of your objects before doing so to avoid <ulink
14021  * url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
14022  * signals being emitted.
14023  *
14024  * Returns: A #GDBusObjectManagerServer object. Free with g_object_unref().
14025  * Since: 2.30
14026  */
14027
14028
14029 /**
14030  * g_dbus_object_manager_server_set_connection:
14031  * @manager: A #GDBusObjectManagerServer.
14032  * @connection: (allow-none): A #GDBusConnection or %NULL.
14033  *
14034  * Exports all objects managed by @manager on @connection. If
14035  * @connection is %NULL, stops exporting objects.
14036  */
14037
14038
14039 /**
14040  * g_dbus_object_manager_server_unexport:
14041  * @manager: A #GDBusObjectManagerServer.
14042  * @object_path: An object path.
14043  *
14044  * If @manager has an object at @path, removes the object. Otherwise
14045  * does nothing.
14046  *
14047  * Note that @object_path must be in the hierarchy rooted by the
14048  * object path for @manager.
14049  *
14050  * Returns: %TRUE if object at @object_path was removed, %FALSE otherwise.
14051  * Since: 2.30
14052  */
14053
14054
14055 /**
14056  * g_dbus_object_proxy_get_connection:
14057  * @proxy: a #GDBusObjectProxy
14058  *
14059  * Gets the connection that @proxy is for.
14060  *
14061  * Returns: (transfer none): A #GDBusConnection. Do not free, the object is owned by @proxy.
14062  * Since: 2.30
14063  */
14064
14065
14066 /**
14067  * g_dbus_object_proxy_new:
14068  * @connection: a #GDBusConnection
14069  * @object_path: the object path
14070  *
14071  * Creates a new #GDBusObjectProxy for the given connection and
14072  * object path.
14073  *
14074  * Returns: a new #GDBusObjectProxy
14075  * Since: 2.30
14076  */
14077
14078
14079 /**
14080  * g_dbus_object_skeleton_add_interface:
14081  * @object: A #GDBusObjectSkeleton.
14082  * @interface_: A #GDBusInterfaceSkeleton.
14083  *
14084  * Adds @interface_ to @object.
14085  *
14086  * If @object already contains a #GDBusInterfaceSkeleton with the same
14087  * interface name, it is removed before @interface_ is added.
14088  *
14089  * Note that @object takes its own reference on @interface_ and holds
14090  * it until removed.
14091  *
14092  * Since: 2.30
14093  */
14094
14095
14096 /**
14097  * g_dbus_object_skeleton_flush:
14098  * @object: A #GDBusObjectSkeleton.
14099  *
14100  * This method simply calls g_dbus_interface_skeleton_flush() on all
14101  * interfaces belonging to @object. See that method for when flushing
14102  * is useful.
14103  *
14104  * Since: 2.30
14105  */
14106
14107
14108 /**
14109  * g_dbus_object_skeleton_new:
14110  * @object_path: An object path.
14111  *
14112  * Creates a new #GDBusObjectSkeleton.
14113  *
14114  * Returns: A #GDBusObjectSkeleton. Free with g_object_unref().
14115  * Since: 2.30
14116  */
14117
14118
14119 /**
14120  * g_dbus_object_skeleton_remove_interface:
14121  * @object: A #GDBusObjectSkeleton.
14122  * @interface_: A #GDBusInterfaceSkeleton.
14123  *
14124  * Removes @interface_ from @object.
14125  *
14126  * Since: 2.30
14127  */
14128
14129
14130 /**
14131  * g_dbus_object_skeleton_remove_interface_by_name:
14132  * @object: A #GDBusObjectSkeleton.
14133  * @interface_name: A D-Bus interface name.
14134  *
14135  * Removes the #GDBusInterface with @interface_name from @object.
14136  *
14137  * If no D-Bus interface of the given interface exists, this function
14138  * does nothing.
14139  *
14140  * Since: 2.30
14141  */
14142
14143
14144 /**
14145  * g_dbus_object_skeleton_set_object_path:
14146  * @object: A #GDBusObjectSkeleton.
14147  * @object_path: A valid D-Bus object path.
14148  *
14149  * Sets the object path for @object.
14150  *
14151  * Since: 2.30
14152  */
14153
14154
14155 /**
14156  * g_dbus_property_info_ref:
14157  * @info: A #GDBusPropertyInfo
14158  *
14159  * If @info is statically allocated does nothing. Otherwise increases
14160  * the reference count.
14161  *
14162  * Returns: The same @info.
14163  * Since: 2.26
14164  */
14165
14166
14167 /**
14168  * g_dbus_property_info_unref:
14169  * @info: A #GDBusPropertyInfo.
14170  *
14171  * If @info is statically allocated, does nothing. Otherwise decreases
14172  * the reference count of @info. When its reference count drops to 0,
14173  * the memory used is freed.
14174  *
14175  * Since: 2.26
14176  */
14177
14178
14179 /**
14180  * g_dbus_proxy_call:
14181  * @proxy: A #GDBusProxy.
14182  * @method_name: Name of method to invoke.
14183  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
14184  * @flags: Flags from the #GDBusCallFlags enumeration.
14185  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
14186  * @cancellable: (allow-none): A #GCancellable or %NULL.
14187  * @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.
14188  * @user_data: The data to pass to @callback.
14189  *
14190  * Asynchronously invokes the @method_name method on @proxy.
14191  *
14192  * If @method_name contains any dots, then @name is split into interface and
14193  * method name parts. This allows using @proxy for invoking methods on
14194  * other interfaces.
14195  *
14196  * If the #GDBusConnection associated with @proxy is closed then
14197  * the operation will fail with %G_IO_ERROR_CLOSED. If
14198  * @cancellable is canceled, the operation will fail with
14199  * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
14200  * compatible with the D-Bus protocol, the operation fails with
14201  * %G_IO_ERROR_INVALID_ARGUMENT.
14202  *
14203  * If the @parameters #GVariant is floating, it is consumed. This allows
14204  * convenient 'inline' use of g_variant_new(), e.g.:
14205  * |[
14206  *  g_dbus_proxy_call (proxy,
14207  *                     "TwoStrings",
14208  *                     g_variant_new ("(ss)",
14209  *                                    "Thing One",
14210  *                                    "Thing Two"),
14211  *                     G_DBUS_CALL_FLAGS_NONE,
14212  *                     -1,
14213  *                     NULL,
14214  *                     (GAsyncReadyCallback) two_strings_done,
14215  *                     &amp;data);
14216  * ]|
14217  *
14218  * If @proxy has an expected interface (see
14219  * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
14220  * then the return value is checked against the return type.
14221  *
14222  * This is an asynchronous method. When the operation is finished,
14223  * @callback will be invoked in the
14224  * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
14225  * of the thread you are calling this method from.
14226  * You can then call g_dbus_proxy_call_finish() to get the result of
14227  * the operation. See g_dbus_proxy_call_sync() for the synchronous
14228  * version of this method.
14229  *
14230  * If @callback is %NULL then the D-Bus method call message will be sent with
14231  * the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
14232  *
14233  * Since: 2.26
14234  */
14235
14236
14237 /**
14238  * g_dbus_proxy_call_finish:
14239  * @proxy: A #GDBusProxy.
14240  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
14241  * @error: Return location for error or %NULL.
14242  *
14243  * Finishes an operation started with g_dbus_proxy_call().
14244  *
14245  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
14246  * Since: 2.26
14247  */
14248
14249
14250 /**
14251  * g_dbus_proxy_call_sync:
14252  * @proxy: A #GDBusProxy.
14253  * @method_name: Name of method to invoke.
14254  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
14255  * @flags: Flags from the #GDBusCallFlags enumeration.
14256  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
14257  * @cancellable: (allow-none): A #GCancellable or %NULL.
14258  * @error: Return location for error or %NULL.
14259  *
14260  * Synchronously invokes the @method_name method on @proxy.
14261  *
14262  * If @method_name contains any dots, then @name is split into interface and
14263  * method name parts. This allows using @proxy for invoking methods on
14264  * other interfaces.
14265  *
14266  * If the #GDBusConnection associated with @proxy is disconnected then
14267  * the operation will fail with %G_IO_ERROR_CLOSED. If
14268  * @cancellable is canceled, the operation will fail with
14269  * %G_IO_ERROR_CANCELLED. If @parameters contains a value not
14270  * compatible with the D-Bus protocol, the operation fails with
14271  * %G_IO_ERROR_INVALID_ARGUMENT.
14272  *
14273  * If the @parameters #GVariant is floating, it is consumed. This allows
14274  * convenient 'inline' use of g_variant_new(), e.g.:
14275  * |[
14276  *  g_dbus_proxy_call_sync (proxy,
14277  *                          "TwoStrings",
14278  *                          g_variant_new ("(ss)",
14279  *                                         "Thing One",
14280  *                                         "Thing Two"),
14281  *                          G_DBUS_CALL_FLAGS_NONE,
14282  *                          -1,
14283  *                          NULL,
14284  *                          &amp;error);
14285  * ]|
14286  *
14287  * The calling thread is blocked until a reply is received. See
14288  * g_dbus_proxy_call() for the asynchronous version of this
14289  * method.
14290  *
14291  * If @proxy has an expected interface (see
14292  * #GDBusProxy:g-interface-info) and @method_name is referenced by it,
14293  * then the return value is checked against the return type.
14294  *
14295  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
14296  * Since: 2.26
14297  */
14298
14299
14300 /**
14301  * g_dbus_proxy_call_with_unix_fd_list:
14302  * @proxy: A #GDBusProxy.
14303  * @method_name: Name of method to invoke.
14304  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
14305  * @flags: Flags from the #GDBusCallFlags enumeration.
14306  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
14307  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
14308  * @cancellable: (allow-none): A #GCancellable or %NULL.
14309  * @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.
14310  * @user_data: The data to pass to @callback.
14311  *
14312  * Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
14313  *
14314  * This method is only available on UNIX.
14315  *
14316  * Since: 2.30
14317  */
14318
14319
14320 /**
14321  * g_dbus_proxy_call_with_unix_fd_list_finish:
14322  * @proxy: A #GDBusProxy.
14323  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
14324  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
14325  * @error: Return location for error or %NULL.
14326  *
14327  * Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
14328  *
14329  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
14330  * Since: 2.30
14331  */
14332
14333
14334 /**
14335  * g_dbus_proxy_call_with_unix_fd_list_sync:
14336  * @proxy: A #GDBusProxy.
14337  * @method_name: Name of method to invoke.
14338  * @parameters: (allow-none): A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
14339  * @flags: Flags from the #GDBusCallFlags enumeration.
14340  * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
14341  * @fd_list: (allow-none): A #GUnixFDList or %NULL.
14342  * @out_fd_list: (out) (allow-none): Return location for a #GUnixFDList or %NULL.
14343  * @cancellable: (allow-none): A #GCancellable or %NULL.
14344  * @error: Return location for error or %NULL.
14345  *
14346  * Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
14347  *
14348  * This method is only available on UNIX.
14349  *
14350  * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with return values. Free with g_variant_unref().
14351  * Since: 2.30
14352  */
14353
14354
14355 /**
14356  * g_dbus_proxy_get_cached_property:
14357  * @proxy: A #GDBusProxy.
14358  * @property_name: Property name.
14359  *
14360  * Looks up the value for a property from the cache. This call does no
14361  * blocking IO.
14362  *
14363  * If @proxy has an expected interface (see
14364  * #GDBusProxy:g-interface-info) and @property_name is referenced by
14365  * it, then @value is checked against the type of the property.
14366  *
14367  * 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().
14368  * Since: 2.26
14369  */
14370
14371
14372 /**
14373  * g_dbus_proxy_get_cached_property_names:
14374  * @proxy: A #GDBusProxy.
14375  *
14376  * Gets the names of all cached properties on @proxy.
14377  *
14378  * Returns: (transfer full): A %NULL-terminated array of strings or %NULL if @proxy has no cached properties. Free the returned array with g_strfreev().
14379  * Since: 2.26
14380  */
14381
14382
14383 /**
14384  * g_dbus_proxy_get_connection:
14385  * @proxy: A #GDBusProxy.
14386  *
14387  * Gets the connection @proxy is for.
14388  *
14389  * Returns: (transfer none): A #GDBusConnection owned by @proxy. Do not free.
14390  * Since: 2.26
14391  */
14392
14393
14394 /**
14395  * g_dbus_proxy_get_default_timeout:
14396  * @proxy: A #GDBusProxy.
14397  *
14398  * Gets the timeout to use if -1 (specifying default timeout) is
14399  * passed as @timeout_msec in the g_dbus_proxy_call() and
14400  * g_dbus_proxy_call_sync() functions.
14401  *
14402  * See the #GDBusProxy:g-default-timeout property for more details.
14403  *
14404  * Returns: Timeout to use for @proxy.
14405  * Since: 2.26
14406  */
14407
14408
14409 /**
14410  * g_dbus_proxy_get_flags:
14411  * @proxy: A #GDBusProxy.
14412  *
14413  * Gets the flags that @proxy was constructed with.
14414  *
14415  * Returns: Flags from the #GDBusProxyFlags enumeration.
14416  * Since: 2.26
14417  */
14418
14419
14420 /**
14421  * g_dbus_proxy_get_interface_info:
14422  * @proxy: A #GDBusProxy
14423  *
14424  * Returns the #GDBusInterfaceInfo, if any, specifying the interface
14425  * that @proxy conforms to. See the #GDBusProxy:g-interface-info
14426  * property for more details.
14427  *
14428  * Returns: A #GDBusInterfaceInfo or %NULL. Do not unref the returned object, it is owned by @proxy.
14429  * Since: 2.26
14430  */
14431
14432
14433 /**
14434  * g_dbus_proxy_get_interface_name:
14435  * @proxy: A #GDBusProxy.
14436  *
14437  * Gets the D-Bus interface name @proxy is for.
14438  *
14439  * Returns: A string owned by @proxy. Do not free.
14440  * Since: 2.26
14441  */
14442
14443
14444 /**
14445  * g_dbus_proxy_get_name:
14446  * @proxy: A #GDBusProxy.
14447  *
14448  * Gets the name that @proxy was constructed for.
14449  *
14450  * Returns: A string owned by @proxy. Do not free.
14451  * Since: 2.26
14452  */
14453
14454
14455 /**
14456  * g_dbus_proxy_get_name_owner:
14457  * @proxy: A #GDBusProxy.
14458  *
14459  * The unique name that owns the name that @proxy is for or %NULL if
14460  * no-one currently owns that name. You may connect to the
14461  * #GObject::notify signal to track changes to the
14462  * #GDBusProxy:g-name-owner property.
14463  *
14464  * Returns: The name owner or %NULL if no name owner exists. Free with g_free().
14465  * Since: 2.26
14466  */
14467
14468
14469 /**
14470  * g_dbus_proxy_get_object_path:
14471  * @proxy: A #GDBusProxy.
14472  *
14473  * Gets the object path @proxy is for.
14474  *
14475  * Returns: A string owned by @proxy. Do not free.
14476  * Since: 2.26
14477  */
14478
14479
14480 /**
14481  * g_dbus_proxy_new:
14482  * @connection: A #GDBusConnection.
14483  * @flags: Flags used when constructing the proxy.
14484  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
14485  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
14486  * @object_path: An object path.
14487  * @interface_name: A D-Bus interface name.
14488  * @cancellable: (allow-none): A #GCancellable or %NULL.
14489  * @callback: Callback function to invoke when the proxy is ready.
14490  * @user_data: User data to pass to @callback.
14491  *
14492  * Creates a proxy for accessing @interface_name on the remote object
14493  * at @object_path owned by @name at @connection and asynchronously
14494  * loads D-Bus properties unless the
14495  * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
14496  * the #GDBusProxy::g-properties-changed signal to get notified about
14497  * property changes.
14498  *
14499  * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
14500  * match rules for signals. Connect to the #GDBusProxy::g-signal signal
14501  * to handle signals from the remote object.
14502  *
14503  * If @name is a well-known name and the
14504  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
14505  * owner currently exists, the message bus will be requested to launch
14506  * a name owner for the name.
14507  *
14508  * This is a failable asynchronous constructor - when the proxy is
14509  * ready, @callback will be invoked and you can use
14510  * g_dbus_proxy_new_finish() to get the result.
14511  *
14512  * See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
14513  *
14514  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
14515  *
14516  * Since: 2.26
14517  */
14518
14519
14520 /**
14521  * g_dbus_proxy_new_finish:
14522  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
14523  * @error: Return location for error or %NULL.
14524  *
14525  * Finishes creating a #GDBusProxy.
14526  *
14527  * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
14528  * Since: 2.26
14529  */
14530
14531
14532 /**
14533  * g_dbus_proxy_new_for_bus:
14534  * @bus_type: A #GBusType.
14535  * @flags: Flags used when constructing the proxy.
14536  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
14537  * @name: A bus name (well-known or unique).
14538  * @object_path: An object path.
14539  * @interface_name: A D-Bus interface name.
14540  * @cancellable: (allow-none): A #GCancellable or %NULL.
14541  * @callback: Callback function to invoke when the proxy is ready.
14542  * @user_data: User data to pass to @callback.
14543  *
14544  * Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
14545  *
14546  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
14547  *
14548  * Since: 2.26
14549  */
14550
14551
14552 /**
14553  * g_dbus_proxy_new_for_bus_finish:
14554  * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
14555  * @error: Return location for error or %NULL.
14556  *
14557  * Finishes creating a #GDBusProxy.
14558  *
14559  * Returns: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
14560  * Since: 2.26
14561  */
14562
14563
14564 /**
14565  * g_dbus_proxy_new_for_bus_sync:
14566  * @bus_type: A #GBusType.
14567  * @flags: Flags used when constructing the proxy.
14568  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
14569  * @name: A bus name (well-known or unique).
14570  * @object_path: An object path.
14571  * @interface_name: A D-Bus interface name.
14572  * @cancellable: (allow-none): A #GCancellable or %NULL.
14573  * @error: Return location for error or %NULL.
14574  *
14575  * Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
14576  *
14577  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
14578  *
14579  * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
14580  * Since: 2.26
14581  */
14582
14583
14584 /**
14585  * g_dbus_proxy_new_sync:
14586  * @connection: A #GDBusConnection.
14587  * @flags: Flags used when constructing the proxy.
14588  * @info: (allow-none): A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
14589  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
14590  * @object_path: An object path.
14591  * @interface_name: A D-Bus interface name.
14592  * @cancellable: (allow-none): A #GCancellable or %NULL.
14593  * @error: (allow-none): Return location for error or %NULL.
14594  *
14595  * Creates a proxy for accessing @interface_name on the remote object
14596  * at @object_path owned by @name at @connection and synchronously
14597  * loads D-Bus properties unless the
14598  * %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
14599  *
14600  * If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
14601  * match rules for signals. Connect to the #GDBusProxy::g-signal signal
14602  * to handle signals from the remote object.
14603  *
14604  * If @name is a well-known name and the
14605  * %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
14606  * owner currently exists, the message bus will be requested to launch
14607  * a name owner for the name.
14608  *
14609  * This is a synchronous failable constructor. See g_dbus_proxy_new()
14610  * and g_dbus_proxy_new_finish() for the asynchronous version.
14611  *
14612  * See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
14613  *
14614  * Returns: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
14615  * Since: 2.26
14616  */
14617
14618
14619 /**
14620  * g_dbus_proxy_set_cached_property:
14621  * @proxy: A #GDBusProxy
14622  * @property_name: Property name.
14623  * @value: (allow-none): Value for the property or %NULL to remove it from the cache.
14624  *
14625  * If @value is not %NULL, sets the cached value for the property with
14626  * name @property_name to the value in @value.
14627  *
14628  * If @value is %NULL, then the cached value is removed from the
14629  * property cache.
14630  *
14631  * If @proxy has an expected interface (see
14632  * #GDBusProxy:g-interface-info) and @property_name is referenced by
14633  * it, then @value is checked against the type of the property.
14634  *
14635  * If the @value #GVariant is floating, it is consumed. This allows
14636  * convenient 'inline' use of g_variant_new(), e.g.
14637  * |[
14638  *  g_dbus_proxy_set_cached_property (proxy,
14639  *                                    "SomeProperty",
14640  *                                    g_variant_new ("(si)",
14641  *                                                  "A String",
14642  *                                                  42));
14643  * ]|
14644  *
14645  * Normally you will not need to use this method since @proxy is
14646  * tracking changes using the
14647  * <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
14648  * D-Bus signal. However, for performance reasons an object may decide
14649  * to not use this signal for some properties and instead use a
14650  * proprietary out-of-band mechanism to transmit changes.
14651  *
14652  * As a concrete example, consider an object with a property
14653  * <literal>ChatroomParticipants</literal> which is an array of
14654  * strings. Instead of transmitting the same (long) array every time
14655  * the property changes, it is more efficient to only transmit the
14656  * delta using e.g. signals <literal>ChatroomParticipantJoined(String
14657  * name)</literal> and <literal>ChatroomParticipantParted(String
14658  * name)</literal>.
14659  *
14660  * Since: 2.26
14661  */
14662
14663
14664 /**
14665  * g_dbus_proxy_set_default_timeout:
14666  * @proxy: A #GDBusProxy.
14667  * @timeout_msec: Timeout in milliseconds.
14668  *
14669  * Sets the timeout to use if -1 (specifying default timeout) is
14670  * passed as @timeout_msec in the g_dbus_proxy_call() and
14671  * g_dbus_proxy_call_sync() functions.
14672  *
14673  * See the #GDBusProxy:g-default-timeout property for more details.
14674  *
14675  * Since: 2.26
14676  */
14677
14678
14679 /**
14680  * g_dbus_proxy_set_interface_info:
14681  * @proxy: A #GDBusProxy
14682  * @info: (allow-none): Minimum interface this proxy conforms to or %NULL to unset.
14683  *
14684  * Ensure that interactions with @proxy conform to the given
14685  * interface. See the #GDBusProxy:g-interface-info property for more
14686  * details.
14687  *
14688  * Since: 2.26
14689  */
14690
14691
14692 /**
14693  * g_dbus_server_get_client_address:
14694  * @server: A #GDBusServer.
14695  *
14696  * Gets a D-Bus address string that can be used by clients to connect
14697  * to @server.
14698  *
14699  * Returns: A D-Bus address string. Do not free, the string is owned by @server.
14700  * Since: 2.26
14701  */
14702
14703
14704 /**
14705  * g_dbus_server_get_flags:
14706  * @server: A #GDBusServer.
14707  *
14708  * Gets the flags for @server.
14709  *
14710  * Returns: A set of flags from the #GDBusServerFlags enumeration.
14711  * Since: 2.26
14712  */
14713
14714
14715 /**
14716  * g_dbus_server_get_guid:
14717  * @server: A #GDBusServer.
14718  *
14719  * Gets the GUID for @server.
14720  *
14721  * Returns: A D-Bus GUID. Do not free this string, it is owned by @server.
14722  * Since: 2.26
14723  */
14724
14725
14726 /**
14727  * g_dbus_server_is_active:
14728  * @server: A #GDBusServer.
14729  *
14730  * Gets whether @server is active.
14731  *
14732  * Returns: %TRUE if server is active, %FALSE otherwise.
14733  * Since: 2.26
14734  */
14735
14736
14737 /**
14738  * g_dbus_server_new_sync:
14739  * @address: A D-Bus address.
14740  * @flags: Flags from the #GDBusServerFlags enumeration.
14741  * @guid: A D-Bus GUID.
14742  * @observer: (allow-none): A #GDBusAuthObserver or %NULL.
14743  * @cancellable: (allow-none): A #GCancellable or %NULL.
14744  * @error: Return location for server or %NULL.
14745  *
14746  * Creates a new D-Bus server that listens on the first address in
14747  * @address that works.
14748  *
14749  * Once constructed, you can use g_dbus_server_get_client_address() to
14750  * get a D-Bus address string that clients can use to connect.
14751  *
14752  * Connect to the #GDBusServer::new-connection signal to handle
14753  * incoming connections.
14754  *
14755  * The returned #GDBusServer isn't active - you have to start it with
14756  * g_dbus_server_start().
14757  *
14758  * See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
14759  * be used.
14760  *
14761  * This is a synchronous failable constructor. See
14762  * g_dbus_server_new() for the asynchronous version.
14763  *
14764  * Returns: A #GDBusServer or %NULL if @error is set. Free with g_object_unref().
14765  * Since: 2.26
14766  */
14767
14768
14769 /**
14770  * g_dbus_server_start:
14771  * @server: A #GDBusServer.
14772  *
14773  * Starts @server.
14774  *
14775  * Since: 2.26
14776  */
14777
14778
14779 /**
14780  * g_dbus_server_stop:
14781  * @server: A #GDBusServer.
14782  *
14783  * Stops @server.
14784  *
14785  * Since: 2.26
14786  */
14787
14788
14789 /**
14790  * g_dbus_signal_info_ref:
14791  * @info: A #GDBusSignalInfo
14792  *
14793  * If @info is statically allocated does nothing. Otherwise increases
14794  * the reference count.
14795  *
14796  * Returns: The same @info.
14797  * Since: 2.26
14798  */
14799
14800
14801 /**
14802  * g_dbus_signal_info_unref:
14803  * @info: A #GDBusSignalInfo.
14804  *
14805  * If @info is statically allocated, does nothing. Otherwise decreases
14806  * the reference count of @info. When its reference count drops to 0,
14807  * the memory used is freed.
14808  *
14809  * Since: 2.26
14810  */
14811
14812
14813 /**
14814  * g_desktop_app_info_get_categories:
14815  * @info: a #GDesktopAppInfo
14816  *
14817  * Gets the categories from the desktop file.
14818  *
14819  * Returns: The unparsed Categories key from the desktop file; i.e. no attempt is made to split it by ';' or validate it.
14820  */
14821
14822
14823 /**
14824  * g_desktop_app_info_get_filename:
14825  * @info: a #GDesktopAppInfo
14826  *
14827  * When @info was created from a known filename, return it.  In some
14828  * situations such as the #GDesktopAppInfo returned from
14829  * g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
14830  *
14831  * Returns: The full path to the file for @info, or %NULL if not known.
14832  * Since: 2.24
14833  */
14834
14835
14836 /**
14837  * g_desktop_app_info_get_generic_name:
14838  * @info: a #GDesktopAppInfo
14839  *
14840  * Gets the generic name from the destkop file.
14841  *
14842  * Returns: The value of the GenericName key
14843  */
14844
14845
14846 /**
14847  * g_desktop_app_info_get_is_hidden:
14848  * @info: a #GDesktopAppInfo.
14849  *
14850  * A desktop file is hidden if the Hidden key in it is
14851  * set to True.
14852  *
14853  * Returns: %TRUE if hidden, %FALSE otherwise.
14854  */
14855
14856
14857 /**
14858  * g_desktop_app_info_get_keywords:
14859  * @info: a #GDesktopAppInfo
14860  *
14861  * Gets the keywords from the desktop file.
14862  *
14863  * Returns: (transfer none): The value of the Keywords key
14864  * Since: 2.32
14865  */
14866
14867
14868 /**
14869  * g_desktop_app_info_get_nodisplay:
14870  * @info: a #GDesktopAppInfo
14871  *
14872  * Gets the value of the NoDisplay key, which helps determine if the
14873  * application info should be shown in menus. See
14874  * #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
14875  *
14876  * Returns: The value of the NoDisplay key
14877  * Since: 2.30
14878  */
14879
14880
14881 /**
14882  * g_desktop_app_info_get_show_in:
14883  * @info: a #GDesktopAppInfo
14884  * @desktop_env: a string specifying a desktop name
14885  *
14886  * Checks if the application info should be shown in menus that list available
14887  * applications for a specific name of the desktop, based on the
14888  * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
14889  *
14890  * If @desktop_env is %NULL, then the name of the desktop set with
14891  * g_desktop_app_info_set_desktop_env() is used.
14892  *
14893  * Note that g_app_info_should_show() for @info will include this check (with
14894  * %NULL for @desktop_env) as well as additional checks.
14895  *
14896  * Returns: %TRUE if the @info should be shown in @desktop_env according to the <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE otherwise.
14897  * Since: 2.30
14898  */
14899
14900
14901 /**
14902  * g_desktop_app_info_get_startup_wm_class:
14903  * @app_info: a #GDesktopAppInfo that supports startup notify
14904  *
14905  * Retrieves the StartupWMClass field from @app_info. This represents the
14906  * WM_CLASS property of the main window of the application, if launched through
14907  * @app_info.
14908  *
14909  * Returns: (transfer none): the startup WM class, or %NULL if none is set in the desktop file.
14910  * Since: 2.34
14911  */
14912
14913
14914 /**
14915  * g_desktop_app_info_launch_uris_as_manager:
14916  * @appinfo: a #GDesktopAppInfo
14917  * @uris: (element-type utf8): List of URIs
14918  * @launch_context: a #GAppLaunchContext
14919  * @spawn_flags: #GSpawnFlags, used for each process
14920  * @user_setup: (scope call): a #GSpawnChildSetupFunc, used once for each process.
14921  * @user_setup_data: (closure user_setup): User data for @user_setup
14922  * @pid_callback: (scope call): Callback for child processes
14923  * @pid_callback_data: (closure pid_callback): User data for @callback
14924  * @error: return location for a #GError, or %NULL
14925  *
14926  * This function performs the equivalent of g_app_info_launch_uris(),
14927  * but is intended primarily for operating system components that
14928  * launch applications.  Ordinary applications should use
14929  * g_app_info_launch_uris().
14930  *
14931  * In contrast to g_app_info_launch_uris(), all processes created will
14932  * always be run directly as children as if by the UNIX fork()/exec()
14933  * calls.
14934  *
14935  * This guarantee allows additional control over the exact environment
14936  * of the child processes, which is provided via a setup function
14937  * @user_setup, as well as the process identifier of each child process
14938  * via @pid_callback. See g_spawn_async() for more information about the
14939  * semantics of the @user_setup function.
14940  *
14941  * Returns: %TRUE on successful launch, %FALSE otherwise.
14942  */
14943
14944
14945 /**
14946  * g_desktop_app_info_lookup_get_default_for_uri_scheme:
14947  * @lookup: a #GDesktopAppInfoLookup
14948  * @uri_scheme: a string containing a URI scheme.
14949  *
14950  * Gets the default application for launching applications
14951  * using this URI scheme for a particular GDesktopAppInfoLookup
14952  * implementation.
14953  *
14954  * The GDesktopAppInfoLookup interface and this function is used
14955  * to implement g_app_info_get_default_for_uri_scheme() backends
14956  * in a GIO module. There is no reason for applications to use it
14957  * directly. Applications should use g_app_info_get_default_for_uri_scheme().
14958  *
14959  * Returns: (transfer full): #GAppInfo for given @uri_scheme or %NULL on error.
14960  * Deprecated: The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
14961  */
14962
14963
14964 /**
14965  * g_desktop_app_info_new:
14966  * @desktop_id: the desktop file id
14967  *
14968  * Creates a new #GDesktopAppInfo based on a desktop file id.
14969  *
14970  * A desktop file id is the basename of the desktop file, including the
14971  * .desktop extension. GIO is looking for a desktop file with this name
14972  * in the <filename>applications</filename> subdirectories of the XDG data
14973  * directories (i.e. the directories specified in the
14974  * <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
14975  * variables). GIO also supports the prefix-to-subdirectory mapping that is
14976  * described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
14977  * (i.e. a desktop id of kde-foo.desktop will match
14978  * <filename>/usr/share/applications/kde/foo.desktop</filename>).
14979  *
14980  * Returns: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
14981  */
14982
14983
14984 /**
14985  * g_desktop_app_info_new_from_filename:
14986  * @filename: the path of a desktop file, in the GLib filename encoding
14987  *
14988  * Creates a new #GDesktopAppInfo.
14989  *
14990  * Returns: a new #GDesktopAppInfo or %NULL on error.
14991  */
14992
14993
14994 /**
14995  * g_desktop_app_info_new_from_keyfile:
14996  * @key_file: an opened #GKeyFile
14997  *
14998  * Creates a new #GDesktopAppInfo.
14999  *
15000  * Returns: a new #GDesktopAppInfo or %NULL on error.
15001  * Since: 2.18
15002  */
15003
15004
15005 /**
15006  * g_desktop_app_info_set_desktop_env:
15007  * @desktop_env: a string specifying what desktop this is
15008  *
15009  * Sets the name of the desktop that the application is running in.
15010  * This is used by g_app_info_should_show() and
15011  * g_desktop_app_info_get_show_in() to evaluate the
15012  * <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
15013  * desktop entry fields.
15014  *
15015  * The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
15016  * Menu specification</ulink> recognizes the following:
15017  * <simplelist>
15018  *   <member>GNOME</member>
15019  *   <member>KDE</member>
15020  *   <member>ROX</member>
15021  *   <member>XFCE</member>
15022  *   <member>LXDE</member>
15023  *   <member>Unity</member>
15024  *   <member>Old</member>
15025  * </simplelist>
15026  *
15027  * Should be called only once; subsequent calls are ignored.
15028  */
15029
15030
15031 /**
15032  * g_drive_can_eject:
15033  * @drive: a #GDrive.
15034  *
15035  * Checks if a drive can be ejected.
15036  *
15037  * Returns: %TRUE if the @drive can be ejected, %FALSE otherwise.
15038  */
15039
15040
15041 /**
15042  * g_drive_can_poll_for_media:
15043  * @drive: a #GDrive.
15044  *
15045  * Checks if a drive can be polled for media changes.
15046  *
15047  * Returns: %TRUE if the @drive can be polled for media changes, %FALSE otherwise.
15048  */
15049
15050
15051 /**
15052  * g_drive_can_start:
15053  * @drive: a #GDrive.
15054  *
15055  * Checks if a drive can be started.
15056  *
15057  * Returns: %TRUE if the @drive can be started, %FALSE otherwise.
15058  * Since: 2.22
15059  */
15060
15061
15062 /**
15063  * g_drive_can_start_degraded:
15064  * @drive: a #GDrive.
15065  *
15066  * Checks if a drive can be started degraded.
15067  *
15068  * Returns: %TRUE if the @drive can be started degraded, %FALSE otherwise.
15069  * Since: 2.22
15070  */
15071
15072
15073 /**
15074  * g_drive_can_stop:
15075  * @drive: a #GDrive.
15076  *
15077  * Checks if a drive can be stopped.
15078  *
15079  * Returns: %TRUE if the @drive can be stopped, %FALSE otherwise.
15080  * Since: 2.22
15081  */
15082
15083
15084 /**
15085  * g_drive_eject:
15086  * @drive: a #GDrive.
15087  * @flags: flags affecting the unmount if required for eject
15088  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
15089  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
15090  * @user_data: user data to pass to @callback
15091  *
15092  * Asynchronously ejects a drive.
15093  *
15094  * When the operation is finished, @callback will be called.
15095  * You can then call g_drive_eject_finish() to obtain the
15096  * result of the operation.
15097  *
15098  * Deprecated: 2.22: Use g_drive_eject_with_operation() instead.
15099  */
15100
15101
15102 /**
15103  * g_drive_eject_finish:
15104  * @drive: a #GDrive.
15105  * @result: a #GAsyncResult.
15106  * @error: a #GError, or %NULL
15107  *
15108  * Finishes ejecting a drive.
15109  *
15110  * Returns: %TRUE if the drive has been ejected successfully, %FALSE otherwise.
15111  * Deprecated: 2.22: Use g_drive_eject_with_operation_finish() instead.
15112  */
15113
15114
15115 /**
15116  * g_drive_eject_with_operation:
15117  * @drive: a #GDrive.
15118  * @flags: flags affecting the unmount if required for eject
15119  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
15120  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
15121  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
15122  * @user_data: user data passed to @callback.
15123  *
15124  * Ejects a drive. This is an asynchronous operation, and is
15125  * finished by calling g_drive_eject_with_operation_finish() with the @drive
15126  * and #GAsyncResult data returned in the @callback.
15127  *
15128  * Since: 2.22
15129  */
15130
15131
15132 /**
15133  * g_drive_eject_with_operation_finish:
15134  * @drive: a #GDrive.
15135  * @result: a #GAsyncResult.
15136  * @error: a #GError location to store the error occurring, or %NULL to ignore.
15137  *
15138  * Finishes ejecting a drive. If any errors occurred during the operation,
15139  * @error will be set to contain the errors and %FALSE will be returned.
15140  *
15141  * Returns: %TRUE if the drive was successfully ejected. %FALSE otherwise.
15142  * Since: 2.22
15143  */
15144
15145
15146 /**
15147  * g_drive_enumerate_identifiers:
15148  * @drive: a #GDrive
15149  *
15150  * Gets the kinds of identifiers that @drive has.
15151  * Use g_drive_get_identifier() to obtain the identifiers
15152  * themselves.
15153  *
15154  * Returns: (transfer full) (array zero-terminated=1): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
15155  */
15156
15157
15158 /**
15159  * g_drive_get_icon:
15160  * @drive: a #GDrive.
15161  *
15162  * Gets the icon for @drive.
15163  *
15164  * Returns: (transfer full): #GIcon for the @drive. Free the returned object with g_object_unref().
15165  */
15166
15167
15168 /**
15169  * g_drive_get_identifier:
15170  * @drive: a #GDrive
15171  * @kind: the kind of identifier to return
15172  *
15173  * Gets the identifier of the given kind for @drive.
15174  *
15175  * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GDrive doesn't have this kind of identifier.
15176  */
15177
15178
15179 /**
15180  * g_drive_get_name:
15181  * @drive: a #GDrive.
15182  *
15183  * Gets the name of @drive.
15184  *
15185  * Returns: a string containing @drive's name. The returned string should be freed when no longer needed.
15186  */
15187
15188
15189 /**
15190  * g_drive_get_sort_key:
15191  * @drive: A #GDrive.
15192  *
15193  * Gets the sort key for @drive, if any.
15194  *
15195  * Returns: Sorting key for @drive or %NULL if no such key is available.
15196  * Since: 2.32
15197  */
15198
15199
15200 /**
15201  * g_drive_get_start_stop_type:
15202  * @drive: a #GDrive.
15203  *
15204  * Gets a hint about how a drive can be started/stopped.
15205  *
15206  * Returns: A value from the #GDriveStartStopType enumeration.
15207  * Since: 2.22
15208  */
15209
15210
15211 /**
15212  * g_drive_get_volumes:
15213  * @drive: a #GDrive.
15214  *
15215  * Get a list of mountable volumes for @drive.
15216  *
15217  * The returned list should be freed with g_list_free(), after
15218  * its elements have been unreffed with g_object_unref().
15219  *
15220  * Returns: (element-type GVolume) (transfer full): #GList containing any #GVolume objects on the given @drive.
15221  */
15222
15223
15224 /**
15225  * g_drive_has_media:
15226  * @drive: a #GDrive.
15227  *
15228  * Checks if the @drive has media. Note that the OS may not be polling
15229  * the drive for media changes; see g_drive_is_media_check_automatic()
15230  * for more details.
15231  *
15232  * Returns: %TRUE if @drive has media, %FALSE otherwise.
15233  */
15234
15235
15236 /**
15237  * g_drive_has_volumes:
15238  * @drive: a #GDrive.
15239  *
15240  * Check if @drive has any mountable volumes.
15241  *
15242  * Returns: %TRUE if the @drive contains volumes, %FALSE otherwise.
15243  */
15244
15245
15246 /**
15247  * g_drive_is_media_check_automatic:
15248  * @drive: a #GDrive.
15249  *
15250  * Checks if @drive is capabable of automatically detecting media changes.
15251  *
15252  * Returns: %TRUE if the @drive is capabable of automatically detecting media changes, %FALSE otherwise.
15253  */
15254
15255
15256 /**
15257  * g_drive_is_media_removable:
15258  * @drive: a #GDrive.
15259  *
15260  * Checks if the @drive supports removable media.
15261  *
15262  * Returns: %TRUE if @drive supports removable media, %FALSE otherwise.
15263  */
15264
15265
15266 /**
15267  * g_drive_poll_for_media:
15268  * @drive: a #GDrive.
15269  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
15270  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
15271  * @user_data: user data to pass to @callback
15272  *
15273  * Asynchronously polls @drive to see if media has been inserted or removed.
15274  *
15275  * When the operation is finished, @callback will be called.
15276  * You can then call g_drive_poll_for_media_finish() to obtain the
15277  * result of the operation.
15278  */
15279
15280
15281 /**
15282  * g_drive_poll_for_media_finish:
15283  * @drive: a #GDrive.
15284  * @result: a #GAsyncResult.
15285  * @error: a #GError, or %NULL
15286  *
15287  * Finishes an operation started with g_drive_poll_for_media() on a drive.
15288  *
15289  * Returns: %TRUE if the drive has been poll_for_mediaed successfully, %FALSE otherwise.
15290  */
15291
15292
15293 /**
15294  * g_drive_start:
15295  * @drive: a #GDrive.
15296  * @flags: flags affecting the start operation.
15297  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
15298  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
15299  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
15300  * @user_data: user data to pass to @callback
15301  *
15302  * Asynchronously starts a drive.
15303  *
15304  * When the operation is finished, @callback will be called.
15305  * You can then call g_drive_start_finish() to obtain the
15306  * result of the operation.
15307  *
15308  * Since: 2.22
15309  */
15310
15311
15312 /**
15313  * g_drive_start_finish:
15314  * @drive: a #GDrive.
15315  * @result: a #GAsyncResult.
15316  * @error: a #GError, or %NULL
15317  *
15318  * Finishes starting a drive.
15319  *
15320  * Returns: %TRUE if the drive has been started successfully, %FALSE otherwise.
15321  * Since: 2.22
15322  */
15323
15324
15325 /**
15326  * g_drive_stop:
15327  * @drive: a #GDrive.
15328  * @flags: flags affecting the unmount if required for stopping.
15329  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
15330  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
15331  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
15332  * @user_data: user data to pass to @callback
15333  *
15334  * Asynchronously stops a drive.
15335  *
15336  * When the operation is finished, @callback will be called.
15337  * You can then call g_drive_stop_finish() to obtain the
15338  * result of the operation.
15339  *
15340  * Since: 2.22
15341  */
15342
15343
15344 /**
15345  * g_drive_stop_finish:
15346  * @drive: a #GDrive.
15347  * @result: a #GAsyncResult.
15348  * @error: a #GError, or %NULL
15349  *
15350  * Finishes stopping a drive.
15351  *
15352  * Returns: %TRUE if the drive has been stopped successfully, %FALSE otherwise.
15353  * Since: 2.22
15354  */
15355
15356
15357 /**
15358  * g_emblem_get_icon:
15359  * @emblem: a #GEmblem from which the icon should be extracted.
15360  *
15361  * Gives back the icon from @emblem.
15362  *
15363  * Returns: (transfer none): a #GIcon. The returned object belongs to the emblem and should not be modified or freed.
15364  * Since: 2.18
15365  */
15366
15367
15368 /**
15369  * g_emblem_get_origin:
15370  * @emblem: a #GEmblem
15371  *
15372  * Gets the origin of the emblem.
15373  *
15374  * Returns: (transfer none): the origin of the emblem
15375  * Since: 2.18
15376  */
15377
15378
15379 /**
15380  * g_emblem_new:
15381  * @icon: a GIcon containing the icon.
15382  *
15383  * Creates a new emblem for @icon.
15384  *
15385  * Returns: a new #GEmblem.
15386  * Since: 2.18
15387  */
15388
15389
15390 /**
15391  * g_emblem_new_with_origin:
15392  * @icon: a GIcon containing the icon.
15393  * @origin: a GEmblemOrigin enum defining the emblem's origin
15394  *
15395  * Creates a new emblem for @icon.
15396  *
15397  * Returns: a new #GEmblem.
15398  * Since: 2.18
15399  */
15400
15401
15402 /**
15403  * g_emblemed_icon_add_emblem:
15404  * @emblemed: a #GEmblemedIcon
15405  * @emblem: a #GEmblem
15406  *
15407  * Adds @emblem to the #GList of #GEmblem <!-- -->s.
15408  *
15409  * Since: 2.18
15410  */
15411
15412
15413 /**
15414  * g_emblemed_icon_clear_emblems:
15415  * @emblemed: a #GEmblemedIcon
15416  *
15417  * Removes all the emblems from @icon.
15418  *
15419  * Since: 2.28
15420  */
15421
15422
15423 /**
15424  * g_emblemed_icon_get_emblems:
15425  * @emblemed: a #GEmblemedIcon
15426  *
15427  * Gets the list of emblems for the @icon.
15428  *
15429  * Returns: (element-type Gio.Emblem) (transfer none): a #GList of #GEmblem <!-- -->s that is owned by @emblemed
15430  * Since: 2.18
15431  */
15432
15433
15434 /**
15435  * g_emblemed_icon_get_icon:
15436  * @emblemed: a #GEmblemedIcon
15437  *
15438  * Gets the main icon for @emblemed.
15439  *
15440  * Returns: (transfer none): a #GIcon that is owned by @emblemed
15441  * Since: 2.18
15442  */
15443
15444
15445 /**
15446  * g_emblemed_icon_new:
15447  * @icon: a #GIcon
15448  * @emblem: (allow-none): a #GEmblem, or %NULL
15449  *
15450  * Creates a new emblemed icon for @icon with the emblem @emblem.
15451  *
15452  * Returns: (transfer full) (type GEmblemedIcon): a new #GIcon
15453  * Since: 2.18
15454  */
15455
15456
15457 /**
15458  * g_file_append_to:
15459  * @file: input #GFile.
15460  * @flags: a set of #GFileCreateFlags.
15461  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
15462  * @error: a #GError, or %NULL
15463  *
15464  * Gets an output stream for appending data to the file. If
15465  * the file doesn't already exist it is created.
15466  *
15467  * By default files created are generally readable by everyone,
15468  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
15469  * will be made readable only to the current user, to the level that
15470  * is supported on the target filesystem.
15471  *
15472  * If @cancellable is not %NULL, then the operation can be cancelled by
15473  * triggering the cancellable object from another thread. If the operation
15474  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
15475  *
15476  * Some file systems don't allow all file names, and may
15477  * return an %G_IO_ERROR_INVALID_FILENAME error.
15478  * If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will be
15479  * returned. Other errors are possible too, and depend on what kind of
15480  * filesystem the file is on.
15481  *
15482  * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
15483  */
15484
15485
15486 /**
15487  * g_file_append_to_async:
15488  * @file: input #GFile.
15489  * @flags: a set of #GFileCreateFlags.
15490  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
15491  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
15492  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
15493  * @user_data: (closure): the data to pass to callback function
15494  *
15495  * Asynchronously opens @file for appending.
15496  *
15497  * For more details, see g_file_append_to() which is
15498  * the synchronous version of this call.
15499  *
15500  * When the operation is finished, @callback will be called. You can then call
15501  * g_file_append_to_finish() to get the result of the operation.
15502  */
15503
15504
15505 /**
15506  * g_file_append_to_finish:
15507  * @file: input #GFile.
15508  * @res: #GAsyncResult
15509  * @error: a #GError, or %NULL
15510  *
15511  * Finishes an asynchronous file append operation started with
15512  * g_file_append_to_async().
15513  *
15514  * Returns: (transfer full): a valid #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
15515  */
15516
15517
15518 /**
15519  * g_file_attribute_info_list_add:
15520  * @list: a #GFileAttributeInfoList.
15521  * @name: the name of the attribute to add.
15522  * @type: the #GFileAttributeType for the attribute.
15523  * @flags: #GFileAttributeInfoFlags for the attribute.
15524  *
15525  * Adds a new attribute with @name to the @list, setting
15526  * its @type and @flags.
15527  */
15528
15529
15530 /**
15531  * g_file_attribute_info_list_dup:
15532  * @list: a #GFileAttributeInfoList to duplicate.
15533  *
15534  * Makes a duplicate of a file attribute info list.
15535  *
15536  * Returns: a copy of the given @list.
15537  */
15538
15539
15540 /**
15541  * g_file_attribute_info_list_lookup:
15542  * @list: a #GFileAttributeInfoList.
15543  * @name: the name of the attribute to lookup.
15544  *
15545  * Gets the file attribute with the name @name from @list.
15546  *
15547  * Returns: a #GFileAttributeInfo for the @name, or %NULL if an attribute isn't found.
15548  */
15549
15550
15551 /**
15552  * g_file_attribute_info_list_new:
15553  *
15554  * Creates a new file attribute info list.
15555  *
15556  * Returns: a #GFileAttributeInfoList.
15557  */
15558
15559
15560 /**
15561  * g_file_attribute_info_list_ref:
15562  * @list: a #GFileAttributeInfoList to reference.
15563  *
15564  * References a file attribute info list.
15565  *
15566  * Returns: #GFileAttributeInfoList or %NULL on error.
15567  */
15568
15569
15570 /**
15571  * g_file_attribute_info_list_unref:
15572  * @list: The #GFileAttributeInfoList to unreference.
15573  *
15574  * Removes a reference from the given @list. If the reference count
15575  * falls to zero, the @list is deleted.
15576  */
15577
15578
15579 /**
15580  * g_file_attribute_matcher_enumerate_namespace:
15581  * @matcher: a #GFileAttributeMatcher.
15582  * @ns: a string containing a file attribute namespace.
15583  *
15584  * Checks if the matcher will match all of the keys in a given namespace.
15585  * This will always return %TRUE if a wildcard character is in use (e.g. if
15586  * matcher was created with "standard::*" and @ns is "standard", or if matcher was created
15587  * using "*" and namespace is anything.)
15588  *
15589  * TODO: this is awkwardly worded.
15590  *
15591  * Returns: %TRUE if the matcher matches all of the entries in the given @ns, %FALSE otherwise.
15592  */
15593
15594
15595 /**
15596  * g_file_attribute_matcher_enumerate_next:
15597  * @matcher: a #GFileAttributeMatcher.
15598  *
15599  * Gets the next matched attribute from a #GFileAttributeMatcher.
15600  *
15601  * Returns: a string containing the next attribute or %NULL if no more attribute exist.
15602  */
15603
15604
15605 /**
15606  * g_file_attribute_matcher_matches:
15607  * @matcher: a #GFileAttributeMatcher.
15608  * @attribute: a file attribute key.
15609  *
15610  * Checks if an attribute will be matched by an attribute matcher. If
15611  * the matcher was created with the "*" matching string, this function
15612  * will always return %TRUE.
15613  *
15614  * Returns: %TRUE if @attribute matches @matcher. %FALSE otherwise.
15615  */
15616
15617
15618 /**
15619  * g_file_attribute_matcher_matches_only:
15620  * @matcher: a #GFileAttributeMatcher.
15621  * @attribute: a file attribute key.
15622  *
15623  * Checks if a attribute matcher only matches a given attribute. Always
15624  * returns %FALSE if "*" was used when creating the matcher.
15625  *
15626  * Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
15627  */
15628
15629
15630 /**
15631  * g_file_attribute_matcher_new:
15632  * @attributes: an attribute string to match.
15633  *
15634  * Creates a new file attribute matcher, which matches attributes
15635  * against a given string. #GFileAttributeMatcher<!-- -->s are reference
15636  * counted structures, and are created with a reference count of 1. If
15637  * the number of references falls to 0, the #GFileAttributeMatcher is
15638  * automatically destroyed.
15639  *
15640  * The @attribute string should be formatted with specific keys separated
15641  * from namespaces with a double colon. Several "namespace::key" strings may be
15642  * concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
15643  * The wildcard "*" may be used to match all keys and namespaces, or
15644  * "namespace::*" will match all keys in a given namespace.
15645  *
15646  * Examples of strings to use:
15647  * <table>
15648  * <title>File Attribute Matcher strings and results</title>
15649  * <tgroup cols='2' align='left'><thead>
15650  * <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
15651  * <tbody>
15652  * <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
15653  * <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
15654  * <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
15655  * all keys in the unix namespace.</entry></row>
15656  * </tbody></tgroup>
15657  * </table>
15658  *
15659  * Returns: a #GFileAttributeMatcher.
15660  */
15661
15662
15663 /**
15664  * g_file_attribute_matcher_ref:
15665  * @matcher: a #GFileAttributeMatcher.
15666  *
15667  * References a file attribute matcher.
15668  *
15669  * Returns: a #GFileAttributeMatcher.
15670  */
15671
15672
15673 /**
15674  * g_file_attribute_matcher_subtract:
15675  * @matcher: Matcher to subtract from
15676  * @subtract: The matcher to subtract
15677  *
15678  * Subtracts all attributes of @subtract from @matcher and returns
15679  * a matcher that supports those attributes.
15680  *
15681  * Note that currently it is not possible to remove a single
15682  * attribute when the @matcher matches the whole namespace - or remove
15683  * a namespace or attribute when the matcher matches everything. This
15684  * is a limitation of the current implementation, but may be fixed
15685  * in the future.
15686  *
15687  * Returns: A file attribute matcher matching all attributes of @matcher that are not matched by @subtract
15688  */
15689
15690
15691 /**
15692  * g_file_attribute_matcher_to_string:
15693  * @matcher: (allow-none): a #GFileAttributeMatcher.
15694  *
15695  * Prints what the matcher is matching against. The format will be
15696  * equal to the format passed to g_file_attribute_matcher_new().
15697  * The output however, might not be identical, as the matcher may
15698  * decide to use a different order or omit needless parts.
15699  *
15700  * Returns: a string describing the attributes the matcher matches against or %NULL if @matcher was %NULL.
15701  * Since: 2.32
15702  */
15703
15704
15705 /**
15706  * g_file_attribute_matcher_unref:
15707  * @matcher: a #GFileAttributeMatcher.
15708  *
15709  * Unreferences @matcher. If the reference count falls below 1,
15710  * the @matcher is automatically freed.
15711  */
15712
15713
15714 /**
15715  * g_file_copy:
15716  * @source: input #GFile.
15717  * @destination: destination #GFile
15718  * @flags: set of #GFileCopyFlags
15719  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
15720  * @progress_callback: (allow-none) (scope call): function to callback with progress information, or %NULL if progress information is not needed
15721  * @progress_callback_data: (closure): user data to pass to @progress_callback
15722  * @error: #GError to set on error, or %NULL
15723  *
15724  * Copies the file @source to the location specified by @destination.
15725  * Can not handle recursive copies of directories.
15726  *
15727  * If the flag #G_FILE_COPY_OVERWRITE is specified an already
15728  * existing @destination file is overwritten.
15729  *
15730  * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
15731  * will be copied as symlinks, otherwise the target of the
15732  * @source symlink will be copied.
15733  *
15734  * If @cancellable is not %NULL, then the operation can be cancelled by
15735  * triggering the cancellable object from another thread. If the operation
15736  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
15737  *
15738  * If @progress_callback is not %NULL, then the operation can be monitored by
15739  * setting this to a #GFileProgressCallback function. @progress_callback_data
15740  * will be passed to this function. It is guaranteed that this callback will
15741  * be called after all data has been transferred with the total number of bytes
15742  * copied during the operation.
15743  *
15744  * If the @source file does not exist then the G_IO_ERROR_NOT_FOUND
15745  * error is returned, independent on the status of the @destination.
15746  *
15747  * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then the
15748  * error G_IO_ERROR_EXISTS is returned.
15749  *
15750  * If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY
15751  * error is returned. If trying to overwrite a directory with a directory the
15752  * G_IO_ERROR_WOULD_MERGE error is returned.
15753  *
15754  * If the source is a directory and the target does not exist, or
15755  * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
15756  * G_IO_ERROR_WOULD_RECURSE error is returned.
15757  *
15758  * If you are interested in copying the #GFile object itself (not the on-disk
15759  * file), see g_file_dup().
15760  *
15761  * Returns: %TRUE on success, %FALSE otherwise.
15762  */
15763
15764
15765 /**
15766  * g_file_copy_async: (skip)
15767  * @source: input #GFile.
15768  * @destination: destination #GFile
15769  * @flags: set of #GFileCopyFlags
15770  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
15771  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
15772  * @progress_callback: (allow-none): function to callback with progress information, or %NULL if progress information is not needed
15773  * @progress_callback_data: (closure): user data to pass to @progress_callback
15774  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
15775  * @user_data: the data to pass to callback function
15776  *
15777  * Copies the file @source to the location specified by @destination
15778  * asynchronously. For details of the behaviour, see g_file_copy().
15779  *
15780  * If @progress_callback is not %NULL, then that function that will be called
15781  * just like in g_file_copy(), however the callback will run in the main loop,
15782  * not in the thread that is doing the I/O operation.
15783  *
15784  * When the operation is finished, @callback will be called. You can then call
15785  * g_file_copy_finish() to get the result of the operation.
15786  */
15787
15788
15789 /**
15790  * g_file_copy_attributes:
15791  * @source: a #GFile with attributes.
15792  * @destination: a #GFile to copy attributes to.
15793  * @flags: a set of #GFileCopyFlags.
15794  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
15795  * @error: a #GError, %NULL to ignore.
15796  *
15797  * Copies the file attributes from @source to @destination.
15798  *
15799  * Normally only a subset of the file attributes are copied,
15800  * those that are copies in a normal file copy operation
15801  * (which for instance does not include e.g. owner). However
15802  * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
15803  * all the metadata that is possible to copy is copied. This
15804  * is useful when implementing move by copy + delete source.
15805  *
15806  * Returns: %TRUE if the attributes were copied successfully, %FALSE otherwise.
15807  */
15808
15809
15810 /**
15811  * g_file_copy_finish:
15812  * @file: input #GFile.
15813  * @res: a #GAsyncResult.
15814  * @error: a #GError, or %NULL
15815  *
15816  * Finishes copying the file started with
15817  * g_file_copy_async().
15818  *
15819  * Returns: a %TRUE on success, %FALSE on error.
15820  */
15821
15822
15823 /**
15824  * g_file_create:
15825  * @file: input #GFile.
15826  * @flags: a set of #GFileCreateFlags.
15827  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
15828  * @error: a #GError, or %NULL
15829  *
15830  * Creates a new file and returns an output stream for writing to it.
15831  * The file must not already exist.
15832  *
15833  * By default files created are generally readable by everyone,
15834  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
15835  * will be made readable only to the current user, to the level that
15836  * is supported on the target filesystem.
15837  *
15838  * If @cancellable is not %NULL, then the operation can be cancelled by
15839  * triggering the cancellable object from another thread. If the operation
15840  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
15841  *
15842  * If a file or directory with this name already exists the G_IO_ERROR_EXISTS
15843  * error will be returned.
15844  * Some file systems don't allow all file names, and may
15845  * return an G_IO_ERROR_INVALID_FILENAME error, and if the name
15846  * is to long G_IO_ERROR_FILENAME_TOO_LONG will be returned.
15847  * Other errors are possible too, and depend on what kind of
15848  * filesystem the file is on.
15849  *
15850  * Returns: (transfer full): a #GFileOutputStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
15851  */
15852
15853
15854 /**
15855  * g_file_create_async:
15856  * @file: input #GFile.
15857  * @flags: a set of #GFileCreateFlags.
15858  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
15859  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
15860  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
15861  * @user_data: (closure): the data to pass to callback function
15862  *
15863  * Asynchronously creates a new file and returns an output stream for writing to it.
15864  * The file must not already exist.
15865  *
15866  * For more details, see g_file_create() which is
15867  * the synchronous version of this call.
15868  *
15869  * When the operation is finished, @callback will be called. You can then call
15870  * g_file_create_finish() to get the result of the operation.
15871  */
15872
15873
15874 /**
15875  * g_file_create_finish:
15876  * @file: input #GFile.
15877  * @res: a #GAsyncResult.
15878  * @error: a #GError, or %NULL
15879  *
15880  * Finishes an asynchronous file create operation started with
15881  * g_file_create_async().
15882  *
15883  * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
15884  */
15885
15886
15887 /**
15888  * g_file_create_readwrite:
15889  * @file: a #GFile
15890  * @flags: a set of #GFileCreateFlags
15891  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
15892  * @error: return location for a #GError, or %NULL
15893  *
15894  * Creates a new file and returns a stream for reading and writing to it.
15895  * The file must not already exist.
15896  *
15897  * By default files created are generally readable by everyone,
15898  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
15899  * will be made readable only to the current user, to the level that
15900  * is supported on the target filesystem.
15901  *
15902  * If @cancellable is not %NULL, then the operation can be cancelled by
15903  * triggering the cancellable object from another thread. If the operation
15904  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
15905  *
15906  * If a file or directory with this name already exists the %G_IO_ERROR_EXISTS
15907  * error will be returned. Some file systems don't allow all file names,
15908  * and may return an %G_IO_ERROR_INVALID_FILENAME error, and if the name
15909  * is too long, %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors
15910  * are possible too, and depend on what kind of filesystem the file is on.
15911  *
15912  * Note that in many non-local file cases read and write streams are not
15913  * supported, so make sure you really need to do read and write streaming,
15914  * rather than just opening for reading or writing.
15915  *
15916  * Returns: (transfer full): a #GFileIOStream for the newly created file, or %NULL on error. Free the returned object with g_object_unref().
15917  * Since: 2.22
15918  */
15919
15920
15921 /**
15922  * g_file_create_readwrite_async:
15923  * @file: input #GFile
15924  * @flags: a set of #GFileCreateFlags
15925  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request
15926  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
15927  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
15928  * @user_data: (closure): the data to pass to callback function
15929  *
15930  * Asynchronously creates a new file and returns a stream for reading and
15931  * writing to it. The file must not already exist.
15932  *
15933  * For more details, see g_file_create_readwrite() which is
15934  * the synchronous version of this call.
15935  *
15936  * When the operation is finished, @callback will be called. You can then
15937  * call g_file_create_readwrite_finish() to get the result of the operation.
15938  *
15939  * Since: 2.22
15940  */
15941
15942
15943 /**
15944  * g_file_create_readwrite_finish:
15945  * @file: input #GFile
15946  * @res: a #GAsyncResult
15947  * @error: a #GError, or %NULL
15948  *
15949  * Finishes an asynchronous file create operation started with
15950  * g_file_create_readwrite_async().
15951  *
15952  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
15953  * Since: 2.22
15954  */
15955
15956
15957 /**
15958  * g_file_delete:
15959  * @file: input #GFile.
15960  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
15961  * @error: a #GError, or %NULL
15962  *
15963  * Deletes a file. If the @file is a directory, it will only be deleted if it
15964  * is empty.
15965  *
15966  * If @cancellable is not %NULL, then the operation can be cancelled by
15967  * triggering the cancellable object from another thread. If the operation
15968  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
15969  *
15970  * Virtual: delete_file
15971  * Returns: %TRUE if the file was deleted. %FALSE otherwise.
15972  */
15973
15974
15975 /**
15976  * g_file_descriptor_based_get_fd:
15977  * @fd_based: a #GFileDescriptorBased.
15978  *
15979  * Gets the underlying file descriptor.
15980  *
15981  * Returns: The file descriptor
15982  * Since: 2.24
15983  */
15984
15985
15986 /**
15987  * g_file_dup:
15988  * @file: input #GFile.
15989  *
15990  * Duplicates a #GFile handle. This operation does not duplicate
15991  * the actual file or directory represented by the #GFile; see
15992  * g_file_copy() if attempting to copy a file.
15993  *
15994  * This call does no blocking i/o.
15995  *
15996  * Returns: (transfer full): a new #GFile that is a duplicate of the given #GFile.
15997  */
15998
15999
16000 /**
16001  * g_file_eject_mountable:
16002  * @file: input #GFile.
16003  * @flags: flags affecting the operation
16004  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16005  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
16006  * @user_data: (closure): the data to pass to callback function
16007  *
16008  * Starts an asynchronous eject on a mountable.
16009  * When this operation has completed, @callback will be called with
16010  * @user_user data, and the operation can be finalized with
16011  * g_file_eject_mountable_finish().
16012  *
16013  * If @cancellable is not %NULL, then the operation can be cancelled by
16014  * triggering the cancellable object from another thread. If the operation
16015  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
16016  *
16017  * Deprecated: 2.22: Use g_file_eject_mountable_with_operation() instead.
16018  */
16019
16020
16021 /**
16022  * g_file_eject_mountable_finish:
16023  * @file: input #GFile.
16024  * @result: a #GAsyncResult.
16025  * @error: a #GError, or %NULL
16026  *
16027  * Finishes an asynchronous eject operation started by
16028  * g_file_eject_mountable().
16029  *
16030  * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
16031  * Deprecated: 2.22: Use g_file_eject_mountable_with_operation_finish() instead.
16032  */
16033
16034
16035 /**
16036  * g_file_eject_mountable_with_operation:
16037  * @file: input #GFile.
16038  * @flags: flags affecting the operation
16039  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
16040  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16041  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
16042  * @user_data: (closure): the data to pass to callback function
16043  *
16044  * Starts an asynchronous eject on a mountable.
16045  * When this operation has completed, @callback will be called with
16046  * @user_user data, and the operation can be finalized with
16047  * g_file_eject_mountable_with_operation_finish().
16048  *
16049  * If @cancellable is not %NULL, then the operation can be cancelled by
16050  * triggering the cancellable object from another thread. If the operation
16051  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
16052  *
16053  * Since: 2.22
16054  */
16055
16056
16057 /**
16058  * g_file_eject_mountable_with_operation_finish:
16059  * @file: input #GFile.
16060  * @result: a #GAsyncResult.
16061  * @error: a #GError, or %NULL
16062  *
16063  * Finishes an asynchronous eject operation started by
16064  * g_file_eject_mountable_with_operation().
16065  *
16066  * Returns: %TRUE if the @file was ejected successfully. %FALSE otherwise.
16067  * Since: 2.22
16068  */
16069
16070
16071 /**
16072  * g_file_enumerate_children:
16073  * @file: input #GFile.
16074  * @attributes: an attribute query string.
16075  * @flags: a set of #GFileQueryInfoFlags.
16076  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16077  * @error: #GError for error reporting.
16078  *
16079  * Gets the requested information about the files in a directory. The result
16080  * is a #GFileEnumerator object that will give out #GFileInfo objects for
16081  * all the files in the directory.
16082  *
16083  * The @attributes value is a string that specifies the file attributes that
16084  * should be gathered. It is not an error if it's not possible to read a particular
16085  * requested attribute from a file - it just won't be set. @attributes should
16086  * be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
16087  * means all attributes, and a wildcard like "standard::*" means all attributes in the standard
16088  * namespace. An example attribute query be "standard::*,owner::user".
16089  * The standard attributes are available as defines, like #G_FILE_ATTRIBUTE_STANDARD_NAME.
16090  *
16091  * If @cancellable is not %NULL, then the operation can be cancelled by
16092  * triggering the cancellable object from another thread. If the operation
16093  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
16094  *
16095  * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
16096  * If the file is not a directory, the G_FILE_ERROR_NOTDIR error will be returned.
16097  * Other errors are possible too.
16098  *
16099  * Returns: (transfer full): A #GFileEnumerator if successful, %NULL on error. Free the returned object with g_object_unref().
16100  */
16101
16102
16103 /**
16104  * g_file_enumerate_children_async:
16105  * @file: input #GFile.
16106  * @attributes: an attribute query string.
16107  * @flags: a set of #GFileQueryInfoFlags.
16108  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
16109  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16110  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
16111  * @user_data: (closure): the data to pass to callback function
16112  *
16113  * Asynchronously gets the requested information about the files in a directory. The result
16114  * is a #GFileEnumerator object that will give out #GFileInfo objects for
16115  * all the files in the directory.
16116  *
16117  * For more details, see g_file_enumerate_children() which is
16118  * the synchronous version of this call.
16119  *
16120  * When the operation is finished, @callback will be called. You can then call
16121  * g_file_enumerate_children_finish() to get the result of the operation.
16122  */
16123
16124
16125 /**
16126  * g_file_enumerate_children_finish:
16127  * @file: input #GFile.
16128  * @res: a #GAsyncResult.
16129  * @error: a #GError.
16130  *
16131  * Finishes an async enumerate children operation.
16132  * See g_file_enumerate_children_async().
16133  *
16134  * Returns: (transfer full): a #GFileEnumerator or %NULL if an error occurred. Free the returned object with g_object_unref().
16135  */
16136
16137
16138 /**
16139  * g_file_enumerator_close:
16140  * @enumerator: a #GFileEnumerator.
16141  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16142  * @error: location to store the error occurring, or %NULL to ignore
16143  *
16144  * Releases all resources used by this enumerator, making the
16145  * enumerator return %G_IO_ERROR_CLOSED on all calls.
16146  *
16147  * This will be automatically called when the last reference
16148  * is dropped, but you might want to call this function to make
16149  * sure resources are released as early as possible.
16150  *
16151  * Returns: #TRUE on success or #FALSE on error.
16152  */
16153
16154
16155 /**
16156  * g_file_enumerator_close_async:
16157  * @enumerator: a #GFileEnumerator.
16158  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
16159  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16160  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
16161  * @user_data: (closure): the data to pass to callback function
16162  *
16163  * Asynchronously closes the file enumerator.
16164  *
16165  * If @cancellable is not %NULL, then the operation can be cancelled by
16166  * triggering the cancellable object from another thread. If the operation
16167  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
16168  * g_file_enumerator_close_finish().
16169  */
16170
16171
16172 /**
16173  * g_file_enumerator_close_finish:
16174  * @enumerator: a #GFileEnumerator.
16175  * @result: a #GAsyncResult.
16176  * @error: a #GError location to store the error occurring, or %NULL to ignore.
16177  *
16178  * Finishes closing a file enumerator, started from g_file_enumerator_close_async().
16179  *
16180  * If the file enumerator was already closed when g_file_enumerator_close_async()
16181  * was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
16182  * return %FALSE. If the file enumerator had pending operation when the close
16183  * operation was started, then this function will report %G_IO_ERROR_PENDING, and
16184  * return %FALSE.  If @cancellable was not %NULL, then the operation may have been
16185  * cancelled by triggering the cancellable object from another thread. If the operation
16186  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
16187  * returned.
16188  *
16189  * Returns: %TRUE if the close operation has finished successfully.
16190  */
16191
16192
16193 /**
16194  * g_file_enumerator_get_container:
16195  * @enumerator: a #GFileEnumerator
16196  *
16197  * Get the #GFile container which is being enumerated.
16198  *
16199  * Returns: (transfer none): the #GFile which is being enumerated.
16200  * Since: 2.18
16201  */
16202
16203
16204 /**
16205  * g_file_enumerator_has_pending:
16206  * @enumerator: a #GFileEnumerator.
16207  *
16208  * Checks if the file enumerator has pending operations.
16209  *
16210  * Returns: %TRUE if the @enumerator has pending operations.
16211  */
16212
16213
16214 /**
16215  * g_file_enumerator_is_closed:
16216  * @enumerator: a #GFileEnumerator.
16217  *
16218  * Checks if the file enumerator has been closed.
16219  *
16220  * Returns: %TRUE if the @enumerator is closed.
16221  */
16222
16223
16224 /**
16225  * g_file_enumerator_next_file:
16226  * @enumerator: a #GFileEnumerator.
16227  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16228  * @error: location to store the error occurring, or %NULL to ignore
16229  *
16230  * Returns information for the next file in the enumerated object.
16231  * Will block until the information is available. The #GFileInfo
16232  * returned from this function will contain attributes that match the
16233  * attribute string that was passed when the #GFileEnumerator was created.
16234  *
16235  * On error, returns %NULL and sets @error to the error. If the
16236  * enumerator is at the end, %NULL will be returned and @error will
16237  * be unset.
16238  *
16239  * 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.
16240  */
16241
16242
16243 /**
16244  * g_file_enumerator_next_files_async:
16245  * @enumerator: a #GFileEnumerator.
16246  * @num_files: the number of file info objects to request
16247  * @io_priority: the <link linkend="gioscheduler">io priority</link> of the request.
16248  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16249  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
16250  * @user_data: (closure): the data to pass to callback function
16251  *
16252  * Request information for a number of files from the enumerator asynchronously.
16253  * When all i/o for the operation is finished the @callback will be called with
16254  * the requested information.
16255  *
16256  * The callback can be called with less than @num_files files in case of error
16257  * or at the end of the enumerator. In case of a partial error the callback will
16258  * be called with any succeeding items and no error, and on the next request the
16259  * error will be reported. If a request is cancelled the callback will be called
16260  * with %G_IO_ERROR_CANCELLED.
16261  *
16262  * During an async request no other sync and async calls are allowed, and will
16263  * result in %G_IO_ERROR_PENDING errors.
16264  *
16265  * Any outstanding i/o request with higher priority (lower numerical value) will
16266  * be executed before an outstanding request with lower priority. Default
16267  * priority is %G_PRIORITY_DEFAULT.
16268  */
16269
16270
16271 /**
16272  * g_file_enumerator_next_files_finish:
16273  * @enumerator: a #GFileEnumerator.
16274  * @result: a #GAsyncResult.
16275  * @error: a #GError location to store the error occurring, or %NULL to ignore.
16276  *
16277  * Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
16278  *
16279  * 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.
16280  */
16281
16282
16283 /**
16284  * g_file_enumerator_set_pending:
16285  * @enumerator: a #GFileEnumerator.
16286  * @pending: a boolean value.
16287  *
16288  * Sets the file enumerator as having pending operations.
16289  */
16290
16291
16292 /**
16293  * g_file_equal:
16294  * @file1: the first #GFile.
16295  * @file2: the second #GFile.
16296  *
16297  * Checks equality of two given #GFile<!-- -->s. Note that two
16298  * #GFile<!-- -->s that differ can still refer to the same
16299  * file on the filesystem due to various forms of filename
16300  * aliasing.
16301  *
16302  * This call does no blocking i/o.
16303  *
16304  * Returns: %TRUE if @file1 and @file2 are equal. %FALSE if either is not a #GFile.
16305  */
16306
16307
16308 /**
16309  * g_file_find_enclosing_mount:
16310  * @file: input #GFile.
16311  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16312  * @error: a #GError.
16313  *
16314  * Gets a #GMount for the #GFile.
16315  *
16316  * If the #GFileIface for @file does not have a mount (e.g. possibly a
16317  * remote share), @error will be set to %G_IO_ERROR_NOT_FOUND and %NULL
16318  * will be returned.
16319  *
16320  * If @cancellable is not %NULL, then the operation can be cancelled by
16321  * triggering the cancellable object from another thread. If the operation
16322  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
16323  *
16324  * Returns: (transfer full): a #GMount where the @file is located or %NULL on error. Free the returned object with g_object_unref().
16325  */
16326
16327
16328 /**
16329  * g_file_find_enclosing_mount_async:
16330  * @file: a #GFile
16331  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
16332  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
16333  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
16334  * @user_data: (closure): the data to pass to callback function
16335  *
16336  * Asynchronously gets the mount for the file.
16337  *
16338  * For more details, see g_file_find_enclosing_mount() which is
16339  * the synchronous version of this call.
16340  *
16341  * When the operation is finished, @callback will be called. You can then call
16342  * g_file_find_enclosing_mount_finish() to get the result of the operation.
16343  */
16344
16345
16346 /**
16347  * g_file_find_enclosing_mount_finish:
16348  * @file: a #GFile
16349  * @res: a #GAsyncResult
16350  * @error: a #GError
16351  *
16352  * Finishes an asynchronous find mount request.
16353  * See g_file_find_enclosing_mount_async().
16354  *
16355  * Returns: (transfer full): #GMount for given @file or %NULL on error. Free the returned object with g_object_unref().
16356  */
16357
16358
16359 /**
16360  * g_file_get_basename:
16361  * @file: input #GFile.
16362  *
16363  * Gets the base name (the last component of the path) for a given #GFile.
16364  *
16365  * If called for the top level of a system (such as the filesystem root
16366  * or a uri like sftp://host/) it will return a single directory separator
16367  * (and on Windows, possibly a drive letter).
16368  *
16369  * The base name is a byte string (*not* UTF-8). It has no defined encoding
16370  * or rules other than it may not contain zero bytes.  If you want to use
16371  * filenames in a user interface you should use the display name that you
16372  * can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
16373  * attribute with g_file_query_info().
16374  *
16375  * This call does no blocking i/o.
16376  *
16377  * 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.
16378  */
16379
16380
16381 /**
16382  * g_file_get_child:
16383  * @file: input #GFile.
16384  * @name: string containing the child's basename.
16385  *
16386  * Gets a child of @file with basename equal to @name.
16387  *
16388  * Note that the file with that specific name might not exist, but
16389  * you can still have a #GFile that points to it. You can use this
16390  * for instance to create that file.
16391  *
16392  * This call does no blocking i/o.
16393  *
16394  * Returns: (transfer full): a #GFile to a child specified by @name. Free the returned object with g_object_unref().
16395  */
16396
16397
16398 /**
16399  * g_file_get_child_for_display_name:
16400  * @file: input #GFile.
16401  * @display_name: string to a possible child.
16402  * @error: #GError.
16403  *
16404  * Gets the child of @file for a given @display_name (i.e. a UTF8
16405  * version of the name). If this function fails, it returns %NULL and @error will be
16406  * set. This is very useful when constructing a GFile for a new file
16407  * and the user entered the filename in the user interface, for instance
16408  * when you select a directory and type a filename in the file selector.
16409  *
16410  * This call does no blocking i/o.
16411  *
16412  * 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().
16413  */
16414
16415
16416 /**
16417  * g_file_get_parent:
16418  * @file: input #GFile.
16419  *
16420  * Gets the parent directory for the @file.
16421  * If the @file represents the root directory of the
16422  * file system, then %NULL will be returned.
16423  *
16424  * This call does no blocking i/o.
16425  *
16426  * 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().
16427  */
16428
16429
16430 /**
16431  * g_file_get_parse_name:
16432  * @file: input #GFile.
16433  *
16434  * Gets the parse name of the @file.
16435  * A parse name is a UTF-8 string that describes the
16436  * file such that one can get the #GFile back using
16437  * g_file_parse_name().
16438  *
16439  * This is generally used to show the #GFile as a nice
16440  * full-pathname kind of string in a user interface,
16441  * like in a location entry.
16442  *
16443  * For local files with names that can safely be converted
16444  * to UTF8 the pathname is used, otherwise the IRI is used
16445  * (a form of URI that allows UTF8 characters unescaped).
16446  *
16447  * This call does no blocking i/o.
16448  *
16449  * Returns: a string containing the #GFile's parse name. The returned string should be freed with g_free() when no longer needed.
16450  */
16451
16452
16453 /**
16454  * g_file_get_path:
16455  * @file: input #GFile.
16456  *
16457  * Gets the local pathname for #GFile, if one exists.
16458  *
16459  * This call does no blocking i/o.
16460  *
16461  * 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.
16462  */
16463
16464
16465 /**
16466  * g_file_get_relative_path:
16467  * @parent: input #GFile.
16468  * @descendant: input #GFile.
16469  *
16470  * Gets the path for @descendant relative to @parent.
16471  *
16472  * This call does no blocking i/o.
16473  *
16474  * 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.
16475  */
16476
16477
16478 /**
16479  * g_file_get_uri:
16480  * @file: input #GFile.
16481  *
16482  * Gets the URI for the @file.
16483  *
16484  * This call does no blocking i/o.
16485  *
16486  * Returns: a string containing the #GFile's URI. The returned string should be freed with g_free() when no longer needed.
16487  */
16488
16489
16490 /**
16491  * g_file_get_uri_scheme:
16492  * @file: input #GFile.
16493  *
16494  * Gets the URI scheme for a #GFile.
16495  * RFC 3986 decodes the scheme as:
16496  * <programlisting>
16497  * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
16498  * </programlisting>
16499  * Common schemes include "file", "http", "ftp", etc.
16500  *
16501  * This call does no blocking i/o.
16502  *
16503  * Returns: a string containing the URI scheme for the given #GFile. The returned string should be freed with g_free() when no longer needed.
16504  */
16505
16506
16507 /**
16508  * g_file_has_parent:
16509  * @file: input #GFile
16510  * @parent: (allow-none): the parent to check for, or %NULL
16511  *
16512  * Checks if @file has a parent, and optionally, if it is @parent.
16513  *
16514  * If @parent is %NULL then this function returns %TRUE if @file has any
16515  * parent at all.  If @parent is non-%NULL then %TRUE is only returned
16516  * if @file is a child of @parent.
16517  *
16518  * Returns: %TRUE if @file is a child of @parent (or any parent in the case that @parent is %NULL).
16519  * Since: 2.24
16520  */
16521
16522
16523 /**
16524  * g_file_has_prefix:
16525  * @file: input #GFile.
16526  * @prefix: input #GFile.
16527  *
16528  * Checks whether @file has the prefix specified by @prefix. In other word,
16529  * if the names of initial elements of @file<!-- -->s pathname match @prefix.
16530  * Only full pathname elements are matched, so a path like /foo is not
16531  * considered a prefix of /foobar, only of /foo/bar.
16532  *
16533  * This call does no i/o, as it works purely on names. As such it can
16534  * sometimes return %FALSE even if @file is inside a @prefix (from a
16535  * filesystem point of view), because the prefix of @file is an alias
16536  * of @prefix.
16537  *
16538  * Virtual: prefix_matches
16539  * Returns: %TRUE if the @files's parent, grandparent, etc is @prefix. %FALSE otherwise.
16540  */
16541
16542
16543 /**
16544  * g_file_has_uri_scheme:
16545  * @file: input #GFile.
16546  * @uri_scheme: a string containing a URI scheme.
16547  *
16548  * Checks to see if a #GFile has a given URI scheme.
16549  *
16550  * This call does no blocking i/o.
16551  *
16552  * Returns: %TRUE if #GFile's backend supports the given URI scheme, %FALSE if URI scheme is %NULL, not supported, or #GFile is invalid.
16553  */
16554
16555
16556 /**
16557  * g_file_hash:
16558  * @file: (type GFile): #gconstpointer to a #GFile.
16559  *
16560  * Creates a hash value for a #GFile.
16561  *
16562  * This call does no blocking i/o.
16563  *
16564  * Virtual: hash
16565  * 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.
16566  */
16567
16568
16569 /**
16570  * g_file_icon_get_file:
16571  * @icon: a #GIcon.
16572  *
16573  * Gets the #GFile associated with the given @icon.
16574  *
16575  * Returns: (transfer none): a #GFile, or %NULL.
16576  */
16577
16578
16579 /**
16580  * g_file_icon_new:
16581  * @file: a #GFile.
16582  *
16583  * Creates a new icon for a file.
16584  *
16585  * Returns: (transfer full) (type GFileIcon): a #GIcon for the given @file, or %NULL on error.
16586  */
16587
16588
16589 /**
16590  * g_file_info_clear_status:
16591  * @info: a #GFileInfo.
16592  *
16593  * Clears the status information from @info.
16594  */
16595
16596
16597 /**
16598  * g_file_info_copy_into:
16599  * @src_info: source to copy attributes from.
16600  * @dest_info: destination to copy attributes to.
16601  *
16602  * Copies all of the <link linkend="gio-GFileAttribute">GFileAttribute</link>s
16603  * from @src_info to @dest_info.
16604  */
16605
16606
16607 /**
16608  * g_file_info_dup:
16609  * @other: a #GFileInfo.
16610  *
16611  * Duplicates a file info structure.
16612  *
16613  * Returns: (transfer full): a duplicate #GFileInfo of @other.
16614  */
16615
16616
16617 /**
16618  * g_file_info_get_attribute_as_string:
16619  * @info: a #GFileInfo.
16620  * @attribute: a file attribute key.
16621  *
16622  * Gets the value of a attribute, formated as a string.
16623  * This escapes things as needed to make the string valid
16624  * utf8.
16625  *
16626  * Returns: a UTF-8 string associated with the given @attribute. When you're done with the string it must be freed with g_free().
16627  */
16628
16629
16630 /**
16631  * g_file_info_get_attribute_boolean:
16632  * @info: a #GFileInfo.
16633  * @attribute: a file attribute key.
16634  *
16635  * Gets the value of a boolean attribute. If the attribute does not
16636  * contain a boolean value, %FALSE will be returned.
16637  *
16638  * Returns: the boolean value contained within the attribute.
16639  */
16640
16641
16642 /**
16643  * g_file_info_get_attribute_byte_string:
16644  * @info: a #GFileInfo.
16645  * @attribute: a file attribute key.
16646  *
16647  * Gets the value of a byte string attribute. If the attribute does
16648  * not contain a byte string, %NULL will be returned.
16649  *
16650  * Returns: the contents of the @attribute value as a byte string, or %NULL otherwise.
16651  */
16652
16653
16654 /**
16655  * g_file_info_get_attribute_data:
16656  * @info: a #GFileInfo
16657  * @attribute: a file attribute key
16658  * @type: (out) (allow-none): return location for the attribute type, or %NULL
16659  * @value_pp: (out) (allow-none): return location for the attribute value, or %NULL
16660  * @status: (out) (allow-none): return location for the attribute status, or %NULL
16661  *
16662  * Gets the attribute type, value and status for an attribute key.
16663  *
16664  * Returns: (transfer none): %TRUE if @info has an attribute named @attribute, %FALSE otherwise.
16665  */
16666
16667
16668 /**
16669  * g_file_info_get_attribute_int32:
16670  * @info: a #GFileInfo.
16671  * @attribute: a file attribute key.
16672  *
16673  * Gets a signed 32-bit integer contained within the attribute. If the
16674  * attribute does not contain a signed 32-bit integer, or is invalid,
16675  * 0 will be returned.
16676  *
16677  * Returns: a signed 32-bit integer from the attribute.
16678  */
16679
16680
16681 /**
16682  * g_file_info_get_attribute_int64:
16683  * @info: a #GFileInfo.
16684  * @attribute: a file attribute key.
16685  *
16686  * Gets a signed 64-bit integer contained within the attribute. If the
16687  * attribute does not contain an signed 64-bit integer, or is invalid,
16688  * 0 will be returned.
16689  *
16690  * Returns: a signed 64-bit integer from the attribute.
16691  */
16692
16693
16694 /**
16695  * g_file_info_get_attribute_object:
16696  * @info: a #GFileInfo.
16697  * @attribute: a file attribute key.
16698  *
16699  * Gets the value of a #GObject attribute. If the attribute does
16700  * not contain a #GObject, %NULL will be returned.
16701  *
16702  * Returns: (transfer none): a #GObject associated with the given @attribute, or %NULL otherwise.
16703  */
16704
16705
16706 /**
16707  * g_file_info_get_attribute_status:
16708  * @info: a #GFileInfo
16709  * @attribute: a file attribute key
16710  *
16711  * Gets the attribute status for an attribute key.
16712  *
16713  * Returns: a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
16714  */
16715
16716
16717 /**
16718  * g_file_info_get_attribute_string:
16719  * @info: a #GFileInfo.
16720  * @attribute: a file attribute key.
16721  *
16722  * Gets the value of a string attribute. If the attribute does
16723  * not contain a string, %NULL will be returned.
16724  *
16725  * Returns: the contents of the @attribute value as a UTF-8 string, or %NULL otherwise.
16726  */
16727
16728
16729 /**
16730  * g_file_info_get_attribute_stringv:
16731  * @info: a #GFileInfo.
16732  * @attribute: a file attribute key.
16733  *
16734  * Gets the value of a stringv attribute. If the attribute does
16735  * not contain a stringv, %NULL will be returned.
16736  *
16737  * Returns: (transfer none): the contents of the @attribute value as a stringv, or %NULL otherwise. Do not free. These returned strings are UTF-8.
16738  * Since: 2.22
16739  */
16740
16741
16742 /**
16743  * g_file_info_get_attribute_type:
16744  * @info: a #GFileInfo.
16745  * @attribute: a file attribute key.
16746  *
16747  * Gets the attribute type for an attribute key.
16748  *
16749  * Returns: a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
16750  */
16751
16752
16753 /**
16754  * g_file_info_get_attribute_uint32:
16755  * @info: a #GFileInfo.
16756  * @attribute: a file attribute key.
16757  *
16758  * Gets an unsigned 32-bit integer contained within the attribute. If the
16759  * attribute does not contain an unsigned 32-bit integer, or is invalid,
16760  * 0 will be returned.
16761  *
16762  * Returns: an unsigned 32-bit integer from the attribute.
16763  */
16764
16765
16766 /**
16767  * g_file_info_get_attribute_uint64:
16768  * @info: a #GFileInfo.
16769  * @attribute: a file attribute key.
16770  *
16771  * Gets a unsigned 64-bit integer contained within the attribute. If the
16772  * attribute does not contain an unsigned 64-bit integer, or is invalid,
16773  * 0 will be returned.
16774  *
16775  * Returns: a unsigned 64-bit integer from the attribute.
16776  */
16777
16778
16779 /**
16780  * g_file_info_get_content_type:
16781  * @info: a #GFileInfo.
16782  *
16783  * Gets the file's content type.
16784  *
16785  * Returns: a string containing the file's content type.
16786  */
16787
16788
16789 /**
16790  * g_file_info_get_display_name:
16791  * @info: a #GFileInfo.
16792  *
16793  * Gets a display name for a file.
16794  *
16795  * Returns: a string containing the display name.
16796  */
16797
16798
16799 /**
16800  * g_file_info_get_edit_name:
16801  * @info: a #GFileInfo.
16802  *
16803  * Gets the edit name for a file.
16804  *
16805  * Returns: a string containing the edit name.
16806  */
16807
16808
16809 /**
16810  * g_file_info_get_etag:
16811  * @info: a #GFileInfo.
16812  *
16813  * Gets the <link linkend="gfile-etag">entity tag</link> for a given
16814  * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
16815  *
16816  * Returns: a string containing the value of the "etag:value" attribute.
16817  */
16818
16819
16820 /**
16821  * g_file_info_get_file_type:
16822  * @info: a #GFileInfo.
16823  *
16824  * Gets a file's type (whether it is a regular file, symlink, etc).
16825  * This is different from the file's content type, see g_file_info_get_content_type().
16826  *
16827  * Returns: a #GFileType for the given file.
16828  */
16829
16830
16831 /**
16832  * g_file_info_get_icon:
16833  * @info: a #GFileInfo.
16834  *
16835  * Gets the icon for a file.
16836  *
16837  * Returns: (transfer none): #GIcon for the given @info.
16838  */
16839
16840
16841 /**
16842  * g_file_info_get_is_backup:
16843  * @info: a #GFileInfo.
16844  *
16845  * Checks if a file is a backup file.
16846  *
16847  * Returns: %TRUE if file is a backup file, %FALSE otherwise.
16848  */
16849
16850
16851 /**
16852  * g_file_info_get_is_hidden:
16853  * @info: a #GFileInfo.
16854  *
16855  * Checks if a file is hidden.
16856  *
16857  * Returns: %TRUE if the file is a hidden file, %FALSE otherwise.
16858  */
16859
16860
16861 /**
16862  * g_file_info_get_is_symlink:
16863  * @info: a #GFileInfo.
16864  *
16865  * Checks if a file is a symlink.
16866  *
16867  * Returns: %TRUE if the given @info is a symlink.
16868  */
16869
16870
16871 /**
16872  * g_file_info_get_modification_time:
16873  * @info: a #GFileInfo.
16874  * @result: (out caller-allocates): a #GTimeVal.
16875  *
16876  * Gets the modification time of the current @info and sets it
16877  * in @result.
16878  */
16879
16880
16881 /**
16882  * g_file_info_get_name:
16883  * @info: a #GFileInfo.
16884  *
16885  * Gets the name for a file.
16886  *
16887  * Returns: a string containing the file name.
16888  */
16889
16890
16891 /**
16892  * g_file_info_get_size:
16893  * @info: a #GFileInfo.
16894  *
16895  * Gets the file's size.
16896  *
16897  * Returns: a #goffset containing the file's size.
16898  */
16899
16900
16901 /**
16902  * g_file_info_get_sort_order:
16903  * @info: a #GFileInfo.
16904  *
16905  * Gets the value of the sort_order attribute from the #GFileInfo.
16906  * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
16907  *
16908  * Returns: a #gint32 containing the value of the "standard::sort_order" attribute.
16909  */
16910
16911
16912 /**
16913  * g_file_info_get_symlink_target:
16914  * @info: a #GFileInfo.
16915  *
16916  * Gets the symlink target for a given #GFileInfo.
16917  *
16918  * Returns: a string containing the symlink target.
16919  */
16920
16921
16922 /**
16923  * g_file_info_has_attribute:
16924  * @info: a #GFileInfo.
16925  * @attribute: a file attribute key.
16926  *
16927  * Checks if a file info structure has an attribute named @attribute.
16928  *
16929  * Returns: %TRUE if @Ginfo has an attribute named @attribute, %FALSE otherwise.
16930  */
16931
16932
16933 /**
16934  * g_file_info_has_namespace:
16935  * @info: a #GFileInfo.
16936  * @name_space: a file attribute namespace.
16937  *
16938  * Checks if a file info structure has an attribute in the
16939  * specified @name_space.
16940  *
16941  * Returns: %TRUE if @Ginfo has an attribute in @name_space, %FALSE otherwise.
16942  * Since: 2.22
16943  */
16944
16945
16946 /**
16947  * g_file_info_list_attributes:
16948  * @info: a #GFileInfo.
16949  * @name_space: a file attribute key's namespace.
16950  *
16951  * Lists the file info structure's attributes.
16952  *
16953  * 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.
16954  */
16955
16956
16957 /**
16958  * g_file_info_new:
16959  *
16960  * Creates a new file info structure.
16961  *
16962  * Returns: a #GFileInfo.
16963  */
16964
16965
16966 /**
16967  * g_file_info_remove_attribute:
16968  * @info: a #GFileInfo.
16969  * @attribute: a file attribute key.
16970  *
16971  * Removes all cases of @attribute from @info if it exists.
16972  */
16973
16974
16975 /**
16976  * g_file_info_set_attribute:
16977  * @info: a #GFileInfo.
16978  * @attribute: a file attribute key.
16979  * @type: a #GFileAttributeType
16980  * @value_p: pointer to the value
16981  *
16982  * Sets the @attribute to contain the given value, if possible. To unset the
16983  * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
16984  */
16985
16986
16987 /**
16988  * g_file_info_set_attribute_boolean:
16989  * @info: a #GFileInfo.
16990  * @attribute: a file attribute key.
16991  * @attr_value: a boolean value.
16992  *
16993  * Sets the @attribute to contain the given @attr_value,
16994  * if possible.
16995  */
16996
16997
16998 /**
16999  * g_file_info_set_attribute_byte_string:
17000  * @info: a #GFileInfo.
17001  * @attribute: a file attribute key.
17002  * @attr_value: a byte string.
17003  *
17004  * Sets the @attribute to contain the given @attr_value,
17005  * if possible.
17006  */
17007
17008
17009 /**
17010  * g_file_info_set_attribute_int32:
17011  * @info: a #GFileInfo.
17012  * @attribute: a file attribute key.
17013  * @attr_value: a signed 32-bit integer
17014  *
17015  * Sets the @attribute to contain the given @attr_value,
17016  * if possible.
17017  */
17018
17019
17020 /**
17021  * g_file_info_set_attribute_int64:
17022  * @info: a #GFileInfo.
17023  * @attribute: attribute name to set.
17024  * @attr_value: int64 value to set attribute to.
17025  *
17026  * Sets the @attribute to contain the given @attr_value,
17027  * if possible.
17028  */
17029
17030
17031 /**
17032  * g_file_info_set_attribute_mask:
17033  * @info: a #GFileInfo.
17034  * @mask: a #GFileAttributeMatcher.
17035  *
17036  * Sets @mask on @info to match specific attribute types.
17037  */
17038
17039
17040 /**
17041  * g_file_info_set_attribute_object:
17042  * @info: a #GFileInfo.
17043  * @attribute: a file attribute key.
17044  * @attr_value: a #GObject.
17045  *
17046  * Sets the @attribute to contain the given @attr_value,
17047  * if possible.
17048  */
17049
17050
17051 /**
17052  * g_file_info_set_attribute_status:
17053  * @info: a #GFileInfo
17054  * @attribute: a file attribute key
17055  * @status: a #GFileAttributeStatus
17056  *
17057  * Sets the attribute status for an attribute key. This is only
17058  * needed by external code that implement g_file_set_attributes_from_info()
17059  * or similar functions.
17060  *
17061  * The attribute must exist in @info for this to work. Otherwise %FALSE
17062  * is returned and @info is unchanged.
17063  *
17064  * Returns: %TRUE if the status was changed, %FALSE if the key was not set.
17065  * Since: 2.22
17066  */
17067
17068
17069 /**
17070  * g_file_info_set_attribute_string:
17071  * @info: a #GFileInfo.
17072  * @attribute: a file attribute key.
17073  * @attr_value: a UTF-8 string.
17074  *
17075  * Sets the @attribute to contain the given @attr_value,
17076  * if possible.
17077  */
17078
17079
17080 /**
17081  * g_file_info_set_attribute_stringv:
17082  * @info: a #GFileInfo.
17083  * @attribute: a file attribute key
17084  * @attr_value: (array) (element-type utf8): a %NULL terminated array of UTF-8 strings.
17085  *
17086  * Sets the @attribute to contain the given @attr_value,
17087  * if possible.
17088  *
17089  * Sinze: 2.22
17090  */
17091
17092
17093 /**
17094  * g_file_info_set_attribute_uint32:
17095  * @info: a #GFileInfo.
17096  * @attribute: a file attribute key.
17097  * @attr_value: an unsigned 32-bit integer.
17098  *
17099  * Sets the @attribute to contain the given @attr_value,
17100  * if possible.
17101  */
17102
17103
17104 /**
17105  * g_file_info_set_attribute_uint64:
17106  * @info: a #GFileInfo.
17107  * @attribute: a file attribute key.
17108  * @attr_value: an unsigned 64-bit integer.
17109  *
17110  * Sets the @attribute to contain the given @attr_value,
17111  * if possible.
17112  */
17113
17114
17115 /**
17116  * g_file_info_set_content_type:
17117  * @info: a #GFileInfo.
17118  * @content_type: a content type. See <link linkend="gio-GContentType">GContentType</link>.
17119  *
17120  * Sets the content type attribute for a given #GFileInfo.
17121  * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
17122  */
17123
17124
17125 /**
17126  * g_file_info_set_display_name:
17127  * @info: a #GFileInfo.
17128  * @display_name: a string containing a display name.
17129  *
17130  * Sets the display name for the current #GFileInfo.
17131  * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
17132  */
17133
17134
17135 /**
17136  * g_file_info_set_edit_name:
17137  * @info: a #GFileInfo.
17138  * @edit_name: a string containing an edit name.
17139  *
17140  * Sets the edit name for the current file.
17141  * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
17142  */
17143
17144
17145 /**
17146  * g_file_info_set_file_type:
17147  * @info: a #GFileInfo.
17148  * @type: a #GFileType.
17149  *
17150  * Sets the file type in a #GFileInfo to @type.
17151  * See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
17152  */
17153
17154
17155 /**
17156  * g_file_info_set_icon:
17157  * @info: a #GFileInfo.
17158  * @icon: a #GIcon.
17159  *
17160  * Sets the icon for a given #GFileInfo.
17161  * See %G_FILE_ATTRIBUTE_STANDARD_ICON.
17162  */
17163
17164
17165 /**
17166  * g_file_info_set_is_hidden:
17167  * @info: a #GFileInfo.
17168  * @is_hidden: a #gboolean.
17169  *
17170  * Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
17171  * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
17172  */
17173
17174
17175 /**
17176  * g_file_info_set_is_symlink:
17177  * @info: a #GFileInfo.
17178  * @is_symlink: a #gboolean.
17179  *
17180  * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
17181  * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
17182  */
17183
17184
17185 /**
17186  * g_file_info_set_modification_time:
17187  * @info: a #GFileInfo.
17188  * @mtime: a #GTimeVal.
17189  *
17190  * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
17191  * info to the given time value.
17192  */
17193
17194
17195 /**
17196  * g_file_info_set_name:
17197  * @info: a #GFileInfo.
17198  * @name: a string containing a name.
17199  *
17200  * Sets the name attribute for the current #GFileInfo.
17201  * See %G_FILE_ATTRIBUTE_STANDARD_NAME.
17202  */
17203
17204
17205 /**
17206  * g_file_info_set_size:
17207  * @info: a #GFileInfo.
17208  * @size: a #goffset containing the file's size.
17209  *
17210  * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
17211  * to the given size.
17212  */
17213
17214
17215 /**
17216  * g_file_info_set_sort_order:
17217  * @info: a #GFileInfo.
17218  * @sort_order: a sort order integer.
17219  *
17220  * Sets the sort order attribute in the file info structure. See
17221  * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
17222  */
17223
17224
17225 /**
17226  * g_file_info_set_symlink_target:
17227  * @info: a #GFileInfo.
17228  * @symlink_target: a static string containing a path to a symlink target.
17229  *
17230  * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
17231  * to the given symlink target.
17232  */
17233
17234
17235 /**
17236  * g_file_info_unset_attribute_mask:
17237  * @info: #GFileInfo.
17238  *
17239  * Unsets a mask set by g_file_info_set_attribute_mask(), if one
17240  * is set.
17241  */
17242
17243
17244 /**
17245  * g_file_input_stream_query_info:
17246  * @stream: a #GFileInputStream.
17247  * @attributes: a file attribute query string.
17248  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17249  * @error: a #GError location to store the error occurring, or %NULL to ignore.
17250  *
17251  * Queries a file input stream the given @attributes. This function blocks
17252  * while querying the stream. For the asynchronous (non-blocking) version
17253  * of this function, see g_file_input_stream_query_info_async(). While the
17254  * stream is blocked, the stream will set the pending flag internally, and
17255  * any other operations on the stream will fail with %G_IO_ERROR_PENDING.
17256  *
17257  * Returns: (transfer full): a #GFileInfo, or %NULL on error.
17258  */
17259
17260
17261 /**
17262  * g_file_input_stream_query_info_async:
17263  * @stream: a #GFileInputStream.
17264  * @attributes: a file attribute query string.
17265  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17266  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17267  * @callback: (scope async): callback to call when the request is satisfied
17268  * @user_data: (closure): the data to pass to callback function
17269  *
17270  * Queries the stream information asynchronously.
17271  * When the operation is finished @callback will be called.
17272  * You can then call g_file_input_stream_query_info_finish()
17273  * to get the result of the operation.
17274  *
17275  * For the synchronous version of this function,
17276  * see g_file_input_stream_query_info().
17277  *
17278  * If @cancellable is not %NULL, then the operation can be cancelled by
17279  * triggering the cancellable object from another thread. If the operation
17280  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set
17281  */
17282
17283
17284 /**
17285  * g_file_input_stream_query_info_finish:
17286  * @stream: a #GFileInputStream.
17287  * @result: a #GAsyncResult.
17288  * @error: a #GError location to store the error occurring, or %NULL to ignore.
17289  *
17290  * Finishes an asynchronous info query operation.
17291  *
17292  * Returns: (transfer full): #GFileInfo.
17293  */
17294
17295
17296 /**
17297  * g_file_io_stream_get_etag:
17298  * @stream: a #GFileIOStream.
17299  *
17300  * Gets the entity tag for the file when it has been written.
17301  * This must be called after the stream has been written
17302  * and closed, as the etag can change while writing.
17303  *
17304  * Returns: the entity tag for the stream.
17305  * Since: 2.22
17306  */
17307
17308
17309 /**
17310  * g_file_io_stream_query_info:
17311  * @stream: a #GFileIOStream.
17312  * @attributes: a file attribute query string.
17313  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17314  * @error: a #GError, %NULL to ignore.
17315  *
17316  * Queries a file io stream for the given @attributes.
17317  * This function blocks while querying the stream. For the asynchronous
17318  * version of this function, see g_file_io_stream_query_info_async().
17319  * While the stream is blocked, the stream will set the pending flag
17320  * internally, and any other operations on the stream will fail with
17321  * %G_IO_ERROR_PENDING.
17322  *
17323  * Can fail if the stream was already closed (with @error being set to
17324  * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
17325  * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
17326  * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
17327  * all cases of failure, %NULL will be returned.
17328  *
17329  * If @cancellable is not %NULL, then the operation can be cancelled by
17330  * triggering the cancellable object from another thread. If the operation
17331  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
17332  * be returned.
17333  *
17334  * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
17335  * Since: 2.22
17336  */
17337
17338
17339 /**
17340  * g_file_io_stream_query_info_async:
17341  * @stream: a #GFileIOStream.
17342  * @attributes: a file attribute query string.
17343  * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
17344  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17345  * @callback: (scope async): callback to call when the request is satisfied
17346  * @user_data: (closure): the data to pass to callback function
17347  *
17348  * Asynchronously queries the @stream for a #GFileInfo. When completed,
17349  * @callback will be called with a #GAsyncResult which can be used to
17350  * finish the operation with g_file_io_stream_query_info_finish().
17351  *
17352  * For the synchronous version of this function, see
17353  * g_file_io_stream_query_info().
17354  *
17355  * Since: 2.22
17356  */
17357
17358
17359 /**
17360  * g_file_io_stream_query_info_finish:
17361  * @stream: a #GFileIOStream.
17362  * @result: a #GAsyncResult.
17363  * @error: a #GError, %NULL to ignore.
17364  *
17365  * Finalizes the asynchronous query started
17366  * by g_file_io_stream_query_info_async().
17367  *
17368  * Returns: (transfer full): A #GFileInfo for the finished query.
17369  * Since: 2.22
17370  */
17371
17372
17373 /**
17374  * g_file_is_native:
17375  * @file: input #GFile.
17376  *
17377  * Checks to see if a file is native to the platform.
17378  *
17379  * A native file s one expressed in the platform-native filename format,
17380  * e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
17381  * as it might be on a locally mounted remote filesystem.
17382  *
17383  * On some systems non-native files may be available using
17384  * the native filesystem via a userspace filesystem (FUSE), in
17385  * these cases this call will return %FALSE, but g_file_get_path()
17386  * will still return a native path.
17387  *
17388  * This call does no blocking i/o.
17389  *
17390  * Returns: %TRUE if file is native.
17391  */
17392
17393
17394 /**
17395  * g_file_load_contents:
17396  * @file: input #GFile.
17397  * @cancellable: optional #GCancellable object, %NULL to ignore.
17398  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file.
17399  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
17400  * @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
17401  * @error: a #GError, or %NULL
17402  *
17403  * Loads the content of the file into memory. The data is always
17404  * zero-terminated, but this is not included in the resultant @length.
17405  * The returned @content should be freed with g_free() when no longer
17406  * needed.
17407  *
17408  * If @cancellable is not %NULL, then the operation can be cancelled by
17409  * triggering the cancellable object from another thread. If the operation
17410  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17411  *
17412  * Returns: %TRUE if the @file's contents were successfully loaded. %FALSE if there were errors.
17413  */
17414
17415
17416 /**
17417  * g_file_load_contents_async:
17418  * @file: input #GFile.
17419  * @cancellable: optional #GCancellable object, %NULL to ignore.
17420  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17421  * @user_data: the data to pass to callback function
17422  *
17423  * Starts an asynchronous load of the @file's contents.
17424  *
17425  * For more details, see g_file_load_contents() which is
17426  * the synchronous version of this call.
17427  *
17428  * When the load operation has completed, @callback will be called
17429  * with @user data. To finish the operation, call
17430  * g_file_load_contents_finish() with the #GAsyncResult returned by
17431  * the @callback.
17432  *
17433  * If @cancellable is not %NULL, then the operation can be cancelled by
17434  * triggering the cancellable object from another thread. If the operation
17435  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17436  */
17437
17438
17439 /**
17440  * g_file_load_contents_finish:
17441  * @file: input #GFile.
17442  * @res: a #GAsyncResult.
17443  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file.
17444  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
17445  * @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
17446  * @error: a #GError, or %NULL
17447  *
17448  * Finishes an asynchronous load of the @file's contents.
17449  * The contents are placed in @contents, and @length is set to the
17450  * size of the @contents string. The @content should be freed with
17451  * g_free() when no longer needed. If @etag_out is present, it will be
17452  * set to the new entity tag for the @file.
17453  *
17454  * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
17455  */
17456
17457
17458 /**
17459  * g_file_load_partial_contents_async: (skip)
17460  * @file: input #GFile.
17461  * @cancellable: optional #GCancellable object, %NULL to ignore.
17462  * @read_more_callback: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read.
17463  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
17464  * @user_data: the data to pass to the callback functions.
17465  *
17466  * Reads the partial contents of a file. A #GFileReadMoreCallback should be
17467  * used to stop reading from the file when appropriate, else this function
17468  * will behave exactly as g_file_load_contents_async(). This operation
17469  * can be finished by g_file_load_partial_contents_finish().
17470  *
17471  * Users of this function should be aware that @user_data is passed to
17472  * both the @read_more_callback and the @callback.
17473  *
17474  * If @cancellable is not %NULL, then the operation can be cancelled by
17475  * triggering the cancellable object from another thread. If the operation
17476  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17477  */
17478
17479
17480 /**
17481  * g_file_load_partial_contents_finish:
17482  * @file: input #GFile.
17483  * @res: a #GAsyncResult.
17484  * @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file.
17485  * @length: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
17486  * @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
17487  * @error: a #GError, or %NULL
17488  *
17489  * Finishes an asynchronous partial load operation that was started
17490  * with g_file_load_partial_contents_async(). The data is always
17491  * zero-terminated, but this is not included in the resultant @length.
17492  * The returned @content should be freed with g_free() when no longer
17493  * needed.
17494  *
17495  * Returns: %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately.
17496  */
17497
17498
17499 /**
17500  * g_file_make_directory:
17501  * @file: input #GFile.
17502  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17503  * @error: a #GError, or %NULL
17504  *
17505  * Creates a directory. Note that this will only create a child directory of
17506  * the immediate parent directory of the path or URI given by the #GFile. To
17507  * recursively create directories, see g_file_make_directory_with_parents().
17508  * This function will fail if the parent directory does not exist, setting
17509  * @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support creating
17510  * directories, this function will fail, setting @error to
17511  * %G_IO_ERROR_NOT_SUPPORTED.
17512  *
17513  * For a local #GFile the newly created directory will have the default
17514  * (current) ownership and permissions of the current process.
17515  *
17516  * If @cancellable is not %NULL, then the operation can be cancelled by
17517  * triggering the cancellable object from another thread. If the operation
17518  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17519  *
17520  * Returns: %TRUE on successful creation, %FALSE otherwise.
17521  */
17522
17523
17524 /**
17525  * g_file_make_directory_with_parents:
17526  * @file: input #GFile.
17527  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17528  * @error: a #GError, or %NULL
17529  *
17530  * Creates a directory and any parent directories that may not exist similar to
17531  * 'mkdir -p'. If the file system does not support creating directories, this
17532  * function will fail, setting @error to %G_IO_ERROR_NOT_SUPPORTED. If the
17533  * directory itself already exists, this function will fail setting @error
17534  * to %G_IO_ERROR_EXISTS, unlike the similar g_mkdir_with_parents().
17535  *
17536  * For a local #GFile the newly created directories will have the default
17537  * (current) ownership and permissions of the current process.
17538  *
17539  * If @cancellable is not %NULL, then the operation can be cancelled by
17540  * triggering the cancellable object from another thread. If the operation
17541  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17542  *
17543  * Returns: %TRUE if all directories have been successfully created, %FALSE otherwise.
17544  * Since: 2.18
17545  */
17546
17547
17548 /**
17549  * g_file_make_symbolic_link:
17550  * @file: a #GFile with the name of the symlink to create
17551  * @symlink_value: a string with the path for the target of the new symlink
17552  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17553  * @error: a #GError.
17554  *
17555  * Creates a symbolic link named @file which contains the string
17556  * @symlink_value.
17557  *
17558  * If @cancellable is not %NULL, then the operation can be cancelled by
17559  * triggering the cancellable object from another thread. If the operation
17560  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17561  *
17562  * Returns: %TRUE on the creation of a new symlink, %FALSE otherwise.
17563  */
17564
17565
17566 /**
17567  * g_file_monitor:
17568  * @file: input #GFile
17569  * @flags: a set of #GFileMonitorFlags
17570  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
17571  * @error: a #GError, or %NULL
17572  *
17573  * Obtains a file or directory monitor for the given file, depending
17574  * on the type of the file.
17575  *
17576  * If @cancellable is not %NULL, then the operation can be cancelled by
17577  * triggering the cancellable object from another thread. If the operation
17578  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17579  *
17580  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
17581  * Since: 2.18
17582  */
17583
17584
17585 /**
17586  * g_file_monitor_cancel:
17587  * @monitor: a #GFileMonitor.
17588  *
17589  * Cancels a file monitor.
17590  *
17591  * Returns: %TRUE if monitor was cancelled.
17592  */
17593
17594
17595 /**
17596  * g_file_monitor_directory:
17597  * @file: input #GFile.
17598  * @flags: a set of #GFileMonitorFlags.
17599  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17600  * @error: a #GError, or %NULL.
17601  *
17602  * Obtains a directory monitor for the given file.
17603  * This may fail if directory monitoring is not supported.
17604  *
17605  * If @cancellable is not %NULL, then the operation can be cancelled by
17606  * triggering the cancellable object from another thread. If the operation
17607  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17608  *
17609  * Virtual: monitor_dir
17610  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
17611  */
17612
17613
17614 /**
17615  * g_file_monitor_emit_event:
17616  * @monitor: a #GFileMonitor.
17617  * @child: a #GFile.
17618  * @other_file: a #GFile.
17619  * @event_type: a set of #GFileMonitorEvent flags.
17620  *
17621  * Emits the #GFileMonitor::changed signal if a change
17622  * has taken place. Should be called from file monitor
17623  * implementations only.
17624  *
17625  * The signal will be emitted from an idle handler (in the <link
17626  * linkend="g-main-context-push-thread-default">thread-default main
17627  * context</link>).
17628  */
17629
17630
17631 /**
17632  * g_file_monitor_file:
17633  * @file: input #GFile.
17634  * @flags: a set of #GFileMonitorFlags.
17635  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17636  * @error: a #GError, or %NULL.
17637  *
17638  * Obtains a file monitor for the given file. If no file notification
17639  * mechanism exists, then regular polling of the file is used.
17640  *
17641  * If @cancellable is not %NULL, then the operation can be cancelled by
17642  * triggering the cancellable object from another thread. If the operation
17643  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17644  *
17645  * Returns: (transfer full): a #GFileMonitor for the given @file, or %NULL on error. Free the returned object with g_object_unref().
17646  */
17647
17648
17649 /**
17650  * g_file_monitor_is_cancelled:
17651  * @monitor: a #GFileMonitor
17652  *
17653  * Returns whether the monitor is canceled.
17654  *
17655  * Returns: %TRUE if monitor is canceled. %FALSE otherwise.
17656  */
17657
17658
17659 /**
17660  * g_file_monitor_set_rate_limit:
17661  * @monitor: a #GFileMonitor.
17662  * @limit_msecs: a non-negative integer with the limit in milliseconds to poll for changes
17663  *
17664  * Sets the rate limit to which the @monitor will report
17665  * consecutive change events to the same file.
17666  */
17667
17668
17669 /**
17670  * g_file_mount_enclosing_volume:
17671  * @location: input #GFile.
17672  * @flags: flags affecting the operation
17673  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
17674  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17675  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
17676  * @user_data: the data to pass to callback function
17677  *
17678  * Starts a @mount_operation, mounting the volume that contains the file @location.
17679  *
17680  * When this operation has completed, @callback will be called with
17681  * @user_user data, and the operation can be finalized with
17682  * g_file_mount_enclosing_volume_finish().
17683  *
17684  * If @cancellable is not %NULL, then the operation can be cancelled by
17685  * triggering the cancellable object from another thread. If the operation
17686  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17687  */
17688
17689
17690 /**
17691  * g_file_mount_enclosing_volume_finish:
17692  * @location: input #GFile.
17693  * @result: a #GAsyncResult.
17694  * @error: a #GError, or %NULL
17695  *
17696  * Finishes a mount operation started by g_file_mount_enclosing_volume().
17697  *
17698  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
17699  */
17700
17701
17702 /**
17703  * g_file_mount_mountable:
17704  * @file: input #GFile.
17705  * @flags: flags affecting the operation
17706  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
17707  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17708  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
17709  * @user_data: (closure): the data to pass to callback function
17710  *
17711  * Mounts a file of type G_FILE_TYPE_MOUNTABLE.
17712  * Using @mount_operation, you can request callbacks when, for instance,
17713  * passwords are needed during authentication.
17714  *
17715  * If @cancellable is not %NULL, then the operation can be cancelled by
17716  * triggering the cancellable object from another thread. If the operation
17717  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17718  *
17719  * When the operation is finished, @callback will be called. You can then call
17720  * g_file_mount_mountable_finish() to get the result of the operation.
17721  */
17722
17723
17724 /**
17725  * g_file_mount_mountable_finish:
17726  * @file: input #GFile.
17727  * @result: a #GAsyncResult.
17728  * @error: a #GError, or %NULL
17729  *
17730  * Finishes a mount operation. See g_file_mount_mountable() for details.
17731  *
17732  * Finish an asynchronous mount operation that was started
17733  * with g_file_mount_mountable().
17734  *
17735  * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
17736  */
17737
17738
17739 /**
17740  * g_file_move:
17741  * @source: #GFile pointing to the source location.
17742  * @destination: #GFile pointing to the destination location.
17743  * @flags: set of #GFileCopyFlags.
17744  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17745  * @progress_callback: (allow-none) (scope call): #GFileProgressCallback function for updates.
17746  * @progress_callback_data: (closure): gpointer to user data for the callback function.
17747  * @error: #GError for returning error conditions, or %NULL
17748  *
17749  * Tries to move the file or directory @source to the location specified by @destination.
17750  * If native move operations are supported then this is used, otherwise a copy + delete
17751  * fallback is used. The native implementation may support moving directories (for instance
17752  * on moves inside the same filesystem), but the fallback code does not.
17753  *
17754  * If the flag #G_FILE_COPY_OVERWRITE is specified an already
17755  * existing @destination file is overwritten.
17756  *
17757  * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
17758  * will be copied as symlinks, otherwise the target of the
17759  * @source symlink will be copied.
17760  *
17761  * If @cancellable is not %NULL, then the operation can be cancelled by
17762  * triggering the cancellable object from another thread. If the operation
17763  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17764  *
17765  * If @progress_callback is not %NULL, then the operation can be monitored by
17766  * setting this to a #GFileProgressCallback function. @progress_callback_data
17767  * will be passed to this function. It is guaranteed that this callback will
17768  * be called after all data has been transferred with the total number of bytes
17769  * copied during the operation.
17770  *
17771  * If the @source file does not exist then the G_IO_ERROR_NOT_FOUND
17772  * error is returned, independent on the status of the @destination.
17773  *
17774  * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then the
17775  * error G_IO_ERROR_EXISTS is returned.
17776  *
17777  * If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY
17778  * error is returned. If trying to overwrite a directory with a directory the
17779  * G_IO_ERROR_WOULD_MERGE error is returned.
17780  *
17781  * If the source is a directory and the target does not exist, or #G_FILE_COPY_OVERWRITE is
17782  * specified and the target is a file, then the G_IO_ERROR_WOULD_RECURSE error
17783  * may be returned (if the native move operation isn't available).
17784  *
17785  * Returns: %TRUE on successful move, %FALSE otherwise.
17786  */
17787
17788
17789 /**
17790  * g_file_new_for_commandline_arg:
17791  * @arg: a command line string.
17792  *
17793  * Creates a #GFile with the given argument from the command line. The value of
17794  * @arg can be either a URI, an absolute path or a relative path resolved
17795  * relative to the current working directory.
17796  * This operation never fails, but the returned object might not support any
17797  * I/O operation if @arg points to a malformed path.
17798  *
17799  * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
17800  */
17801
17802
17803 /**
17804  * g_file_new_for_path:
17805  * @path: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
17806  *
17807  * Constructs a #GFile for a given path. This operation never
17808  * fails, but the returned object might not support any I/O
17809  * operation if @path is malformed.
17810  *
17811  * Returns: (transfer full): a new #GFile for the given @path. Free the returned object with g_object_unref().
17812  */
17813
17814
17815 /**
17816  * g_file_new_for_uri:
17817  * @uri: a UTF8 string containing a URI.
17818  *
17819  * Constructs a #GFile for a given URI. This operation never
17820  * fails, but the returned object might not support any I/O
17821  * operation if @uri is malformed or if the uri type is
17822  * not supported.
17823  *
17824  * Returns: (transfer full): a new #GFile for the given @uri. Free the returned object with g_object_unref().
17825  */
17826
17827
17828 /**
17829  * g_file_new_tmp:
17830  * @tmpl: (type filename) (allow-none): Template for the file name, as in g_file_open_tmp(), or %NULL for a default template.
17831  * @iostream: (out): on return, a #GFileIOStream for the created file.
17832  * @error: a #GError, or %NULL
17833  *
17834  * Opens a file in the preferred directory for temporary files (as
17835  * returned by g_get_tmp_dir()) and returns a #GFile and
17836  * #GFileIOStream pointing to it.
17837  *
17838  * @tmpl should be a string in the GLib file name encoding
17839  * containing a sequence of six 'X' characters, and containing no
17840  * directory components. If it is %NULL, a default template is used.
17841  *
17842  * Unlike the other #GFile constructors, this will return %NULL if
17843  * a temporary file could not be created.
17844  *
17845  * Returns: (transfer full): a new #GFile. Free the returned object with g_object_unref().
17846  * Since: 2.32
17847  */
17848
17849
17850 /**
17851  * g_file_open_readwrite:
17852  * @file: #GFile to open
17853  * @cancellable: (allow-none): a #GCancellable
17854  * @error: a #GError, or %NULL
17855  *
17856  * Opens an existing file for reading and writing. The result is
17857  * a #GFileIOStream that can be used to read and write the contents of the file.
17858  *
17859  * If @cancellable is not %NULL, then the operation can be cancelled by
17860  * triggering the cancellable object from another thread. If the operation
17861  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
17862  *
17863  * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
17864  * If the file is a directory, the G_IO_ERROR_IS_DIRECTORY error will be returned.
17865  * Other errors are possible too, and depend on what kind of filesystem the file is on.
17866  * Note that in many non-local file cases read and write streams are not supported,
17867  * so make sure you really need to do read and write streaming, rather than
17868  * just opening for reading or writing.
17869  *
17870  * Returns: (transfer full): #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
17871  * Since: 2.22
17872  */
17873
17874
17875 /**
17876  * g_file_open_readwrite_async:
17877  * @file: input #GFile.
17878  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
17879  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
17880  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
17881  * @user_data: (closure): the data to pass to callback function
17882  *
17883  * Asynchronously opens @file for reading and writing.
17884  *
17885  * For more details, see g_file_open_readwrite() which is
17886  * the synchronous version of this call.
17887  *
17888  * When the operation is finished, @callback will be called. You can then call
17889  * g_file_open_readwrite_finish() to get the result of the operation.
17890  *
17891  * Since: 2.22
17892  */
17893
17894
17895 /**
17896  * g_file_open_readwrite_finish:
17897  * @file: input #GFile.
17898  * @res: a #GAsyncResult.
17899  * @error: a #GError, or %NULL
17900  *
17901  * Finishes an asynchronous file read operation started with
17902  * g_file_open_readwrite_async().
17903  *
17904  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
17905  * Since: 2.22
17906  */
17907
17908
17909 /**
17910  * g_file_output_stream_get_etag:
17911  * @stream: a #GFileOutputStream.
17912  *
17913  * Gets the entity tag for the file when it has been written.
17914  * This must be called after the stream has been written
17915  * and closed, as the etag can change while writing.
17916  *
17917  * Returns: the entity tag for the stream.
17918  */
17919
17920
17921 /**
17922  * g_file_output_stream_query_info:
17923  * @stream: a #GFileOutputStream.
17924  * @attributes: a file attribute query string.
17925  * @cancellable: optional #GCancellable object, %NULL to ignore.
17926  * @error: a #GError, %NULL to ignore.
17927  *
17928  * Queries a file output stream for the given @attributes.
17929  * This function blocks while querying the stream. For the asynchronous
17930  * version of this function, see g_file_output_stream_query_info_async().
17931  * While the stream is blocked, the stream will set the pending flag
17932  * internally, and any other operations on the stream will fail with
17933  * %G_IO_ERROR_PENDING.
17934  *
17935  * Can fail if the stream was already closed (with @error being set to
17936  * %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
17937  * set to %G_IO_ERROR_PENDING), or if querying info is not supported for
17938  * the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
17939  * all cases of failure, %NULL will be returned.
17940  *
17941  * If @cancellable is not %NULL, then the operation can be cancelled by
17942  * triggering the cancellable object from another thread. If the operation
17943  * was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
17944  * be returned.
17945  *
17946  * Returns: (transfer full): a #GFileInfo for the @stream, or %NULL on error.
17947  */
17948
17949
17950 /**
17951  * g_file_output_stream_query_info_async:
17952  * @stream: a #GFileOutputStream.
17953  * @attributes: a file attribute query string.
17954  * @io_priority: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
17955  * @cancellable: optional #GCancellable object, %NULL to ignore.
17956  * @callback: callback to call when the request is satisfied
17957  * @user_data: the data to pass to callback function
17958  *
17959  * Asynchronously queries the @stream for a #GFileInfo. When completed,
17960  * @callback will be called with a #GAsyncResult which can be used to
17961  * finish the operation with g_file_output_stream_query_info_finish().
17962  *
17963  * For the synchronous version of this function, see
17964  * g_file_output_stream_query_info().
17965  */
17966
17967
17968 /**
17969  * g_file_output_stream_query_info_finish:
17970  * @stream: a #GFileOutputStream.
17971  * @result: a #GAsyncResult.
17972  * @error: a #GError, %NULL to ignore.
17973  *
17974  * Finalizes the asynchronous query started
17975  * by g_file_output_stream_query_info_async().
17976  *
17977  * Returns: (transfer full): A #GFileInfo for the finished query.
17978  */
17979
17980
17981 /**
17982  * g_file_parse_name:
17983  * @parse_name: a file name or path to be parsed.
17984  *
17985  * Constructs a #GFile with the given @parse_name (i.e. something given by g_file_get_parse_name()).
17986  * This operation never fails, but the returned object might not support any I/O
17987  * operation if the @parse_name cannot be parsed.
17988  *
17989  * Returns: (transfer full): a new #GFile.
17990  */
17991
17992
17993 /**
17994  * g_file_poll_mountable:
17995  * @file: input #GFile.
17996  * @cancellable: optional #GCancellable object, %NULL to ignore.
17997  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
17998  * @user_data: the data to pass to callback function
17999  *
18000  * Polls a file of type G_FILE_TYPE_MOUNTABLE.
18001  *
18002  * If @cancellable is not %NULL, then the operation can be cancelled by
18003  * triggering the cancellable object from another thread. If the operation
18004  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18005  *
18006  * When the operation is finished, @callback will be called. You can then call
18007  * g_file_mount_mountable_finish() to get the result of the operation.
18008  *
18009  * Since: 2.22
18010  */
18011
18012
18013 /**
18014  * g_file_poll_mountable_finish:
18015  * @file: input #GFile.
18016  * @result: a #GAsyncResult.
18017  * @error: a #GError, or %NULL
18018  *
18019  * Finishes a poll operation. See g_file_poll_mountable() for details.
18020  *
18021  * Finish an asynchronous poll operation that was polled
18022  * with g_file_poll_mountable().
18023  *
18024  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
18025  * Since: 2.22
18026  */
18027
18028
18029 /**
18030  * g_file_query_default_handler:
18031  * @file: a #GFile to open.
18032  * @cancellable: optional #GCancellable object, %NULL to ignore.
18033  * @error: a #GError, or %NULL
18034  *
18035  * Returns the #GAppInfo that is registered as the default
18036  * application to handle the file specified by @file.
18037  *
18038  * If @cancellable is not %NULL, then the operation can be cancelled by
18039  * triggering the cancellable object from another thread. If the operation
18040  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18041  *
18042  * 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()
18043  */
18044
18045
18046 /**
18047  * g_file_query_exists:
18048  * @file: input #GFile.
18049  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18050  *
18051  * Utility function to check if a particular file exists. This is
18052  * implemented using g_file_query_info() and as such does blocking I/O.
18053  *
18054  * Note that in many cases it is racy to first check for file existence
18055  * and then execute something based on the outcome of that, because the
18056  * file might have been created or removed in between the operations. The
18057  * general approach to handling that is to not check, but just do the
18058  * operation and handle the errors as they come.
18059  *
18060  * As an example of race-free checking, take the case of reading a file, and
18061  * if it doesn't exist, creating it. There are two racy versions: read it, and
18062  * on error create it; and: check if it exists, if not create it. These
18063  * can both result in two processes creating the file (with perhaps a partially
18064  * written file as the result). The correct approach is to always try to create
18065  * the file with g_file_create() which will either atomically create the file
18066  * or fail with a G_IO_ERROR_EXISTS error.
18067  *
18068  * However, in many cases an existence check is useful in a user
18069  * interface, for instance to make a menu item sensitive/insensitive, so that
18070  * you don't have to fool users that something is possible and then just show
18071  * and error dialog. If you do this, you should make sure to also handle the
18072  * errors that can happen due to races when you execute the operation.
18073  *
18074  * Returns: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
18075  */
18076
18077
18078 /**
18079  * g_file_query_file_type:
18080  * @file: input #GFile.
18081  * @flags: a set of #GFileQueryInfoFlags passed to g_file_query_info().
18082  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18083  *
18084  * Utility function to inspect the #GFileType of a file. This is
18085  * implemented using g_file_query_info() and as such does blocking I/O.
18086  *
18087  * The primary use case of this method is to check if a file is a regular file,
18088  * directory, or symlink.
18089  *
18090  * Returns: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file does not exist
18091  * Since: 2.18
18092  */
18093
18094
18095 /**
18096  * g_file_query_filesystem_info:
18097  * @file: input #GFile.
18098  * @attributes: an attribute query string.
18099  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18100  * @error: a #GError.
18101  *
18102  * Similar to g_file_query_info(), but obtains information
18103  * about the filesystem the @file is on, rather than the file itself.
18104  * For instance the amount of space available and the type of
18105  * the filesystem.
18106  *
18107  * The @attributes value is a string that specifies the file attributes that
18108  * should be gathered. It is not an error if it's not possible to read a particular
18109  * requested attribute from a file - it just won't be set. @attributes should
18110  * be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
18111  * means all attributes, and a wildcard like "filesystem::*" means all attributes in the
18112  * filesystem namespace. The standard namespace for filesystem attributes is "filesystem".
18113  * Common attributes of interest are #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE
18114  * (the total size of the filesystem in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of
18115  * bytes available), and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
18116  *
18117  * If @cancellable is not %NULL, then the operation can be cancelled by
18118  * triggering the cancellable object from another thread. If the operation
18119  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18120  *
18121  * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
18122  * Other errors are possible too, and depend on what kind of filesystem the file is on.
18123  *
18124  * Returns: (transfer full): a #GFileInfo or %NULL if there was an error. Free the returned object with g_object_unref().
18125  */
18126
18127
18128 /**
18129  * g_file_query_filesystem_info_async:
18130  * @file: input #GFile.
18131  * @attributes: an attribute query string.
18132  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18133  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18134  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18135  * @user_data: (closure): the data to pass to callback function
18136  *
18137  * Asynchronously gets the requested information about the filesystem
18138  * that the specified @file is on. The result is a #GFileInfo object
18139  * that contains key-value attributes (such as type or size for the
18140  * file).
18141  *
18142  * For more details, see g_file_query_filesystem_info() which is the
18143  * synchronous version of this call.
18144  *
18145  * When the operation is finished, @callback will be called. You can
18146  * then call g_file_query_info_finish() to get the result of the
18147  * operation.
18148  */
18149
18150
18151 /**
18152  * g_file_query_filesystem_info_finish:
18153  * @file: input #GFile.
18154  * @res: a #GAsyncResult.
18155  * @error: a #GError.
18156  *
18157  * Finishes an asynchronous filesystem info query.  See
18158  * g_file_query_filesystem_info_async().
18159  *
18160  * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
18161  */
18162
18163
18164 /**
18165  * g_file_query_info:
18166  * @file: input #GFile.
18167  * @attributes: an attribute query string.
18168  * @flags: a set of #GFileQueryInfoFlags.
18169  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18170  * @error: a #GError.
18171  *
18172  * Gets the requested information about specified @file. The result
18173  * is a #GFileInfo object that contains key-value attributes (such as
18174  * the type or size of the file).
18175  *
18176  * The @attributes value is a string that specifies the file attributes that
18177  * should be gathered. It is not an error if it's not possible to read a particular
18178  * requested attribute from a file - it just won't be set. @attributes should
18179  * be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
18180  * means all attributes, and a wildcard like "standard::*" means all attributes in the standard
18181  * namespace. An example attribute query be "standard::*,owner::user".
18182  * The standard attributes are available as defines, like #G_FILE_ATTRIBUTE_STANDARD_NAME.
18183  *
18184  * If @cancellable is not %NULL, then the operation can be cancelled by
18185  * triggering the cancellable object from another thread. If the operation
18186  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18187  *
18188  * For symlinks, normally the information about the target of the
18189  * symlink is returned, rather than information about the symlink itself.
18190  * However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS in @flags the
18191  * information about the symlink itself will be returned. Also, for symlinks
18192  * that point to non-existing files the information about the symlink itself
18193  * will be returned.
18194  *
18195  * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
18196  * Other errors are possible too, and depend on what kind of filesystem the file is on.
18197  *
18198  * Returns: (transfer full): a #GFileInfo for the given @file, or %NULL on error. Free the returned object with g_object_unref().
18199  */
18200
18201
18202 /**
18203  * g_file_query_info_async:
18204  * @file: input #GFile.
18205  * @attributes: an attribute query string.
18206  * @flags: a set of #GFileQueryInfoFlags.
18207  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18208  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18209  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18210  * @user_data: (closure): the data to pass to callback function
18211  *
18212  * Asynchronously gets the requested information about specified @file. The result
18213  * is a #GFileInfo object that contains key-value attributes (such as type or size
18214  * for the file).
18215  *
18216  * For more details, see g_file_query_info() which is
18217  * the synchronous version of this call.
18218  *
18219  * When the operation is finished, @callback will be called. You can then call
18220  * g_file_query_info_finish() to get the result of the operation.
18221  */
18222
18223
18224 /**
18225  * g_file_query_info_finish:
18226  * @file: input #GFile.
18227  * @res: a #GAsyncResult.
18228  * @error: a #GError.
18229  *
18230  * Finishes an asynchronous file info query.
18231  * See g_file_query_info_async().
18232  *
18233  * Returns: (transfer full): #GFileInfo for given @file or %NULL on error. Free the returned object with g_object_unref().
18234  */
18235
18236
18237 /**
18238  * g_file_query_settable_attributes:
18239  * @file: input #GFile.
18240  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18241  * @error: a #GError, or %NULL
18242  *
18243  * Obtain the list of settable attributes for the file.
18244  *
18245  * Returns the type and full attribute name of all the attributes
18246  * that can be set on this file. This doesn't mean setting it will always
18247  * succeed though, you might get an access failure, or some specific
18248  * file may not support a specific attribute.
18249  *
18250  * If @cancellable is not %NULL, then the operation can be cancelled by
18251  * triggering the cancellable object from another thread. If the operation
18252  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18253  *
18254  * Returns: a #GFileAttributeInfoList describing the settable attributes. When you are done with it, release it with g_file_attribute_info_list_unref()
18255  */
18256
18257
18258 /**
18259  * g_file_query_writable_namespaces:
18260  * @file: input #GFile.
18261  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18262  * @error: a #GError, or %NULL
18263  *
18264  * Obtain the list of attribute namespaces where new attributes
18265  * can be created by a user. An example of this is extended
18266  * attributes (in the "xattr" namespace).
18267  *
18268  * If @cancellable is not %NULL, then the operation can be cancelled by
18269  * triggering the cancellable object from another thread. If the operation
18270  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18271  *
18272  * Returns: a #GFileAttributeInfoList describing the writable namespaces. When you are done with it, release it with g_file_attribute_info_list_unref()
18273  */
18274
18275
18276 /**
18277  * g_file_read:
18278  * @file: #GFile to read.
18279  * @cancellable: (allow-none): a #GCancellable
18280  * @error: a #GError, or %NULL
18281  *
18282  * Opens a file for reading. The result is a #GFileInputStream that
18283  * can be used to read the contents of the file.
18284  *
18285  * If @cancellable is not %NULL, then the operation can be cancelled by
18286  * triggering the cancellable object from another thread. If the operation
18287  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18288  *
18289  * If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
18290  * If the file is a directory, the G_IO_ERROR_IS_DIRECTORY error will be returned.
18291  * Other errors are possible too, and depend on what kind of filesystem the file is on.
18292  *
18293  * Virtual: read_fn
18294  * Returns: (transfer full): #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
18295  */
18296
18297
18298 /**
18299  * g_file_read_async:
18300  * @file: input #GFile
18301  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18302  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18303  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18304  * @user_data: (closure): the data to pass to callback function
18305  *
18306  * Asynchronously opens @file for reading.
18307  *
18308  * For more details, see g_file_read() which is
18309  * the synchronous version of this call.
18310  *
18311  * When the operation is finished, @callback will be called. You can then call
18312  * g_file_read_finish() to get the result of the operation.
18313  */
18314
18315
18316 /**
18317  * g_file_read_finish:
18318  * @file: input #GFile.
18319  * @res: a #GAsyncResult.
18320  * @error: a #GError, or %NULL
18321  *
18322  * Finishes an asynchronous file read operation started with
18323  * g_file_read_async().
18324  *
18325  * Returns: (transfer full): a #GFileInputStream or %NULL on error. Free the returned object with g_object_unref().
18326  */
18327
18328
18329 /**
18330  * g_file_replace:
18331  * @file: input #GFile.
18332  * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore.
18333  * @make_backup: %TRUE if a backup should be created.
18334  * @flags: a set of #GFileCreateFlags.
18335  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18336  * @error: a #GError, or %NULL
18337  *
18338  * Returns an output stream for overwriting the file, possibly
18339  * creating a backup copy of the file first. If the file doesn't exist,
18340  * it will be created.
18341  *
18342  * This will try to replace the file in the safest way possible so
18343  * that any errors during the writing will not affect an already
18344  * existing copy of the file. For instance, for local files it
18345  * may write to a temporary file and then atomically rename over
18346  * the destination when the stream is closed.
18347  *
18348  * By default files created are generally readable by everyone,
18349  * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
18350  * will be made readable only to the current user, to the level that
18351  * is supported on the target filesystem.
18352  *
18353  * If @cancellable is not %NULL, then the operation can be cancelled by
18354  * triggering the cancellable object from another thread. If the operation
18355  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18356  *
18357  * If you pass in a non-#NULL @etag value, then this value is
18358  * compared to the current entity tag of the file, and if they differ
18359  * an G_IO_ERROR_WRONG_ETAG error is returned. This generally means
18360  * that the file has been changed since you last read it. You can get
18361  * the new etag from g_file_output_stream_get_etag() after you've
18362  * finished writing and closed the #GFileOutputStream. When you load
18363  * a new file you can use g_file_input_stream_query_info() to get
18364  * the etag of the file.
18365  *
18366  * If @make_backup is %TRUE, this function will attempt to make a backup
18367  * of the current file before overwriting it. If this fails a G_IO_ERROR_CANT_CREATE_BACKUP
18368  * error will be returned. If you want to replace anyway, try again with
18369  * @make_backup set to %FALSE.
18370  *
18371  * If the file is a directory the G_IO_ERROR_IS_DIRECTORY error will be returned,
18372  * and if the file is some other form of non-regular file then a
18373  * G_IO_ERROR_NOT_REGULAR_FILE error will be returned.
18374  * Some file systems don't allow all file names, and may
18375  * return an G_IO_ERROR_INVALID_FILENAME error, and if the name
18376  * is to long G_IO_ERROR_FILENAME_TOO_LONG will be returned.
18377  * Other errors are possible too, and depend on what kind of
18378  * filesystem the file is on.
18379  *
18380  * Returns: (transfer full): a #GFileOutputStream or %NULL on error. Free the returned object with g_object_unref().
18381  */
18382
18383
18384 /**
18385  * g_file_replace_async:
18386  * @file: input #GFile.
18387  * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
18388  * @make_backup: %TRUE if a backup should be created.
18389  * @flags: a set of #GFileCreateFlags.
18390  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18391  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18392  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18393  * @user_data: (closure): the data to pass to callback function
18394  *
18395  * Asynchronously overwrites the file, replacing the contents, possibly
18396  * creating a backup copy of the file first.
18397  *
18398  * For more details, see g_file_replace() which is
18399  * the synchronous version of this call.
18400  *
18401  * When the operation is finished, @callback will be called. You can then call
18402  * g_file_replace_finish() to get the result of the operation.
18403  */
18404
18405
18406 /**
18407  * g_file_replace_contents:
18408  * @file: input #GFile.
18409  * @contents: (element-type guint8) (array length=length): a string containing the new contents for @file.
18410  * @length: the length of @contents in bytes.
18411  * @etag: (allow-none): the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
18412  * @make_backup: %TRUE if a backup should be created.
18413  * @flags: a set of #GFileCreateFlags.
18414  * @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
18415  * @cancellable: optional #GCancellable object, %NULL to ignore.
18416  * @error: a #GError, or %NULL
18417  *
18418  * Replaces the contents of @file with @contents of @length bytes.
18419  *
18420  * If @etag is specified (not %NULL) any existing file must have that etag, or
18421  * the error %G_IO_ERROR_WRONG_ETAG will be returned.
18422  *
18423  * If @make_backup is %TRUE, this function will attempt to make a backup of @file.
18424  *
18425  * If @cancellable is not %NULL, then the operation can be cancelled by
18426  * triggering the cancellable object from another thread. If the operation
18427  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18428  *
18429  * The returned @new_etag can be used to verify that the file hasn't changed the
18430  * next time it is saved over.
18431  *
18432  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
18433  */
18434
18435
18436 /**
18437  * g_file_replace_contents_async:
18438  * @file: input #GFile.
18439  * @contents: (element-type guint8) (array length=length): string of contents to replace the file with.
18440  * @length: the length of @contents in bytes.
18441  * @etag: (allow-none): a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
18442  * @make_backup: %TRUE if a backup should be created.
18443  * @flags: a set of #GFileCreateFlags.
18444  * @cancellable: optional #GCancellable object, %NULL to ignore.
18445  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
18446  * @user_data: the data to pass to callback function
18447  *
18448  * Starts an asynchronous replacement of @file with the given
18449  * @contents of @length bytes. @etag will replace the document's
18450  * current entity tag.
18451  *
18452  * When this operation has completed, @callback will be called with
18453  * @user_user data, and the operation can be finalized with
18454  * g_file_replace_contents_finish().
18455  *
18456  * If @cancellable is not %NULL, then the operation can be cancelled by
18457  * triggering the cancellable object from another thread. If the operation
18458  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18459  *
18460  * If @make_backup is %TRUE, this function will attempt to
18461  * make a backup of @file.
18462  */
18463
18464
18465 /**
18466  * g_file_replace_contents_finish:
18467  * @file: input #GFile.
18468  * @res: a #GAsyncResult.
18469  * @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
18470  * @error: a #GError, or %NULL
18471  *
18472  * Finishes an asynchronous replace of the given @file. See
18473  * g_file_replace_contents_async(). Sets @new_etag to the new entity
18474  * tag for the document, if present.
18475  *
18476  * Returns: %TRUE on success, %FALSE on failure.
18477  */
18478
18479
18480 /**
18481  * g_file_replace_finish:
18482  * @file: input #GFile.
18483  * @res: a #GAsyncResult.
18484  * @error: a #GError, or %NULL
18485  *
18486  * Finishes an asynchronous file replace operation started with
18487  * g_file_replace_async().
18488  *
18489  * Returns: (transfer full): a #GFileOutputStream, or %NULL on error. Free the returned object with g_object_unref().
18490  */
18491
18492
18493 /**
18494  * g_file_replace_readwrite:
18495  * @file: a #GFile
18496  * @etag: (allow-none): an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
18497  * @make_backup: %TRUE if a backup should be created
18498  * @flags: a set of #GFileCreateFlags
18499  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
18500  * @error: return location for a #GError, or %NULL
18501  *
18502  * Returns an output stream for overwriting the file in readwrite mode,
18503  * possibly creating a backup copy of the file first. If the file doesn't
18504  * exist, it will be created.
18505  *
18506  * For details about the behaviour, see g_file_replace() which does the same
18507  * thing but returns an output stream only.
18508  *
18509  * Note that in many non-local file cases read and write streams are not
18510  * supported, so make sure you really need to do read and write streaming,
18511  * rather than just opening for reading or writing.
18512  *
18513  * Returns: (transfer full): a #GFileIOStream or %NULL on error. Free the returned object with g_object_unref().
18514  * Since: 2.22
18515  */
18516
18517
18518 /**
18519  * g_file_replace_readwrite_async:
18520  * @file: input #GFile.
18521  * @etag: (allow-none): an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
18522  * @make_backup: %TRUE if a backup should be created.
18523  * @flags: a set of #GFileCreateFlags.
18524  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18525  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18526  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18527  * @user_data: (closure): the data to pass to callback function
18528  *
18529  * Asynchronously overwrites the file in read-write mode, replacing the
18530  * contents, possibly creating a backup copy of the file first.
18531  *
18532  * For more details, see g_file_replace_readwrite() which is
18533  * the synchronous version of this call.
18534  *
18535  * When the operation is finished, @callback will be called. You can then
18536  * call g_file_replace_readwrite_finish() to get the result of the operation.
18537  *
18538  * Since: 2.22
18539  */
18540
18541
18542 /**
18543  * g_file_replace_readwrite_finish:
18544  * @file: input #GFile.
18545  * @res: a #GAsyncResult.
18546  * @error: a #GError, or %NULL
18547  *
18548  * Finishes an asynchronous file replace operation started with
18549  * g_file_replace_readwrite_async().
18550  *
18551  * Returns: (transfer full): a #GFileIOStream, or %NULL on error. Free the returned object with g_object_unref().
18552  * Since: 2.22
18553  */
18554
18555
18556 /**
18557  * g_file_resolve_relative_path:
18558  * @file: input #GFile.
18559  * @relative_path: a given relative path string.
18560  *
18561  * Resolves a relative path for @file to an absolute path.
18562  *
18563  * This call does no blocking i/o.
18564  *
18565  * 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().
18566  */
18567
18568
18569 /**
18570  * g_file_set_attribute:
18571  * @file: input #GFile.
18572  * @attribute: a string containing the attribute's name.
18573  * @type: The type of the attribute
18574  * @value_p: (allow-none): a pointer to the value (or the pointer itself if the type is a pointer type)
18575  * @flags: a set of #GFileQueryInfoFlags.
18576  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18577  * @error: a #GError, or %NULL
18578  *
18579  * Sets an attribute in the file with attribute name @attribute to @value.
18580  *
18581  * Some attributes can be unset by setting @attribute to
18582  * %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
18583  *
18584  * If @cancellable is not %NULL, then the operation can be cancelled by
18585  * triggering the cancellable object from another thread. If the operation
18586  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18587  *
18588  * Returns: %TRUE if the attribute was set, %FALSE otherwise.
18589  */
18590
18591
18592 /**
18593  * g_file_set_attribute_byte_string:
18594  * @file: input #GFile.
18595  * @attribute: a string containing the attribute's name.
18596  * @value: a string containing the attribute's new value.
18597  * @flags: a #GFileQueryInfoFlags.
18598  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18599  * @error: a #GError, or %NULL
18600  *
18601  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
18602  * If @attribute is of a different type, this operation will fail,
18603  * returning %FALSE.
18604  *
18605  * If @cancellable is not %NULL, then the operation can be cancelled by
18606  * triggering the cancellable object from another thread. If the operation
18607  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18608  *
18609  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
18610  */
18611
18612
18613 /**
18614  * g_file_set_attribute_int32:
18615  * @file: input #GFile.
18616  * @attribute: a string containing the attribute's name.
18617  * @value: a #gint32 containing the attribute's new value.
18618  * @flags: a #GFileQueryInfoFlags.
18619  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18620  * @error: a #GError, or %NULL
18621  *
18622  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
18623  * If @attribute is of a different type, this operation will fail.
18624  *
18625  * If @cancellable is not %NULL, then the operation can be cancelled by
18626  * triggering the cancellable object from another thread. If the operation
18627  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18628  *
18629  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
18630  */
18631
18632
18633 /**
18634  * g_file_set_attribute_int64:
18635  * @file: input #GFile.
18636  * @attribute: a string containing the attribute's name.
18637  * @value: a #guint64 containing the attribute's new value.
18638  * @flags: a #GFileQueryInfoFlags.
18639  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18640  * @error: a #GError, or %NULL
18641  *
18642  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
18643  * If @attribute is of a different type, this operation will fail.
18644  *
18645  * If @cancellable is not %NULL, then the operation can be cancelled by
18646  * triggering the cancellable object from another thread. If the operation
18647  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18648  *
18649  * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
18650  */
18651
18652
18653 /**
18654  * g_file_set_attribute_string:
18655  * @file: input #GFile.
18656  * @attribute: a string containing the attribute's name.
18657  * @value: a string containing the attribute's value.
18658  * @flags: #GFileQueryInfoFlags.
18659  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18660  * @error: a #GError, or %NULL
18661  *
18662  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
18663  * If @attribute is of a different type, this operation will fail.
18664  *
18665  * If @cancellable is not %NULL, then the operation can be cancelled by
18666  * triggering the cancellable object from another thread. If the operation
18667  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18668  *
18669  * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
18670  */
18671
18672
18673 /**
18674  * g_file_set_attribute_uint32:
18675  * @file: input #GFile.
18676  * @attribute: a string containing the attribute's name.
18677  * @value: a #guint32 containing the attribute's new value.
18678  * @flags: a #GFileQueryInfoFlags.
18679  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18680  * @error: a #GError, or %NULL
18681  *
18682  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
18683  * If @attribute is of a different type, this operation will fail.
18684  *
18685  * If @cancellable is not %NULL, then the operation can be cancelled by
18686  * triggering the cancellable object from another thread. If the operation
18687  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18688  *
18689  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
18690  */
18691
18692
18693 /**
18694  * g_file_set_attribute_uint64:
18695  * @file: input #GFile.
18696  * @attribute: a string containing the attribute's name.
18697  * @value: a #guint64 containing the attribute's new value.
18698  * @flags: a #GFileQueryInfoFlags.
18699  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18700  * @error: a #GError, or %NULL
18701  *
18702  * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
18703  * If @attribute is of a different type, this operation will fail.
18704  *
18705  * If @cancellable is not %NULL, then the operation can be cancelled by
18706  * triggering the cancellable object from another thread. If the operation
18707  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18708  *
18709  * Returns: %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise.
18710  */
18711
18712
18713 /**
18714  * g_file_set_attributes_async:
18715  * @file: input #GFile.
18716  * @info: a #GFileInfo.
18717  * @flags: a #GFileQueryInfoFlags.
18718  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18719  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18720  * @callback: (scope async): a #GAsyncReadyCallback.
18721  * @user_data: (closure): a #gpointer.
18722  *
18723  * Asynchronously sets the attributes of @file with @info.
18724  *
18725  * For more details, see g_file_set_attributes_from_info() which is
18726  * the synchronous version of this call.
18727  *
18728  * When the operation is finished, @callback will be called. You can then call
18729  * g_file_set_attributes_finish() to get the result of the operation.
18730  */
18731
18732
18733 /**
18734  * g_file_set_attributes_finish:
18735  * @file: input #GFile.
18736  * @result: a #GAsyncResult.
18737  * @info: (out) (transfer full): a #GFileInfo.
18738  * @error: a #GError, or %NULL
18739  *
18740  * Finishes setting an attribute started in g_file_set_attributes_async().
18741  *
18742  * Returns: %TRUE if the attributes were set correctly, %FALSE otherwise.
18743  */
18744
18745
18746 /**
18747  * g_file_set_attributes_from_info:
18748  * @file: input #GFile.
18749  * @info: a #GFileInfo.
18750  * @flags: #GFileQueryInfoFlags
18751  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18752  * @error: a #GError, or %NULL
18753  *
18754  * Tries to set all attributes in the #GFileInfo on the target values,
18755  * not stopping on the first error.
18756  *
18757  * If there is any error during this operation then @error will be set to
18758  * the first error. Error on particular fields are flagged by setting
18759  * the "status" field in the attribute value to
18760  * %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can also detect
18761  * further errors.
18762  *
18763  * If @cancellable is not %NULL, then the operation can be cancelled by
18764  * triggering the cancellable object from another thread. If the operation
18765  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18766  *
18767  * Returns: %TRUE if there was any error, %FALSE otherwise.
18768  */
18769
18770
18771 /**
18772  * g_file_set_display_name:
18773  * @file: input #GFile.
18774  * @display_name: a string.
18775  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18776  * @error: a #GError, or %NULL
18777  *
18778  * Renames @file to the specified display name.
18779  *
18780  * The display name is converted from UTF8 to the correct encoding for the target
18781  * filesystem if possible and the @file is renamed to this.
18782  *
18783  * If you want to implement a rename operation in the user interface the edit name
18784  * (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the initial value in the rename
18785  * widget, and then the result after editing should be passed to g_file_set_display_name().
18786  *
18787  * On success the resulting converted filename is returned.
18788  *
18789  * If @cancellable is not %NULL, then the operation can be cancelled by
18790  * triggering the cancellable object from another thread. If the operation
18791  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18792  *
18793  * 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().
18794  */
18795
18796
18797 /**
18798  * g_file_set_display_name_async:
18799  * @file: input #GFile.
18800  * @display_name: a string.
18801  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
18802  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18803  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
18804  * @user_data: (closure): the data to pass to callback function
18805  *
18806  * Asynchronously sets the display name for a given #GFile.
18807  *
18808  * For more details, see g_file_set_display_name() which is
18809  * the synchronous version of this call.
18810  *
18811  * When the operation is finished, @callback will be called. You can then call
18812  * g_file_set_display_name_finish() to get the result of the operation.
18813  */
18814
18815
18816 /**
18817  * g_file_set_display_name_finish:
18818  * @file: input #GFile.
18819  * @res: a #GAsyncResult.
18820  * @error: a #GError, or %NULL
18821  *
18822  * Finishes setting a display name started with
18823  * g_file_set_display_name_async().
18824  *
18825  * Returns: (transfer full): a #GFile or %NULL on error. Free the returned object with g_object_unref().
18826  */
18827
18828
18829 /**
18830  * g_file_start_mountable:
18831  * @file: input #GFile.
18832  * @flags: flags affecting the operation
18833  * @start_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
18834  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18835  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
18836  * @user_data: the data to pass to callback function
18837  *
18838  * Starts a file of type G_FILE_TYPE_MOUNTABLE.
18839  * Using @start_operation, you can request callbacks when, for instance,
18840  * passwords are needed during authentication.
18841  *
18842  * If @cancellable is not %NULL, then the operation can be cancelled by
18843  * triggering the cancellable object from another thread. If the operation
18844  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18845  *
18846  * When the operation is finished, @callback will be called. You can then call
18847  * g_file_mount_mountable_finish() to get the result of the operation.
18848  *
18849  * Since: 2.22
18850  */
18851
18852
18853 /**
18854  * g_file_start_mountable_finish:
18855  * @file: input #GFile.
18856  * @result: a #GAsyncResult.
18857  * @error: a #GError, or %NULL
18858  *
18859  * Finishes a start operation. See g_file_start_mountable() for details.
18860  *
18861  * Finish an asynchronous start operation that was started
18862  * with g_file_start_mountable().
18863  *
18864  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
18865  * Since: 2.22
18866  */
18867
18868
18869 /**
18870  * g_file_stop_mountable:
18871  * @file: input #GFile.
18872  * @flags: flags affecting the operation
18873  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
18874  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18875  * @callback: (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
18876  * @user_data: the data to pass to callback function
18877  *
18878  * Stops a file of type G_FILE_TYPE_MOUNTABLE.
18879  *
18880  * If @cancellable is not %NULL, then the operation can be cancelled by
18881  * triggering the cancellable object from another thread. If the operation
18882  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18883  *
18884  * When the operation is finished, @callback will be called. You can then call
18885  * g_file_stop_mountable_finish() to get the result of the operation.
18886  *
18887  * Since: 2.22
18888  */
18889
18890
18891 /**
18892  * g_file_stop_mountable_finish:
18893  * @file: input #GFile.
18894  * @result: a #GAsyncResult.
18895  * @error: a #GError, or %NULL
18896  *
18897  * Finishes an stop operation, see g_file_stop_mountable() for details.
18898  *
18899  * Finish an asynchronous stop operation that was started
18900  * with g_file_stop_mountable().
18901  *
18902  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
18903  * Since: 2.22
18904  */
18905
18906
18907 /**
18908  * g_file_supports_thread_contexts:
18909  * @file: a #GFile.
18910  *
18911  * Checks if @file supports <link
18912  * linkend="g-main-context-push-thread-default-context">thread-default
18913  * contexts</link>. If this returns %FALSE, you cannot perform
18914  * asynchronous operations on @file in a thread that has a
18915  * thread-default context.
18916  *
18917  * Returns: Whether or not @file supports thread-default contexts.
18918  * Since: 2.22
18919  */
18920
18921
18922 /**
18923  * g_file_trash:
18924  * @file: #GFile to send to trash.
18925  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18926  * @error: a #GError, or %NULL
18927  *
18928  * Sends @file to the "Trashcan", if possible. This is similar to
18929  * deleting it, but the user can recover it before emptying the trashcan.
18930  * Not all file systems support trashing, so this call can return the
18931  * %G_IO_ERROR_NOT_SUPPORTED error.
18932  *
18933  *
18934  * If @cancellable is not %NULL, then the operation can be cancelled by
18935  * triggering the cancellable object from another thread. If the operation
18936  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18937  *
18938  * Returns: %TRUE on successful trash, %FALSE otherwise.
18939  */
18940
18941
18942 /**
18943  * g_file_unmount_mountable:
18944  * @file: input #GFile.
18945  * @flags: flags affecting the operation
18946  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18947  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
18948  * @user_data: (closure): the data to pass to callback function
18949  *
18950  * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
18951  *
18952  * If @cancellable is not %NULL, then the operation can be cancelled by
18953  * triggering the cancellable object from another thread. If the operation
18954  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18955  *
18956  * When the operation is finished, @callback will be called. You can then call
18957  * g_file_unmount_mountable_finish() to get the result of the operation.
18958  *
18959  * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation() instead.
18960  */
18961
18962
18963 /**
18964  * g_file_unmount_mountable_finish:
18965  * @file: input #GFile.
18966  * @result: a #GAsyncResult.
18967  * @error: a #GError, or %NULL
18968  *
18969  * Finishes an unmount operation, see g_file_unmount_mountable() for details.
18970  *
18971  * Finish an asynchronous unmount operation that was started
18972  * with g_file_unmount_mountable().
18973  *
18974  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
18975  * Deprecated: 2.22: Use g_file_unmount_mountable_with_operation_finish() instead.
18976  */
18977
18978
18979 /**
18980  * g_file_unmount_mountable_with_operation:
18981  * @file: input #GFile.
18982  * @flags: flags affecting the operation
18983  * @mount_operation: (allow-none): a #GMountOperation, or %NULL to avoid user interaction.
18984  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
18985  * @callback: (scope async) (allow-none): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
18986  * @user_data: (closure): the data to pass to callback function
18987  *
18988  * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
18989  *
18990  * If @cancellable is not %NULL, then the operation can be cancelled by
18991  * triggering the cancellable object from another thread. If the operation
18992  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18993  *
18994  * When the operation is finished, @callback will be called. You can then call
18995  * g_file_unmount_mountable_finish() to get the result of the operation.
18996  *
18997  * Since: 2.22
18998  */
18999
19000
19001 /**
19002  * g_file_unmount_mountable_with_operation_finish:
19003  * @file: input #GFile.
19004  * @result: a #GAsyncResult.
19005  * @error: a #GError, or %NULL
19006  *
19007  * Finishes an unmount operation, see g_file_unmount_mountable_with_operation() for details.
19008  *
19009  * Finish an asynchronous unmount operation that was started
19010  * with g_file_unmount_mountable_with_operation().
19011  *
19012  * Returns: %TRUE if the operation finished successfully. %FALSE otherwise.
19013  * Since: 2.22
19014  */
19015
19016
19017 /**
19018  * g_filename_completer_get_completion_suffix:
19019  * @completer: the filename completer.
19020  * @initial_text: text to be completed.
19021  *
19022  * Obtains a completion for @initial_text from @completer.
19023  *
19024  * 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.
19025  */
19026
19027
19028 /**
19029  * g_filename_completer_get_completions:
19030  * @completer: the filename completer.
19031  * @initial_text: text to be completed.
19032  *
19033  * Gets an array of completion strings for a given initial text.
19034  *
19035  * 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.
19036  */
19037
19038
19039 /**
19040  * g_filename_completer_new:
19041  *
19042  * Creates a new filename completer.
19043  *
19044  * Returns: a #GFilenameCompleter.
19045  */
19046
19047
19048 /**
19049  * g_filename_completer_set_dirs_only:
19050  * @completer: the filename completer.
19051  * @dirs_only: a #gboolean.
19052  *
19053  * If @dirs_only is %TRUE, @completer will only
19054  * complete directory names, and not file names.
19055  */
19056
19057
19058 /**
19059  * g_filter_input_stream_get_base_stream:
19060  * @stream: a #GFilterInputStream.
19061  *
19062  * Gets the base stream for the filter stream.
19063  *
19064  * Returns: (transfer none): a #GInputStream.
19065  */
19066
19067
19068 /**
19069  * g_filter_input_stream_get_close_base_stream:
19070  * @stream: a #GFilterInputStream.
19071  *
19072  * Returns whether the base stream will be closed when @stream is
19073  * closed.
19074  *
19075  * Returns: %TRUE if the base stream will be closed.
19076  */
19077
19078
19079 /**
19080  * g_filter_input_stream_set_close_base_stream:
19081  * @stream: a #GFilterInputStream.
19082  * @close_base: %TRUE to close the base stream.
19083  *
19084  * Sets whether the base stream will be closed when @stream is closed.
19085  */
19086
19087
19088 /**
19089  * g_filter_output_stream_get_base_stream:
19090  * @stream: a #GFilterOutputStream.
19091  *
19092  * Gets the base stream for the filter stream.
19093  *
19094  * Returns: (transfer none): a #GOutputStream.
19095  */
19096
19097
19098 /**
19099  * g_filter_output_stream_get_close_base_stream:
19100  * @stream: a #GFilterOutputStream.
19101  *
19102  * Returns whether the base stream will be closed when @stream is
19103  * closed.
19104  *
19105  * Returns: %TRUE if the base stream will be closed.
19106  */
19107
19108
19109 /**
19110  * g_filter_output_stream_set_close_base_stream:
19111  * @stream: a #GFilterOutputStream.
19112  * @close_base: %TRUE to close the base stream.
19113  *
19114  * Sets whether the base stream will be closed when @stream is closed.
19115  */
19116
19117
19118 /**
19119  * g_icon_equal:
19120  * @icon1: (allow-none): pointer to the first #GIcon.
19121  * @icon2: (allow-none): pointer to the second #GIcon.
19122  *
19123  * Checks if two icons are equal.
19124  *
19125  * Returns: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
19126  */
19127
19128
19129 /**
19130  * g_icon_hash:
19131  * @icon: #gconstpointer to an icon object.
19132  *
19133  * Gets a hash for an icon.
19134  *
19135  * Virtual: hash
19136  * Returns: a #guint containing a hash for the @icon, suitable for use in a #GHashTable or similar data structure.
19137  */
19138
19139
19140 /**
19141  * g_icon_new_for_string:
19142  * @str: A string obtained via g_icon_to_string().
19143  * @error: Return location for error.
19144  *
19145  * Generate a #GIcon instance from @str. This function can fail if
19146  * @str is not valid - see g_icon_to_string() for discussion.
19147  *
19148  * If your application or library provides one or more #GIcon
19149  * implementations you need to ensure that each #GType is registered
19150  * with the type system prior to calling g_icon_new_for_string().
19151  *
19152  * Returns: (transfer full): An object implementing the #GIcon interface or %NULL if @error is set.
19153  * Since: 2.20
19154  */
19155
19156
19157 /**
19158  * g_icon_to_string:
19159  * @icon: a #GIcon.
19160  *
19161  * Generates a textual representation of @icon that can be used for
19162  * serialization such as when passing @icon to a different process or
19163  * saving it to persistent storage. Use g_icon_new_for_string() to
19164  * get @icon back from the returned string.
19165  *
19166  * The encoding of the returned string is proprietary to #GIcon except
19167  * in the following two cases
19168  *
19169  * <itemizedlist>
19170  * <listitem><para>
19171  *     If @icon is a #GFileIcon, the returned string is a native path
19172  *     (such as <literal>/path/to/my icon.png</literal>) without escaping
19173  *     if the #GFile for @icon is a native file.  If the file is not
19174  *     native, the returned string is the result of g_file_get_uri()
19175  *     (such as <literal>sftp://path/to/my&percnt;20icon.png</literal>).
19176  * </para></listitem>
19177  * <listitem><para>
19178  *    If @icon is a #GThemedIcon with exactly one name, the encoding is
19179  *    simply the name (such as <literal>network-server</literal>).
19180  * </para></listitem>
19181  * </itemizedlist>
19182  *
19183  * Virtual: to_tokens
19184  * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't be serialized. Use g_free() to free.
19185  * Since: 2.20
19186  */
19187
19188
19189 /**
19190  * g_inet_address_equal:
19191  * @address: A #GInetAddress.
19192  * @other_address: Another #GInetAddress.
19193  *
19194  * Checks if two #GInetAddress instances are equal, e.g. the same address.
19195  *
19196  * Returns: %TRUE if @address and @other_address are equal, %FALSE otherwise.
19197  * Since: 2.30
19198  */
19199
19200
19201 /**
19202  * g_inet_address_get_family:
19203  * @address: a #GInetAddress
19204  *
19205  * Gets @address's family
19206  *
19207  * Returns: @address's family
19208  * Since: 2.22
19209  */
19210
19211
19212 /**
19213  * g_inet_address_get_is_any:
19214  * @address: a #GInetAddress
19215  *
19216  * Tests whether @address is the "any" address for its family.
19217  *
19218  * Returns: %TRUE if @address is the "any" address for its family.
19219  * Since: 2.22
19220  */
19221
19222
19223 /**
19224  * g_inet_address_get_is_link_local:
19225  * @address: a #GInetAddress
19226  *
19227  * Tests whether @address is a link-local address (that is, if it
19228  * identifies a host on a local network that is not connected to the
19229  * Internet).
19230  *
19231  * Returns: %TRUE if @address is a link-local address.
19232  * Since: 2.22
19233  */
19234
19235
19236 /**
19237  * g_inet_address_get_is_loopback:
19238  * @address: a #GInetAddress
19239  *
19240  * Tests whether @address is the loopback address for its family.
19241  *
19242  * Returns: %TRUE if @address is the loopback address for its family.
19243  * Since: 2.22
19244  */
19245
19246
19247 /**
19248  * g_inet_address_get_is_mc_global:
19249  * @address: a #GInetAddress
19250  *
19251  * Tests whether @address is a global multicast address.
19252  *
19253  * Returns: %TRUE if @address is a global multicast address.
19254  * Since: 2.22
19255  */
19256
19257
19258 /**
19259  * g_inet_address_get_is_mc_link_local:
19260  * @address: a #GInetAddress
19261  *
19262  * Tests whether @address is a link-local multicast address.
19263  *
19264  * Returns: %TRUE if @address is a link-local multicast address.
19265  * Since: 2.22
19266  */
19267
19268
19269 /**
19270  * g_inet_address_get_is_mc_node_local:
19271  * @address: a #GInetAddress
19272  *
19273  * Tests whether @address is a node-local multicast address.
19274  *
19275  * Returns: %TRUE if @address is a node-local multicast address.
19276  * Since: 2.22
19277  */
19278
19279
19280 /**
19281  * g_inet_address_get_is_mc_org_local:
19282  * @address: a #GInetAddress
19283  *
19284  * Tests whether @address is an organization-local multicast address.
19285  *
19286  * Returns: %TRUE if @address is an organization-local multicast address.
19287  * Since: 2.22
19288  */
19289
19290
19291 /**
19292  * g_inet_address_get_is_mc_site_local:
19293  * @address: a #GInetAddress
19294  *
19295  * Tests whether @address is a site-local multicast address.
19296  *
19297  * Returns: %TRUE if @address is a site-local multicast address.
19298  * Since: 2.22
19299  */
19300
19301
19302 /**
19303  * g_inet_address_get_is_multicast:
19304  * @address: a #GInetAddress
19305  *
19306  * Tests whether @address is a multicast address.
19307  *
19308  * Returns: %TRUE if @address is a multicast address.
19309  * Since: 2.22
19310  */
19311
19312
19313 /**
19314  * g_inet_address_get_is_site_local:
19315  * @address: a #GInetAddress
19316  *
19317  * Tests whether @address is a site-local address such as 10.0.0.1
19318  * (that is, the address identifies a host on a local network that can
19319  * not be reached directly from the Internet, but which may have
19320  * outgoing Internet connectivity via a NAT or firewall).
19321  *
19322  * Returns: %TRUE if @address is a site-local address.
19323  * Since: 2.22
19324  */
19325
19326
19327 /**
19328  * g_inet_address_get_native_size:
19329  * @address: a #GInetAddress
19330  *
19331  * Gets the size of the native raw binary address for @address. This
19332  * is the size of the data that you get from g_inet_address_to_bytes().
19333  *
19334  * Returns: the number of bytes used for the native version of @address.
19335  * Since: 2.22
19336  */
19337
19338
19339 /**
19340  * g_inet_address_mask_equal:
19341  * @mask: a #GInetAddressMask
19342  * @mask2: another #GInetAddressMask
19343  *
19344  * Tests if @mask and @mask2 are the same mask.
19345  *
19346  * Returns: whether @mask and @mask2 are the same mask
19347  * Since: 2.32
19348  */
19349
19350
19351 /**
19352  * g_inet_address_mask_get_address:
19353  * @mask: a #GInetAddressMask
19354  *
19355  * Gets @mask's base address
19356  *
19357  * Returns: (transfer none): @mask's base address
19358  * Since: 2.32
19359  */
19360
19361
19362 /**
19363  * g_inet_address_mask_get_family:
19364  * @mask: a #GInetAddressMask
19365  *
19366  * Gets the #GSocketFamily of @mask's address
19367  *
19368  * Returns: the #GSocketFamily of @mask's address
19369  * Since: 2.32
19370  */
19371
19372
19373 /**
19374  * g_inet_address_mask_get_length:
19375  * @mask: a #GInetAddressMask
19376  *
19377  * Gets @mask's length
19378  *
19379  * Returns: @mask's length
19380  * Since: 2.32
19381  */
19382
19383
19384 /**
19385  * g_inet_address_mask_matches:
19386  * @mask: a #GInetAddressMask
19387  * @address: a #GInetAddress
19388  *
19389  * Tests if @address falls within the range described by @mask.
19390  *
19391  * Returns: whether @address falls within the range described by @mask.
19392  * Since: 2.32
19393  */
19394
19395
19396 /**
19397  * g_inet_address_mask_new:
19398  * @addr: a #GInetAddress
19399  * @length: number of bits of @addr to use
19400  * @error: return location for #GError, or %NULL
19401  *
19402  * Creates a new #GInetAddressMask representing all addresses whose
19403  * first @length bits match @addr.
19404  *
19405  * Returns: a new #GInetAddressMask, or %NULL on error
19406  * Since: 2.32
19407  */
19408
19409
19410 /**
19411  * g_inet_address_mask_new_from_string:
19412  * @mask_string: an IP address or address/length string
19413  * @error: return location for #GError, or %NULL
19414  *
19415  * Parses @mask_string as an IP address and (optional) length, and
19416  * creates a new #GInetAddressMask. The length, if present, is
19417  * delimited by a "/". If it is not present, then the length is
19418  * assumed to be the full length of the address.
19419  *
19420  * Returns: a new #GInetAddressMask corresponding to @string, or %NULL on error.
19421  * Since: 2.32
19422  */
19423
19424
19425 /**
19426  * g_inet_address_mask_to_string:
19427  * @mask: a #GInetAddressMask
19428  *
19429  * Converts @mask back to its corresponding string form.
19430  *
19431  * Returns: a string corresponding to @mask.
19432  * Since: 2.32
19433  */
19434
19435
19436 /**
19437  * g_inet_address_new_any:
19438  * @family: the address family
19439  *
19440  * Creates a #GInetAddress for the "any" address (unassigned/"don't
19441  * care") for @family.
19442  *
19443  * Returns: a new #GInetAddress corresponding to the "any" address for @family.
19444  * Since: 2.22
19445  */
19446
19447
19448 /**
19449  * g_inet_address_new_from_bytes:
19450  * @bytes: (array) (element-type guint8): raw address data
19451  * @family: the address family of @bytes
19452  *
19453  * Creates a new #GInetAddress from the given @family and @bytes.
19454  * @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for
19455  * %G_SOCKET_FAMILY_IPV6.
19456  *
19457  * Returns: a new #GInetAddress corresponding to @family and @bytes.
19458  * Since: 2.22
19459  */
19460
19461
19462 /**
19463  * g_inet_address_new_from_string:
19464  * @string: a string representation of an IP address
19465  *
19466  * Parses @string as an IP address and creates a new #GInetAddress.
19467  *
19468  * Returns: a new #GInetAddress corresponding to @string, or %NULL if @string could not be parsed.
19469  * Since: 2.22
19470  */
19471
19472
19473 /**
19474  * g_inet_address_new_loopback:
19475  * @family: the address family
19476  *
19477  * Creates a #GInetAddress for the loopback address for @family.
19478  *
19479  * Returns: a new #GInetAddress corresponding to the loopback address for @family.
19480  * Since: 2.22
19481  */
19482
19483
19484 /**
19485  * g_inet_address_to_bytes: (skip)
19486  * @address: a #GInetAddress
19487  *
19488  * Gets the raw binary address data from @address.
19489  *
19490  * 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().
19491  * Since: 2.22
19492  */
19493
19494
19495 /**
19496  * g_inet_address_to_string:
19497  * @address: a #GInetAddress
19498  *
19499  * Converts @address to string form.
19500  *
19501  * Returns: a representation of @address as a string, which should be freed after use.
19502  * Since: 2.22
19503  */
19504
19505
19506 /**
19507  * g_inet_socket_address_get_address:
19508  * @address: a #GInetSocketAddress
19509  *
19510  * Gets @address's #GInetAddress.
19511  *
19512  * Returns: (transfer none): the #GInetAddress for @address, which must be g_object_ref()'d if it will be stored
19513  * Since: 2.22
19514  */
19515
19516
19517 /**
19518  * g_inet_socket_address_get_flowinfo:
19519  * @address: a %G_SOCKET_FAMILY_IPV6 #GInetSocketAddress
19520  *
19521  * Gets the <literal>sin6_flowinfo</literal> field from @address,
19522  * which must be an IPv6 address.
19523  *
19524  * Returns: the flowinfo field
19525  * Since: 2.32
19526  */
19527
19528
19529 /**
19530  * g_inet_socket_address_get_port:
19531  * @address: a #GInetSocketAddress
19532  *
19533  * Gets @address's port.
19534  *
19535  * Returns: the port for @address
19536  * Since: 2.22
19537  */
19538
19539
19540 /**
19541  * g_inet_socket_address_get_scope_id:
19542  * @address: a %G_SOCKET_FAMILY_IPV6 #GInetAddress
19543  *
19544  * Gets the <literal>sin6_scope_id</literal> field from @address,
19545  * which must be an IPv6 address.
19546  *
19547  * Returns: the scope id field
19548  * Since: 2.32
19549  */
19550
19551
19552 /**
19553  * g_inet_socket_address_new:
19554  * @address: a #GInetAddress
19555  * @port: a port number
19556  *
19557  * Creates a new #GInetSocketAddress for @address and @port.
19558  *
19559  * Returns: a new #GInetSocketAddress
19560  * Since: 2.22
19561  */
19562
19563
19564 /**
19565  * g_initable_init:
19566  * @initable: a #GInitable.
19567  * @cancellable: optional #GCancellable object, %NULL to ignore.
19568  * @error: a #GError location to store the error occurring, or %NULL to ignore.
19569  *
19570  * Initializes the object implementing the interface.
19571  *
19572  * The object must be initialized before any real use after initial
19573  * construction, either with this function or g_async_initable_init_async().
19574  *
19575  * Implementations may also support cancellation. If @cancellable is not %NULL,
19576  * then initialization can be cancelled by triggering the cancellable object
19577  * from another thread. If the operation was cancelled, the error
19578  * %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
19579  * the object doesn't support cancellable initialization the error
19580  * %G_IO_ERROR_NOT_SUPPORTED will be returned.
19581  *
19582  * If the object is not initialized, or initialization returns with an
19583  * error, then all operations on the object except g_object_ref() and
19584  * g_object_unref() are considered to be invalid, and have undefined
19585  * behaviour. See the <xref linkend="ginitable"/> section introduction
19586  * for more details.
19587  *
19588  * Implementations of this method must be idempotent, i.e. multiple calls
19589  * to this function with the same argument should return the same results.
19590  * Only the first call initializes the object, further calls return the result
19591  * of the first call. This is so that it's safe to implement the singleton
19592  * pattern in the GObject constructor function.
19593  *
19594  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
19595  * Since: 2.22
19596  */
19597
19598
19599 /**
19600  * g_initable_new:
19601  * @object_type: a #GType supporting #GInitable.
19602  * @cancellable: optional #GCancellable object, %NULL to ignore.
19603  * @error: a #GError location to store the error occurring, or %NULL to ignore.
19604  * @first_property_name: (allow-none): the name of the first property, or %NULL if no properties
19605  * @...: the value if the first property, followed by and other property value pairs, and ended by %NULL.
19606  *
19607  * Helper function for constructing #GInitable object. This is
19608  * similar to g_object_new() but also initializes the object
19609  * and returns %NULL, setting an error on failure.
19610  *
19611  * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
19612  * Since: 2.22
19613  */
19614
19615
19616 /**
19617  * g_initable_new_valist:
19618  * @object_type: a #GType supporting #GInitable.
19619  * @first_property_name: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
19620  * @var_args: The var args list generated from @first_property_name.
19621  * @cancellable: optional #GCancellable object, %NULL to ignore.
19622  * @error: a #GError location to store the error occurring, or %NULL to ignore.
19623  *
19624  * Helper function for constructing #GInitable object. This is
19625  * similar to g_object_new_valist() but also initializes the object
19626  * and returns %NULL, setting an error on failure.
19627  *
19628  * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
19629  * Since: 2.22
19630  */
19631
19632
19633 /**
19634  * g_initable_newv:
19635  * @object_type: a #GType supporting #GInitable.
19636  * @n_parameters: the number of parameters in @parameters
19637  * @parameters: (array length=n_parameters): the parameters to use to construct the object
19638  * @cancellable: optional #GCancellable object, %NULL to ignore.
19639  * @error: a #GError location to store the error occurring, or %NULL to ignore.
19640  *
19641  * Helper function for constructing #GInitable object. This is
19642  * similar to g_object_newv() but also initializes the object
19643  * and returns %NULL, setting an error on failure.
19644  *
19645  * Returns: (transfer full): a newly allocated #GObject, or %NULL on error
19646  * Since: 2.22
19647  */
19648
19649
19650 /**
19651  * g_input_stream_clear_pending:
19652  * @stream: input stream
19653  *
19654  * Clears the pending flag on @stream.
19655  */
19656
19657
19658 /**
19659  * g_input_stream_close:
19660  * @stream: A #GInputStream.
19661  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19662  * @error: location to store the error occurring, or %NULL to ignore
19663  *
19664  * Closes the stream, releasing resources related to it.
19665  *
19666  * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
19667  * Closing a stream multiple times will not return an error.
19668  *
19669  * Streams will be automatically closed when the last reference
19670  * is dropped, but you might want to call this function to make sure
19671  * resources are released as early as possible.
19672  *
19673  * Some streams might keep the backing store of the stream (e.g. a file descriptor)
19674  * open after the stream is closed. See the documentation for the individual
19675  * stream for details.
19676  *
19677  * On failure the first error that happened will be reported, but the close
19678  * operation will finish as much as possible. A stream that failed to
19679  * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
19680  * is important to check and report the error to the user.
19681  *
19682  * If @cancellable is not %NULL, then the operation can be cancelled by
19683  * triggering the cancellable object from another thread. If the operation
19684  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19685  * Cancelling a close will still leave the stream closed, but some streams
19686  * can use a faster close that doesn't block to e.g. check errors.
19687  *
19688  * Returns: %TRUE on success, %FALSE on failure
19689  */
19690
19691
19692 /**
19693  * g_input_stream_close_async:
19694  * @stream: A #GInputStream.
19695  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
19696  * @cancellable: (allow-none): optional cancellable object
19697  * @callback: (scope async): callback to call when the request is satisfied
19698  * @user_data: (closure): the data to pass to callback function
19699  *
19700  * Requests an asynchronous closes of the stream, releasing resources related to it.
19701  * When the operation is finished @callback will be called.
19702  * You can then call g_input_stream_close_finish() to get the result of the
19703  * operation.
19704  *
19705  * For behaviour details see g_input_stream_close().
19706  *
19707  * The asyncronous methods have a default fallback that uses threads to implement
19708  * asynchronicity, so they are optional for inheriting classes. However, if you
19709  * override one you must override all.
19710  */
19711
19712
19713 /**
19714  * g_input_stream_close_finish:
19715  * @stream: a #GInputStream.
19716  * @result: a #GAsyncResult.
19717  * @error: a #GError location to store the error occurring, or %NULL to ignore.
19718  *
19719  * Finishes closing a stream asynchronously, started from g_input_stream_close_async().
19720  *
19721  * Returns: %TRUE if the stream was closed successfully.
19722  */
19723
19724
19725 /**
19726  * g_input_stream_has_pending:
19727  * @stream: input stream.
19728  *
19729  * Checks if an input stream has pending actions.
19730  *
19731  * Returns: %TRUE if @stream has pending actions.
19732  */
19733
19734
19735 /**
19736  * g_input_stream_is_closed:
19737  * @stream: input stream.
19738  *
19739  * Checks if an input stream is closed.
19740  *
19741  * Returns: %TRUE if the stream is closed.
19742  */
19743
19744
19745 /**
19746  * g_input_stream_read:
19747  * @stream: a #GInputStream.
19748  * @buffer: a buffer to read data into (which should be at least count bytes long).
19749  * @count: the number of bytes that will be read from the stream
19750  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19751  * @error: location to store the error occurring, or %NULL to ignore
19752  *
19753  * Tries to read @count bytes from the stream into the buffer starting at
19754  * @buffer. Will block during this read.
19755  *
19756  * If count is zero returns zero and does nothing. A value of @count
19757  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
19758  *
19759  * On success, the number of bytes read into the buffer is returned.
19760  * It is not an error if this is not the same as the requested size, as it
19761  * can happen e.g. near the end of a file. Zero is returned on end of file
19762  * (or if @count is zero),  but never otherwise.
19763  *
19764  * If @cancellable is not %NULL, then the operation can be cancelled by
19765  * triggering the cancellable object from another thread. If the operation
19766  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
19767  * operation was partially finished when the operation was cancelled the
19768  * partial result will be returned, without an error.
19769  *
19770  * On error -1 is returned and @error is set accordingly.
19771  *
19772  * Returns: Number of bytes read, or -1 on error, or 0 on end of file.
19773  */
19774
19775
19776 /**
19777  * g_input_stream_read_all:
19778  * @stream: a #GInputStream.
19779  * @buffer: a buffer to read data into (which should be at least count bytes long).
19780  * @count: the number of bytes that will be read from the stream
19781  * @bytes_read: (out): location to store the number of bytes that was read from the stream
19782  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19783  * @error: location to store the error occurring, or %NULL to ignore
19784  *
19785  * Tries to read @count bytes from the stream into the buffer starting at
19786  * @buffer. Will block during this read.
19787  *
19788  * This function is similar to g_input_stream_read(), except it tries to
19789  * read as many bytes as requested, only stopping on an error or end of stream.
19790  *
19791  * On a successful read of @count bytes, or if we reached the end of the
19792  * stream,  %TRUE is returned, and @bytes_read is set to the number of bytes
19793  * read into @buffer.
19794  *
19795  * If there is an error during the operation %FALSE is returned and @error
19796  * is set to indicate the error status, @bytes_read is updated to contain
19797  * the number of bytes read into @buffer before the error occurred.
19798  *
19799  * Returns: %TRUE on success, %FALSE if there was an error
19800  */
19801
19802
19803 /**
19804  * g_input_stream_read_async:
19805  * @stream: A #GInputStream.
19806  * @buffer: a buffer to read data into (which should be at least count bytes long).
19807  * @count: the number of bytes that will be read from the stream
19808  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
19809  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19810  * @callback: (scope async): callback to call when the request is satisfied
19811  * @user_data: (closure): the data to pass to callback function
19812  *
19813  * Request an asynchronous read of @count bytes from the stream into the buffer
19814  * starting at @buffer. When the operation is finished @callback will be called.
19815  * You can then call g_input_stream_read_finish() to get the result of the
19816  * operation.
19817  *
19818  * During an async request no other sync and async calls are allowed on @stream, and will
19819  * result in %G_IO_ERROR_PENDING errors.
19820  *
19821  * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
19822  *
19823  * On success, the number of bytes read into the buffer will be passed to the
19824  * callback. It is not an error if this is not the same as the requested size, as it
19825  * can happen e.g. near the end of a file, but generally we try to read
19826  * as many bytes as requested. Zero is returned on end of file
19827  * (or if @count is zero),  but never otherwise.
19828  *
19829  * Any outstanding i/o request with higher priority (lower numerical value) will
19830  * be executed before an outstanding request with lower priority. Default
19831  * priority is %G_PRIORITY_DEFAULT.
19832  *
19833  * The asyncronous methods have a default fallback that uses threads to implement
19834  * asynchronicity, so they are optional for inheriting classes. However, if you
19835  * override one you must override all.
19836  */
19837
19838
19839 /**
19840  * g_input_stream_read_finish:
19841  * @stream: a #GInputStream.
19842  * @result: a #GAsyncResult.
19843  * @error: a #GError location to store the error occurring, or %NULL to ignore.
19844  *
19845  * Finishes an asynchronous stream read operation.
19846  *
19847  * Returns: number of bytes read in, or -1 on error, or 0 on end of file.
19848  */
19849
19850
19851 /**
19852  * g_input_stream_set_pending:
19853  * @stream: input stream
19854  * @error: a #GError location to store the error occurring, or %NULL to ignore.
19855  *
19856  * Sets @stream to have actions pending. If the pending flag is
19857  * already set or @stream is closed, it will return %FALSE and set
19858  * @error.
19859  *
19860  * Returns: %TRUE if pending was previously unset and is now set.
19861  */
19862
19863
19864 /**
19865  * g_input_stream_skip:
19866  * @stream: a #GInputStream.
19867  * @count: the number of bytes that will be skipped from the stream
19868  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19869  * @error: location to store the error occurring, or %NULL to ignore
19870  *
19871  * Tries to skip @count bytes from the stream. Will block during the operation.
19872  *
19873  * This is identical to g_input_stream_read(), from a behaviour standpoint,
19874  * but the bytes that are skipped are not returned to the user. Some
19875  * streams have an implementation that is more efficient than reading the data.
19876  *
19877  * This function is optional for inherited classes, as the default implementation
19878  * emulates it using read.
19879  *
19880  * If @cancellable is not %NULL, then the operation can be cancelled by
19881  * triggering the cancellable object from another thread. If the operation
19882  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
19883  * operation was partially finished when the operation was cancelled the
19884  * partial result will be returned, without an error.
19885  *
19886  * Returns: Number of bytes skipped, or -1 on error
19887  */
19888
19889
19890 /**
19891  * g_input_stream_skip_async:
19892  * @stream: A #GInputStream.
19893  * @count: the number of bytes that will be skipped from the stream
19894  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
19895  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
19896  * @callback: (scope async): callback to call when the request is satisfied
19897  * @user_data: (closure): the data to pass to callback function
19898  *
19899  * Request an asynchronous skip of @count bytes from the stream.
19900  * When the operation is finished @callback will be called.
19901  * You can then call g_input_stream_skip_finish() to get the result
19902  * of the operation.
19903  *
19904  * During an async request no other sync and async calls are allowed,
19905  * and will result in %G_IO_ERROR_PENDING errors.
19906  *
19907  * A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
19908  *
19909  * On success, the number of bytes skipped will be passed to the callback.
19910  * It is not an error if this is not the same as the requested size, as it
19911  * can happen e.g. near the end of a file, but generally we try to skip
19912  * as many bytes as requested. Zero is returned on end of file
19913  * (or if @count is zero), but never otherwise.
19914  *
19915  * Any outstanding i/o request with higher priority (lower numerical value)
19916  * will be executed before an outstanding request with lower priority.
19917  * Default priority is %G_PRIORITY_DEFAULT.
19918  *
19919  * The asynchronous methods have a default fallback that uses threads to
19920  * implement asynchronicity, so they are optional for inheriting classes.
19921  * However, if you override one, you must override all.
19922  */
19923
19924
19925 /**
19926  * g_input_stream_skip_finish:
19927  * @stream: a #GInputStream.
19928  * @result: a #GAsyncResult.
19929  * @error: a #GError location to store the error occurring, or %NULL to ignore.
19930  *
19931  * Finishes a stream skip operation.
19932  *
19933  * Returns: the size of the bytes skipped, or %-1 on error.
19934  */
19935
19936
19937 /**
19938  * g_io_error_from_errno:
19939  * @err_no: Error number as defined in errno.h.
19940  *
19941  * Converts errno.h error codes into GIO error codes.
19942  *
19943  * Returns: #GIOErrorEnum value for the given errno.h error number.
19944  */
19945
19946
19947 /**
19948  * g_io_error_from_win32_error:
19949  * @error_code: Windows error number.
19950  *
19951  * Converts some common error codes into GIO error codes. The
19952  * fallback value G_IO_ERROR_FAILED is returned for error codes not
19953  * handled.
19954  *
19955  * Returns: #GIOErrorEnum value for the given error number.
19956  * Since: 2.26
19957  */
19958
19959
19960 /**
19961  * g_io_error_quark:
19962  *
19963  * Gets the GIO Error Quark.
19964  *
19965  * Returns: a #GQuark.
19966  */
19967
19968
19969 /**
19970  * g_io_extension_get_name:
19971  * @extension: a #GIOExtension
19972  *
19973  * Gets the name under which @extension was registered.
19974  *
19975  * Note that the same type may be registered as extension
19976  * for multiple extension points, under different names.
19977  *
19978  * Returns: the name of @extension.
19979  */
19980
19981
19982 /**
19983  * g_io_extension_get_priority:
19984  * @extension: a #GIOExtension
19985  *
19986  * Gets the priority with which @extension was registered.
19987  *
19988  * Returns: the priority of @extension
19989  */
19990
19991
19992 /**
19993  * g_io_extension_get_type:
19994  * @extension: a #GIOExtension
19995  *
19996  * Gets the type associated with @extension.
19997  *
19998  * Returns: the type of @extension
19999  */
20000
20001
20002 /**
20003  * g_io_extension_point_get_extension_by_name:
20004  * @extension_point: a #GIOExtensionPoint
20005  * @name: the name of the extension to get
20006  *
20007  * Finds a #GIOExtension for an extension point by name.
20008  *
20009  * Returns: (transfer none): the #GIOExtension for @extension_point that has the given name, or %NULL if there is no extension with that name
20010  */
20011
20012
20013 /**
20014  * g_io_extension_point_get_extensions:
20015  * @extension_point: a #GIOExtensionPoint
20016  *
20017  * Gets a list of all extensions that implement this extension point.
20018  * The list is sorted by priority, beginning with the highest priority.
20019  *
20020  * Returns: (element-type GIOExtension) (transfer none): a #GList of #GIOExtension<!-- -->s. The list is owned by GIO and should not be modified.
20021  */
20022
20023
20024 /**
20025  * g_io_extension_point_get_required_type:
20026  * @extension_point: a #GIOExtensionPoint
20027  *
20028  * Gets the required type for @extension_point.
20029  *
20030  * Returns: the #GType that all implementations must have, or #G_TYPE_INVALID if the extension point has no required type
20031  */
20032
20033
20034 /**
20035  * g_io_extension_point_implement:
20036  * @extension_point_name: the name of the extension point
20037  * @type: the #GType to register as extension
20038  * @extension_name: the name for the extension
20039  * @priority: the priority for the extension
20040  *
20041  * Registers @type as extension for the extension point with name
20042  * @extension_point_name.
20043  *
20044  * If @type has already been registered as an extension for this
20045  * extension point, the existing #GIOExtension object is returned.
20046  *
20047  * Returns: (transfer none): a #GIOExtension object for #GType
20048  */
20049
20050
20051 /**
20052  * g_io_extension_point_lookup:
20053  * @name: the name of the extension point
20054  *
20055  * Looks up an existing extension point.
20056  *
20057  * Returns: (transfer none): the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name.
20058  */
20059
20060
20061 /**
20062  * g_io_extension_point_register:
20063  * @name: The name of the extension point
20064  *
20065  * Registers an extension point.
20066  *
20067  * Returns: (transfer none): the new #GIOExtensionPoint. This object is owned by GIO and should not be freed.
20068  */
20069
20070
20071 /**
20072  * g_io_extension_point_set_required_type:
20073  * @extension_point: a #GIOExtensionPoint
20074  * @type: the #GType to require
20075  *
20076  * Sets the required type for @extension_point to @type.
20077  * All implementations must henceforth have this type.
20078  */
20079
20080
20081 /**
20082  * g_io_extension_ref_class:
20083  * @extension: a #GIOExtension
20084  *
20085  * Gets a reference to the class for the type that is
20086  * associated with @extension.
20087  *
20088  * Returns: (transfer full): the #GTypeClass for the type of @extension
20089  */
20090
20091
20092 /**
20093  * g_io_module_new:
20094  * @filename: filename of the shared library module.
20095  *
20096  * Creates a new GIOModule that will load the specific
20097  * shared library when in use.
20098  *
20099  * Returns: a #GIOModule from given @filename, or %NULL on error.
20100  */
20101
20102
20103 /**
20104  * g_io_module_scope_block:
20105  * @scope: a module loading scope
20106  * @basename: the basename to block
20107  *
20108  * Block modules with the given @basename from being loaded when
20109  * this scope is used with g_io_modules_scan_all_in_directory_with_scope()
20110  * or g_io_modules_load_all_in_directory_with_scope().
20111  *
20112  * Since: 2.30
20113  */
20114
20115
20116 /**
20117  * g_io_module_scope_free:
20118  * @scope: a module loading scope
20119  *
20120  * Free a module scope.
20121  *
20122  * Since: 2.30
20123  */
20124
20125
20126 /**
20127  * g_io_module_scope_new:
20128  * @flags: flags for the new scope
20129  *
20130  * Create a new scope for loading of IO modules. A scope can be used for
20131  * blocking duplicate modules, or blocking a module you don't want to load.
20132  *
20133  * Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules
20134  * which have the same base name as a module that has already been seen
20135  * in this scope.
20136  *
20137  * Returns: (transfer full): the new module scope
20138  * Since: 2.30
20139  */
20140
20141
20142 /**
20143  * g_io_modules_load_all_in_directory:
20144  * @dirname: pathname for a directory containing modules to load.
20145  *
20146  * Loads all the modules in the specified directory.
20147  *
20148  * If don't require all modules to be initialized (and thus registering
20149  * all gtypes) then you can use g_io_modules_scan_all_in_directory()
20150  * which allows delayed/lazy loading of modules.
20151  *
20152  * 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().
20153  */
20154
20155
20156 /**
20157  * g_io_modules_load_all_in_directory_with_scope:
20158  * @dirname: pathname for a directory containing modules to load.
20159  * @scope: a scope to use when scanning the modules.
20160  *
20161  * Loads all the modules in the specified directory.
20162  *
20163  * If don't require all modules to be initialized (and thus registering
20164  * all gtypes) then you can use g_io_modules_scan_all_in_directory()
20165  * which allows delayed/lazy loading of modules.
20166  *
20167  * 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().
20168  * Since: 2.30
20169  */
20170
20171
20172 /**
20173  * g_io_modules_scan_all_in_directory:
20174  * @dirname: pathname for a directory containing modules to scan.
20175  *
20176  * Scans all the modules in the specified directory, ensuring that
20177  * any extension point implemented by a module is registered.
20178  *
20179  * This may not actually load and initialize all the types in each
20180  * module, some modules may be lazily loaded and initialized when
20181  * an extension point it implementes is used with e.g.
20182  * g_io_extension_point_get_extensions() or
20183  * g_io_extension_point_get_extension_by_name().
20184  *
20185  * If you need to guarantee that all types are loaded in all the modules,
20186  * use g_io_modules_load_all_in_directory().
20187  *
20188  * Since: 2.24
20189  */
20190
20191
20192 /**
20193  * g_io_modules_scan_all_in_directory_with_scope:
20194  * @dirname: pathname for a directory containing modules to scan.
20195  * @scope: a scope to use when scanning the modules
20196  *
20197  * Scans all the modules in the specified directory, ensuring that
20198  * any extension point implemented by a module is registered.
20199  *
20200  * This may not actually load and initialize all the types in each
20201  * module, some modules may be lazily loaded and initialized when
20202  * an extension point it implementes is used with e.g.
20203  * g_io_extension_point_get_extensions() or
20204  * g_io_extension_point_get_extension_by_name().
20205  *
20206  * If you need to guarantee that all types are loaded in all the modules,
20207  * use g_io_modules_load_all_in_directory().
20208  *
20209  * Since: 2.30
20210  */
20211
20212
20213 /**
20214  * g_io_scheduler_cancel_all_jobs:
20215  *
20216  * Cancels all cancellable I/O jobs.
20217  *
20218  * A job is cancellable if a #GCancellable was passed into
20219  * g_io_scheduler_push_job().
20220  */
20221
20222
20223 /**
20224  * g_io_scheduler_job_send_to_mainloop:
20225  * @job: a #GIOSchedulerJob
20226  * @func: a #GSourceFunc callback that will be called in the original thread
20227  * @user_data: data to pass to @func
20228  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
20229  *
20230  * Used from an I/O job to send a callback to be run in the thread
20231  * that the job was started from, waiting for the result (and thus
20232  * blocking the I/O job).
20233  *
20234  * Returns: The return value of @func
20235  */
20236
20237
20238 /**
20239  * g_io_scheduler_job_send_to_mainloop_async:
20240  * @job: a #GIOSchedulerJob
20241  * @func: a #GSourceFunc callback that will be called in the original thread
20242  * @user_data: data to pass to @func
20243  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
20244  *
20245  * Used from an I/O job to send a callback to be run asynchronously in
20246  * the thread that the job was started from. The callback will be run
20247  * when the main loop is available, but at that time the I/O job might
20248  * have finished. The return value from the callback is ignored.
20249  *
20250  * Note that if you are passing the @user_data from g_io_scheduler_push_job()
20251  * on to this function you have to ensure that it is not freed before
20252  * @func is called, either by passing %NULL as @notify to
20253  * g_io_scheduler_push_job() or by using refcounting for @user_data.
20254  */
20255
20256
20257 /**
20258  * g_io_scheduler_push_job:
20259  * @job_func: a #GIOSchedulerJobFunc.
20260  * @user_data: data to pass to @job_func
20261  * @notify: (allow-none): a #GDestroyNotify for @user_data, or %NULL
20262  * @io_priority: the <link linkend="gioscheduler">I/O priority</link> of the request.
20263  * @cancellable: optional #GCancellable object, %NULL to ignore.
20264  *
20265  * Schedules the I/O job to run in another thread.
20266  *
20267  * @notify will be called on @user_data after @job_func has returned,
20268  * regardless whether the job was cancelled or has run to completion.
20269  *
20270  * If @cancellable is not %NULL, it can be used to cancel the I/O job
20271  * by calling g_cancellable_cancel() or by calling
20272  * g_io_scheduler_cancel_all_jobs().
20273  */
20274
20275
20276 /**
20277  * g_io_stream_clear_pending:
20278  * @stream: a #GIOStream
20279  *
20280  * Clears the pending flag on @stream.
20281  *
20282  * Since: 2.22
20283  */
20284
20285
20286 /**
20287  * g_io_stream_close:
20288  * @stream: a #GIOStream
20289  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
20290  * @error: location to store the error occurring, or %NULL to ignore
20291  *
20292  * Closes the stream, releasing resources related to it. This will also
20293  * closes the individual input and output streams, if they are not already
20294  * closed.
20295  *
20296  * Once the stream is closed, all other operations will return
20297  * %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
20298  * return an error.
20299  *
20300  * Closing a stream will automatically flush any outstanding buffers
20301  * in the stream.
20302  *
20303  * Streams will be automatically closed when the last reference
20304  * is dropped, but you might want to call this function to make sure
20305  * resources are released as early as possible.
20306  *
20307  * Some streams might keep the backing store of the stream (e.g. a file
20308  * descriptor) open after the stream is closed. See the documentation for
20309  * the individual stream for details.
20310  *
20311  * On failure the first error that happened will be reported, but the
20312  * close operation will finish as much as possible. A stream that failed
20313  * to close will still return %G_IO_ERROR_CLOSED for all operations.
20314  * Still, it is important to check and report the error to the user,
20315  * otherwise there might be a loss of data as all data might not be written.
20316  *
20317  * If @cancellable is not NULL, then the operation can be cancelled by
20318  * triggering the cancellable object from another thread. If the operation
20319  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
20320  * Cancelling a close will still leave the stream closed, but some streams
20321  * can use a faster close that doesn't block to e.g. check errors.
20322  *
20323  * The default implementation of this method just calls close on the
20324  * individual input/output streams.
20325  *
20326  * Returns: %TRUE on success, %FALSE on failure
20327  * Since: 2.22
20328  */
20329
20330
20331 /**
20332  * g_io_stream_close_async:
20333  * @stream: a #GIOStream
20334  * @io_priority: the io priority of the request
20335  * @cancellable: (allow-none): optional cancellable object
20336  * @callback: (scope async): callback to call when the request is satisfied
20337  * @user_data: (closure): the data to pass to callback function
20338  *
20339  * Requests an asynchronous close of the stream, releasing resources
20340  * related to it. When the operation is finished @callback will be
20341  * called. You can then call g_io_stream_close_finish() to get
20342  * the result of the operation.
20343  *
20344  * For behaviour details see g_io_stream_close().
20345  *
20346  * The asynchronous methods have a default fallback that uses threads
20347  * to implement asynchronicity, so they are optional for inheriting
20348  * classes. However, if you override one you must override all.
20349  *
20350  * Since: 2.22
20351  */
20352
20353
20354 /**
20355  * g_io_stream_close_finish:
20356  * @stream: a #GIOStream
20357  * @result: a #GAsyncResult
20358  * @error: a #GError location to store the error occurring, or %NULL to ignore
20359  *
20360  * Closes a stream.
20361  *
20362  * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
20363  * Since: 2.22
20364  */
20365
20366
20367 /**
20368  * g_io_stream_get_input_stream:
20369  * @stream: a #GIOStream
20370  *
20371  * Gets the input stream for this object. This is used
20372  * for reading.
20373  *
20374  * Returns: (transfer none): a #GInputStream, owned by the #GIOStream. Do not free.
20375  * Since: 2.22
20376  */
20377
20378
20379 /**
20380  * g_io_stream_get_output_stream:
20381  * @stream: a #GIOStream
20382  *
20383  * Gets the output stream for this object. This is used for
20384  * writing.
20385  *
20386  * Returns: (transfer none): a #GOutputStream, owned by the #GIOStream. Do not free.
20387  * Since: 2.22
20388  */
20389
20390
20391 /**
20392  * g_io_stream_has_pending:
20393  * @stream: a #GIOStream
20394  *
20395  * Checks if a stream has pending actions.
20396  *
20397  * Returns: %TRUE if @stream has pending actions.
20398  * Since: 2.22
20399  */
20400
20401
20402 /**
20403  * g_io_stream_is_closed:
20404  * @stream: a #GIOStream
20405  *
20406  * Checks if a stream is closed.
20407  *
20408  * Returns: %TRUE if the stream is closed.
20409  * Since: 2.22
20410  */
20411
20412
20413 /**
20414  * g_io_stream_set_pending:
20415  * @stream: a #GIOStream
20416  * @error: a #GError location to store the error occurring, or %NULL to ignore
20417  *
20418  * Sets @stream to have actions pending. If the pending flag is
20419  * already set or @stream is closed, it will return %FALSE and set
20420  * @error.
20421  *
20422  * Returns: %TRUE if pending was previously unset and is now set.
20423  * Since: 2.22
20424  */
20425
20426
20427 /**
20428  * g_io_stream_splice_async:
20429  * @stream1: a #GIOStream.
20430  * @stream2: a #GIOStream.
20431  * @flags: a set of #GIOStreamSpliceFlags.
20432  * @io_priority: the io priority of the request.
20433  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20434  * @callback: (scope async): a #GAsyncReadyCallback.
20435  * @user_data: (closure): user data passed to @callback.
20436  *
20437  * Asyncronously splice the output stream of @stream1 to the input stream of
20438  * @stream2, and splice the output stream of @stream2 to the input stream of
20439  * @stream1.
20440  *
20441  * When the operation is finished @callback will be called.
20442  * You can then call g_io_stream_splice_finish() to get the
20443  * result of the operation.
20444  *
20445  * Since: 2.28
20446  */
20447
20448
20449 /**
20450  * g_io_stream_splice_finish:
20451  * @result: a #GAsyncResult.
20452  * @error: a #GError location to store the error occurring, or %NULL to ignore.
20453  *
20454  * Finishes an asynchronous io stream splice operation.
20455  *
20456  * Returns: %TRUE on success, %FALSE otherwise.
20457  * Since: 2.28
20458  */
20459
20460
20461 /**
20462  * g_keyfile_settings_backend_new:
20463  * @filename: the filename of the keyfile
20464  * @root_path: the path under which all settings keys appear
20465  * @root_group: (allow-none): the group name corresponding to @root_path, or %NULL
20466  *
20467  * Creates a keyfile-backed #GSettingsBackend.
20468  *
20469  * The filename of the keyfile to use is given by @filename.
20470  *
20471  * All settings read to or written from the backend must fall under the
20472  * path given in @root_path (which must start and end with a slash and
20473  * not contain two consecutive slashes).  @root_path may be "/".
20474  *
20475  * If @root_group is non-%NULL then it specifies the name of the keyfile
20476  * group used for keys that are written directly below @root_path.  For
20477  * example, if @root_path is "/apps/example/" and @root_group is
20478  * "toplevel", then settings the key "/apps/example/enabled" to a value
20479  * of %TRUE will cause the following to appear in the keyfile:
20480  *
20481  * |[
20482  *   [toplevel]
20483  *   enabled=true
20484  * ]|
20485  *
20486  * If @root_group is %NULL then it is not permitted to store keys
20487  * directly below the @root_path.
20488  *
20489  * For keys not stored directly below @root_path (ie: in a sub-path),
20490  * the name of the subpath (with the final slash stripped) is used as
20491  * the name of the keyfile group.  To continue the example, if
20492  * "/apps/example/profiles/default/font-size" were set to
20493  * 12 then the following would appear in the keyfile:
20494  *
20495  * |[
20496  *   [profiles/default]
20497  *   font-size=12
20498  * ]|
20499  *
20500  * The backend will refuse writes (and return writability as being
20501  * %FALSE) for keys outside of @root_path and, in the event that
20502  * @root_group is %NULL, also for keys directly under @root_path.
20503  * Writes will also be refused if the backend detects that it has the
20504  * inability to rewrite the keyfile (ie: the containing directory is not
20505  * writable).
20506  *
20507  * There is no checking done for your key namespace clashing with the
20508  * syntax of the key file format.  For example, if you have '[' or ']'
20509  * characters in your path names or '=' in your key names you may be in
20510  * trouble.
20511  *
20512  * Returns: (transfer full): a keyfile-backed #GSettingsBackend
20513  */
20514
20515
20516 /**
20517  * g_loadable_icon_load:
20518  * @icon: a #GLoadableIcon.
20519  * @size: an integer.
20520  * @type: (out) (allow-none): a location to store the type of the loaded icon, %NULL to ignore.
20521  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20522  * @error: a #GError location to store the error occurring, or %NULL to ignore.
20523  *
20524  * Loads a loadable icon. For the asynchronous version of this function,
20525  * see g_loadable_icon_load_async().
20526  *
20527  * Returns: (transfer full): a #GInputStream to read the icon from.
20528  */
20529
20530
20531 /**
20532  * g_loadable_icon_load_async:
20533  * @icon: a #GLoadableIcon.
20534  * @size: an integer.
20535  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
20536  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
20537  * @user_data: (closure): the data to pass to callback function
20538  *
20539  * Loads an icon asynchronously. To finish this function, see
20540  * g_loadable_icon_load_finish(). For the synchronous, blocking
20541  * version of this function, see g_loadable_icon_load().
20542  */
20543
20544
20545 /**
20546  * g_loadable_icon_load_finish:
20547  * @icon: a #GLoadableIcon.
20548  * @res: a #GAsyncResult.
20549  * @type: a location to store the type of the loaded icon, %NULL to ignore.
20550  * @error: a #GError location to store the error occurring, or %NULL to ignore.
20551  *
20552  * Finishes an asynchronous icon load started in g_loadable_icon_load_async().
20553  *
20554  * Returns: (transfer full): a #GInputStream to read the icon from.
20555  */
20556
20557
20558 /**
20559  * g_local_vfs_new:
20560  *
20561  * Returns a new #GVfs handle for a local vfs.
20562  *
20563  * Returns: a new #GVfs handle.
20564  */
20565
20566
20567 /**
20568  * g_memory_input_stream_add_data:
20569  * @stream: a #GMemoryInputStream
20570  * @data: (array length=len) (element-type guint8) (transfer full): input data
20571  * @len: length of the data, may be -1 if @data is a nul-terminated string
20572  * @destroy: (allow-none): function that is called to free @data, or %NULL
20573  *
20574  * Appends @data to data that can be read from the input stream
20575  */
20576
20577
20578 /**
20579  * g_memory_input_stream_new:
20580  *
20581  * Creates a new empty #GMemoryInputStream.
20582  *
20583  * Returns: a new #GInputStream
20584  */
20585
20586
20587 /**
20588  * g_memory_input_stream_new_from_data:
20589  * @data: (array length=len) (element-type guint8) (transfer full): input data
20590  * @len: length of the data, may be -1 if @data is a nul-terminated string
20591  * @destroy: (allow-none): function that is called to free @data, or %NULL
20592  *
20593  * Creates a new #GMemoryInputStream with data in memory of a given size.
20594  *
20595  * Returns: new #GInputStream read from @data of @len bytes.
20596  */
20597
20598
20599 /**
20600  * g_memory_output_stream_get_data:
20601  * @ostream: a #GMemoryOutputStream
20602  *
20603  * Gets any loaded data from the @ostream.
20604  *
20605  * Note that the returned pointer may become invalid on the next
20606  * write or truncate operation on the stream.
20607  *
20608  * Returns: (transfer none): pointer to the stream's data
20609  */
20610
20611
20612 /**
20613  * g_memory_output_stream_get_data_size:
20614  * @ostream: a #GMemoryOutputStream
20615  *
20616  * Returns the number of bytes from the start up
20617  * to including the last byte written in the stream
20618  * that has not been truncated away.
20619  *
20620  * Returns: the number of bytes written to the stream
20621  * Since: 2.18
20622  */
20623
20624
20625 /**
20626  * g_memory_output_stream_get_size:
20627  * @ostream: a #GMemoryOutputStream
20628  *
20629  * Gets the size of the currently allocated data area (available from
20630  * g_memory_output_stream_get_data()). If the stream isn't
20631  * growable (no realloc was passed to g_memory_output_stream_new()) then
20632  * this is the maximum size of the stream and further writes
20633  * will return %G_IO_ERROR_NO_SPACE.
20634  *
20635  * Note that for growable streams the returned size may become invalid on
20636  * the next write or truncate operation on the stream.
20637  *
20638  * If you want the number of bytes currently written to the stream, use
20639  * g_memory_output_stream_get_data_size().
20640  *
20641  * Returns: the number of bytes allocated for the data buffer
20642  */
20643
20644
20645 /**
20646  * g_memory_output_stream_new: (skip)
20647  * @data: (allow-none): pointer to a chunk of memory to use, or %NULL
20648  * @size: the size of @data
20649  * @realloc_function: (allow-none): a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
20650  * @destroy_function: (allow-none): a function to be called on @data when the stream is finalized, or %NULL
20651  *
20652  * Creates a new #GMemoryOutputStream.
20653  *
20654  * If @data is non-%NULL, the stream  will use that for its internal storage.
20655  * If @realloc_fn is non-%NULL, it will be used for resizing the internal
20656  * storage when necessary. To construct a fixed-size output stream,
20657  * pass %NULL as @realloc_fn.
20658  *
20659  * |[
20660  * /&ast; a stream that can grow &ast;/
20661  * stream = g_memory_output_stream_new (NULL, 0, realloc, free);
20662  *
20663  * /&ast; another stream that can grow &ast;/
20664  * stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
20665  *
20666  * /&ast; a fixed-size stream &ast;/
20667  * data = malloc (200);
20668  * stream3 = g_memory_output_stream_new (data, 200, NULL, free);
20669  * ]|
20670  *
20671  * Returns: A newly created #GMemoryOutputStream object.
20672  */
20673
20674
20675 /**
20676  * g_memory_output_stream_steal_data:
20677  * @ostream: a #GMemoryOutputStream
20678  *
20679  * Gets any loaded data from the @ostream. Ownership of the data
20680  * is transferred to the caller; when no longer needed it must be
20681  * freed using the free function set in @ostream's
20682  * #GMemoryOutputStream:destroy-function property.
20683  *
20684  * @ostream must be closed before calling this function.
20685  *
20686  * Returns: (transfer full): the stream's data
20687  * Since: 2.26
20688  */
20689
20690
20691 /**
20692  * g_memory_settings_backend_new:
20693  *
20694  * Creates a memory-backed #GSettingsBackend.
20695  *
20696  * This backend allows changes to settings, but does not write them
20697  * to any backing storage, so the next time you run your application,
20698  * the memory backend will start out with the default values again.
20699  *
20700  * Returns: (transfer full): a newly created #GSettingsBackend
20701  * Since: 2.28
20702  */
20703
20704
20705 /**
20706  * g_menu_append:
20707  * @menu: a #GMenu
20708  * @label: (allow-none): the section label, or %NULL
20709  * @detailed_action: (allow-none): the detailed action string, or %NULL
20710  *
20711  * Convenience function for appending a normal menu item to the end of
20712  * @menu.  Combine g_menu_new() and g_menu_insert_item() for a more
20713  * flexible alternative.
20714  *
20715  * Since: 2.32
20716  */
20717
20718
20719 /**
20720  * g_menu_append_item:
20721  * @menu: a #GMenu
20722  * @item: a #GMenuItem to append
20723  *
20724  * Appends @item to the end of @menu.
20725  *
20726  * See g_menu_insert_item() for more information.
20727  *
20728  * Since: 2.32
20729  */
20730
20731
20732 /**
20733  * g_menu_append_section:
20734  * @menu: a #GMenu
20735  * @label: (allow-none): the section label, or %NULL
20736  * @section: a #GMenuModel with the items of the section
20737  *
20738  * Convenience function for appending a section menu item to the end of
20739  * @menu.  Combine g_menu_item_new_section() and g_menu_insert_item() for a
20740  * more flexible alternative.
20741  *
20742  * Since: 2.32
20743  */
20744
20745
20746 /**
20747  * g_menu_append_submenu:
20748  * @menu: a #GMenu
20749  * @label: (allow-none): the section label, or %NULL
20750  * @submenu: a #GMenuModel with the items of the submenu
20751  *
20752  * Convenience function for appending a submenu menu item to the end of
20753  * @menu.  Combine g_menu_item_new_submenu() and g_menu_insert_item() for a
20754  * more flexible alternative.
20755  *
20756  * Since: 2.32
20757  */
20758
20759
20760 /**
20761  * g_menu_attribute_iter_get_name:
20762  * @iter: a #GMenuAttributeIter
20763  *
20764  * Gets the name of the attribute at the current iterator position, as
20765  * a string.
20766  *
20767  * The iterator is not advanced.
20768  *
20769  * Returns: the name of the attribute
20770  * Since: 2.32
20771  */
20772
20773
20774 /**
20775  * g_menu_attribute_iter_get_next:
20776  * @iter: a #GMenuAttributeIter
20777  * @out_name: (out) (allow-none) (transfer none): the type of the attribute
20778  * @value: (out) (allow-none) (transfer full): the attribute value
20779  *
20780  * This function combines g_menu_attribute_iter_next() with
20781  * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().
20782  *
20783  * First the iterator is advanced to the next (possibly first) attribute.
20784  * If that fails, then %FALSE is returned and there are no other
20785  * effects.
20786  *
20787  * If successful, @name and @value are set to the name and value of the
20788  * attribute that has just been advanced to.  At this point,
20789  * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will
20790  * return the same values again.
20791  *
20792  * The value returned in @name remains valid for as long as the iterator
20793  * remains at the current position.  The value returned in @value must
20794  * be unreffed using g_variant_unref() when it is no longer in use.
20795  *
20796  * Returns: %TRUE on success, or %FALSE if there is no additional attribute
20797  * Since: 2.32
20798  */
20799
20800
20801 /**
20802  * g_menu_attribute_iter_get_value:
20803  * @iter: a #GMenuAttributeIter
20804  *
20805  * Gets the value of the attribute at the current iterator position.
20806  *
20807  * The iterator is not advanced.
20808  *
20809  * Returns: (transfer full): the value of the current attribute
20810  * Since: 2.32
20811  */
20812
20813
20814 /**
20815  * g_menu_attribute_iter_next:
20816  * @iter: a #GMenuAttributeIter
20817  *
20818  * Attempts to advance the iterator to the next (possibly first)
20819  * attribute.
20820  *
20821  * %TRUE is returned on success, or %FALSE if there are no more
20822  * attributes.
20823  *
20824  * You must call this function when you first acquire the iterator
20825  * to advance it to the first attribute (and determine if the first
20826  * attribute exists at all).
20827  *
20828  * Returns: %TRUE on success, or %FALSE when there are no more attributes
20829  * Since: 2.32
20830  */
20831
20832
20833 /**
20834  * g_menu_freeze:
20835  * @menu: a #GMenu
20836  *
20837  * Marks @menu as frozen.
20838  *
20839  * After the menu is frozen, it is an error to attempt to make any
20840  * changes to it.  In effect this means that the #GMenu API must no
20841  * longer be used.
20842  *
20843  * This function causes g_menu_model_is_mutable() to begin returning
20844  * %FALSE, which has some positive performance implications.
20845  *
20846  * Since: 2.32
20847  */
20848
20849
20850 /**
20851  * g_menu_insert:
20852  * @menu: a #GMenu
20853  * @position: the position at which to insert the item
20854  * @label: (allow-none): the section label, or %NULL
20855  * @detailed_action: (allow-none): the detailed action string, or %NULL
20856  *
20857  * Convenience function for inserting a normal menu item into @menu.
20858  * Combine g_menu_new() and g_menu_insert_item() for a more flexible
20859  * alternative.
20860  *
20861  * Since: 2.32
20862  */
20863
20864
20865 /**
20866  * g_menu_insert_item:
20867  * @menu: a #GMenu
20868  * @position: the position at which to insert the item
20869  * @item: the #GMenuItem to insert
20870  *
20871  * Inserts @item into @menu.
20872  *
20873  * The "insertion" is actually done by copying all of the attribute and
20874  * link values of @item and using them to form a new item within @menu.
20875  * As such, @item itself is not really inserted, but rather, a menu item
20876  * that is exactly the same as the one presently described by @item.
20877  *
20878  * This means that @item is essentially useless after the insertion
20879  * occurs.  Any changes you make to it are ignored unless it is inserted
20880  * again (at which point its updated values will be copied).
20881  *
20882  * You should probably just free @item once you're done.
20883  *
20884  * There are many convenience functions to take care of common cases.
20885  * See g_menu_insert(), g_menu_insert_section() and
20886  * g_menu_insert_submenu() as well as "prepend" and "append" variants of
20887  * each of these functions.
20888  *
20889  * Since: 2.32
20890  */
20891
20892
20893 /**
20894  * g_menu_insert_section:
20895  * @menu: a #GMenu
20896  * @position: the position at which to insert the item
20897  * @label: (allow-none): the section label, or %NULL
20898  * @section: a #GMenuModel with the items of the section
20899  *
20900  * Convenience function for inserting a section menu item into @menu.
20901  * Combine g_menu_item_new_section() and g_menu_insert_item() for a more
20902  * flexible alternative.
20903  *
20904  * Since: 2.32
20905  */
20906
20907
20908 /**
20909  * g_menu_insert_submenu:
20910  * @menu: a #GMenu
20911  * @position: the position at which to insert the item
20912  * @label: (allow-none): the section label, or %NULL
20913  * @submenu: a #GMenuModel with the items of the submenu
20914  *
20915  * Convenience function for inserting a submenu menu item into @menu.
20916  * Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more
20917  * flexible alternative.
20918  *
20919  * Since: 2.32
20920  */
20921
20922
20923 /**
20924  * g_menu_item_new:
20925  * @label: (allow-none): the section label, or %NULL
20926  * @detailed_action: (allow-none): the detailed action string, or %NULL
20927  *
20928  * Creates a new #GMenuItem.
20929  *
20930  * If @label is non-%NULL it is used to set the "label" attribute of the
20931  * new item.
20932  *
20933  * If @detailed_action is non-%NULL it is used to set the "action" and
20934  * possibly the "target" attribute of the new item.  See
20935  * g_menu_item_set_detailed_action() for more information.
20936  *
20937  * Returns: a new #GMenuItem
20938  * Since: 2.32
20939  */
20940
20941
20942 /**
20943  * g_menu_item_new_section:
20944  * @label: (allow-none): the section label, or %NULL
20945  * @section: a #GMenuModel with the items of the section
20946  *
20947  * Creates a new #GMenuItem representing a section.
20948  *
20949  * This is a convenience API around g_menu_item_new() and
20950  * g_menu_item_set_section().
20951  *
20952  * The effect of having one menu appear as a section of another is
20953  * exactly as it sounds: the items from @section become a direct part of
20954  * the menu that @menu_item is added to.
20955  *
20956  * Visual separation is typically displayed between two non-empty
20957  * sections.  If @label is non-%NULL then it will be encorporated into
20958  * this visual indication.  This allows for labeled subsections of a
20959  * menu.
20960  *
20961  * As a simple example, consider a typical "Edit" menu from a simple
20962  * program.  It probably contains an "Undo" and "Redo" item, followed by
20963  * a separator, followed by "Cut", "Copy" and "Paste".
20964  *
20965  * This would be accomplished by creating three #GMenu instances.  The
20966  * first would be populated with the "Undo" and "Redo" items, and the
20967  * second with the "Cut", "Copy" and "Paste" items.  The first and
20968  * second menus would then be added as submenus of the third.  In XML
20969  * format, this would look something like the following:
20970  *
20971  * <informalexample><programlisting><![CDATA[
20972  * <menu id='edit-menu'>
20973  *   <section>
20974  *     <item label='Undo'/>
20975  *     <item label='Redo'/>
20976  *   </section>
20977  *   <section>
20978  *     <item label='Cut'/>
20979  *     <item label='Copy'/>
20980  *     <item label='Paste'/>
20981  *   </section>
20982  * </menu>
20983  * ]]></programlisting></informalexample>
20984  *
20985  * The following example is exactly equivalent.  It is more illustrative
20986  * of the exact relationship between the menus and items (keeping in
20987  * mind that the 'link' element defines a new menu that is linked to the
20988  * containing one).  The style of the second example is more verbose and
20989  * difficult to read (and therefore not recommended except for the
20990  * purpose of understanding what is really going on).
20991  *
20992  * <informalexample><programlisting><![CDATA[
20993  * <menu id='edit-menu'>
20994  *   <item>
20995  *     <link name='section'>
20996  *       <item label='Undo'/>
20997  *       <item label='Redo'/>
20998  *     </link>
20999  *   </item>
21000  *   <item>
21001  *     <link name='section'>
21002  *       <item label='Cut'/>
21003  *       <item label='Copy'/>
21004  *       <item label='Paste'/>
21005  *     </link>
21006  *   </item>
21007  * </menu>
21008  * ]]></programlisting></informalexample>
21009  *
21010  * Returns: a new #GMenuItem
21011  * Since: 2.32
21012  */
21013
21014
21015 /**
21016  * g_menu_item_new_submenu:
21017  * @label: (allow-none): the section label, or %NULL
21018  * @submenu: a #GMenuModel with the items of the submenu
21019  *
21020  * Creates a new #GMenuItem representing a submenu.
21021  *
21022  * This is a convenience API around g_menu_item_new() and
21023  * g_menu_item_set_submenu().
21024  *
21025  * Returns: a new #GMenuItem
21026  * Since: 2.32
21027  */
21028
21029
21030 /**
21031  * g_menu_item_set_action_and_target:
21032  * @menu_item: a #GMenuItem
21033  * @action: (allow-none): the name of the action for this item
21034  * @format_string: (allow-none): a GVariant format string
21035  * @...: positional parameters, as per @format_string
21036  *
21037  * Sets or unsets the "action" and "target" attributes of @menu_item.
21038  *
21039  * If @action is %NULL then both the "action" and "target" attributes
21040  * are unset (and @format_string is ignored along with the positional
21041  * parameters).
21042  *
21043  * If @action is non-%NULL then the "action" attribute is set.
21044  * @format_string is then inspected.  If it is non-%NULL then the proper
21045  * position parameters are collected to create a #GVariant instance to
21046  * use as the target value.  If it is %NULL then the positional
21047  * parameters are ignored and the "target" attribute is unset.
21048  *
21049  * See also g_menu_item_set_action_and_target_value() for an equivalent
21050  * call that directly accepts a #GVariant.  See
21051  * g_menu_item_set_detailed_action() for a more convenient version that
21052  * works with string-typed targets.
21053  *
21054  * See also g_menu_item_set_action_and_target_value() for a
21055  * description of the semantics of the action and target attributes.
21056  *
21057  * Since: 2.32
21058  */
21059
21060
21061 /**
21062  * g_menu_item_set_action_and_target_value:
21063  * @menu_item: a #GMenuItem
21064  * @action: (allow-none): the name of the action for this item
21065  * @target_value: (allow-none): a #GVariant to use as the action target
21066  *
21067  * Sets or unsets the "action" and "target" attributes of @menu_item.
21068  *
21069  * If @action is %NULL then both the "action" and "target" attributes
21070  * are unset (and @target_value is ignored).
21071  *
21072  * If @action is non-%NULL then the "action" attribute is set.  The
21073  * "target" attribute is then set to the value of @target_value if it is
21074  * non-%NULL or unset otherwise.
21075  *
21076  * Normal menu items (ie: not submenu, section or other custom item
21077  * types) are expected to have the "action" attribute set to identify
21078  * the action that they are associated with.  The state type of the
21079  * action help to determine the disposition of the menu item.  See
21080  * #GAction and #GActionGroup for an overview of actions.
21081  *
21082  * In general, clicking on the menu item will result in activation of
21083  * the named action with the "target" attribute given as the parameter
21084  * to the action invocation.  If the "target" attribute is not set then
21085  * the action is invoked with no parameter.
21086  *
21087  * If the action has no state then the menu item is usually drawn as a
21088  * plain menu item (ie: with no additional decoration).
21089  *
21090  * If the action has a boolean state then the menu item is usually drawn
21091  * as a toggle menu item (ie: with a checkmark or equivalent
21092  * indication).  The item should be marked as 'toggled' or 'checked'
21093  * when the boolean state is %TRUE.
21094  *
21095  * If the action has a string state then the menu item is usually drawn
21096  * as a radio menu item (ie: with a radio bullet or equivalent
21097  * indication).  The item should be marked as 'selected' when the string
21098  * state is equal to the value of the @target property.
21099  *
21100  * See g_menu_item_set_action_and_target() or
21101  * g_menu_item_set_detailed_action() for two equivalent calls that are
21102  * probably more convenient for most uses.
21103  *
21104  * Since: 2.32
21105  */
21106
21107
21108 /**
21109  * g_menu_item_set_attribute:
21110  * @menu_item: a #GMenuItem
21111  * @attribute: the attribute to set
21112  * @format_string: (allow-none): a #GVariant format string, or %NULL
21113  * @...: positional parameters, as per @format_string
21114  *
21115  * Sets or unsets an attribute on @menu_item.
21116  *
21117  * The attribute to set or unset is specified by @attribute. This
21118  * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
21119  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
21120  * attribute name.
21121  * Attribute names are restricted to lowercase characters, numbers
21122  * and '-'. Furthermore, the names must begin with a lowercase character,
21123  * must not end with a '-', and must not contain consecutive dashes.
21124  *
21125  * If @format_string is non-%NULL then the proper position parameters
21126  * are collected to create a #GVariant instance to use as the attribute
21127  * value.  If it is %NULL then the positional parameterrs are ignored
21128  * and the named attribute is unset.
21129  *
21130  * See also g_menu_item_set_attribute_value() for an equivalent call
21131  * that directly accepts a #GVariant.
21132  *
21133  * Since: 2.32
21134  */
21135
21136
21137 /**
21138  * g_menu_item_set_attribute_value:
21139  * @menu_item: a #GMenuItem
21140  * @attribute: the attribute to set
21141  * @value: (allow-none): a #GVariant to use as the value, or %NULL
21142  *
21143  * Sets or unsets an attribute on @menu_item.
21144  *
21145  * The attribute to set or unset is specified by @attribute. This
21146  * can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
21147  * %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
21148  * attribute name.
21149  * Attribute names are restricted to lowercase characters, numbers
21150  * and '-'. Furthermore, the names must begin with a lowercase character,
21151  * must not end with a '-', and must not contain consecutive dashes.
21152  *
21153  * must consist only of lowercase
21154  * ASCII characters, digits and '-'.
21155  *
21156  * If @value is non-%NULL then it is used as the new value for the
21157  * attribute.  If @value is %NULL then the attribute is unset. If
21158  * the @value #GVariant is floating, it is consumed.
21159  *
21160  * See also g_menu_item_set_attribute() for a more convenient way to do
21161  * the same.
21162  *
21163  * Since: 2.32
21164  */
21165
21166
21167 /**
21168  * g_menu_item_set_detailed_action:
21169  * @menu_item: a #GMenuItem
21170  * @detailed_action: the "detailed" action string
21171  *
21172  * Sets the "action" and possibly the "target" attribute of @menu_item.
21173  *
21174  * If @detailed_action contains a double colon ("::") then it is used as
21175  * a separator between an action name and a target string.  In this
21176  * case, this call is equivalent to calling
21177  * g_menu_item_set_action_and_target() with the part before the "::" and
21178  * with a string-type #GVariant containing the part following the "::".
21179  *
21180  * If @detailed_action doesn't contain "::" then the action is set to
21181  * the given string (verbatim) and the target value is unset.
21182  *
21183  * See g_menu_item_set_action_and_target() or
21184  * g_menu_item_set_action_and_target_value() for more flexible (but
21185  * slightly less convenient) alternatives.
21186  *
21187  * See also g_menu_item_set_action_and_target_value() for a description of
21188  * the semantics of the action and target attributes.
21189  *
21190  * Since: 2.32
21191  */
21192
21193
21194 /**
21195  * g_menu_item_set_label:
21196  * @menu_item: a #GMenuItem
21197  * @label: (allow-none): the label to set, or %NULL to unset
21198  *
21199  * Sets or unsets the "label" attribute of @menu_item.
21200  *
21201  * If @label is non-%NULL it is used as the label for the menu item.  If
21202  * it is %NULL then the label attribute is unset.
21203  *
21204  * Since: 2.32
21205  */
21206
21207
21208 /**
21209  * g_menu_item_set_link:
21210  * @menu_item: a #GMenuItem
21211  * @link: type of link to establish or unset
21212  * @model: (allow-none): the #GMenuModel to link to (or %NULL to unset)
21213  *
21214  * Creates a link from @menu_item to @model if non-%NULL, or unsets it.
21215  *
21216  * Links are used to establish a relationship between a particular menu
21217  * item and another menu.  For example, %G_MENU_LINK_SUBMENU is used to
21218  * associate a submenu with a particular menu item, and %G_MENU_LINK_SECTION
21219  * is used to create a section. Other types of link can be used, but there
21220  * is no guarantee that clients will be able to make sense of them.
21221  * Link types are restricted to lowercase characters, numbers
21222  * and '-'. Furthermore, the names must begin with a lowercase character,
21223  * must not end with a '-', and must not contain consecutive dashes.
21224  *
21225  * Since: 2.32
21226  */
21227
21228
21229 /**
21230  * g_menu_item_set_section:
21231  * @menu_item: a #GMenuItem
21232  * @section: (allow-none): a #GMenuModel, or %NULL
21233  *
21234  * Sets or unsets the "section" link of @menu_item to @section.
21235  *
21236  * The effect of having one menu appear as a section of another is
21237  * exactly as it sounds: the items from @section become a direct part of
21238  * the menu that @menu_item is added to.  See g_menu_item_new_section()
21239  * for more information about what it means for a menu item to be a
21240  * section.
21241  *
21242  * Since: 2.32
21243  */
21244
21245
21246 /**
21247  * g_menu_item_set_submenu:
21248  * @menu_item: a #GMenuItem
21249  * @submenu: (allow-none): a #GMenuModel, or %NULL
21250  *
21251  * Sets or unsets the "submenu" link of @menu_item to @submenu.
21252  *
21253  * If @submenu is non-%NULL, it is linked to.  If it is %NULL then the
21254  * link is unset.
21255  *
21256  * The effect of having one menu appear as a submenu of another is
21257  * exactly as it sounds.
21258  *
21259  * Since: 2.32
21260  */
21261
21262
21263 /**
21264  * g_menu_link_iter_get_name:
21265  * @iter: a #GMenuLinkIter
21266  *
21267  * Gets the name of the link at the current iterator position.
21268  *
21269  * The iterator is not advanced.
21270  *
21271  * Returns: the type of the link
21272  * Since: 2.32
21273  */
21274
21275
21276 /**
21277  * g_menu_link_iter_get_next:
21278  * @iter: a #GMenuLinkIter
21279  * @out_link: (out) (allow-none) (transfer none): the name of the link
21280  * @value: (out) (allow-none) (transfer full): the linked #GMenuModel
21281  *
21282  * This function combines g_menu_link_iter_next() with
21283  * g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
21284  *
21285  * First the iterator is advanced to the next (possibly first) link.
21286  * If that fails, then %FALSE is returned and there are no other effects.
21287  *
21288  * If successful, @out_link and @value are set to the name and #GMenuModel
21289  * of the link that has just been advanced to.  At this point,
21290  * g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the
21291  * same values again.
21292  *
21293  * The value returned in @out_link remains valid for as long as the iterator
21294  * remains at the current position.  The value returned in @value must
21295  * be unreffed using g_object_unref() when it is no longer in use.
21296  *
21297  * Returns: %TRUE on success, or %FALSE if there is no additional link
21298  * Since: 2.32
21299  */
21300
21301
21302 /**
21303  * g_menu_link_iter_get_value:
21304  * @iter: a #GMenuLinkIter
21305  *
21306  * Gets the linked #GMenuModel at the current iterator position.
21307  *
21308  * The iterator is not advanced.
21309  *
21310  * Returns: (transfer full): the #GMenuModel that is linked to
21311  * Since: 2.32
21312  */
21313
21314
21315 /**
21316  * g_menu_link_iter_next:
21317  * @iter: a #GMenuLinkIter
21318  *
21319  * Attempts to advance the iterator to the next (possibly first)
21320  * link.
21321  *
21322  * %TRUE is returned on success, or %FALSE if there are no more links.
21323  *
21324  * You must call this function when you first acquire the iterator to
21325  * advance it to the first link (and determine if the first link exists
21326  * at all).
21327  *
21328  * Returns: %TRUE on success, or %FALSE when there are no more links
21329  * Since: 2.32
21330  */
21331
21332
21333 /**
21334  * g_menu_model_get_item_attribute:
21335  * @model: a #GMenuModel
21336  * @item_index: the index of the item
21337  * @attribute: the attribute to query
21338  * @format_string: a #GVariant format string
21339  * @...: positional parameters, as per @format_string
21340  *
21341  * Queries item at position @item_index in @model for the attribute
21342  * specified by @attribute.
21343  *
21344  * If the attribute exists and matches the #GVariantType corresponding
21345  * to @format_string then @format_string is used to deconstruct the
21346  * value into the positional parameters and %TRUE is returned.
21347  *
21348  * If the attribute does not exist, or it does exist but has the wrong
21349  * type, then the positional parameters are ignored and %FALSE is
21350  * returned.
21351  *
21352  * Returns: %TRUE if the named attribute was found with the expected type
21353  * Since: 2.32
21354  */
21355
21356
21357 /**
21358  * g_menu_model_get_item_attribute_value:
21359  * @model: a #GMenuModel
21360  * @item_index: the index of the item
21361  * @attribute: the attribute to query
21362  * @expected_type: (allow-none): the expected type of the attribute, or %NULL
21363  *
21364  * Queries the item at position @item_index in @model for the attribute
21365  * specified by @attribute.
21366  *
21367  * If @expected_type is non-%NULL then it specifies the expected type of
21368  * the attribute.  If it is %NULL then any type will be accepted.
21369  *
21370  * If the attribute exists and matches @expected_type (or if the
21371  * expected type is unspecified) then the value is returned.
21372  *
21373  * If the attribute does not exist, or does not match the expected type
21374  * then %NULL is returned.
21375  *
21376  * Returns: (transfer full): the value of the attribute
21377  * Since: 2.32
21378  */
21379
21380
21381 /**
21382  * g_menu_model_get_item_link:
21383  * @model: a #GMenuModel
21384  * @item_index: the index of the item
21385  * @link: the link to query
21386  *
21387  * Queries the item at position @item_index in @model for the link
21388  * specified by @link.
21389  *
21390  * If the link exists, the linked #GMenuModel is returned.  If the link
21391  * does not exist, %NULL is returned.
21392  *
21393  * Returns: (transfer full): the linked #GMenuModel, or %NULL
21394  * Since: 2.32
21395  */
21396
21397
21398 /**
21399  * g_menu_model_get_n_items:
21400  * @model: a #GMenuModel
21401  *
21402  * Query the number of items in @model.
21403  *
21404  * Returns: the number of items
21405  * Since: 2.32
21406  */
21407
21408
21409 /**
21410  * g_menu_model_is_mutable:
21411  * @model: a #GMenuModel
21412  *
21413  * Queries if @model is mutable.
21414  *
21415  * An immutable #GMenuModel will never emit the #GMenuModel::items-changed
21416  * signal. Consumers of the model may make optimisations accordingly.
21417  *
21418  * Returns: %TRUE if the model is mutable (ie: "items-changed" may be emitted).
21419  * Since: 2.32
21420  */
21421
21422
21423 /**
21424  * g_menu_model_items_changed:
21425  * @model: a #GMenuModel
21426  * @position: the position of the change
21427  * @removed: the number of items removed
21428  * @added: the number of items added
21429  *
21430  * Requests emission of the #GMenuModel::items-changed signal on @model.
21431  *
21432  * This function should never be called except by #GMenuModel
21433  * subclasses.  Any other calls to this function will very likely lead
21434  * to a violation of the interface of the model.
21435  *
21436  * The implementation should update its internal representation of the
21437  * menu before emitting the signal.  The implementation should further
21438  * expect to receive queries about the new state of the menu (and
21439  * particularly added menu items) while signal handlers are running.
21440  *
21441  * The implementation must dispatch this call directly from a mainloop
21442  * entry and not in response to calls -- particularly those from the
21443  * #GMenuModel API.  Said another way: the menu must not change while
21444  * user code is running without returning to the mainloop.
21445  *
21446  * Since: 2.32
21447  */
21448
21449
21450 /**
21451  * g_menu_model_iterate_item_attributes:
21452  * @model: a #GMenuModel
21453  * @item_index: the index of the item
21454  *
21455  * Creates a #GMenuAttributeIter to iterate over the attributes of
21456  * the item at position @item_index in @model.
21457  *
21458  * You must free the iterator with g_object_unref() when you are done.
21459  *
21460  * Returns: (transfer full): a new #GMenuAttributeIter
21461  * Since: 2.32
21462  */
21463
21464
21465 /**
21466  * g_menu_model_iterate_item_links:
21467  * @model: a #GMenuModel
21468  * @item_index: the index of the item
21469  *
21470  * Creates a #GMenuLinkIter to iterate over the links of the item at
21471  * position @item_index in @model.
21472  *
21473  * You must free the iterator with g_object_unref() when you are done.
21474  *
21475  * Returns: (transfer full): a new #GMenuLinkIter
21476  * Since: 2.32
21477  */
21478
21479
21480 /**
21481  * g_menu_new:
21482  *
21483  * Creates a new #GMenu.
21484  *
21485  * The new menu has no items.
21486  *
21487  * Returns: a new #GMenu
21488  * Since: 2.32
21489  */
21490
21491
21492 /**
21493  * g_menu_prepend:
21494  * @menu: a #GMenu
21495  * @label: (allow-none): the section label, or %NULL
21496  * @detailed_action: (allow-none): the detailed action string, or %NULL
21497  *
21498  * Convenience function for prepending a normal menu item to the start
21499  * of @menu.  Combine g_menu_new() and g_menu_insert_item() for a more
21500  * flexible alternative.
21501  *
21502  * Since: 2.32
21503  */
21504
21505
21506 /**
21507  * g_menu_prepend_item:
21508  * @menu: a #GMenu
21509  * @item: a #GMenuItem to prepend
21510  *
21511  * Prepends @item to the start of @menu.
21512  *
21513  * See g_menu_insert_item() for more information.
21514  *
21515  * Since: 2.32
21516  */
21517
21518
21519 /**
21520  * g_menu_prepend_section:
21521  * @menu: a #GMenu
21522  * @label: (allow-none): the section label, or %NULL
21523  * @section: a #GMenuModel with the items of the section
21524  *
21525  * Convenience function for prepending a section menu item to the start
21526  * of @menu.  Combine g_menu_item_new_section() and g_menu_insert_item() for
21527  * a more flexible alternative.
21528  *
21529  * Since: 2.32
21530  */
21531
21532
21533 /**
21534  * g_menu_prepend_submenu:
21535  * @menu: a #GMenu
21536  * @label: (allow-none): the section label, or %NULL
21537  * @submenu: a #GMenuModel with the items of the submenu
21538  *
21539  * Convenience function for prepending a submenu menu item to the start
21540  * of @menu.  Combine g_menu_item_new_submenu() and g_menu_insert_item() for
21541  * a more flexible alternative.
21542  *
21543  * Since: 2.32
21544  */
21545
21546
21547 /**
21548  * g_menu_remove:
21549  * @menu: a #GMenu
21550  * @position: the position of the item to remove
21551  *
21552  * Removes an item from the menu.
21553  *
21554  * @position gives the index of the item to remove.
21555  *
21556  * It is an error if position is not in range the range from 0 to one
21557  * less than the number of items in the menu.
21558  *
21559  * It is not possible to remove items by identity since items are added
21560  * to the menu simply by copying their links and attributes (ie:
21561  * identity of the item itself is not preserved).
21562  *
21563  * Since: 2.32
21564  */
21565
21566
21567 /**
21568  * g_mount_can_eject:
21569  * @mount: a #GMount.
21570  *
21571  * Checks if @mount can be eject.
21572  *
21573  * Returns: %TRUE if the @mount can be ejected.
21574  */
21575
21576
21577 /**
21578  * g_mount_can_unmount:
21579  * @mount: a #GMount.
21580  *
21581  * Checks if @mount can be mounted.
21582  *
21583  * Returns: %TRUE if the @mount can be unmounted.
21584  */
21585
21586
21587 /**
21588  * g_mount_eject:
21589  * @mount: a #GMount.
21590  * @flags: flags affecting the unmount if required for eject
21591  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21592  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
21593  * @user_data: user data passed to @callback.
21594  *
21595  * Ejects a mount. This is an asynchronous operation, and is
21596  * finished by calling g_mount_eject_finish() with the @mount
21597  * and #GAsyncResult data returned in the @callback.
21598  *
21599  * Deprecated: 2.22: Use g_mount_eject_with_operation() instead.
21600  */
21601
21602
21603 /**
21604  * g_mount_eject_finish:
21605  * @mount: a #GMount.
21606  * @result: a #GAsyncResult.
21607  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21608  *
21609  * Finishes ejecting a mount. If any errors occurred during the operation,
21610  * @error will be set to contain the errors and %FALSE will be returned.
21611  *
21612  * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
21613  * Deprecated: 2.22: Use g_mount_eject_with_operation_finish() instead.
21614  */
21615
21616
21617 /**
21618  * g_mount_eject_with_operation:
21619  * @mount: a #GMount.
21620  * @flags: flags affecting the unmount if required for eject
21621  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
21622  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21623  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
21624  * @user_data: user data passed to @callback.
21625  *
21626  * Ejects a mount. This is an asynchronous operation, and is
21627  * finished by calling g_mount_eject_with_operation_finish() with the @mount
21628  * and #GAsyncResult data returned in the @callback.
21629  *
21630  * Since: 2.22
21631  */
21632
21633
21634 /**
21635  * g_mount_eject_with_operation_finish:
21636  * @mount: a #GMount.
21637  * @result: a #GAsyncResult.
21638  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21639  *
21640  * Finishes ejecting a mount. If any errors occurred during the operation,
21641  * @error will be set to contain the errors and %FALSE will be returned.
21642  *
21643  * Returns: %TRUE if the mount was successfully ejected. %FALSE otherwise.
21644  * Since: 2.22
21645  */
21646
21647
21648 /**
21649  * g_mount_get_default_location:
21650  * @mount: a #GMount.
21651  *
21652  * Gets the default location of @mount. The default location of the given
21653  * @mount is a path that reflects the main entry point for the user (e.g.
21654  * the home directory, or the root of the volume).
21655  *
21656  * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
21657  */
21658
21659
21660 /**
21661  * g_mount_get_drive:
21662  * @mount: a #GMount.
21663  *
21664  * Gets the drive for the @mount.
21665  *
21666  * This is a convenience method for getting the #GVolume and then
21667  * using that object to get the #GDrive.
21668  *
21669  * 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.
21670  */
21671
21672
21673 /**
21674  * g_mount_get_icon:
21675  * @mount: a #GMount.
21676  *
21677  * Gets the icon for @mount.
21678  *
21679  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
21680  */
21681
21682
21683 /**
21684  * g_mount_get_name:
21685  * @mount: a #GMount.
21686  *
21687  * Gets the name of @mount.
21688  *
21689  * Returns: the name for the given @mount. The returned string should be freed with g_free() when no longer needed.
21690  */
21691
21692
21693 /**
21694  * g_mount_get_root:
21695  * @mount: a #GMount.
21696  *
21697  * Gets the root directory on @mount.
21698  *
21699  * Returns: (transfer full): a #GFile. The returned object should be unreffed with g_object_unref() when no longer needed.
21700  */
21701
21702
21703 /**
21704  * g_mount_get_sort_key:
21705  * @mount: A #GMount.
21706  *
21707  * Gets the sort key for @mount, if any.
21708  *
21709  * Returns: Sorting key for @mount or %NULL if no such key is available.
21710  * Since: 2.32
21711  */
21712
21713
21714 /**
21715  * g_mount_get_uuid:
21716  * @mount: a #GMount.
21717  *
21718  * Gets the UUID for the @mount. The reference is typically based on
21719  * the file system UUID for the mount in question and should be
21720  * considered an opaque string. Returns %NULL if there is no UUID
21721  * available.
21722  *
21723  * 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.
21724  */
21725
21726
21727 /**
21728  * g_mount_get_volume:
21729  * @mount: a #GMount.
21730  *
21731  * Gets the volume for the @mount.
21732  *
21733  * 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.
21734  */
21735
21736
21737 /**
21738  * g_mount_guess_content_type:
21739  * @mount: a #GMount
21740  * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
21741  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21742  * @callback: a #GAsyncReadyCallback
21743  * @user_data: user data passed to @callback
21744  *
21745  * Tries to guess the type of content stored on @mount. Returns one or
21746  * more textual identifiers of well-known content types (typically
21747  * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
21748  * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
21749  * specification for more on x-content types.
21750  *
21751  * This is an asynchronous operation (see
21752  * g_mount_guess_content_type_sync() for the synchronous version), and
21753  * is finished by calling g_mount_guess_content_type_finish() with the
21754  * @mount and #GAsyncResult data returned in the @callback.
21755  *
21756  * Since: 2.18
21757  */
21758
21759
21760 /**
21761  * g_mount_guess_content_type_finish:
21762  * @mount: a #GMount
21763  * @result: a #GAsyncResult
21764  * @error: a #GError location to store the error occurring, or %NULL to ignore
21765  *
21766  * Finishes guessing content types of @mount. If any errors occurred
21767  * during the operation, @error will be set to contain the errors and
21768  * %FALSE will be returned. In particular, you may get an
21769  * %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
21770  * guessing.
21771  *
21772  * 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.
21773  * Since: 2.18
21774  */
21775
21776
21777 /**
21778  * g_mount_guess_content_type_sync:
21779  * @mount: a #GMount
21780  * @force_rescan: Whether to force a rescan of the content. Otherwise a cached result will be used if available
21781  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
21782  * @error: a #GError location to store the error occurring, or %NULL to ignore
21783  *
21784  * Tries to guess the type of content stored on @mount. Returns one or
21785  * more textual identifiers of well-known content types (typically
21786  * prefixed with "x-content/"), e.g. x-content/image-dcf for camera
21787  * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
21788  * specification for more on x-content types.
21789  *
21790  * This is an synchronous operation and as such may block doing IO;
21791  * see g_mount_guess_content_type() for the asynchronous version.
21792  *
21793  * 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.
21794  * Since: 2.18
21795  */
21796
21797
21798 /**
21799  * g_mount_is_shadowed:
21800  * @mount: A #GMount.
21801  *
21802  * Determines if @mount is shadowed. Applications or libraries should
21803  * avoid displaying @mount in the user interface if it is shadowed.
21804  *
21805  * A mount is said to be shadowed if there exists one or more user
21806  * visible objects (currently #GMount objects) with a root that is
21807  * inside the root of @mount.
21808  *
21809  * One application of shadow mounts is when exposing a single file
21810  * system that is used to address several logical volumes. In this
21811  * situation, a #GVolumeMonitor implementation would create two
21812  * #GVolume objects (for example, one for the camera functionality of
21813  * the device and one for a SD card reader on the device) with
21814  * activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
21815  * and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
21816  * underlying mount (with root
21817  * <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
21818  * #GVolumeMonitor implementation would create two #GMount objects
21819  * (each with their root matching the corresponding volume activation
21820  * root) that would shadow the original mount.
21821  *
21822  * The proxy monitor in GVfs 2.26 and later, automatically creates and
21823  * manage shadow mounts (and shadows the underlying mount) if the
21824  * activation root on a #GVolume is set.
21825  *
21826  * Returns: %TRUE if @mount is shadowed.
21827  * Since: 2.20
21828  */
21829
21830
21831 /**
21832  * g_mount_operation_get_anonymous:
21833  * @op: a #GMountOperation.
21834  *
21835  * Check to see whether the mount operation is being used
21836  * for an anonymous user.
21837  *
21838  * Returns: %TRUE if mount operation is anonymous.
21839  */
21840
21841
21842 /**
21843  * g_mount_operation_get_choice:
21844  * @op: a #GMountOperation.
21845  *
21846  * Gets a choice from the mount operation.
21847  *
21848  * Returns: an integer containing an index of the user's choice from the choice's list, or %0.
21849  */
21850
21851
21852 /**
21853  * g_mount_operation_get_domain:
21854  * @op: a #GMountOperation.
21855  *
21856  * Gets the domain of the mount operation.
21857  *
21858  * Returns: a string set to the domain.
21859  */
21860
21861
21862 /**
21863  * g_mount_operation_get_password:
21864  * @op: a #GMountOperation.
21865  *
21866  * Gets a password from the mount operation.
21867  *
21868  * Returns: a string containing the password within @op.
21869  */
21870
21871
21872 /**
21873  * g_mount_operation_get_password_save:
21874  * @op: a #GMountOperation.
21875  *
21876  * Gets the state of saving passwords for the mount operation.
21877  *
21878  * Returns: a #GPasswordSave flag.
21879  */
21880
21881
21882 /**
21883  * g_mount_operation_get_username:
21884  * @op: a #GMountOperation.
21885  *
21886  * Get the user name from the mount operation.
21887  *
21888  * Returns: a string containing the user name.
21889  */
21890
21891
21892 /**
21893  * g_mount_operation_new:
21894  *
21895  * Creates a new mount operation.
21896  *
21897  * Returns: a #GMountOperation.
21898  */
21899
21900
21901 /**
21902  * g_mount_operation_reply:
21903  * @op: a #GMountOperation
21904  * @result: a #GMountOperationResult
21905  *
21906  * Emits the #GMountOperation::reply signal.
21907  */
21908
21909
21910 /**
21911  * g_mount_operation_set_anonymous:
21912  * @op: a #GMountOperation.
21913  * @anonymous: boolean value.
21914  *
21915  * Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
21916  */
21917
21918
21919 /**
21920  * g_mount_operation_set_choice:
21921  * @op: a #GMountOperation.
21922  * @choice: an integer.
21923  *
21924  * Sets a default choice for the mount operation.
21925  */
21926
21927
21928 /**
21929  * g_mount_operation_set_domain:
21930  * @op: a #GMountOperation.
21931  * @domain: the domain to set.
21932  *
21933  * Sets the mount operation's domain.
21934  */
21935
21936
21937 /**
21938  * g_mount_operation_set_password:
21939  * @op: a #GMountOperation.
21940  * @password: password to set.
21941  *
21942  * Sets the mount operation's password to @password.
21943  */
21944
21945
21946 /**
21947  * g_mount_operation_set_password_save:
21948  * @op: a #GMountOperation.
21949  * @save: a set of #GPasswordSave flags.
21950  *
21951  * Sets the state of saving passwords for the mount operation.
21952  */
21953
21954
21955 /**
21956  * g_mount_operation_set_username:
21957  * @op: a #GMountOperation.
21958  * @username: input username.
21959  *
21960  * Sets the user name within @op to @username.
21961  */
21962
21963
21964 /**
21965  * g_mount_remount:
21966  * @mount: a #GMount.
21967  * @flags: flags affecting the operation
21968  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
21969  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
21970  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
21971  * @user_data: user data passed to @callback.
21972  *
21973  * Remounts a mount. This is an asynchronous operation, and is
21974  * finished by calling g_mount_remount_finish() with the @mount
21975  * and #GAsyncResults data returned in the @callback.
21976  *
21977  * Remounting is useful when some setting affecting the operation
21978  * of the volume has been changed, as these may need a remount to
21979  * take affect. While this is semantically equivalent with unmounting
21980  * and then remounting not all backends might need to actually be
21981  * unmounted.
21982  */
21983
21984
21985 /**
21986  * g_mount_remount_finish:
21987  * @mount: a #GMount.
21988  * @result: a #GAsyncResult.
21989  * @error: a #GError location to store the error occurring, or %NULL to ignore.
21990  *
21991  * Finishes remounting a mount. If any errors occurred during the operation,
21992  * @error will be set to contain the errors and %FALSE will be returned.
21993  *
21994  * Returns: %TRUE if the mount was successfully remounted. %FALSE otherwise.
21995  */
21996
21997
21998 /**
21999  * g_mount_shadow:
22000  * @mount: A #GMount.
22001  *
22002  * Increments the shadow count on @mount. Usually used by
22003  * #GVolumeMonitor implementations when creating a shadow mount for
22004  * @mount, see g_mount_is_shadowed() for more information. The caller
22005  * will need to emit the #GMount::changed signal on @mount manually.
22006  *
22007  * Since: 2.20
22008  */
22009
22010
22011 /**
22012  * g_mount_unmount:
22013  * @mount: a #GMount.
22014  * @flags: flags affecting the operation
22015  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22016  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
22017  * @user_data: user data passed to @callback.
22018  *
22019  * Unmounts a mount. This is an asynchronous operation, and is
22020  * finished by calling g_mount_unmount_finish() with the @mount
22021  * and #GAsyncResult data returned in the @callback.
22022  *
22023  * Deprecated: 2.22: Use g_mount_unmount_with_operation() instead.
22024  */
22025
22026
22027 /**
22028  * g_mount_unmount_finish:
22029  * @mount: a #GMount.
22030  * @result: a #GAsyncResult.
22031  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22032  *
22033  * Finishes unmounting a mount. If any errors occurred during the operation,
22034  * @error will be set to contain the errors and %FALSE will be returned.
22035  *
22036  * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
22037  * Deprecated: 2.22: Use g_mount_unmount_with_operation_finish() instead.
22038  */
22039
22040
22041 /**
22042  * g_mount_unmount_with_operation:
22043  * @mount: a #GMount.
22044  * @flags: flags affecting the operation
22045  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
22046  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22047  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
22048  * @user_data: user data passed to @callback.
22049  *
22050  * Unmounts a mount. This is an asynchronous operation, and is
22051  * finished by calling g_mount_unmount_with_operation_finish() with the @mount
22052  * and #GAsyncResult data returned in the @callback.
22053  *
22054  * Since: 2.22
22055  */
22056
22057
22058 /**
22059  * g_mount_unmount_with_operation_finish:
22060  * @mount: a #GMount.
22061  * @result: a #GAsyncResult.
22062  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22063  *
22064  * Finishes unmounting a mount. If any errors occurred during the operation,
22065  * @error will be set to contain the errors and %FALSE will be returned.
22066  *
22067  * Returns: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
22068  * Since: 2.22
22069  */
22070
22071
22072 /**
22073  * g_mount_unshadow:
22074  * @mount: A #GMount.
22075  *
22076  * Decrements the shadow count on @mount. Usually used by
22077  * #GVolumeMonitor implementations when destroying a shadow mount for
22078  * @mount, see g_mount_is_shadowed() for more information. The caller
22079  * will need to emit the #GMount::changed signal on @mount manually.
22080  *
22081  * Since: 2.20
22082  */
22083
22084
22085 /**
22086  * g_network_address_get_hostname:
22087  * @addr: a #GNetworkAddress
22088  *
22089  * Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
22090  * depending on what @addr was created with.
22091  *
22092  * Returns: @addr's hostname
22093  * Since: 2.22
22094  */
22095
22096
22097 /**
22098  * g_network_address_get_port:
22099  * @addr: a #GNetworkAddress
22100  *
22101  * Gets @addr's port number
22102  *
22103  * Returns: @addr's port (which may be 0)
22104  * Since: 2.22
22105  */
22106
22107
22108 /**
22109  * g_network_address_get_scheme:
22110  * @addr: a #GNetworkAddress
22111  *
22112  * Gets @addr's scheme
22113  *
22114  * Returns: @addr's scheme (%NULL if not built from URI)
22115  * Since: 2.26
22116  */
22117
22118
22119 /**
22120  * g_network_address_new:
22121  * @hostname: the hostname
22122  * @port: the port
22123  *
22124  * Creates a new #GSocketConnectable for connecting to the given
22125  * @hostname and @port.
22126  *
22127  * Returns: (transfer full) (type GNetworkAddress): the new #GNetworkAddress
22128  * Since: 2.22
22129  */
22130
22131
22132 /**
22133  * g_network_address_parse:
22134  * @host_and_port: the hostname and optionally a port
22135  * @default_port: the default port if not in @host_and_port
22136  * @error: a pointer to a #GError, or %NULL
22137  *
22138  * Creates a new #GSocketConnectable for connecting to the given
22139  * @hostname and @port. May fail and return %NULL in case
22140  * parsing @host_and_port fails.
22141  *
22142  * @host_and_port may be in any of a number of recognised formats; an IPv6
22143  * address, an IPv4 address, or a domain name (in which case a DNS
22144  * lookup is performed). Quoting with [] is supported for all address
22145  * types. A port override may be specified in the usual way with a
22146  * colon.
22147  *
22148  * If no port is specified in @host_and_port then @default_port will be
22149  * used as the port number to connect to.
22150  *
22151  * In general, @host_and_port is expected to be provided by the user
22152  * (allowing them to give the hostname, and a port overide if necessary)
22153  * and @default_port is expected to be provided by the application.
22154  *
22155  * (The port component of @host_and_port can also be specified as a
22156  * service name rather than as a numeric port, but this functionality
22157  * is deprecated, because it depends on the contents of /etc/services,
22158  * which is generally quite sparse on platforms other than Linux.)
22159  *
22160  * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
22161  * Since: 2.22
22162  */
22163
22164
22165 /**
22166  * g_network_address_parse_uri:
22167  * @uri: the hostname and optionally a port
22168  * @default_port: The default port if none is found in the URI
22169  * @error: a pointer to a #GError, or %NULL
22170  *
22171  * Creates a new #GSocketConnectable for connecting to the given
22172  * @uri. May fail and return %NULL in case parsing @uri fails.
22173  *
22174  * Using this rather than g_network_address_new() or
22175  * g_network_address_parse() allows #GSocketClient to determine
22176  * when to use application-specific proxy protocols.
22177  *
22178  * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error
22179  * Since: 2.26
22180  */
22181
22182
22183 /**
22184  * g_network_monitor_base_add_network:
22185  * @monitor: the #GNetworkMonitorBase
22186  * @network: a #GInetAddressMask
22187  *
22188  * Adds @network to @monitor's list of available networks.
22189  *
22190  * Since: 2.32
22191  */
22192
22193
22194 /**
22195  * g_network_monitor_base_remove_network:
22196  * @monitor: the #GNetworkMonitorBase
22197  * @network: a #GInetAddressMask
22198  *
22199  * Removes @network from @monitor's list of available networks.
22200  *
22201  * Since: 2.32
22202  */
22203
22204
22205 /**
22206  * g_network_monitor_base_set_networks:
22207  * @monitor: the #GNetworkMonitorBase
22208  * @networks: (array length=length): an array of #GInetAddressMask
22209  * @length: length of @networks
22210  *
22211  * Drops @monitor's current list of available networks and replaces
22212  * it with @networks.
22213  */
22214
22215
22216 /**
22217  * g_network_monitor_can_reach:
22218  * @monitor: a #GNetworkMonitor
22219  * @connectable: a #GSocketConnectable
22220  * @cancellable: (allow-none): a #GCancellable, or %NULL
22221  * @error: return location for a #GError, or %NULL
22222  *
22223  * Attempts to determine whether or not the host pointed to by
22224  * @connectable can be reached, without actually trying to connect to
22225  * it.
22226  *
22227  * This may return %TRUE even when #GNetworkMonitor:network-available
22228  * is %FALSE, if, for example, @monitor can determine that
22229  * @connectable refers to a host on a local network.
22230  *
22231  * If @monitor believes that an attempt to connect to @connectable
22232  * will succeed, it will return %TRUE. Otherwise, it will return
22233  * %FALSE and set @error to an appropriate error (such as
22234  * %G_IO_ERROR_HOST_UNREACHABLE).
22235  *
22236  * Note that although this does not attempt to connect to
22237  * @connectable, it may still block for a brief period of time (eg,
22238  * trying to do multicast DNS on the local network), so if you do not
22239  * want to block, you should use g_network_monitor_can_reach_async().
22240  *
22241  * Returns: %TRUE if @connectable is reachable, %FALSE if not.
22242  * Since: 2.32
22243  */
22244
22245
22246 /**
22247  * g_network_monitor_can_reach_async:
22248  * @monitor: a #GNetworkMonitor
22249  * @connectable: a #GSocketConnectable
22250  * @cancellable: (allow-none): a #GCancellable, or %NULL
22251  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
22252  * @user_data: (closure): the data to pass to callback function
22253  *
22254  * Asynchronously attempts to determine whether or not the host
22255  * pointed to by @connectable can be reached, without actually
22256  * trying to connect to it.
22257  *
22258  * For more details, see g_network_monitor_can_reach().
22259  *
22260  * When the operation is finished, @callback will be called.
22261  * You can then call g_network_monitor_can_reach_finish()
22262  * to get the result of the operation.
22263  */
22264
22265
22266 /**
22267  * g_network_monitor_can_reach_finish:
22268  * @monitor: a #GNetworkMonitor
22269  * @result: a #GAsyncResult
22270  * @error: return location for errors, or %NULL
22271  *
22272  * Finishes an async network connectivity test.
22273  * See g_network_monitor_can_reach_async().
22274  *
22275  * Returns: %TRUE if network is reachable, %FALSE if not.
22276  */
22277
22278
22279 /**
22280  * g_network_monitor_get_default:
22281  *
22282  * Gets the default #GNetworkMonitor for the system.
22283  *
22284  * Returns: (transfer none): a #GNetworkMonitor
22285  * Since: 2.32
22286  */
22287
22288
22289 /**
22290  * g_network_monitor_get_network_available:
22291  * @monitor: the #GNetworkMonitor
22292  *
22293  * Checks if the network is available. "Available" here means that the
22294  * system has a default route available for at least one of IPv4 or
22295  * IPv6. It does not necessarily imply that the public Internet is
22296  * reachable. See #GNetworkMonitor:network-available for more details.
22297  *
22298  * Returns: whether the network is available
22299  * Since: 2.32
22300  */
22301
22302
22303 /**
22304  * g_network_service_get_domain:
22305  * @srv: a #GNetworkService
22306  *
22307  * Gets the domain that @srv serves. This might be either UTF-8 or
22308  * ASCII-encoded, depending on what @srv was created with.
22309  *
22310  * Returns: @srv's domain name
22311  * Since: 2.22
22312  */
22313
22314
22315 /**
22316  * g_network_service_get_protocol:
22317  * @srv: a #GNetworkService
22318  *
22319  * Gets @srv's protocol name (eg, "tcp").
22320  *
22321  * Returns: @srv's protocol name
22322  * Since: 2.22
22323  */
22324
22325
22326 /**
22327  * g_network_service_get_scheme:
22328  * @srv: a #GNetworkService
22329  *
22330  * Get's the URI scheme used to resolve proxies. By default, the service name
22331  * is used as scheme.
22332  *
22333  * Returns: @srv's scheme name
22334  * Since: 2.26
22335  */
22336
22337
22338 /**
22339  * g_network_service_get_service:
22340  * @srv: a #GNetworkService
22341  *
22342  * Gets @srv's service name (eg, "ldap").
22343  *
22344  * Returns: @srv's service name
22345  * Since: 2.22
22346  */
22347
22348
22349 /**
22350  * g_network_service_new:
22351  * @service: the service type to look up (eg, "ldap")
22352  * @protocol: the networking protocol to use for @service (eg, "tcp")
22353  * @domain: the DNS domain to look up the service in
22354  *
22355  * Creates a new #GNetworkService representing the given @service,
22356  * @protocol, and @domain. This will initially be unresolved; use the
22357  * #GSocketConnectable interface to resolve it.
22358  *
22359  * Returns: (transfer full) (type GNetworkService): a new #GNetworkService
22360  * Since: 2.22
22361  */
22362
22363
22364 /**
22365  * g_network_service_set_scheme:
22366  * @srv: a #GNetworkService
22367  * @scheme: a URI scheme
22368  *
22369  * Set's the URI scheme used to resolve proxies. By default, the service name
22370  * is used as scheme.
22371  *
22372  * Since: 2.26
22373  */
22374
22375
22376 /**
22377  * g_null_settings_backend_new:
22378  *
22379  * Creates a readonly #GSettingsBackend.
22380  *
22381  * This backend does not allow changes to settings, so all settings
22382  * will always have their default values.
22383  *
22384  * Returns: (transfer full): a newly created #GSettingsBackend
22385  * Since: 2.28
22386  */
22387
22388
22389 /**
22390  * g_output_stream_clear_pending:
22391  * @stream: output stream
22392  *
22393  * Clears the pending flag on @stream.
22394  */
22395
22396
22397 /**
22398  * g_output_stream_close:
22399  * @stream: A #GOutputStream.
22400  * @cancellable: (allow-none): optional cancellable object
22401  * @error: location to store the error occurring, or %NULL to ignore
22402  *
22403  * Closes the stream, releasing resources related to it.
22404  *
22405  * Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
22406  * Closing a stream multiple times will not return an error.
22407  *
22408  * Closing a stream will automatically flush any outstanding buffers in the
22409  * stream.
22410  *
22411  * Streams will be automatically closed when the last reference
22412  * is dropped, but you might want to call this function to make sure
22413  * resources are released as early as possible.
22414  *
22415  * Some streams might keep the backing store of the stream (e.g. a file descriptor)
22416  * open after the stream is closed. See the documentation for the individual
22417  * stream for details.
22418  *
22419  * On failure the first error that happened will be reported, but the close
22420  * operation will finish as much as possible. A stream that failed to
22421  * close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
22422  * is important to check and report the error to the user, otherwise
22423  * there might be a loss of data as all data might not be written.
22424  *
22425  * If @cancellable is not %NULL, then the operation can be cancelled by
22426  * triggering the cancellable object from another thread. If the operation
22427  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
22428  * Cancelling a close will still leave the stream closed, but there some streams
22429  * can use a faster close that doesn't block to e.g. check errors. On
22430  * cancellation (as with any error) there is no guarantee that all written
22431  * data will reach the target.
22432  *
22433  * Returns: %TRUE on success, %FALSE on failure
22434  */
22435
22436
22437 /**
22438  * g_output_stream_close_async:
22439  * @stream: A #GOutputStream.
22440  * @io_priority: the io priority of the request.
22441  * @cancellable: (allow-none): optional cancellable object
22442  * @callback: (scope async): callback to call when the request is satisfied
22443  * @user_data: (closure): the data to pass to callback function
22444  *
22445  * Requests an asynchronous close of the stream, releasing resources
22446  * related to it. When the operation is finished @callback will be
22447  * called. You can then call g_output_stream_close_finish() to get
22448  * the result of the operation.
22449  *
22450  * For behaviour details see g_output_stream_close().
22451  *
22452  * The asyncronous methods have a default fallback that uses threads
22453  * to implement asynchronicity, so they are optional for inheriting
22454  * classes. However, if you override one you must override all.
22455  */
22456
22457
22458 /**
22459  * g_output_stream_close_finish:
22460  * @stream: a #GOutputStream.
22461  * @result: a #GAsyncResult.
22462  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22463  *
22464  * Closes an output stream.
22465  *
22466  * Returns: %TRUE if stream was successfully closed, %FALSE otherwise.
22467  */
22468
22469
22470 /**
22471  * g_output_stream_flush:
22472  * @stream: a #GOutputStream.
22473  * @cancellable: (allow-none): optional cancellable object
22474  * @error: location to store the error occurring, or %NULL to ignore
22475  *
22476  * Forces a write of all user-space buffered data for the given
22477  * @stream. Will block during the operation. Closing the stream will
22478  * implicitly cause a flush.
22479  *
22480  * This function is optional for inherited classes.
22481  *
22482  * If @cancellable is not %NULL, then the operation can be cancelled by
22483  * triggering the cancellable object from another thread. If the operation
22484  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
22485  *
22486  * Returns: %TRUE on success, %FALSE on error
22487  */
22488
22489
22490 /**
22491  * g_output_stream_flush_async:
22492  * @stream: a #GOutputStream.
22493  * @io_priority: the io priority of the request.
22494  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22495  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
22496  * @user_data: (closure): the data to pass to callback function
22497  *
22498  * Forces an asynchronous write of all user-space buffered data for
22499  * the given @stream.
22500  * For behaviour details see g_output_stream_flush().
22501  *
22502  * When the operation is finished @callback will be
22503  * called. You can then call g_output_stream_flush_finish() to get the
22504  * result of the operation.
22505  */
22506
22507
22508 /**
22509  * g_output_stream_flush_finish:
22510  * @stream: a #GOutputStream.
22511  * @result: a GAsyncResult.
22512  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22513  *
22514  * Finishes flushing an output stream.
22515  *
22516  * Returns: %TRUE if flush operation succeeded, %FALSE otherwise.
22517  */
22518
22519
22520 /**
22521  * g_output_stream_has_pending:
22522  * @stream: a #GOutputStream.
22523  *
22524  * Checks if an ouput stream has pending actions.
22525  *
22526  * Returns: %TRUE if @stream has pending actions.
22527  */
22528
22529
22530 /**
22531  * g_output_stream_is_closed:
22532  * @stream: a #GOutputStream.
22533  *
22534  * Checks if an output stream has already been closed.
22535  *
22536  * Returns: %TRUE if @stream is closed. %FALSE otherwise.
22537  */
22538
22539
22540 /**
22541  * g_output_stream_is_closing:
22542  * @stream: a #GOutputStream.
22543  *
22544  * Checks if an output stream is being closed. This can be
22545  * used inside e.g. a flush implementation to see if the
22546  * flush (or other i/o operation) is called from within
22547  * the closing operation.
22548  *
22549  * Returns: %TRUE if @stream is being closed. %FALSE otherwise.
22550  * Since: 2.24
22551  */
22552
22553
22554 /**
22555  * g_output_stream_set_pending:
22556  * @stream: a #GOutputStream.
22557  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22558  *
22559  * Sets @stream to have actions pending. If the pending flag is
22560  * already set or @stream is closed, it will return %FALSE and set
22561  * @error.
22562  *
22563  * Returns: %TRUE if pending was previously unset and is now set.
22564  */
22565
22566
22567 /**
22568  * g_output_stream_splice:
22569  * @stream: a #GOutputStream.
22570  * @source: a #GInputStream.
22571  * @flags: a set of #GOutputStreamSpliceFlags.
22572  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22573  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22574  *
22575  * Splices an input stream into an output stream.
22576  *
22577  * 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.
22578  */
22579
22580
22581 /**
22582  * g_output_stream_splice_async:
22583  * @stream: a #GOutputStream.
22584  * @source: a #GInputStream.
22585  * @flags: a set of #GOutputStreamSpliceFlags.
22586  * @io_priority: the io priority of the request.
22587  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22588  * @callback: (scope async): a #GAsyncReadyCallback.
22589  * @user_data: (closure): user data passed to @callback.
22590  *
22591  * Splices a stream asynchronously.
22592  * When the operation is finished @callback will be called.
22593  * You can then call g_output_stream_splice_finish() to get the
22594  * result of the operation.
22595  *
22596  * For the synchronous, blocking version of this function, see
22597  * g_output_stream_splice().
22598  */
22599
22600
22601 /**
22602  * g_output_stream_splice_finish:
22603  * @stream: a #GOutputStream.
22604  * @result: a #GAsyncResult.
22605  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22606  *
22607  * Finishes an asynchronous stream splice operation.
22608  *
22609  * 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.
22610  */
22611
22612
22613 /**
22614  * g_output_stream_write:
22615  * @stream: a #GOutputStream.
22616  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
22617  * @count: the number of bytes to write
22618  * @cancellable: (allow-none): optional cancellable object
22619  * @error: location to store the error occurring, or %NULL to ignore
22620  *
22621  * Tries to write @count bytes from @buffer into the stream. Will block
22622  * during the operation.
22623  *
22624  * If count is 0, returns 0 and does nothing. A value of @count
22625  * larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
22626  *
22627  * On success, the number of bytes written to the stream is returned.
22628  * It is not an error if this is not the same as the requested size, as it
22629  * can happen e.g. on a partial I/O error, or if there is not enough
22630  * storage in the stream. All writes block until at least one byte
22631  * is written or an error occurs; 0 is never returned (unless
22632  * @count is 0).
22633  *
22634  * If @cancellable is not %NULL, then the operation can be cancelled by
22635  * triggering the cancellable object from another thread. If the operation
22636  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
22637  * operation was partially finished when the operation was cancelled the
22638  * partial result will be returned, without an error.
22639  *
22640  * On error -1 is returned and @error is set accordingly.
22641  *
22642  * Virtual: write_fn
22643  * Returns: Number of bytes written, or -1 on error
22644  */
22645
22646
22647 /**
22648  * g_output_stream_write_all:
22649  * @stream: a #GOutputStream.
22650  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
22651  * @count: the number of bytes to write
22652  * @bytes_written: (out): location to store the number of bytes that was written to the stream
22653  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22654  * @error: location to store the error occurring, or %NULL to ignore
22655  *
22656  * Tries to write @count bytes from @buffer into the stream. Will block
22657  * during the operation.
22658  *
22659  * This function is similar to g_output_stream_write(), except it tries to
22660  * write as many bytes as requested, only stopping on an error.
22661  *
22662  * On a successful write of @count bytes, %TRUE is returned, and @bytes_written
22663  * is set to @count.
22664  *
22665  * If there is an error during the operation %FALSE is returned and @error
22666  * is set to indicate the error status, @bytes_written is updated to contain
22667  * the number of bytes written into the stream before the error occurred.
22668  *
22669  * Returns: %TRUE on success, %FALSE if there was an error
22670  */
22671
22672
22673 /**
22674  * g_output_stream_write_async:
22675  * @stream: A #GOutputStream.
22676  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
22677  * @count: the number of bytes to write
22678  * @io_priority: the io priority of the request.
22679  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
22680  * @callback: (scope async): callback to call when the request is satisfied
22681  * @user_data: (closure): the data to pass to callback function
22682  *
22683  * Request an asynchronous write of @count bytes from @buffer into
22684  * the stream. When the operation is finished @callback will be called.
22685  * You can then call g_output_stream_write_finish() to get the result of the
22686  * operation.
22687  *
22688  * During an async request no other sync and async calls are allowed,
22689  * and will result in %G_IO_ERROR_PENDING errors.
22690  *
22691  * A value of @count larger than %G_MAXSSIZE will cause a
22692  * %G_IO_ERROR_INVALID_ARGUMENT error.
22693  *
22694  * On success, the number of bytes written will be passed to the
22695  * @callback. It is not an error if this is not the same as the
22696  * requested size, as it can happen e.g. on a partial I/O error,
22697  * but generally we try to write as many bytes as requested.
22698  *
22699  * You are guaranteed that this method will never fail with
22700  * %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
22701  * method will just wait until this changes.
22702  *
22703  * Any outstanding I/O request with higher priority (lower numerical
22704  * value) will be executed before an outstanding request with lower
22705  * priority. Default priority is %G_PRIORITY_DEFAULT.
22706  *
22707  * The asyncronous methods have a default fallback that uses threads
22708  * to implement asynchronicity, so they are optional for inheriting
22709  * classes. However, if you override one you must override all.
22710  *
22711  * For the synchronous, blocking version of this function, see
22712  * g_output_stream_write().
22713  */
22714
22715
22716 /**
22717  * g_output_stream_write_finish:
22718  * @stream: a #GOutputStream.
22719  * @result: a #GAsyncResult.
22720  * @error: a #GError location to store the error occurring, or %NULL to ignore.
22721  *
22722  * Finishes a stream write operation.
22723  *
22724  * Returns: a #gssize containing the number of bytes written to the stream.
22725  */
22726
22727
22728 /**
22729  * g_permission_acquire:
22730  * @permission: a #GPermission instance
22731  * @cancellable: (allow-none): a #GCancellable, or %NULL
22732  * @error: a pointer to a %NULL #GError, or %NULL
22733  *
22734  * Attempts to acquire the permission represented by @permission.
22735  *
22736  * The precise method by which this happens depends on the permission
22737  * and the underlying authentication mechanism.  A simple example is
22738  * that a dialog may appear asking the user to enter their password.
22739  *
22740  * You should check with g_permission_get_can_acquire() before calling
22741  * this function.
22742  *
22743  * If the permission is acquired then %TRUE is returned.  Otherwise,
22744  * %FALSE is returned and @error is set appropriately.
22745  *
22746  * This call is blocking, likely for a very long time (in the case that
22747  * user interaction is required).  See g_permission_acquire_async() for
22748  * the non-blocking version.
22749  *
22750  * Returns: %TRUE if the permission was successfully acquired
22751  * Since: 2.26
22752  */
22753
22754
22755 /**
22756  * g_permission_acquire_async:
22757  * @permission: a #GPermission instance
22758  * @cancellable: (allow-none): a #GCancellable, or %NULL
22759  * @callback: the #GAsyncReadyCallback to call when done
22760  * @user_data: the user data to pass to @callback
22761  *
22762  * Attempts to acquire the permission represented by @permission.
22763  *
22764  * This is the first half of the asynchronous version of
22765  * g_permission_acquire().
22766  *
22767  * Since: 2.26
22768  */
22769
22770
22771 /**
22772  * g_permission_acquire_finish:
22773  * @permission: a #GPermission instance
22774  * @result: the #GAsyncResult given to the #GAsyncReadyCallback
22775  * @error: a pointer to a %NULL #GError, or %NULL
22776  *
22777  * Collects the result of attempting to acquire the permission
22778  * represented by @permission.
22779  *
22780  * This is the second half of the asynchronous version of
22781  * g_permission_acquire().
22782  *
22783  * Returns: %TRUE if the permission was successfully acquired
22784  * Since: 2.26
22785  */
22786
22787
22788 /**
22789  * g_permission_get_allowed:
22790  * @permission: a #GPermission instance
22791  *
22792  * Gets the value of the 'allowed' property.  This property is %TRUE if
22793  * the caller currently has permission to perform the action that
22794  * @permission represents the permission to perform.
22795  *
22796  * Returns: the value of the 'allowed' property
22797  * Since: 2.26
22798  */
22799
22800
22801 /**
22802  * g_permission_get_can_acquire:
22803  * @permission: a #GPermission instance
22804  *
22805  * Gets the value of the 'can-acquire' property.  This property is %TRUE
22806  * if it is generally possible to acquire the permission by calling
22807  * g_permission_acquire().
22808  *
22809  * Returns: the value of the 'can-acquire' property
22810  * Since: 2.26
22811  */
22812
22813
22814 /**
22815  * g_permission_get_can_release:
22816  * @permission: a #GPermission instance
22817  *
22818  * Gets the value of the 'can-release' property.  This property is %TRUE
22819  * if it is generally possible to release the permission by calling
22820  * g_permission_release().
22821  *
22822  * Returns: the value of the 'can-release' property
22823  * Since: 2.26
22824  */
22825
22826
22827 /**
22828  * g_permission_impl_update:
22829  * @permission: a #GPermission instance
22830  * @allowed: the new value for the 'allowed' property
22831  * @can_acquire: the new value for the 'can-acquire' property
22832  * @can_release: the new value for the 'can-release' property
22833  *
22834  * This function is called by the #GPermission implementation to update
22835  * the properties of the permission.  You should never call this
22836  * function except from a #GPermission implementation.
22837  *
22838  * GObject notify signals are generated, as appropriate.
22839  *
22840  * Since: 2.26
22841  */
22842
22843
22844 /**
22845  * g_permission_release:
22846  * @permission: a #GPermission instance
22847  * @cancellable: (allow-none): a #GCancellable, or %NULL
22848  * @error: a pointer to a %NULL #GError, or %NULL
22849  *
22850  * Attempts to release the permission represented by @permission.
22851  *
22852  * The precise method by which this happens depends on the permission
22853  * and the underlying authentication mechanism.  In most cases the
22854  * permission will be dropped immediately without further action.
22855  *
22856  * You should check with g_permission_get_can_release() before calling
22857  * this function.
22858  *
22859  * If the permission is released then %TRUE is returned.  Otherwise,
22860  * %FALSE is returned and @error is set appropriately.
22861  *
22862  * This call is blocking, likely for a very long time (in the case that
22863  * user interaction is required).  See g_permission_release_async() for
22864  * the non-blocking version.
22865  *
22866  * Returns: %TRUE if the permission was successfully released
22867  * Since: 2.26
22868  */
22869
22870
22871 /**
22872  * g_permission_release_async:
22873  * @permission: a #GPermission instance
22874  * @cancellable: (allow-none): a #GCancellable, or %NULL
22875  * @callback: the #GAsyncReadyCallback to call when done
22876  * @user_data: the user data to pass to @callback
22877  *
22878  * Attempts to release the permission represented by @permission.
22879  *
22880  * This is the first half of the asynchronous version of
22881  * g_permission_release().
22882  *
22883  * Since: 2.26
22884  */
22885
22886
22887 /**
22888  * g_permission_release_finish:
22889  * @permission: a #GPermission instance
22890  * @result: the #GAsyncResult given to the #GAsyncReadyCallback
22891  * @error: a pointer to a %NULL #GError, or %NULL
22892  *
22893  * Collects the result of attempting to release the permission
22894  * represented by @permission.
22895  *
22896  * This is the second half of the asynchronous version of
22897  * g_permission_release().
22898  *
22899  * Returns: %TRUE if the permission was successfully released
22900  * Since: 2.26
22901  */
22902
22903
22904 /**
22905  * g_poll_file_monitor_new:
22906  * @file: a #GFile.
22907  *
22908  * Polls @file for changes.
22909  *
22910  * Returns: a new #GFileMonitor for the given #GFile.
22911  */
22912
22913
22914 /**
22915  * g_pollable_input_stream_can_poll:
22916  * @stream: a #GPollableInputStream.
22917  *
22918  * Checks if @stream is actually pollable. Some classes may implement
22919  * #GPollableInputStream but have only certain instances of that class
22920  * be pollable. If this method returns %FALSE, then the behavior of
22921  * other #GPollableInputStream methods is undefined.
22922  *
22923  * For any given stream, the value returned by this method is constant;
22924  * a stream cannot switch from pollable to non-pollable or vice versa.
22925  *
22926  * Returns: %TRUE if @stream is pollable, %FALSE if not.
22927  * Since: 2.28
22928  */
22929
22930
22931 /**
22932  * g_pollable_input_stream_create_source:
22933  * @stream: a #GPollableInputStream.
22934  * @cancellable: (allow-none): a #GCancellable, or %NULL
22935  *
22936  * Creates a #GSource that triggers when @stream can be read, or
22937  * @cancellable is triggered or an error occurs. The callback on the
22938  * source is of the #GPollableSourceFunc type.
22939  *
22940  * As with g_pollable_input_stream_is_readable(), it is possible that
22941  * the stream may not actually be readable even after the source
22942  * triggers, so you should use g_pollable_input_stream_read_nonblocking()
22943  * rather than g_input_stream_read() from the callback.
22944  *
22945  * Returns: (transfer full): a new #GSource
22946  * Since: 2.28
22947  */
22948
22949
22950 /**
22951  * g_pollable_input_stream_is_readable:
22952  * @stream: a #GPollableInputStream.
22953  *
22954  * Checks if @stream can be read.
22955  *
22956  * Note that some stream types may not be able to implement this 100%
22957  * reliably, and it is possible that a call to g_input_stream_read()
22958  * after this returns %TRUE would still block. To guarantee
22959  * non-blocking behavior, you should always use
22960  * g_pollable_input_stream_read_nonblocking(), which will return a
22961  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
22962  *
22963  * 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.
22964  * Since: 2.28
22965  */
22966
22967
22968 /**
22969  * g_pollable_input_stream_read_nonblocking:
22970  * @stream: a #GPollableInputStream
22971  * @buffer: a buffer to read data into (which should be at least @count bytes long).
22972  * @count: the number of bytes you want to read
22973  * @cancellable: (allow-none): a #GCancellable, or %NULL
22974  * @error: #GError for error reporting, or %NULL to ignore.
22975  *
22976  * Attempts to read up to @count bytes from @stream into @buffer, as
22977  * with g_input_stream_read(). If @stream is not currently readable,
22978  * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
22979  * use g_pollable_input_stream_create_source() to create a #GSource
22980  * that will be triggered when @stream is readable.
22981  *
22982  * Note that since this method never blocks, you cannot actually
22983  * use @cancellable to cancel it. However, it will return an error
22984  * if @cancellable has already been cancelled when you call, which
22985  * may happen if you call this method after a source triggers due
22986  * to having been cancelled.
22987  *
22988  * Virtual: read_nonblocking
22989  * Returns: the number of bytes read, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
22990  */
22991
22992
22993 /**
22994  * g_pollable_output_stream_can_poll:
22995  * @stream: a #GPollableOutputStream.
22996  *
22997  * Checks if @stream is actually pollable. Some classes may implement
22998  * #GPollableOutputStream but have only certain instances of that
22999  * class be pollable. If this method returns %FALSE, then the behavior
23000  * of other #GPollableOutputStream methods is undefined.
23001  *
23002  * For any given stream, the value returned by this method is constant;
23003  * a stream cannot switch from pollable to non-pollable or vice versa.
23004  *
23005  * Returns: %TRUE if @stream is pollable, %FALSE if not.
23006  * Since: 2.28
23007  */
23008
23009
23010 /**
23011  * g_pollable_output_stream_create_source:
23012  * @stream: a #GPollableOutputStream.
23013  * @cancellable: (allow-none): a #GCancellable, or %NULL
23014  *
23015  * Creates a #GSource that triggers when @stream can be written, or
23016  * @cancellable is triggered or an error occurs. The callback on the
23017  * source is of the #GPollableSourceFunc type.
23018  *
23019  * As with g_pollable_output_stream_is_writable(), it is possible that
23020  * the stream may not actually be writable even after the source
23021  * triggers, so you should use g_pollable_output_stream_write_nonblocking()
23022  * rather than g_output_stream_write() from the callback.
23023  *
23024  * Returns: (transfer full): a new #GSource
23025  * Since: 2.28
23026  */
23027
23028
23029 /**
23030  * g_pollable_output_stream_is_writable:
23031  * @stream: a #GPollableOutputStream.
23032  *
23033  * Checks if @stream can be written.
23034  *
23035  * Note that some stream types may not be able to implement this 100%
23036  * reliably, and it is possible that a call to g_output_stream_write()
23037  * after this returns %TRUE would still block. To guarantee
23038  * non-blocking behavior, you should always use
23039  * g_pollable_output_stream_write_nonblocking(), which will return a
23040  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
23041  *
23042  * 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.
23043  * Since: 2.28
23044  */
23045
23046
23047 /**
23048  * g_pollable_output_stream_write_nonblocking:
23049  * @stream: a #GPollableOutputStream
23050  * @buffer: (array length=count) (element-type guint8): a buffer to write data from
23051  * @count: the number of bytes you want to write
23052  * @cancellable: (allow-none): a #GCancellable, or %NULL
23053  * @error: #GError for error reporting, or %NULL to ignore.
23054  *
23055  * Attempts to write up to @count bytes from @buffer to @stream, as
23056  * with g_output_stream_write(). If @stream is not currently writable,
23057  * this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
23058  * use g_pollable_output_stream_create_source() to create a #GSource
23059  * that will be triggered when @stream is writable.
23060  *
23061  * Note that since this method never blocks, you cannot actually
23062  * use @cancellable to cancel it. However, it will return an error
23063  * if @cancellable has already been cancelled when you call, which
23064  * may happen if you call this method after a source triggers due
23065  * to having been cancelled.
23066  *
23067  * Virtual: write_nonblocking
23068  * Returns: the number of bytes written, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
23069  */
23070
23071
23072 /**
23073  * g_pollable_source_new:
23074  * @pollable_stream: the stream associated with the new source
23075  *
23076  * Utility method for #GPollableInputStream and #GPollableOutputStream
23077  * implementations. Creates a new #GSource that expects a callback of
23078  * type #GPollableSourceFunc. The new source does not actually do
23079  * anything on its own; use g_source_add_child_source() to add other
23080  * sources to it to cause it to trigger.
23081  *
23082  * Returns: (transfer full): the new #GSource.
23083  * Since: 2.28
23084  */
23085
23086
23087 /**
23088  * g_pollable_source_new_full:
23089  * @pollable_stream: (type GObject): the stream associated with the new source
23090  * @child_source: (allow-none): optional child source to attach
23091  * @cancellable: (allow-none): optional #GCancellable to attach
23092  *
23093  * Utility method for #GPollableInputStream and #GPollableOutputStream
23094  * implementations. Creates a new #GSource, as with
23095  * g_pollable_source_new(), but also attaching @child_source (with a
23096  * dummy callback), and @cancellable, if they are non-%NULL.
23097  *
23098  * Returns: (transfer full): the new #GSource.
23099  * Since: 2.34
23100  */
23101
23102
23103 /**
23104  * g_pollable_stream_read:
23105  * @stream: a #GInputStream
23106  * @buffer: a buffer to read data into
23107  * @count: the number of bytes to read
23108  * @blocking: whether to do blocking I/O
23109  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23110  * @error: location to store the error occurring, or %NULL to ignore
23111  *
23112  * Tries to read from @stream, as with g_input_stream_read() (if
23113  * @blocking is %TRUE) or g_pollable_input_stream_read_nonblocking()
23114  * (if @blocking is %FALSE). This can be used to more easily share
23115  * code between blocking and non-blocking implementations of a method.
23116  *
23117  * If @blocking is %FALSE, then @stream must be a
23118  * #GPollableInputStream for which g_pollable_input_stream_can_poll()
23119  * returns %TRUE, or else the behavior is undefined. If @blocking is
23120  * %TRUE, then @stream does not need to be a #GPollableInputStream.
23121  *
23122  * Returns: the number of bytes read, or -1 on error.
23123  * Since: 2.34
23124  */
23125
23126
23127 /**
23128  * g_pollable_stream_write:
23129  * @stream: a #GOutputStream.
23130  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
23131  * @count: the number of bytes to write
23132  * @blocking: whether to do blocking I/O
23133  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23134  * @error: location to store the error occurring, or %NULL to ignore
23135  *
23136  * Tries to write to @stream, as with g_output_stream_write() (if
23137  * @blocking is %TRUE) or g_pollable_output_stream_write_nonblocking()
23138  * (if @blocking is %FALSE). This can be used to more easily share
23139  * code between blocking and non-blocking implementations of a method.
23140  *
23141  * If @blocking is %FALSE, then @stream must be a
23142  * #GPollableOutputStream for which
23143  * g_pollable_output_stream_can_poll() returns %TRUE or else the
23144  * behavior is undefined. If @blocking is %TRUE, then @stream does not
23145  * need to be a #GPollableOutputStream.
23146  *
23147  * Returns: the number of bytes written, or -1 on error.
23148  * Since: 2.34
23149  */
23150
23151
23152 /**
23153  * g_pollable_stream_write_all:
23154  * @stream: a #GOutputStream.
23155  * @buffer: (array length=count) (element-type guint8): the buffer containing the data to write.
23156  * @count: the number of bytes to write
23157  * @blocking: whether to do blocking I/O
23158  * @bytes_written: (out): location to store the number of bytes that was written to the stream
23159  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
23160  * @error: location to store the error occurring, or %NULL to ignore
23161  *
23162  * Tries to write @count bytes to @stream, as with
23163  * g_output_stream_write_all(), but using g_pollable_stream_write()
23164  * rather than g_output_stream_write().
23165  *
23166  * On a successful write of @count bytes, %TRUE is returned, and
23167  * @bytes_written is set to @count.
23168  *
23169  * If there is an error during the operation (including
23170  * %G_IO_ERROR_WOULD_BLOCK in the non-blocking case), %FALSE is
23171  * returned and @error is set to indicate the error status,
23172  * @bytes_written is updated to contain the number of bytes written
23173  * into the stream before the error occurred.
23174  *
23175  * As with g_pollable_stream_write(), if @blocking is %FALSE, then
23176  * @stream must be a #GPollableOutputStream for which
23177  * g_pollable_output_stream_can_poll() returns %TRUE or else the
23178  * behavior is undefined. If @blocking is %TRUE, then @stream does not
23179  * need to be a #GPollableOutputStream.
23180  *
23181  * Returns: %TRUE on success, %FALSE if there was an error
23182  * Since: 2.34
23183  */
23184
23185
23186 /**
23187  * g_proxy_address_get_destination_hostname:
23188  * @proxy: a #GProxyAddress
23189  *
23190  * Gets @proxy's destination hostname; that is, the name of the host
23191  * that will be connected to via the proxy, not the name of the proxy
23192  * itself.
23193  *
23194  * Returns: the @proxy's destination hostname
23195  * Since: 2.26
23196  */
23197
23198
23199 /**
23200  * g_proxy_address_get_destination_port:
23201  * @proxy: a #GProxyAddress
23202  *
23203  * Gets @proxy's destination port; that is, the port on the
23204  * destination host that will be connected to via the proxy, not the
23205  * port number of the proxy itself.
23206  *
23207  * Returns: the @proxy's destination port
23208  * Since: 2.26
23209  */
23210
23211
23212 /**
23213  * g_proxy_address_get_destination_protocol:
23214  * @proxy: a #GProxyAddress
23215  *
23216  * Gets the protocol that is being spoken to the destination
23217  * server; eg, "http" or "ftp".
23218  *
23219  * Returns: the @proxy's destination protocol
23220  * Since: 2.34
23221  */
23222
23223
23224 /**
23225  * g_proxy_address_get_password:
23226  * @proxy: a #GProxyAddress
23227  *
23228  * Gets @proxy's password.
23229  *
23230  * Returns: the @proxy's password
23231  * Since: 2.26
23232  */
23233
23234
23235 /**
23236  * g_proxy_address_get_protocol:
23237  * @proxy: a #GProxyAddress
23238  *
23239  * Gets @proxy's protocol. eg, "socks" or "http"
23240  *
23241  * Returns: the @proxy's protocol
23242  * Since: 2.26
23243  */
23244
23245
23246 /**
23247  * g_proxy_address_get_uri:
23248  * @proxy: a #GProxyAddress
23249  *
23250  * Gets the proxy URI that @proxy was constructed from.
23251  *
23252  * Returns: the @proxy's URI, or %NULL if unknown
23253  * Since: 2.34
23254  */
23255
23256
23257 /**
23258  * g_proxy_address_get_username:
23259  * @proxy: a #GProxyAddress
23260  *
23261  * Gets @proxy's username.
23262  *
23263  * Returns: the @proxy's username
23264  * Since: 2.26
23265  */
23266
23267
23268 /**
23269  * g_proxy_address_new:
23270  * @inetaddr: The proxy server #GInetAddress.
23271  * @port: The proxy server port.
23272  * @protocol: The proxy protocol to support, in lower case (e.g. socks, http).
23273  * @dest_hostname: The destination hostname the the proxy should tunnel to.
23274  * @dest_port: The destination port to tunnel to.
23275  * @username: (allow-none): The username to authenticate to the proxy server (or %NULL).
23276  * @password: (allow-none): The password to authenticate to the proxy server (or %NULL).
23277  *
23278  * Creates a new #GProxyAddress for @inetaddr with @protocol that should
23279  * tunnel through @dest_hostname and @dest_port.
23280  *
23281  * (Note that this method doesn't set the #GProxyAddress:uri or
23282  * #GProxyAddress:destination-protocol fields; use g_object_new()
23283  * directly if you want to set those.)
23284  *
23285  * Returns: a new #GProxyAddress
23286  * Since: 2.26
23287  */
23288
23289
23290 /**
23291  * g_proxy_connect:
23292  * @proxy: a #GProxy
23293  * @connection: a #GIOStream
23294  * @proxy_address: a #GProxyAddress
23295  * @cancellable: (allow-none): a #GCancellable
23296  * @error: return #GError
23297  *
23298  * Given @connection to communicate with a proxy (eg, a
23299  * #GSocketConnection that is connected to the proxy server), this
23300  * does the necessary handshake to connect to @proxy_address, and if
23301  * required, wraps the #GIOStream to handle proxy payload.
23302  *
23303  * Returns: (transfer full): a #GIOStream that will replace @connection. This might be the same as @connection, in which case a reference will be added.
23304  * Since: 2.26
23305  */
23306
23307
23308 /**
23309  * g_proxy_connect_async:
23310  * @proxy: a #GProxy
23311  * @connection: a #GIOStream
23312  * @proxy_address: a #GProxyAddress
23313  * @cancellable: (allow-none): a #GCancellable
23314  * @callback: (scope async): a #GAsyncReadyCallback
23315  * @user_data: (closure): callback data
23316  *
23317  * Asynchronous version of g_proxy_connect().
23318  *
23319  * Since: 2.26
23320  */
23321
23322
23323 /**
23324  * g_proxy_connect_finish:
23325  * @proxy: a #GProxy
23326  * @result: a #GAsyncResult
23327  * @error: return #GError
23328  *
23329  * See g_proxy_connect().
23330  *
23331  * Returns: (transfer full): a #GIOStream.
23332  * Since: 2.26
23333  */
23334
23335
23336 /**
23337  * g_proxy_get_default_for_protocol:
23338  * @protocol: the proxy protocol name (e.g. http, socks, etc)
23339  *
23340  * Lookup "gio-proxy" extension point for a proxy implementation that supports
23341  * specified protocol.
23342  *
23343  * Returns: (transfer full): return a #GProxy or NULL if protocol is not supported.
23344  * Since: 2.26
23345  */
23346
23347
23348 /**
23349  * g_proxy_resolver_get_default:
23350  *
23351  * Gets the default #GProxyResolver for the system.
23352  *
23353  * Returns: (transfer none): the default #GProxyResolver.
23354  * Since: 2.26
23355  */
23356
23357
23358 /**
23359  * g_proxy_resolver_is_supported:
23360  * @resolver: a #GProxyResolver
23361  *
23362  * Checks if @resolver can be used on this system. (This is used
23363  * internally; g_proxy_resolver_get_default() will only return a proxy
23364  * resolver that returns %TRUE for this method.)
23365  *
23366  * Returns: %TRUE if @resolver is supported.
23367  * Since: 2.26
23368  */
23369
23370
23371 /**
23372  * g_proxy_resolver_lookup:
23373  * @resolver: a #GProxyResolver
23374  * @uri: a URI representing the destination to connect to
23375  * @cancellable: (allow-none): a #GCancellable, or %NULL
23376  * @error: return location for a #GError, or %NULL
23377  *
23378  * Looks into the system proxy configuration to determine what proxy,
23379  * if any, to use to connect to @uri. The returned proxy URIs are of the
23380  * form <literal>&lt;protocol&gt;://[user[:password]@]host:port</literal>
23381  * or <literal>direct://</literal>, where &lt;protocol&gt; could be
23382  * http, rtsp, socks or other proxying protocol.
23383  *
23384  * If you don't know what network protocol is being used on the
23385  * socket, you should use <literal>none</literal> as the URI protocol.
23386  * In this case, the resolver might still return a generic proxy type
23387  * (such as SOCKS), but would not return protocol-specific proxy types
23388  * (such as http).
23389  *
23390  * <literal>direct://</literal> is used when no proxy is needed.
23391  * Direct connection should not be attempted unless it is part of the
23392  * returned array of proxies.
23393  *
23394  * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
23395  * Since: 2.26
23396  */
23397
23398
23399 /**
23400  * g_proxy_resolver_lookup_async:
23401  * @resolver: a #GProxyResolver
23402  * @uri: a URI representing the destination to connect to
23403  * @cancellable: (allow-none): a #GCancellable, or %NULL
23404  * @callback: (scope async): callback to call after resolution completes
23405  * @user_data: (closure): data for @callback
23406  *
23407  * Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
23408  * details.
23409  *
23410  * Since: 2.26
23411  */
23412
23413
23414 /**
23415  * g_proxy_resolver_lookup_finish:
23416  * @resolver: a #GProxyResolver
23417  * @result: the result passed to your #GAsyncReadyCallback
23418  * @error: return location for a #GError, or %NULL
23419  *
23420  * Call this function to obtain the array of proxy URIs when
23421  * g_proxy_resolver_lookup_async() is complete. See
23422  * g_proxy_resolver_lookup() for more details.
23423  *
23424  * Returns: (transfer full) (array zero-terminated=1): A NULL-terminated array of proxy URIs. Must be freed with g_strfreev().
23425  * Since: 2.26
23426  */
23427
23428
23429 /**
23430  * g_proxy_supports_hostname:
23431  * @proxy: a #GProxy
23432  *
23433  * Some proxy protocols expect to be passed a hostname, which they
23434  * will resolve to an IP address themselves. Others, like SOCKS4, do
23435  * not allow this. This function will return %FALSE if @proxy is
23436  * implementing such a protocol. When %FALSE is returned, the caller
23437  * should resolve the destination hostname first, and then pass a
23438  * #GProxyAddress containing the stringified IP address to
23439  * g_proxy_connect() or g_proxy_connect_async().
23440  *
23441  * Returns: %TRUE if hostname resolution is supported.
23442  * Since: 2.26
23443  */
23444
23445
23446 /**
23447  * g_remote_action_group_activate_action_full:
23448  * @remote: a #GDBusActionGroup
23449  * @action_name: the name of the action to activate
23450  * @parameter: (allow-none): the optional parameter to the activation
23451  * @platform_data: the platform data to send
23452  *
23453  * Activates the remote action.
23454  *
23455  * This is the same as g_action_group_activate_action() except that it
23456  * allows for provision of "platform data" to be sent along with the
23457  * activation request.  This typically contains details such as the user
23458  * interaction timestamp or startup notification information.
23459  *
23460  * @platform_data must be non-%NULL and must have the type
23461  * %G_VARIANT_TYPE_VARDICT.  If it is floating, it will be consumed.
23462  *
23463  * Since: 2.32
23464  */
23465
23466
23467 /**
23468  * g_remote_action_group_change_action_state_full:
23469  * @remote: a #GRemoteActionGroup
23470  * @action_name: the name of the action to change the state of
23471  * @value: the new requested value for the state
23472  * @platform_data: the platform data to send
23473  *
23474  * Changes the state of a remote action.
23475  *
23476  * This is the same as g_action_group_change_action_state() except that
23477  * it allows for provision of "platform data" to be sent along with the
23478  * state change request.  This typically contains details such as the
23479  * user interaction timestamp or startup notification information.
23480  *
23481  * @platform_data must be non-%NULL and must have the type
23482  * %G_VARIANT_TYPE_VARDICT.  If it is floating, it will be consumed.
23483  *
23484  * Since: 2.32
23485  */
23486
23487
23488 /**
23489  * g_resolver_error_quark:
23490  *
23491  * Gets the #GResolver Error Quark.
23492  *
23493  * Returns: a #GQuark.
23494  * Since: 2.22
23495  */
23496
23497
23498 /**
23499  * g_resolver_free_addresses: (skip)
23500  * @addresses: a #GList of #GInetAddress
23501  *
23502  * Frees @addresses (which should be the return value from
23503  * g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
23504  * (This is a convenience method; you can also simply free the results
23505  * by hand.)
23506  *
23507  * Since: 2.22
23508  */
23509
23510
23511 /**
23512  * g_resolver_free_targets: (skip)
23513  * @targets: a #GList of #GSrvTarget
23514  *
23515  * Frees @targets (which should be the return value from
23516  * g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
23517  * (This is a convenience method; you can also simply free the
23518  * results by hand.)
23519  *
23520  * Since: 2.22
23521  */
23522
23523
23524 /**
23525  * g_resolver_get_default:
23526  *
23527  * Gets the default #GResolver. You should unref it when you are done
23528  * with it. #GResolver may use its reference count as a hint about how
23529  * many threads it should allocate for concurrent DNS resolutions.
23530  *
23531  * Returns: (transfer full): the default #GResolver.
23532  * Since: 2.22
23533  */
23534
23535
23536 /**
23537  * g_resolver_lookup_by_address:
23538  * @resolver: a #GResolver
23539  * @address: the address to reverse-resolve
23540  * @cancellable: (allow-none): a #GCancellable, or %NULL
23541  * @error: return location for a #GError, or %NULL
23542  *
23543  * Synchronously reverse-resolves @address to determine its
23544  * associated hostname.
23545  *
23546  * If the DNS resolution fails, @error (if non-%NULL) will be set to
23547  * a value from #GResolverError.
23548  *
23549  * If @cancellable is non-%NULL, it can be used to cancel the
23550  * operation, in which case @error (if non-%NULL) will be set to
23551  * %G_IO_ERROR_CANCELLED.
23552  *
23553  * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
23554  * Since: 2.22
23555  */
23556
23557
23558 /**
23559  * g_resolver_lookup_by_address_async:
23560  * @resolver: a #GResolver
23561  * @address: the address to reverse-resolve
23562  * @cancellable: (allow-none): a #GCancellable, or %NULL
23563  * @callback: (scope async): callback to call after resolution completes
23564  * @user_data: (closure): data for @callback
23565  *
23566  * Begins asynchronously reverse-resolving @address to determine its
23567  * associated hostname, and eventually calls @callback, which must
23568  * call g_resolver_lookup_by_address_finish() to get the final result.
23569  *
23570  * Since: 2.22
23571  */
23572
23573
23574 /**
23575  * g_resolver_lookup_by_address_finish:
23576  * @resolver: a #GResolver
23577  * @result: the result passed to your #GAsyncReadyCallback
23578  * @error: return location for a #GError, or %NULL
23579  *
23580  * Retrieves the result of a previous call to
23581  * g_resolver_lookup_by_address_async().
23582  *
23583  * If the DNS resolution failed, @error (if non-%NULL) will be set to
23584  * a value from #GResolverError. If the operation was cancelled,
23585  * @error will be set to %G_IO_ERROR_CANCELLED.
23586  *
23587  * Returns: a hostname (either ASCII-only, or in ASCII-encoded form), or %NULL on error.
23588  * Since: 2.22
23589  */
23590
23591
23592 /**
23593  * g_resolver_lookup_by_name:
23594  * @resolver: a #GResolver
23595  * @hostname: the hostname to look up
23596  * @cancellable: (allow-none): a #GCancellable, or %NULL
23597  * @error: return location for a #GError, or %NULL
23598  *
23599  * Synchronously resolves @hostname to determine its associated IP
23600  * address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
23601  * the textual form of an IP address (in which case this just becomes
23602  * a wrapper around g_inet_address_new_from_string()).
23603  *
23604  * On success, g_resolver_lookup_by_name() will return a #GList of
23605  * #GInetAddress, sorted in order of preference and guaranteed to not
23606  * contain duplicates. That is, if using the result to connect to
23607  * @hostname, you should attempt to connect to the first address
23608  * first, then the second if the first fails, etc. If you are using
23609  * the result to listen on a socket, it is appropriate to add each
23610  * result using e.g. g_socket_listener_add_address().
23611  *
23612  * If the DNS resolution fails, @error (if non-%NULL) will be set to a
23613  * value from #GResolverError.
23614  *
23615  * If @cancellable is non-%NULL, it can be used to cancel the
23616  * operation, in which case @error (if non-%NULL) will be set to
23617  * %G_IO_ERROR_CANCELLED.
23618  *
23619  * If you are planning to connect to a socket on the resolved IP
23620  * address, it may be easier to create a #GNetworkAddress and use its
23621  * #GSocketConnectable interface.
23622  *
23623  * 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.)
23624  * Since: 2.22
23625  */
23626
23627
23628 /**
23629  * g_resolver_lookup_by_name_async:
23630  * @resolver: a #GResolver
23631  * @hostname: the hostname to look up the address of
23632  * @cancellable: (allow-none): a #GCancellable, or %NULL
23633  * @callback: (scope async): callback to call after resolution completes
23634  * @user_data: (closure): data for @callback
23635  *
23636  * Begins asynchronously resolving @hostname to determine its
23637  * associated IP address(es), and eventually calls @callback, which
23638  * must call g_resolver_lookup_by_name_finish() to get the result.
23639  * See g_resolver_lookup_by_name() for more details.
23640  *
23641  * Since: 2.22
23642  */
23643
23644
23645 /**
23646  * g_resolver_lookup_by_name_finish:
23647  * @resolver: a #GResolver
23648  * @result: the result passed to your #GAsyncReadyCallback
23649  * @error: return location for a #GError, or %NULL
23650  *
23651  * Retrieves the result of a call to
23652  * g_resolver_lookup_by_name_async().
23653  *
23654  * If the DNS resolution failed, @error (if non-%NULL) will be set to
23655  * a value from #GResolverError. If the operation was cancelled,
23656  * @error will be set to %G_IO_ERROR_CANCELLED.
23657  *
23658  * Returns: (element-type GInetAddress) (transfer full): a #GList of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name() for more details.
23659  * Since: 2.22
23660  */
23661
23662
23663 /**
23664  * g_resolver_lookup_records:
23665  * @resolver: a #GResolver
23666  * @rrname: the DNS name to lookup the record for
23667  * @record_type: the type of DNS record to lookup
23668  * @cancellable: (allow-none): a #GCancellable, or %NULL
23669  * @error: return location for a #GError, or %NULL
23670  *
23671  * Synchronously performs a DNS record lookup for the given @rrname and returns
23672  * a list of records as #GVariant tuples. See #GResolverRecordType for
23673  * information on what the records contain for each @record_type.
23674  *
23675  * If the DNS resolution fails, @error (if non-%NULL) will be set to
23676  * a value from #GResolverError.
23677  *
23678  * If @cancellable is non-%NULL, it can be used to cancel the
23679  * operation, in which case @error (if non-%NULL) will be set to
23680  * %G_IO_ERROR_CANCELLED.
23681  *
23682  * 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.)
23683  * Since: 2.34
23684  */
23685
23686
23687 /**
23688  * g_resolver_lookup_records_async:
23689  * @resolver: a #GResolver
23690  * @rrname: the DNS name to lookup the record for
23691  * @record_type: the type of DNS record to lookup
23692  * @cancellable: (allow-none): a #GCancellable, or %NULL
23693  * @callback: (scope async): callback to call after resolution completes
23694  * @user_data: (closure): data for @callback
23695  *
23696  * Begins asynchronously performing a DNS lookup for the given
23697  * @rrname, and eventually calls @callback, which must call
23698  * g_resolver_lookup_records_finish() to get the final result. See
23699  * g_resolver_lookup_records() for more details.
23700  *
23701  * Since: 2.34
23702  */
23703
23704
23705 /**
23706  * g_resolver_lookup_records_finish:
23707  * @resolver: a #GResolver
23708  * @result: the result passed to your #GAsyncReadyCallback
23709  * @error: return location for a #GError, or %NULL
23710  *
23711  * Retrieves the result of a previous call to
23712  * g_resolver_lookup_records_async(). Returns a list of records as #GVariant
23713  * tuples. See #GResolverRecordType for information on what the records contain.
23714  *
23715  * If the DNS resolution failed, @error (if non-%NULL) will be set to
23716  * a value from #GResolverError. If the operation was cancelled,
23717  * @error will be set to %G_IO_ERROR_CANCELLED.
23718  *
23719  * 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.)
23720  * Since: 2.34
23721  */
23722
23723
23724 /**
23725  * g_resolver_lookup_service:
23726  * @resolver: a #GResolver
23727  * @service: the service type to look up (eg, "ldap")
23728  * @protocol: the networking protocol to use for @service (eg, "tcp")
23729  * @domain: the DNS domain to look up the service in
23730  * @cancellable: (allow-none): a #GCancellable, or %NULL
23731  * @error: return location for a #GError, or %NULL
23732  *
23733  * Synchronously performs a DNS SRV lookup for the given @service and
23734  * @protocol in the given @domain and returns an array of #GSrvTarget.
23735  * @domain may be an ASCII-only or UTF-8 hostname. Note also that the
23736  * @service and @protocol arguments <emphasis>do not</emphasis>
23737  * include the leading underscore that appears in the actual DNS
23738  * entry.
23739  *
23740  * On success, g_resolver_lookup_service() will return a #GList of
23741  * #GSrvTarget, sorted in order of preference. (That is, you should
23742  * attempt to connect to the first target first, then the second if
23743  * the first fails, etc.)
23744  *
23745  * If the DNS resolution fails, @error (if non-%NULL) will be set to
23746  * a value from #GResolverError.
23747  *
23748  * If @cancellable is non-%NULL, it can be used to cancel the
23749  * operation, in which case @error (if non-%NULL) will be set to
23750  * %G_IO_ERROR_CANCELLED.
23751  *
23752  * If you are planning to connect to the service, it is usually easier
23753  * to create a #GNetworkService and use its #GSocketConnectable
23754  * interface.
23755  *
23756  * 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.)
23757  * Since: 2.22
23758  */
23759
23760
23761 /**
23762  * g_resolver_lookup_service_async:
23763  * @resolver: a #GResolver
23764  * @service: the service type to look up (eg, "ldap")
23765  * @protocol: the networking protocol to use for @service (eg, "tcp")
23766  * @domain: the DNS domain to look up the service in
23767  * @cancellable: (allow-none): a #GCancellable, or %NULL
23768  * @callback: (scope async): callback to call after resolution completes
23769  * @user_data: (closure): data for @callback
23770  *
23771  * Begins asynchronously performing a DNS SRV lookup for the given
23772  * @service and @protocol in the given @domain, and eventually calls
23773  * @callback, which must call g_resolver_lookup_service_finish() to
23774  * get the final result. See g_resolver_lookup_service() for more
23775  * details.
23776  *
23777  * Since: 2.22
23778  */
23779
23780
23781 /**
23782  * g_resolver_lookup_service_finish:
23783  * @resolver: a #GResolver
23784  * @result: the result passed to your #GAsyncReadyCallback
23785  * @error: return location for a #GError, or %NULL
23786  *
23787  * Retrieves the result of a previous call to
23788  * g_resolver_lookup_service_async().
23789  *
23790  * If the DNS resolution failed, @error (if non-%NULL) will be set to
23791  * a value from #GResolverError. If the operation was cancelled,
23792  * @error will be set to %G_IO_ERROR_CANCELLED.
23793  *
23794  * Returns: (element-type GSrvTarget) (transfer full): a #GList of #GSrvTarget, or %NULL on error. See g_resolver_lookup_service() for more details.
23795  * Since: 2.22
23796  */
23797
23798
23799 /**
23800  * g_resolver_set_default:
23801  * @resolver: the new default #GResolver
23802  *
23803  * Sets @resolver to be the application's default resolver (reffing
23804  * @resolver, and unreffing the previous default resolver, if any).
23805  * Future calls to g_resolver_get_default() will return this resolver.
23806  *
23807  * This can be used if an application wants to perform any sort of DNS
23808  * caching or "pinning"; it can implement its own #GResolver that
23809  * calls the original default resolver for DNS operations, and
23810  * implements its own cache policies on top of that, and then set
23811  * itself as the default resolver for all later code to use.
23812  *
23813  * Since: 2.22
23814  */
23815
23816
23817 /**
23818  * g_resource_enumerate_children:
23819  * @resource: A #GResource
23820  * @path: A pathname inside the resource
23821  * @lookup_flags: A #GResourceLookupFlags
23822  * @error: return location for a #GError, or %NULL
23823  *
23824  * Returns all the names of children at the specified @path in the resource.
23825  * The return result is a %NULL terminated list of strings which should
23826  * be released with g_strfreev().
23827  *
23828  * @lookup_flags controls the behaviour of the lookup.
23829  *
23830  * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
23831  * Since: 2.32
23832  */
23833
23834
23835 /**
23836  * g_resource_error_quark:
23837  *
23838  * Gets the #GResource Error Quark.
23839  *
23840  * Returns: a #GQuark
23841  * Since: 2.32
23842  */
23843
23844
23845 /**
23846  * g_resource_get_info:
23847  * @resource: A #GResource
23848  * @path: A pathname inside the resource
23849  * @lookup_flags: A #GResourceLookupFlags
23850  * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
23851  * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
23852  * @error: return location for a #GError, or %NULL
23853  *
23854  * Looks for a file at the specified @path in the resource and
23855  * if found returns information about it.
23856  *
23857  * @lookup_flags controls the behaviour of the lookup.
23858  *
23859  * Returns: %TRUE if the file was found. %FALSE if there were errors
23860  * Since: 2.32
23861  */
23862
23863
23864 /**
23865  * g_resource_load:
23866  * @filename: (type filename): the path of a filename to load, in the GLib filename encoding
23867  * @error: return location for a #GError, or %NULL
23868  *
23869  * Loads a binary resource bundle and creates a #GResource representation of it, allowing
23870  * you to query it for data.
23871  *
23872  * If you want to use this resource in the global resource namespace you need
23873  * to register it with g_resources_register().
23874  *
23875  * Returns: (transfer full): a new #GResource, or %NULL on error
23876  * Since: 2.32
23877  */
23878
23879
23880 /**
23881  * g_resource_lookup_data:
23882  * @resource: A #GResource
23883  * @path: A pathname inside the resource
23884  * @lookup_flags: A #GResourceLookupFlags
23885  * @error: return location for a #GError, or %NULL
23886  *
23887  * Looks for a file at the specified @path in the resource and
23888  * returns a #GBytes that lets you directly access the data in
23889  * memory.
23890  *
23891  * The data is always followed by a zero byte, so you
23892  * can safely use the data as a C string. However, that byte
23893  * is not included in the size of the GBytes.
23894  *
23895  * For uncompressed resource files this is a pointer directly into
23896  * the resource bundle, which is typically in some readonly data section
23897  * in the program binary. For compressed files we allocate memory on
23898  * the heap and automatically uncompress the data.
23899  *
23900  * @lookup_flags controls the behaviour of the lookup.
23901  *
23902  * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
23903  * Since: 2.32
23904  */
23905
23906
23907 /**
23908  * g_resource_new_from_data:
23909  * @data: A #GBytes
23910  * @error: return location for a #GError, or %NULL
23911  *
23912  * Creates a GResource from a reference to the binary resource bundle.
23913  * This will keep a reference to @data while the resource lives, so
23914  * the data should not be modified or freed.
23915  *
23916  * If you want to use this resource in the global resource namespace you need
23917  * to register it with g_resources_register().
23918  *
23919  * Returns: (transfer full): a new #GResource, or %NULL on error
23920  * Since: 2.32
23921  */
23922
23923
23924 /**
23925  * g_resource_open_stream:
23926  * @resource: A #GResource
23927  * @path: A pathname inside the resource
23928  * @lookup_flags: A #GResourceLookupFlags
23929  * @error: return location for a #GError, or %NULL
23930  *
23931  * Looks for a file at the specified @path in the resource and
23932  * returns a #GInputStream that lets you read the data.
23933  *
23934  * @lookup_flags controls the behaviour of the lookup.
23935  *
23936  * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
23937  * Since: 2.32
23938  */
23939
23940
23941 /**
23942  * g_resource_ref:
23943  * @resource: A #GResource
23944  *
23945  * Atomically increments the reference count of @array by one. This
23946  * function is MT-safe and may be called from any thread.
23947  *
23948  * Returns: The passed in #GResource
23949  * Since: 2.32
23950  */
23951
23952
23953 /**
23954  * g_resource_unref:
23955  * @resource: A #GResource
23956  *
23957  * Atomically decrements the reference count of @resource by one. If the
23958  * reference count drops to 0, all memory allocated by the array is
23959  * released. This function is MT-safe and may be called from any
23960  * thread.
23961  *
23962  * Since: 2.32
23963  */
23964
23965
23966 /**
23967  * g_resources_enumerate_children:
23968  * @path: A pathname inside the resource
23969  * @lookup_flags: A #GResourceLookupFlags
23970  * @error: return location for a #GError, or %NULL
23971  *
23972  * Returns all the names of children at the specified @path in the set of
23973  * globally registred resources.
23974  * The return result is a %NULL terminated list of strings which should
23975  * be released with g_strfreev().
23976  *
23977  * @lookup_flags controls the behaviour of the lookup.
23978  *
23979  * Returns: (array zero-terminated=1) (transfer full): an array of constant strings
23980  * Since: 2.32
23981  */
23982
23983
23984 /**
23985  * g_resources_get_info:
23986  * @path: A pathname inside the resource
23987  * @lookup_flags: A #GResourceLookupFlags
23988  * @size: (out) (allow-none): a location to place the length of the contents of the file, or %NULL if the length is not needed
23989  * @flags: (out) (allow-none): a location to place the flags about the file, or %NULL if the length is not needed
23990  * @error: return location for a #GError, or %NULL
23991  *
23992  * Looks for a file at the specified @path in the set of
23993  * globally registred resources and if found returns information about it.
23994  *
23995  * @lookup_flags controls the behaviour of the lookup.
23996  *
23997  * Returns: %TRUE if the file was found. %FALSE if there were errors
23998  * Since: 2.32
23999  */
24000
24001
24002 /**
24003  * g_resources_lookup_data:
24004  * @path: A pathname inside the resource
24005  * @lookup_flags: A #GResourceLookupFlags
24006  * @error: return location for a #GError, or %NULL
24007  *
24008  * Looks for a file at the specified @path in the set of
24009  * globally registred resources and returns a #GBytes that
24010  * lets you directly access the data in memory.
24011  *
24012  * The data is always followed by a zero byte, so you
24013  * can safely use the data as a C string. However, that byte
24014  * is not included in the size of the GBytes.
24015  *
24016  * For uncompressed resource files this is a pointer directly into
24017  * the resource bundle, which is typically in some readonly data section
24018  * in the program binary. For compressed files we allocate memory on
24019  * the heap and automatically uncompress the data.
24020  *
24021  * @lookup_flags controls the behaviour of the lookup.
24022  *
24023  * Returns: (transfer full): #GBytes or %NULL on error. Free the returned object with g_bytes_unref()
24024  * Since: 2.32
24025  */
24026
24027
24028 /**
24029  * g_resources_open_stream:
24030  * @path: A pathname inside the resource
24031  * @lookup_flags: A #GResourceLookupFlags
24032  * @error: return location for a #GError, or %NULL
24033  *
24034  * Looks for a file at the specified @path in the set of
24035  * globally registred resources and returns a #GInputStream
24036  * that lets you read the data.
24037  *
24038  * @lookup_flags controls the behaviour of the lookup.
24039  *
24040  * Returns: (transfer full): #GInputStream or %NULL on error. Free the returned object with g_object_unref()
24041  * Since: 2.32
24042  */
24043
24044
24045 /**
24046  * g_resources_register:
24047  * @resource: A #GResource
24048  *
24049  * Registers the resource with the process-global set of resources.
24050  * Once a resource is registered the files in it can be accessed
24051  * with the global resource lookup functions like g_resources_lookup_data().
24052  *
24053  * Since: 2.32
24054  */
24055
24056
24057 /**
24058  * g_resources_unregister:
24059  * @resource: A #GResource
24060  *
24061  * Unregisters the resource from the process-global set of resources.
24062  *
24063  * Since: 2.32
24064  */
24065
24066
24067 /**
24068  * g_seekable_can_seek:
24069  * @seekable: a #GSeekable.
24070  *
24071  * Tests if the stream supports the #GSeekableIface.
24072  *
24073  * Returns: %TRUE if @seekable can be seeked. %FALSE otherwise.
24074  */
24075
24076
24077 /**
24078  * g_seekable_can_truncate:
24079  * @seekable: a #GSeekable.
24080  *
24081  * Tests if the stream can be truncated.
24082  *
24083  * Returns: %TRUE if the stream can be truncated, %FALSE otherwise.
24084  */
24085
24086
24087 /**
24088  * g_seekable_seek:
24089  * @seekable: a #GSeekable.
24090  * @offset: a #goffset.
24091  * @type: a #GSeekType.
24092  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24093  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24094  *
24095  * Seeks in the stream by the given @offset, modified by @type.
24096  *
24097  * If @cancellable is not %NULL, then the operation can be cancelled by
24098  * triggering the cancellable object from another thread. If the operation
24099  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
24100  *
24101  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
24102  */
24103
24104
24105 /**
24106  * g_seekable_tell:
24107  * @seekable: a #GSeekable.
24108  *
24109  * Tells the current position within the stream.
24110  *
24111  * Returns: the offset from the beginning of the buffer.
24112  */
24113
24114
24115 /**
24116  * g_seekable_truncate:
24117  * @seekable: a #GSeekable.
24118  * @offset: a #goffset.
24119  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
24120  * @error: a #GError location to store the error occurring, or %NULL to ignore.
24121  *
24122  * Truncates a stream with a given #offset.
24123  *
24124  * If @cancellable is not %NULL, then the operation can be cancelled by
24125  * triggering the cancellable object from another thread. If the operation
24126  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
24127  * operation was partially finished when the operation was cancelled the
24128  * partial result will be returned, without an error.
24129  *
24130  * Virtual: truncate_fn
24131  * Returns: %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
24132  */
24133
24134
24135 /**
24136  * g_settings_apply:
24137  * @settings: a #GSettings instance
24138  *
24139  * Applies any changes that have been made to the settings.  This
24140  * function does nothing unless @settings is in 'delay-apply' mode;
24141  * see g_settings_delay().  In the normal case settings are always
24142  * applied immediately.
24143  */
24144
24145
24146 /**
24147  * g_settings_backend_changed:
24148  * @backend: a #GSettingsBackend implementation
24149  * @key: the name of the key
24150  * @origin_tag: the origin tag
24151  *
24152  * Signals that a single key has possibly changed.  Backend
24153  * implementations should call this if a key has possibly changed its
24154  * value.
24155  *
24156  * @key must be a valid key (ie starting with a slash, not containing
24157  * '//', and not ending with a slash).
24158  *
24159  * The implementation must call this function during any call to
24160  * g_settings_backend_write(), before the call returns (except in the
24161  * case that no keys are actually changed and it cares to detect this
24162  * fact).  It may not rely on the existence of a mainloop for
24163  * dispatching the signal later.
24164  *
24165  * The implementation may call this function at any other time it likes
24166  * in response to other events (such as changes occurring outside of the
24167  * program).  These calls may originate from a mainloop or may originate
24168  * in response to any other action (including from calls to
24169  * g_settings_backend_write()).
24170  *
24171  * In the case that this call is in response to a call to
24172  * g_settings_backend_write() then @origin_tag must be set to the same
24173  * value that was passed to that call.
24174  *
24175  * Since: 2.26
24176  */
24177
24178
24179 /**
24180  * g_settings_backend_changed_tree:
24181  * @backend: a #GSettingsBackend implementation
24182  * @tree: a #GTree containing the changes
24183  * @origin_tag: the origin tag
24184  *
24185  * This call is a convenience wrapper.  It gets the list of changes from
24186  * @tree, computes the longest common prefix and calls
24187  * g_settings_backend_changed().
24188  *
24189  * Since: 2.26
24190  */
24191
24192
24193 /**
24194  * g_settings_backend_flatten_tree:
24195  * @tree: a #GTree containing the changes
24196  * @path: (out): the location to save the path
24197  * @keys: (out) (transfer container) (array zero-terminated=1): the location to save the relative keys
24198  * @values: (out) (allow-none) (transfer container) (array zero-terminated=1): the location to save the values, or %NULL
24199  *
24200  * Calculate the longest common prefix of all keys in a tree and write
24201  * out an array of the key names relative to that prefix and,
24202  * optionally, the value to store at each of those keys.
24203  *
24204  * You must free the value returned in @path, @keys and @values using
24205  * g_free().  You should not attempt to free or unref the contents of
24206  * @keys or @values.
24207  *
24208  * Since: 2.26
24209  */
24210
24211
24212 /**
24213  * g_settings_backend_get_default:
24214  *
24215  * Returns the default #GSettingsBackend. It is possible to override
24216  * the default by setting the <envar>GSETTINGS_BACKEND</envar>
24217  * environment variable to the name of a settings backend.
24218  *
24219  * The user gets a reference to the backend.
24220  *
24221  * Returns: (transfer full): the default #GSettingsBackend
24222  * Since: 2.28
24223  */
24224
24225
24226 /**
24227  * g_settings_backend_keys_changed:
24228  * @backend: a #GSettingsBackend implementation
24229  * @path: the path containing the changes
24230  * @items: (array zero-terminated=1): the %NULL-terminated list of changed keys
24231  * @origin_tag: the origin tag
24232  *
24233  * Signals that a list of keys have possibly changed.  Backend
24234  * implementations should call this if keys have possibly changed their
24235  * values.
24236  *
24237  * @path must be a valid path (ie starting and ending with a slash and
24238  * not containing '//').  Each string in @items must form a valid key
24239  * name when @path is prefixed to it (ie: each item must not start or
24240  * end with '/' and must not contain '//').
24241  *
24242  * The meaning of this signal is that any of the key names resulting
24243  * from the contatenation of @path with each item in @items may have
24244  * changed.
24245  *
24246  * The same rules for when notifications must occur apply as per
24247  * g_settings_backend_changed().  These two calls can be used
24248  * interchangeably if exactly one item has changed (although in that
24249  * case g_settings_backend_changed() is definitely preferred).
24250  *
24251  * For efficiency reasons, the implementation should strive for @path to
24252  * be as long as possible (ie: the longest common prefix of all of the
24253  * keys that were changed) but this is not strictly required.
24254  *
24255  * Since: 2.26
24256  */
24257
24258
24259 /**
24260  * g_settings_backend_path_changed:
24261  * @backend: a #GSettingsBackend implementation
24262  * @path: the path containing the changes
24263  * @origin_tag: the origin tag
24264  *
24265  * Signals that all keys below a given path may have possibly changed.
24266  * Backend implementations should call this if an entire path of keys
24267  * have possibly changed their values.
24268  *
24269  * @path must be a valid path (ie starting and ending with a slash and
24270  * not containing '//').
24271  *
24272  * The meaning of this signal is that any of the key which has a name
24273  * starting with @path may have changed.
24274  *
24275  * The same rules for when notifications must occur apply as per
24276  * g_settings_backend_changed().  This call might be an appropriate
24277  * reasponse to a 'reset' call but implementations are also free to
24278  * explicitly list the keys that were affected by that call if they can
24279  * easily do so.
24280  *
24281  * For efficiency reasons, the implementation should strive for @path to
24282  * be as long as possible (ie: the longest common prefix of all of the
24283  * keys that were changed) but this is not strictly required.  As an
24284  * example, if this function is called with the path of "/" then every
24285  * single key in the application will be notified of a possible change.
24286  *
24287  * Since: 2.26
24288  */
24289
24290
24291 /**
24292  * g_settings_backend_path_writable_changed:
24293  * @backend: a #GSettingsBackend implementation
24294  * @path: the name of the path
24295  *
24296  * Signals that the writability of all keys below a given path may have
24297  * changed.
24298  *
24299  * Since GSettings performs no locking operations for itself, this call
24300  * will always be made in response to external events.
24301  *
24302  * Since: 2.26
24303  */
24304
24305
24306 /**
24307  * g_settings_backend_writable_changed:
24308  * @backend: a #GSettingsBackend implementation
24309  * @key: the name of the key
24310  *
24311  * Signals that the writability of a single key has possibly changed.
24312  *
24313  * Since GSettings performs no locking operations for itself, this call
24314  * will always be made in response to external events.
24315  *
24316  * Since: 2.26
24317  */
24318
24319
24320 /**
24321  * g_settings_bind:
24322  * @settings: a #GSettings object
24323  * @key: the key to bind
24324  * @object: (type GObject.Object): a #GObject
24325  * @property: the name of the property to bind
24326  * @flags: flags for the binding
24327  *
24328  * Create a binding between the @key in the @settings object
24329  * and the property @property of @object.
24330  *
24331  * The binding uses the default GIO mapping functions to map
24332  * between the settings and property values. These functions
24333  * handle booleans, numeric types and string types in a
24334  * straightforward way. Use g_settings_bind_with_mapping() if
24335  * you need a custom mapping, or map between types that are not
24336  * supported by the default mapping functions.
24337  *
24338  * Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
24339  * function also establishes a binding between the writability of
24340  * @key and the "sensitive" property of @object (if @object has
24341  * a boolean property by that name). See g_settings_bind_writable()
24342  * for more details about writable bindings.
24343  *
24344  * Note that the lifecycle of the binding is tied to the object,
24345  * and that you can have only one binding per object property.
24346  * If you bind the same property twice on the same object, the second
24347  * binding overrides the first one.
24348  *
24349  * Since: 2.26
24350  */
24351
24352
24353 /**
24354  * g_settings_bind_with_mapping: (skip)
24355  * @settings: a #GSettings object
24356  * @key: the key to bind
24357  * @object: (type GObject.Object): a #GObject
24358  * @property: the name of the property to bind
24359  * @flags: flags for the binding
24360  * @get_mapping: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
24361  * @set_mapping: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
24362  * @user_data: data that gets passed to @get_mapping and @set_mapping
24363  * @destroy: #GDestroyNotify function for @user_data
24364  *
24365  * Create a binding between the @key in the @settings object
24366  * and the property @property of @object.
24367  *
24368  * The binding uses the provided mapping functions to map between
24369  * settings and property values.
24370  *
24371  * Note that the lifecycle of the binding is tied to the object,
24372  * and that you can have only one binding per object property.
24373  * If you bind the same property twice on the same object, the second
24374  * binding overrides the first one.
24375  *
24376  * Since: 2.26
24377  */
24378
24379
24380 /**
24381  * g_settings_bind_writable:
24382  * @settings: a #GSettings object
24383  * @key: the key to bind
24384  * @object: (type GObject.Object): a #GObject
24385  * @property: the name of a boolean property to bind
24386  * @inverted: whether to 'invert' the value
24387  *
24388  * Create a binding between the writability of @key in the
24389  * @settings object and the property @property of @object.
24390  * The property must be boolean; "sensitive" or "visible"
24391  * properties of widgets are the most likely candidates.
24392  *
24393  * Writable bindings are always uni-directional; changes of the
24394  * writability of the setting will be propagated to the object
24395  * property, not the other way.
24396  *
24397  * When the @inverted argument is %TRUE, the binding inverts the
24398  * value as it passes from the setting to the object, i.e. @property
24399  * will be set to %TRUE if the key is <emphasis>not</emphasis>
24400  * writable.
24401  *
24402  * Note that the lifecycle of the binding is tied to the object,
24403  * and that you can have only one binding per object property.
24404  * If you bind the same property twice on the same object, the second
24405  * binding overrides the first one.
24406  *
24407  * Since: 2.26
24408  */
24409
24410
24411 /**
24412  * g_settings_create_action:
24413  * @settings: a #GSettings
24414  * @key: the name of a key in @settings
24415  *
24416  * Creates a #GAction corresponding to a given #GSettings key.
24417  *
24418  * The action has the same name as the key.
24419  *
24420  * The value of the key becomes the state of the action and the action
24421  * is enabled when the key is writable.  Changing the state of the
24422  * action results in the key being written to.  Changes to the value or
24423  * writability of the key cause appropriate change notifications to be
24424  * emitted for the action.
24425  *
24426  * For boolean-valued keys, action activations take no parameter and
24427  * result in the toggling of the value.  For all other types,
24428  * activations take the new value for the key (which must have the
24429  * correct type).
24430  *
24431  * Returns: (transfer full): a new #GAction
24432  * Since: 2.32
24433  */
24434
24435
24436 /**
24437  * g_settings_delay:
24438  * @settings: a #GSettings object
24439  *
24440  * Changes the #GSettings object into 'delay-apply' mode. In this
24441  * mode, changes to @settings are not immediately propagated to the
24442  * backend, but kept locally until g_settings_apply() is called.
24443  *
24444  * Since: 2.26
24445  */
24446
24447
24448 /**
24449  * g_settings_get:
24450  * @settings: a #GSettings object
24451  * @key: the key to get the value for
24452  * @format: a #GVariant format string
24453  * @...: arguments as per @format
24454  *
24455  * Gets the value that is stored at @key in @settings.
24456  *
24457  * A convenience function that combines g_settings_get_value() with
24458  * g_variant_get().
24459  *
24460  * It is a programmer error to give a @key that isn't contained in the
24461  * schema for @settings or for the #GVariantType of @format to mismatch
24462  * the type given in the schema.
24463  *
24464  * Since: 2.26
24465  */
24466
24467
24468 /**
24469  * g_settings_get_boolean:
24470  * @settings: a #GSettings object
24471  * @key: the key to get the value for
24472  *
24473  * Gets the value that is stored at @key in @settings.
24474  *
24475  * A convenience variant of g_settings_get() for booleans.
24476  *
24477  * It is a programmer error to give a @key that isn't specified as
24478  * having a boolean type in the schema for @settings.
24479  *
24480  * Returns: a boolean
24481  * Since: 2.26
24482  */
24483
24484
24485 /**
24486  * g_settings_get_child:
24487  * @settings: a #GSettings object
24488  * @name: the name of the 'child' schema
24489  *
24490  * Creates a 'child' settings object which has a base path of
24491  * <replaceable>base-path</replaceable>/@name, where
24492  * <replaceable>base-path</replaceable> is the base path of @settings.
24493  *
24494  * The schema for the child settings object must have been declared
24495  * in the schema of @settings using a <tag class="starttag">child</tag> element.
24496  *
24497  * Returns: (transfer full): a 'child' settings object
24498  * Since: 2.26
24499  */
24500
24501
24502 /**
24503  * g_settings_get_double:
24504  * @settings: a #GSettings object
24505  * @key: the key to get the value for
24506  *
24507  * Gets the value that is stored at @key in @settings.
24508  *
24509  * A convenience variant of g_settings_get() for doubles.
24510  *
24511  * It is a programmer error to give a @key that isn't specified as
24512  * having a 'double' type in the schema for @settings.
24513  *
24514  * Returns: a double
24515  * Since: 2.26
24516  */
24517
24518
24519 /**
24520  * g_settings_get_enum:
24521  * @settings: a #GSettings object
24522  * @key: the key to get the value for
24523  *
24524  * Gets the value that is stored in @settings for @key and converts it
24525  * to the enum value that it represents.
24526  *
24527  * In order to use this function the type of the value must be a string
24528  * and it must be marked in the schema file as an enumerated type.
24529  *
24530  * It is a programmer error to give a @key that isn't contained in the
24531  * schema for @settings or is not marked as an enumerated type.
24532  *
24533  * If the value stored in the configuration database is not a valid
24534  * value for the enumerated type then this function will return the
24535  * default value.
24536  *
24537  * Returns: the enum value
24538  * Since: 2.26
24539  */
24540
24541
24542 /**
24543  * g_settings_get_flags:
24544  * @settings: a #GSettings object
24545  * @key: the key to get the value for
24546  *
24547  * Gets the value that is stored in @settings for @key and converts it
24548  * to the flags value that it represents.
24549  *
24550  * In order to use this function the type of the value must be an array
24551  * of strings and it must be marked in the schema file as an flags type.
24552  *
24553  * It is a programmer error to give a @key that isn't contained in the
24554  * schema for @settings or is not marked as a flags type.
24555  *
24556  * If the value stored in the configuration database is not a valid
24557  * value for the flags type then this function will return the default
24558  * value.
24559  *
24560  * Returns: the flags value
24561  * Since: 2.26
24562  */
24563
24564
24565 /**
24566  * g_settings_get_has_unapplied:
24567  * @settings: a #GSettings object
24568  *
24569  * Returns whether the #GSettings object has any unapplied
24570  * changes.  This can only be the case if it is in 'delayed-apply' mode.
24571  *
24572  * Returns: %TRUE if @settings has unapplied changes
24573  * Since: 2.26
24574  */
24575
24576
24577 /**
24578  * g_settings_get_int:
24579  * @settings: a #GSettings object
24580  * @key: the key to get the value for
24581  *
24582  * Gets the value that is stored at @key in @settings.
24583  *
24584  * A convenience variant of g_settings_get() for 32-bit integers.
24585  *
24586  * It is a programmer error to give a @key that isn't specified as
24587  * having a int32 type in the schema for @settings.
24588  *
24589  * Returns: an integer
24590  * Since: 2.26
24591  */
24592
24593
24594 /**
24595  * g_settings_get_mapped:
24596  * @settings: a #GSettings object
24597  * @key: the key to get the value for
24598  * @mapping: (scope call): the function to map the value in the settings database to the value used by the application
24599  * @user_data: user data for @mapping
24600  *
24601  * Gets the value that is stored at @key in @settings, subject to
24602  * application-level validation/mapping.
24603  *
24604  * You should use this function when the application needs to perform
24605  * some processing on the value of the key (for example, parsing).  The
24606  * @mapping function performs that processing.  If the function
24607  * indicates that the processing was unsuccessful (due to a parse error,
24608  * for example) then the mapping is tried again with another value.
24609  *
24610  * This allows a robust 'fall back to defaults' behaviour to be
24611  * implemented somewhat automatically.
24612  *
24613  * The first value that is tried is the user's setting for the key.  If
24614  * the mapping function fails to map this value, other values may be
24615  * tried in an unspecified order (system or site defaults, translated
24616  * schema default values, untranslated schema default values, etc).
24617  *
24618  * If the mapping function fails for all possible values, one additional
24619  * attempt is made: the mapping function is called with a %NULL value.
24620  * If the mapping function still indicates failure at this point then
24621  * the application will be aborted.
24622  *
24623  * The result parameter for the @mapping function is pointed to a
24624  * #gpointer which is initially set to %NULL.  The same pointer is given
24625  * to each invocation of @mapping.  The final value of that #gpointer is
24626  * what is returned by this function.  %NULL is valid; it is returned
24627  * just as any other value would be.
24628  *
24629  * Returns: (transfer full): the result, which may be %NULL
24630  */
24631
24632
24633 /**
24634  * g_settings_get_range:
24635  * @settings: a #GSettings
24636  * @key: the key to query the range of
24637  *
24638  * Queries the range of a key.
24639  *
24640  * This function will return a #GVariant that fully describes the range
24641  * of values that are valid for @key.
24642  *
24643  * The type of #GVariant returned is <literal>(sv)</literal>.  The
24644  * string describes the type of range restriction in effect.  The type
24645  * and meaning of the value contained in the variant depends on the
24646  * string.
24647  *
24648  * If the string is <literal>'type'</literal> then the variant contains
24649  * an empty array.  The element type of that empty array is the expected
24650  * type of value and all values of that type are valid.
24651  *
24652  * If the string is <literal>'enum'</literal> then the variant contains
24653  * an array enumerating the possible values.  Each item in the array is
24654  * a possible valid value and no other values are valid.
24655  *
24656  * If the string is <literal>'flags'</literal> then the variant contains
24657  * an array.  Each item in the array is a value that may appear zero or
24658  * one times in an array to be used as the value for this key.  For
24659  * example, if the variant contained the array <literal>['x',
24660  * 'y']</literal> then the valid values for the key would be
24661  * <literal>[]</literal>, <literal>['x']</literal>,
24662  * <literal>['y']</literal>, <literal>['x', 'y']</literal> and
24663  * <literal>['y', 'x']</literal>.
24664  *
24665  * Finally, if the string is <literal>'range'</literal> then the variant
24666  * contains a pair of like-typed values -- the minimum and maximum
24667  * permissible values for this key.
24668  *
24669  * This information should not be used by normal programs.  It is
24670  * considered to be a hint for introspection purposes.  Normal programs
24671  * should already know what is permitted by their own schema.  The
24672  * format may change in any way in the future -- but particularly, new
24673  * forms may be added to the possibilities described above.
24674  *
24675  * It is a programmer error to give a @key that isn't contained in the
24676  * schema for @settings.
24677  *
24678  * You should free the returned value with g_variant_unref() when it is
24679  * no longer needed.
24680  *
24681  * Returns: a #GVariant describing the range
24682  * Since: 2.28
24683  */
24684
24685
24686 /**
24687  * g_settings_get_string:
24688  * @settings: a #GSettings object
24689  * @key: the key to get the value for
24690  *
24691  * Gets the value that is stored at @key in @settings.
24692  *
24693  * A convenience variant of g_settings_get() for strings.
24694  *
24695  * It is a programmer error to give a @key that isn't specified as
24696  * having a string type in the schema for @settings.
24697  *
24698  * Returns: a newly-allocated string
24699  * Since: 2.26
24700  */
24701
24702
24703 /**
24704  * g_settings_get_strv:
24705  * @settings: a #GSettings object
24706  * @key: the key to get the value for
24707  *
24708  * A convenience variant of g_settings_get() for string arrays.
24709  *
24710  * It is a programmer error to give a @key that isn't specified as
24711  * having an array of strings type in the schema for @settings.
24712  *
24713  * Returns: (array zero-terminated=1) (transfer full): a newly-allocated, %NULL-terminated array of strings, the value that is stored at @key in @settings.
24714  * Since: 2.26
24715  */
24716
24717
24718 /**
24719  * g_settings_get_uint:
24720  * @settings: a #GSettings object
24721  * @key: the key to get the value for
24722  *
24723  * Gets the value that is stored at @key in @settings.
24724  *
24725  * A convenience variant of g_settings_get() for 32-bit unsigned
24726  * integers.
24727  *
24728  * It is a programmer error to give a @key that isn't specified as
24729  * having a uint32 type in the schema for @settings.
24730  *
24731  * Returns: an unsigned integer
24732  * Since: 2.30
24733  */
24734
24735
24736 /**
24737  * g_settings_get_value:
24738  * @settings: a #GSettings object
24739  * @key: the key to get the value for
24740  *
24741  * Gets the value that is stored in @settings for @key.
24742  *
24743  * It is a programmer error to give a @key that isn't contained in the
24744  * schema for @settings.
24745  *
24746  * Returns: a new #GVariant
24747  * Since: 2.26
24748  */
24749
24750
24751 /**
24752  * g_settings_is_writable:
24753  * @settings: a #GSettings object
24754  * @name: the name of a key
24755  *
24756  * Finds out if a key can be written or not
24757  *
24758  * Returns: %TRUE if the key @name is writable
24759  * Since: 2.26
24760  */
24761
24762
24763 /**
24764  * g_settings_list_children:
24765  * @settings: a #GSettings object
24766  *
24767  * Gets the list of children on @settings.
24768  *
24769  * The list is exactly the list of strings for which it is not an error
24770  * to call g_settings_get_child().
24771  *
24772  * For GSettings objects that are lists, this value can change at any
24773  * time and you should connect to the "children-changed" signal to watch
24774  * for those changes.  Note that there is a race condition here: you may
24775  * request a child after listing it only for it to have been destroyed
24776  * in the meantime.  For this reason, g_settings_get_child() may return
24777  * %NULL even for a child that was listed by this function.
24778  *
24779  * For GSettings objects that are not lists, you should probably not be
24780  * calling this function from "normal" code (since you should already
24781  * know what children are in your schema).  This function may still be
24782  * useful there for introspection reasons, however.
24783  *
24784  * You should free the return value with g_strfreev() when you are done
24785  * with it.
24786  *
24787  * Returns: (transfer full) (element-type utf8): a list of the children on @settings
24788  */
24789
24790
24791 /**
24792  * g_settings_list_keys:
24793  * @settings: a #GSettings object
24794  *
24795  * Introspects the list of keys on @settings.
24796  *
24797  * You should probably not be calling this function from "normal" code
24798  * (since you should already know what keys are in your schema).  This
24799  * function is intended for introspection reasons.
24800  *
24801  * You should free the return value with g_strfreev() when you are done
24802  * with it.
24803  *
24804  * Returns: (transfer full) (element-type utf8): a list of the keys on @settings
24805  */
24806
24807
24808 /**
24809  * g_settings_list_relocatable_schemas:
24810  *
24811  * Gets a list of the relocatable #GSettings schemas installed on the
24812  * system.  These are schemas that do not provide their own path.  It is
24813  * usual to instantiate these schemas directly, but if you want to you
24814  * can use g_settings_new_with_path() to specify the path.
24815  *
24816  * The output of this function, taken together with the output of
24817  * g_settings_list_schemas() represents the complete list of all
24818  * installed schemas.
24819  *
24820  * Returns: (element-type utf8) (transfer none): a list of relocatable #GSettings schemas that are available.  The list must not be modified or freed.
24821  * Since: 2.28
24822  */
24823
24824
24825 /**
24826  * g_settings_list_schemas:
24827  *
24828  * Gets a list of the #GSettings schemas installed on the system.  The
24829  * returned list is exactly the list of schemas for which you may call
24830  * g_settings_new() without adverse effects.
24831  *
24832  * This function does not list the schemas that do not provide their own
24833  * paths (ie: schemas for which you must use
24834  * g_settings_new_with_path()).  See
24835  * g_settings_list_relocatable_schemas() for that.
24836  *
24837  * Returns: (element-type utf8) (transfer none): a list of #GSettings schemas that are available.  The list must not be modified or freed.
24838  * Since: 2.26
24839  */
24840
24841
24842 /**
24843  * g_settings_new:
24844  * @schema_id: the id of the schema
24845  *
24846  * Creates a new #GSettings object with the schema specified by
24847  * @schema_id.
24848  *
24849  * Signals on the newly created #GSettings object will be dispatched
24850  * via the thread-default #GMainContext in effect at the time of the
24851  * call to g_settings_new().  The new #GSettings will hold a reference
24852  * on the context.  See g_main_context_push_thread_default().
24853  *
24854  * Returns: a new #GSettings object
24855  * Since: 2.26
24856  */
24857
24858
24859 /**
24860  * g_settings_new_full:
24861  * @schema: a #GSettingsSchema
24862  * @backend: (allow-none): a #GSettingsBackend
24863  * @path: (allow-none): the path to use
24864  *
24865  * Creates a new #GSettings object with a given schema, backend and
24866  * path.
24867  *
24868  * It should be extremely rare that you ever want to use this function.
24869  * It is made available for advanced use-cases (such as plugin systems
24870  * that want to provide access to schemas loaded from custom locations,
24871  * etc).
24872  *
24873  * At the most basic level, a #GSettings object is a pure composition of
24874  * 4 things: a #GSettingsSchema, a #GSettingsBackend, a path within that
24875  * backend, and a #GMainContext to which signals are dispatched.
24876  *
24877  * This constructor therefore gives you full control over constructing
24878  * #GSettings instances.  The first 4 parameters are given directly as
24879  * @schema, @backend and @path, and the main context is taken from the
24880  * thread-default (as per g_settings_new()).
24881  *
24882  * If @backend is %NULL then the default backend is used.
24883  *
24884  * If @path is %NULL then the path from the schema is used.  It is an
24885  * error f @path is %NULL and the schema has no path of its own or if
24886  * @path is non-%NULL and not equal to the path that the schema does
24887  * have.
24888  *
24889  * Returns: a new #GSettings object
24890  * Since: 2.32
24891  */
24892
24893
24894 /**
24895  * g_settings_new_with_backend:
24896  * @schema_id: the id of the schema
24897  * @backend: the #GSettingsBackend to use
24898  *
24899  * Creates a new #GSettings object with the schema specified by
24900  * @schema_id and a given #GSettingsBackend.
24901  *
24902  * Creating a #GSettings object with a different backend allows accessing
24903  * settings from a database other than the usual one. For example, it may make
24904  * sense to pass a backend corresponding to the "defaults" settings database on
24905  * the system to get a settings object that modifies the system default
24906  * settings instead of the settings for this user.
24907  *
24908  * Returns: a new #GSettings object
24909  * Since: 2.26
24910  */
24911
24912
24913 /**
24914  * g_settings_new_with_backend_and_path:
24915  * @schema_id: the id of the schema
24916  * @backend: the #GSettingsBackend to use
24917  * @path: the path to use
24918  *
24919  * Creates a new #GSettings object with the schema specified by
24920  * @schema_id and a given #GSettingsBackend and path.
24921  *
24922  * This is a mix of g_settings_new_with_backend() and
24923  * g_settings_new_with_path().
24924  *
24925  * Returns: a new #GSettings object
24926  * Since: 2.26
24927  */
24928
24929
24930 /**
24931  * g_settings_new_with_path:
24932  * @schema_id: the id of the schema
24933  * @path: the path to use
24934  *
24935  * Creates a new #GSettings object with the relocatable schema specified
24936  * by @schema_id and a given path.
24937  *
24938  * You only need to do this if you want to directly create a settings
24939  * object with a schema that doesn't have a specified path of its own.
24940  * That's quite rare.
24941  *
24942  * It is a programmer error to call this function for a schema that
24943  * has an explicitly specified path.
24944  *
24945  * Returns: a new #GSettings object
24946  * Since: 2.26
24947  */
24948
24949
24950 /**
24951  * g_settings_range_check:
24952  * @settings: a #GSettings
24953  * @key: the key to check
24954  * @value: the value to check
24955  *
24956  * Checks if the given @value is of the correct type and within the
24957  * permitted range for @key.
24958  *
24959  * This API is not intended to be used by normal programs -- they should
24960  * already know what is permitted by their own schemas.  This API is
24961  * meant to be used by programs such as editors or commandline tools.
24962  *
24963  * It is a programmer error to give a @key that isn't contained in the
24964  * schema for @settings.
24965  *
24966  * Returns: %TRUE if @value is valid for @key
24967  * Since: 2.28
24968  */
24969
24970
24971 /**
24972  * g_settings_reset:
24973  * @settings: a #GSettings object
24974  * @key: the name of a key
24975  *
24976  * Resets @key to its default value.
24977  *
24978  * This call resets the key, as much as possible, to its default value.
24979  * That might the value specified in the schema or the one set by the
24980  * administrator.
24981  */
24982
24983
24984 /**
24985  * g_settings_revert:
24986  * @settings: a #GSettings instance
24987  *
24988  * Reverts all non-applied changes to the settings.  This function
24989  * does nothing unless @settings is in 'delay-apply' mode; see
24990  * g_settings_delay().  In the normal case settings are always applied
24991  * immediately.
24992  *
24993  * Change notifications will be emitted for affected keys.
24994  */
24995
24996
24997 /**
24998  * g_settings_schema_get_id:
24999  * @schema: a #GSettingsSchema
25000  *
25001  * Get the ID of @schema.
25002  *
25003  * Returns: (transfer none): the ID
25004  */
25005
25006
25007 /**
25008  * g_settings_schema_get_path:
25009  * @schema: a #GSettingsSchema
25010  *
25011  * Gets the path associated with @schema, or %NULL.
25012  *
25013  * Schemas may be single-instance or relocatable.  Single-instance
25014  * schemas correspond to exactly one set of keys in the backend
25015  * database: those located at the path returned by this function.
25016  *
25017  * Relocatable schemas can be referenced by other schemas and can
25018  * threfore describe multiple sets of keys at different locations.  For
25019  * relocatable schemas, this function will return %NULL.
25020  *
25021  * Returns: (transfer none): the path of the schema, or %NULL
25022  * Since: 2.32
25023  */
25024
25025
25026 /**
25027  * g_settings_schema_ref:
25028  * @schema: a #GSettingsSchema
25029  *
25030  * Increase the reference count of @schema, returning a new reference.
25031  *
25032  * Returns: a new reference to @schema
25033  * Since: 2.32
25034  */
25035
25036
25037 /**
25038  * g_settings_schema_source_get_default:
25039  *
25040  * Gets the default system schema source.
25041  *
25042  * This function is not required for normal uses of #GSettings but it
25043  * may be useful to authors of plugin management systems or to those who
25044  * want to introspect the content of schemas.
25045  *
25046  * If no schemas are installed, %NULL will be returned.
25047  *
25048  * The returned source may actually consist of multiple schema sources
25049  * from different directories, depending on which directories were given
25050  * in <envar>XDG_DATA_DIRS</envar> and
25051  * <envar>GSETTINGS_SCHEMA_DIR</envar>.  For this reason, all lookups
25052  * performed against the default source should probably be done
25053  * recursively.
25054  *
25055  * Returns: (transfer none): the default schema source
25056  * Since: 2.32
25057  */
25058
25059
25060 /**
25061  * g_settings_schema_source_lookup:
25062  * @source: a #GSettingsSchemaSource
25063  * @schema_id: a schema ID
25064  * @recursive: %TRUE if the lookup should be recursive
25065  *
25066  * Looks up a schema with the identifier @schema_id in @source.
25067  *
25068  * This function is not required for normal uses of #GSettings but it
25069  * may be useful to authors of plugin management systems or to those who
25070  * want to introspect the content of schemas.
25071  *
25072  * If the schema isn't found directly in @source and @recursive is %TRUE
25073  * then the parent sources will also be checked.
25074  *
25075  * If the schema isn't found, %NULL is returned.
25076  *
25077  * Returns: (transfer full): a new #GSettingsSchema
25078  * Since: 2.32
25079  */
25080
25081
25082 /**
25083  * g_settings_schema_source_new_from_directory:
25084  * @directory: the filename of a directory
25085  * @parent: (allow-none): a #GSettingsSchemaSource, or %NULL
25086  * @trusted: %TRUE, if the directory is trusted
25087  * @error: a pointer to a #GError pointer set to %NULL, or %NULL
25088  *
25089  * Attempts to create a new schema source corresponding to the contents
25090  * of the given directory.
25091  *
25092  * This function is not required for normal uses of #GSettings but it
25093  * may be useful to authors of plugin management systems.
25094  *
25095  * The directory should contain a file called
25096  * <filename>gschemas.compiled</filename> as produced by
25097  * <command>glib-compile-schemas</command>.
25098  *
25099  * If @trusted is %TRUE then <filename>gschemas.compiled</filename> is
25100  * trusted not to be corrupted.  This assumption has a performance
25101  * advantage, but can result in crashes or inconsistent behaviour in the
25102  * case of a corrupted file.  Generally, you should set @trusted to
25103  * %TRUE for files installed by the system and to %FALSE for files in
25104  * the home directory.
25105  *
25106  * If @parent is non-%NULL then there are two effects.
25107  *
25108  * First, if g_settings_schema_source_lookup() is called with the
25109  * @recursive flag set to %TRUE and the schema can not be found in the
25110  * source, the lookup will recurse to the parent.
25111  *
25112  * Second, any references to other schemas specified within this
25113  * source (ie: <literal>child</literal> or <literal>extents</literal>)
25114  * references may be resolved from the @parent.
25115  *
25116  * For this second reason, except in very unusual situations, the
25117  * @parent should probably be given as the default schema source, as
25118  * returned by g_settings_schema_source_get_default().
25119  *
25120  * Since: 2.32
25121  */
25122
25123
25124 /**
25125  * g_settings_schema_source_ref:
25126  * @source: a #GSettingsSchemaSource
25127  *
25128  * Increase the reference count of @source, returning a new reference.
25129  *
25130  * Returns: a new reference to @source
25131  * Since: 2.32
25132  */
25133
25134
25135 /**
25136  * g_settings_schema_source_unref:
25137  * @source: a #GSettingsSchemaSource
25138  *
25139  * Decrease the reference count of @source, possibly freeing it.
25140  *
25141  * Since: 2.32
25142  */
25143
25144
25145 /**
25146  * g_settings_schema_unref:
25147  * @schema: a #GSettingsSchema
25148  *
25149  * Decrease the reference count of @schema, possibly freeing it.
25150  *
25151  * Since: 2.32
25152  */
25153
25154
25155 /**
25156  * g_settings_set:
25157  * @settings: a #GSettings object
25158  * @key: the name of the key to set
25159  * @format: a #GVariant format string
25160  * @...: arguments as per @format
25161  *
25162  * Sets @key in @settings to @value.
25163  *
25164  * A convenience function that combines g_settings_set_value() with
25165  * g_variant_new().
25166  *
25167  * It is a programmer error to give a @key that isn't contained in the
25168  * schema for @settings or for the #GVariantType of @format to mismatch
25169  * the type given in the schema.
25170  *
25171  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
25172  * Since: 2.26
25173  */
25174
25175
25176 /**
25177  * g_settings_set_boolean:
25178  * @settings: a #GSettings object
25179  * @key: the name of the key to set
25180  * @value: the value to set it to
25181  *
25182  * Sets @key in @settings to @value.
25183  *
25184  * A convenience variant of g_settings_set() for booleans.
25185  *
25186  * It is a programmer error to give a @key that isn't specified as
25187  * having a boolean type in the schema for @settings.
25188  *
25189  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
25190  * Since: 2.26
25191  */
25192
25193
25194 /**
25195  * g_settings_set_double:
25196  * @settings: a #GSettings object
25197  * @key: the name of the key to set
25198  * @value: the value to set it to
25199  *
25200  * Sets @key in @settings to @value.
25201  *
25202  * A convenience variant of g_settings_set() for doubles.
25203  *
25204  * It is a programmer error to give a @key that isn't specified as
25205  * having a 'double' type in the schema for @settings.
25206  *
25207  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
25208  * Since: 2.26
25209  */
25210
25211
25212 /**
25213  * g_settings_set_enum:
25214  * @settings: a #GSettings object
25215  * @key: a key, within @settings
25216  * @value: an enumerated value
25217  *
25218  * Looks up the enumerated type nick for @value and writes it to @key,
25219  * within @settings.
25220  *
25221  * It is a programmer error to give a @key that isn't contained in the
25222  * schema for @settings or is not marked as an enumerated type, or for
25223  * @value not to be a valid value for the named type.
25224  *
25225  * After performing the write, accessing @key directly with
25226  * g_settings_get_string() will return the 'nick' associated with
25227  * @value.
25228  *
25229  * Returns: %TRUE, if the set succeeds
25230  */
25231
25232
25233 /**
25234  * g_settings_set_flags:
25235  * @settings: a #GSettings object
25236  * @key: a key, within @settings
25237  * @value: a flags value
25238  *
25239  * Looks up the flags type nicks for the bits specified by @value, puts
25240  * them in an array of strings and writes the array to @key, within
25241  * @settings.
25242  *
25243  * It is a programmer error to give a @key that isn't contained in the
25244  * schema for @settings or is not marked as a flags type, or for @value
25245  * to contain any bits that are not value for the named type.
25246  *
25247  * After performing the write, accessing @key directly with
25248  * g_settings_get_strv() will return an array of 'nicks'; one for each
25249  * bit in @value.
25250  *
25251  * Returns: %TRUE, if the set succeeds
25252  */
25253
25254
25255 /**
25256  * g_settings_set_int:
25257  * @settings: a #GSettings object
25258  * @key: the name of the key to set
25259  * @value: the value to set it to
25260  *
25261  * Sets @key in @settings to @value.
25262  *
25263  * A convenience variant of g_settings_set() for 32-bit integers.
25264  *
25265  * It is a programmer error to give a @key that isn't specified as
25266  * having a int32 type in the schema for @settings.
25267  *
25268  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
25269  * Since: 2.26
25270  */
25271
25272
25273 /**
25274  * g_settings_set_string:
25275  * @settings: a #GSettings object
25276  * @key: the name of the key to set
25277  * @value: the value to set it to
25278  *
25279  * Sets @key in @settings to @value.
25280  *
25281  * A convenience variant of g_settings_set() for strings.
25282  *
25283  * It is a programmer error to give a @key that isn't specified as
25284  * having a string type in the schema for @settings.
25285  *
25286  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
25287  * Since: 2.26
25288  */
25289
25290
25291 /**
25292  * g_settings_set_strv:
25293  * @settings: a #GSettings object
25294  * @key: the name of the key to set
25295  * @value: (allow-none) (array zero-terminated=1): the value to set it to, or %NULL
25296  *
25297  * Sets @key in @settings to @value.
25298  *
25299  * A convenience variant of g_settings_set() for string arrays.  If
25300  * @value is %NULL, then @key is set to be the empty array.
25301  *
25302  * It is a programmer error to give a @key that isn't specified as
25303  * having an array of strings type in the schema for @settings.
25304  *
25305  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
25306  * Since: 2.26
25307  */
25308
25309
25310 /**
25311  * g_settings_set_uint:
25312  * @settings: a #GSettings object
25313  * @key: the name of the key to set
25314  * @value: the value to set it to
25315  *
25316  * Sets @key in @settings to @value.
25317  *
25318  * A convenience variant of g_settings_set() for 32-bit unsigned
25319  * integers.
25320  *
25321  * It is a programmer error to give a @key that isn't specified as
25322  * having a uint32 type in the schema for @settings.
25323  *
25324  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
25325  * Since: 2.30
25326  */
25327
25328
25329 /**
25330  * g_settings_set_value:
25331  * @settings: a #GSettings object
25332  * @key: the name of the key to set
25333  * @value: a #GVariant of the correct type
25334  *
25335  * Sets @key in @settings to @value.
25336  *
25337  * It is a programmer error to give a @key that isn't contained in the
25338  * schema for @settings or for @value to have the incorrect type, per
25339  * the schema.
25340  *
25341  * If @value is floating then this function consumes the reference.
25342  *
25343  * Returns: %TRUE if setting the key succeeded, %FALSE if the key was not writable
25344  * Since: 2.26
25345  */
25346
25347
25348 /**
25349  * g_settings_sync:
25350  *
25351  * Ensures that all pending operations for the given are complete for
25352  * the default backend.
25353  *
25354  * Writes made to a #GSettings are handled asynchronously.  For this
25355  * reason, it is very unlikely that the changes have it to disk by the
25356  * time g_settings_set() returns.
25357  *
25358  * This call will block until all of the writes have made it to the
25359  * backend.  Since the mainloop is not running, no change notifications
25360  * will be dispatched during this call (but some may be queued by the
25361  * time the call is done).
25362  */
25363
25364
25365 /**
25366  * g_settings_unbind:
25367  * @object: the object
25368  * @property: the property whose binding is removed
25369  *
25370  * Removes an existing binding for @property on @object.
25371  *
25372  * Note that bindings are automatically removed when the
25373  * object is finalized, so it is rarely necessary to call this
25374  * function.
25375  *
25376  * Since: 2.26
25377  */
25378
25379
25380 /**
25381  * g_simple_action_group_add_entries:
25382  * @simple: a #GSimpleActionGroup
25383  * @entries: (array length=n_entries): a pointer to the first item in an array of #GActionEntry structs
25384  * @n_entries: the length of @entries, or -1
25385  * @user_data: the user data for signal connections
25386  *
25387  * A convenience function for creating multiple #GSimpleAction instances
25388  * and adding them to the action group.
25389  *
25390  * Since: 2.30
25391  */
25392
25393
25394 /**
25395  * g_simple_action_group_insert:
25396  * @simple: a #GSimpleActionGroup
25397  * @action: a #GAction
25398  *
25399  * Adds an action to the action group.
25400  *
25401  * If the action group already contains an action with the same name as
25402  * @action then the old action is dropped from the group.
25403  *
25404  * The action group takes its own reference on @action.
25405  *
25406  * Since: 2.28
25407  */
25408
25409
25410 /**
25411  * g_simple_action_group_lookup:
25412  * @simple: a #GSimpleActionGroup
25413  * @action_name: the name of an action
25414  *
25415  * Looks up the action with the name @action_name in the group.
25416  *
25417  * If no such action exists, returns %NULL.
25418  *
25419  * Returns: (transfer none): a #GAction, or %NULL
25420  * Since: 2.28
25421  */
25422
25423
25424 /**
25425  * g_simple_action_group_new:
25426  *
25427  * Creates a new, empty, #GSimpleActionGroup.
25428  *
25429  * Returns: a new #GSimpleActionGroup
25430  * Since: 2.28
25431  */
25432
25433
25434 /**
25435  * g_simple_action_group_remove:
25436  * @simple: a #GSimpleActionGroup
25437  * @action_name: the name of the action
25438  *
25439  * Removes the named action from the action group.
25440  *
25441  * If no action of this name is in the group then nothing happens.
25442  *
25443  * Since: 2.28
25444  */
25445
25446
25447 /**
25448  * g_simple_action_new:
25449  * @name: the name of the action
25450  * @parameter_type: (allow-none): the type of parameter to the activate function
25451  *
25452  * Creates a new action.
25453  *
25454  * The created action is stateless.  See g_simple_action_new_stateful().
25455  *
25456  * Returns: a new #GSimpleAction
25457  * Since: 2.28
25458  */
25459
25460
25461 /**
25462  * g_simple_action_new_stateful:
25463  * @name: the name of the action
25464  * @parameter_type: (allow-none): the type of the parameter to the activate function
25465  * @state: the initial state of the action
25466  *
25467  * Creates a new stateful action.
25468  *
25469  * @state is the initial state of the action.  All future state values
25470  * must have the same #GVariantType as the initial state.
25471  *
25472  * If the @state GVariant is floating, it is consumed.
25473  *
25474  * Returns: a new #GSimpleAction
25475  * Since: 2.28
25476  */
25477
25478
25479 /**
25480  * g_simple_action_set_enabled:
25481  * @simple: a #GSimpleAction
25482  * @enabled: whether the action is enabled
25483  *
25484  * Sets the action as enabled or not.
25485  *
25486  * An action must be enabled in order to be activated or in order to
25487  * have its state changed from outside callers.
25488  *
25489  * This should only be called by the implementor of the action.  Users
25490  * of the action should not attempt to modify its enabled flag.
25491  *
25492  * Since: 2.28
25493  */
25494
25495
25496 /**
25497  * g_simple_action_set_state:
25498  * @simple: a #GSimpleAction
25499  * @value: the new #GVariant for the state
25500  *
25501  * Sets the state of the action.
25502  *
25503  * This directly updates the 'state' property to the given value.
25504  *
25505  * This should only be called by the implementor of the action.  Users
25506  * of the action should not attempt to directly modify the 'state'
25507  * property.  Instead, they should call g_action_change_state() to
25508  * request the change.
25509  *
25510  * Since: 2.30
25511  */
25512
25513
25514 /**
25515  * g_simple_async_report_error_in_idle: (skip)
25516  * @object: (allow-none): a #GObject, or %NULL.
25517  * @callback: a #GAsyncReadyCallback.
25518  * @user_data: user data passed to @callback.
25519  * @domain: a #GQuark containing the error domain (usually #G_IO_ERROR).
25520  * @code: a specific error code.
25521  * @format: a formatted error reporting string.
25522  * @...: a list of variables to fill in @format.
25523  *
25524  * Reports an error in an asynchronous function in an idle function by
25525  * directly setting the contents of the #GAsyncResult with the given error
25526  * information.
25527  */
25528
25529
25530 /**
25531  * g_simple_async_report_gerror_in_idle:
25532  * @object: (allow-none): a #GObject, or %NULL
25533  * @callback: (scope async): a #GAsyncReadyCallback.
25534  * @user_data: (closure): user data passed to @callback.
25535  * @error: the #GError to report
25536  *
25537  * Reports an error in an idle function. Similar to
25538  * g_simple_async_report_error_in_idle(), but takes a #GError rather
25539  * than building a new one.
25540  */
25541
25542
25543 /**
25544  * g_simple_async_report_take_gerror_in_idle: (skip)
25545  * @object: (allow-none): a #GObject, or %NULL
25546  * @callback: a #GAsyncReadyCallback.
25547  * @user_data: user data passed to @callback.
25548  * @error: the #GError to report
25549  *
25550  * Reports an error in an idle function. Similar to
25551  * g_simple_async_report_gerror_in_idle(), but takes over the caller's
25552  * ownership of @error, so the caller does not have to free it any more.
25553  *
25554  * Since: 2.28
25555  */
25556
25557
25558 /**
25559  * g_simple_async_result_complete:
25560  * @simple: a #GSimpleAsyncResult.
25561  *
25562  * Completes an asynchronous I/O job immediately. Must be called in
25563  * the thread where the asynchronous result was to be delivered, as it
25564  * invokes the callback directly. If you are in a different thread use
25565  * g_simple_async_result_complete_in_idle().
25566  *
25567  * Calling this function takes a reference to @simple for as long as
25568  * is needed to complete the call.
25569  */
25570
25571
25572 /**
25573  * g_simple_async_result_complete_in_idle:
25574  * @simple: a #GSimpleAsyncResult.
25575  *
25576  * Completes an asynchronous function in an idle handler in the <link
25577  * linkend="g-main-context-push-thread-default">thread-default main
25578  * loop</link> of the thread that @simple was initially created in
25579  * (and re-pushes that context around the invocation of the callback).
25580  *
25581  * Calling this function takes a reference to @simple for as long as
25582  * is needed to complete the call.
25583  */
25584
25585
25586 /**
25587  * g_simple_async_result_get_op_res_gboolean:
25588  * @simple: a #GSimpleAsyncResult.
25589  *
25590  * Gets the operation result boolean from within the asynchronous result.
25591  *
25592  * Returns: %TRUE if the operation's result was %TRUE, %FALSE if the operation's result was %FALSE.
25593  */
25594
25595
25596 /**
25597  * g_simple_async_result_get_op_res_gpointer: (skip)
25598  * @simple: a #GSimpleAsyncResult.
25599  *
25600  * Gets a pointer result as returned by the asynchronous function.
25601  *
25602  * Returns: a pointer from the result.
25603  */
25604
25605
25606 /**
25607  * g_simple_async_result_get_op_res_gssize:
25608  * @simple: a #GSimpleAsyncResult.
25609  *
25610  * Gets a gssize from the asynchronous result.
25611  *
25612  * Returns: a gssize returned from the asynchronous function.
25613  */
25614
25615
25616 /**
25617  * g_simple_async_result_get_source_tag: (skip)
25618  * @simple: a #GSimpleAsyncResult.
25619  *
25620  * Gets the source tag for the #GSimpleAsyncResult.
25621  *
25622  * Returns: a #gpointer to the source object for the #GSimpleAsyncResult.
25623  */
25624
25625
25626 /**
25627  * g_simple_async_result_is_valid:
25628  * @result: the #GAsyncResult passed to the _finish function.
25629  * @source: the #GObject passed to the _finish function.
25630  * @source_tag: the asynchronous function.
25631  *
25632  * Ensures that the data passed to the _finish function of an async
25633  * operation is consistent.  Three checks are performed.
25634  *
25635  * First, @result is checked to ensure that it is really a
25636  * #GSimpleAsyncResult.  Second, @source is checked to ensure that it
25637  * matches the source object of @result.  Third, @source_tag is
25638  * checked to ensure that it is either %NULL (as it is when the result was
25639  * created by g_simple_async_report_error_in_idle() or
25640  * g_simple_async_report_gerror_in_idle()) or equal to the
25641  * @source_tag argument given to g_simple_async_result_new() (which, by
25642  * convention, is a pointer to the _async function corresponding to the
25643  * _finish function from which this function is called).
25644  *
25645  * Returns: #TRUE if all checks passed or #FALSE if any failed.
25646  * Since: 2.20
25647  */
25648
25649
25650 /**
25651  * g_simple_async_result_new:
25652  * @source_object: (allow-none): a #GObject, or %NULL.
25653  * @callback: (scope async): a #GAsyncReadyCallback.
25654  * @user_data: (closure): user data passed to @callback.
25655  * @source_tag: the asynchronous function.
25656  *
25657  * Creates a #GSimpleAsyncResult.
25658  *
25659  * The common convention is to create the #GSimpleAsyncResult in the
25660  * function that starts the asynchronous operation and use that same
25661  * function as the @source_tag.
25662  *
25663  * If your operation supports cancellation with #GCancellable (which it
25664  * probably should) then you should provide the user's cancellable to
25665  * g_simple_async_result_set_check_cancellable() immediately after
25666  * this function returns.
25667  *
25668  * Returns: a #GSimpleAsyncResult.
25669  */
25670
25671
25672 /**
25673  * g_simple_async_result_new_error:
25674  * @source_object: (allow-none): a #GObject, or %NULL.
25675  * @callback: (scope async): a #GAsyncReadyCallback.
25676  * @user_data: (closure): user data passed to @callback.
25677  * @domain: a #GQuark.
25678  * @code: an error code.
25679  * @format: a string with format characters.
25680  * @...: a list of values to insert into @format.
25681  *
25682  * Creates a new #GSimpleAsyncResult with a set error.
25683  *
25684  * Returns: a #GSimpleAsyncResult.
25685  */
25686
25687
25688 /**
25689  * g_simple_async_result_new_from_error:
25690  * @source_object: (allow-none): a #GObject, or %NULL.
25691  * @callback: (scope async): a #GAsyncReadyCallback.
25692  * @user_data: (closure): user data passed to @callback.
25693  * @error: a #GError
25694  *
25695  * Creates a #GSimpleAsyncResult from an error condition.
25696  *
25697  * Returns: a #GSimpleAsyncResult.
25698  */
25699
25700
25701 /**
25702  * g_simple_async_result_new_take_error: (skip)
25703  * @source_object: (allow-none): a #GObject, or %NULL
25704  * @callback: (scope async): a #GAsyncReadyCallback
25705  * @user_data: (closure): user data passed to @callback
25706  * @error: a #GError
25707  *
25708  * Creates a #GSimpleAsyncResult from an error condition, and takes over the
25709  * caller's ownership of @error, so the caller does not need to free it anymore.
25710  *
25711  * Returns: a #GSimpleAsyncResult
25712  * Since: 2.28
25713  */
25714
25715
25716 /**
25717  * g_simple_async_result_propagate_error:
25718  * @simple: a #GSimpleAsyncResult.
25719  * @dest: (out): a location to propagate the error to.
25720  *
25721  * Propagates an error from within the simple asynchronous result to
25722  * a given destination.
25723  *
25724  * If the #GCancellable given to a prior call to
25725  * g_simple_async_result_set_check_cancellable() is cancelled then this
25726  * function will return %TRUE with @dest set appropriately.
25727  *
25728  * Returns: %TRUE if the error was propagated to @dest. %FALSE otherwise.
25729  */
25730
25731
25732 /**
25733  * g_simple_async_result_run_in_thread: (skip)
25734  * @simple: a #GSimpleAsyncResult.
25735  * @func: a #GSimpleAsyncThreadFunc.
25736  * @io_priority: the io priority of the request.
25737  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25738  *
25739  * Runs the asynchronous job in a separate thread and then calls
25740  * g_simple_async_result_complete_in_idle() on @simple to return
25741  * the result to the appropriate main loop.
25742  *
25743  * Calling this function takes a reference to @simple for as long as
25744  * is needed to run the job and report its completion.
25745  */
25746
25747
25748 /**
25749  * g_simple_async_result_set_check_cancellable:
25750  * @simple: a #GSimpleAsyncResult
25751  * @check_cancellable: (allow-none): a #GCancellable to check, or %NULL to unset
25752  *
25753  * Sets a #GCancellable to check before dispatching results.
25754  *
25755  * This function has one very specific purpose: the provided cancellable
25756  * is checked at the time of g_simple_async_result_propagate_error() If
25757  * it is cancelled, these functions will return an "Operation was
25758  * cancelled" error (%G_IO_ERROR_CANCELLED).
25759  *
25760  * Implementors of cancellable asynchronous functions should use this in
25761  * order to provide a guarantee to their callers that cancelling an
25762  * async operation will reliably result in an error being returned for
25763  * that operation (even if a positive result for the operation has
25764  * already been sent as an idle to the main context to be dispatched).
25765  *
25766  * The checking described above is done regardless of any call to the
25767  * unrelated g_simple_async_result_set_handle_cancellation() function.
25768  *
25769  * Since: 2.32
25770  */
25771
25772
25773 /**
25774  * g_simple_async_result_set_error: (skip)
25775  * @simple: a #GSimpleAsyncResult.
25776  * @domain: a #GQuark (usually #G_IO_ERROR).
25777  * @code: an error code.
25778  * @format: a formatted error reporting string.
25779  * @...: a list of variables to fill in @format.
25780  *
25781  * Sets an error within the asynchronous result without a #GError.
25782  */
25783
25784
25785 /**
25786  * g_simple_async_result_set_error_va: (skip)
25787  * @simple: a #GSimpleAsyncResult.
25788  * @domain: a #GQuark (usually #G_IO_ERROR).
25789  * @code: an error code.
25790  * @format: a formatted error reporting string.
25791  * @args: va_list of arguments.
25792  *
25793  * Sets an error within the asynchronous result without a #GError.
25794  * Unless writing a binding, see g_simple_async_result_set_error().
25795  */
25796
25797
25798 /**
25799  * g_simple_async_result_set_from_error:
25800  * @simple: a #GSimpleAsyncResult.
25801  * @error: #GError.
25802  *
25803  * Sets the result from a #GError.
25804  */
25805
25806
25807 /**
25808  * g_simple_async_result_set_handle_cancellation:
25809  * @simple: a #GSimpleAsyncResult.
25810  * @handle_cancellation: a #gboolean.
25811  *
25812  * Sets whether to handle cancellation within the asynchronous operation.
25813  *
25814  * This function has nothing to do with
25815  * g_simple_async_result_set_check_cancellable().  It only refers to the
25816  * #GCancellable passed to g_simple_async_result_run_in_thread().
25817  */
25818
25819
25820 /**
25821  * g_simple_async_result_set_op_res_gboolean:
25822  * @simple: a #GSimpleAsyncResult.
25823  * @op_res: a #gboolean.
25824  *
25825  * Sets the operation result to a boolean within the asynchronous result.
25826  */
25827
25828
25829 /**
25830  * g_simple_async_result_set_op_res_gpointer: (skip)
25831  * @simple: a #GSimpleAsyncResult.
25832  * @op_res: a pointer result from an asynchronous function.
25833  * @destroy_op_res: a #GDestroyNotify function.
25834  *
25835  * Sets the operation result within the asynchronous result to a pointer.
25836  */
25837
25838
25839 /**
25840  * g_simple_async_result_set_op_res_gssize:
25841  * @simple: a #GSimpleAsyncResult.
25842  * @op_res: a #gssize.
25843  *
25844  * Sets the operation result within the asynchronous result to
25845  * the given @op_res.
25846  */
25847
25848
25849 /**
25850  * g_simple_async_result_take_error: (skip)
25851  * @simple: a #GSimpleAsyncResult
25852  * @error: a #GError
25853  *
25854  * Sets the result from @error, and takes over the caller's ownership
25855  * of @error, so the caller does not need to free it any more.
25856  *
25857  * Since: 2.28
25858  */
25859
25860
25861 /**
25862  * g_simple_permission_new:
25863  * @allowed: %TRUE if the action is allowed
25864  *
25865  * Creates a new #GPermission instance that represents an action that is
25866  * either always or never allowed.
25867  *
25868  * Returns: the #GSimplePermission, as a #GPermission
25869  * Since: 2.26
25870  */
25871
25872
25873 /**
25874  * g_socket_accept:
25875  * @socket: a #GSocket.
25876  * @cancellable: (allow-none): a %GCancellable or %NULL
25877  * @error: #GError for error reporting, or %NULL to ignore.
25878  *
25879  * Accept incoming connections on a connection-based socket. This removes
25880  * the first outstanding connection request from the listening socket and
25881  * creates a #GSocket object for it.
25882  *
25883  * The @socket must be bound to a local address with g_socket_bind() and
25884  * must be listening for incoming connections (g_socket_listen()).
25885  *
25886  * If there are no outstanding connections then the operation will block
25887  * or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
25888  * To be notified of an incoming connection, wait for the %G_IO_IN condition.
25889  *
25890  * Returns: (transfer full): a new #GSocket, or %NULL on error. Free the returned object with g_object_unref().
25891  * Since: 2.22
25892  */
25893
25894
25895 /**
25896  * g_socket_address_enumerator_next:
25897  * @enumerator: a #GSocketAddressEnumerator
25898  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25899  * @error: a #GError.
25900  *
25901  * Retrieves the next #GSocketAddress from @enumerator. Note that this
25902  * may block for some amount of time. (Eg, a #GNetworkAddress may need
25903  * to do a DNS lookup before it can return an address.) Use
25904  * g_socket_address_enumerator_next_async() if you need to avoid
25905  * blocking.
25906  *
25907  * If @enumerator is expected to yield addresses, but for some reason
25908  * is unable to (eg, because of a DNS error), then the first call to
25909  * g_socket_address_enumerator_next() will return an appropriate error
25910  * in *@error. However, if the first call to
25911  * g_socket_address_enumerator_next() succeeds, then any further
25912  * internal errors (other than @cancellable being triggered) will be
25913  * ignored.
25914  *
25915  * 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.
25916  */
25917
25918
25919 /**
25920  * g_socket_address_enumerator_next_async:
25921  * @enumerator: a #GSocketAddressEnumerator
25922  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
25923  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
25924  * @user_data: (closure): the data to pass to callback function
25925  *
25926  * Asynchronously retrieves the next #GSocketAddress from @enumerator
25927  * and then calls @callback, which must call
25928  * g_socket_address_enumerator_next_finish() to get the result.
25929  */
25930
25931
25932 /**
25933  * g_socket_address_enumerator_next_finish:
25934  * @enumerator: a #GSocketAddressEnumerator
25935  * @result: a #GAsyncResult
25936  * @error: a #GError
25937  *
25938  * Retrieves the result of a completed call to
25939  * g_socket_address_enumerator_next_async(). See
25940  * g_socket_address_enumerator_next() for more information about
25941  * error handling.
25942  *
25943  * 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.
25944  */
25945
25946
25947 /**
25948  * g_socket_address_get_family:
25949  * @address: a #GSocketAddress
25950  *
25951  * Gets the socket family type of @address.
25952  *
25953  * Returns: the socket family type of @address.
25954  * Since: 2.22
25955  */
25956
25957
25958 /**
25959  * g_socket_address_get_native_size:
25960  * @address: a #GSocketAddress
25961  *
25962  * Gets the size of @address's native <type>struct sockaddr</type>.
25963  * You can use this to allocate memory to pass to
25964  * g_socket_address_to_native().
25965  *
25966  * Returns: the size of the native <type>struct sockaddr</type> that @address represents
25967  * Since: 2.22
25968  */
25969
25970
25971 /**
25972  * g_socket_address_new_from_native:
25973  * @native: a pointer to a <type>struct sockaddr</type>
25974  * @len: the size of the memory location pointed to by @native
25975  *
25976  * Creates a #GSocketAddress subclass corresponding to the native
25977  * <type>struct sockaddr</type> @native.
25978  *
25979  * Returns: a new #GSocketAddress if @native could successfully be converted, otherwise %NULL.
25980  * Since: 2.22
25981  */
25982
25983
25984 /**
25985  * g_socket_address_to_native:
25986  * @address: a #GSocketAddress
25987  * @dest: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
25988  * @destlen: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
25989  * @error: #GError for error reporting, or %NULL to ignore.
25990  *
25991  * Converts a #GSocketAddress to a native <type>struct
25992  * sockaddr</type>, which can be passed to low-level functions like
25993  * connect() or bind().
25994  *
25995  * If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
25996  * returned. If the address type is not known on the system
25997  * then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
25998  *
25999  * Returns: %TRUE if @dest was filled in, %FALSE on error
26000  * Since: 2.22
26001  */
26002
26003
26004 /**
26005  * g_socket_bind:
26006  * @socket: a #GSocket.
26007  * @address: a #GSocketAddress specifying the local address.
26008  * @allow_reuse: whether to allow reusing this address
26009  * @error: #GError for error reporting, or %NULL to ignore.
26010  *
26011  * When a socket is created it is attached to an address family, but it
26012  * doesn't have an address in this family. g_socket_bind() assigns the
26013  * address (sometimes called name) of the socket.
26014  *
26015  * It is generally required to bind to a local address before you can
26016  * receive connections. (See g_socket_listen() and g_socket_accept() ).
26017  * In certain situations, you may also want to bind a socket that will be
26018  * used to initiate connections, though this is not normally required.
26019  *
26020  * @allow_reuse should be %TRUE for server sockets (sockets that you will
26021  * eventually call g_socket_accept() on), and %FALSE for client sockets.
26022  * (Specifically, if it is %TRUE, then g_socket_bind() will set the
26023  * %SO_REUSEADDR flag on the socket, allowing it to bind @address even if
26024  * that address was previously used by another socket that has not yet been
26025  * fully cleaned-up by the kernel. Failing to set this flag on a server
26026  * socket may cause the bind call to return %G_IO_ERROR_ADDRESS_IN_USE if
26027  * the server program is stopped and then immediately restarted.)
26028  *
26029  * Returns: %TRUE on success, %FALSE on error.
26030  * Since: 2.22
26031  */
26032
26033
26034 /**
26035  * g_socket_check_connect_result:
26036  * @socket: a #GSocket
26037  * @error: #GError for error reporting, or %NULL to ignore.
26038  *
26039  * Checks and resets the pending connect error for the socket.
26040  * This is used to check for errors when g_socket_connect() is
26041  * used in non-blocking mode.
26042  *
26043  * Returns: %TRUE if no error, %FALSE otherwise, setting @error to the error
26044  * Since: 2.22
26045  */
26046
26047
26048 /**
26049  * g_socket_client_add_application_proxy:
26050  * @client: a #GSocketClient
26051  * @protocol: The proxy protocol
26052  *
26053  * Enable proxy protocols to be handled by the application. When the
26054  * indicated proxy protocol is returned by the #GProxyResolver,
26055  * #GSocketClient will consider this protocol as supported but will
26056  * not try to find a #GProxy instance to handle handshaking. The
26057  * application must check for this case by calling
26058  * g_socket_connection_get_remote_address() on the returned
26059  * #GSocketConnection, and seeing if it's a #GProxyAddress of the
26060  * appropriate type, to determine whether or not it needs to handle
26061  * the proxy handshaking itself.
26062  *
26063  * This should be used for proxy protocols that are dialects of
26064  * another protocol such as HTTP proxy. It also allows cohabitation of
26065  * proxy protocols that are reused between protocols. A good example
26066  * is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
26067  * be use as generic socket proxy through the HTTP CONNECT method.
26068  *
26069  * When the proxy is detected as being an application proxy, TLS handshake
26070  * will be skipped. This is required to let the application do the proxy
26071  * specific handshake.
26072  */
26073
26074
26075 /**
26076  * g_socket_client_connect:
26077  * @client: a #GSocketClient.
26078  * @connectable: a #GSocketConnectable specifying the remote address.
26079  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
26080  * @error: #GError for error reporting, or %NULL to ignore.
26081  *
26082  * Tries to resolve the @connectable and make a network connection to it.
26083  *
26084  * Upon a successful connection, a new #GSocketConnection is constructed
26085  * and returned.  The caller owns this new object and must drop their
26086  * reference to it when finished with it.
26087  *
26088  * The type of the #GSocketConnection object returned depends on the type of
26089  * the underlying socket that is used. For instance, for a TCP/IP connection
26090  * it will be a #GTcpConnection.
26091  *
26092  * The socket created will be the same family as the address that the
26093  * @connectable resolves to, unless family is set with g_socket_client_set_family()
26094  * or indirectly via g_socket_client_set_local_address(). The socket type
26095  * defaults to %G_SOCKET_TYPE_STREAM but can be set with
26096  * g_socket_client_set_socket_type().
26097  *
26098  * If a local address is specified with g_socket_client_set_local_address() the
26099  * socket will be bound to this address before connecting.
26100  *
26101  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
26102  * Since: 2.22
26103  */
26104
26105
26106 /**
26107  * g_socket_client_connect_async:
26108  * @client: a #GSocketClient
26109  * @connectable: a #GSocketConnectable specifying the remote address.
26110  * @cancellable: (allow-none): a #GCancellable, or %NULL
26111  * @callback: (scope async): a #GAsyncReadyCallback
26112  * @user_data: (closure): user data for the callback
26113  *
26114  * This is the asynchronous version of g_socket_client_connect().
26115  *
26116  * When the operation is finished @callback will be
26117  * called. You can then call g_socket_client_connect_finish() to get
26118  * the result of the operation.
26119  *
26120  * Since: 2.22
26121  */
26122
26123
26124 /**
26125  * g_socket_client_connect_finish:
26126  * @client: a #GSocketClient.
26127  * @result: a #GAsyncResult.
26128  * @error: a #GError location to store the error occurring, or %NULL to ignore.
26129  *
26130  * Finishes an async connect operation. See g_socket_client_connect_async()
26131  *
26132  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
26133  * Since: 2.22
26134  */
26135
26136
26137 /**
26138  * g_socket_client_connect_to_host:
26139  * @client: a #GSocketClient
26140  * @host_and_port: the name and optionally port of the host to connect to
26141  * @default_port: the default port to connect to
26142  * @cancellable: (allow-none): a #GCancellable, or %NULL
26143  * @error: a pointer to a #GError, or %NULL
26144  *
26145  * This is a helper function for g_socket_client_connect().
26146  *
26147  * Attempts to create a TCP connection to the named host.
26148  *
26149  * @host_and_port may be in any of a number of recognized formats; an IPv6
26150  * address, an IPv4 address, or a domain name (in which case a DNS
26151  * lookup is performed).  Quoting with [] is supported for all address
26152  * types.  A port override may be specified in the usual way with a
26153  * colon.  Ports may be given as decimal numbers or symbolic names (in
26154  * which case an /etc/services lookup is performed).
26155  *
26156  * If no port override is given in @host_and_port then @default_port will be
26157  * used as the port number to connect to.
26158  *
26159  * In general, @host_and_port is expected to be provided by the user (allowing
26160  * them to give the hostname, and a port override if necessary) and
26161  * @default_port is expected to be provided by the application.
26162  *
26163  * In the case that an IP address is given, a single connection
26164  * attempt is made.  In the case that a name is given, multiple
26165  * connection attempts may be made, in turn and according to the
26166  * number of address records in DNS, until a connection succeeds.
26167  *
26168  * Upon a successful connection, a new #GSocketConnection is constructed
26169  * and returned.  The caller owns this new object and must drop their
26170  * reference to it when finished with it.
26171  *
26172  * In the event of any failure (DNS error, service not found, no hosts
26173  * connectable) %NULL is returned and @error (if non-%NULL) is set
26174  * accordingly.
26175  *
26176  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
26177  * Since: 2.22
26178  */
26179
26180
26181 /**
26182  * g_socket_client_connect_to_host_async:
26183  * @client: a #GSocketClient
26184  * @host_and_port: the name and optionally the port of the host to connect to
26185  * @default_port: the default port to connect to
26186  * @cancellable: (allow-none): a #GCancellable, or %NULL
26187  * @callback: (scope async): a #GAsyncReadyCallback
26188  * @user_data: (closure): user data for the callback
26189  *
26190  * This is the asynchronous version of g_socket_client_connect_to_host().
26191  *
26192  * When the operation is finished @callback will be
26193  * called. You can then call g_socket_client_connect_to_host_finish() to get
26194  * the result of the operation.
26195  *
26196  * Since: 2.22
26197  */
26198
26199
26200 /**
26201  * g_socket_client_connect_to_host_finish:
26202  * @client: a #GSocketClient.
26203  * @result: a #GAsyncResult.
26204  * @error: a #GError location to store the error occurring, or %NULL to ignore.
26205  *
26206  * Finishes an async connect operation. See g_socket_client_connect_to_host_async()
26207  *
26208  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
26209  * Since: 2.22
26210  */
26211
26212
26213 /**
26214  * g_socket_client_connect_to_service:
26215  * @client: a #GSocketConnection
26216  * @domain: a domain name
26217  * @service: the name of the service to connect to
26218  * @cancellable: (allow-none): a #GCancellable, or %NULL
26219  * @error: a pointer to a #GError, or %NULL
26220  *
26221  * Attempts to create a TCP connection to a service.
26222  *
26223  * This call looks up the SRV record for @service at @domain for the
26224  * "tcp" protocol.  It then attempts to connect, in turn, to each of
26225  * the hosts providing the service until either a connection succeeds
26226  * or there are no hosts remaining.
26227  *
26228  * Upon a successful connection, a new #GSocketConnection is constructed
26229  * and returned.  The caller owns this new object and must drop their
26230  * reference to it when finished with it.
26231  *
26232  * In the event of any failure (DNS error, service not found, no hosts
26233  * connectable) %NULL is returned and @error (if non-%NULL) is set
26234  * accordingly.
26235  *
26236  * Returns: (transfer full): a #GSocketConnection if successful, or %NULL on error
26237  */
26238
26239
26240 /**
26241  * g_socket_client_connect_to_service_async:
26242  * @client: a #GSocketClient
26243  * @domain: a domain name
26244  * @service: the name of the service to connect to
26245  * @cancellable: (allow-none): a #GCancellable, or %NULL
26246  * @callback: (scope async): a #GAsyncReadyCallback
26247  * @user_data: (closure): user data for the callback
26248  *
26249  * This is the asynchronous version of
26250  * g_socket_client_connect_to_service().
26251  *
26252  * Since: 2.22
26253  */
26254
26255
26256 /**
26257  * g_socket_client_connect_to_service_finish:
26258  * @client: a #GSocketClient.
26259  * @result: a #GAsyncResult.
26260  * @error: a #GError location to store the error occurring, or %NULL to ignore.
26261  *
26262  * Finishes an async connect operation. See g_socket_client_connect_to_service_async()
26263  *
26264  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
26265  * Since: 2.22
26266  */
26267
26268
26269 /**
26270  * g_socket_client_connect_to_uri:
26271  * @client: a #GSocketClient
26272  * @uri: A network URI
26273  * @default_port: the default port to connect to
26274  * @cancellable: (allow-none): a #GCancellable, or %NULL
26275  * @error: a pointer to a #GError, or %NULL
26276  *
26277  * This is a helper function for g_socket_client_connect().
26278  *
26279  * Attempts to create a TCP connection with a network URI.
26280  *
26281  * @uri may be any valid URI containing an "authority" (hostname/port)
26282  * component. If a port is not specified in the URI, @default_port
26283  * will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
26284  * (#GSocketClient does not know to automatically assume TLS for
26285  * certain URI schemes.)
26286  *
26287  * Using this rather than g_socket_client_connect() or
26288  * g_socket_client_connect_to_host() allows #GSocketClient to
26289  * determine when to use application-specific proxy protocols.
26290  *
26291  * Upon a successful connection, a new #GSocketConnection is constructed
26292  * and returned.  The caller owns this new object and must drop their
26293  * reference to it when finished with it.
26294  *
26295  * In the event of any failure (DNS error, service not found, no hosts
26296  * connectable) %NULL is returned and @error (if non-%NULL) is set
26297  * accordingly.
26298  *
26299  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
26300  * Since: 2.26
26301  */
26302
26303
26304 /**
26305  * g_socket_client_connect_to_uri_async:
26306  * @client: a #GSocketClient
26307  * @uri: a network uri
26308  * @default_port: the default port to connect to
26309  * @cancellable: (allow-none): a #GCancellable, or %NULL
26310  * @callback: (scope async): a #GAsyncReadyCallback
26311  * @user_data: (closure): user data for the callback
26312  *
26313  * This is the asynchronous version of g_socket_client_connect_to_uri().
26314  *
26315  * When the operation is finished @callback will be
26316  * called. You can then call g_socket_client_connect_to_uri_finish() to get
26317  * the result of the operation.
26318  *
26319  * Since: 2.26
26320  */
26321
26322
26323 /**
26324  * g_socket_client_connect_to_uri_finish:
26325  * @client: a #GSocketClient.
26326  * @result: a #GAsyncResult.
26327  * @error: a #GError location to store the error occurring, or %NULL to ignore.
26328  *
26329  * Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
26330  *
26331  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
26332  * Since: 2.26
26333  */
26334
26335
26336 /**
26337  * g_socket_client_get_enable_proxy:
26338  * @client: a #GSocketClient.
26339  *
26340  * Gets the proxy enable state; see g_socket_client_set_enable_proxy()
26341  *
26342  * Returns: whether proxying is enabled
26343  * Since: 2.26
26344  */
26345
26346
26347 /**
26348  * g_socket_client_get_family:
26349  * @client: a #GSocketClient.
26350  *
26351  * Gets the socket family of the socket client.
26352  *
26353  * See g_socket_client_set_family() for details.
26354  *
26355  * Returns: a #GSocketFamily
26356  * Since: 2.22
26357  */
26358
26359
26360 /**
26361  * g_socket_client_get_local_address:
26362  * @client: a #GSocketClient.
26363  *
26364  * Gets the local address of the socket client.
26365  *
26366  * See g_socket_client_set_local_address() for details.
26367  *
26368  * Returns: (transfer none): a #GSocketAddress or %NULL. Do not free.
26369  * Since: 2.22
26370  */
26371
26372
26373 /**
26374  * g_socket_client_get_protocol:
26375  * @client: a #GSocketClient
26376  *
26377  * Gets the protocol name type of the socket client.
26378  *
26379  * See g_socket_client_set_protocol() for details.
26380  *
26381  * Returns: a #GSocketProtocol
26382  * Since: 2.22
26383  */
26384
26385
26386 /**
26387  * g_socket_client_get_socket_type:
26388  * @client: a #GSocketClient.
26389  *
26390  * Gets the socket type of the socket client.
26391  *
26392  * See g_socket_client_set_socket_type() for details.
26393  *
26394  * Returns: a #GSocketFamily
26395  * Since: 2.22
26396  */
26397
26398
26399 /**
26400  * g_socket_client_get_timeout:
26401  * @client: a #GSocketClient
26402  *
26403  * Gets the I/O timeout time for sockets created by @client.
26404  *
26405  * See g_socket_client_set_timeout() for details.
26406  *
26407  * Returns: the timeout in seconds
26408  * Since: 2.26
26409  */
26410
26411
26412 /**
26413  * g_socket_client_get_tls:
26414  * @client: a #GSocketClient.
26415  *
26416  * Gets whether @client creates TLS connections. See
26417  * g_socket_client_set_tls() for details.
26418  *
26419  * Returns: whether @client uses TLS
26420  * Since: 2.28
26421  */
26422
26423
26424 /**
26425  * g_socket_client_get_tls_validation_flags:
26426  * @client: a #GSocketClient.
26427  *
26428  * Gets the TLS validation flags used creating TLS connections via
26429  * @client.
26430  *
26431  * Returns: the TLS validation flags
26432  * Since: 2.28
26433  */
26434
26435
26436 /**
26437  * g_socket_client_new:
26438  *
26439  * Creates a new #GSocketClient with the default options.
26440  *
26441  * Returns: a #GSocketClient. Free the returned object with g_object_unref().
26442  * Since: 2.22
26443  */
26444
26445
26446 /**
26447  * g_socket_client_set_enable_proxy:
26448  * @client: a #GSocketClient.
26449  * @enable: whether to enable proxies
26450  *
26451  * Sets whether or not @client attempts to make connections via a
26452  * proxy server. When enabled (the default), #GSocketClient will use a
26453  * #GProxyResolver to determine if a proxy protocol such as SOCKS is
26454  * needed, and automatically do the necessary proxy negotiation.
26455  *
26456  * Since: 2.26
26457  */
26458
26459
26460 /**
26461  * g_socket_client_set_family:
26462  * @client: a #GSocketClient.
26463  * @family: a #GSocketFamily
26464  *
26465  * Sets the socket family of the socket client.
26466  * If this is set to something other than %G_SOCKET_FAMILY_INVALID
26467  * then the sockets created by this object will be of the specified
26468  * family.
26469  *
26470  * This might be useful for instance if you want to force the local
26471  * connection to be an ipv4 socket, even though the address might
26472  * be an ipv6 mapped to ipv4 address.
26473  *
26474  * Since: 2.22
26475  */
26476
26477
26478 /**
26479  * g_socket_client_set_local_address:
26480  * @client: a #GSocketClient.
26481  * @address: (allow-none): a #GSocketAddress, or %NULL
26482  *
26483  * Sets the local address of the socket client.
26484  * The sockets created by this object will bound to the
26485  * specified address (if not %NULL) before connecting.
26486  *
26487  * This is useful if you want to ensure that the local
26488  * side of the connection is on a specific port, or on
26489  * a specific interface.
26490  *
26491  * Since: 2.22
26492  */
26493
26494
26495 /**
26496  * g_socket_client_set_protocol:
26497  * @client: a #GSocketClient.
26498  * @protocol: a #GSocketProtocol
26499  *
26500  * Sets the protocol of the socket client.
26501  * The sockets created by this object will use of the specified
26502  * protocol.
26503  *
26504  * If @protocol is %0 that means to use the default
26505  * protocol for the socket family and type.
26506  *
26507  * Since: 2.22
26508  */
26509
26510
26511 /**
26512  * g_socket_client_set_socket_type:
26513  * @client: a #GSocketClient.
26514  * @type: a #GSocketType
26515  *
26516  * Sets the socket type of the socket client.
26517  * The sockets created by this object will be of the specified
26518  * type.
26519  *
26520  * It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
26521  * as GSocketClient is used for connection oriented services.
26522  *
26523  * Since: 2.22
26524  */
26525
26526
26527 /**
26528  * g_socket_client_set_timeout:
26529  * @client: a #GSocketClient.
26530  * @timeout: the timeout
26531  *
26532  * Sets the I/O timeout for sockets created by @client. @timeout is a
26533  * time in seconds, or 0 for no timeout (the default).
26534  *
26535  * The timeout value affects the initial connection attempt as well,
26536  * so setting this may cause calls to g_socket_client_connect(), etc,
26537  * to fail with %G_IO_ERROR_TIMED_OUT.
26538  *
26539  * Since: 2.26
26540  */
26541
26542
26543 /**
26544  * g_socket_client_set_tls:
26545  * @client: a #GSocketClient.
26546  * @tls: whether to use TLS
26547  *
26548  * Sets whether @client creates TLS (aka SSL) connections. If @tls is
26549  * %TRUE, @client will wrap its connections in a #GTlsClientConnection
26550  * and perform a TLS handshake when connecting.
26551  *
26552  * Note that since #GSocketClient must return a #GSocketConnection,
26553  * but #GTlsClientConnection is not a #GSocketConnection, this
26554  * actually wraps the resulting #GTlsClientConnection in a
26555  * #GTcpWrapperConnection when returning it. You can use
26556  * g_tcp_wrapper_connection_get_base_io_stream() on the return value
26557  * to extract the #GTlsClientConnection.
26558  *
26559  * If you need to modify the behavior of the TLS handshake (eg, by
26560  * setting a client-side certificate to use, or connecting to the
26561  * #GTlsConnection::accept-certificate signal), you can connect to
26562  * @client's #GSocketClient::event signal and wait for it to be
26563  * emitted with %G_SOCKET_CLIENT_TLS_HANDSHAKING, which will give you
26564  * a chance to see the #GTlsClientConnection before the handshake
26565  * starts.
26566  *
26567  * Since: 2.28
26568  */
26569
26570
26571 /**
26572  * g_socket_client_set_tls_validation_flags:
26573  * @client: a #GSocketClient.
26574  * @flags: the validation flags
26575  *
26576  * Sets the TLS validation flags used when creating TLS connections
26577  * via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
26578  *
26579  * Since: 2.28
26580  */
26581
26582
26583 /**
26584  * g_socket_close:
26585  * @socket: a #GSocket
26586  * @error: #GError for error reporting, or %NULL to ignore.
26587  *
26588  * Closes the socket, shutting down any active connection.
26589  *
26590  * Closing a socket does not wait for all outstanding I/O operations
26591  * to finish, so the caller should not rely on them to be guaranteed
26592  * to complete even if the close returns with no error.
26593  *
26594  * Once the socket is closed, all other operations will return
26595  * %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
26596  * return an error.
26597  *
26598  * Sockets will be automatically closed when the last reference
26599  * is dropped, but you might want to call this function to make sure
26600  * resources are released as early as possible.
26601  *
26602  * Beware that due to the way that TCP works, it is possible for
26603  * recently-sent data to be lost if either you close a socket while the
26604  * %G_IO_IN condition is set, or else if the remote connection tries to
26605  * send something to you after you close the socket but before it has
26606  * finished reading all of the data you sent. There is no easy generic
26607  * way to avoid this problem; the easiest fix is to design the network
26608  * protocol such that the client will never send data "out of turn".
26609  * Another solution is for the server to half-close the connection by
26610  * calling g_socket_shutdown() with only the @shutdown_write flag set,
26611  * and then wait for the client to notice this and close its side of the
26612  * connection, after which the server can safely call g_socket_close().
26613  * (This is what #GTcpConnection does if you call
26614  * g_tcp_connection_set_graceful_disconnect(). But of course, this
26615  * only works if the client will close its connection after the server
26616  * does.)
26617  *
26618  * Returns: %TRUE on success, %FALSE on error
26619  * Since: 2.22
26620  */
26621
26622
26623 /**
26624  * g_socket_condition_check:
26625  * @socket: a #GSocket
26626  * @condition: a #GIOCondition mask to check
26627  *
26628  * Checks on the readiness of @socket to perform operations.
26629  * The operations specified in @condition are checked for and masked
26630  * against the currently-satisfied conditions on @socket. The result
26631  * is returned.
26632  *
26633  * Note that on Windows, it is possible for an operation to return
26634  * %G_IO_ERROR_WOULD_BLOCK even immediately after
26635  * g_socket_condition_check() has claimed that the socket is ready for
26636  * writing. Rather than calling g_socket_condition_check() and then
26637  * writing to the socket if it succeeds, it is generally better to
26638  * simply try writing to the socket right away, and try again later if
26639  * the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
26640  *
26641  * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
26642  * these conditions will always be set in the output if they are true.
26643  *
26644  * This call never blocks.
26645  *
26646  * Returns: the @GIOCondition mask of the current state
26647  * Since: 2.22
26648  */
26649
26650
26651 /**
26652  * g_socket_condition_timed_wait:
26653  * @socket: a #GSocket
26654  * @condition: a #GIOCondition mask to wait for
26655  * @timeout: the maximum time (in microseconds) to wait, or -1
26656  * @cancellable: (allow-none): a #GCancellable, or %NULL
26657  * @error: a #GError pointer, or %NULL
26658  *
26659  * Waits for up to @timeout microseconds for @condition to become true
26660  * on @socket. If the condition is met, %TRUE is returned.
26661  *
26662  * If @cancellable is cancelled before the condition is met, or if
26663  * @timeout (or the socket's #GSocket:timeout) is reached before the
26664  * condition is met, then %FALSE is returned and @error, if non-%NULL,
26665  * is set to the appropriate value (%G_IO_ERROR_CANCELLED or
26666  * %G_IO_ERROR_TIMED_OUT).
26667  *
26668  * If you don't want a timeout, use g_socket_condition_wait().
26669  * (Alternatively, you can pass -1 for @timeout.)
26670  *
26671  * Note that although @timeout is in microseconds for consistency with
26672  * other GLib APIs, this function actually only has millisecond
26673  * resolution, and the behavior is undefined if @timeout is not an
26674  * exact number of milliseconds.
26675  *
26676  * Returns: %TRUE if the condition was met, %FALSE otherwise
26677  * Since: 2.32
26678  */
26679
26680
26681 /**
26682  * g_socket_condition_wait:
26683  * @socket: a #GSocket
26684  * @condition: a #GIOCondition mask to wait for
26685  * @cancellable: (allow-none): a #GCancellable, or %NULL
26686  * @error: a #GError pointer, or %NULL
26687  *
26688  * Waits for @condition to become true on @socket. When the condition
26689  * is met, %TRUE is returned.
26690  *
26691  * If @cancellable is cancelled before the condition is met, or if the
26692  * socket has a timeout set and it is reached before the condition is
26693  * met, then %FALSE is returned and @error, if non-%NULL, is set to
26694  * the appropriate value (%G_IO_ERROR_CANCELLED or
26695  * %G_IO_ERROR_TIMED_OUT).
26696  *
26697  * See also g_socket_condition_timed_wait().
26698  *
26699  * Returns: %TRUE if the condition was met, %FALSE otherwise
26700  * Since: 2.22
26701  */
26702
26703
26704 /**
26705  * g_socket_connect:
26706  * @socket: a #GSocket.
26707  * @address: a #GSocketAddress specifying the remote address.
26708  * @cancellable: (allow-none): a %GCancellable or %NULL
26709  * @error: #GError for error reporting, or %NULL to ignore.
26710  *
26711  * Connect the socket to the specified remote address.
26712  *
26713  * For connection oriented socket this generally means we attempt to make
26714  * a connection to the @address. For a connection-less socket it sets
26715  * the default address for g_socket_send() and discards all incoming datagrams
26716  * from other sources.
26717  *
26718  * Generally connection oriented sockets can only connect once, but
26719  * connection-less sockets can connect multiple times to change the
26720  * default address.
26721  *
26722  * If the connect call needs to do network I/O it will block, unless
26723  * non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
26724  * and the user can be notified of the connection finishing by waiting
26725  * for the G_IO_OUT condition. The result of the connection must then be
26726  * checked with g_socket_check_connect_result().
26727  *
26728  * Returns: %TRUE if connected, %FALSE on error.
26729  * Since: 2.22
26730  */
26731
26732
26733 /**
26734  * g_socket_connectable_enumerate:
26735  * @connectable: a #GSocketConnectable
26736  *
26737  * Creates a #GSocketAddressEnumerator for @connectable.
26738  *
26739  * Returns: (transfer full): a new #GSocketAddressEnumerator.
26740  * Since: 2.22
26741  */
26742
26743
26744 /**
26745  * g_socket_connectable_proxy_enumerate:
26746  * @connectable: a #GSocketConnectable
26747  *
26748  * Creates a #GSocketAddressEnumerator for @connectable that will
26749  * return #GProxyAddress<!-- -->es for addresses that you must connect
26750  * to via a proxy.
26751  *
26752  * If @connectable does not implement
26753  * g_socket_connectable_proxy_enumerate(), this will fall back to
26754  * calling g_socket_connectable_enumerate().
26755  *
26756  * Returns: (transfer full): a new #GSocketAddressEnumerator.
26757  * Since: 2.26
26758  */
26759
26760
26761 /**
26762  * g_socket_connection_connect:
26763  * @connection: a #GSocketConnection
26764  * @address: a #GSocketAddress specifying the remote address.
26765  * @cancellable: (allow-none): a %GCancellable or %NULL
26766  * @error: #GError for error reporting, or %NULL to ignore.
26767  *
26768  * Connect @connection to the specified remote address.
26769  *
26770  * Returns: %TRUE if the connection succeeded, %FALSE on error
26771  * Since: 2.32
26772  */
26773
26774
26775 /**
26776  * g_socket_connection_connect_async:
26777  * @connection: a #GSocketConnection
26778  * @address: a #GSocketAddress specifying the remote address.
26779  * @cancellable: (allow-none): a %GCancellable or %NULL
26780  * @callback: (scope async): a #GAsyncReadyCallback
26781  * @user_data: (closure): user data for the callback
26782  *
26783  * Asynchronously connect @connection to the specified remote address.
26784  *
26785  * This clears the #GSocket:blocking flag on @connection's underlying
26786  * socket if it is currently set.
26787  *
26788  * Use g_socket_connection_connect_finish() to retrieve the result.
26789  *
26790  * Since: 2.32
26791  */
26792
26793
26794 /**
26795  * g_socket_connection_connect_finish:
26796  * @connection: a #GSocketConnection
26797  * @result: the #GAsyncResult
26798  * @error: #GError for error reporting, or %NULL to ignore.
26799  *
26800  * Gets the result of a g_socket_connection_connect_async() call.
26801  *
26802  * Returns: %TRUE if the connection succeeded, %FALSE on error
26803  * Since: 2.32
26804  */
26805
26806
26807 /**
26808  * g_socket_connection_factory_create_connection:
26809  * @socket: a #GSocket
26810  *
26811  * Creates a #GSocketConnection subclass of the right type for
26812  * @socket.
26813  *
26814  * Returns: (transfer full): a #GSocketConnection
26815  * Since: 2.22
26816  */
26817
26818
26819 /**
26820  * g_socket_connection_factory_lookup_type:
26821  * @family: a #GSocketFamily
26822  * @type: a #GSocketType
26823  * @protocol_id: a protocol id
26824  *
26825  * Looks up the #GType to be used when creating socket connections on
26826  * sockets with the specified @family, @type and @protocol_id.
26827  *
26828  * If no type is registered, the #GSocketConnection base type is returned.
26829  *
26830  * Returns: a #GType
26831  * Since: 2.22
26832  */
26833
26834
26835 /**
26836  * g_socket_connection_factory_register_type:
26837  * @g_type: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
26838  * @family: a #GSocketFamily
26839  * @type: a #GSocketType
26840  * @protocol: a protocol id
26841  *
26842  * Looks up the #GType to be used when creating socket connections on
26843  * sockets with the specified @family, @type and @protocol.
26844  *
26845  * If no type is registered, the #GSocketConnection base type is returned.
26846  *
26847  * Since: 2.22
26848  */
26849
26850
26851 /**
26852  * g_socket_connection_get_local_address:
26853  * @connection: a #GSocketConnection
26854  * @error: #GError for error reporting, or %NULL to ignore.
26855  *
26856  * Try to get the local address of a socket connection.
26857  *
26858  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
26859  * Since: 2.22
26860  */
26861
26862
26863 /**
26864  * g_socket_connection_get_remote_address:
26865  * @connection: a #GSocketConnection
26866  * @error: #GError for error reporting, or %NULL to ignore.
26867  *
26868  * Try to get the remote address of a socket connection.
26869  *
26870  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
26871  * Since: 2.22
26872  */
26873
26874
26875 /**
26876  * g_socket_connection_get_socket:
26877  * @connection: a #GSocketConnection
26878  *
26879  * Gets the underlying #GSocket object of the connection.
26880  * This can be useful if you want to do something unusual on it
26881  * not supported by the #GSocketConnection APIs.
26882  *
26883  * Returns: (transfer none): a #GSocketAddress or %NULL on error.
26884  * Since: 2.22
26885  */
26886
26887
26888 /**
26889  * g_socket_connection_is_connected:
26890  * @connection: a #GSocketConnection
26891  *
26892  * Checks if @connection is connected. This is equivalent to calling
26893  * g_socket_is_connected() on @connection's underlying #GSocket.
26894  *
26895  * Returns: whether @connection is connected
26896  * Since: 2.32
26897  */
26898
26899
26900 /**
26901  * g_socket_control_message_deserialize:
26902  * @level: a socket level
26903  * @type: a socket control message type for the given @level
26904  * @size: the size of the data in bytes
26905  * @data: (array length=size) (element-type guint8): pointer to the message data
26906  *
26907  * Tries to deserialize a socket control message of a given
26908  * @level and @type. This will ask all known (to GType) subclasses
26909  * of #GSocketControlMessage if they can understand this kind
26910  * of message and if so deserialize it into a #GSocketControlMessage.
26911  *
26912  * If there is no implementation for this kind of control message, %NULL
26913  * will be returned.
26914  *
26915  * Returns: (transfer full): the deserialized message or %NULL
26916  * Since: 2.22
26917  */
26918
26919
26920 /**
26921  * g_socket_control_message_get_level:
26922  * @message: a #GSocketControlMessage
26923  *
26924  * Returns the "level" (i.e. the originating protocol) of the control message.
26925  * This is often SOL_SOCKET.
26926  *
26927  * Returns: an integer describing the level
26928  * Since: 2.22
26929  */
26930
26931
26932 /**
26933  * g_socket_control_message_get_msg_type:
26934  * @message: a #GSocketControlMessage
26935  *
26936  * Returns the protocol specific type of the control message.
26937  * For instance, for UNIX fd passing this would be SCM_RIGHTS.
26938  *
26939  * Returns: an integer describing the type of control message
26940  * Since: 2.22
26941  */
26942
26943
26944 /**
26945  * g_socket_control_message_get_size:
26946  * @message: a #GSocketControlMessage
26947  *
26948  * Returns the space required for the control message, not including
26949  * headers or alignment.
26950  *
26951  * Returns: The number of bytes required.
26952  * Since: 2.22
26953  */
26954
26955
26956 /**
26957  * g_socket_control_message_serialize:
26958  * @message: a #GSocketControlMessage
26959  * @data: A buffer to write data to
26960  *
26961  * Converts the data in the message to bytes placed in the
26962  * message.
26963  *
26964  * @data is guaranteed to have enough space to fit the size
26965  * returned by g_socket_control_message_get_size() on this
26966  * object.
26967  *
26968  * Since: 2.22
26969  */
26970
26971
26972 /**
26973  * g_socket_create_source: (skip)
26974  * @socket: a #GSocket
26975  * @condition: a #GIOCondition mask to monitor
26976  * @cancellable: (allow-none): a %GCancellable or %NULL
26977  *
26978  * Creates a %GSource that can be attached to a %GMainContext to monitor
26979  * for the availibility of the specified @condition on the socket.
26980  *
26981  * The callback on the source is of the #GSocketSourceFunc type.
26982  *
26983  * It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
26984  * these conditions will always be reported output if they are true.
26985  *
26986  * @cancellable if not %NULL can be used to cancel the source, which will
26987  * cause the source to trigger, reporting the current condition (which
26988  * is likely 0 unless cancellation happened at the same time as a
26989  * condition change). You can check for this in the callback using
26990  * g_cancellable_is_cancelled().
26991  *
26992  * If @socket has a timeout set, and it is reached before @condition
26993  * occurs, the source will then trigger anyway, reporting %G_IO_IN or
26994  * %G_IO_OUT depending on @condition. However, @socket will have been
26995  * marked as having had a timeout, and so the next #GSocket I/O method
26996  * you call will then fail with a %G_IO_ERROR_TIMED_OUT.
26997  *
26998  * Returns: (transfer full): a newly allocated %GSource, free with g_source_unref().
26999  * Since: 2.22
27000  */
27001
27002
27003 /**
27004  * g_socket_get_available_bytes:
27005  * @socket: a #GSocket
27006  *
27007  * Get the amount of data pending in the OS input buffer.
27008  *
27009  * Returns: the number of bytes that can be read from the socket without blocking or -1 on error.
27010  * Since: 2.32
27011  */
27012
27013
27014 /**
27015  * g_socket_get_blocking:
27016  * @socket: a #GSocket.
27017  *
27018  * Gets the blocking mode of the socket. For details on blocking I/O,
27019  * see g_socket_set_blocking().
27020  *
27021  * Returns: %TRUE if blocking I/O is used, %FALSE otherwise.
27022  * Since: 2.22
27023  */
27024
27025
27026 /**
27027  * g_socket_get_broadcast:
27028  * @socket: a #GSocket.
27029  *
27030  * Gets the broadcast setting on @socket; if %TRUE,
27031  * it is possible to send packets to broadcast
27032  * addresses or receive from broadcast addresses.
27033  *
27034  * Returns: the broadcast setting on @socket
27035  * Since: 2.32
27036  */
27037
27038
27039 /**
27040  * g_socket_get_credentials:
27041  * @socket: a #GSocket.
27042  * @error: #GError for error reporting, or %NULL to ignore.
27043  *
27044  * Returns the credentials of the foreign process connected to this
27045  * socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
27046  * sockets).
27047  *
27048  * If this operation isn't supported on the OS, the method fails with
27049  * the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
27050  * by reading the %SO_PEERCRED option on the underlying socket.
27051  *
27052  * Other ways to obtain credentials from a foreign peer includes the
27053  * #GUnixCredentialsMessage type and
27054  * g_unix_connection_send_credentials() /
27055  * g_unix_connection_receive_credentials() functions.
27056  *
27057  * Returns: (transfer full): %NULL if @error is set, otherwise a #GCredentials object that must be freed with g_object_unref().
27058  * Since: 2.26
27059  */
27060
27061
27062 /**
27063  * g_socket_get_family:
27064  * @socket: a #GSocket.
27065  *
27066  * Gets the socket family of the socket.
27067  *
27068  * Returns: a #GSocketFamily
27069  * Since: 2.22
27070  */
27071
27072
27073 /**
27074  * g_socket_get_fd:
27075  * @socket: a #GSocket.
27076  *
27077  * Returns the underlying OS socket object. On unix this
27078  * is a socket file descriptor, and on windows this is
27079  * a Winsock2 SOCKET handle. This may be useful for
27080  * doing platform specific or otherwise unusual operations
27081  * on the socket.
27082  *
27083  * Returns: the file descriptor of the socket.
27084  * Since: 2.22
27085  */
27086
27087
27088 /**
27089  * g_socket_get_keepalive:
27090  * @socket: a #GSocket.
27091  *
27092  * Gets the keepalive mode of the socket. For details on this,
27093  * see g_socket_set_keepalive().
27094  *
27095  * Returns: %TRUE if keepalive is active, %FALSE otherwise.
27096  * Since: 2.22
27097  */
27098
27099
27100 /**
27101  * g_socket_get_listen_backlog:
27102  * @socket: a #GSocket.
27103  *
27104  * Gets the listen backlog setting of the socket. For details on this,
27105  * see g_socket_set_listen_backlog().
27106  *
27107  * Returns: the maximum number of pending connections.
27108  * Since: 2.22
27109  */
27110
27111
27112 /**
27113  * g_socket_get_local_address:
27114  * @socket: a #GSocket.
27115  * @error: #GError for error reporting, or %NULL to ignore.
27116  *
27117  * Try to get the local address of a bound socket. This is only
27118  * useful if the socket has been bound to a local address,
27119  * either explicitly or implicitly when connecting.
27120  *
27121  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
27122  * Since: 2.22
27123  */
27124
27125
27126 /**
27127  * g_socket_get_multicast_loopback:
27128  * @socket: a #GSocket.
27129  *
27130  * Gets the multicast loopback setting on @socket; if %TRUE (the
27131  * default), outgoing multicast packets will be looped back to
27132  * multicast listeners on the same host.
27133  *
27134  * Returns: the multicast loopback setting on @socket
27135  * Since: 2.32
27136  */
27137
27138
27139 /**
27140  * g_socket_get_multicast_ttl:
27141  * @socket: a #GSocket.
27142  *
27143  * Gets the multicast time-to-live setting on @socket; see
27144  * g_socket_set_multicast_ttl() for more details.
27145  *
27146  * Returns: the multicast time-to-live setting on @socket
27147  * Since: 2.32
27148  */
27149
27150
27151 /**
27152  * g_socket_get_protocol:
27153  * @socket: a #GSocket.
27154  *
27155  * Gets the socket protocol id the socket was created with.
27156  * In case the protocol is unknown, -1 is returned.
27157  *
27158  * Returns: a protocol id, or -1 if unknown
27159  * Since: 2.22
27160  */
27161
27162
27163 /**
27164  * g_socket_get_remote_address:
27165  * @socket: a #GSocket.
27166  * @error: #GError for error reporting, or %NULL to ignore.
27167  *
27168  * Try to get the remove address of a connected socket. This is only
27169  * useful for connection oriented sockets that have been connected.
27170  *
27171  * Returns: (transfer full): a #GSocketAddress or %NULL on error. Free the returned object with g_object_unref().
27172  * Since: 2.22
27173  */
27174
27175
27176 /**
27177  * g_socket_get_socket_type:
27178  * @socket: a #GSocket.
27179  *
27180  * Gets the socket type of the socket.
27181  *
27182  * Returns: a #GSocketType
27183  * Since: 2.22
27184  */
27185
27186
27187 /**
27188  * g_socket_get_timeout:
27189  * @socket: a #GSocket.
27190  *
27191  * Gets the timeout setting of the socket. For details on this, see
27192  * g_socket_set_timeout().
27193  *
27194  * Returns: the timeout in seconds
27195  * Since: 2.26
27196  */
27197
27198
27199 /**
27200  * g_socket_get_ttl:
27201  * @socket: a #GSocket.
27202  *
27203  * Gets the unicast time-to-live setting on @socket; see
27204  * g_socket_set_ttl() for more details.
27205  *
27206  * Returns: the time-to-live setting on @socket
27207  * Since: 2.32
27208  */
27209
27210
27211 /**
27212  * g_socket_is_closed:
27213  * @socket: a #GSocket
27214  *
27215  * Checks whether a socket is closed.
27216  *
27217  * Returns: %TRUE if socket is closed, %FALSE otherwise
27218  * Since: 2.22
27219  */
27220
27221
27222 /**
27223  * g_socket_is_connected:
27224  * @socket: a #GSocket.
27225  *
27226  * Check whether the socket is connected. This is only useful for
27227  * connection-oriented sockets.
27228  *
27229  * Returns: %TRUE if socket is connected, %FALSE otherwise.
27230  * Since: 2.22
27231  */
27232
27233
27234 /**
27235  * g_socket_join_multicast_group:
27236  * @socket: a #GSocket.
27237  * @group: a #GInetAddress specifying the group address to join.
27238  * @iface: (allow-none): Name of the interface to use, or %NULL
27239  * @source_specific: %TRUE if source-specific multicast should be used
27240  * @error: #GError for error reporting, or %NULL to ignore.
27241  *
27242  * Registers @socket to receive multicast messages sent to @group.
27243  * @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have
27244  * been bound to an appropriate interface and port with
27245  * g_socket_bind().
27246  *
27247  * If @iface is %NULL, the system will automatically pick an interface
27248  * to bind to based on @group.
27249  *
27250  * If @source_specific is %TRUE, source-specific multicast as defined
27251  * in RFC 4604 is used. Note that on older platforms this may fail
27252  * with a %G_IO_ERROR_NOT_SUPPORTED error.
27253  *
27254  * Returns: %TRUE on success, %FALSE on error.
27255  * Since: 2.32
27256  */
27257
27258
27259 /**
27260  * g_socket_leave_multicast_group:
27261  * @socket: a #GSocket.
27262  * @group: a #GInetAddress specifying the group address to leave.
27263  * @iface: (allow-none): Interface used
27264  * @source_specific: %TRUE if source-specific multicast was used
27265  * @error: #GError for error reporting, or %NULL to ignore.
27266  *
27267  * Removes @socket from the multicast group defined by @group, @iface,
27268  * and @source_specific (which must all have the same values they had
27269  * when you joined the group).
27270  *
27271  * @socket remains bound to its address and port, and can still receive
27272  * unicast messages after calling this.
27273  *
27274  * Returns: %TRUE on success, %FALSE on error.
27275  * Since: 2.32
27276  */
27277
27278
27279 /**
27280  * g_socket_listen:
27281  * @socket: a #GSocket.
27282  * @error: #GError for error reporting, or %NULL to ignore.
27283  *
27284  * Marks the socket as a server socket, i.e. a socket that is used
27285  * to accept incoming requests using g_socket_accept().
27286  *
27287  * Before calling this the socket must be bound to a local address using
27288  * g_socket_bind().
27289  *
27290  * To set the maximum amount of outstanding clients, use
27291  * g_socket_set_listen_backlog().
27292  *
27293  * Returns: %TRUE on success, %FALSE on error.
27294  * Since: 2.22
27295  */
27296
27297
27298 /**
27299  * g_socket_listener_accept:
27300  * @listener: a #GSocketListener
27301  * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL
27302  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27303  * @error: #GError for error reporting, or %NULL to ignore.
27304  *
27305  * Blocks waiting for a client to connect to any of the sockets added
27306  * to the listener. Returns a #GSocketConnection for the socket that was
27307  * accepted.
27308  *
27309  * If @source_object is not %NULL it will be filled out with the source
27310  * object specified when the corresponding socket or address was added
27311  * to the listener.
27312  *
27313  * If @cancellable is not %NULL, then the operation can be cancelled by
27314  * triggering the cancellable object from another thread. If the operation
27315  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
27316  *
27317  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27318  * Since: 2.22
27319  */
27320
27321
27322 /**
27323  * g_socket_listener_accept_async:
27324  * @listener: a #GSocketListener
27325  * @cancellable: (allow-none): a #GCancellable, or %NULL
27326  * @callback: (scope async): a #GAsyncReadyCallback
27327  * @user_data: (closure): user data for the callback
27328  *
27329  * This is the asynchronous version of g_socket_listener_accept().
27330  *
27331  * When the operation is finished @callback will be
27332  * called. You can then call g_socket_listener_accept_socket()
27333  * to get the result of the operation.
27334  *
27335  * Since: 2.22
27336  */
27337
27338
27339 /**
27340  * g_socket_listener_accept_finish:
27341  * @listener: a #GSocketListener
27342  * @result: a #GAsyncResult.
27343  * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
27344  * @error: a #GError location to store the error occurring, or %NULL to ignore.
27345  *
27346  * Finishes an async accept operation. See g_socket_listener_accept_async()
27347  *
27348  * Returns: (transfer full): a #GSocketConnection on success, %NULL on error.
27349  * Since: 2.22
27350  */
27351
27352
27353 /**
27354  * g_socket_listener_accept_socket:
27355  * @listener: a #GSocketListener
27356  * @source_object: (out) (transfer none) (allow-none): location where #GObject pointer will be stored, or %NULL.
27357  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
27358  * @error: #GError for error reporting, or %NULL to ignore.
27359  *
27360  * Blocks waiting for a client to connect to any of the sockets added
27361  * to the listener. Returns the #GSocket that was accepted.
27362  *
27363  * If you want to accept the high-level #GSocketConnection, not a #GSocket,
27364  * which is often the case, then you should use g_socket_listener_accept()
27365  * instead.
27366  *
27367  * If @source_object is not %NULL it will be filled out with the source
27368  * object specified when the corresponding socket or address was added
27369  * to the listener.
27370  *
27371  * If @cancellable is not %NULL, then the operation can be cancelled by
27372  * triggering the cancellable object from another thread. If the operation
27373  * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
27374  *
27375  * Returns: (transfer full): a #GSocket on success, %NULL on error.
27376  * Since: 2.22
27377  */
27378
27379
27380 /**
27381  * g_socket_listener_accept_socket_async:
27382  * @listener: a #GSocketListener
27383  * @cancellable: (allow-none): a #GCancellable, or %NULL
27384  * @callback: (scope async): a #GAsyncReadyCallback
27385  * @user_data: (closure): user data for the callback
27386  *
27387  * This is the asynchronous version of g_socket_listener_accept_socket().
27388  *
27389  * When the operation is finished @callback will be
27390  * called. You can then call g_socket_listener_accept_socket_finish()
27391  * to get the result of the operation.
27392  *
27393  * Since: 2.22
27394  */
27395
27396
27397 /**
27398  * g_socket_listener_accept_socket_finish:
27399  * @listener: a #GSocketListener
27400  * @result: a #GAsyncResult.
27401  * @source_object: (out) (transfer none) (allow-none): Optional #GObject identifying this source
27402  * @error: a #GError location to store the error occurring, or %NULL to ignore.
27403  *
27404  * Finishes an async accept operation. See g_socket_listener_accept_socket_async()
27405  *
27406  * Returns: (transfer full): a #GSocket on success, %NULL on error.
27407  * Since: 2.22
27408  */
27409
27410
27411 /**
27412  * g_socket_listener_add_address:
27413  * @listener: a #GSocketListener
27414  * @address: a #GSocketAddress
27415  * @type: a #GSocketType
27416  * @protocol: a #GSocketProtocol
27417  * @source_object: (allow-none): Optional #GObject identifying this source
27418  * @effective_address: (out) (allow-none): location to store the address that was bound to, or %NULL.
27419  * @error: #GError for error reporting, or %NULL to ignore.
27420  *
27421  * Creates a socket of type @type and protocol @protocol, binds
27422  * it to @address and adds it to the set of sockets we're accepting
27423  * sockets from.
27424  *
27425  * Note that adding an IPv6 address, depending on the platform,
27426  * may or may not result in a listener that also accepts IPv4
27427  * connections.  For more deterministic behavior, see
27428  * g_socket_listener_add_inet_port().
27429  *
27430  * @source_object will be passed out in the various calls
27431  * to accept to identify this particular source, which is
27432  * useful if you're listening on multiple addresses and do
27433  * different things depending on what address is connected to.
27434  *
27435  * If successful and @effective_address is non-%NULL then it will
27436  * be set to the address that the binding actually occurred at.  This
27437  * is helpful for determining the port number that was used for when
27438  * requesting a binding to port 0 (ie: "any port").  This address, if
27439  * requested, belongs to the caller and must be freed.
27440  *
27441  * Returns: %TRUE on success, %FALSE on error.
27442  * Since: 2.22
27443  */
27444
27445
27446 /**
27447  * g_socket_listener_add_any_inet_port:
27448  * @listener: a #GSocketListener
27449  * @source_object: (allow-none): Optional #GObject identifying this source
27450  * @error: a #GError location to store the error occurring, or %NULL to ignore.
27451  *
27452  * Listens for TCP connections on any available port number for both
27453  * IPv6 and IPv4 (if each is available).
27454  *
27455  * This is useful if you need to have a socket for incoming connections
27456  * but don't care about the specific port number.
27457  *
27458  * @source_object will be passed out in the various calls
27459  * to accept to identify this particular source, which is
27460  * useful if you're listening on multiple addresses and do
27461  * different things depending on what address is connected to.
27462  *
27463  * Returns: the port number, or 0 in case of failure.
27464  * Since: 2.24
27465  */
27466
27467
27468 /**
27469  * g_socket_listener_add_inet_port:
27470  * @listener: a #GSocketListener
27471  * @port: an IP port number (non-zero)
27472  * @source_object: (allow-none): Optional #GObject identifying this source
27473  * @error: #GError for error reporting, or %NULL to ignore.
27474  *
27475  * Helper function for g_socket_listener_add_address() that
27476  * creates a TCP/IP socket listening on IPv4 and IPv6 (if
27477  * supported) on the specified port on all interfaces.
27478  *
27479  * @source_object will be passed out in the various calls
27480  * to accept to identify this particular source, which is
27481  * useful if you're listening on multiple addresses and do
27482  * different things depending on what address is connected to.
27483  *
27484  * Returns: %TRUE on success, %FALSE on error.
27485  * Since: 2.22
27486  */
27487
27488
27489 /**
27490  * g_socket_listener_add_socket:
27491  * @listener: a #GSocketListener
27492  * @socket: a listening #GSocket
27493  * @source_object: (allow-none): Optional #GObject identifying this source
27494  * @error: #GError for error reporting, or %NULL to ignore.
27495  *
27496  * Adds @socket to the set of sockets that we try to accept
27497  * new clients from. The socket must be bound to a local
27498  * address and listened to.
27499  *
27500  * @source_object will be passed out in the various calls
27501  * to accept to identify this particular source, which is
27502  * useful if you're listening on multiple addresses and do
27503  * different things depending on what address is connected to.
27504  *
27505  * Returns: %TRUE on success, %FALSE on error.
27506  * Since: 2.22
27507  */
27508
27509
27510 /**
27511  * g_socket_listener_close:
27512  * @listener: a #GSocketListener
27513  *
27514  * Closes all the sockets in the listener.
27515  *
27516  * Since: 2.22
27517  */
27518
27519
27520 /**
27521  * g_socket_listener_new:
27522  *
27523  * Creates a new #GSocketListener with no sockets to listen for.
27524  * New listeners can be added with e.g. g_socket_listener_add_address()
27525  * or g_socket_listener_add_inet_port().
27526  *
27527  * Returns: a new #GSocketListener.
27528  * Since: 2.22
27529  */
27530
27531
27532 /**
27533  * g_socket_listener_set_backlog:
27534  * @listener: a #GSocketListener
27535  * @listen_backlog: an integer
27536  *
27537  * Sets the listen backlog on the sockets in the listener.
27538  *
27539  * See g_socket_set_listen_backlog() for details
27540  *
27541  * Since: 2.22
27542  */
27543
27544
27545 /**
27546  * g_socket_new:
27547  * @family: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
27548  * @type: the socket type to use.
27549  * @protocol: the id of the protocol to use, or 0 for default.
27550  * @error: #GError for error reporting, or %NULL to ignore.
27551  *
27552  * Creates a new #GSocket with the defined family, type and protocol.
27553  * If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
27554  * for the family and type is used.
27555  *
27556  * The @protocol is a family and type specific int that specifies what
27557  * kind of protocol to use. #GSocketProtocol lists several common ones.
27558  * Many families only support one protocol, and use 0 for this, others
27559  * support several and using 0 means to use the default protocol for
27560  * the family and type.
27561  *
27562  * The protocol id is passed directly to the operating
27563  * system, so you can use protocols not listed in #GSocketProtocol if you
27564  * know the protocol number used for it.
27565  *
27566  * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
27567  * Since: 2.22
27568  */
27569
27570
27571 /**
27572  * g_socket_new_from_fd:
27573  * @fd: a native socket file descriptor.
27574  * @error: #GError for error reporting, or %NULL to ignore.
27575  *
27576  * Creates a new #GSocket from a native file descriptor
27577  * or winsock SOCKET handle.
27578  *
27579  * This reads all the settings from the file descriptor so that
27580  * all properties should work. Note that the file descriptor
27581  * will be set to non-blocking mode, independent on the blocking
27582  * mode of the #GSocket.
27583  *
27584  * Returns: a #GSocket or %NULL on error. Free the returned object with g_object_unref().
27585  * Since: 2.22
27586  */
27587
27588
27589 /**
27590  * g_socket_receive:
27591  * @socket: a #GSocket
27592  * @buffer: a buffer to read data into (which should be at least @size bytes long).
27593  * @size: the number of bytes you want to read from the socket
27594  * @cancellable: (allow-none): a %GCancellable or %NULL
27595  * @error: #GError for error reporting, or %NULL to ignore.
27596  *
27597  * Receive data (up to @size bytes) from a socket. This is mainly used by
27598  * connection-oriented sockets; it is identical to g_socket_receive_from()
27599  * with @address set to %NULL.
27600  *
27601  * For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
27602  * g_socket_receive() will always read either 0 or 1 complete messages from
27603  * the socket. If the received message is too large to fit in @buffer, then
27604  * the data beyond @size bytes will be discarded, without any explicit
27605  * indication that this has occurred.
27606  *
27607  * For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
27608  * number of bytes, up to @size. If more than @size bytes have been
27609  * received, the additional data will be returned in future calls to
27610  * g_socket_receive().
27611  *
27612  * If the socket is in blocking mode the call will block until there
27613  * is some data to receive, the connection is closed, or there is an
27614  * error. If there is no data available and the socket is in
27615  * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
27616  * returned. To be notified when data is available, wait for the
27617  * %G_IO_IN condition.
27618  *
27619  * On error -1 is returned and @error is set accordingly.
27620  *
27621  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
27622  * Since: 2.22
27623  */
27624
27625
27626 /**
27627  * g_socket_receive_from:
27628  * @socket: a #GSocket
27629  * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
27630  * @buffer: (array length=size) (element-type guint8): a buffer to read data into (which should be at least @size bytes long).
27631  * @size: the number of bytes you want to read from the socket
27632  * @cancellable: (allow-none): a %GCancellable or %NULL
27633  * @error: #GError for error reporting, or %NULL to ignore.
27634  *
27635  * Receive data (up to @size bytes) from a socket.
27636  *
27637  * If @address is non-%NULL then @address will be set equal to the
27638  * source address of the received packet.
27639  * @address is owned by the caller.
27640  *
27641  * See g_socket_receive() for additional information.
27642  *
27643  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
27644  * Since: 2.22
27645  */
27646
27647
27648 /**
27649  * g_socket_receive_message:
27650  * @socket: a #GSocket
27651  * @address: (out) (allow-none): a pointer to a #GSocketAddress pointer, or %NULL
27652  * @vectors: (array length=num_vectors): an array of #GInputVector structs
27653  * @num_vectors: the number of elements in @vectors, or -1
27654  * @messages: (array length=num_messages) (allow-none): a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
27655  * @num_messages: a pointer which will be filled with the number of elements in @messages, or %NULL
27656  * @flags: a pointer to an int containing #GSocketMsgFlags flags
27657  * @cancellable: (allow-none): a %GCancellable or %NULL
27658  * @error: a #GError pointer, or %NULL
27659  *
27660  * Receive data from a socket.  This is the most complicated and
27661  * fully-featured version of this call. For easier use, see
27662  * g_socket_receive() and g_socket_receive_from().
27663  *
27664  * If @address is non-%NULL then @address will be set equal to the
27665  * source address of the received packet.
27666  * @address is owned by the caller.
27667  *
27668  * @vector must point to an array of #GInputVector structs and
27669  * @num_vectors must be the length of this array.  These structs
27670  * describe the buffers that received data will be scattered into.
27671  * If @num_vectors is -1, then @vectors is assumed to be terminated
27672  * by a #GInputVector with a %NULL buffer pointer.
27673  *
27674  * As a special case, if @num_vectors is 0 (in which case, @vectors
27675  * may of course be %NULL), then a single byte is received and
27676  * discarded. This is to facilitate the common practice of sending a
27677  * single '\0' byte for the purposes of transferring ancillary data.
27678  *
27679  * @messages, if non-%NULL, will be set to point to a newly-allocated
27680  * array of #GSocketControlMessage instances or %NULL if no such
27681  * messages was received. These correspond to the control messages
27682  * received from the kernel, one #GSocketControlMessage per message
27683  * from the kernel. This array is %NULL-terminated and must be freed
27684  * by the caller using g_free() after calling g_object_unref() on each
27685  * element. If @messages is %NULL, any control messages received will
27686  * be discarded.
27687  *
27688  * @num_messages, if non-%NULL, will be set to the number of control
27689  * messages received.
27690  *
27691  * If both @messages and @num_messages are non-%NULL, then
27692  * @num_messages gives the number of #GSocketControlMessage instances
27693  * in @messages (ie: not including the %NULL terminator).
27694  *
27695  * @flags is an in/out parameter. The commonly available arguments
27696  * for this are available in the #GSocketMsgFlags enum, but the
27697  * values there are the same as the system values, and the flags
27698  * are passed in as-is, so you can pass in system-specific flags too
27699  * (and g_socket_receive_message() may pass system-specific flags out).
27700  *
27701  * As with g_socket_receive(), data may be discarded if @socket is
27702  * %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
27703  * provide enough buffer space to read a complete message. You can pass
27704  * %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
27705  * removing it from the receive queue, but there is no portable way to find
27706  * out the length of the message other than by reading it into a
27707  * sufficiently-large buffer.
27708  *
27709  * If the socket is in blocking mode the call will block until there
27710  * is some data to receive, the connection is closed, or there is an
27711  * error. If there is no data available and the socket is in
27712  * non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
27713  * returned. To be notified when data is available, wait for the
27714  * %G_IO_IN condition.
27715  *
27716  * On error -1 is returned and @error is set accordingly.
27717  *
27718  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
27719  * Since: 2.22
27720  */
27721
27722
27723 /**
27724  * g_socket_receive_with_blocking:
27725  * @socket: a #GSocket
27726  * @buffer: a buffer to read data into (which should be at least @size bytes long).
27727  * @size: the number of bytes you want to read from the socket
27728  * @blocking: whether to do blocking or non-blocking I/O
27729  * @cancellable: (allow-none): a %GCancellable or %NULL
27730  * @error: #GError for error reporting, or %NULL to ignore.
27731  *
27732  * This behaves exactly the same as g_socket_receive(), except that
27733  * the choice of blocking or non-blocking behavior is determined by
27734  * the @blocking argument rather than by @socket's properties.
27735  *
27736  * Returns: Number of bytes read, or 0 if the connection was closed by the peer, or -1 on error
27737  * Since: 2.26
27738  */
27739
27740
27741 /**
27742  * g_socket_send:
27743  * @socket: a #GSocket
27744  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
27745  * @size: the number of bytes to send
27746  * @cancellable: (allow-none): a %GCancellable or %NULL
27747  * @error: #GError for error reporting, or %NULL to ignore.
27748  *
27749  * Tries to send @size bytes from @buffer on the socket. This is
27750  * mainly used by connection-oriented sockets; it is identical to
27751  * g_socket_send_to() with @address set to %NULL.
27752  *
27753  * If the socket is in blocking mode the call will block until there is
27754  * space for the data in the socket queue. If there is no space available
27755  * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
27756  * will be returned. To be notified when space is available, wait for the
27757  * %G_IO_OUT condition. Note though that you may still receive
27758  * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
27759  * notified of a %G_IO_OUT condition. (On Windows in particular, this is
27760  * very common due to the way the underlying APIs work.)
27761  *
27762  * On error -1 is returned and @error is set accordingly.
27763  *
27764  * Returns: Number of bytes written (which may be less than @size), or -1 on error
27765  * Since: 2.22
27766  */
27767
27768
27769 /**
27770  * g_socket_send_message:
27771  * @socket: a #GSocket
27772  * @address: (allow-none): a #GSocketAddress, or %NULL
27773  * @vectors: (array length=num_vectors): an array of #GOutputVector structs
27774  * @num_vectors: the number of elements in @vectors, or -1
27775  * @messages: (array length=num_messages) (allow-none): a pointer to an array of #GSocketControlMessages, or %NULL.
27776  * @num_messages: number of elements in @messages, or -1.
27777  * @flags: an int containing #GSocketMsgFlags flags
27778  * @cancellable: (allow-none): a %GCancellable or %NULL
27779  * @error: #GError for error reporting, or %NULL to ignore.
27780  *
27781  * Send data to @address on @socket.  This is the most complicated and
27782  * fully-featured version of this call. For easier use, see
27783  * g_socket_send() and g_socket_send_to().
27784  *
27785  * If @address is %NULL then the message is sent to the default receiver
27786  * (set by g_socket_connect()).
27787  *
27788  * @vectors must point to an array of #GOutputVector structs and
27789  * @num_vectors must be the length of this array. (If @num_vectors is -1,
27790  * then @vectors is assumed to be terminated by a #GOutputVector with a
27791  * %NULL buffer pointer.) The #GOutputVector structs describe the buffers
27792  * that the sent data will be gathered from. Using multiple
27793  * #GOutputVector<!-- -->s is more memory-efficient than manually copying
27794  * data from multiple sources into a single buffer, and more
27795  * network-efficient than making multiple calls to g_socket_send().
27796  *
27797  * @messages, if non-%NULL, is taken to point to an array of @num_messages
27798  * #GSocketControlMessage instances. These correspond to the control
27799  * messages to be sent on the socket.
27800  * If @num_messages is -1 then @messages is treated as a %NULL-terminated
27801  * array.
27802  *
27803  * @flags modify how the message is sent. The commonly available arguments
27804  * for this are available in the #GSocketMsgFlags enum, but the
27805  * values there are the same as the system values, and the flags
27806  * are passed in as-is, so you can pass in system-specific flags too.
27807  *
27808  * If the socket is in blocking mode the call will block until there is
27809  * space for the data in the socket queue. If there is no space available
27810  * and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
27811  * will be returned. To be notified when space is available, wait for the
27812  * %G_IO_OUT condition. Note though that you may still receive
27813  * %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
27814  * notified of a %G_IO_OUT condition. (On Windows in particular, this is
27815  * very common due to the way the underlying APIs work.)
27816  *
27817  * On error -1 is returned and @error is set accordingly.
27818  *
27819  * Returns: Number of bytes written (which may be less than @size), or -1 on error
27820  * Since: 2.22
27821  */
27822
27823
27824 /**
27825  * g_socket_send_to:
27826  * @socket: a #GSocket
27827  * @address: (allow-none): a #GSocketAddress, or %NULL
27828  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
27829  * @size: the number of bytes to send
27830  * @cancellable: (allow-none): a %GCancellable or %NULL
27831  * @error: #GError for error reporting, or %NULL to ignore.
27832  *
27833  * Tries to send @size bytes from @buffer to @address. If @address is
27834  * %NULL then the message is sent to the default receiver (set by
27835  * g_socket_connect()).
27836  *
27837  * See g_socket_send() for additional information.
27838  *
27839  * Returns: Number of bytes written (which may be less than @size), or -1 on error
27840  * Since: 2.22
27841  */
27842
27843
27844 /**
27845  * g_socket_send_with_blocking:
27846  * @socket: a #GSocket
27847  * @buffer: (array length=size) (element-type guint8): the buffer containing the data to send.
27848  * @size: the number of bytes to send
27849  * @blocking: whether to do blocking or non-blocking I/O
27850  * @cancellable: (allow-none): a %GCancellable or %NULL
27851  * @error: #GError for error reporting, or %NULL to ignore.
27852  *
27853  * This behaves exactly the same as g_socket_send(), except that
27854  * the choice of blocking or non-blocking behavior is determined by
27855  * the @blocking argument rather than by @socket's properties.
27856  *
27857  * Returns: Number of bytes written (which may be less than @size), or -1 on error
27858  * Since: 2.26
27859  */
27860
27861
27862 /**
27863  * g_socket_service_is_active:
27864  * @service: a #GSocketService
27865  *
27866  * Check whether the service is active or not. An active
27867  * service will accept new clients that connect, while
27868  * a non-active service will let connecting clients queue
27869  * up until the service is started.
27870  *
27871  * Returns: %TRUE if the service is active, %FALSE otherwise
27872  * Since: 2.22
27873  */
27874
27875
27876 /**
27877  * g_socket_service_new:
27878  *
27879  * Creates a new #GSocketService with no sockets to listen for.
27880  * New listeners can be added with e.g. g_socket_listener_add_address()
27881  * or g_socket_listener_add_inet_port().
27882  *
27883  * Returns: a new #GSocketService.
27884  * Since: 2.22
27885  */
27886
27887
27888 /**
27889  * g_socket_service_start:
27890  * @service: a #GSocketService
27891  *
27892  * Starts the service, i.e. start accepting connections
27893  * from the added sockets when the mainloop runs.
27894  *
27895  * This call is thread-safe, so it may be called from a thread
27896  * handling an incoming client request.
27897  *
27898  * Since: 2.22
27899  */
27900
27901
27902 /**
27903  * g_socket_service_stop:
27904  * @service: a #GSocketService
27905  *
27906  * Stops the service, i.e. stops accepting connections
27907  * from the added sockets when the mainloop runs.
27908  *
27909  * This call is thread-safe, so it may be called from a thread
27910  * handling an incoming client request.
27911  *
27912  * Since: 2.22
27913  */
27914
27915
27916 /**
27917  * g_socket_set_blocking:
27918  * @socket: a #GSocket.
27919  * @blocking: Whether to use blocking I/O or not.
27920  *
27921  * Sets the blocking mode of the socket. In blocking mode
27922  * all operations block until they succeed or there is an error. In
27923  * non-blocking mode all functions return results immediately or
27924  * with a %G_IO_ERROR_WOULD_BLOCK error.
27925  *
27926  * All sockets are created in blocking mode. However, note that the
27927  * platform level socket is always non-blocking, and blocking mode
27928  * is a GSocket level feature.
27929  *
27930  * Since: 2.22
27931  */
27932
27933
27934 /**
27935  * g_socket_set_broadcast:
27936  * @socket: a #GSocket.
27937  * @broadcast: whether @socket should allow sending to and receiving from broadcast addresses
27938  *
27939  * Sets whether @socket should allow sending to and receiving from
27940  * broadcast addresses. This is %FALSE by default.
27941  *
27942  * Since: 2.32
27943  */
27944
27945
27946 /**
27947  * g_socket_set_keepalive:
27948  * @socket: a #GSocket.
27949  * @keepalive: Value for the keepalive flag
27950  *
27951  * Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
27952  * this flag is set on a socket, the system will attempt to verify that the
27953  * remote socket endpoint is still present if a sufficiently long period of
27954  * time passes with no data being exchanged. If the system is unable to
27955  * verify the presence of the remote endpoint, it will automatically close
27956  * the connection.
27957  *
27958  * This option is only functional on certain kinds of sockets. (Notably,
27959  * %G_SOCKET_PROTOCOL_TCP sockets.)
27960  *
27961  * The exact time between pings is system- and protocol-dependent, but will
27962  * normally be at least two hours. Most commonly, you would set this flag
27963  * on a server socket if you want to allow clients to remain idle for long
27964  * periods of time, but also want to ensure that connections are eventually
27965  * garbage-collected if clients crash or become unreachable.
27966  *
27967  * Since: 2.22
27968  */
27969
27970
27971 /**
27972  * g_socket_set_listen_backlog:
27973  * @socket: a #GSocket.
27974  * @backlog: the maximum number of pending connections.
27975  *
27976  * Sets the maximum number of outstanding connections allowed
27977  * when listening on this socket. If more clients than this are
27978  * connecting to the socket and the application is not handling them
27979  * on time then the new connections will be refused.
27980  *
27981  * Note that this must be called before g_socket_listen() and has no
27982  * effect if called after that.
27983  *
27984  * Since: 2.22
27985  */
27986
27987
27988 /**
27989  * g_socket_set_multicast_loopback:
27990  * @socket: a #GSocket.
27991  * @loopback: whether @socket should receive messages sent to its multicast groups from the local host
27992  *
27993  * Sets whether outgoing multicast packets will be received by sockets
27994  * listening on that multicast address on the same host. This is %TRUE
27995  * by default.
27996  *
27997  * Since: 2.32
27998  */
27999
28000
28001 /**
28002  * g_socket_set_multicast_ttl:
28003  * @socket: a #GSocket.
28004  * @ttl: the time-to-live value for all multicast datagrams on @socket
28005  *
28006  * Sets the time-to-live for outgoing multicast datagrams on @socket.
28007  * By default, this is 1, meaning that multicast packets will not leave
28008  * the local network.
28009  *
28010  * Since: 2.32
28011  */
28012
28013
28014 /**
28015  * g_socket_set_timeout:
28016  * @socket: a #GSocket.
28017  * @timeout: the timeout for @socket, in seconds, or 0 for none
28018  *
28019  * Sets the time in seconds after which I/O operations on @socket will
28020  * time out if they have not yet completed.
28021  *
28022  * On a blocking socket, this means that any blocking #GSocket
28023  * operation will time out after @timeout seconds of inactivity,
28024  * returning %G_IO_ERROR_TIMED_OUT.
28025  *
28026  * On a non-blocking socket, calls to g_socket_condition_wait() will
28027  * also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
28028  * created with g_socket_create_source() will trigger after
28029  * @timeout seconds of inactivity, with the requested condition
28030  * set, at which point calling g_socket_receive(), g_socket_send(),
28031  * g_socket_check_connect_result(), etc, will fail with
28032  * %G_IO_ERROR_TIMED_OUT.
28033  *
28034  * If @timeout is 0 (the default), operations will never time out
28035  * on their own.
28036  *
28037  * Note that if an I/O operation is interrupted by a signal, this may
28038  * cause the timeout to be reset.
28039  *
28040  * Since: 2.26
28041  */
28042
28043
28044 /**
28045  * g_socket_set_ttl:
28046  * @socket: a #GSocket.
28047  * @ttl: the time-to-live value for all unicast packets on @socket
28048  *
28049  * Sets the time-to-live for outgoing unicast packets on @socket.
28050  * By default the platform-specific default value is used.
28051  *
28052  * Since: 2.32
28053  */
28054
28055
28056 /**
28057  * g_socket_shutdown:
28058  * @socket: a #GSocket
28059  * @shutdown_read: whether to shut down the read side
28060  * @shutdown_write: whether to shut down the write side
28061  * @error: #GError for error reporting, or %NULL to ignore.
28062  *
28063  * Shut down part of a full-duplex connection.
28064  *
28065  * If @shutdown_read is %TRUE then the receiving side of the connection
28066  * is shut down, and further reading is disallowed.
28067  *
28068  * If @shutdown_write is %TRUE then the sending side of the connection
28069  * is shut down, and further writing is disallowed.
28070  *
28071  * It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
28072  *
28073  * One example where this is used is graceful disconnect for TCP connections
28074  * where you close the sending side, then wait for the other side to close
28075  * the connection, thus ensuring that the other side saw all sent data.
28076  *
28077  * Returns: %TRUE on success, %FALSE on error
28078  * Since: 2.22
28079  */
28080
28081
28082 /**
28083  * g_socket_speaks_ipv4:
28084  * @socket: a #GSocket
28085  *
28086  * Checks if a socket is capable of speaking IPv4.
28087  *
28088  * IPv4 sockets are capable of speaking IPv4.  On some operating systems
28089  * and under some combinations of circumstances IPv6 sockets are also
28090  * capable of speaking IPv4.  See RFC 3493 section 3.7 for more
28091  * information.
28092  *
28093  * No other types of sockets are currently considered as being capable
28094  * of speaking IPv4.
28095  *
28096  * Returns: %TRUE if this socket can be used with IPv4.
28097  * Since: 2.22
28098  */
28099
28100
28101 /**
28102  * g_srv_target_copy:
28103  * @target: a #GSrvTarget
28104  *
28105  * Copies @target
28106  *
28107  * Returns: a copy of @target
28108  * Since: 2.22
28109  */
28110
28111
28112 /**
28113  * g_srv_target_free:
28114  * @target: a #GSrvTarget
28115  *
28116  * Frees @target
28117  *
28118  * Since: 2.22
28119  */
28120
28121
28122 /**
28123  * g_srv_target_get_hostname:
28124  * @target: a #GSrvTarget
28125  *
28126  * Gets @target's hostname (in ASCII form; if you are going to present
28127  * this to the user, you should use g_hostname_is_ascii_encoded() to
28128  * check if it contains encoded Unicode segments, and use
28129  * g_hostname_to_unicode() to convert it if it does.)
28130  *
28131  * Returns: @target's hostname
28132  * Since: 2.22
28133  */
28134
28135
28136 /**
28137  * g_srv_target_get_port:
28138  * @target: a #GSrvTarget
28139  *
28140  * Gets @target's port
28141  *
28142  * Returns: @target's port
28143  * Since: 2.22
28144  */
28145
28146
28147 /**
28148  * g_srv_target_get_priority:
28149  * @target: a #GSrvTarget
28150  *
28151  * Gets @target's priority. You should not need to look at this;
28152  * #GResolver already sorts the targets according to the algorithm in
28153  * RFC 2782.
28154  *
28155  * Returns: @target's priority
28156  * Since: 2.22
28157  */
28158
28159
28160 /**
28161  * g_srv_target_get_weight:
28162  * @target: a #GSrvTarget
28163  *
28164  * Gets @target's weight. You should not need to look at this;
28165  * #GResolver already sorts the targets according to the algorithm in
28166  * RFC 2782.
28167  *
28168  * Returns: @target's weight
28169  * Since: 2.22
28170  */
28171
28172
28173 /**
28174  * g_srv_target_list_sort: (skip)
28175  * @targets: a #GList of #GSrvTarget
28176  *
28177  * Sorts @targets in place according to the algorithm in RFC 2782.
28178  *
28179  * Returns: (transfer full): the head of the sorted list.
28180  * Since: 2.22
28181  */
28182
28183
28184 /**
28185  * g_srv_target_new:
28186  * @hostname: the host that the service is running on
28187  * @port: the port that the service is running on
28188  * @priority: the target's priority
28189  * @weight: the target's weight
28190  *
28191  * Creates a new #GSrvTarget with the given parameters.
28192  *
28193  * You should not need to use this; normally #GSrvTarget<!-- -->s are
28194  * created by #GResolver.
28195  *
28196  * Returns: a new #GSrvTarget.
28197  * Since: 2.22
28198  */
28199
28200
28201 /**
28202  * g_static_resource_fini:
28203  * @static_resource: pointer to a static #GStaticResource
28204  *
28205  * Finalized a GResource initialized by g_static_resource_init().
28206  *
28207  * This is normally used by code generated by
28208  * <link linkend="glib-compile-resources">glib-compile-resources</link>
28209  * and is not typically used by other code.
28210  *
28211  * Since: 2.32
28212  */
28213
28214
28215 /**
28216  * g_static_resource_get_resource:
28217  * @static_resource: pointer to a static #GStaticResource
28218  *
28219  * Gets the GResource that was registred by a call to g_static_resource_init().
28220  *
28221  * This is normally used by code generated by
28222  * <link linkend="glib-compile-resources">glib-compile-resources</link>
28223  * and is not typically used by other code.
28224  *
28225  * Returns: (transfer none): a #GResource
28226  * Since: 2.32
28227  */
28228
28229
28230 /**
28231  * g_static_resource_init:
28232  * @static_resource: pointer to a static #GStaticResource
28233  *
28234  * Initializes a GResource from static data using a
28235  * GStaticResource.
28236  *
28237  * This is normally used by code generated by
28238  * <link linkend="glib-compile-resources">glib-compile-resources</link>
28239  * and is not typically used by other code.
28240  *
28241  * Since: 2.32
28242  */
28243
28244
28245 /**
28246  * g_tcp_connection_get_graceful_disconnect:
28247  * @connection: a #GTcpConnection
28248  *
28249  * Checks if graceful disconnects are used. See
28250  * g_tcp_connection_set_graceful_disconnect().
28251  *
28252  * Returns: %TRUE if graceful disconnect is used on close, %FALSE otherwise
28253  * Since: 2.22
28254  */
28255
28256
28257 /**
28258  * g_tcp_connection_set_graceful_disconnect:
28259  * @connection: a #GTcpConnection
28260  * @graceful_disconnect: Whether to do graceful disconnects or not
28261  *
28262  * This enabled graceful disconnects on close. A graceful disconnect
28263  * means that we signal the receiving end that the connection is terminated
28264  * and wait for it to close the connection before closing the connection.
28265  *
28266  * A graceful disconnect means that we can be sure that we successfully sent
28267  * all the outstanding data to the other end, or get an error reported.
28268  * However, it also means we have to wait for all the data to reach the
28269  * other side and for it to acknowledge this by closing the socket, which may
28270  * take a while. For this reason it is disabled by default.
28271  *
28272  * Since: 2.22
28273  */
28274
28275
28276 /**
28277  * g_tcp_wrapper_connection_get_base_io_stream:
28278  * @conn: a #GTcpWrapperConnection
28279  *
28280  * Get's @conn's base #GIOStream
28281  *
28282  * Returns: (transfer none): @conn's base #GIOStream
28283  */
28284
28285
28286 /**
28287  * g_tcp_wrapper_connection_new:
28288  * @base_io_stream: the #GIOStream to wrap
28289  * @socket: the #GSocket associated with @base_io_stream
28290  *
28291  * Wraps @base_io_stream and @socket together as a #GSocketConnection.
28292  *
28293  * Returns: the new #GSocketConnection.
28294  * Since: 2.28
28295  */
28296
28297
28298 /**
28299  * g_test_dbus_add_service_dir:
28300  * @self: a #GTestDBus
28301  * @path: path to a directory containing .service files
28302  *
28303  * Add a path where dbus-daemon will lookup for .services files. This can't be
28304  * called after g_test_dbus_up().
28305  */
28306
28307
28308 /**
28309  * g_test_dbus_down:
28310  * @self: a #GTestDBus
28311  *
28312  * Stop the session bus started by g_test_dbus_up().
28313  *
28314  * This will wait for the singleton returned by g_bus_get() or g_bus_get_sync()
28315  * is destroyed. This is done to ensure that the next unit test won't get a
28316  * leaked singleton from this test.
28317  */
28318
28319
28320 /**
28321  * g_test_dbus_get_bus_address:
28322  * @self: a #GTestDBus
28323  *
28324  * Get the address on which dbus-daemon is running. if g_test_dbus_up() has not
28325  * been called yet, %NULL is returned. This can be used with
28326  * g_dbus_connection_new_for_address()
28327  *
28328  * Returns: the address of the bus, or %NULL.
28329  */
28330
28331
28332 /**
28333  * g_test_dbus_get_flags:
28334  * @self: a #GTestDBus
28335  *
28336  *
28337  *
28338  * Returns: the value of #GTestDBus:flags property
28339  */
28340
28341
28342 /**
28343  * g_test_dbus_new:
28344  * @flags: a #GTestDBusFlags
28345  *
28346  * Create a new #GTestDBus object.
28347  *
28348  * Returns: (transfer full): a new #GTestDBus.
28349  */
28350
28351
28352 /**
28353  * g_test_dbus_stop:
28354  * @self: a #GTestDBus
28355  *
28356  * Stop the session bus started by g_test_dbus_up().
28357  *
28358  * Unlike g_test_dbus_down(), this won't verify the #GDBusConnection
28359  * singleton returned by g_bus_get() or g_bus_get_sync() is destroyed. Unit
28360  * tests wanting to verify behaviour after the session bus has been stopped
28361  * can use this function but should still call g_test_dbus_down() when done.
28362  */
28363
28364
28365 /**
28366  * g_test_dbus_unset:
28367  *
28368  * Unset DISPLAY and DBUS_SESSION_BUS_ADDRESS env variables to ensure the test
28369  * won't use user's session bus.
28370  *
28371  * This is useful for unit tests that want to verify behaviour when no session
28372  * bus is running. It is not necessary to call this if unit test already calls
28373  * g_test_dbus_up() before acquiring the session bus.
28374  */
28375
28376
28377 /**
28378  * g_test_dbus_up:
28379  * @self: a #GTestDBus
28380  *
28381  * Start a dbus-daemon instance and set DBUS_SESSION_BUS_ADDRESS. After this
28382  * call, it is safe for unit tests to start sending messages on the session bug.
28383  *
28384  * If this function is called from setup callback of g_test_add(),
28385  * g_test_dbus_down() must be called in its teardown callback.
28386  *
28387  * If this function is called from unit test's main(), then g_test_dbus_down()
28388  * must be called after g_test_run().
28389  */
28390
28391
28392 /**
28393  * g_themed_icon_append_name:
28394  * @icon: a #GThemedIcon
28395  * @iconname: name of icon to append to list of icons from within @icon.
28396  *
28397  * Append a name to the list of icons from within @icon.
28398  *
28399  * <note><para>
28400  * Note that doing so invalidates the hash computed by prior calls
28401  * to g_icon_hash().
28402  * </para></note>
28403  */
28404
28405
28406 /**
28407  * g_themed_icon_get_names:
28408  * @icon: a #GThemedIcon.
28409  *
28410  * Gets the names of icons from within @icon.
28411  *
28412  * Returns: (transfer none): a list of icon names.
28413  */
28414
28415
28416 /**
28417  * g_themed_icon_new:
28418  * @iconname: a string containing an icon name.
28419  *
28420  * Creates a new themed icon for @iconname.
28421  *
28422  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
28423  */
28424
28425
28426 /**
28427  * g_themed_icon_new_from_names:
28428  * @iconnames: (array length=len): an array of strings containing icon names.
28429  * @len: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
28430  *
28431  * Creates a new themed icon for @iconnames.
28432  *
28433  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon
28434  */
28435
28436
28437 /**
28438  * g_themed_icon_new_with_default_fallbacks:
28439  * @iconname: a string containing an icon name
28440  *
28441  * Creates a new themed icon for @iconname, and all the names
28442  * that can be created by shortening @iconname at '-' characters.
28443  *
28444  * In the following example, @icon1 and @icon2 are equivalent:
28445  * |[
28446  * const char *names[] = {
28447  *   "gnome-dev-cdrom-audio",
28448  *   "gnome-dev-cdrom",
28449  *   "gnome-dev",
28450  *   "gnome"
28451  * };
28452  *
28453  * icon1 = g_themed_icon_new_from_names (names, 4);
28454  * icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
28455  * ]|
28456  *
28457  * Returns: (transfer full) (type GThemedIcon): a new #GThemedIcon.
28458  */
28459
28460
28461 /**
28462  * g_themed_icon_prepend_name:
28463  * @icon: a #GThemedIcon
28464  * @iconname: name of icon to prepend to list of icons from within @icon.
28465  *
28466  * Prepend a name to the list of icons from within @icon.
28467  *
28468  * <note><para>
28469  * Note that doing so invalidates the hash computed by prior calls
28470  * to g_icon_hash().
28471  * </para></note>
28472  *
28473  * Since: 2.18
28474  */
28475
28476
28477 /**
28478  * g_threaded_socket_service_new:
28479  * @max_threads: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
28480  *
28481  * Creates a new #GThreadedSocketService with no listeners. Listeners
28482  * must be added with one of the #GSocketListener "add" methods.
28483  *
28484  * Returns: a new #GSocketService.
28485  * Since: 2.22
28486  */
28487
28488
28489 /**
28490  * g_tls_backend_get_certificate_type:
28491  * @backend: the #GTlsBackend
28492  *
28493  * Gets the #GType of @backend's #GTlsCertificate implementation.
28494  *
28495  * Returns: the #GType of @backend's #GTlsCertificate implementation.
28496  * Since: 2.28
28497  */
28498
28499
28500 /**
28501  * g_tls_backend_get_client_connection_type:
28502  * @backend: the #GTlsBackend
28503  *
28504  * Gets the #GType of @backend's #GTlsClientConnection implementation.
28505  *
28506  * Returns: the #GType of @backend's #GTlsClientConnection implementation.
28507  * Since: 2.28
28508  */
28509
28510
28511 /**
28512  * g_tls_backend_get_default:
28513  *
28514  * Gets the default #GTlsBackend for the system.
28515  *
28516  * Returns: (transfer none): a #GTlsBackend
28517  * Since: 2.28
28518  */
28519
28520
28521 /**
28522  * g_tls_backend_get_default_database:
28523  * @backend: the #GTlsBackend
28524  *
28525  * Gets the default #GTlsDatabase used to verify TLS connections.
28526  *
28527  * Returns: (transfer full): the default database, which should be unreffed when done.
28528  * Since: 2.30
28529  */
28530
28531
28532 /**
28533  * g_tls_backend_get_file_database_type:
28534  * @backend: the #GTlsBackend
28535  *
28536  * Gets the #GType of @backend's #GTlsFileDatabase implementation.
28537  *
28538  * Returns: the #GType of backend's #GTlsFileDatabase implementation.
28539  * Since: 2.30
28540  */
28541
28542
28543 /**
28544  * g_tls_backend_get_server_connection_type:
28545  * @backend: the #GTlsBackend
28546  *
28547  * Gets the #GType of @backend's #GTlsServerConnection implementation.
28548  *
28549  * Returns: the #GType of @backend's #GTlsServerConnection implementation.
28550  * Since: 2.28
28551  */
28552
28553
28554 /**
28555  * g_tls_backend_supports_tls:
28556  * @backend: the #GTlsBackend
28557  *
28558  * Checks if TLS is supported; if this returns %FALSE for the default
28559  * #GTlsBackend, it means no "real" TLS backend is available.
28560  *
28561  * Returns: whether or not TLS is supported
28562  * Since: 2.28
28563  */
28564
28565
28566 /**
28567  * g_tls_certificate_get_issuer:
28568  * @cert: a #GTlsCertificate
28569  *
28570  * Gets the #GTlsCertificate representing @cert's issuer, if known
28571  *
28572  * Returns: (transfer none): The certificate of @cert's issuer, or %NULL if @cert is self-signed or signed with an unknown certificate.
28573  * Since: 2.28
28574  */
28575
28576
28577 /**
28578  * g_tls_certificate_list_new_from_file:
28579  * @file: file containing PEM-encoded certificates to import
28580  * @error: #GError for error reporting, or %NULL to ignore.
28581  *
28582  * Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
28583  * data in @file. If @file cannot be read or parsed, the function will
28584  * return %NULL and set @error. If @file does not contain any
28585  * PEM-encoded certificates, this will return an empty list and not
28586  * set @error.
28587  *
28588  * 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.
28589  * Since: 2.28
28590  */
28591
28592
28593 /**
28594  * g_tls_certificate_new_from_file:
28595  * @file: file containing a PEM-encoded certificate to import
28596  * @error: #GError for error reporting, or %NULL to ignore.
28597  *
28598  * Creates a #GTlsCertificate from the PEM-encoded data in @file. If
28599  * @file cannot be read or parsed, the function will return %NULL and
28600  * set @error. Otherwise, this behaves like
28601  * g_tls_certificate_new_from_pem().
28602  *
28603  * Returns: the new certificate, or %NULL on error
28604  * Since: 2.28
28605  */
28606
28607
28608 /**
28609  * g_tls_certificate_new_from_files:
28610  * @cert_file: file containing a PEM-encoded certificate to import
28611  * @key_file: file containing a PEM-encoded private key to import
28612  * @error: #GError for error reporting, or %NULL to ignore.
28613  *
28614  * Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
28615  * and @key_file. If either file cannot be read or parsed, the
28616  * function will return %NULL and set @error. Otherwise, this behaves
28617  * like g_tls_certificate_new_from_pem().
28618  *
28619  * Returns: the new certificate, or %NULL on error
28620  * Since: 2.28
28621  */
28622
28623
28624 /**
28625  * g_tls_certificate_new_from_pem:
28626  * @data: PEM-encoded certificate data
28627  * @length: the length of @data, or -1 if it's 0-terminated.
28628  * @error: #GError for error reporting, or %NULL to ignore.
28629  *
28630  * Creates a new #GTlsCertificate from the PEM-encoded data in @data.
28631  * If @data includes both a certificate and a private key, then the
28632  * returned certificate will include the private key data as well. (See
28633  * the #GTlsCertificate:private-key-pem property for information about
28634  * supported formats.)
28635  *
28636  * If @data includes multiple certificates, only the first one will be
28637  * parsed.
28638  *
28639  * Returns: the new certificate, or %NULL if @data is invalid
28640  * Since: 2.28
28641  */
28642
28643
28644 /**
28645  * g_tls_certificate_verify:
28646  * @cert: a #GTlsCertificate
28647  * @identity: (allow-none): the expected peer identity
28648  * @trusted_ca: (allow-none): the certificate of a trusted authority
28649  *
28650  * This verifies @cert and returns a set of #GTlsCertificateFlags
28651  * indicating any problems found with it. This can be used to verify a
28652  * certificate outside the context of making a connection, or to
28653  * check a certificate against a CA that is not part of the system
28654  * CA database.
28655  *
28656  * If @identity is not %NULL, @cert's name(s) will be compared against
28657  * it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
28658  * value if it does not match. If @identity is %NULL, that bit will
28659  * never be set in the return value.
28660  *
28661  * If @trusted_ca is not %NULL, then @cert (or one of the certificates
28662  * in its chain) must be signed by it, or else
28663  * %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
28664  * @trusted_ca is %NULL, that bit will never be set in the return
28665  * value.
28666  *
28667  * (All other #GTlsCertificateFlags values will always be set or unset
28668  * as appropriate.)
28669  *
28670  * Returns: the appropriate #GTlsCertificateFlags
28671  * Since: 2.28
28672  */
28673
28674
28675 /**
28676  * g_tls_client_connection_get_accepted_cas:
28677  * @conn: the #GTlsClientConnection
28678  *
28679  * Gets the list of distinguished names of the Certificate Authorities
28680  * that the server will accept certificates from. This will be set
28681  * during the TLS handshake if the server requests a certificate.
28682  * Otherwise, it will be %NULL.
28683  *
28684  * Each item in the list is a #GByteArray which contains the complete
28685  * subject DN of the certificate authority.
28686  *
28687  * 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().
28688  * Since: 2.28
28689  */
28690
28691
28692 /**
28693  * g_tls_client_connection_get_server_identity:
28694  * @conn: the #GTlsClientConnection
28695  *
28696  * Gets @conn's expected server identity
28697  *
28698  * Returns: (transfer none): a #GSocketConnectable describing the expected server identity, or %NULL if the expected identity is not known.
28699  * Since: 2.28
28700  */
28701
28702
28703 /**
28704  * g_tls_client_connection_get_use_ssl3:
28705  * @conn: the #GTlsClientConnection
28706  *
28707  * Gets whether @conn will use SSL 3.0 rather than the
28708  * highest-supported version of TLS; see
28709  * g_tls_client_connection_set_use_ssl3().
28710  *
28711  * Returns: whether @conn will use SSL 3.0
28712  * Since: 2.28
28713  */
28714
28715
28716 /**
28717  * g_tls_client_connection_get_validation_flags:
28718  * @conn: the #GTlsClientConnection
28719  *
28720  * Gets @conn's validation flags
28721  *
28722  * Returns: the validation flags
28723  * Since: 2.28
28724  */
28725
28726
28727 /**
28728  * g_tls_client_connection_new:
28729  * @base_io_stream: the #GIOStream to wrap
28730  * @server_identity: (allow-none): the expected identity of the server
28731  * @error: #GError for error reporting, or %NULL to ignore.
28732  *
28733  * Creates a new #GTlsClientConnection wrapping @base_io_stream (which
28734  * must have pollable input and output streams) which is assumed to
28735  * communicate with the server identified by @server_identity.
28736  *
28737  * Returns: (transfer full) (type GTlsClientConnection): the new #GTlsClientConnection, or %NULL on error
28738  * Since: 2.28
28739  */
28740
28741
28742 /**
28743  * g_tls_client_connection_set_server_identity:
28744  * @conn: the #GTlsClientConnection
28745  * @identity: a #GSocketConnectable describing the expected server identity
28746  *
28747  * Sets @conn's expected server identity, which is used both to tell
28748  * servers on virtual hosts which certificate to present, and also
28749  * to let @conn know what name to look for in the certificate when
28750  * performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
28751  *
28752  * Since: 2.28
28753  */
28754
28755
28756 /**
28757  * g_tls_client_connection_set_use_ssl3:
28758  * @conn: the #GTlsClientConnection
28759  * @use_ssl3: whether to use SSL 3.0
28760  *
28761  * If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
28762  * trying to properly negotiate the right version of TLS or SSL to use.
28763  * This can be used when talking to servers that do not implement the
28764  * fallbacks correctly and which will therefore fail to handshake with
28765  * a "modern" TLS handshake attempt.
28766  *
28767  * Since: 2.28
28768  */
28769
28770
28771 /**
28772  * g_tls_client_connection_set_validation_flags:
28773  * @conn: the #GTlsClientConnection
28774  * @flags: the #GTlsCertificateFlags to use
28775  *
28776  * Sets @conn's validation flags, to override the default set of
28777  * checks performed when validating a server certificate. By default,
28778  * %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
28779  *
28780  * Since: 2.28
28781  */
28782
28783
28784 /**
28785  * g_tls_connection_emit_accept_certificate:
28786  * @conn: a #GTlsConnection
28787  * @peer_cert: the peer's #GTlsCertificate
28788  * @errors: the problems with @peer_cert
28789  *
28790  * Used by #GTlsConnection implementations to emit the
28791  * #GTlsConnection::accept-certificate signal.
28792  *
28793  * Returns: %TRUE if one of the signal handlers has returned %TRUE to accept @peer_cert
28794  * Since: 2.28
28795  */
28796
28797
28798 /**
28799  * g_tls_connection_get_certificate:
28800  * @conn: a #GTlsConnection
28801  *
28802  * Gets @conn's certificate, as set by
28803  * g_tls_connection_set_certificate().
28804  *
28805  * Returns: (transfer none): @conn's certificate, or %NULL
28806  * Since: 2.28
28807  */
28808
28809
28810 /**
28811  * g_tls_connection_get_database:
28812  * @conn: a #GTlsConnection
28813  *
28814  * Gets the certificate database that @conn uses to verify
28815  * peer certificates. See g_tls_connection_set_database().
28816  *
28817  * Returns: (transfer none): the certificate database that @conn uses or %NULL
28818  * Since: 2.30
28819  */
28820
28821
28822 /**
28823  * g_tls_connection_get_interaction:
28824  * @conn: a connection
28825  *
28826  * Get the object that will be used to interact with the user. It will be used
28827  * for things like prompting the user for passwords. If %NULL is returned, then
28828  * no user interaction will occur for this connection.
28829  *
28830  * Returns: (transfer none): The interaction object.
28831  * Since: 2.30
28832  */
28833
28834
28835 /**
28836  * g_tls_connection_get_peer_certificate:
28837  * @conn: a #GTlsConnection
28838  *
28839  * Gets @conn's peer's certificate after the handshake has completed.
28840  * (It is not set during the emission of
28841  * #GTlsConnection::accept-certificate.)
28842  *
28843  * Returns: (transfer none): @conn's peer's certificate, or %NULL
28844  * Since: 2.28
28845  */
28846
28847
28848 /**
28849  * g_tls_connection_get_peer_certificate_errors:
28850  * @conn: a #GTlsConnection
28851  *
28852  * Gets the errors associated with validating @conn's peer's
28853  * certificate, after the handshake has completed. (It is not set
28854  * during the emission of #GTlsConnection::accept-certificate.)
28855  *
28856  * Returns: @conn's peer's certificate errors
28857  * Since: 2.28
28858  */
28859
28860
28861 /**
28862  * g_tls_connection_get_rehandshake_mode:
28863  * @conn: a #GTlsConnection
28864  *
28865  * Gets @conn rehandshaking mode. See
28866  * g_tls_connection_set_rehandshake_mode() for details.
28867  *
28868  * Returns: @conn's rehandshaking mode
28869  * Since: 2.28
28870  */
28871
28872
28873 /**
28874  * g_tls_connection_get_require_close_notify:
28875  * @conn: a #GTlsConnection
28876  *
28877  * Tests whether or not @conn expects a proper TLS close notification
28878  * when the connection is closed. See
28879  * g_tls_connection_set_require_close_notify() for details.
28880  *
28881  * Returns: %TRUE if @conn requires a proper TLS close notification.
28882  * Since: 2.28
28883  */
28884
28885
28886 /**
28887  * g_tls_connection_get_use_system_certdb:
28888  * @conn: a #GTlsConnection
28889  *
28890  * Gets whether @conn uses the system certificate database to verify
28891  * peer certificates. See g_tls_connection_set_use_system_certdb().
28892  *
28893  * Returns: whether @conn uses the system certificate database
28894  * Deprecated: 2.30: Use g_tls_connection_get_database() instead
28895  */
28896
28897
28898 /**
28899  * g_tls_connection_handshake:
28900  * @conn: a #GTlsConnection
28901  * @cancellable: (allow-none): a #GCancellable, or %NULL
28902  * @error: a #GError, or %NULL
28903  *
28904  * Attempts a TLS handshake on @conn.
28905  *
28906  * On the client side, it is never necessary to call this method;
28907  * although the connection needs to perform a handshake after
28908  * connecting (or after sending a "STARTTLS"-type command) and may
28909  * need to rehandshake later if the server requests it,
28910  * #GTlsConnection will handle this for you automatically when you try
28911  * to send or receive data on the connection. However, you can call
28912  * g_tls_connection_handshake() manually if you want to know for sure
28913  * whether the initial handshake succeeded or failed (as opposed to
28914  * just immediately trying to write to @conn's output stream, in which
28915  * case if it fails, it may not be possible to tell if it failed
28916  * before or after completing the handshake).
28917  *
28918  * Likewise, on the server side, although a handshake is necessary at
28919  * the beginning of the communication, you do not need to call this
28920  * function explicitly unless you want clearer error reporting.
28921  * However, you may call g_tls_connection_handshake() later on to
28922  * renegotiate parameters (encryption methods, etc) with the client.
28923  *
28924  * #GTlsConnection::accept_certificate may be emitted during the
28925  * handshake.
28926  *
28927  * Returns: success or failure
28928  * Since: 2.28
28929  */
28930
28931
28932 /**
28933  * g_tls_connection_handshake_async:
28934  * @conn: a #GTlsConnection
28935  * @io_priority: the <link linkend="io-priority">I/O priority</link> of the request.
28936  * @cancellable: (allow-none): a #GCancellable, or %NULL
28937  * @callback: callback to call when the handshake is complete
28938  * @user_data: the data to pass to the callback function
28939  *
28940  * Asynchronously performs a TLS handshake on @conn. See
28941  * g_tls_connection_handshake() for more information.
28942  *
28943  * Since: 2.28
28944  */
28945
28946
28947 /**
28948  * g_tls_connection_handshake_finish:
28949  * @conn: a #GTlsConnection
28950  * @result: a #GAsyncResult.
28951  * @error: a #GError pointer, or %NULL
28952  *
28953  * Finish an asynchronous TLS handshake operation. See
28954  * g_tls_connection_handshake() for more information.
28955  *
28956  * Returns: %TRUE on success, %FALSE on failure, in which case @error will be set.
28957  * Since: 2.28
28958  */
28959
28960
28961 /**
28962  * g_tls_connection_set_certificate:
28963  * @conn: a #GTlsConnection
28964  * @certificate: the certificate to use for @conn
28965  *
28966  * This sets the certificate that @conn will present to its peer
28967  * during the TLS handshake. For a #GTlsServerConnection, it is
28968  * mandatory to set this, and that will normally be done at construct
28969  * time.
28970  *
28971  * For a #GTlsClientConnection, this is optional. If a handshake fails
28972  * with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
28973  * requires a certificate, and if you try connecting again, you should
28974  * call this method first. You can call
28975  * g_tls_client_connection_get_accepted_cas() on the failed connection
28976  * to get a list of Certificate Authorities that the server will
28977  * accept certificates from.
28978  *
28979  * (It is also possible that a server will allow the connection with
28980  * or without a certificate; in that case, if you don't provide a
28981  * certificate, you can tell that the server requested one by the fact
28982  * that g_tls_client_connection_get_accepted_cas() will return
28983  * non-%NULL.)
28984  *
28985  * Since: 2.28
28986  */
28987
28988
28989 /**
28990  * g_tls_connection_set_database:
28991  * @conn: a #GTlsConnection
28992  * @database: a #GTlsDatabase
28993  *
28994  * Sets the certificate database that is used to verify peer certificates.
28995  * This is set to the default database by default. See
28996  * g_tls_backend_get_default_database(). If set to %NULL, then
28997  * peer certificate validation will always set the
28998  * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
28999  * #GTlsConnection::accept-certificate will always be emitted on
29000  * client-side connections, unless that bit is not set in
29001  * #GTlsClientConnection:validation-flags).
29002  *
29003  * Since: 2.30
29004  */
29005
29006
29007 /**
29008  * g_tls_connection_set_interaction:
29009  * @conn: a connection
29010  * @interaction: (allow-none): an interaction object, or %NULL
29011  *
29012  * Set the object that will be used to interact with the user. It will be used
29013  * for things like prompting the user for passwords.
29014  *
29015  * The @interaction argument will normally be a derived subclass of
29016  * #GTlsInteraction. %NULL can also be provided if no user interaction
29017  * should occur for this connection.
29018  *
29019  * Since: 2.30
29020  */
29021
29022
29023 /**
29024  * g_tls_connection_set_rehandshake_mode:
29025  * @conn: a #GTlsConnection
29026  * @mode: the rehandshaking mode
29027  *
29028  * Sets how @conn behaves with respect to rehandshaking requests.
29029  *
29030  * %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
29031  * rehandshake after the initial handshake is complete. (For a client,
29032  * this means it will refuse rehandshake requests from the server, and
29033  * for a server, this means it will close the connection with an error
29034  * if the client attempts to rehandshake.)
29035  *
29036  * %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
29037  * rehandshake only if the other end of the connection supports the
29038  * TLS <literal>renegotiation_info</literal> extension. This is the
29039  * default behavior, but means that rehandshaking will not work
29040  * against older implementations that do not support that extension.
29041  *
29042  * %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
29043  * rehandshaking even without the
29044  * <literal>renegotiation_info</literal> extension. On the server side
29045  * in particular, this is not recommended, since it leaves the server
29046  * open to certain attacks. However, this mode is necessary if you
29047  * need to allow renegotiation with older client software.
29048  *
29049  * Since: 2.28
29050  */
29051
29052
29053 /**
29054  * g_tls_connection_set_require_close_notify:
29055  * @conn: a #GTlsConnection
29056  * @require_close_notify: whether or not to require close notification
29057  *
29058  * Sets whether or not @conn expects a proper TLS close notification
29059  * before the connection is closed. If this is %TRUE (the default),
29060  * then @conn will expect to receive a TLS close notification from its
29061  * peer before the connection is closed, and will return a
29062  * %G_TLS_ERROR_EOF error if the connection is closed without proper
29063  * notification (since this may indicate a network error, or
29064  * man-in-the-middle attack).
29065  *
29066  * In some protocols, the application will know whether or not the
29067  * connection was closed cleanly based on application-level data
29068  * (because the application-level data includes a length field, or is
29069  * somehow self-delimiting); in this case, the close notify is
29070  * redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
29071  * in TLS 1.0 it is technically an error, but often done anyway.) You
29072  * can use g_tls_connection_set_require_close_notify() to tell @conn
29073  * to allow an "unannounced" connection close, in which case the close
29074  * will show up as a 0-length read, as in a non-TLS
29075  * #GSocketConnection, and it is up to the application to check that
29076  * the data has been fully received.
29077  *
29078  * Note that this only affects the behavior when the peer closes the
29079  * connection; when the application calls g_io_stream_close() itself
29080  * on @conn, this will send a close notification regardless of the
29081  * setting of this property. If you explicitly want to do an unclean
29082  * close, you can close @conn's #GTlsConnection:base-io-stream rather
29083  * than closing @conn itself.
29084  *
29085  * Since: 2.28
29086  */
29087
29088
29089 /**
29090  * g_tls_connection_set_use_system_certdb:
29091  * @conn: a #GTlsConnection
29092  * @use_system_certdb: whether to use the system certificate database
29093  *
29094  * Sets whether @conn uses the system certificate database to verify
29095  * peer certificates. This is %TRUE by default. If set to %FALSE, then
29096  * peer certificate validation will always set the
29097  * %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
29098  * #GTlsConnection::accept-certificate will always be emitted on
29099  * client-side connections, unless that bit is not set in
29100  * #GTlsClientConnection:validation-flags).
29101  *
29102  * Deprecated: 2.30: Use g_tls_connection_set_database() instead
29103  */
29104
29105
29106 /**
29107  * g_tls_database_create_certificate_handle:
29108  * @self: a #GTlsDatabase
29109  * @certificate: certificate for which to create a handle.
29110  *
29111  * Create a handle string for the certificate. The database will only be able
29112  * to create a handle for certificates that originate from the database. In
29113  * cases where the database cannot create a handle for a certificate, %NULL
29114  * will be returned.
29115  *
29116  * This handle should be stable across various instances of the application,
29117  * and between applications. If a certificate is modified in the database,
29118  * then it is not guaranteed that this handle will continue to point to it.
29119  *
29120  * Returns: (allow-none): a newly allocated string containing the handle.
29121  * Since: 2.30
29122  */
29123
29124
29125 /**
29126  * g_tls_database_lookup_certificate_for_handle:
29127  * @self: a #GTlsDatabase
29128  * @handle: a certificate handle
29129  * @interaction: (allow-none): used to interact with the user if necessary
29130  * @flags: Flags which affect the lookup.
29131  * @cancellable: (allow-none): a #GCancellable, or %NULL
29132  * @error: (allow-none): a #GError, or %NULL
29133  *
29134  * Lookup a certificate by its handle.
29135  *
29136  * The handle should have been created by calling
29137  * g_tls_database_create_certificate_handle() on a #GTlsDatabase object of
29138  * the same TLS backend. The handle is designed to remain valid across
29139  * instantiations of the database.
29140  *
29141  * If the handle is no longer valid, or does not point to a certificate in
29142  * this database, then %NULL will be returned.
29143  *
29144  * This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
29145  * the lookup operation asynchronously.
29146  *
29147  * Returns: (transfer full) (allow-none): a newly allocated #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
29148  * Since: 2.30
29149  */
29150
29151
29152 /**
29153  * g_tls_database_lookup_certificate_for_handle_async:
29154  * @self: a #GTlsDatabase
29155  * @handle: a certificate handle
29156  * @interaction: (allow-none): used to interact with the user if necessary
29157  * @flags: Flags which affect the lookup.
29158  * @cancellable: (allow-none): a #GCancellable, or %NULL
29159  * @callback: callback to call when the operation completes
29160  * @user_data: the data to pass to the callback function
29161  *
29162  * Asynchronously lookup a certificate by its handle in the database. See
29163  * g_tls_database_lookup_certificate_for_handle() for more information.
29164  *
29165  * Since: 2.30
29166  */
29167
29168
29169 /**
29170  * g_tls_database_lookup_certificate_for_handle_finish:
29171  * @self: a #GTlsDatabase
29172  * @result: a #GAsyncResult.
29173  * @error: a #GError pointer, or %NULL
29174  *
29175  * Finish an asynchronous lookup of a certificate by its handle. See
29176  * g_tls_database_lookup_certificate_handle() for more information.
29177  *
29178  * If the handle is no longer valid, or does not point to a certificate in
29179  * this database, then %NULL will be returned.
29180  *
29181  * Returns: (transfer full): a newly allocated #GTlsCertificate object. Use g_object_unref() to release the certificate.
29182  * Since: 2.30
29183  */
29184
29185
29186 /**
29187  * g_tls_database_lookup_certificate_issuer:
29188  * @self: a #GTlsDatabase
29189  * @certificate: a #GTlsCertificate
29190  * @interaction: (allow-none): used to interact with the user if necessary
29191  * @flags: flags which affect the lookup operation
29192  * @cancellable: (allow-none): a #GCancellable, or %NULL
29193  * @error: (allow-none): a #GError, or %NULL
29194  *
29195  * Lookup the issuer of @certificate in the database.
29196  *
29197  * The %issuer property
29198  * of @certificate is not modified, and the two certificates are not hooked
29199  * into a chain.
29200  *
29201  * This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
29202  * the lookup operation asynchronously.
29203  *
29204  * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
29205  * Since: 2.30
29206  */
29207
29208
29209 /**
29210  * g_tls_database_lookup_certificate_issuer_async:
29211  * @self: a #GTlsDatabase
29212  * @certificate: a #GTlsCertificate
29213  * @interaction: (allow-none): used to interact with the user if necessary
29214  * @flags: flags which affect the lookup operation
29215  * @cancellable: (allow-none): a #GCancellable, or %NULL
29216  * @callback: callback to call when the operation completes
29217  * @user_data: the data to pass to the callback function
29218  *
29219  * Asynchronously lookup the issuer of @certificate in the database. See
29220  * g_tls_database_lookup_certificate_issuer() for more information.
29221  *
29222  * Since: 2.30
29223  */
29224
29225
29226 /**
29227  * g_tls_database_lookup_certificate_issuer_finish:
29228  * @self: a #GTlsDatabase
29229  * @result: a #GAsyncResult.
29230  * @error: a #GError pointer, or %NULL
29231  *
29232  * Finish an asynchronous lookup issuer operation. See
29233  * g_tls_database_lookup_certificate_issuer() for more information.
29234  *
29235  * Returns: (transfer full): a newly allocated issuer #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
29236  * Since: 2.30
29237  */
29238
29239
29240 /**
29241  * g_tls_database_lookup_certificates_issued_by:
29242  * @self: a #GTlsDatabase
29243  * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
29244  * @interaction: (allow-none): used to interact with the user if necessary
29245  * @flags: Flags which affect the lookup operation.
29246  * @cancellable: (allow-none): a #GCancellable, or %NULL
29247  * @error: (allow-none): a #GError, or %NULL
29248  *
29249  * Lookup certificates issued by this issuer in the database.
29250  *
29251  * This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
29252  * the lookup operation asynchronously.
29253  *
29254  * 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.
29255  * Since: 2.30
29256  */
29257
29258
29259 /**
29260  * g_tls_database_lookup_certificates_issued_by_async:
29261  * @self: a #GTlsDatabase
29262  * @issuer_raw_dn: a #GByteArray which holds the DER encoded issuer DN.
29263  * @interaction: (allow-none): used to interact with the user if necessary
29264  * @flags: Flags which affect the lookup operation.
29265  * @cancellable: (allow-none): a #GCancellable, or %NULL
29266  * @callback: callback to call when the operation completes
29267  * @user_data: the data to pass to the callback function
29268  *
29269  * Asynchronously lookup certificates issued by this issuer in the database. See
29270  * g_tls_database_lookup_certificates_issued_by() for more information.
29271  *
29272  * The database may choose to hold a reference to the issuer byte array for the duration
29273  * of of this asynchronous operation. The byte array should not be modified during
29274  * this time.
29275  *
29276  * Since: 2.30
29277  */
29278
29279
29280 /**
29281  * g_tls_database_lookup_certificates_issued_by_finish:
29282  * @self: a #GTlsDatabase
29283  * @result: a #GAsyncResult.
29284  * @error: a #GError pointer, or %NULL
29285  *
29286  * Finish an asynchronous lookup of certificates. See
29287  * g_tls_database_lookup_certificates_issued_by() for more information.
29288  *
29289  * Returns: (transfer full): a newly allocated list of #GTlsCertificate objects. Use g_object_unref() on each certificate, and g_list_free() on the release the list.
29290  * Since: 2.30
29291  */
29292
29293
29294 /**
29295  * g_tls_database_verify_chain:
29296  * @self: a #GTlsDatabase
29297  * @chain: a #GTlsCertificate chain
29298  * @purpose: the purpose that this certificate chain will be used for.
29299  * @identity: (allow-none): the expected peer identity
29300  * @interaction: (allow-none): used to interact with the user if necessary
29301  * @flags: additional verify flags
29302  * @cancellable: (allow-none): a #GCancellable, or %NULL
29303  * @error: (allow-none): a #GError, or %NULL
29304  *
29305  * Verify's a certificate chain after looking up and adding any missing
29306  * certificates to the chain.
29307  *
29308  * @chain is a chain of #GTlsCertificate objects each pointing to the next
29309  * certificate in the chain by its %issuer property. The chain may initially
29310  * consist of one or more certificates. After the verification process is
29311  * complete, @chain may be modified by adding missing certificates, or removing
29312  * extra certificates. If a certificate anchor was found, then it is added to
29313  * the @chain.
29314  *
29315  * @purpose describes the purpose (or usage) for which the certificate
29316  * is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
29317  * which means that the certificate is being used to authenticate a server
29318  * (and we are acting as the client).
29319  *
29320  * The @identity is used to check for pinned certificates (trust exceptions)
29321  * in the database. These will override the normal verification process on a
29322  * host by host basis.
29323  *
29324  * Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
29325  * used.
29326  *
29327  * This function can block, use g_tls_database_verify_chain_async() to perform
29328  * the verification operation asynchronously.
29329  *
29330  * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
29331  * Since: 2.30
29332  */
29333
29334
29335 /**
29336  * g_tls_database_verify_chain_async:
29337  * @self: a #GTlsDatabase
29338  * @chain: a #GTlsCertificate chain
29339  * @purpose: the purpose that this certificate chain will be used for.
29340  * @identity: (allow-none): the expected peer identity
29341  * @interaction: (allow-none): used to interact with the user if necessary
29342  * @flags: additional verify flags
29343  * @cancellable: (allow-none): a #GCancellable, or %NULL
29344  * @callback: callback to call when the operation completes
29345  * @user_data: the data to pass to the callback function
29346  *
29347  * Asynchronously verify's a certificate chain after looking up and adding
29348  * any missing certificates to the chain. See g_tls_database_verify_chain()
29349  * for more information.
29350  *
29351  * Since: 2.30
29352  */
29353
29354
29355 /**
29356  * g_tls_database_verify_chain_finish:
29357  * @self: a #GTlsDatabase
29358  * @result: a #GAsyncResult.
29359  * @error: a #GError pointer, or %NULL
29360  *
29361  * Finish an asynchronous verify chain operation. See
29362  * g_tls_database_verify_chain() for more information. *
29363  *
29364  * Returns: the appropriate #GTlsCertificateFlags which represents the result of verification.
29365  * Since: 2.30
29366  */
29367
29368
29369 /**
29370  * g_tls_error_quark:
29371  *
29372  * Gets the TLS error quark.
29373  *
29374  * Returns: a #GQuark.
29375  * Since: 2.28
29376  */
29377
29378
29379 /**
29380  * g_tls_file_database_new:
29381  * @anchors: filename of anchor certificate authorities.
29382  * @error: #GError for error reporting, or %NULL to ignore.
29383  *
29384  * Creates a new #GTlsFileDatabase which uses anchor certificate authorities
29385  * in @anchors to verify certificate chains.
29386  *
29387  * The certificates in @anchors must be PEM encoded.
29388  *
29389  * Returns: (transfer full) (type GTlsFileDatabase): the new #GTlsFileDatabase, or %NULL on error
29390  * Since: 2.30
29391  */
29392
29393
29394 /**
29395  * g_tls_interaction_ask_password:
29396  * @interaction: a #GTlsInteraction object
29397  * @password: a #GTlsPassword object
29398  * @cancellable: an optional #GCancellable cancellation object
29399  * @error: an optional location to place an error on failure
29400  *
29401  * Run synchronous interaction to ask the user for a password. In general,
29402  * g_tls_interaction_invoke_ask_password() should be used instead of this
29403  * function.
29404  *
29405  * Derived subclasses usually implement a password prompt, although they may
29406  * also choose to provide a password from elsewhere. The @password value will
29407  * be filled in and then @callback will be called. Alternatively the user may
29408  * abort this password request, which will usually abort the TLS connection.
29409  *
29410  * If the interaction is cancelled by the cancellation object, or by the
29411  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
29412  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
29413  * not support immediate cancellation.
29414  *
29415  * Returns: The status of the ask password interaction.
29416  * Since: 2.30
29417  */
29418
29419
29420 /**
29421  * g_tls_interaction_ask_password_async:
29422  * @interaction: a #GTlsInteraction object
29423  * @password: a #GTlsPassword object
29424  * @cancellable: an optional #GCancellable cancellation object
29425  * @callback: (allow-none): will be called when the interaction completes
29426  * @user_data: (allow-none): data to pass to the @callback
29427  *
29428  * Run asynchronous interaction to ask the user for a password. In general,
29429  * g_tls_interaction_invoke_ask_password() should be used instead of this
29430  * function.
29431  *
29432  * Derived subclasses usually implement a password prompt, although they may
29433  * also choose to provide a password from elsewhere. The @password value will
29434  * be filled in and then @callback will be called. Alternatively the user may
29435  * abort this password request, which will usually abort the TLS connection.
29436  *
29437  * If the interaction is cancelled by the cancellation object, or by the
29438  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
29439  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
29440  * not support immediate cancellation.
29441  *
29442  * Certain implementations may not support immediate cancellation.
29443  *
29444  * Since: 2.30
29445  */
29446
29447
29448 /**
29449  * g_tls_interaction_ask_password_finish:
29450  * @interaction: a #GTlsInteraction object
29451  * @result: the result passed to the callback
29452  * @error: an optional location to place an error on failure
29453  *
29454  * Complete an ask password user interaction request. This should be once
29455  * the g_tls_interaction_ask_password_async() completion callback is called.
29456  *
29457  * If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
29458  * to g_tls_interaction_ask_password() will have its password filled in.
29459  *
29460  * If the interaction is cancelled by the cancellation object, or by the
29461  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
29462  * contains a %G_IO_ERROR_CANCELLED error code.
29463  *
29464  * Returns: The status of the ask password interaction.
29465  * Since: 2.30
29466  */
29467
29468
29469 /**
29470  * g_tls_interaction_invoke_ask_password:
29471  * @interaction: a #GTlsInteraction object
29472  * @password: a #GTlsPassword object
29473  * @cancellable: an optional #GCancellable cancellation object
29474  * @error: an optional location to place an error on failure
29475  *
29476  * Invoke the interaction to ask the user for a password. It invokes this
29477  * interaction in the main loop, specifically the #GMainContext returned by
29478  * g_main_context_get_thread_default() when the interaction is created. This
29479  * is called by called by #GTlsConnection or #GTlsDatabase to ask the user
29480  * for a password.
29481  *
29482  * Derived subclasses usually implement a password prompt, although they may
29483  * also choose to provide a password from elsewhere. The @password value will
29484  * be filled in and then @callback will be called. Alternatively the user may
29485  * abort this password request, which will usually abort the TLS connection.
29486  *
29487  * The implementation can either be a synchronous (eg: modal dialog) or an
29488  * asynchronous one (eg: modeless dialog). This function will take care of
29489  * calling which ever one correctly.
29490  *
29491  * If the interaction is cancelled by the cancellation object, or by the
29492  * user then %G_TLS_INTERACTION_FAILED will be returned with an error that
29493  * contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
29494  * not support immediate cancellation.
29495  *
29496  * Returns: The status of the ask password interaction.
29497  * Since: 2.30
29498  */
29499
29500
29501 /**
29502  * g_tls_password_get_description:
29503  * @password: a #GTlsPassword object
29504  *
29505  * Get a description string about what the password will be used for.
29506  *
29507  * Returns: The description of the password.
29508  * Since: 2.30
29509  */
29510
29511
29512 /**
29513  * g_tls_password_get_flags:
29514  * @password: a #GTlsPassword object
29515  *
29516  * Get flags about the password.
29517  *
29518  * Returns: The flags about the password.
29519  * Since: 2.30
29520  */
29521
29522
29523 /**
29524  * g_tls_password_get_value:
29525  * @password: a #GTlsPassword object
29526  * @length: (allow-none): location to place the length of the password.
29527  *
29528  * Get the password value. If @length is not %NULL then it will be
29529  * filled in with the length of the password value. (Note that the
29530  * password value is not nul-terminated, so you can only pass %NULL
29531  * for @length in contexts where you know the password will have a
29532  * certain fixed length.)
29533  *
29534  * Returns: The password value (owned by the password object).
29535  * Since: 2.30
29536  */
29537
29538
29539 /**
29540  * g_tls_password_get_warning:
29541  * @password: a #GTlsPassword object
29542  *
29543  * Get a user readable translated warning. Usually this warning is a
29544  * representation of the password flags returned from
29545  * g_tls_password_get_flags().
29546  *
29547  * Returns: The warning.
29548  * Since: 2.30
29549  */
29550
29551
29552 /**
29553  * g_tls_password_new:
29554  * @flags: the password flags
29555  * @description: description of what the password is for
29556  *
29557  * Create a new #GTlsPassword object.
29558  *
29559  * Returns: (transfer full): The newly allocated password object
29560  */
29561
29562
29563 /**
29564  * g_tls_password_set_description:
29565  * @password: a #GTlsPassword object
29566  * @description: The description of the password
29567  *
29568  * Set a description string about what the password will be used for.
29569  *
29570  * Since: 2.30
29571  */
29572
29573
29574 /**
29575  * g_tls_password_set_flags:
29576  * @password: a #GTlsPassword object
29577  * @flags: The flags about the password
29578  *
29579  * Set flags about the password.
29580  *
29581  * Since: 2.30
29582  */
29583
29584
29585 /**
29586  * g_tls_password_set_value:
29587  * @password: a #GTlsPassword object
29588  * @value: the new password value
29589  * @length: the length of the password, or -1
29590  *
29591  * Set the value for this password. The @value will be copied by the password
29592  * object.
29593  *
29594  * Specify the @length, for a non-nul-terminated password. Pass -1 as
29595  * @length if using a nul-terminated password, and @length will be
29596  * calculated automatically. (Note that the terminating nul is not
29597  * considered part of the password in this case.)
29598  *
29599  * Since: 2.30
29600  */
29601
29602
29603 /**
29604  * g_tls_password_set_value_full:
29605  * @password: a #GTlsPassword object
29606  * @value: the value for the password
29607  * @length: the length of the password, or -1
29608  * @destroy: (allow-none): a function to use to free the password.
29609  *
29610  * Provide the value for this password.
29611  *
29612  * The @value will be owned by the password object, and later freed using
29613  * the @destroy function callback.
29614  *
29615  * Specify the @length, for a non-nul-terminated password. Pass -1 as
29616  * @length if using a nul-terminated password, and @length will be
29617  * calculated automatically. (Note that the terminating nul is not
29618  * considered part of the password in this case.)
29619  *
29620  * Virtual: set_value
29621  * Since: 2.30
29622  */
29623
29624
29625 /**
29626  * g_tls_password_set_warning:
29627  * @password: a #GTlsPassword object
29628  * @warning: The user readable warning
29629  *
29630  * Set a user readable translated warning. Usually this warning is a
29631  * representation of the password flags returned from
29632  * g_tls_password_get_flags().
29633  *
29634  * Since: 2.30
29635  */
29636
29637
29638 /**
29639  * g_tls_server_connection_new:
29640  * @base_io_stream: the #GIOStream to wrap
29641  * @certificate: (allow-none): the default server certificate, or %NULL
29642  * @error: #GError for error reporting, or %NULL to ignore.
29643  *
29644  * Creates a new #GTlsServerConnection wrapping @base_io_stream (which
29645  * must have pollable input and output streams).
29646  *
29647  * Returns: (transfer full) (type GTlsServerConnection): the new #GTlsServerConnection, or %NULL on error
29648  * Since: 2.28
29649  */
29650
29651
29652 /**
29653  * g_unix_connection_receive_credentials:
29654  * @connection: A #GUnixConnection.
29655  * @cancellable: (allow-none): A #GCancellable or %NULL.
29656  * @error: Return location for error or %NULL.
29657  *
29658  * Receives credentials from the sending end of the connection.  The
29659  * sending end has to call g_unix_connection_send_credentials() (or
29660  * similar) for this to work.
29661  *
29662  * As well as reading the credentials this also reads (and discards) a
29663  * single byte from the stream, as this is required for credentials
29664  * passing to work on some implementations.
29665  *
29666  * Other ways to exchange credentials with a foreign peer includes the
29667  * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
29668  *
29669  * Returns: (transfer full): Received credentials on success (free with g_object_unref()), %NULL if @error is set.
29670  * Since: 2.26
29671  */
29672
29673
29674 /**
29675  * g_unix_connection_receive_credentials_async:
29676  * @connection: A #GUnixConnection.
29677  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29678  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
29679  * @user_data: (closure): the data to pass to callback function
29680  *
29681  * Asynchronously receive credentials.
29682  *
29683  * For more details, see g_unix_connection_receive_credentials() which is
29684  * the synchronous version of this call.
29685  *
29686  * When the operation is finished, @callback will be called. You can then call
29687  * g_unix_connection_receive_credentials_finish() to get the result of the operation.
29688  *
29689  * Since: 2.32
29690  */
29691
29692
29693 /**
29694  * g_unix_connection_receive_credentials_finish:
29695  * @connection: A #GUnixConnection.
29696  * @result: a #GAsyncResult.
29697  * @error: a #GError, or %NULL
29698  *
29699  * Finishes an asynchronous receive credentials operation started with
29700  * g_unix_connection_receive_credentials_async().
29701  *
29702  * Returns: (transfer full): a #GCredentials, or %NULL on error. Free the returned object with g_object_unref().
29703  * Since: 2.32
29704  */
29705
29706
29707 /**
29708  * g_unix_connection_receive_fd:
29709  * @connection: a #GUnixConnection
29710  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
29711  * @error: (allow-none): #GError for error reporting, or %NULL to ignore
29712  *
29713  * Receives a file descriptor from the sending end of the connection.
29714  * The sending end has to call g_unix_connection_send_fd() for this
29715  * to work.
29716  *
29717  * As well as reading the fd this also reads a single byte from the
29718  * stream, as this is required for fd passing to work on some
29719  * implementations.
29720  *
29721  * Returns: a file descriptor on success, -1 on error.
29722  * Since: 2.22
29723  */
29724
29725
29726 /**
29727  * g_unix_connection_send_credentials:
29728  * @connection: A #GUnixConnection.
29729  * @cancellable: (allow-none): A #GCancellable or %NULL.
29730  * @error: Return location for error or %NULL.
29731  *
29732  * Passes the credentials of the current user the receiving side
29733  * of the connection. The receiving end has to call
29734  * g_unix_connection_receive_credentials() (or similar) to accept the
29735  * credentials.
29736  *
29737  * As well as sending the credentials this also writes a single NUL
29738  * byte to the stream, as this is required for credentials passing to
29739  * work on some implementations.
29740  *
29741  * Other ways to exchange credentials with a foreign peer includes the
29742  * #GUnixCredentialsMessage type and g_socket_get_credentials() function.
29743  *
29744  * Returns: %TRUE on success, %FALSE if @error is set.
29745  * Since: 2.26
29746  */
29747
29748
29749 /**
29750  * g_unix_connection_send_credentials_async:
29751  * @connection: A #GUnixConnection.
29752  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29753  * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
29754  * @user_data: (closure): the data to pass to callback function
29755  *
29756  * Asynchronously send credentials.
29757  *
29758  * For more details, see g_unix_connection_send_credentials() which is
29759  * the synchronous version of this call.
29760  *
29761  * When the operation is finished, @callback will be called. You can then call
29762  * g_unix_connection_send_credentials_finish() to get the result of the operation.
29763  *
29764  * Since: 2.32
29765  */
29766
29767
29768 /**
29769  * g_unix_connection_send_credentials_finish:
29770  * @connection: A #GUnixConnection.
29771  * @result: a #GAsyncResult.
29772  * @error: a #GError, or %NULL
29773  *
29774  * Finishes an asynchronous send credentials operation started with
29775  * g_unix_connection_send_credentials_async().
29776  *
29777  * Returns: %TRUE if the operation was successful, otherwise %FALSE.
29778  * Since: 2.32
29779  */
29780
29781
29782 /**
29783  * g_unix_connection_send_fd:
29784  * @connection: a #GUnixConnection
29785  * @fd: a file descriptor
29786  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
29787  * @error: (allow-none): #GError for error reporting, or %NULL to ignore.
29788  *
29789  * Passes a file descriptor to the receiving side of the
29790  * connection. The receiving end has to call g_unix_connection_receive_fd()
29791  * to accept the file descriptor.
29792  *
29793  * As well as sending the fd this also writes a single byte to the
29794  * stream, as this is required for fd passing to work on some
29795  * implementations.
29796  *
29797  * Returns: a %TRUE on success, %NULL on error.
29798  * Since: 2.22
29799  */
29800
29801
29802 /**
29803  * g_unix_credentials_message_get_credentials:
29804  * @message: A #GUnixCredentialsMessage.
29805  *
29806  * Gets the credentials stored in @message.
29807  *
29808  * Returns: (transfer none): A #GCredentials instance. Do not free, it is owned by @message.
29809  * Since: 2.26
29810  */
29811
29812
29813 /**
29814  * g_unix_credentials_message_is_supported:
29815  *
29816  * Checks if passing #GCredentials on a #GSocket is supported on this platform.
29817  *
29818  * Returns: %TRUE if supported, %FALSE otherwise
29819  * Since: 2.26
29820  */
29821
29822
29823 /**
29824  * g_unix_credentials_message_new:
29825  *
29826  * Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
29827  *
29828  * Returns: a new #GUnixCredentialsMessage
29829  * Since: 2.26
29830  */
29831
29832
29833 /**
29834  * g_unix_credentials_message_new_with_credentials:
29835  * @credentials: A #GCredentials object.
29836  *
29837  * Creates a new #GUnixCredentialsMessage holding @credentials.
29838  *
29839  * Returns: a new #GUnixCredentialsMessage
29840  * Since: 2.26
29841  */
29842
29843
29844 /**
29845  * g_unix_fd_list_append:
29846  * @list: a #GUnixFDList
29847  * @fd: a valid open file descriptor
29848  * @error: a #GError pointer
29849  *
29850  * Adds a file descriptor to @list.
29851  *
29852  * The file descriptor is duplicated using dup(). You keep your copy
29853  * of the descriptor and the copy contained in @list will be closed
29854  * when @list is finalized.
29855  *
29856  * A possible cause of failure is exceeding the per-process or
29857  * system-wide file descriptor limit.
29858  *
29859  * The index of the file descriptor in the list is returned.  If you use
29860  * this index with g_unix_fd_list_get() then you will receive back a
29861  * duplicated copy of the same file descriptor.
29862  *
29863  * Returns: the index of the appended fd in case of success, else -1 (and @error is set)
29864  * Since: 2.24
29865  */
29866
29867
29868 /**
29869  * g_unix_fd_list_get:
29870  * @list: a #GUnixFDList
29871  * @index_: the index into the list
29872  * @error: a #GError pointer
29873  *
29874  * Gets a file descriptor out of @list.
29875  *
29876  * @index_ specifies the index of the file descriptor to get.  It is a
29877  * programmer error for @index_ to be out of range; see
29878  * g_unix_fd_list_get_length().
29879  *
29880  * The file descriptor is duplicated using dup() and set as
29881  * close-on-exec before being returned.  You must call close() on it
29882  * when you are done.
29883  *
29884  * A possible cause of failure is exceeding the per-process or
29885  * system-wide file descriptor limit.
29886  *
29887  * Returns: the file descriptor, or -1 in case of error
29888  * Since: 2.24
29889  */
29890
29891
29892 /**
29893  * g_unix_fd_list_get_length:
29894  * @list: a #GUnixFDList
29895  *
29896  * Gets the length of @list (ie: the number of file descriptors
29897  * contained within).
29898  *
29899  * Returns: the length of @list
29900  * Since: 2.24
29901  */
29902
29903
29904 /**
29905  * g_unix_fd_list_new:
29906  *
29907  * Creates a new #GUnixFDList containing no file descriptors.
29908  *
29909  * Returns: a new #GUnixFDList
29910  * Since: 2.24
29911  */
29912
29913
29914 /**
29915  * g_unix_fd_list_new_from_array:
29916  * @fds: (array length=n_fds): the initial list of file descriptors
29917  * @n_fds: the length of #fds, or -1
29918  *
29919  * Creates a new #GUnixFDList containing the file descriptors given in
29920  * @fds.  The file descriptors become the property of the new list and
29921  * may no longer be used by the caller.  The array itself is owned by
29922  * the caller.
29923  *
29924  * Each file descriptor in the array should be set to close-on-exec.
29925  *
29926  * If @n_fds is -1 then @fds must be terminated with -1.
29927  *
29928  * Returns: a new #GUnixFDList
29929  * Since: 2.24
29930  */
29931
29932
29933 /**
29934  * g_unix_fd_list_peek_fds:
29935  * @list: a #GUnixFDList
29936  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
29937  *
29938  * Returns the array of file descriptors that is contained in this
29939  * object.
29940  *
29941  * After this call, the descriptors remain the property of @list.  The
29942  * caller must not close them and must not free the array.  The array is
29943  * valid only until @list is changed in any way.
29944  *
29945  * If @length is non-%NULL then it is set to the number of file
29946  * descriptors in the returned array. The returned array is also
29947  * terminated with -1.
29948  *
29949  * This function never returns %NULL. In case there are no file
29950  * descriptors contained in @list, an empty array is returned.
29951  *
29952  * Returns: (array length=length) (transfer none): an array of file descriptors
29953  * Since: 2.24
29954  */
29955
29956
29957 /**
29958  * g_unix_fd_list_steal_fds:
29959  * @list: a #GUnixFDList
29960  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
29961  *
29962  * Returns the array of file descriptors that is contained in this
29963  * object.
29964  *
29965  * After this call, the descriptors are no longer contained in
29966  * @list. Further calls will return an empty list (unless more
29967  * descriptors have been added).
29968  *
29969  * The return result of this function must be freed with g_free().
29970  * The caller is also responsible for closing all of the file
29971  * descriptors.  The file descriptors in the array are set to
29972  * close-on-exec.
29973  *
29974  * If @length is non-%NULL then it is set to the number of file
29975  * descriptors in the returned array. The returned array is also
29976  * terminated with -1.
29977  *
29978  * This function never returns %NULL. In case there are no file
29979  * descriptors contained in @list, an empty array is returned.
29980  *
29981  * Returns: (array length=length) (transfer full): an array of file descriptors
29982  * Since: 2.24
29983  */
29984
29985
29986 /**
29987  * g_unix_fd_message_append_fd:
29988  * @message: a #GUnixFDMessage
29989  * @fd: a valid open file descriptor
29990  * @error: a #GError pointer
29991  *
29992  * Adds a file descriptor to @message.
29993  *
29994  * The file descriptor is duplicated using dup(). You keep your copy
29995  * of the descriptor and the copy contained in @message will be closed
29996  * when @message is finalized.
29997  *
29998  * A possible cause of failure is exceeding the per-process or
29999  * system-wide file descriptor limit.
30000  *
30001  * Returns: %TRUE in case of success, else %FALSE (and @error is set)
30002  * Since: 2.22
30003  */
30004
30005
30006 /**
30007  * g_unix_fd_message_get_fd_list:
30008  * @message: a #GUnixFDMessage
30009  *
30010  * Gets the #GUnixFDList contained in @message.  This function does not
30011  * return a reference to the caller, but the returned list is valid for
30012  * the lifetime of @message.
30013  *
30014  * Returns: (transfer none): the #GUnixFDList from @message
30015  * Since: 2.24
30016  */
30017
30018
30019 /**
30020  * g_unix_fd_message_new:
30021  *
30022  * Creates a new #GUnixFDMessage containing an empty file descriptor
30023  * list.
30024  *
30025  * Returns: a new #GUnixFDMessage
30026  * Since: 2.22
30027  */
30028
30029
30030 /**
30031  * g_unix_fd_message_new_with_fd_list:
30032  * @fd_list: a #GUnixFDList
30033  *
30034  * Creates a new #GUnixFDMessage containing @list.
30035  *
30036  * Returns: a new #GUnixFDMessage
30037  * Since: 2.24
30038  */
30039
30040
30041 /**
30042  * g_unix_fd_message_steal_fds:
30043  * @message: a #GUnixFDMessage
30044  * @length: (out) (allow-none): pointer to the length of the returned array, or %NULL
30045  *
30046  * Returns the array of file descriptors that is contained in this
30047  * object.
30048  *
30049  * After this call, the descriptors are no longer contained in
30050  * @message. Further calls will return an empty list (unless more
30051  * descriptors have been added).
30052  *
30053  * The return result of this function must be freed with g_free().
30054  * The caller is also responsible for closing all of the file
30055  * descriptors.
30056  *
30057  * If @length is non-%NULL then it is set to the number of file
30058  * descriptors in the returned array. The returned array is also
30059  * terminated with -1.
30060  *
30061  * This function never returns %NULL. In case there are no file
30062  * descriptors contained in @message, an empty array is returned.
30063  *
30064  * Returns: (array length=length) (transfer full): an array of file descriptors
30065  * Since: 2.22
30066  */
30067
30068
30069 /**
30070  * g_unix_input_stream_get_close_fd:
30071  * @stream: a #GUnixInputStream
30072  *
30073  * Returns whether the file descriptor of @stream will be
30074  * closed when the stream is closed.
30075  *
30076  * Returns: %TRUE if the file descriptor is closed when done
30077  * Since: 2.20
30078  */
30079
30080
30081 /**
30082  * g_unix_input_stream_get_fd:
30083  * @stream: a #GUnixInputStream
30084  *
30085  * Return the UNIX file descriptor that the stream reads from.
30086  *
30087  * Returns: The file descriptor of @stream
30088  * Since: 2.20
30089  */
30090
30091
30092 /**
30093  * g_unix_input_stream_new:
30094  * @fd: a UNIX file descriptor
30095  * @close_fd: %TRUE to close the file descriptor when done
30096  *
30097  * Creates a new #GUnixInputStream for the given @fd.
30098  *
30099  * If @close_fd is %TRUE, the file descriptor will be closed
30100  * when the stream is closed.
30101  *
30102  * Returns: a new #GUnixInputStream
30103  */
30104
30105
30106 /**
30107  * g_unix_input_stream_set_close_fd:
30108  * @stream: a #GUnixInputStream
30109  * @close_fd: %TRUE to close the file descriptor when done
30110  *
30111  * Sets whether the file descriptor of @stream shall be closed
30112  * when the stream is closed.
30113  *
30114  * Since: 2.20
30115  */
30116
30117
30118 /**
30119  * g_unix_is_mount_path_system_internal:
30120  * @mount_path: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
30121  *
30122  * Determines if @mount_path is considered an implementation of the
30123  * OS. This is primarily used for hiding mountable and mounted volumes
30124  * that only are used in the OS and has little to no relevance to the
30125  * casual user.
30126  *
30127  * Returns: %TRUE if @mount_path is considered an implementation detail of the OS.
30128  */
30129
30130
30131 /**
30132  * g_unix_mount_at: (skip)
30133  * @mount_path: path for a possible unix mount.
30134  * @time_read: (out) (allow-none): guint64 to contain a timestamp.
30135  *
30136  * Gets a #GUnixMountEntry for a given mount path. If @time_read
30137  * is set, it will be filled with a unix timestamp for checking
30138  * if the mounts have changed since with g_unix_mounts_changed_since().
30139  *
30140  * Returns: (transfer full): a #GUnixMountEntry.
30141  */
30142
30143
30144 /**
30145  * g_unix_mount_compare:
30146  * @mount1: first #GUnixMountEntry to compare.
30147  * @mount2: second #GUnixMountEntry to compare.
30148  *
30149  * Compares two unix mounts.
30150  *
30151  * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
30152  */
30153
30154
30155 /**
30156  * g_unix_mount_free:
30157  * @mount_entry: a #GUnixMountEntry.
30158  *
30159  * Frees a unix mount.
30160  */
30161
30162
30163 /**
30164  * g_unix_mount_get_device_path:
30165  * @mount_entry: a #GUnixMount.
30166  *
30167  * Gets the device path for a unix mount.
30168  *
30169  * Returns: a string containing the device path.
30170  */
30171
30172
30173 /**
30174  * g_unix_mount_get_fs_type:
30175  * @mount_entry: a #GUnixMount.
30176  *
30177  * Gets the filesystem type for the unix mount.
30178  *
30179  * Returns: a string containing the file system type.
30180  */
30181
30182
30183 /**
30184  * g_unix_mount_get_mount_path:
30185  * @mount_entry: input #GUnixMountEntry to get the mount path for.
30186  *
30187  * Gets the mount path for a unix mount.
30188  *
30189  * Returns: the mount path for @mount_entry.
30190  */
30191
30192
30193 /**
30194  * g_unix_mount_guess_can_eject:
30195  * @mount_entry: a #GUnixMountEntry
30196  *
30197  * Guesses whether a Unix mount can be ejected.
30198  *
30199  * Returns: %TRUE if @mount_entry is deemed to be ejectable.
30200  */
30201
30202
30203 /**
30204  * g_unix_mount_guess_icon:
30205  * @mount_entry: a #GUnixMountEntry
30206  *
30207  * Guesses the icon of a Unix mount.
30208  *
30209  * Returns: (transfer full): a #GIcon
30210  */
30211
30212
30213 /**
30214  * g_unix_mount_guess_name:
30215  * @mount_entry: a #GUnixMountEntry
30216  *
30217  * Guesses the name of a Unix mount.
30218  * The result is a translated string.
30219  *
30220  * Returns: A newly allocated string that must be freed with g_free()
30221  */
30222
30223
30224 /**
30225  * g_unix_mount_guess_should_display:
30226  * @mount_entry: a #GUnixMountEntry
30227  *
30228  * Guesses whether a Unix mount should be displayed in the UI.
30229  *
30230  * Returns: %TRUE if @mount_entry is deemed to be displayable.
30231  */
30232
30233
30234 /**
30235  * g_unix_mount_is_readonly:
30236  * @mount_entry: a #GUnixMount.
30237  *
30238  * Checks if a unix mount is mounted read only.
30239  *
30240  * Returns: %TRUE if @mount_entry is read only.
30241  */
30242
30243
30244 /**
30245  * g_unix_mount_is_system_internal:
30246  * @mount_entry: a #GUnixMount.
30247  *
30248  * Checks if a unix mount is a system path.
30249  *
30250  * Returns: %TRUE if the unix mount is for a system path.
30251  */
30252
30253
30254 /**
30255  * g_unix_mount_monitor_new:
30256  *
30257  * Gets a new #GUnixMountMonitor. The default rate limit for which the
30258  * monitor will report consecutive changes for the mount and mount
30259  * point entry files is the default for a #GFileMonitor. Use
30260  * g_unix_mount_monitor_set_rate_limit() to change this.
30261  *
30262  * Returns: a #GUnixMountMonitor.
30263  */
30264
30265
30266 /**
30267  * g_unix_mount_monitor_set_rate_limit:
30268  * @mount_monitor: a #GUnixMountMonitor
30269  * @limit_msec: a integer with the limit in milliseconds to poll for changes.
30270  *
30271  * Sets the rate limit to which the @mount_monitor will report
30272  * consecutive change events to the mount and mount point entry files.
30273  *
30274  * Since: 2.18
30275  */
30276
30277
30278 /**
30279  * g_unix_mount_point_compare:
30280  * @mount1: a #GUnixMount.
30281  * @mount2: a #GUnixMount.
30282  *
30283  * Compares two unix mount points.
30284  *
30285  * Returns: 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively.
30286  */
30287
30288
30289 /**
30290  * g_unix_mount_point_free:
30291  * @mount_point: unix mount point to free.
30292  *
30293  * Frees a unix mount point.
30294  */
30295
30296
30297 /**
30298  * g_unix_mount_point_get_device_path:
30299  * @mount_point: a #GUnixMountPoint.
30300  *
30301  * Gets the device path for a unix mount point.
30302  *
30303  * Returns: a string containing the device path.
30304  */
30305
30306
30307 /**
30308  * g_unix_mount_point_get_fs_type:
30309  * @mount_point: a #GUnixMountPoint.
30310  *
30311  * Gets the file system type for the mount point.
30312  *
30313  * Returns: a string containing the file system type.
30314  */
30315
30316
30317 /**
30318  * g_unix_mount_point_get_mount_path:
30319  * @mount_point: a #GUnixMountPoint.
30320  *
30321  * Gets the mount path for a unix mount point.
30322  *
30323  * Returns: a string containing the mount path.
30324  */
30325
30326
30327 /**
30328  * g_unix_mount_point_get_options:
30329  * @mount_point: a #GUnixMountPoint.
30330  *
30331  * Gets the options for the mount point.
30332  *
30333  * Returns: a string containing the options.
30334  * Since: 2.32
30335  */
30336
30337
30338 /**
30339  * g_unix_mount_point_guess_can_eject:
30340  * @mount_point: a #GUnixMountPoint
30341  *
30342  * Guesses whether a Unix mount point can be ejected.
30343  *
30344  * Returns: %TRUE if @mount_point is deemed to be ejectable.
30345  */
30346
30347
30348 /**
30349  * g_unix_mount_point_guess_icon:
30350  * @mount_point: a #GUnixMountPoint
30351  *
30352  * Guesses the icon of a Unix mount point.
30353  *
30354  * Returns: (transfer full): a #GIcon
30355  */
30356
30357
30358 /**
30359  * g_unix_mount_point_guess_name:
30360  * @mount_point: a #GUnixMountPoint
30361  *
30362  * Guesses the name of a Unix mount point.
30363  * The result is a translated string.
30364  *
30365  * Returns: A newly allocated string that must be freed with g_free()
30366  */
30367
30368
30369 /**
30370  * g_unix_mount_point_is_loopback:
30371  * @mount_point: a #GUnixMountPoint.
30372  *
30373  * Checks if a unix mount point is a loopback device.
30374  *
30375  * Returns: %TRUE if the mount point is a loopback. %FALSE otherwise.
30376  */
30377
30378
30379 /**
30380  * g_unix_mount_point_is_readonly:
30381  * @mount_point: a #GUnixMountPoint.
30382  *
30383  * Checks if a unix mount point is read only.
30384  *
30385  * Returns: %TRUE if a mount point is read only.
30386  */
30387
30388
30389 /**
30390  * g_unix_mount_point_is_user_mountable:
30391  * @mount_point: a #GUnixMountPoint.
30392  *
30393  * Checks if a unix mount point is mountable by the user.
30394  *
30395  * Returns: %TRUE if the mount point is user mountable.
30396  */
30397
30398
30399 /**
30400  * g_unix_mount_points_changed_since:
30401  * @time: guint64 to contain a timestamp.
30402  *
30403  * Checks if the unix mount points have changed since a given unix time.
30404  *
30405  * Returns: %TRUE if the mount points have changed since @time.
30406  */
30407
30408
30409 /**
30410  * g_unix_mount_points_get: (skip)
30411  * @time_read: (out) (allow-none): guint64 to contain a timestamp.
30412  *
30413  * Gets a #GList of #GUnixMountPoint containing the unix mount points.
30414  * If @time_read is set, it will be filled with the mount timestamp,
30415  * allowing for checking if the mounts have changed with
30416  * g_unix_mount_points_changed_since().
30417  *
30418  * Returns: (element-type GUnixMountPoint) (transfer full): a #GList of the UNIX mountpoints.
30419  */
30420
30421
30422 /**
30423  * g_unix_mounts_changed_since:
30424  * @time: guint64 to contain a timestamp.
30425  *
30426  * Checks if the unix mounts have changed since a given unix time.
30427  *
30428  * Returns: %TRUE if the mounts have changed since @time.
30429  */
30430
30431
30432 /**
30433  * g_unix_mounts_get: (skip)
30434  * @time_read: (out) (allow-none): guint64 to contain a timestamp, or %NULL
30435  *
30436  * Gets a #GList of #GUnixMountEntry containing the unix mounts.
30437  * If @time_read is set, it will be filled with the mount
30438  * timestamp, allowing for checking if the mounts have changed
30439  * with g_unix_mounts_changed_since().
30440  *
30441  * Returns: (element-type GUnixMountEntry) (transfer full): a #GList of the UNIX mounts.
30442  */
30443
30444
30445 /**
30446  * g_unix_output_stream_get_close_fd:
30447  * @stream: a #GUnixOutputStream
30448  *
30449  * Returns whether the file descriptor of @stream will be
30450  * closed when the stream is closed.
30451  *
30452  * Returns: %TRUE if the file descriptor is closed when done
30453  * Since: 2.20
30454  */
30455
30456
30457 /**
30458  * g_unix_output_stream_get_fd:
30459  * @stream: a #GUnixOutputStream
30460  *
30461  * Return the UNIX file descriptor that the stream writes to.
30462  *
30463  * Returns: The file descriptor of @stream
30464  * Since: 2.20
30465  */
30466
30467
30468 /**
30469  * g_unix_output_stream_new:
30470  * @fd: a UNIX file descriptor
30471  * @close_fd: %TRUE to close the file descriptor when done
30472  *
30473  * Creates a new #GUnixOutputStream for the given @fd.
30474  *
30475  * If @close_fd, is %TRUE, the file descriptor will be closed when
30476  * the output stream is destroyed.
30477  *
30478  * Returns: a new #GOutputStream
30479  */
30480
30481
30482 /**
30483  * g_unix_output_stream_set_close_fd:
30484  * @stream: a #GUnixOutputStream
30485  * @close_fd: %TRUE to close the file descriptor when done
30486  *
30487  * Sets whether the file descriptor of @stream shall be closed
30488  * when the stream is closed.
30489  *
30490  * Since: 2.20
30491  */
30492
30493
30494 /**
30495  * g_unix_socket_address_abstract_names_supported:
30496  *
30497  * Checks if abstract unix domain socket names are supported.
30498  *
30499  * Returns: %TRUE if supported, %FALSE otherwise
30500  * Since: 2.22
30501  */
30502
30503
30504 /**
30505  * g_unix_socket_address_get_address_type:
30506  * @address: a #GInetSocketAddress
30507  *
30508  * Gets @address's type.
30509  *
30510  * Returns: a #GUnixSocketAddressType
30511  * Since: 2.26
30512  */
30513
30514
30515 /**
30516  * g_unix_socket_address_get_is_abstract:
30517  * @address: a #GInetSocketAddress
30518  *
30519  * Tests if @address is abstract.
30520  *
30521  * Returns: %TRUE if the address is abstract, %FALSE otherwise
30522  * Since: 2.22
30523  * Deprecated: Use g_unix_socket_address_get_address_type()
30524  */
30525
30526
30527 /**
30528  * g_unix_socket_address_get_path:
30529  * @address: a #GInetSocketAddress
30530  *
30531  * Gets @address's path, or for abstract sockets the "name".
30532  *
30533  * Guaranteed to be zero-terminated, but an abstract socket
30534  * may contain embedded zeros, and thus you should use
30535  * g_unix_socket_address_get_path_len() to get the true length
30536  * of this string.
30537  *
30538  * Returns: the path for @address
30539  * Since: 2.22
30540  */
30541
30542
30543 /**
30544  * g_unix_socket_address_get_path_len:
30545  * @address: a #GInetSocketAddress
30546  *
30547  * Gets the length of @address's path.
30548  *
30549  * For details, see g_unix_socket_address_get_path().
30550  *
30551  * Returns: the length of the path
30552  * Since: 2.22
30553  */
30554
30555
30556 /**
30557  * g_unix_socket_address_new:
30558  * @path: the socket path
30559  *
30560  * Creates a new #GUnixSocketAddress for @path.
30561  *
30562  * To create abstract socket addresses, on systems that support that,
30563  * use g_unix_socket_address_new_abstract().
30564  *
30565  * Returns: a new #GUnixSocketAddress
30566  * Since: 2.22
30567  */
30568
30569
30570 /**
30571  * g_unix_socket_address_new_abstract:
30572  * @path: (array length=path_len) (element-type gchar): the abstract name
30573  * @path_len: the length of @path, or -1
30574  *
30575  * Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
30576  * #GUnixSocketAddress for @path.
30577  *
30578  * Returns: a new #GUnixSocketAddress
30579  * Deprecated: Use g_unix_socket_address_new_with_type().
30580  */
30581
30582
30583 /**
30584  * g_unix_socket_address_new_with_type:
30585  * @path: (array length=path_len) (element-type gchar): the name
30586  * @path_len: the length of @path, or -1
30587  * @type: a #GUnixSocketAddressType
30588  *
30589  * Creates a new #GUnixSocketAddress of type @type with name @path.
30590  *
30591  * If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
30592  * calling g_unix_socket_address_new().
30593  *
30594  * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
30595  * bytes of @path will be copied to the socket's path, and only those
30596  * bytes will be considered part of the name. (If @path_len is -1,
30597  * then @path is assumed to be NUL-terminated.) For example, if @path
30598  * was "test", then calling g_socket_address_get_native_size() on the
30599  * returned socket would return 7 (2 bytes of overhead, 1 byte for the
30600  * abstract-socket indicator byte, and 4 bytes for the name "test").
30601  *
30602  * If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
30603  * @path_len bytes of @path will be copied to the socket's path, the
30604  * rest of the path will be padded with 0 bytes, and the entire
30605  * zero-padded buffer will be considered the name. (As above, if
30606  * @path_len is -1, then @path is assumed to be NUL-terminated.) In
30607  * this case, g_socket_address_get_native_size() will always return
30608  * the full size of a <literal>struct sockaddr_un</literal>, although
30609  * g_unix_socket_address_get_path_len() will still return just the
30610  * length of @path.
30611  *
30612  * %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
30613  * %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
30614  * when connecting to a server created by another process, you must
30615  * use the appropriate type corresponding to how that process created
30616  * its listening socket.
30617  *
30618  * Returns: a new #GUnixSocketAddress
30619  * Since: 2.26
30620  */
30621
30622
30623 /**
30624  * g_vfs_get_default:
30625  *
30626  * Gets the default #GVfs for the system.
30627  *
30628  * Returns: (transfer none): a #GVfs.
30629  */
30630
30631
30632 /**
30633  * g_vfs_get_file_for_path:
30634  * @vfs: a #GVfs.
30635  * @path: a string containing a VFS path.
30636  *
30637  * Gets a #GFile for @path.
30638  *
30639  * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
30640  */
30641
30642
30643 /**
30644  * g_vfs_get_file_for_uri:
30645  * @vfs: a#GVfs.
30646  * @uri: a string containing a URI
30647  *
30648  * Gets a #GFile for @uri.
30649  *
30650  * This operation never fails, but the returned object
30651  * might not support any I/O operation if the URI
30652  * is malformed or if the URI scheme is not supported.
30653  *
30654  * Returns: (transfer full): a #GFile. Free the returned object with g_object_unref().
30655  */
30656
30657
30658 /**
30659  * g_vfs_get_local:
30660  *
30661  * Gets the local #GVfs for the system.
30662  *
30663  * Returns: (transfer none): a #GVfs.
30664  */
30665
30666
30667 /**
30668  * g_vfs_get_supported_uri_schemes:
30669  * @vfs: a #GVfs.
30670  *
30671  * Gets a list of URI schemes supported by @vfs.
30672  *
30673  * Returns: (transfer none): a %NULL-terminated array of strings. The returned array belongs to GIO and must not be freed or modified.
30674  */
30675
30676
30677 /**
30678  * g_vfs_is_active:
30679  * @vfs: a #GVfs.
30680  *
30681  * Checks if the VFS is active.
30682  *
30683  * Returns: %TRUE if construction of the @vfs was successful and it is now active.
30684  */
30685
30686
30687 /**
30688  * g_vfs_parse_name:
30689  * @vfs: a #GVfs.
30690  * @parse_name: a string to be parsed by the VFS module.
30691  *
30692  * This operation never fails, but the returned object might
30693  * not support any I/O operations if the @parse_name cannot
30694  * be parsed by the #GVfs module.
30695  *
30696  * Returns: (transfer full): a #GFile for the given @parse_name. Free the returned object with g_object_unref().
30697  */
30698
30699
30700 /**
30701  * g_volume_can_eject:
30702  * @volume: a #GVolume.
30703  *
30704  * Checks if a volume can be ejected.
30705  *
30706  * Returns: %TRUE if the @volume can be ejected. %FALSE otherwise.
30707  */
30708
30709
30710 /**
30711  * g_volume_can_mount:
30712  * @volume: a #GVolume.
30713  *
30714  * Checks if a volume can be mounted.
30715  *
30716  * Returns: %TRUE if the @volume can be mounted. %FALSE otherwise.
30717  */
30718
30719
30720 /**
30721  * g_volume_eject:
30722  * @volume: a #GVolume.
30723  * @flags: flags affecting the unmount if required for eject
30724  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
30725  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
30726  * @user_data: user data that gets passed to @callback
30727  *
30728  * Ejects a volume. This is an asynchronous operation, and is
30729  * finished by calling g_volume_eject_finish() with the @volume
30730  * and #GAsyncResult returned in the @callback.
30731  *
30732  * Deprecated: 2.22: Use g_volume_eject_with_operation() instead.
30733  */
30734
30735
30736 /**
30737  * g_volume_eject_finish:
30738  * @volume: pointer to a #GVolume.
30739  * @result: a #GAsyncResult.
30740  * @error: a #GError location to store an error, or %NULL to ignore
30741  *
30742  * Finishes ejecting a volume. If any errors occurred during the operation,
30743  * @error will be set to contain the errors and %FALSE will be returned.
30744  *
30745  * Returns: %TRUE, %FALSE if operation failed.
30746  * Deprecated: 2.22: Use g_volume_eject_with_operation_finish() instead.
30747  */
30748
30749
30750 /**
30751  * g_volume_eject_with_operation:
30752  * @volume: a #GVolume.
30753  * @flags: flags affecting the unmount if required for eject
30754  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
30755  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
30756  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
30757  * @user_data: user data passed to @callback.
30758  *
30759  * Ejects a volume. This is an asynchronous operation, and is
30760  * finished by calling g_volume_eject_with_operation_finish() with the @volume
30761  * and #GAsyncResult data returned in the @callback.
30762  *
30763  * Since: 2.22
30764  */
30765
30766
30767 /**
30768  * g_volume_eject_with_operation_finish:
30769  * @volume: a #GVolume.
30770  * @result: a #GAsyncResult.
30771  * @error: a #GError location to store the error occurring, or %NULL to ignore.
30772  *
30773  * Finishes ejecting a volume. If any errors occurred during the operation,
30774  * @error will be set to contain the errors and %FALSE will be returned.
30775  *
30776  * Returns: %TRUE if the volume was successfully ejected. %FALSE otherwise.
30777  * Since: 2.22
30778  */
30779
30780
30781 /**
30782  * g_volume_enumerate_identifiers:
30783  * @volume: a #GVolume
30784  *
30785  * Gets the kinds of <link linkend="volume-identifier">identifiers</link>
30786  * that @volume has. Use g_volume_get_identifier() to obtain
30787  * the identifiers themselves.
30788  *
30789  * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free.
30790  */
30791
30792
30793 /**
30794  * g_volume_get_activation_root:
30795  * @volume: a #GVolume
30796  *
30797  * Gets the activation root for a #GVolume if it is known ahead of
30798  * mount time. Returns %NULL otherwise. If not %NULL and if @volume
30799  * is mounted, then the result of g_mount_get_root() on the
30800  * #GMount object obtained from g_volume_get_mount() will always
30801  * either be equal or a prefix of what this function returns. In
30802  * other words, in code
30803  *
30804  * <programlisting>
30805  *   GMount *mount;
30806  *   GFile *mount_root
30807  *   GFile *volume_activation_root;
30808  *
30809  *   mount = g_volume_get_mount (volume); /&ast; mounted, so never NULL &ast;/
30810  *   mount_root = g_mount_get_root (mount);
30811  *   volume_activation_root = g_volume_get_activation_root(volume); /&ast; assume not NULL &ast;/
30812  * </programlisting>
30813  *
30814  * then the expression
30815  *
30816  * <programlisting>
30817  *   (g_file_has_prefix (volume_activation_root, mount_root) ||
30818  *       g_file_equal (volume_activation_root, mount_root))
30819  * </programlisting>
30820  *
30821  * will always be %TRUE.
30822  *
30823  * Activation roots are typically used in #GVolumeMonitor
30824  * implementations to find the underlying mount to shadow, see
30825  * g_mount_is_shadowed() for more details.
30826  *
30827  * Returns: (transfer full): the activation root of @volume or %NULL. Use g_object_unref() to free.
30828  * Since: 2.18
30829  */
30830
30831
30832 /**
30833  * g_volume_get_drive:
30834  * @volume: a #GVolume.
30835  *
30836  * Gets the drive for the @volume.
30837  *
30838  * 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.
30839  */
30840
30841
30842 /**
30843  * g_volume_get_icon:
30844  * @volume: a #GVolume.
30845  *
30846  * Gets the icon for @volume.
30847  *
30848  * Returns: (transfer full): a #GIcon. The returned object should be unreffed with g_object_unref() when no longer needed.
30849  */
30850
30851
30852 /**
30853  * g_volume_get_identifier:
30854  * @volume: a #GVolume
30855  * @kind: the kind of identifier to return
30856  *
30857  * Gets the identifier of the given kind for @volume.
30858  * See the <link linkend="volume-identifier">introduction</link>
30859  * for more information about volume identifiers.
30860  *
30861  * Returns: a newly allocated string containing the requested identfier, or %NULL if the #GVolume doesn't have this kind of identifier
30862  */
30863
30864
30865 /**
30866  * g_volume_get_mount:
30867  * @volume: a #GVolume.
30868  *
30869  * Gets the mount for the @volume.
30870  *
30871  * 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.
30872  */
30873
30874
30875 /**
30876  * g_volume_get_name:
30877  * @volume: a #GVolume.
30878  *
30879  * Gets the name of @volume.
30880  *
30881  * Returns: the name for the given @volume. The returned string should be freed with g_free() when no longer needed.
30882  */
30883
30884
30885 /**
30886  * g_volume_get_sort_key:
30887  * @volume: A #GVolume.
30888  *
30889  * Gets the sort key for @volume, if any.
30890  *
30891  * Returns: Sorting key for @volume or %NULL if no such key is available.
30892  * Since: 2.32
30893  */
30894
30895
30896 /**
30897  * g_volume_get_uuid:
30898  * @volume: a #GVolume.
30899  *
30900  * Gets the UUID for the @volume. The reference is typically based on
30901  * the file system UUID for the volume in question and should be
30902  * considered an opaque string. Returns %NULL if there is no UUID
30903  * available.
30904  *
30905  * 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.
30906  */
30907
30908
30909 /**
30910  * g_volume_monitor_adopt_orphan_mount:
30911  * @mount: a #GMount object to find a parent for
30912  *
30913  * This function should be called by any #GVolumeMonitor
30914  * implementation when a new #GMount object is created that is not
30915  * associated with a #GVolume object. It must be called just before
30916  * emitting the @mount_added signal.
30917  *
30918  * If the return value is not %NULL, the caller must associate the
30919  * returned #GVolume object with the #GMount. This involves returning
30920  * it in its g_mount_get_volume() implementation. The caller must
30921  * also listen for the "removed" signal on the returned object
30922  * and give up its reference when handling that signal
30923  *
30924  * Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
30925  * the implementor must take a reference to @mount and return it in
30926  * its g_volume_get_mount() implemented. Also, the implementor must
30927  * listen for the "unmounted" signal on @mount and give up its
30928  * reference upon handling that signal.
30929  *
30930  * There are two main use cases for this function.
30931  *
30932  * One is when implementing a user space file system driver that reads
30933  * blocks of a block device that is already represented by the native
30934  * volume monitor (for example a CD Audio file system driver). Such
30935  * a driver will generate its own #GMount object that needs to be
30936  * associated with the #GVolume object that represents the volume.
30937  *
30938  * The other is for implementing a #GVolumeMonitor whose sole purpose
30939  * is to return #GVolume objects representing entries in the users
30940  * "favorite servers" list or similar.
30941  *
30942  * Returns: (transfer full): the #GVolume object that is the parent for @mount or %NULL if no wants to adopt the #GMount.
30943  * 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.
30944  */
30945
30946
30947 /**
30948  * g_volume_monitor_get:
30949  *
30950  * Gets the volume monitor used by gio.
30951  *
30952  * Returns: (transfer full): a reference to the #GVolumeMonitor used by gio. Call g_object_unref() when done with it.
30953  */
30954
30955
30956 /**
30957  * g_volume_monitor_get_connected_drives:
30958  * @volume_monitor: a #GVolumeMonitor.
30959  *
30960  * Gets a list of drives connected to the system.
30961  *
30962  * The returned list should be freed with g_list_free(), after
30963  * its elements have been unreffed with g_object_unref().
30964  *
30965  * Returns: (element-type GDrive) (transfer full): a #GList of connected #GDrive objects.
30966  */
30967
30968
30969 /**
30970  * g_volume_monitor_get_mount_for_uuid:
30971  * @volume_monitor: a #GVolumeMonitor.
30972  * @uuid: the UUID to look for
30973  *
30974  * Finds a #GMount object by its UUID (see g_mount_get_uuid())
30975  *
30976  * Returns: (transfer full): a #GMount or %NULL if no such mount is available. Free the returned object with g_object_unref().
30977  */
30978
30979
30980 /**
30981  * g_volume_monitor_get_mounts:
30982  * @volume_monitor: a #GVolumeMonitor.
30983  *
30984  * Gets a list of the mounts on the system.
30985  *
30986  * The returned list should be freed with g_list_free(), after
30987  * its elements have been unreffed with g_object_unref().
30988  *
30989  * Returns: (element-type GMount) (transfer full): a #GList of #GMount objects.
30990  */
30991
30992
30993 /**
30994  * g_volume_monitor_get_volume_for_uuid:
30995  * @volume_monitor: a #GVolumeMonitor.
30996  * @uuid: the UUID to look for
30997  *
30998  * Finds a #GVolume object by its UUID (see g_volume_get_uuid())
30999  *
31000  * Returns: (transfer full): a #GVolume or %NULL if no such volume is available. Free the returned object with g_object_unref().
31001  */
31002
31003
31004 /**
31005  * g_volume_monitor_get_volumes:
31006  * @volume_monitor: a #GVolumeMonitor.
31007  *
31008  * Gets a list of the volumes on the system.
31009  *
31010  * The returned list should be freed with g_list_free(), after
31011  * its elements have been unreffed with g_object_unref().
31012  *
31013  * Returns: (element-type GVolume) (transfer full): a #GList of #GVolume objects.
31014  */
31015
31016
31017 /**
31018  * g_volume_mount:
31019  * @volume: a #GVolume.
31020  * @flags: flags affecting the operation
31021  * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
31022  * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
31023  * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
31024  * @user_data: user data that gets passed to @callback
31025  *
31026  * Mounts a volume. This is an asynchronous operation, and is
31027  * finished by calling g_volume_mount_finish() with the @volume
31028  * and #GAsyncResult returned in the @callback.
31029  *
31030  * Virtual: mount_fn
31031  */
31032
31033
31034 /**
31035  * g_volume_mount_finish:
31036  * @volume: a #GVolume
31037  * @result: a #GAsyncResult
31038  * @error: a #GError location to store an error, or %NULL to ignore
31039  *
31040  * Finishes mounting a volume. If any errors occurred during the operation,
31041  * @error will be set to contain the errors and %FALSE will be returned.
31042  *
31043  * If the mount operation succeeded, g_volume_get_mount() on @volume
31044  * is guaranteed to return the mount right after calling this
31045  * function; there's no need to listen for the 'mount-added' signal on
31046  * #GVolumeMonitor.
31047  *
31048  * Returns: %TRUE, %FALSE if operation failed.
31049  */
31050
31051
31052 /**
31053  * g_volume_should_automount:
31054  * @volume: a #GVolume
31055  *
31056  * Returns whether the volume should be automatically mounted.
31057  *
31058  * Returns: %TRUE if the volume should be automatically mounted.
31059  */
31060
31061
31062 /**
31063  * g_win32_input_stream_get_close_handle:
31064  * @stream: a #GWin32InputStream
31065  *
31066  * Returns whether the handle of @stream will be
31067  * closed when the stream is closed.
31068  *
31069  * Returns: %TRUE if the handle is closed when done
31070  * Since: 2.26
31071  */
31072
31073
31074 /**
31075  * g_win32_input_stream_get_handle:
31076  * @stream: a #GWin32InputStream
31077  *
31078  * Return the Windows file handle that the stream reads from.
31079  *
31080  * Returns: The file handle of @stream
31081  * Since: 2.26
31082  */
31083
31084
31085 /**
31086  * g_win32_input_stream_new:
31087  * @handle: a Win32 file handle
31088  * @close_handle: %TRUE to close the handle when done
31089  *
31090  * Creates a new #GWin32InputStream for the given @handle.
31091  *
31092  * If @close_handle is %TRUE, the handle will be closed
31093  * when the stream is closed.
31094  *
31095  * Note that "handle" here means a Win32 HANDLE, not a "file descriptor"
31096  * as used in the Windows C libraries.
31097  *
31098  * Returns: a new #GWin32InputStream
31099  */
31100
31101
31102 /**
31103  * g_win32_input_stream_set_close_handle:
31104  * @stream: a #GWin32InputStream
31105  * @close_handle: %TRUE to close the handle when done
31106  *
31107  * Sets whether the handle of @stream shall be closed
31108  * when the stream is closed.
31109  *
31110  * Since: 2.26
31111  */
31112
31113
31114 /**
31115  * g_win32_output_stream_get_close_handle:
31116  * @stream: a #GWin32OutputStream
31117  *
31118  * Returns whether the handle of @stream will be closed when the
31119  * stream is closed.
31120  *
31121  * Returns: %TRUE if the handle is closed when done
31122  * Since: 2.26
31123  */
31124
31125
31126 /**
31127  * g_win32_output_stream_get_handle:
31128  * @stream: a #GWin32OutputStream
31129  *
31130  * Return the Windows handle that the stream writes to.
31131  *
31132  * Returns: The handle descriptor of @stream
31133  * Since: 2.26
31134  */
31135
31136
31137 /**
31138  * g_win32_output_stream_new:
31139  * @handle: a Win32 file handle
31140  * @close_handle: %TRUE to close the handle when done
31141  *
31142  * Creates a new #GWin32OutputStream for the given @handle.
31143  *
31144  * If @close_handle, is %TRUE, the handle will be closed when the
31145  * output stream is destroyed.
31146  *
31147  * Returns: a new #GOutputStream
31148  * Since: 2.26
31149  */
31150
31151
31152 /**
31153  * g_win32_output_stream_set_close_handle:
31154  * @stream: a #GWin32OutputStream
31155  * @close_handle: %TRUE to close the handle when done
31156  *
31157  * Sets whether the handle of @stream shall be closed when the stream
31158  * is closed.
31159  *
31160  * Since: 2.26
31161  */
31162
31163
31164 /**
31165  * g_zlib_compressor_get_file_info:
31166  * @compressor: a #GZlibCompressor
31167  *
31168  * Returns the #GZlibCompressor:file-info property.
31169  *
31170  * Returns: (transfer none): a #GFileInfo, or %NULL
31171  * Since: 2.26
31172  */
31173
31174
31175 /**
31176  * g_zlib_compressor_new:
31177  * @format: The format to use for the compressed data
31178  * @level: compression level (0-9), -1 for default
31179  *
31180  * Creates a new #GZlibCompressor.
31181  *
31182  * Returns: a new #GZlibCompressor
31183  * Since: 2.24
31184  */
31185
31186
31187 /**
31188  * g_zlib_compressor_set_file_info:
31189  * @compressor: a #GZlibCompressor
31190  * @file_info: (allow-none): a #GFileInfo
31191  *
31192  * Sets @file_info in @compressor. If non-%NULL, and @compressor's
31193  * #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
31194  * it will be used to set the file name and modification time in
31195  * the GZIP header of the compressed data.
31196  *
31197  * Note: it is an error to call this function while a compression is in
31198  * progress; it may only be called immediately after creation of @compressor,
31199  * or after resetting it with g_converter_reset().
31200  *
31201  * Since: 2.26
31202  */
31203
31204
31205 /**
31206  * g_zlib_decompressor_get_file_info:
31207  * @decompressor: a #GZlibDecompressor
31208  *
31209  * Retrieves the #GFileInfo constructed from the GZIP header data
31210  * of compressed data processed by @compressor, or %NULL if @decompressor's
31211  * #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
31212  * or the header data was not fully processed yet, or it not present in the
31213  * data stream at all.
31214  *
31215  * Returns: (transfer none): a #GFileInfo, or %NULL
31216  * Since: 2.26
31217  */
31218
31219
31220 /**
31221  * g_zlib_decompressor_new:
31222  * @format: The format to use for the compressed data
31223  *
31224  * Creates a new #GZlibDecompressor.
31225  *
31226  * Returns: a new #GZlibDecompressor
31227  * Since: 2.24
31228  */
31229
31230
31231 /**
31232  * get_all_desktop_entries_for_mime_type:
31233  * @mime_type: a mime type.
31234  * @except: NULL or a strv list
31235  *
31236  * Returns all the desktop ids for @mime_type. The desktop files
31237  * are listed in an order so that default applications are listed before
31238  * non-default ones, and handlers for inherited mimetypes are listed
31239  * after the base ones.
31240  *
31241  * Optionally doesn't list the desktop ids given in the @except
31242  *
31243  * Returns: a #GList containing the desktop ids which claim to handle @mime_type.
31244  */
31245
31246
31247 /**
31248  * mime_info_cache_reload:
31249  * @dir: directory path which needs reloading.
31250  *
31251  * Reload the mime information for the @dir.
31252  */
31253
31254
31255
31256 /************************************************************/
31257 /* THIS FILE IS GENERATED DO NOT EDIT */
31258 /************************************************************/