a bus connection the well-known name to own a set of flags with ownership options closure to invoke when @name is acquired, or `NULL` to ignore closure to invoke when @name is lost, or `NULL` to ignore Version of [func@Gio.bus_own_name using closures instead of callbacks for easier binding in other languages. an identifier (never 0) that can be used with [func@Gio.bus_unown_name] to stop owning the name. the type of bus to own a name on the well-known name to own a set of flags with ownership options closure to invoke when connected to the bus of type @bus_type, or `NULL` to ignore closure to invoke when @name is acquired, or `NULL` to ignore closure to invoke when @name is lost, or `NULL` to ignore Stops owning a name. Note that there may still be D-Bus traffic to process (relating to owning and unowning the name) in the current thread-default [struct@GLib.MainContext] after this function has returned. You should continue to iterate the [struct@GLib.MainContext] until the [callback@GLib.DestroyNotify] function passed to [func@Gio.bus_own_name] is called, in order to avoid memory leaks through callbacks queued on the [struct@GLib.MainContext] after it’s stopped being iterated. an identifier obtained from [func@Gio.bus_own_name] Stops watching a name. Note that there may still be D-Bus traffic to process (relating to watching and unwatching the name) in the current thread-default #GMainContext after this function has returned. You should continue to iterate the #GMainContext until the #GDestroyNotify function passed to g_bus_watch_name() is called, in order to avoid memory leaks through callbacks queued on the #GMainContext after it’s stopped being iterated. An identifier obtained from g_bus_watch_name() Starts watching @name on the bus specified by @bus_type and calls @name_appeared_handler and @name_vanished_handler when the name is known to have an owner respectively known to lose its owner. Callbacks will be invoked in the thread-default main context (see [method@GLib.MainContext.push_thread_default]) of the thread you are calling this function from. You are guaranteed that one of the handlers will be invoked after calling this function. When you are done watching the name, just call g_bus_unwatch_name() with the watcher id this function returns. If the name vanishes or appears (for example the application owning the name could restart), the handlers are also invoked. If the #GDBusConnection that is used for watching the name disconnects, then @name_vanished_handler is invoked since it is no longer possible to access the name. Another guarantee is that invocations of @name_appeared_handler and @name_vanished_handler are guaranteed to alternate; that is, if @name_appeared_handler is invoked then you are guaranteed that the next time one of the handlers is invoked, it will be @name_vanished_handler. The reverse is also true. This behavior makes it very simple to write applications that want to take action when a certain [name exists](dbus-name-watching.html#d-bus-name-watching). Basically, the application should create object proxies in @name_appeared_handler and destroy them again (if any) in @name_vanished_handler. An identifier (never 0) that can be used with g_bus_unwatch_name() to stop watching the name. The type of bus to watch a name on. The name (well-known or unique) to watch. Flags from the #GBusNameWatcherFlags enumeration. Handler to invoke when @name is known to exist or %NULL. Handler to invoke when @name is known to not exist or %NULL. User data to pass to handlers. Function for freeing @user_data or %NULL. Like g_bus_watch_name() but takes a #GDBusConnection instead of a #GBusType. An identifier (never 0) that can be used with g_bus_unwatch_name() to stop watching the name. A #GDBusConnection. The name (well-known or unique) to watch. Flags from the #GBusNameWatcherFlags enumeration. Handler to invoke when @name is known to exist or %NULL. Handler to invoke when @name is known to not exist or %NULL. User data to pass to handlers. Function for freeing @user_data or %NULL. Version of g_bus_watch_name_on_connection() using closures instead of callbacks for easier binding in other languages. An identifier (never 0) that can be used with g_bus_unwatch_name() to stop watching the name. A #GDBusConnection. The name (well-known or unique) to watch. Flags from the #GBusNameWatcherFlags enumeration. #GClosure to invoke when @name is known to exist or %NULL. #GClosure to invoke when @name is known to not exist or %NULL. Version of g_bus_watch_name() using closures instead of callbacks for easier binding in other languages. An identifier (never 0) that can be used with g_bus_unwatch_name() to stop watching the name. The type of bus to watch a name on. The name (well-known or unique) to watch. Flags from the #GBusNameWatcherFlags enumeration. #GClosure to invoke when @name is known to exist or %NULL. #GClosure to invoke when @name is known to not exist or %NULL. If @subscription_id_pointer points to a nonzero subscription ID, unsubscribe from that D-Bus signal subscription as if via [method@Gio.DBusConnection.signal_unsubscribe]. Also set the value pointed to by @subscription_id_pointer to zero, which signifies it’s no longer a valid subscription ID. This convenience function for C code helps to ensure that each signal subscription is unsubscribed exactly once, similar to [func@GObject.clear_object] and [func@GObject.clear_signal_handler]. A pointer to either a subscription ID obtained from [method@Gio.DBusConnection.signal_subscribe], or zero. The connection from which the subscription ID was obtained. This pointer may be `NULL` or invalid, if the subscription ID is zero. Checks if a content type can be executable. Note that for instance things like text files can be executables (i.e. scripts and batch files). %TRUE if the file type corresponds to a type that can be executable, %FALSE otherwise. a content type string Compares two content types for equality. %TRUE if the two strings are identical or equivalent, %FALSE otherwise. a content type string a content type string Tries to find a content type based on the mime type name. Newly allocated string with content type or %NULL. Free with g_free() a mime type string Gets the human readable description of the content type. a short description of the content type @type. Free the returned string with g_free() a content type string Gets the generic icon name for a content type. See the [shared-mime-info](http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec) specification for more on the generic icon name. the registered generic icon name for the given @type, or %NULL if unknown. Free with g_free() a content type string Gets the icon for a content type. #GIcon corresponding to the content type. Free the returned object with g_object_unref() a content type string Get the list of directories which MIME data is loaded from. See g_content_type_set_mime_dirs() for details. %NULL-terminated list of directories to load MIME data from, including any `mime/` subdirectory, and with the first directory to try listed first Gets the mime type for the content type, if one is registered. the registered mime type for the given @type, or %NULL if unknown; free with g_free(). a content type string Gets the symbolic icon for a content type. symbolic #GIcon corresponding to the content type. Free the returned object with g_object_unref() a content type string Guesses the content type based on example data. If the function is uncertain, @result_uncertain will be set to %TRUE. Either @filename or @data may be %NULL, in which case the guess will be based solely on the other argument. a string indicating a guessed content type for the given data. Free with g_free() a path, or %NULL a stream of data, or %NULL the size of @data return location for the certainty of the result, or %NULL Tries to guess the type of the tree with root @root, by looking at the files it contains. The result is an array of content types, with the best guess coming first. The types returned all have the form x-content/foo, e.g. x-content/audio-cdda (for audio CDs) or x-content/image-dcf (for a camera memory card). See the [shared-mime-info](http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec) specification for more on x-content types. This function is useful in the implementation of g_mount_guess_content_type(). an %NULL-terminated array of zero or more content types. Free with g_strfreev() the root of the tree to guess a type for Determines if @type is a subset of @supertype. %TRUE if @type is a kind of @supertype, %FALSE otherwise. a content type string a content type string Determines if @type is a subset of @mime_type. Convenience wrapper around g_content_type_is_a(). %TRUE if @type is a kind of @mime_type, %FALSE otherwise. a content type string a mime type string Checks if the content type is the generic "unknown" type. On UNIX this is the "application/octet-stream" mimetype, while on win32 it is "*" and on OSX it is a dynamic type or octet-stream. %TRUE if the type is the unknown type. a content type string Set the list of directories used by GIO to load the MIME database. If @dirs is %NULL, the directories used are the default: - the `mime` subdirectory of the directory in `$XDG_DATA_HOME` - the `mime` subdirectory of every directory in `$XDG_DATA_DIRS` This function is intended to be used when writing tests that depend on information stored in the MIME database, in order to control the data. Typically, in case your tests use %G_TEST_OPTION_ISOLATE_DIRS, but they depend on the system’s MIME database, you should call this function with @dirs set to %NULL before calling g_test_init(), for instance: |[<!-- language="C" --> // Load MIME data from the system g_content_type_set_mime_dirs (NULL); // Isolate the environment g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL); … return g_test_run (); ]| %NULL-terminated list of directories to load MIME data from, including any `mime/` subdirectory, and with the first directory to try listed first Gets a list of strings containing all the registered content types known to the system. The list and its data should be freed using `g_list_free_full (list, g_free)`. list of the registered content types Escape @string so it can appear in a D-Bus address as the value part of a key-value pair. For instance, if @string is `/run/bus-for-:0`, this function would return `/run/bus-for-%3A0`, which could be used in a D-Bus address like `unix:nonce-tcp:host=127.0.0.1,port=42,noncefile=/run/bus-for-%3A0`. a copy of @string with all non-optionally-escaped bytes escaped an unescaped string to be included in a D-Bus address as the value in a key-value pair Synchronously looks up the D-Bus address for the well-known message bus instance specified by @bus_type. This may involve using various platform specific mechanisms. The returned address will be in the [D-Bus address format](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses). a valid D-Bus address string for @bus_type or %NULL if @error is set a #GBusType a #GCancellable or %NULL Asynchronously connects to an endpoint specified by @address and sets up the connection so it is in a state to run the client-side of the D-Bus authentication conversation. @address must be in the [D-Bus address format](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses). When the operation is finished, @callback will be invoked. You can then call g_dbus_address_get_stream_finish() to get the result of the operation. This is an asynchronous failable function. See g_dbus_address_get_stream_sync() for the synchronous version. A valid D-Bus address. A #GCancellable or %NULL. A #GAsyncReadyCallback to call when the request is satisfied. Data to pass to @callback. Finishes an operation started with g_dbus_address_get_stream(). A server is not required to set a GUID, so @out_guid may be set to %NULL even on success. A #GIOStream or %NULL if @error is set. A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream(). %NULL or return location to store the GUID extracted from @address, if any. Synchronously connects to an endpoint specified by @address and sets up the connection so it is in a state to run the client-side of the D-Bus authentication conversation. @address must be in the [D-Bus address format](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses). A server is not required to set a GUID, so @out_guid may be set to %NULL even on success. This is a synchronous failable function. See g_dbus_address_get_stream() for the asynchronous version. A #GIOStream or %NULL if @error is set. A valid D-Bus address. %NULL or return location to store the GUID extracted from @address, if any. A #GCancellable or %NULL. Looks up the value of an annotation. The cost of this function is O(n) in number of annotations. The value or %NULL if not found. Do not free, it is owned by @annotations. A %NULL-terminated array of annotations or %NULL. The name of the annotation to look up. Creates a D-Bus error name to use for @error. If @error matches a registered error (cf. g_dbus_error_register_error()), the corresponding D-Bus error name will be returned. Otherwise the a name of the form `org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE` will be used. This allows other GDBus applications to map the error on the wire back to a #GError using g_dbus_error_new_for_dbus_error(). This function is typically only used in object mappings to put a #GError on the wire. Regular applications should not use it. A D-Bus error name (never %NULL). Free with g_free(). A #GError. Gets the D-Bus error name used for @error, if any. This function is guaranteed to return a D-Bus error name for all #GErrors returned from functions handling remote method calls (e.g. g_dbus_connection_call_finish()) unless g_dbus_error_strip_remote_error() has been used on @error. an allocated string or %NULL if the D-Bus error name could not be found. Free with g_free(). a #GError Checks if @error represents an error received via D-Bus from a remote peer. If so, use g_dbus_error_get_remote_error() to get the name of the error. %TRUE if @error represents an error from a remote peer, %FALSE otherwise. A #GError. Creates a #GError based on the contents of @dbus_error_name and @dbus_error_message. Errors registered with g_dbus_error_register_error() will be looked up using @dbus_error_name and if a match is found, the error domain and code is used. Applications can use g_dbus_error_get_remote_error() to recover @dbus_error_name. If a match against a registered error is not found and the D-Bus error name is in a form as returned by g_dbus_error_encode_gerror() the error domain and code encoded in the name is used to create the #GError. Also, @dbus_error_name is added to the error message such that it can be recovered with g_dbus_error_get_remote_error(). Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR in the %G_IO_ERROR error domain is returned. Also, @dbus_error_name is added to the error message such that it can be recovered with g_dbus_error_get_remote_error(). In all three cases, @dbus_error_name can always be recovered from the returned #GError using the g_dbus_error_get_remote_error() function (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error). This function is typically only used in object mappings to prepare #GError instances for applications. Regular applications should not use it. An allocated #GError. Free with g_error_free(). D-Bus error name. D-Bus error message. Creates an association to map between @dbus_error_name and #GErrors specified by @error_domain and @error_code. This is typically done in the routine that returns the #GQuark for an error domain. %TRUE if the association was created, %FALSE if it already exists. A #GQuark for an error domain. An error code. A D-Bus error name. Helper function for associating a #GError error domain with D-Bus error names. While @quark_volatile has a `volatile` qualifier, this is a historical artifact and the argument passed to it should not be `volatile`. The error domain name. A pointer where to store the #GQuark. A pointer to @num_entries #GDBusErrorEntry struct items. Number of items to register. Looks for extra information in the error message used to recover the D-Bus error name and strips it if found. If stripped, the message field in @error will correspond exactly to what was received on the wire. This is typically used when presenting errors to the end user. %TRUE if information was stripped, %FALSE otherwise. A #GError. Destroys an association previously set up with g_dbus_error_register_error(). %TRUE if the association was destroyed, %FALSE if it wasn't found. A #GQuark for an error domain. An error code. A D-Bus error name. This is a language binding friendly version of g_dbus_escape_object_path_bytestring(). an escaped version of @s. Free with g_free(). the string to escape Escapes @bytes for use in a D-Bus object path component. @bytes is an array of zero or more nonzero bytes in an unspecified encoding, followed by a single zero byte. The escaping method consists of replacing all non-alphanumeric characters (see g_ascii_isalnum()) with their hexadecimal value preceded by an underscore (`_`). For example: `foo.bar.baz` will become `foo_2ebar_2ebaz`. This method is appropriate to use when the input is nearly a valid object path component but is not when your input is far from being a valid object path component. Other escaping algorithms are also valid to use with D-Bus object paths. This can be reversed with g_dbus_unescape_object_path(). an escaped version of @bytes. Free with g_free(). the string of bytes to escape Generate a D-Bus GUID that can be used with e.g. g_dbus_connection_new(). See the [D-Bus specification](https://dbus.freedesktop.org/doc/dbus-specification.html#uuids) regarding what strings are valid D-Bus GUIDs. The specification refers to these as ‘UUIDs’ whereas GLib (for historical reasons) refers to them as ‘GUIDs’. The terms are interchangeable. Note that D-Bus GUIDs do not follow [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122). A valid D-Bus GUID. Free with g_free(). Converts a #GValue to a #GVariant of the type indicated by the @type parameter. The conversion is using the following rules: - `G_TYPE_STRING`: 's', 'o', 'g' or 'ay' - `G_TYPE_STRV`: 'as', 'ao' or 'aay' - `G_TYPE_BOOLEAN`: 'b' - `G_TYPE_UCHAR`: 'y' - `G_TYPE_INT`: 'i', 'n' - `G_TYPE_UINT`: 'u', 'q' - `G_TYPE_INT64`: 'x' - `G_TYPE_UINT64`: 't' - `G_TYPE_DOUBLE`: 'd' - `G_TYPE_VARIANT`: Any #GVariantType This can fail if e.g. @gvalue is of type %G_TYPE_STRING and @type is 'i', i.e. %G_VARIANT_TYPE_INT32. It will also fail for any #GType (including e.g. %G_TYPE_OBJECT and %G_TYPE_BOXED derived-types) not in the table above. Note that if @gvalue is of type %G_TYPE_VARIANT and its value is %NULL, the empty #GVariant instance (never %NULL) for @type is returned (e.g. 0 for scalar types, the empty string for string types, '/' for object path types, the empty array for any array type and so on). See the g_dbus_gvariant_to_gvalue() function for how to convert a #GVariant to a #GValue. A #GVariant (never floating) of #GVariantType @type holding the data from @gvalue or an empty #GVariant in case of failure. Free with g_variant_unref(). A #GValue to convert to a #GVariant A #GVariantType Converts a #GVariant to a #GValue. If @value is floating, it is consumed. The rules specified in the g_dbus_gvalue_to_gvariant() function are used - this function is essentially its reverse form. So, a #GVariant containing any basic or string array type will be converted to a #GValue containing a basic value or string array. Any other #GVariant (handle, variant, tuple, dict entry) will be converted to a #GValue containing that #GVariant. The conversion never fails - a valid #GValue is always returned in @out_gvalue. A #GVariant. Return location pointing to a zero-filled (uninitialized) #GValue. Checks if @string is a [D-Bus address](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses). This doesn't check if @string is actually supported by #GDBusServer or #GDBusConnection - use g_dbus_is_supported_address() to do more checks. %TRUE if @string is a valid D-Bus address, %FALSE otherwise. A string. Check whether @string is a valid D-Bus error name. This function returns the same result as g_dbus_is_interface_name(), because D-Bus error names are defined to have exactly the same syntax as interface names. %TRUE if valid, %FALSE otherwise. The string to check. Checks if @string is a D-Bus GUID. See the documentation for g_dbus_generate_guid() for more information about the format of a GUID. %TRUE if @string is a GUID, %FALSE otherwise. The string to check. Checks if @string is a valid D-Bus interface name. %TRUE if valid, %FALSE otherwise. The string to check. Checks if @string is a valid D-Bus member (e.g. signal or method) name. %TRUE if valid, %FALSE otherwise. The string to check. Checks if @string is a valid D-Bus bus name (either unique or well-known). %TRUE if valid, %FALSE otherwise. The string to check. Like g_dbus_is_address() but also checks if the library supports the transports in @string and that key/value pairs for each transport are valid. See the specification of the [D-Bus address format](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses). %TRUE if @string is a valid D-Bus address that is supported by this library, %FALSE if @error is set. A string. Checks if @string is a valid D-Bus unique bus name. %TRUE if valid, %FALSE otherwise. The string to check. Unescapes an string that was previously escaped with g_dbus_escape_object_path(). If the string is in a format that could not have been returned by g_dbus_escape_object_path(), this function returns %NULL. Encoding alphanumeric characters which do not need to be encoded is not allowed (e.g `_63` is not valid, the string should contain `c` instead). an unescaped version of @s, or %NULL if @s is not a string returned from g_dbus_escape_object_path(). Free with g_free(). the string to unescape Creates a new #GDtlsClientConnection wrapping @base_socket which is assumed to communicate with the server identified by @server_identity. the new #GDtlsClientConnection, or %NULL on error the #GDatagramBased to wrap the expected identity of the server Creates a new #GDtlsServerConnection wrapping @base_socket. the new #GDtlsServerConnection, or %NULL on error the #GDatagramBased to wrap the default server certificate, or %NULL Constructs a #GFile from a vector of elements using the correct separator for filenames. Using this function is equivalent to calling g_build_filenamev(), followed by g_file_new_for_path() on the result. a new #GFile %NULL-terminated array of strings containing the path elements. Creates a #GFile with the given argument from the command line. The value of @arg can be either a URI, an absolute path or a relative path resolved relative to the current working directory. This operation never fails, but the returned object might not support any I/O operation if @arg points to a malformed path. Note that on Windows, this function expects its argument to be in UTF-8 -- not the system code page. This means that you should not use this function with string from argv as it is passed to main(). g_win32_get_command_line() will return a UTF-8 version of the commandline. #GApplication also uses UTF-8 but g_application_command_line_create_file_for_arg() may be more useful for you there. It is also always possible to use this function with #GOptionContext arguments of type %G_OPTION_ARG_FILENAME. a new #GFile. Free the returned object with g_object_unref(). a command line string Creates a #GFile with the given argument from the command line. This function is similar to g_file_new_for_commandline_arg() except that it allows for passing the current working directory as an argument instead of using the current working directory of the process. This is useful if the commandline argument was given in a context other than the invocation of the current process. See also g_application_command_line_create_file_for_arg(). a new #GFile a command line string the current working directory of the commandline Constructs a #GFile for a given path. This operation never fails, but the returned object might not support any I/O operation if @path is malformed. a new #GFile for the given @path. Free the returned object with g_object_unref(). a string containing a relative or absolute path. The string must be encoded in the glib filename encoding. Constructs a #GFile for a given URI. This operation never fails, but the returned object might not support any I/O operation if @uri is malformed or if the uri type is not supported. a new #GFile for the given @uri. Free the returned object with g_object_unref(). a UTF-8 string containing a URI Opens a file in the preferred directory for temporary files (as returned by g_get_tmp_dir()) and returns a #GFile and #GFileIOStream pointing to it. @tmpl should be a string in the GLib file name encoding containing a sequence of six 'X' characters, and containing no directory components. If it is %NULL, a default template is used. Unlike the other #GFile constructors, this will return %NULL if a temporary file could not be created. a new #GFile. Free the returned object with g_object_unref(). Template for the file name, as in g_file_open_tmp(), or %NULL for a default template on return, a #GFileIOStream for the created file Asynchronously opens a file in the preferred directory for temporary files (as returned by g_get_tmp_dir()) as g_file_new_tmp(). @tmpl should be a string in the GLib file name encoding containing a sequence of six 'X' characters, and containing no directory components. If it is %NULL, a default template is used. Template for the file name, as in g_file_open_tmp(), or %NULL for a default template the [I/O priority](iface.AsyncResult.html#io-priority) of the request optional #GCancellable object, %NULL to ignore a #GAsyncReadyCallback to call when the request is done data to pass to @callback Asynchronously creates a directory in the preferred directory for temporary files (as returned by g_get_tmp_dir()) as g_dir_make_tmp(). @tmpl should be a string in the GLib file name encoding containing a sequence of six 'X' characters, and containing no directory components. If it is %NULL, a default template is used. Template for the file name, as in g_dir_make_tmp(), or %NULL for a default template the [I/O priority](iface.AsyncResult.html#io-priority) of the request optional #GCancellable object, %NULL to ignore a #GAsyncReadyCallback to call when the request is done data to pass to @callback Finishes a temporary directory creation started by g_file_new_tmp_dir_async(). a new #GFile. Free the returned object with g_object_unref(). a #GAsyncResult Finishes a temporary file creation started by g_file_new_tmp_async(). a new #GFile. Free the returned object with g_object_unref(). a #GAsyncResult on return, a #GFileIOStream for the created file Constructs a #GFile with the given @parse_name (i.e. something given by g_file_get_parse_name()). This operation never fails, but the returned object might not support any I/O operation if the @parse_name cannot be parsed. a new #GFile. a file name or path to be parsed Deserializes a #GIcon previously serialized using g_icon_serialize(). a #GIcon, or %NULL when deserialization fails. a #GVariant created with g_icon_serialize() Generate a #GIcon instance from @str. This function can fail if @str is not valid - see g_icon_to_string() for discussion. If your application or library provides one or more #GIcon implementations you need to ensure that each #GType is registered with the type system prior to calling g_icon_new_for_string(). An object implementing the #GIcon interface or %NULL if @error is set. A string obtained via g_icon_to_string(). Helper function for constructing #GInitable object. This is similar to g_object_newv() but also initializes the object and returns %NULL, setting an error on failure. Use g_object_new_with_properties() and g_initable_init() instead. See #GParameter for more information. a newly allocated #GObject, or %NULL on error a #GType supporting #GInitable. the number of parameters in @parameters the parameters to use to construct the object optional #GCancellable object, %NULL to ignore. Converts `errno.h` error codes into GIO error codes. The fallback value %G_IO_ERROR_FAILED is returned for error codes not currently handled (but note that future GLib releases may return a more specific value instead). As `errno` is global and may be modified by intermediate function calls, you should save its value immediately after the call returns, and use the saved value instead of `errno`: |[<!-- language="C" --> int saved_errno; ret = read (blah); saved_errno = errno; g_io_error_from_errno (saved_errno); ]| #GIOErrorEnum value for the given `errno.h` error number Error number as defined in errno.h. Converts #GFileError error codes into GIO error codes. #GIOErrorEnum value for the given #GFileError error value. a #GFileError. Gets the GIO Error Quark. a #GQuark. Registers @type as extension for the extension point with name @extension_point_name. If @type has already been registered as an extension for this extension point, the existing #GIOExtension object is returned. a #GIOExtension object for #GType the name of the extension point the #GType to register as extension the name for the extension the priority for the extension Looks up an existing extension point. the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name. the name of the extension point Registers an extension point. the new #GIOExtensionPoint. This object is owned by GIO and should not be freed. The name of the extension point Loads all the modules in the specified directory. If don't require all modules to be initialized (and thus registering all gtypes) then you can use g_io_modules_scan_all_in_directory() which allows delayed/lazy loading of modules. 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(). pathname for a directory containing modules to load. Loads all the modules in the specified directory. If don't require all modules to be initialized (and thus registering all gtypes) then you can use g_io_modules_scan_all_in_directory() which allows delayed/lazy loading of modules. 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(). pathname for a directory containing modules to load. a scope to use when scanning the modules. Scans all the modules in the specified directory, ensuring that any extension point implemented by a module is registered. This may not actually load and initialize all the types in each module, some modules may be lazily loaded and initialized when an extension point it implements is used with e.g. g_io_extension_point_get_extensions() or g_io_extension_point_get_extension_by_name(). If you need to guarantee that all types are loaded in all the modules, use g_io_modules_load_all_in_directory(). pathname for a directory containing modules to scan. Scans all the modules in the specified directory, ensuring that any extension point implemented by a module is registered. This may not actually load and initialize all the types in each module, some modules may be lazily loaded and initialized when an extension point it implements is used with e.g. g_io_extension_point_get_extensions() or g_io_extension_point_get_extension_by_name(). If you need to guarantee that all types are loaded in all the modules, use g_io_modules_load_all_in_directory(). pathname for a directory containing modules to scan. a scope to use when scanning the modules Cancels all cancellable I/O jobs. A job is cancellable if a #GCancellable was passed into g_io_scheduler_push_job(). You should never call this function, since you don't know how other libraries in your program might be making use of gioscheduler. Schedules the I/O job to run in another thread. @notify will be called on @user_data after @job_func has returned, regardless whether the job was cancelled or has run to completion. If @cancellable is not %NULL, it can be used to cancel the I/O job by calling g_cancellable_cancel() or by calling g_io_scheduler_cancel_all_jobs(). use #GThreadPool or g_task_run_in_thread() a #GIOSchedulerJobFunc. data to pass to @job_func a #GDestroyNotify for @user_data, or %NULL the [I/O priority](iface.AsyncResult.html#io-priority) of the request. optional #GCancellable object, %NULL to ignore. Creates a keyfile-backed [class@Gio.SettingsBackend]. The filename of the keyfile to use is given by @filename. All settings read to or written from the backend must fall under the path given in @root_path (which must start and end with a slash and not contain two consecutive slashes). @root_path may be `"/"`. If @root_group is non-`NULL` then it specifies the name of the keyfile group used for keys that are written directly below @root_path. For example, if @root_path is `"/apps/example/"` and @root_group is `"toplevel"`, then setting the key `"/apps/example/enabled"` to true will cause the following to appear in the keyfile: ``` [toplevel] enabled=true ``` If @root_group is `NULL` then it is not permitted to store keys directly below the @root_path. For keys not stored directly below @root_path (ie: in a sub-path), the name of the subpath (with the final slash stripped) is used as the name of the keyfile group. To continue the example, if `"/apps/example/profiles/default/font-size"` were set to `12` then the following would appear in the keyfile: ``` [profiles/default] font-size=12 ``` The backend will refuse writes (and return writability as being false) for keys outside of @root_path and, in the event that @root_group is `NULL`, also for keys directly under @root_path. Writes will also be refused if the backend detects that it has the inability to rewrite the keyfile (ie: the containing directory is not writable). There is no checking done for your key namespace clashing with the syntax of the key file format. For example, if you have `[` or `]` characters in your path names or `=` in your key names you may be in trouble. The backend reads default values from a keyfile called `defaults` in the directory specified by the `GKeyfileSettingsBackend:defaults-dir` property, and a list of locked keys from a text file with the name `locks` in the same location. a keyfile-backed [class@Gio.SettingsBackend] the filename of the keyfile the path under which all settings keys appear the group name corresponding to @root_path, or `NULL` to disallow storing keys directly beneath @root_path Gets a reference to the default #GMemoryMonitor for the system. a new reference to the default #GMemoryMonitor Creates a memory-backed #GSettingsBackend. This backend allows changes to settings, but does not write them to any backing storage, so the next time you run your application, the memory backend will start out with the default values again. a newly created #GSettingsBackend Gets the default #GNetworkMonitor for the system. a #GNetworkMonitor, which will be a dummy object if no network monitor is available Initializes the platform networking libraries (eg, on Windows, this calls WSAStartup()). GLib will call this itself if it is needed, so you only need to call it if you directly call system networking functions (without calling any GLib networking functions first). Creates a readonly #GSettingsBackend. This backend does not allow changes to settings, so all settings will always have their default values. a newly created #GSettingsBackend Utility method for #GPollableInputStream and #GPollableOutputStream implementations. Creates a new #GSource that expects a callback of type #GPollableSourceFunc. The new source does not actually do anything on its own; use g_source_add_child_source() to add other sources to it to cause it to trigger. the new #GSource. the stream associated with the new source Utility method for #GPollableInputStream and #GPollableOutputStream implementations. Creates a new #GSource, as with g_pollable_source_new(), but also attaching @child_source (with a dummy callback), and @cancellable, if they are non-%NULL. the new #GSource. the stream associated with the new source optional child source to attach optional #GCancellable to attach Tries to read from @stream, as with g_input_stream_read() (if @blocking is %TRUE) or g_pollable_input_stream_read_nonblocking() (if @blocking is %FALSE). This can be used to more easily share code between blocking and non-blocking implementations of a method. If @blocking is %FALSE, then @stream must be a #GPollableInputStream for which g_pollable_input_stream_can_poll() returns %TRUE, or else the behavior is undefined. If @blocking is %TRUE, then @stream does not need to be a #GPollableInputStream. the number of bytes read, or -1 on error. a #GInputStream a buffer to read data into the number of bytes to read whether to do blocking I/O optional #GCancellable object, %NULL to ignore. Tries to write to @stream, as with g_output_stream_write() (if @blocking is %TRUE) or g_pollable_output_stream_write_nonblocking() (if @blocking is %FALSE). This can be used to more easily share code between blocking and non-blocking implementations of a method. If @blocking is %FALSE, then @stream must be a #GPollableOutputStream for which g_pollable_output_stream_can_poll() returns %TRUE or else the behavior is undefined. If @blocking is %TRUE, then @stream does not need to be a #GPollableOutputStream. the number of bytes written, or -1 on error. a #GOutputStream. the buffer containing the data to write. the number of bytes to write whether to do blocking I/O optional #GCancellable object, %NULL to ignore. Tries to write @count bytes to @stream, as with g_output_stream_write_all(), but using g_pollable_stream_write() rather than g_output_stream_write(). On a successful write of @count bytes, %TRUE is returned, and @bytes_written is set to @count. If there is an error during the operation (including %G_IO_ERROR_WOULD_BLOCK in the non-blocking case), %FALSE is returned and @error is set to indicate the error status, @bytes_written is updated to contain the number of bytes written into the stream before the error occurred. As with g_pollable_stream_write(), if @blocking is %FALSE, then @stream must be a #GPollableOutputStream for which g_pollable_output_stream_can_poll() returns %TRUE or else the behavior is undefined. If @blocking is %TRUE, then @stream does not need to be a #GPollableOutputStream. %TRUE on success, %FALSE if there was an error a #GOutputStream. the buffer containing the data to write. the number of bytes to write whether to do blocking I/O location to store the number of bytes that was written to the stream optional #GCancellable object, %NULL to ignore. Gets a reference to the default #GPowerProfileMonitor for the system. a new reference to the default #GPowerProfileMonitor Find the `gio-proxy` extension point for a proxy implementation that supports the specified protocol. return a #GProxy or NULL if protocol is not supported. the proxy protocol name (e.g. http, socks, etc) Gets the default #GProxyResolver for the system. the default #GProxyResolver, which will be a dummy object if no proxy resolver is available Gets the #GResolver Error Quark. a #GQuark. Gets the [struct@Gio.Resource] Error Quark. a [type@GLib.Quark] Loads a binary resource bundle and creates a [struct@Gio.Resource] representation of it, allowing you to query it for data. If you want to use this resource in the global resource namespace you need to register it with [func@Gio.resources_register]. If @filename is empty or the data in it is corrupt, %G_RESOURCE_ERROR_INTERNAL will be returned. If @filename doesn’t exist, or there is an error in reading it, an error from [ctor@GLib.MappedFile.new] will be returned. a new [struct@Gio.Resource], or `NULL` on error the path of a filename to load, in the GLib filename encoding Returns all the names of children at the specified @path in the set of globally registered resources. The return result is a `NULL` terminated list of strings which should be released with [func@GLib.strfreev]. @lookup_flags controls the behaviour of the lookup. an array of constant strings A path name inside the resource A [flags@Gio.ResourceLookupFlags] Looks for a file at the specified @path in the set of globally registered resources and if found returns information about it. @lookup_flags controls the behaviour of the lookup. `TRUE` if the file was found, `FALSE` if there were errors A path name inside the resource A [flags@Gio.ResourceLookupFlags] a location to place the length of the contents of the file, or `NULL` if the length is not needed a location to place the [flags@Gio.ResourceFlags] about the file, or `NULL` if the flags are not needed Returns whether the specified @path in the set of globally registered resources has children. %TRUE if @patch has children A pathname Looks for a file at the specified @path in the set of globally registered resources and returns a [struct@GLib.Bytes] that lets you directly access the data in memory. The data is always followed by a zero byte, so you can safely use the data as a C string. However, that byte is not included in the size of the [struct@GLib.Bytes]. For uncompressed resource files this is a pointer directly into the resource bundle, which is typically in some read-only data section in the program binary. For compressed files we allocate memory on the heap and automatically uncompress the data. @lookup_flags controls the behaviour of the lookup. [struct@GLib.Bytes] or `NULL` on error A path name inside the resource A [flags@Gio.ResourceLookupFlags] Looks for a file at the specified @path in the set of globally registered resources and returns a [class@Gio.InputStream] that lets you read the data. @lookup_flags controls the behaviour of the lookup. [class@Gio.InputStream] or `NULL` on error A path name inside the resource A [flags@Gio.ResourceLookupFlags] Registers the resource with the process-global set of resources. Once a resource is registered the files in it can be accessed with the global resource lookup functions like [func@Gio.resources_lookup_data]. A [struct@Gio.Resource] Unregisters the resource from the process-global set of resources. A [struct@Gio.Resource] Gets the default system schema source. This function is not required for normal uses of #GSettings but it may be useful to authors of plugin management systems or to those who want to introspect the content of schemas. If no schemas are installed, %NULL will be returned. The returned source may actually consist of multiple schema sources from different directories, depending on which directories were given in `XDG_DATA_DIRS` and `GSETTINGS_SCHEMA_DIR`. For this reason, all lookups performed against the default source should probably be done recursively. the default schema source Reports an error in an asynchronous function in an idle function by directly setting the contents of the #GAsyncResult with the given error information. Use g_task_report_error(). a #GObject, or %NULL. a #GAsyncReadyCallback. user data passed to @callback. a #GQuark containing the error domain (usually %G_IO_ERROR). a specific error code. a formatted error reporting string. a list of variables to fill in @format. Reports an error in an idle function. Similar to g_simple_async_report_error_in_idle(), but takes a #GError rather than building a new one. Use g_task_report_error(). a #GObject, or %NULL a #GAsyncReadyCallback. user data passed to @callback. the #GError to report Reports an error in an idle function. Similar to g_simple_async_report_gerror_in_idle(), but takes over the caller's ownership of @error, so the caller does not have to free it any more. Use g_task_report_error(). a #GObject, or %NULL a #GAsyncReadyCallback. user data passed to @callback. the #GError to report Sorts @targets in place according to the algorithm in RFC 2782. the head of the sorted list. a #GList of #GSrvTarget Gets the default #GTlsBackend for the system. a #GTlsBackend, which will be a dummy object if no TLS backend is available Gets the TLS channel binding error quark. a #GQuark. Creates a new #GTlsClientConnection wrapping @base_io_stream (which must have pollable input and output streams) which is assumed to communicate with the server identified by @server_identity. See the documentation for #GTlsConnection:base-io-stream for restrictions on when application code can run operations on the @base_io_stream after this function has returned. the new #GTlsClientConnection, or %NULL on error the #GIOStream to wrap the expected identity of the server Gets the TLS error quark. a #GQuark. Creates a new #GTlsFileDatabase which uses anchor certificate authorities in @anchors to verify certificate chains. The certificates in @anchors must be PEM encoded. the new #GTlsFileDatabase, or %NULL on error filename of anchor certificate authorities. Creates a new #GTlsServerConnection wrapping @base_io_stream (which must have pollable input and output streams). See the documentation for #GTlsConnection:base-io-stream for restrictions on when application code can run operations on the @base_io_stream after this function has returned. the new #GTlsServerConnection, or %NULL on error the #GIOStream to wrap the default server certificate, or %NULL Determines if @mount_path is considered an implementation of the OS. This is primarily used for hiding mountable and mounted volumes that only are used in the OS and has little to no relevance to the casual user. true if @mount_path is considered an implementation detail of the OS; false otherwise a mount path, e.g. `/media/disk` or `/usr` Determines if @device_path is considered a block device path which is only used in implementation of the OS. This is primarily used for hiding mounted volumes that are intended as APIs for programs to read, and system administrators at a shell; rather than something that should, for example, appear in a GUI. For example, the Linux `/proc` filesystem. The list of device paths considered ‘system’ ones may change over time. true if @device_path is considered an implementation detail of the OS; false otherwise a device path, e.g. `/dev/loop0` or `nfsd` Determines if @fs_type is considered a type of file system which is only used in implementation of the OS. This is primarily used for hiding mounted volumes that are intended as APIs for programs to read, and system administrators at a shell; rather than something that should, for example, appear in a GUI. For example, the Linux `/proc` filesystem. The list of file system types considered ‘system’ ones may change over time. true if @fs_type is considered an implementation detail of the OS; false otherwise a file system type, e.g. `procfs` or `tmpfs` Gets a [struct@GioUnix.MountEntry] for a given mount path. If @time_read is set, it will be filled with a Unix timestamp for checking if the mounts have changed since with [func@GioUnix.mount_entries_changed_since]. If more mounts have the same mount path, the last matching mount is returned. This will return `NULL` if there is no mount point at @mount_path. Use [func@GioUnix.MountEntry.at] instead. a [struct@GioUnix.MountEntry] path for a possible Unix mount return location for a timestamp Compares two Unix mounts. Use [func@GioUnix.MountEntry.compare] instead. `1`, `0` or `-1` if @mount1 is greater than, equal to, or less than @mount2, respectively first [struct@GioUnix.MountEntry] to compare second [struct@GioUnix.MountEntry] to compare Makes a copy of @mount_entry. Use [func@GioUnix.MountEntry.copy] instead. a new [struct@GioUnix.MountEntry] a [struct@GioUnix.MountEntry] Checks if the Unix mounts have changed since a given Unix time. This can only work reliably if a [class@GioUnix.MountMonitor] is running in the process, otherwise changes in the mount entries file (such as `/proc/self/mountinfo` on Linux) cannot be detected and, as a result, this function has to conservatively always return `TRUE`. It is more efficient to use [signal@GioUnix.MountMonitor::mounts-changed] to be signalled of changes to the mount entries, rather than polling using this function. This function is more appropriate for infrequently determining cache validity. true if the mounts have changed since @time; false otherwise Since 2.84 a timestamp Gets a list of [struct@GioUnix.MountEntry] instances representing the Unix mounts. If @time_read is set, it will be filled with the mount timestamp, allowing for checking if the mounts have changed with [func@GioUnix.mount_entries_changed_since]. a list of the Unix mounts return location for a timestamp Gets an array of [struct@Gio.UnixMountEntry]s containing the Unix mounts listed in @table_path. This is a generalized version of [func@GioUnix.mount_entries_get], mainly intended for internal testing use. Note that [func@GioUnix.mount_entries_get] may parse multiple hierarchical table files, so this function is not a direct superset of its functionality. If there is an error reading or parsing the file, `NULL` will be returned and both out parameters will be set to `0`. mount entries, or `NULL` if there was an error loading them path to the mounts table file (for example `/proc/self/mountinfo`) return location for the modification time of @table_path return location for the number of mount entries returned Gets a [struct@GioUnix.MountEntry] for a given mount path. If @time_read is set, it will be filled with a Unix timestamp for checking if the mounts have changed since with [func@GioUnix.mount_entries_changed_since]. If more mounts have the same mount path, the last matching mount is returned. This will return `NULL` if there is no mount point at @mount_path. a [struct@GioUnix.MountEntry] path for a possible Unix mount return location for a timestamp Gets a [struct@GioUnix.MountEntry] for a given file path. If @time_read is set, it will be filled with a Unix timestamp for checking if the mounts have changed since with [func@GioUnix.mount_entries_changed_since]. If more mounts have the same mount path, the last matching mount is returned. This will return `NULL` if looking up the mount entry fails, if @file_path doesn’t exist or there is an I/O error. a [struct@GioUnix.MountEntry] file path on some Unix mount return location for a timestamp Gets a [struct@GioUnix.MountEntry] for a given file path. If @time_read is set, it will be filled with a Unix timestamp for checking if the mounts have changed since with [func@GioUnix.mount_entries_changed_since]. If more mounts have the same mount path, the last matching mount is returned. This will return `NULL` if looking up the mount entry fails, if @file_path doesn’t exist or there is an I/O error. Use [func@GioUnix.MountEntry.for] instead. a [struct@GioUnix.MountEntry] file path on some Unix mount return location for a timestamp Frees a Unix mount. Use [func@GioUnix.MountEntry.free] instead. a [struct@GioUnix.MountEntry] Gets the device path for a Unix mount. Use [func@GioUnix.MountEntry.get_device_path] instead. a string containing the device path a [struct@GioUnix.MountEntry] Gets the filesystem type for the Unix mount. Use [func@GioUnix.MountEntry.get_fs_type] instead. a string containing the file system type a [struct@GioUnix.MountEntry] Gets the mount path for a Unix mount. Use [func@GioUnix.MountEntry.get_mount_path] instead. the mount path for @mount_entry a [struct@GioUnix.MountEntry] to get the mount path for Gets a comma separated list of mount options for the Unix mount. For example: `rw,relatime,seclabel,data=ordered`. This is similar to [func@GioUnix.MountPoint.get_options], but it takes a [struct@GioUnix.MountEntry] as an argument. Use [func@GioUnix.MountEntry.get_options] instead. a string containing the options, or `NULL` if not available. a [struct@GioUnix.MountEntry] Gets the root of the mount within the filesystem. This is useful e.g. for mounts created by bind operation, or btrfs subvolumes. For example, the root path is equal to `/` for a mount created by `mount /dev/sda1 /mnt/foo` and `/bar` for `mount --bind /mnt/foo/bar /mnt/bar`. Use [func@GioUnix.MountEntry.get_root_path] instead. a string containing the root, or `NULL` if not supported a [struct@GioUnix.MountEntry] Guesses whether a Unix mount entry can be ejected. Use [func@GioUnix.MountEntry.guess_can_eject] instead. true if @mount_entry is deemed to be ejectable; false otherwise a [struct@GioUnix.MountEntry] Guesses the icon of a Unix mount entry. Use [func@GioUnix.MountEntry.guess_icon] instead. a [iface@Gio.Icon] a [struct@GioUnix.MountEntry] Guesses the name of a Unix mount entry. The result is a translated string. Use [func@GioUnix.MountEntry.guess_name] instead. a newly allocated translated string a [struct@GioUnix.MountEntry] Guesses whether a Unix mount entry should be displayed in the UI. Use [func@GioUnix.MountEntry.guess_should_display] instead. true if @mount_entry is deemed to be displayable; false otherwise a [struct@GioUnix.MountEntry] Guesses the symbolic icon of a Unix mount entry. Use [func@GioUnix.MountEntry.guess_symbolic_icon] instead. a [iface@Gio.Icon] a [struct@GioUnix.MountEntry] Checks if a Unix mount is mounted read only. Use [func@GioUnix.MountEntry.is_readonly] instead. true if @mount_entry is read only; false otherwise a [struct@GioUnix.MountEntry] Checks if a Unix mount is a system mount. This is the Boolean OR of [func@GioUnix.is_system_fs_type], [func@GioUnix.is_system_device_path] and [func@GioUnix.is_mount_path_system_internal] on @mount_entry’s properties. The definition of what a ‘system’ mount entry is may change over time as new file system types and device paths are ignored. Use [func@GioUnix.MountEntry.is_system_internal] instead. true if the Unix mount is for a system path; false otherwise a [struct@GioUnix.MountEntry] Gets a [struct@GioUnix.MountPoint] for a given mount path. If @time_read is set, it will be filled with a Unix timestamp for checking if the mount points have changed since with [func@GioUnix.mount_points_changed_since]. If more mount points have the same mount path, the last matching mount point is returned. a [struct@GioUnix.MountPoint], or `NULL` if no match is found path for a possible Unix mount point return location for a timestamp Checks if the Unix mount points have changed since a given Unix time. Unlike [func@GioUnix.mount_entries_changed_since], this function can work reliably without a [class@GioUnix.MountMonitor] running, as it accesses the static mount point information (such as `/etc/fstab` on Linux), which has a valid modification time. It is more efficient to use [signal@GioUnix.MountMonitor::mountpoints-changed] to be signalled of changes to the mount points, rather than polling using this function. This function is more appropriate for infrequently determining cache validity. true if the mount points have changed since @time; false otherwise a timestamp Gets a list of [struct@GioUnix.MountPoint] instances representing the Unix mount points. If @time_read is set, it will be filled with the mount timestamp, allowing for checking if the mounts have changed with [func@GioUnix.mount_points_changed_since]. a list of the Unix mount points return location for a timestamp Gets an array of [struct@Gio.UnixMountPoint]s containing the Unix mount points listed in @table_path. This is a generalized version of [func@GioUnix.mount_points_get], mainly intended for internal testing use. Note that [func@GioUnix.mount_points_get] may parse multiple hierarchical table files, so this function is not a direct superset of its functionality. If there is an error reading or parsing the file, `NULL` will be returned and both out parameters will be set to `0`. mount points, or `NULL` if there was an error loading them path to the mount points table file (for example `/etc/fstab`) return location for the modification time of @table_path return location for the number of mount points returned Checks if the Unix mounts have changed since a given Unix time. Use [func@GioUnix.mount_entries_changed_since] instead. true if the mounts have changed since @time; false otherwise a timestamp Gets a list of [struct@GioUnix.MountEntry] instances representing the Unix mounts. If @time_read is set, it will be filled with the mount timestamp, allowing for checking if the mounts have changed with [func@GioUnix.mount_entries_changed_since]. Use [func@GioUnix.mount_entries_get] instead. a list of the Unix mounts return location for a timestamp Gets an array of [struct@Gio.UnixMountEntry]s containing the Unix mounts listed in @table_path. This is a generalized version of [func@GioUnix.mount_entries_get], mainly intended for internal testing use. Note that [func@GioUnix.mount_entries_get] may parse multiple hierarchical table files, so this function is not a direct superset of its functionality. If there is an error reading or parsing the file, `NULL` will be returned and both out parameters will be set to `0`. Use [func@GioUnix.mount_entries_get_from_file] instead. mount entries, or `NULL` if there was an error loading them path to the mounts table file (for example `/proc/self/mountinfo`) return location for the modification time of @table_path return location for the number of mount entries returned