Converts a string to a hash value. It can be passed to g_hash_table_new() as the @hash_func parameter, when using strings as keys in a #GHashTable. a string key a hash value corresponding to the key Unquotes a string as the shell (/bin/sh) would. Only handles quotes; if a string contains file globs, arithmetic operators, variables, backticks, redirections, or other special-to-the-shell features, the result will be different from the result a real shell would produce (the variables, backticks, etc. will be passed through literally instead of being expanded). This function is guaranteed to succeed if applied to the result of g_shell_quote(). If it fails, it returns %NULL and sets the error. The @quoted_string need not actually contain quoted or escaped text; g_shell_unquote() simply goes through the string and unquotes/unescapes anything that the shell would. Both single and double quotes are handled, as are escapes including escaped newlines. The return value must be freed with g_free(). Possible errors are in the #G_SHELL_ERROR domain. Shell quoting rules are a bit strange. Single quotes preserve the literal string exactly. escape sequences are not allowed; not even \' - if you want a ' in the quoted text, you have to do something like 'foo'\''bar'. Double quotes allow $, `, ", \, and newline to be escaped with backslash. Otherwise double quotes preserve things literally. shell-quoted string error return location or NULL an unquoted string Removes a previously installed #GTypeClassCacheFunc. The cache maintained by @cache_func has to be empty when calling g_type_remove_class_cache_func() to avoid leaks. data that was given when adding @cache_func a #GTypeClassCacheFunc Behaves exactly like g_build_path(), but takes the path elements as a string array, instead of varargs. This function is mainly meant for language bindings. a string used to separator the elements of the path. %NULL-terminated array of strings containing the path elements. a newly-allocated string that must be freed with g_free(). Since: 2.8 References a file attribute info list. a #GFileAttributeInfoList to reference. #GFileAttributeInfoList or %NULL on error. Return value: the number of threads currently running a #GThreadPool the number of threads currently running Retrieves the names of the applications that have registered the bookmark for @uri. In the event the URI cannot be found, %NULL is returned and @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. a #GBookmarkFile a valid URI return location of the length of the returned list, or %NULL return location for a #GError, or %NULL a newly allocated %NULL-terminated array of strings. Use g_strfreev() to free it. Since: 2.12 Checks if @drive is capabable of automatically detecting media changes. a #GDrive. %TRUE if the @drive is capabable of automatically detecting media changes, %FALSE otherwise. Returns: a canonical representation for the string a string a canonical representation for the string Since: 2.10 Flushes a stream asynchronously. For behaviour details see g_output_stream_flush(). When the operation is finished @callback will be called. You can then call g_output_stream_flush_finish() to get the result of the operation. a #GOutputStream. the io priority of the request. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied the data to pass to callback function Adds a content type to the application information to indicate the application is capable of opening files with the given content type. a #GAppInfo. a string. a #GError. %TRUE on success, %FALSE on error. Creates a new closure which invokes @callback_func with @user_data as the last parameter. the function to invoke user data to pass to @callback_func destroy notify to be called when @user_data is no longer used a new #GCClosure Gets the file's size. a #GFileInfo. a #goffset containing the file's size. Creates a new #GSource structure. The size is specified to allow creating structures derived from #GSource that contain additional data. The size passed in must be at least <literal>sizeof (GSource)</literal>. The source will not initially be associated with any #GMainContext and must be added to one with g_source_attach() before it will be executed. structure containing functions that implement the sources behavior. size of the #GSource structure to create. the newly-created #GSource. The initial reference count of a newly created #GParamSpec is 1, even though no one has explicitly called g_param_spec_ref() on it yet. So the initial reference count is flagged as "floating", until someone calls <literal>g_param_spec_ref (pspec); g_param_spec_sink (pspec);</literal> in sequence on it, taking over the initial reference count (thus ending up with a @pspec that has a reference count of 1 still, but is not flagged "floating" anymore). a valid #GParamSpec Gets the number of children of a #GNode. a #GNode the number of children of @node Creates a new #GStringChunk. the default size of the blocks of memory which are allocated to store the strings. If a particular string is larger than this default size, a larger block of memory will be allocated for it. a new #GStringChunk Scans for the next match using the same parameters of the previous call to g_regex_match_full() or g_regex_match() that returned @match_info. The match is done on the string passed to the match function, so you cannot free it before calling this function. a #GMatchInfo structure location to store the error occuring, or %NULL to ignore errors %TRUE is the string matched, %FALSE otherwise Since: 2.14 Creates a symbolic link. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. a string with the value of the new symlink. optional #GCancellable object, %NULL to ignore. a #GError. %TRUE on the creation of a new symlink, %FALSE otherwise. Adds an emission hook for a signal, which will get called for any emission of that signal, independent of the instance. This is possible only for signals which don't have #G_SIGNAL_NO_HOOKS flag set. the signal identifier, as returned by g_signal_lookup(). the detail on which to call the hook. a #GSignalEmissionHook function. user data for @hook_func. a #GDestroyNotify for @hook_data. the hook id, for later use with g_signal_remove_emission_hook(). Decreases reference count of @regex by 1. When reference count drops to zero, it frees all the memory associated with the regex structure. Since: 2.14 a #GRegex If @context is currently waiting in a poll(), interrupt the poll(), and continue the iteration process. a #GMainContext Sets the meta marshaller of @closure. A meta marshaller wraps @closure->marshal and modifies the way it is called in some fashion. The most common use of this facility is for C callbacks. The same marshallers (generated by <link linkend="glib-genmarshal">glib-genmarshal</link>) are used everywhere, but the way that we get the callback function differs. In most cases we want to use @closure->callback, but in other cases we want to use some different technique to retrieve the callback function. For example, class closures for signals (see g_signal_type_cclosure_new()) retrieve the callback function from a fixed offset in the class structure. The meta marshaller retrieves the right callback and passes it to the marshaller as the @marshal_data argument. a #GClosure context-dependent data to pass to @meta_marshal a #GClosureMarshal function Gets the directory to use for temporary files. This is found from inspecting the environment variables <envar>TMPDIR</envar>, <envar>TMP</envar>, and <envar>TEMP</envar> in that order. If none of those are defined "/tmp" is returned on UNIX and "C:\" on Windows. The encoding of the returned string is system-defined. On Windows, it is always UTF-8. The return value is never %NULL. the directory to use for temporary files. Tries to find a content type based on the mime type name. a mime type string. Newly allocated string with content type or NULL when does not know. Since: 2.18 Puts an unsigned 32-bit integer into the stream. a #GDataOutputStream. a #guint32. optional #GCancellable object, %NULL to ignore. a #GError, %NULL to ignore. %TRUE if @data was successfully added to the @stream. Returns: the string searched with @match_info a #GMatchInfo the string searched with @match_info Since: 2.14 Return value: A negative number if @a comes before @b, 0 if they are a #GSequenceIter a #GSequenceIter A negative number if @a comes before @b, 0 if they are equal, and a positive number if @a comes after @b. Since: 2.14 Adds a function to be called whenever there are no higher priority events pending. If the function returns %FALSE it is automatically removed from the list of event sources and will not be called again. the priority of the idle source. Typically this will be in the range btweeen #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE. function to call data to pass to @function function to call when the idle is removed, or %NULL the ID (greater than 0) of the event source. Removes the @n'th element of @queue. a #GQueue the position of the element. the element's data, or %NULL if @n is off the end of @queue. Since: 2.4 Adds a new element on to the start of the list. <note><para> The return value is the new start of the list, which may have changed, so make sure you store the new value. </para></note> |[ /* Notice that it is initialized to the empty list. */ GSList *list = NULL; list = g_slist_prepend (list, "last"); list = g_slist_prepend (list, "first"); ]| a #GSList the data for the new element the new start of the #GSList Gets the parse name of the @file. A parse name is a UTF-8 string that describes the file such that one can get the #GFile back using g_file_parse_name(). This is generally used to show the #GFile as a nice full-pathname kind of string in a user interface, like in a location entry. For local files with names that can safely be converted to UTF8 the pathname is used, otherwise the IRI is used (a form of URI that allows UTF8 characters unescaped). This call does no blocking i/o. input #GFile. a string containing the #GFile's parse name. The returned string should be freed with g_free() when no longer needed. Gets the user data from a #GAsyncResult. a #GAsyncResult. the user data for @res. Return value: A random number. a #GRand. A random number. Creates a new GIOModule that will load the specific shared library when in use. filename of the shared library module. a #GIOModule from given @filename, or %NULL on error. Get the contents of a %G_TYPE_OBJECT derived #GValue, increasing its reference count. a valid #GValue whose type is derived from %G_TYPE_OBJECT object content of @value, should be unreferenced when no longer needed. Emits a signal. Note that g_signal_emit_valist() resets the return value to the default if no handlers are connected, in contrast to g_signal_emitv(). the instance the signal is being emitted on. the signal id the detail a list of parameters to be passed to the signal, followed by a location for the return value. If the return type of the signal is #G_TYPE_NONE, the return value location can be omitted. This function looks for a desktop bookmark file named @file in the paths returned from g_get_user_data_dir() and g_get_system_data_dirs(), loads the file into @bookmark and returns the file's full path in @full_path. If the file could not be loaded then an %error is set to either a #GFileError or #GBookmarkFileError. a #GBookmarkFile a relative path to a filename to open and parse return location for a string containing the full path of the file, or %NULL return location for a #GError, or %NULL %TRUE if a key file could be loaded, %FALSE othewise Since: 2.12 Return value: the main group of @context, or %NULL if @context doesn't a #GOptionContext the main group of @context, or %NULL if @context doesn't have a main group. Note that group belongs to @context and should not be modified or freed. Since: 2.6 Converts all upper case ASCII letters to lower case ASCII letters. a string. length of @str in bytes, or -1 if @str is nul-terminated. a newly-allocated string, with all the upper case characters in @str converted to lower case, with semantics that exactly match g_ascii_tolower(). (Note that this is unlike the old g_strdown(), which modified the string in place.) Duplicates a file info structure. a #GFileInfo. a duplicate #GFileInfo of @other. Retrieves the list of group names of the bookmark for @uri. In the event the URI cannot be found, %NULL is returned and @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. The returned array is %NULL terminated, so @length may optionally be %NULL. a #GBookmarkFile a valid URI return location for the length of the returned string, or %NULL return location for a #GError, or %NULL a newly allocated %NULL-terminated array of group names. Use g_strfreev() to free it. Since: 2.12 Return value: The start group of the key file. a #GKeyFile The start group of the key file. Since: 2.6 Guesses the icon of a Unix mount point. a #GUnixMountPoint a #GIcon This function will return the maximum @interval that a thread will wait in the thread pool for new tasks before being stopped. If this function returns 0, threads waiting in the thread pool for new work are not stopped. the maximum @interval to wait for new tasks in the thread pool before stopping the thread (1/1000ths of a second). Since: 2.10 Removes @len bytes from a #GString, starting at position @pos. The rest of the #GString is shifted down to fill the gap. a #GString the position of the content to remove the number of bytes to remove, or -1 to remove all following bytes @string Attaches arbitrary data to a type. a #GType a #GQuark id to identify the data the data Finds an element in a #GSList, using a supplied function to find the desired element. It iterates over the list, calling the given function which should return 0 when the desired element is found. The function takes two #gconstpointer arguments, the #GSList element's data as the first argument and the given user data. a #GSList user data passed to the function the function to call for each element. It should return 0 when the desired element is found the found #GSList element, or %NULL if it is not found Return value: a string owned by GLib that must not be modified a string owned by GLib that must not be modified or freed. Since: 2.6 Frees a unix mount point. unix mount point to free. Compare @s1 and @s2, ignoring the case of ASCII characters and any characters after the first @n in each string. Unlike the BSD strcasecmp() function, this only recognizes standard ASCII letters and ignores the locale, treating all non-ASCII characters as if they are not letters. The same warning as in g_ascii_strcasecmp() applies: Use this function only on strings known to be in encodings where bytes corresponding to ASCII letters always represent themselves. string to compare with @s2. string to compare with @s1. number of characters to compare. 0 if the strings match, a negative value if @s1 < @s2, or a positive value if @s1 > @s2. Atomically increments the reference count of @hash_table by one. This function is MT-safe and may be called from any thread. a valid #GHashTable. the passed in #GHashTable. Since: 2.10 Runs a main loop until g_main_loop_quit() is called on the loop. If this is called for the thread of the loop's #GMainContext, it will process events from the loop, otherwise it will simply wait. a #GMainLoop Adds a new element at the head of the queue. a #GQueue. a single #GList element, <emphasis>not</emphasis> a list with more than one element. Converts a string to lower case. the string to convert. the string Deprecated:2.2: This function is totally broken for the reasons discussed in the g_strncasecmp() docs - use g_ascii_strdown() or g_utf8_strdown() instead. Finds an element in a #GQueue, using a supplied function to find the desired element. It iterates over the queue, calling the given function which should return 0 when the desired element is found. The function takes two gconstpointer arguments, the #GQueue element's data as the first argument and the given user data as the second argument. a #GQueue user data passed to @func a #GCompareFunc to call for each element. It should return 0 when the desired element is found The found link, or %NULL if it wasn't found Since: 2.4 Associates a function with @group which will be called from g_option_context_parse() when an error occurs. Note that the user data to be passed to @pre_parse_func and @post_parse_func can be specified when constructing the group with g_option_group_new(). Since: 2.6 a #GOptionGroup a function to call when an error occurs Return a newly allocated and 0-terminated array of type IDs, listing the child types of @type. The return value has to be g_free()ed after use. The parent type. Optional #guint pointer to contain the number of child types. Newly allocated and 0-terminated array of child types. Gets a #GUnixMountEntry 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 g_unix_mounts_changed_since(). path for a possible unix mount. guint64 to contain a timestamp. a #GUnixMount. Initializes a key/value pair iterator and associates it with @hash_table. Modifying the hash table after calling this function invalidates the returned iterator. |[ GHashTableIter iter; gpointer key, value; g_hash_table_iter_init (&iter, hash_table); while (g_hash_table_iter_next (&iter, &key, &value)) { /* do something with key and value */ } ]| Since: 2.16 an uninitialized #GHashTableIter. a #GHashTable. Computes a list of applicable locale names, which can be used to e.g. construct locale-dependent filenames or search paths. The returned list is sorted from most desirable to least desirable and always contains the default locale "C". For example, if LANGUAGE=de:en_US, then the returned list is "de", "en_US", "en", "C". This function consults the environment variables <envar>LANGUAGE</envar>, <envar>LC_ALL</envar>, <envar>LC_MESSAGES</envar> and <envar>LANG</envar> to find the list of locales specified by the user. a %NULL-terminated array of strings owned by GLib that must not be modified or freed. Since: 2.6 Looks up a #GFlagsValue by nickname. a #GFlagsClass the nickname to look up the #GFlagsValue with nickname @nick, or %NULL if there is no flag with that nickname Gets the kinds of identifiers that @drive has. Use g_drive_get_identifer() to obtain the identifiers themselves. a #GDrive a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free. Gets a list of the volumes on the system. The returned list should be freed with g_list_free(), after its elements have been unreffed with g_object_unref(). a #GVolumeMonitor. a #GList of #GVolume<!-- -->s. Frees an instance of a type, returning it to the instance pool for the type, if there is one. Like g_type_create_instance(), this function is reserved for implementors of fundamental types. an instance of a type. Looks up a key in a #GHashTable. Note that this function cannot distinguish between a key that is not present and one which is present and has the value %NULL. If you need this distinction, use g_hash_table_lookup_extended(). a #GHashTable. the key to look up. the associated value, or %NULL if the key is not found. Checks if an input stream is closed. input stream. %TRUE if the stream is closed. Encode a sequence of binary data into its Base-64 stringified representation. the binary data to encode the length of @data a newly allocated, zero-terminated Base-64 encoded string representing @data. The returned string must be freed with g_free(). Since: 2.12 Replaces the contents of @file with @contents of @length bytes. If @etag is specified (not %NULL) any existing file must have that etag, or the error %G_IO_ERROR_WRONG_ETAG will be returned. If @make_backup is %TRUE, this function will attempt to make a backup of @file. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. The returned @new_etag can be used to verify that the file hasn't changed the next time it is saved over. input #GFile. a string containing the new contents for @file. the length of @contents in bytes. the old <link linkend="gfile-etag">entity tag</link> for the document. %TRUE if a backup should be created. a set of #GFileCreateFlags. 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. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present. Gets a list of URI schemes supported by @vfs. a #GVfs. a list of strings. Guesses the icon of a Unix mount. a #GUnixMountEntry a #GIcon Queries a file input stream the given @attributes. This function blocks while querying the stream. For the asynchronous (non-blocking) version of this function, see g_file_input_stream_query_info_async(). While the stream is blocked, the stream will set the pending flag internally, and any other operations on the stream will fail with %G_IO_ERROR_PENDING. a #GFileInputStream. a file attribute query string. optional #GCancellable object, %NULL to ignore. a #GError location to store the error occuring, or %NULL to ignore. a #GFileInfo, or %NULL on error. A variant of g_closure_new_simple() which stores @object in the @data field of the closure and calls g_object_watch_closure() on @object and the created closure. This function is mainly useful when implementing new types of closures. the size of the structure to allocate, must be at least <literal>sizeof (GClosure)</literal> a #GObject pointer to store in the @data field of the newly allocated #GClosure a newly allocated #GClosure Adds a copy of @string to the #GStringChunk. It returns a pointer to the new copy of the string in the #GStringChunk. The characters in the string can be changed, if necessary, though you should not change anything after the end of the string. Unlike g_string_chunk_insert_const(), this function does not check for duplicates. Also strings added with g_string_chunk_insert() will not be searched by g_string_chunk_insert_const() when looking for duplicates. a #GStringChunk the string to add a pointer to the copy of @string within the #GStringChunk Removes @root and its children from the tree, freeing any memory allocated. the root of the tree/subtree to destroy Finishes a mount operation started by g_file_mount_enclosing_volume(). input #GFile. a #GAsyncResult. a #GError, or %NULL %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present. Locates the first executable named @program in the user's path, in the same way that execvp() would locate it. Returns an allocated string with the absolute path name, or %NULL if the program is not found in the path. If @program is already an absolute path, returns a copy of @program if @program exists and is executable, and %NULL otherwise. On Windows, if @program does not have a file type suffix, tries with the suffixes .exe, .cmd, .bat and .com, and the suffixes in the <envar>PATHEXT</envar> environment variable. On Windows, it looks for the file in the same way as CreateProcess() would. This means first in the directory where the executing program was loaded from, then in the current directory, then in the Windows 32-bit system directory, then in the Windows directory, and finally in the directories in the <envar>PATH</envar> environment variable. If the program is found, the return value contains the full name including the type suffix. a program name in the GLib file name encoding absolute path, or %NULL Creates a new data output stream for @base_stream. a #GOutputStream. #GDataOutputStream. Formats arguments according to @format, escaping all string and character arguments in the fashion of g_markup_escape_text(). This is useful when you want to insert literal strings into XML-style markup output, without having to worry that the strings might themselves contain markup. |[ const char *store = "Fortnum & Mason"; const char *item = "Tea"; char *output;   output = g_markup_printf_escaped ("<purchase>" "<store>%s</store>" "<item>%s</item>" "</purchase>", store, item); ]| printf() style format string the arguments to insert in the format string newly allocated result from formatting operation. Free with g_free(). Since: 2.4 Creates a new #GParamSpecULong instance specifying a %G_TYPE_ULONG property. See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified minimum value for the property specified maximum value for the property specified default value for the property specified flags for the property specified a newly created parameter specification Gets the #GFile associated with the given @icon. a #GIcon. a #GFile, or %NULL. Writes a formatted string into a #GString. This function is similar to g_string_printf() except that the arguments to the format string are passed as a va_list. Since: 2.14 a #GString the string format. See the printf() documentation the parameters to insert into the format string Gets the names of all variables set in the environment. a %NULL-terminated list of strings which must be freed with g_strfreev(). Programs that want to be portable to Windows should typically use this function and g_getenv() instead of using the environ array from the C library directly. On Windows, the strings in the environ array are in system codepage encoding, while in most of the typical use cases for environment variables in GLib-using programs you want the UTF-8 encoding that this function and g_getenv() provide. Since: 2.8 Changes the data for the item pointed to by @iter to be @data. If the sequence has a data destroy function associated with it, that function is called on the existing data that @iter pointed to. Since: 2.14 a #GSequenceIter new data for the item Sets an attribute in the file with attribute name @attribute to @value. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. a string containing the attribute's name. The type of the attribute a pointer to the value (or the pointer itself if the type is a pointer type) a set of #GFileQueryInfoFlags. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL %TRUE if the attribute was set, %FALSE otherwise. Return a random #guint32 equally distributed over the range [0..2^32-1]. A random number. Finishes a stream skip operation. a #GInputStream. a #GAsyncResult. a #GError location to store the error occuring, or %NULL to ignore. the size of the bytes skipped, or %-1 on error. Return value: the length of @seq a #GSequence the length of @seq Since: 2.14 Sets the value of a date from a #GTime value. @Deprecated:2.10: Use g_date_set_time_t() instead. a #GDate. #GTime value to set. Get the time since the last start of the timer with g_test_timer_start(). the time since the last start of the timer, as a double Since: 2.16 Sorts a #GSList using the given comparison function. a #GSList the comparison function used to sort the #GSList. This function is passed the data from 2 elements of the #GSList and should return 0 if they are equal, a negative value if the first element comes before the second, or a positive value if the first element comes after the second. the start of the sorted #GSList Formats the data in @args according to @format, escaping all string and character arguments in the fashion of g_markup_escape_text(). See g_markup_printf_escaped(). printf() style format string variable argument list, similar to vprintf() newly allocated result from formatting operation. Free with g_free(). Since: 2.4 Finishes an asynchronous info query operation. a #GFileInputStream. a #GAsyncResult. a #GError location to store the error occuring, or %NULL to ignore. #GFileInfo. Creates a new #GParamSpecGType instance specifying a %G_TYPE_GTYPE property. See g_param_spec_internal() for details on property names. Since: 2.10 canonical name of the property specified nick name for the property specified description of the property specified a #GType whose subtypes are allowed as values of the property (use %G_TYPE_NONE for any type) flags for the property specified a newly created parameter specification Copies a #GSList. <note><para> Note that this is a "shallow" copy. If the list elements consist of pointers to data, the pointers are copied but the actual data isn't. </para></note> a #GSList a copy of @list Frees all the memory associated with the #GMatchInfo structure. Since: 2.14 a #GMatchInfo Universal Resource Identifier for the dummy file object. a new #GFile. Unblocks all handlers on an instance that match a certain selection criteria. The criteria mask is passed as an OR-ed combination of #GSignalMatchType flags, and the criteria values are passed as arguments. Passing at least one of the %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC or %G_SIGNAL_MATCH_DATA match flags is required for successful matches. If no handlers were found, 0 is returned, the number of unblocked handlers otherwise. The match criteria should not apply to any handlers that are not currently blocked. The instance to unblock handlers from. Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handlers have to match. Signal the handlers have to be connected to. Signal detail the handlers have to be connected to. The closure the handlers will invoke. The C closure callback of the handlers (useless for non-C closures). The closure data of the handlers' closures. The number of handlers that matched. Won't hold a ref, we have a timout callback to clean unused fdata. If there is no value for a key, add it and return it; else return the old one. Returns: the data of the first element in the queue, or %NULL if the queue a #GQueue. the data of the first element in the queue, or %NULL if the queue is empty. Schedules the I/O job to run. @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(). a #GIOSchedulerJobFunc. data to pass to @job_func a #GDestroyNotify for @user_data, or %NULL the <link linkend="gioscheduler">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. Return value: a %NULL-terminated array of strings owned by GLib that must a %NULL-terminated array of strings owned by GLib that must not be modified or freed. Since: 2.6 Get an array of #GParamSpec* for all properties of a class. a #GObjectClass return location for the length of the returned array an array of #GParamSpec* which should be freed after use A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs ignored 2 a #GValue array holding the instance and the #GBoxed* parameter the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Looks up a #GParamSpec in the pool. a #GParamSpecPool the name to look for the owner to look for If %TRUE, also try to find a #GParamSpec with @param_name owned by an ancestor of @owner_type. The found #GParamSpec, or %NULL if no matching #GParamSpec was found. 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. a command line string. a new #GFile. Determines the canonical combining class of a Unicode character. a Unicode character the combining class of the character Since: 2.14 Queries the signal system for in-depth information about a specific signal. This function will fill in a user-provided structure to hold signal-specific information. If an invalid signal id is passed in, the @signal_id member of the #GSignalQuery is 0. All members filled into the #GSignalQuery structure should be considered constant and have to be left untouched. The signal id of the signal to query information for. A user provided structure that is filled in with constant values upon success. This signal is emitted when the #GVolume have been removed. If the recipient is holding references to the object they should release them so the object can be finalized. Obtain the list of settable attributes for the file. Returns: a #GFileAttributeInfoList describing the settable attributes. input #GFile. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL a #GFileAttributeInfoList describing the settable attributes. When you are done with it, release it with g_file_attribute_info_list_unref() Inserts a new element into @queue at the given position Since: 2.4 a #GQueue the data for the new element the position to insert the new element. If @n is negative or larger than the number of elements in the @queue, the element is added to the end of the queue. Inserts @data into @queue after @sibling @sibling must be part of @queue Since: 2.4 a #GQueue a #GList link that <emphasis>must</emphasis> be part of @queue the data to insert Finds the element in a #GList which contains the given data. a #GList the element data to find the found #GList element, or %NULL if it is not found Incrementally encode a sequence of binary data into it's Base-64 stringified representation. By calling this function multiple times you can convert data in chunks to avoid having to have the full encoded data in memory. When all of the data has been converted you must call g_base64_encode_close() to flush the saved state. The output buffer must be large enough to fit all the data that will be written to it. Due to the way base64 encodes you will need at least: @len * 4 / 3 + 6 bytes. If you enable line-breaking you will need at least: @len * 4 / 3 + @len * 4 / (3 * 72) + 7 bytes. @break_lines is typically used when putting base64-encoded data in emails. It breaks the lines at 72 columns instead of putting all of the text on the same line. This avoids problems with long lines in the email system. the binary data to encode the length of @in whether to break long lines pointer to destination buffer Saved state between steps, initialize to 0 Saved state between steps, initialize to 0 The number of bytes of output that was written Since: 2.12 Like g_slist_sort(), but the sort function accepts a user data argument. a #GSList comparison function data to pass to comparison function new head of the list Converts a string to a #gdouble value. It calls the standard strtod() function to handle the conversion, but if the string is not completely converted it attempts the conversion again with g_ascii_strtod(), and returns the best match. This function should seldomly be used. The normal situation when reading numbers not for human consumption is to use g_ascii_strtod(). Only when you know that you must expect both locale formatted and C formatted numbers should you use this. Make sure that you don't pass strings such as comma separated lists of values, since the commas may be interpreted as a decimal point in some locales, causing unexpected results. the string to convert to a numeric value. if non-%NULL, it returns the character after the last character used in the conversion. the #gdouble value. Get the corresponding quark of the type IDs name. Type to return quark of type name for. The type names quark or 0. Peeks in the buffer, copying data of size @count into @buffer, offset @offset bytes. a #GBufferedInputStream. a pointer to an allocated chunk of memory. a #gsize. a #gsize. a #gsize of the number of bytes peeked, or %-1 on error. Creates a new #GParamSpecBoxed instance specifying a %G_TYPE_BOXED derived property. See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified %G_TYPE_BOXED derived type of this property flags for the property specified a newly created parameter specification Return value: a newly allocated string or %NULL if the specified a #GKeyFile a group name a key a locale or %NULL return location for a #GError, or %NULL a newly allocated string or %NULL if the specified key cannot be found. Since: 2.6 Creates a new #GParamSpecPoiner instance specifying a pointer property. See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified flags for the property specified a newly created parameter specification Converts a pointer to a #gint to a hash value. It can be passed to g_hash_table_new() as the @hash_func parameter, when using pointers to integers values as keys in a #GHashTable. a pointer to a #gint key a hash value corresponding to the key. Checks if the matcher will match all of the keys in a given namespace. This will always return %TRUE if a wildcard character is in use (e.g. if matcher was created with "standard::*" and @ns is "standard", or if matcher was created using "*" and namespace is anything.) TODO: this is awkwardly worded. a #GFileAttributeMatcher. a string containing a file attribute namespace. %TRUE if the matcher matches all of the entries in the given @ns, %FALSE otherwise. Gets the operation result boolean from within the asynchronous result. a #GSimpleAsyncResult. %TRUE if the operation's result was %TRUE, %FALSE if the operation's result was %FALSE. < private > Unsafe, need lock fen_lock. Removes the bookmark for @uri from the bookmark file @bookmark. a #GBookmarkFile a valid URI return location for a #GError, or %NULL %TRUE if the bookmark was removed successfully. Since: 2.12 Attempts to complete the string @prefix using the #GCompletion target items. In contrast to g_completion_complete(), this function returns the largest common prefix that is a valid UTF-8 string, omitting a possible common partial character. You should use this function instead of g_completion_complete() if your items are UTF-8 strings. the #GCompletion the prefix string, typically used by the user, which is compared with each of the items if non-%NULL, returns the longest prefix which is common to all items that matched @prefix, or %NULL if no items matched @prefix. This string should be freed when no longer needed. the list of items whose strings begin with @prefix. This should not be changed. Since: 2.4 Finds a #GNode in a tree. the root #GNode of the tree to search the order in which nodes are visited - %G_IN_ORDER, %G_PRE_ORDER, %G_POST_ORDER, or %G_LEVEL_ORDER which types of children are to be searched, one of %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES the data to find the found #GNode, or %NULL if the data is not found Reload the mime information for the @dir. directory path which needs reloading. Inserts @link into @queue at the given position. Since: 2.4 a #GQueue the position to insert the link. If this is negative or larger than the number of elements in @queue, the link is added to the end of @queue. the link to add to @queue Looks whether the string @str begins with @prefix. a nul-terminated string. the nul-terminated prefix to look for. %TRUE if @str begins with @prefix, %FALSE otherwise. Since: 2.2 Adds a new element at the head of the queue. a #GQueue. the data for the new element. Gets the name of the program. This name should <emphasis>not</emphasis> be localized, contrast with g_get_application_name(). (If you are using GDK or GTK+ the program name is set in gdk_init(), which is called by gtk_init(). The program name is found by taking the last component of <literal>argv[0]</literal>.) the name of the program. The returned string belongs to GLib and must not be modified or freed. Return value: whether @iter is the begin iterator a #GSequenceIter whether @iter is the begin iterator Since: 2.14 This signal is emitted when the #GMount have been unmounted. If the recipient is holding references to the object they should release them so the object can be finalized. Get the user name from the mount operation. a #GMountOperation. a string containing the user name. Sets the file enumerator as having pending operations. a #GFileEnumerator. a boolean value. Converts errno.h error codes into GIO error codes. Error number as defined in errno.h. #GIOErrorEnum value for the given errno.h error number. Creates a new string @length bytes long filled with @fill_char. The returned string should be freed when no longer needed. the length of the new string the byte to fill the string with a newly-allocated string filled the @fill_char Creates a filename from a series of elements using the correct separator for filenames. On Unix, this function behaves identically to <literal>g_build_path (G_DIR_SEPARATOR_S, first_element, ....)</literal>. On Windows, it takes into account that either the backslash (<literal>\</literal> or slash (<literal>/</literal>) can be used as separator in filenames, but otherwise behaves as on Unix. When file pathname separators need to be inserted, the one that last previously occurred in the parameters (reading from left to right) is used. No attempt is made to force the resulting filename to be an absolute path. If the first element is a relative path, the result will be a relative path. the first element in the path remaining elements in path, terminated by %NULL a newly-allocated string that must be freed with g_free(). Returns: the first #GFlagsValue which is set in @value, or %NULL if a #GFlagsClass the value the first #GFlagsValue which is set in @value, or %NULL if none is set Gets the first element in a #GList. a #GList the first element in the #GList, or %NULL if the #GList has no elements Get the #GFile container which is being enumerated. a #GFileEnumerator the #GFile which is being enumerated. Since: 2.18. This function should be called by any #GVolumeMonitor implementation when a new #GMount object is created that is not associated with a #GVolume object. It must be called just before emitting the @mount_added signal. If the return value is not %NULL, the caller must associate the returned #GVolume object with the #GMount. This involves returning it in it's g_mount_get_volume() implementation. The caller must also listen for the "removed" signal on the returned object and give up it's reference when handling that signal Similary, if implementing g_volume_monitor_adopt_orphan_mount(), the implementor must take a reference to @mount and return it in it's g_volume_get_mount() implemented. Also, the implementor must listen for the "unmounted" signal on @mount and give up it's reference upon handling that signal. There are two main use cases for this function. One is when implementing a user space file system driver that reads blocks of a block device that is already represented by the native volume monitor (for example a CD Audio file system driver). Such a driver will generate it's own #GMount object that needs to be assoicated with the #GVolume object that represents the volume. The other is for implementing a #GVolumeMonitor whose sole purpose is to return #GVolume objects representing entries in the users "favorite servers" list or similar. a #GMount object to find a parent for the #GVolume object that is the parent for @mount or %NULL if no wants to adopt the #GMount. Writes data to a #GIOChannel. a #GIOChannel the buffer containing the data to write the number of bytes to write the number of bytes actually written %G_IO_ERROR_NONE if the operation was successful. Deprecated:2.2: Use g_io_channel_write_chars() instead. This function looks for a key file named @file in the paths returned from g_get_user_data_dir() and g_get_system_data_dirs(), loads the file into @key_file and returns the file's full path in @full_path. If the file could not be loaded then an %error is set to either a #GFileError or #GKeyFileError. an empty #GKeyFile struct a relative path to a filename to open and parse return location for a string containing the full path of the file, or %NULL flags from #GKeyFileFlags return location for a #GError, or %NULL %TRUE if a key file could be loaded, %FALSE othewise Since: 2.6 This function adds a message to test reports that associates a bug URI with a test case. Bug URIs are constructed from a base URI set with g_test_bug_base() and @bug_uri_snippet. Since: 2.16 Bug specific bug tracker URI portion. Creates a hash code for @str; for use with #GHashTable. a string to hash hash code for @str An implementation of the standard vsprintf() function which supports positional parameters, as specified in the Single Unix Specification. the buffer to hold the output. a standard printf() format string, but notice <link linkend="string-precision">string precision pitfalls</link>. the list of arguments to insert in the output. the number of bytes printed. Since: 2.2 Tries to pop data from the @queue. If no data is available, %NULL is returned. a #GAsyncQueue. data from the queue or %NULL, when no data is available immediately. Sets the contents of a %G_TYPE_PARAM #GValue to @param and takes over the ownership of the callers reference to @param; the caller doesn't have to unref it any more. Since: 2.4 a valid #GValue of type %G_TYPE_PARAM the #GParamSpec to be set Reads a line from a #GIOChannel, using a #GString as a buffer. a #GIOChannel a #GString into which the line will be written. If @buffer already contains data, the old data will be overwritten. location to store position of line terminator, or %NULL a location to store an error of type #GConvertError or #GIOChannelError the status of the operation. Does nothing if @err is %NULL; if @err is non-%NULL, then *@err must be %NULL. A new #GError is created and assigned to *@err. a return location for a #GError, or %NULL error domain error code printf()-style format args for @format Return value: the first link in @queue, or %NULL if @queue is empty a #GQueue the first link in @queue, or %NULL if @queue is empty Since: 2.4 filename of the directory to monitor. #GFileMonitorFlags. new #GFileMonitor for the given @dirname. Gets the identifier of the given kind for @drive. a #GDrive the kind of identifier to return a newly allocated string containing the requested identfier, or %NULL if the #GDrive doesn't have this kind of identifier Inserts a node before @sibling containing @data. a #GSList node to insert @data before data to put in the newly-inserted node the new head of the list. Unmaps the buffer of @file and frees it. Since: 2.8 a #GMappedFile Cancels a file monitor. a #GFileMonitor. %TRUE if monitor was cancelled. A mixed enumerated type and flags field. You must specify one type (string, strdup, boolean, tristate). Additionally, you may optionally bitwise OR the type with the flag %G_MARKUP_COLLECT_OPTIONAL. It is likely that this enum will be extended in the future to support other types. used to terminate the list of attributes to collect. collect the string pointer directly from the attribute_values[] array. Expects a parameter of type (const char **). If %G_MARKUP_COLLECT_OPTIONAL is specified and the attribute isn't present then the pointer will be set to %NULL. as with %G_MARKUP_COLLECT_STRING, but expects a paramter of type (char **) and g_strdup()s the returned pointer. The pointer must be freed with g_free(). expects a parameter of type (gboolean *) and parses the attribute value as a boolean. Sets %FALSE if the attribute isn't present. Valid boolean values consist of (case insensitive) "false", "f", "no", "n", "0" and "true", "t", "yes", "y", "1". as with %G_MARKUP_COLLECT_BOOLEAN, but in the case of a missing attribute a value is set that compares equal to neither %FALSE nor %TRUE. G_MARKUP_COLLECT_OPTIONAL is implied. can be bitwise ORed with the other fields. If present, allows the attribute not to appear. A default value is set depending on what value type is used. Gets the mount for the @volume. a #GVolume. a #GMount or %NULL if @volume isn't mounted. Return value: a newly allocated string or %NULL if the specified a #GBookmarkFile a valid URI or %NULL return location for a #GError, or %NULL a newly allocated string or %NULL if the specified URI cannot be found. Since: 2.12 Frees a #GOptionGroup. Note that you must <emphasis>not</emphasis> free groups which have been added to a #GOptionContext. Since: 2.6 a #GOptionGroup Set the contents of a %G_TYPE_PARAM #GValue to @param. a valid #GValue of type %G_TYPE_PARAM the #GParamSpec to be set Stops all currently unused threads. This does not change the maximal number of unused threads. This function can be used to regularly stop all unused threads e.g. from g_timeout_add(). Gets the priority of a source. a #GSource the priority of the source Creates a new signal. (This is usually done in the class initializer.) See g_signal_new() for details on allowed signal names. the name for the signal the type this signal pertains to. It will also pertain to types which are derived from this type. a combination of #GSignalFlags specifying detail of when the default handler is to be invoked. You should at least specify %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST. The closure to invoke on signal emission; may be %NULL. the accumulator for this signal; may be %NULL. user data for the @accumulator. the function to translate arrays of parameter values to signal emissions into C language callback invocations. the type of return value, or #G_TYPE_NONE for a signal without a return value. the number of parameter types in @args. va_list of #GType, one for each parameter. the signal id Replaces all occurances of the pattern in @regex with the replacement text. @replacement is replaced literally, to include backreferences use g_regex_replace(). Setting @start_position differs from just passing over a shortened string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern that begins with any kind of lookbehind assertion, such as "\b". a #GRegex structure the string to perform matches against the length of @string, or -1 if @string is nul-terminated starting index of the string to match text to replace each match with options for the match location to store the error occuring, or %NULL to ignore errors a newly allocated string containing the replacements Since: 2.14 Launches the application. Passes @files to the launched application as arguments, using the optional @launch_context to get information about the details of the launcher (like what screen it is on). On error, @error will be set accordingly. To lauch the application without arguments pass a %NULL @files list. Note that even if the launch is successful the application launched can fail to start if it runs into problems during startup. There is no way to detect this. Some URIs can be changed when passed through a GFile (for instance unsupported uris with strange formats like mailto:), so if you have a textual uri you want to pass in as argument, consider using g_app_info_launch_uris() instead. a #GAppInfo. a #GList of #GFile objects. a #GAppLaunchContext. a #GError. %TRUE on successful launch, %FALSE otherwise. Gets an #GList of all #GParamSpec<!-- -->s owned by @owner_type in the pool. a #GParamSpecPool the owner to look for a #GList of all #GParamSpec<!-- -->s owned by @owner_type in the pool#GParamSpec<!-- -->s. Removes the key/value pair currently pointed to by the iterator from its associated #GHashTable, without calling the key and value destroy functions. Can only be called after g_hash_table_iter_next() returned %TRUE, and cannot be called more than once for the same key/value pair. Since: 2.16 an initialized #GHashTableIter. Returns: the transation of @str to the current locale The string to be translated the transation of @str to the current locale Checks if the file enumerator has pending operations. a #GFileEnumerator. %TRUE if the @enumerator has pending operations. 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 string containing a URI. a #GFile for the given @uri. Sets the mount operation to use an anonymous user if @anonymous is %TRUE. a #GMountOperation. boolean value. Looks up a #GEnumValue by name. a #GEnumClass the name to look up the #GEnumValue with name @name, or %NULL if the enumeration doesn't have a member with that name Opens a temporary file. See the mkstemp() documentation on most UNIX-like systems. The parameter is a string that should follow the rules for mkstemp() templates, i.e. contain the string "XXXXXX". g_mkstemp() is slightly more flexible than mkstemp() in that the sequence does not have to occur at the very end of the template. The X string will be modified to form the name of a file that didn't exist. The string should be in the GLib file name encoding. Most importantly, on Windows it should be in UTF-8. template filename A file handle (as from open()) to the file opened for reading and writing. The file is opened in binary mode on platforms where there is a difference. The file handle should be closed with close(). In case of errors, -1 is returned. Convert a string from UTF-8 to a 32-bit fixed width representation as UCS-4, assuming valid UTF-8 input. This function is roughly twice as fast as g_utf8_to_ucs4() but does no error checking on the input. a UTF-8 encoded string the maximum length of @str to use. If @len < 0, then the string is nul-terminated. location to store the number of characters in the result, or %NULL. a pointer to a newly allocated UCS-4 string. This value must be freed with g_free(). Inserts a new key and value into a #GHashTable similar to g_hash_table_insert(). The difference is that if the key already exists in the #GHashTable, it gets replaced by the new key. If you supplied a @value_destroy_func when creating the #GHashTable, the old value is freed using that function. If you supplied a @key_destroy_func when creating the #GHashTable, the old key is freed using that function. a #GHashTable. a key to insert. the value to associate with the key. Registers an additional interface for a type, whose interface lives in the given type plugin. If the interface was already registered for the type in this plugin, nothing will be done. As long as any instances of the type exist, the type plugin will not be unloaded. a #GTypeModule type to which to add the interface. interface type to add type information structure Registers @type_name as the name of a new static type derived from @parent_type. The type system uses the information contained in the #GTypeInfo structure pointed to by @info to manage the type and its instances (if not abstract). The value of @flags determines the nature (e.g. abstract or not) of the type. Type from which this type will be derived. 0-terminated string used as the name of the new type. The #GTypeInfo structure for this type. Bitwise combination of #GTypeFlags values. The new type identifier. Creates a new #GError; unlike g_error_new(), @message is not a printf()-style format string. Use this function if @message contains text you don't have control over, that could include printf() escape sequences. error domain error code error message a new #GError Return value: The position of @link_, or -1 if the link is a #Gqueue A #GList link The position of @link_, or -1 if the link is not part of @queue Since: 2.4 Polls @drive to see if media has been inserted or removed. a #GDrive. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback, or %NULL. a #gpointer. Checks if a file is a backup file. a #GFileInfo. %TRUE if file is a backup file, %FALSE otherwise. Gets a #GList of strings containing 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 g_unix_mounts_changed_since(). guint64 to contain a timestamp. a #GList of the UNIX mounts. Get a reproducible random floating point number, see g_test_rand_int() for details on test case random numbers. a random number from the seeded random number generator. Since: 2.16 Queries the stream information asynchronously. When the operation is finished @callback will be called. You can then call g_file_input_stream_query_info_finish() to get the result of the operation. For the synchronous version of this function, see g_file_input_stream_query_info(). If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be set a #GFileInputStream. a file attribute query string. the <link linkend="io-priority">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. callback to call when the request is satisfied the data to pass to callback function Adds the options specified in @entries to @group. Since: 2.6 a #GOptionGroup a %NULL-terminated array of #GOptionEntry<!-- -->s Converts a string which is in the encoding used by GLib for filenames into a UTF-8 string. Note that on Windows GLib uses UTF-8 for filenames; on other platforms, this function indirectly depends on the <link linkend="setlocale">current locale</link>. a string in the encoding for filenames the length of the string, or -1 if the string is nul-terminated<footnoteref linkend="nul-unsafe"/>. location to store the number of bytes in the input string that were successfully converted, or %NULL. Even if the conversion was successful, this may be less than @len if there were partial characters at the end of the input. If the error #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value stored will the byte offset after the last valid input sequence. the number of bytes stored in the output buffer (not including the terminating nul). location to store the error occuring, or %NULL to ignore errors. Any of the errors in #GConvertError may occur. The converted string, or %NULL on an error. Searches the string @haystack for the last occurrence of the string @needle. a nul-terminated string. the nul-terminated string to search for. a pointer to the found occurrence, or %NULL if not found. Increments the reference count of @pspec. a valid #GParamSpec the #GParamSpec that was passed into this function Return a name for the machine. The returned name is not necessarily a fully-qualified domain name, or even present in DNS or some other name service at all. It need not even be unique on your local network or site, but usually it is. Callers should not rely on the return value having any specific properties like uniqueness for security purposes. Even if the name of the machine is changed while an application is running, the return value from this function does not change. The returned string is owned by GLib and should not be modified or freed. If no name can be determined, a default fixed string "localhost" is returned. the host name of the machine. Since: 2.8 Sets the value of a date from a <type>time_t</type> value. To set the value of a date to the current day, you could write: |[ g_date_set_time_t (date, time (NULL)); ]| Since: 2.10 a #GDate <type>time_t</type> value to set Gets the top cancellable from the stack. a #GCancellable from the top of the stack, or %NULL if the stack is empty. Gets a list of drives connected to the system. The returned list should be freed with g_list_free(), after its elements have been unreffed with g_object_unref(). a #GVolumeMonitor. a #GList of connected #GDrive<!-- -->s Duplicates the first @n bytes of a string, returning a newly-allocated buffer @n + 1 bytes long which will always be nul-terminated. If @str is less than @n bytes long the buffer is padded with nuls. If @str is %NULL it returns %NULL. The returned value should be freed when no longer needed. <note><para> To copy a number of characters from a UTF-8 encoded string, use g_utf8_strncpy() instead. </para></note> the string to duplicate the maximum number of bytes to copy from @str a newly-allocated buffer containing the first @n bytes of @str, nul-terminated Gets back user data pointers stored via g_param_spec_set_qdata() and removes the @data from @pspec without invoking it's destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier. the #GParamSpec to get a stored user data pointer from a #GQuark, naming the user data pointer the user data pointer set, or %NULL Internal function for gtester to free test log messages, no ABI guarantees provided. Return value: a newly allocated string or %NULL if the specified a #GKeyFile a group name a key return location for a #GError, or %NULL a newly allocated string or %NULL if the specified key cannot be found. Since: 2.6 Gets the base stream for the filter stream. a #GFilterOutputStream. a #GOutputStream. Removes an environment variable from the environment. Note that on some systems, when variables are overwritten, the memory used for the previous variables and its value isn't reclaimed. Furthermore, this function can't be guaranteed to operate in a threadsafe way. Since: 2.4 the environment variable to remove, must not contain '='. Using the standard algorithm for regular expression matching only the longest match in the string is retrieved, it is not possibile to obtain all the available matches. For instance matching "<a> <b> <c>" against the pattern "<.*>" you get "<a> <b> <c>". This function uses a different algorithm (called DFA, i.e. deterministic finite automaton), so it can retrieve all the possible matches, all starting at the same point in the string. For instance matching "<a> <b> <c>" against the pattern "<.*>" you would obtain three matches: "<a> <b> <c>", "<a> <b>" and "<a>". The number of matched strings is retrieved using g_match_info_get_match_count(). To obtain the matched strings and their position you can use, respectively, g_match_info_fetch() and g_match_info_fetch_pos(). Note that the strings are returned in reverse order of length; that is, the longest matching string is given first. Note that the DFA algorithm is slower than the standard one and it is not able to capture substrings, so backreferences do not work. Setting @start_position differs from just passing over a shortened string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern that begins with any kind of lookbehind assertion, such as "\b". A #GMatchInfo structure, used to get information on the match, is stored in @match_info if not %NULL. Note that if @match_info is not %NULL then it is created even if the function returns %FALSE, i.e. you must free it regardless if regular expression actually matched. a #GRegex structure from g_regex_new() the string to scan for matches the length of @string, or -1 if @string is nul-terminated starting index of the string to match match options pointer to location where to store the #GMatchInfo, or %NULL if you do not need it location to store the error occuring, or %NULL to ignore errors %TRUE is the string matched, %FALSE otherwise Since: 2.14 Gets the real name of the user. This usually comes from the user's entry in the <filename>passwd</filename> file. The encoding of the returned string is system-defined. (On Windows, it is, however, always UTF-8.) If the real user name cannot be determined, the string "Unknown" is returned. the user's real name. An implementation of the standard fprintf() function which supports positional parameters, as specified in the Single Unix Specification. the stream to write to. a standard printf() format string, but notice <link linkend="string-precision">string precision pitfalls</link>. the list of arguments to insert in the output. the number of bytes printed. Since: 2.2 Associates a new value with @key under @group_name. If @key cannot be found then it is created. If @group_name cannot be found then it is created. Since: 2.6 a #GKeyFile a group name a key a string Gets the depth of a #GNode. If @node is %NULL the depth is 0. The root node has a depth of 1. For the children of the root node the depth is 2. And so on. a #GNode the depth of the #GNode Unsets a mask set by g_file_info_set_attribute_mask(), if one is set. #GFileInfo. Get the contents of a %G_TYPE_LONG #GValue. a valid #GValue of type %G_TYPE_LONG long integer contents of @value Splices a stream asynchronously. When the operation is finished @callback will be called. You can then call g_output_stream_splice_finish() to get the result of the operation. For the synchronous, blocking version of this function, see g_output_stream_splice(). a #GOutputStream. a #GInputStream. a set of #GOutputStreamSpliceFlags. the io priority of the request. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback. user data passed to @callback. Inserts @data into @queue using @func to determine the new position. This function requires that the @queue is sorted before pushing on new elements. This function is called while holding the @queue's lock. For an example of @func see g_async_queue_sort(). Since: 2.10 a #GAsyncQueue the @data to push into the @queue the #GCompareDataFunc is used to sort @queue. This function is passed two elements of the @queue. The function should return 0 if they are equal, a negative value if the first element should be higher in the @queue or a positive value if the first element should be lower in the @queue than the second element. user data passed to @func. Get the contents of a %G_TYPE_BOOLEAN #GValue. a valid #GValue of type %G_TYPE_BOOLEAN boolean contents of @value Frees a #GKeyFile. Since: 2.6 a #GKeyFile Calls the given function for each node in the #GTree. Deprecated:2.2: The order of a balanced tree is somewhat arbitrary. If you just want to visit all nodes in sorted order, use g_tree_foreach() instead. If you really need to visit nodes in a different order, consider using an <link linkend="glib-N-ary-Trees">N-ary Tree</link>. a #GTree. the function to call for each node visited. If this function returns %TRUE, the traversal is stopped. the order in which nodes are visited, one of %G_IN_ORDER, %G_PRE_ORDER and %G_POST_ORDER. user data to pass to the function. Flushed any outstanding buffers in the stream. Will block during the operation. Closing the stream will implicitly cause a flush. This function is optional for inherited classes. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. a #GOutputStream. optional cancellable object location to store the error occuring, or %NULL to ignore %TRUE on success, %FALSE on error Checks if a file is a symlink. a #GFileInfo. %TRUE if the given @info is a symlink. Insert a copy of @value as first element of @value_array. #GValueArray to add an element to #GValue to copy into #GValueArray the #GValueArray passed in as @value_array Tries to read a single byte from the stream or the buffer. Will block during this read. On success, the byte read from the stream is returned. On end of stream -1 is returned but it's not an exceptional error and @error is not set. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an operation was partially finished when the operation was cancelled the partial result will be returned, without an error. On error -1 is returned and @error is set accordingly. #GBufferedInputStream. optional #GCancellable object, %NULL to ignore. location to store the error occuring, or %NULL to ignore. the byte read from the @stream, or -1 on end of stream or error. Gets the size of the input buffer. #GBufferedInputStream. the current buffer size. Determines the preferred character sets used for filenames. The first character set from the @charsets is the filename encoding, the subsequent character sets are used when trying to generate a displayable representation of a filename, see g_filename_display_name(). On Unix, the character sets are determined by consulting the environment variables <envar>G_FILENAME_ENCODING</envar> and <envar>G_BROKEN_FILENAMES</envar>. On Windows, the character set used in the GLib API is always UTF-8 and said environment variables have no effect. <envar>G_FILENAME_ENCODING</envar> may be set to a comma-separated list of character set names. The special token "@locale" is taken to mean the character set for the <link linkend="setlocale">current locale</link>. If <envar>G_FILENAME_ENCODING</envar> is not set, but <envar>G_BROKEN_FILENAMES</envar> is, the character set of the current locale is taken as the filename encoding. If neither environment variable is set, UTF-8 is taken as the filename encoding, but the character set of the current locale is also put in the list of encodings. The returned @charsets belong to GLib and must not be freed. Note that on Unix, regardless of the locale character set or <envar>G_FILENAME_ENCODING</envar> value, the actual file names present on a system might be in any random encoding or just gibberish. return location for the %NULL-terminated list of encoding names %TRUE if the filename encoding is UTF-8. Since: 2.6 Return value: the last link in @queue, or %NULL if @queue is empty a #GQueue the last link in @queue, or %NULL if @queue is empty Since: 2.4 a string. a #GCancellable, or %NULL a #GMount for given @mount_path or %NULL. Obtains a completion for @initial_text from @completer. the filename completer. text to be completed. a completed string, or %NULL if no completion exists. This string is not owned by GIO, so remember to g_free() it when finished. Gets back user data pointers stored via g_param_spec_set_qdata(). a valid #GParamSpec a #GQuark, naming the user data pointer the user data pointer set, or %NULL Finds an element in a #GList, using a supplied function to find the desired element. It iterates over the list, calling the given function which should return 0 when the desired element is found. The function takes two #gconstpointer arguments, the #GList element's data as the first argument and the given user data. a #GList user data passed to the function the function to call for each element. It should return 0 when the desired element is found the found #GList element, or %NULL if it is not found Gets the default application for launching applications using this URI scheme. A URI scheme is the initial part of the URI, up to but not including the ':', e.g. "http", "ftp" or "sip". a string containing a URI scheme. #GAppInfo for given @uri_scheme or %NULL on error. Finishes setting an attribute started in g_file_set_attributes_async(). input #GFile. a #GAsyncResult. a #GFileInfo. a #GError, or %NULL %TRUE if the attributes were set correctly, %FALSE otherwise. Get the contents of a %G_TYPE_DOUBLE #GValue. a valid #GValue of type %G_TYPE_DOUBLE double contents of @value Polls @file for changes. a #GFile. a new #GFileMonitor for the given #GFile. Registers an invalidation notifier which will be called when the @closure is invalidated with g_closure_invalidate(). Invalidation notifiers are invoked before finalization notifiers, in an unspecified order. a #GClosure data to pass to @notify_func the callback function to register Return value: the ID (greater than 0) for the source a #GSource the ID (greater than 0) for the source Guesses whether a Unix mount point can be ejected. a #GUnixMountPoint %TRUE if @mount_point is deemed to be ejectable. Finishes an async enumerate children operation. See g_file_enumerate_children_async(). input #GFile. a #GAsyncResult. a #GError. a #GFileEnumerator or %NULL if an error occurred. A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes an enumeration type.. the #GClosure to which the marshaller belongs ignored 2 a #GValue array holding the instance and the enumeration parameter the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Loads a bookmark file from memory into an empty #GBookmarkFile structure. If the object cannot be created then @error is set to a #GBookmarkFileError. an empty #GBookmarkFile struct desktop bookmarks loaded in memory the length of @data in bytes return location for a #GError, or %NULL %TRUE if a desktop bookmark could be loaded. Since: 2.12 Return value: the value of the environment variable, or %NULL if the environment variable to get, in the GLib file name encoding. the value of the environment variable, or %NULL if the environment variable is not found. The returned string may be overwritten by the next call to g_getenv(), g_setenv() or g_unsetenv(). Creates a hash value for a #GFile. This call does no blocking i/o. #gconstpointer to a #GFile. 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. Initializes the inotify backend. This must be called before any other functions in this module. #TRUE if initialization succeeded, #FALSE otherwise Inserts a #GParamSpec in the pool. a #GParamSpecPool. the #GParamSpec to insert a #GType identifying the owner of @pspec Registers @type_name as the name of a new static type derived from @parent_type. The value of @flags determines the nature (e.g. abstract or not) of the type. It works by filling a #GTypeInfo struct and calling g_type_register_static(). Since: 2.12 Type from which this type will be derived. 0-terminated string used as the name of the new type. Size of the class structure (see #GTypeInfo) Location of the class initialization function (see #GTypeInfo) Size of the instance structure (see #GTypeInfo) Location of the instance initialization function (see #GTypeInfo) Bitwise combination of #GTypeFlags values. The new type identifier. Sets the rate limit to which the @mount_monitor will report consecutive change events to the mount and mount point entry files. Since: 2.18 a #GUnixMountMonitor. a integer with the limit in milliseconds to poll for changes. Copies the file @source to the location specified by @destination. Can not handle recursive copies of directories. If the flag #G_FILE_COPY_OVERWRITE is specified an already existing @destination file is overwritten. If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks will be copied as symlinks, otherwise the target of the @source symlink will be copied. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If @progress_callback is not %NULL, then the operation can be monitored by setting this to a #GFileProgressCallback function. @progress_callback_data will be passed to this function. It is guaranteed that this callback will be called after all data has been transferred with the total number of bytes copied during the operation. If the @source file does not exist then the G_IO_ERROR_NOT_FOUND error is returned, independent on the status of the @destination. If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then the error G_IO_ERROR_EXISTS is returned. If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY error is returned. If trying to overwrite a directory with a directory the G_IO_ERROR_WOULD_MERGE error is returned. If the source is a directory and the target does not exist, or #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the G_IO_ERROR_WOULD_RECURSE error is returned. If you are interested in copying the #GFile object itself (not the on-disk file), see g_file_dup(). input #GFile. destination #GFile set of #GFileCopyFlags optional #GCancellable object, %NULL to ignore. function to callback with progress information user data to pass to @progress_callback #GError to set on error, or %NULL %TRUE on success, %FALSE otherwise. Checks whether a source is allowed to be called recursively. see g_source_set_can_recurse(). a #GSource whether recursion is allowed. Calls a function for each element of a #GPtrArray. Since: 2.4 a #GPtrArray the function to call for each array element user data to pass to the function Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. The @handler_id becomes invalid and may be reused. The @handler_id has to be a valid signal handler id, connected to a signal of @instance. The instance to remove the signal handler from. Handler id of the handler to be disconnected. Finishes the asynchronous operation started with g_file_enumerator_next_files_async(). a #GFileEnumerator. a #GAsyncResult. a #GError location to store the error occuring, or %NULL to ignore. 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. Unescapes a segment of an escaped string. If any of the characters in @illegal_characters or the character zero appears as an escaped character in @escaped_string then that is an error and %NULL will be returned. This is useful it you want to avoid for instance having a slash being expanded in an escaped path element, which might confuse pathname handling. a string. a string. an optional string of illegal characters not to be allowed. an unescaped version of @escaped_string or %NULL on error. The returned string should be freed when no longer needed. Since: 2.16 Reads an entire file into allocated memory, with good error checking. If the call was successful, it returns %TRUE and sets @contents to the file contents and @length to the length of the file contents in bytes. The string stored in @contents will be nul-terminated, so for text files you can pass %NULL for the @length argument. If the call was not successful, it returns %FALSE and sets @error. The error domain is #G_FILE_ERROR. Possible error codes are those in the #GFileError enumeration. In the error case, @contents is set to %NULL and @length is set to zero. name of a file to read contents from, in the GLib file name encoding location to store an allocated string location to store length in bytes of the contents, or %NULL return location for a #GError, or %NULL %TRUE on success, %FALSE if an error occurred Advances @iter and retrieves the key and/or value that are now pointed to as a result of this advancement. If %FALSE is returned, @key and @value are not set, and the iterator becomes invalid. an initialized #GHashTableIter. a location to store the key, or %NULL. a location to store the value, or %NULL. %FALSE if the end of the #GHashTable has been reached. Since: 2.16 Gets the number of elements in a #GList. <note><para> This function iterates over the whole list to count its elements. </para></note> a #GList the number of elements in the #GList Create a new test case, similar to g_test_create_case(). However the test is assumed to use no fixture, and test suites are automatically created on the fly and added to the root fixture, based on the slash-separated portions of @testpath. Since: 2.16 Slash-separated test case path name for the test. The test function to invoke for this test. Removes an element from a #GList, without freeing the element. The removed element's prev and next links are set to %NULL, so that it becomes a self-contained list with one element. a #GList an element in the #GList the new start of the #GList, without the element Removes a #GParamSpec from the pool. a #GParamSpecPool the #GParamSpec to remove Decrements the reference count of a @pspec. a valid #GParamSpec Sets an error within the asynchronous result without a #GError. a #GSimpleAsyncResult. a #GQuark (usually #G_IO_ERROR). an error code. a formatted error reporting string. a list of variables to fill in @format. Reads data from a #GIOChannel. a #GIOChannel a buffer to read the data into (which should be at least count bytes long) the number of bytes to read from the #GIOChannel returns the number of bytes actually read %G_IO_ERROR_NONE if the operation was successful. Deprecated:2.2: Use g_io_channel_read_chars() instead. Removes all cases of @attribute from @info if it exists. a #GFileInfo. a file attribute key. Set the contents of a %G_TYPE_FLAGS #GValue to @v_flags. a valid #GValue whose type is derived from %G_TYPE_FLAGS flags value to be set Gets the digest as an hexadecimal string. Once this function has been called the #GChecksum can no longer be updated with g_checksum_update(). a #GChecksum the hexadecimal representation of the checksum. The returned string is owned by the checksum and should not be modified or freed. Since: 2.16 Creates a new #GChecksum, using the checksum algorithm @checksum_type. If the @checksum_type is not known, %NULL is returned. A #GChecksum can be used to compute the checksum, or digest, of an arbitrary binary blob, using different hashing algorithms. A #GChecksum works by feeding a binary blob through g_checksum_update() until there is data to be checked; the digest can then be extracted using g_checksum_get_string(), which will return the checksum as a hexadecimal string; or g_checksum_get_digest(), which will return a vector of raw bytes. Once either g_checksum_get_string() or g_checksum_get_digest() have been called on a #GChecksum, the checksum will be closed and it won't be possible to call g_checksum_update() on it anymore. the desired type of checksum the newly created #GChecksum, or %NULL. Use g_checksum_free() to free the memory allocated by it. Since: 2.16 Releases all references to other objects. This can be used to break reference cycles. This functions should only be called from object system implementations. a #GObject Gets the value of a string attribute. If the attribute does not contain a string, %NULL will be returned. a #GFileInfo. a file attribute key. the contents of the @attribute value as a string, or %NULL otherwise. Determines the numeric value of a character as a hexidecimal digit. Differs from g_unichar_xdigit_value() because it takes a char, so there's no worry about sign extension if characters are signed. an ASCII character. If @c is a hex digit (according to g_ascii_isxdigit()), its numeric value. Otherwise, -1. Compares two content types for equality. a content type string. a content type string. %TRUE if the two strings are identical or equivalent, %FALSE otherwise. Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info to the given size. a #GFileInfo. a #goffset containing the file's size. Reads a string from the data input stream, up to the first occurrance of any of the stop characters. a given #GDataInputStream. characters to terminate the read. a #gsize to get the length of the data read in. optional #GCancellable object, %NULL to ignore. #GError for error reporting. 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. Returns: a new #GVfs handle. a new #GVfs handle. path name to monitor. #GFileMonitorFlags. a new #GFileMonitor for the given @pathname. Pops @cancellable off the cancellable stack (verifying that @cancellable is on the top of the stack). optional #GCancellable object, %NULL to ignore. Return value: The position of the first element in @queue which contains @data, or -1 if no element in @queue contains @data. a #GQueue the data to find. The position of the first element in @queue which contains @data, or -1 if no element in @queue contains @data. Since: 2.4 Releases ownership of a context previously acquired by this thread with g_main_context_acquire(). If the context was acquired multiple times, the ownership will be released only when g_main_context_release() is called as many times as it was acquired. a #GMainContext This function is a wrapper of dngettext() which does not translate the message if the default domain as set with textdomain() has no translations for the current locale. See g_dgettext() for details of how this differs from dngettext() proper. the translation domain to use, or %NULL to use the domain set with textdomain() message to translate plural form of the message the quantity for which translation is needed The translated string Since: 2.18 Sorts a #GList using the given comparison function. a #GList the comparison function used to sort the #GList. This function is passed the data from 2 elements of the #GList and should return 0 if they are equal, a negative value if the first element comes before the second, or a positive value if the first element comes after the second. the start of the sorted #GList Lists the file info structure's attributes. a #GFileInfo. a file attribute key's namespace. a null-terminated array of strings of all of the possible attribute types for the given @name_space, or %NULL on error. Inserts a new element into the list, using the given comparison function to determine its position. a pointer to a #GList the data for the new element the function to compare elements in the list. It should return a number > 0 if the first parameter comes after the second parameter in the sort order. the new start of the #GList Creates a new #GParamSpecUnichar instance specifying a %G_TYPE_UINT property. #GValue structures for this property can be accessed with g_value_set_uint() and g_value_get_uint(). See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified default value for the property specified flags for the property specified a newly created parameter specification Sets @mime_type as the MIME type of the bookmark for @uri. If a bookmark for @uri cannot be found then it is created. Since: 2.12 a #GBookmarkFile a valid URI a MIME type Scans for a match in string for the pattern in @regex. The @match_options are combined with the match options specified when the @regex structure was created, letting you have more flexibility in reusing #GRegex structures. A #GMatchInfo structure, used to get information on the match, is stored in @match_info if not %NULL. Note that if @match_info is not %NULL then it is created even if the function returns %FALSE, i.e. you must free it regardless if regular expression actually matched. To retrieve all the non-overlapping matches of the pattern in string you can use g_match_info_next(). |[ static void print_uppercase_words (const gchar *string) { /* Print all uppercase-only words. */ GRegex *regex; GMatchInfo *match_info;   regex = g_regex_new ("[A-Z]+", 0, 0, NULL); g_regex_match (regex, string, 0, &match_info); while (g_match_info_matches (match_info)) { gchar *word = g_match_info_fetch (match_info, 0); g_print ("Found: %s\n", word); g_free (word); g_match_info_next (match_info, NULL); } g_match_info_free (match_info); g_regex_unref (regex); } ]| a #GRegex structure from g_regex_new() the string to scan for matches match options pointer to location where to store the #GMatchInfo, or %NULL if you do not need it %TRUE is the string matched, %FALSE otherwise Since: 2.14 Removes a comment above @key from @group_name. If @key is %NULL then @comment will be removed above @group_name. If both @key and @group_name are %NULL, then @comment will be removed above the first group in the file. a #GKeyFile a group name, or %NULL a key return location for a #GError %TRUE if the comment was removed, %FALSE otherwise Since: 2.6 Sets the edit name for the current file. See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME. a #GFileInfo. a string containing an edit name. Creates a new file and returns an output stream for writing to it. The file must not already exist. By default files created are generally readable by everyone, but if you pass #G_FILE_CREATE_PRIVATE in @flags the file will be made readable only to the current user, to the level that is supported on the target filesystem. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If a file or directory with this name already exists the G_IO_ERROR_EXISTS error will be returned. Some file systems don't allow all file names, and may return an G_IO_ERROR_INVALID_FILENAME error, and if the name is to long G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on. input #GFile. a set of #GFileCreateFlags. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL a #GFileOutputStream for the newly created file, or %NULL on error. Tries to read @count bytes from the stream into the buffer. Will block during this read. If @count is zero, returns zero and does nothing. A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error. On success, the number of bytes read into the buffer is returned. It is not an error if this is not the same as the requested size, as it can happen e.g. near the end of a file. Zero is returned on end of file (or if @count is zero), but never otherwise. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an operation was partially finished when the operation was cancelled the partial result will be returned, without an error. On error -1 is returned and @error is set accordingly. For the asynchronous, non-blocking, version of this function, see g_buffered_input_stream_fill_async(). #GBufferedInputStream. the number of bytes that will be read from the stream. optional #GCancellable object, %NULL to ignore. location to store the error occuring, or %NULL to ignore. the number of bytes read into @stream's buffer, up to @count, or -1 on error. This function is a wrapper of dgettext() which does not translate the message if the default domain as set with textdomain() has no translations for the current locale. The advantage of using this function over dgettext() proper is that libraries using this function (like GTK+) will not use translations if the application using the library does not have translations for the current locale. This results in a consistent English-only interface instead of one having partial translations. For this feature to work, the call to textdomain() and setlocale() should precede any g_dgettext() invocations. For GTK+, it means calling textdomain() before gtk_init or its variants. This function disables translations if and only if upon its first call all the following conditions hold: <itemizedlist> <listitem>@domain is not %NULL</listitem> <listitem>textdomain() has been called to set a default text domain</listitem> <listitem>there is no translations available for the default text domain and the current locale</listitem> <listitem>current locale is not "C" or any English locales (those starting with "en_")</listitem> </itemizedlist> Note that this behavior may not be desired for example if an application has its untranslated messages in a language other than English. In those cases the application should call textdomain() after initializing GTK+. Applications should normally not use this function directly, but use the _() macro for translations. the translation domain to use, or %NULL to use the domain set with textdomain() message to translate The translated string Since: 2.18 Determines whether a character is printable and not a space (returns %FALSE for control characters, format characters, and spaces). g_unichar_isprint() is similar, but returns %TRUE for spaces. Given some UTF-8 text, obtain a character value with g_utf8_get_char(). a Unicode character %TRUE if @c is printable unless it's a space Unlinks a #GNode from a tree, resulting in two separate trees. the #GNode to unlink, which becomes the root of a new tree Determines whether a character is a mark (non-spacing mark, combining mark, or enclosing mark in Unicode speak). Given some UTF-8 text, obtain a character value with g_utf8_get_char(). Note: in most cases where isalpha characters are allowed, ismark characters should be allowed to as they are essential for writing most European languages as well as many non-Latin scripts. a Unicode character %TRUE if @c is a mark character Since: 2.14 Gets the last child of a #GNode. a #GNode (must not be %NULL) the last child of @node, or %NULL if @node has no children Gets the registration informations of @app_name for the bookmark for @uri. See g_bookmark_file_set_app_info() for more informations about the returned data. The string returned in @app_exec must be freed. In the event the URI cannot be found, %FALSE is returned and @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the event that no application with name @app_name has registered a bookmark for @uri, %FALSE is returned and error is set to #G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED. In the event that unquoting the command line fails, an error of the #G_SHELL_ERROR domain is set and %FALSE is returned. a #GBookmarkFile a valid URI an application's name location for the command line of the application, or %NULL return location for the registration count, or %NULL return location for the last registration time, or %NULL return location for a #GError, or %NULL %TRUE on success. Since: 2.12 Determines whether a character is punctuation or a symbol. Given some UTF-8 text, obtain a character value with g_utf8_get_char(). a Unicode character %TRUE if @c is a punctuation or symbol character Starts a @mount_operation, mounting the volume that contains the file @location. When this operation has completed, @callback will be called with @user_user data, and the operation can be finalized with g_file_mount_enclosing_volume_finish(). If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. flags affecting the operation a #GMountOperation or %NULL to avoid user interaction. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied, or %NULL. the data to pass to callback function Tests if the stream supports the #GSeekableIface. a #GSeekable. %TRUE if @seekable can be seeked. %FALSE otherwise. An implementation of the standard vprintf() function which supports positional parameters, as specified in the Single Unix Specification. a standard printf() format string, but notice <link linkend="string-precision">string precision pitfalls</link>. the list of arguments to insert in the output. the number of bytes printed. Since: 2.2 Checks whether @group appears in the list of groups to which the bookmark for @uri belongs to. In the event the URI cannot be found, %FALSE is returned and @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. a #GBookmarkFile a valid URI the group name to be searched return location for a #GError, or %NULL %TRUE if @group was found. Since: 2.12 Creates a new file attribute matcher, which matches attributes against a given string. #GFileAttributeMatcher<!-- -->s are reference counted structures, and are created with a reference count of 1. If the number of references falls to 0, the #GFileAttributeMatcher is automatically destroyed. The @attribute string should be formatted with specific keys separated from namespaces with a double colon. Several "namespace::key" strings may be concatenated with a single comma (e.g. "standard::type,standard::is-hidden"). The wildcard "*" may be used to match all keys and namespaces, or "namespace::*" will match all keys in a given namespace. Examples of strings to use: <table> <title>File Attribute Matcher strings and results</title> <tgroup cols='2' align='left'><thead> <row><entry> Matcher String </entry><entry> Matches </entry></row></thead> <tbody> <row><entry>"*"</entry><entry>matches all attributes.</entry></row> <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row> <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and all keys in the unix namespace.</entry></row> </tbody></tgroup> </table> an attribute string to match. a #GFileAttributeMatcher. A marshaller for a #GCClosure with a callback of type <literal>gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs a #GValue, which can store the returned string 3 a #GValue array holding instance, arg1 and arg2 the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller This is an internal function introduced mainly for C marshallers. Deprecated: 2.4: Use g_value_take_param() instead. a valid #GValue of type %G_TYPE_PARAM the #GParamSpec to be set < private > Unsafe, need lock fen_lock. Creates a new random number generator initialized with a seed taken either from <filename>/dev/urandom</filename> (if existing) or from the current time (as a fallback). the new #GRand. Calls the given function for key/value pairs in the #GHashTable until @predicate returns %TRUE. The function is passed the key and value of each pair, and the given @user_data parameter. The hash table may not be modified while iterating over it (you can't add/remove items). Note, that hash tables are really only optimized for forward lookups, i.e. g_hash_table_lookup(). So code that frequently issues g_hash_table_find() or g_hash_table_foreach() (e.g. in the order of once per every entry in a hash table) should probably be reworked to use additional or different data structures for reverse lookups (keep in mind that an O(n) find/foreach operation issued for all n values in a hash table ends up needing O(n*n) operations). a #GHashTable. function to test the key/value pairs for a certain property. user data to pass to the function. The value of the first key/value pair is returned, for which func evaluates to %TRUE. If no pair with the requested property is found, %NULL is returned. Since: 2.4 Creates a new instance of a #GObject subtype and sets its properties. Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY) which are not explicitly specified are set to their default values. the type id of the #GObject subtype to instantiate the name of the first property the value of the first property, followed optionally by more name/value pairs, followed by %NULL a new instance of @object_type Looks up a #GFlagsValue by name. a #GFlagsClass the name to look up the #GFlagsValue with name @name, or %NULL if there is no flag with that name A variant of g_cclosure_new() which uses @object as @user_data and calls g_object_watch_closure() on @object and the created closure. This function is useful when you have a callback closely associated with a #GObject, and want the callback to no longer run after the object is is freed. the function to invoke a #GObject pointer to pass to @callback_func a new #GCClosure Gets the attribute type for an attribute key. a #GFileInfo. a file attribute key. a #GFileAttributeType for the given @attribute, or %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is invalid. Finds the leftmost occurrence of the given Unicode character in a UTF-8 encoded string, while limiting the search to @len bytes. If @len is -1, allow unbounded search. a nul-terminated UTF-8 encoded string the maximum length of @p a Unicode character %NULL if the string does not contain the character, otherwise, a pointer to the start of the leftmost occurrence of the character in the string. Return value: a %NULL-terminated string array or %NULL if the specified a #GKeyFile a group name a key return location for the number of returned strings, or %NULL return location for a #GError, or %NULL a %NULL-terminated string array or %NULL if the specified key cannot be found. The array should be freed with g_strfreev(). Since: 2.6 Loads the content of the file into memory, returning the size of the data. The data is always zero terminated, but this is not included in the resultant @length. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. optional #GCancellable object, %NULL to ignore. a location to place the contents of the file. a location to place the length of the contents of the file. a location to place the current entity tag for the file. a #GError, or %NULL %TRUE if the @file's contents were successfully loaded. %FALSE if there were errors.. Retrieves the name of the next entry in the directory. The '.' and '..' entries are omitted. On Windows, the returned name is in UTF-8. On Unix, it is in the on-disk encoding. a #GDir* created by g_dir_open() The entry's name or %NULL if there are no more entries. The return value is owned by GLib and must not be modified or freed. Get a copy the contents of a %G_TYPE_STRING #GValue. a valid #GValue of type %G_TYPE_STRING a newly allocated copy of the string content of @value Parses a command line into an argument vector, in much the same way the shell would, but without many of the expansions the shell would perform (variable expansion, globs, operators, filename expansion, etc. are not supported). The results are defined to be the same as those you would get from a UNIX98 /bin/sh, as long as the input contains none of the unsupported shell expansions. If the input does contain such expansions, they are passed through literally. Possible errors are those from the #G_SHELL_ERROR domain. Free the returned vector with g_strfreev(). command line to parse return location for number of args return location for array of args return location for error %TRUE on success, %FALSE if error set Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed. a valid #GValue of %G_TYPE_BOXED derived type boxed value to be set Finds a #GVolume object by it's UUID (see g_volume_get_uuid()) a #GVolumeMonitor. the UUID to look for a #GVolume or %NULL if no such volume is available. Same as the standard UNIX routine iconv_close(), but may be implemented via libiconv on UNIX flavors that lack a native implementation. Should be called to clean up the conversion descriptor from g_iconv_open() when you are done converting things. GLib provides g_convert() and g_locale_to_utf8() which are likely more convenient than the raw iconv wrappers. a conversion descriptor from g_iconv_open() -1 on error, 0 on success Increases the reference count of the asynchronous @queue by 1. @Deprecated: Since 2.8, reference counting is done atomically so g_async_queue_ref() can be used regardless of the @queue's lock. a #GAsyncQueue. Like g_list_sort(), but the comparison function accepts a user data argument. a #GList comparison function user data to pass to comparison function the new head of @list Gets a gssize from the asynchronous result. a #GSimpleAsyncResult. a gssize returned from the asynchronous function. Gets the default #GVfs for the system. a #GVfs. Finishes a mount operation. See g_file_mount_mountable() for details. Finish an asynchronous mount operation that was started with g_file_mount_mountable(). input #GFile. a #GAsyncResult. a #GError, or %NULL a #GFile or %NULL on error. Finishes poll_for_mediaing a drive. a #GDrive. a #GAsyncResult. a #GError. %TRUE if the drive has been poll_for_mediaed successfully, %FALSE otherwise. This function outputs @key_file as a string. Note that this function never reports an error, so it is safe to pass %NULL as @error. a #GKeyFile return location for the length of the returned string, or %NULL return location for a #GError, or %NULL a newly allocated string holding the contents of the #GKeyFile Since: 2.6 Returns: %TRUE if the previous match operation succeeded, a #GMatchInfo structure %TRUE if the previous match operation succeeded, %FALSE otherwise Since: 2.14 Sets the function which is used to translate user-visible strings, for <option>--help</option> output. Different groups can use different #GTranslateFunc<!-- -->s. If @func is %NULL, strings are not translated. If you are using gettext(), you only need to set the translation domain, see g_option_group_set_translation_domain(). Since: 2.6 a #GOptionGroup the #GTranslateFunc, or %NULL user data to pass to @func, or %NULL a function which gets called to free @data, or %NULL Frees all resources allocated for @pool. If @immediate is %TRUE, no new task is processed for @pool. Otherwise @pool is not freed before the last task is processed. Note however, that no thread of this pool is interrupted, while processing a task. Instead at least all still running threads can finish their tasks before the @pool is freed. If @wait_ is %TRUE, the functions does not return before all tasks to be processed (dependent on @immediate, whether all or only the currently running) are ready. Otherwise the function returns immediately. After calling this function @pool must not be used anymore. a #GThreadPool should @pool shut down immediately? should the function wait for all tasks to be finished? Sets the function used to sort the list of tasks. This allows the tasks to be processed by a priority determined by @func, and not just in the order in which they were added to the pool. Note, if the maximum number of threads is more than 1, the order that threads are executed can not be guranteed 100%. Threads are scheduled by the operating system and are executed at random. It cannot be assumed that threads are executed in the order they are created. Since: 2.10 a #GThreadPool the #GCompareDataFunc used to sort the list of tasks. This function is passed two tasks. It should return 0 if the order in which they are handled does not matter, a negative value if the first task should be processed before the second or a positive value if the second task should be processed first. user data passed to @func. Checks if the application accepts files as arguments. a #GAppInfo. %TRUE if the @appinfo supports files. Inserts a key/value pair into a #GTree. If the given key already exists in the #GTree its corresponding value is set to the new value. If you supplied a value_destroy_func when creating the #GTree, the old value is freed using that function. If you supplied a @key_destroy_func when creating the #GTree, the passed key is freed using that function. The tree is automatically 'balanced' as new key/value pairs are added, so that the distance from the root to every leaf is as small as possible. a #GTree. the key to insert. the value corresponding to the key. Releases the queue's lock. a #GAsyncQueue. Creates a new random number generator initialized with @seed. a value to initialize the random number generator. the new #GRand. Converts a string which is in the encoding used for strings by the C runtime (usually the same as that used by the operating system) in the <link linkend="setlocale">current locale</link> into a UTF-8 string. a string in the encoding of the current locale. On Windows this means the system codepage. the length of the string, or -1 if the string is nul-terminated<footnoteref linkend="nul-unsafe"/>. location to store the number of bytes in the input string that were successfully converted, or %NULL. Even if the conversion was successful, this may be less than @len if there were partial characters at the end of the input. If the error #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value stored will the byte offset after the last valid input sequence. the number of bytes stored in the output buffer (not including the terminating nul). location to store the error occuring, or %NULL to ignore errors. Any of the errors in #GConvertError may occur. The converted string, or %NULL on an error. Inserts @data into @queue using @func to determine the new position. This function requires that the @queue is sorted before pushing on new elements. This function will lock @queue before it sorts the queue and unlock it when it is finished. For an example of @func see g_async_queue_sort(). Since: 2.10 a #GAsyncQueue the @data to push into the @queue the #GCompareDataFunc is used to sort @queue. This function is passed two elements of the @queue. The function should return 0 if they are equal, a negative value if the first element should be higher in the @queue or a positive value if the first element should be lower in the @queue than the second element. user data passed to @func. Overwrites part of a string, lengthening it if necessary. a #GString the position at which to start overwriting the string that will overwrite the @string starting at @pos @string Since: 2.14 Returns: The version information. The version information. Since: 2.6 Creates a new application launch context. This is not normally used, instead you instantiate a subclass of this, such as #GdkAppLaunchContext. a #GAppLaunchContext. Sets the operation result within the asynchronous result to a pointer. a #GSimpleAsyncResult. a pointer result from an asynchronous function. a #GDestroyNotify function. Gets the device path for a unix mount. a #GUnixMount. a string containing the device path. Converts an escaped ASCII-encoded URI to a local filename in the encoding used for filenames. a uri describing a filename (escaped, encoded in ASCII). Location to store hostname for the URI, or %NULL. If there is no hostname in the URI, %NULL will be stored in this location. location to store the error occuring, or %NULL to ignore errors. Any of the errors in #GConvertError may occur. a newly-allocated string holding the resulting filename, or %NULL on an error. Return Value: %TRUE if the @channel is buffered. a #GIOChannel %TRUE if the @channel is buffered. Gets the #GMainContext with which the source is associated. Calling this function on a destroyed source is an error. a #GSource the #GMainContext with which the source is associated, or %NULL if the context has not yet been added to a source. Converts a character to lower case. a Unicode character. the result of converting @c to lower case. If @c is not an upperlower or titlecase character, or has no lowercase equivalent @c is returned unchanged. Converts from a pointer to position within a string to a integer character offset. Since 2.10, this function allows @pos to be before @str, and returns a negative offset in this case. a UTF-8 encoded string a pointer to a position within @str the resulting character offset Determines the numeric value of a character as a hexidecimal digit. a Unicode character If @c is a hex digit (according to g_unichar_isxdigit()), its numeric value. Otherwise, -1. Gets the URI scheme for a #GFile. RFC 3986 decodes the scheme as: <programlisting> URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] </programlisting> Common schemes include "file", "http", "ftp", etc. This call does no blocking i/o. input #GFile. a string containing the URI scheme for the given #GFile. The returned string should be freed with g_free() when no longer needed. Gets the requested information about the files in a directory. The result is a #GFileEnumerator object that will give out #GFileInfo objects for all the files in the directory. The @attribute value is a string that specifies the file attributes that should be gathered. It is not an error if it's not possible to read a particular requested attribute from a file - it just won't be set. @attribute should be a comma-separated list of attribute or attribute wildcards. The wildcard "*" means all attributes, and a wildcard like "standard::*" means all attributes in the standard namespace. An example attribute query be "standard::*,owner::user". The standard attributes are available as defines, like #G_FILE_ATTRIBUTE_STANDARD_NAME. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned. If the file is not a directory, the G_FILE_ERROR_NOTDIR error will be returned. Other errors are possible too. input #GFile. an attribute query string. a set of #GFileQueryInfoFlags. optional #GCancellable object, %NULL to ignore. #GError for error reporting. A #GFileEnumerator if successful, %NULL on error. Executes a child synchronously (waits for the child to exit before returning). All output from the child is stored in @standard_output and @standard_error, if those parameters are non-%NULL. Note that you must set the %G_SPAWN_STDOUT_TO_DEV_NULL and %G_SPAWN_STDERR_TO_DEV_NULL flags when passing %NULL for @standard_output and @standard_error. If @exit_status is non-%NULL, the exit status of the child is stored there as it would be returned by waitpid(); standard UNIX macros such as WIFEXITED() and WEXITSTATUS() must be used to evaluate the exit status. Note that this function call waitpid() even if @exit_status is %NULL, and does not accept the %G_SPAWN_DO_NOT_REAP_CHILD flag. If an error occurs, no data is returned in @standard_output, @standard_error, or @exit_status. This function calls g_spawn_async_with_pipes() internally; see that function for full details on the other parameters and details on how these functions work on Windows. child's current working directory, or %NULL to inherit parent's child's argument vector child's environment, or %NULL to inherit parent's flags from #GSpawnFlags function to run in the child just before exec() user data for @child_setup return location for child output, or %NULL return location for child error messages, or %NULL return location for child exit status, as returned by waitpid(), or %NULL return location for error, or %NULL %TRUE on success, %FALSE if an error was set. Clears the pending flag on @stream. output stream Adds a function to be called after an interface vtable is initialized for any class (i.e. after the @interface_init member of #GInterfaceInfo has been called). This function is useful when you want to check an invariant that depends on the interfaces of a class. For instance, the implementation of #GObject uses this facility to check that an object implements all of the properties that are defined on its interfaces. Since: 2.4 data to pass to @check_func function to be called after each interface is initialized. Add a message to the test report. Since: 2.16 the format string printf-like arguments to @format Construct an exact copy of a #GValueArray by duplicating all its contents. #GValueArray to copy Newly allocated copy of #GValueArray Used from an I/O job to send a callback to be run in the main loop (main thread), waiting for the result (and thus blocking the I/O job). a #GIOSchedulerJob a #GSourceFunc callback that will be called in the main thread data to pass to @func a #GDestroyNotify for @user_data, or %NULL The return value of @func Find the rightmost occurrence of the given Unicode character in a UTF-8 encoded string, while limiting the search to @len bytes. If @len is -1, allow unbounded search. a nul-terminated UTF-8 encoded string the maximum length of @p a Unicode character %NULL if the string does not contain the character, otherwise, a pointer to the start of the rightmost occurrence of the character in the string. If @err is %NULL, does nothing. If @err is non-%NULL, calls g_error_free() on *@err and sets *@err to %NULL. a #GError return location Return value: the end iterator for @seq a #GSequence the end iterator for @seq Since: 2.14 Convert a character to ASCII lower case. Unlike the standard C library tolower() function, this only recognizes standard ASCII letters and ignores the locale, returning all non-ASCII characters unchanged, even if they are lower case letters in a particular character set. Also unlike the standard library function, this takes and returns a char, not an int, so don't call it on %EOF but no need to worry about casting to #guchar before passing a possibly non-ASCII character in. any character. the result of converting @c to lower case. If @c is not an ASCII upper case letter, @c is returned unchanged. Creates a #GSimpleAsyncResult. a #GObject the asynchronous function was called with. a #GAsyncReadyCallback. user data passed to @callback. the asynchronous function. a #GSimpleAsyncResult. Gets the mime-type for the content type. If one is registered a content type string. the registered mime-type for the given @type, or NULL if unknown. Asynchronously gets the mount for the file. For more details, see g_file_find_enclosing_mount() which is the synchronous version of this call. When the operation is finished, @callback will be called. You can then call g_file_find_enclosing_mount_finish() to get the result of the operation. a #GFile the <link linkend="io-priority">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied the data to pass to callback function Removes an interface check function added with g_type_add_interface_check(). Since: 2.4 callback data passed to g_type_add_interface_check() callback function passed to g_type_add_interface_check() Translate a Win32 error code (as returned by GetLastError()) into the corresponding message. The message is either language neutral, or in the thread's language, or the user's language, the system's language, or US English (see docs for FormatMessage()). The returned string is in UTF-8. It should be deallocated with g_free(). error code. newly-allocated error message Sort @value_array using @compare_func to compare the elements accoring to the semantics of #GCompareFunc. The current implementation uses Quick-Sort as sorting algorithm. #GValueArray to sort function to compare elements the #GValueArray passed in as @value_array A wrapper for the POSIX unlink() function. The unlink() function deletes a name from the filesystem. If this was the last link to the file and no processes have it opened, the diskspace occupied by the file is freed. See your C library manual for more details about unlink(). Note that on Windows, it is in general not possible to delete files that are open to some process, or mapped into memory. a pathname in the GLib file name encoding (UTF-8 on Windows) 0 if the name was successfully deleted, -1 if an error occurred Since: 2.6 Increments the reference count for the interface type @g_type, and returns the default interface vtable for the type. If the type is not currently in use, then the default vtable for the type will be created and initalized by calling the base interface init and default vtable init functions for the type (the @<structfield>base_init</structfield> and <structfield>class_init</structfield> members of #GTypeInfo). Calling g_type_default_interface_ref() is useful when you want to make sure that signals and properties for an interface have been installed. Since: 2.4 an interface type the default vtable for the interface; call g_type_default_interface_unref() when you are done using the interface. Decreases the reference count of @object. When its reference count drops to 0, the object is finalized (i.e. its memory is freed). a #GObject Creates a new #GMemoryInputStream with data in memory of a given size. input data length of the data, may be -1 if @data is a nul-terminated string function that is called to free @data, or %NULL new #GInputStream read from @data of @len bytes. Sets the contents of a %G_TYPE_OBJECT derived #GValue to @v_object and takes over the ownership of the callers reference to @v_object; the caller doesn't have to unref it any more (i.e. the reference count of the object is not increased). If you want the #GValue to hold its own reference to @v_object, use g_value_set_object() instead. Since: 2.4 a valid #GValue of %G_TYPE_OBJECT derived type object value to be set Return value: The main loop recursion level in the current thread The main loop recursion level in the current thread Checks if an attribute will be matched by an attribute matcher. If the matcher was created with the "*" matching string, this function will always return %TRUE. a #GFileAttributeMatcher. a file attribute key. %TRUE if @attribute matches @matcher. %FALSE otherwise. A predefined #GSignalAccumulator for signals that return a boolean values. The behavior that this accumulator gives is that a return of %TRUE stops the signal emission: no further callbacks will be invoked, while a return of %FALSE allows the emission to coninue. The idea here is that a %TRUE return indicates that the callback <emphasis>handled</emphasis> the signal, and no further handling is needed. Since: 2.4 standard #GSignalAccumulator parameter standard #GSignalAccumulator parameter standard #GSignalAccumulator parameter standard #GSignalAccumulator parameter standard #GSignalAccumulator result Sets the @attribute to contain the given @attr_value, if possible. a #GFileInfo. a file attribute key. a signed 32-bit integer Return value: whether @error has @domain and @code a #GError an error domain an error code whether @error has @domain and @code Get the contents of a %G_TYPE_PARAM #GValue, increasing its reference count. a valid #GValue whose type is derived from %G_TYPE_PARAM #GParamSpec content of @value, should be unreferenced when no longer needed. Converts a filename into a valid UTF-8 string. The conversion is not necessarily reversible, so you should keep the original around and use the return value of this function only for display purposes. Unlike g_filename_to_utf8(), the result is guaranteed to be non-%NULL even if the filename actually isn't in the GLib file name encoding. If GLib can not make sense of the encoding of @filename, as a last resort it replaces unknown characters with U+FFFD, the Unicode replacement character. You can search the result for the UTF-8 encoding of this character (which is "\357\277\275" in octal notation) to find out if @filename was in an invalid encoding. If you know the whole pathname of the file you should use g_filename_display_basename(), since that allows location-based translation of filenames. a pathname hopefully in the GLib file name encoding a newly allocated string containing a rendition of the filename in valid UTF-8 Since: 2.6 Calls a function for each element of a #GSList. a #GSList the function to call with each element's data user data to pass to the function Gets the next matched attribute from a #GFileAttributeMatcher. a #GFileAttributeMatcher. a string containing the next attribute or %NULL if no more attribute exist. A wrapper for the POSIX lstat() function. The lstat() function is like stat() except that in the case of symbolic links, it returns information about the symbolic link itself and not the file that it refers to. If the system does not support symbolic links g_lstat() is identical to g_stat(). See your C library manual for more details about lstat(). a pathname in the GLib file name encoding (UTF-8 on Windows) a pointer to a <structname>stat</structname> struct, which will be filled with the file information 0 if the information was successfully retrieved, -1 if an error occurred Since: 2.6 Releases all resources used by this enumerator, making the enumerator return %G_IO_ERROR_CLOSED on all calls. This will be automatically called when the last reference is dropped, but you might want to call this function to make sure resources are released as early as possible. a #GFileEnumerator. optional #GCancellable object, %NULL to ignore. location to store the error occuring, or %NULL to ignore #TRUE on success or #FALSE on error. Specify the base URI for bug reports. The base URI is used to construct bug report messages for g_test_message() when g_test_bug() is called. Calling this function outside of a test case sets the default base URI for all test cases. Calling it from within a test case changes the base URI for the scope of the test case only. Bug URIs are constructed by appending a bug specific URI portion to @uri_pattern, or by replacing the special string '%s' within @uri_pattern if that is present. Since: 2.16 the base pattern for bug URIs Request an asynchronous skip of @count bytes from the stream into the buffer starting at @buffer. When the operation is finished @callback will be called. You can then call g_input_stream_skip_finish() to get the result of the operation. During an async request no other sync and async calls are allowed, and will result in %G_IO_ERROR_PENDING errors. A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error. On success, the number of bytes skipped will be passed to the callback. It is not an error if this is not the same as the requested size, as it can happen e.g. near the end of a file, but generally we try to skip as many bytes as requested. Zero is returned on end of file (or if @count is zero), but never otherwise. Any outstanding i/o request with higher priority (lower numerical value) will be executed before an outstanding request with lower priority. Default priority is %G_PRIORITY_DEFAULT. The asyncronous methods have a default fallback that uses threads to implement asynchronicity, so they are optional for inheriting classes. However, if you override one you must override all. A #GInputStream. the number of bytes that will be skipped from the stream the <link linkend="io-priority">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. callback to call when the request is satisfied the data to pass to callback function Gets any loaded data from the @ostream. Note that the returned pointer may become invalid on the next write or truncate operation on the stream. a #GMemoryOutputStream pointer to the stream's data An auxiliary function for gettext() support (see Q_()). a string another string @msgval, unless @msgval is identical to @msgid and contains a '|' character, in which case a pointer to the substring of msgid after the first '|' character is returned. Since: 2.4 Emits a "notify" signal for the property @property_name on @object. a #GObject the name of a property installed on the class of @object. Splices an input stream into an output stream. a #GOutputStream. a #GInputStream. a set of #GOutputStreamSpliceFlags. optional #GCancellable object, %NULL to ignore. a #GError location to store the error occuring, or %NULL to ignore. a #gssize containing the size of the data spliced. A statically-allocated #GQueue must be initialized with this function before it can be used. Alternatively you can initialize it with #G_QUEUE_INIT. It is not necessary to initialize queues created with g_queue_new(). Since: 2.14 an uninitialized #GQueue Returns: the expanded string, or %NULL if an error occurred a #GMatchInfo or %NULL the string to expand location to store the error occuring, or %NULL to ignore errors the expanded string, or %NULL if an error occurred Since: 2.14 Creates a new #GParamSpecChar instance specifying a %G_TYPE_CHAR property. canonical name of the property specified nick name for the property specified description of the property specified minimum value for the property specified maximum value for the property specified default value for the property specified flags for the property specified a newly created parameter specification Gets a #GList of strings containing 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 g_unix_mounts_points_changed_since(). guint64 to contain a timestamp. a #GList of the UNIX mountpoints. Sets the function to use to handle polling of file descriptors. It will be used instead of the poll() system call (or GLib's replacement function, which is used where poll() isn't available). This function could possibly be used to integrate the GLib event loop with an external event loop. a #GMainContext the function to call to poll all file descriptors Will set @cancellable to cancelled, and will emit the CANCELLED signal. This function is thread-safe. In other words, you can safely call it from another thread than the one running an operation that was passed the @cancellable. a #GCancellable object. Removes the last element of the queue. a #GQueue. the data of the last element in the queue, or %NULL if the queue is empty. 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 string containing a relative or absolute path. a new #GFile for the given @path. Copies the file attributes from @source to @destination. Normally only a subset of the file attributes are copied, those that are copies in a normal file copy operation (which for instance does not include e.g. mtime). However if #G_FILE_COPY_ALL_METADATA is specified in @flags, then all the metadata that is possible to copy is copied. a #GFile with attributes. a #GFile to copy attributes to. a set of #GFileCopyFlags. optional #GCancellable object, %NULL to ignore. a #GError, %NULL to ignore. %TRUE if the attributes were copied successfully, %FALSE otherwise. Creates a new #GString, with enough space for @dfl_size bytes. This is useful if you are going to add a lot of text to the string and don't want it to be reallocated too often. the default size of the space allocated to hold the string the new #GString Like the standard C strncpy() function, but copies a given number of characters instead of a given number of bytes. The @src string must be valid UTF-8 encoded text. (Use g_utf8_validate() on all text before trying to use UTF-8 utility functions with it.) buffer to fill with characters from @src UTF-8 encoded string character count @dest Gets the #GAppInfo that correspond to a given content type. the content type to find a #GAppInfo for if %TRUE, the #GAppInfo is expected to support URIs #GAppInfo for given @content_type or %NULL on error. Searches the string @haystack for the first occurrence of the string @needle, limiting the length of the search to @haystack_len. a string. the maximum length of @haystack. the string to search for. a pointer to the found occurrence, or %NULL if not found. Gets the symlink target for a given #GFileInfo. a #GFileInfo. a string containing the symlink target. Finishes an asynchronous partial load operation that was started with g_file_load_partial_contents_async(). input #GFile. a #GAsyncResult. a location to place the contents of the file. a location to place the length of the contents of the file. a location to place the current entity tag for the file. a #GError, or %NULL %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately. Makes a copy of @error. a #GError a new #GError Tries to write @count bytes from @buffer into the stream. Will block during the operation. If count is zero returns zero and does nothing. A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error. On success, the number of bytes written to the stream is returned. It is not an error if this is not the same as the requested size, as it can happen e.g. on a partial i/o error, or if there is not enough storage in the stream. All writes either block until at least one byte is written, so zero is never returned (unless @count is zero). If @cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an operation was partially finished when the operation was cancelled the partial result will be returned, without an error. On error -1 is returned and @error is set accordingly. a #GOutputStream. the buffer containing the data to write. the number of bytes to write optional cancellable object location to store the error occuring, or %NULL to ignore Number of bytes written, or -1 on error Insert a copy of @value as last element of @value_array. #GValueArray to add an element to #GValue to copy into #GValueArray the #GValueArray passed in as @value_array Converts all lower case ASCII letters to upper case ASCII letters. a string. length of @str in bytes, or -1 if @str is nul-terminated. a newly allocated string, with all the lower case characters in @str converted to upper case, with semantics that exactly match g_ascii_toupper(). (Note that this is unlike the old g_strup(), which modified the string in place.) Adds a #GSource to a @context so that it will be executed within that context. a #GSource a #GMainContext (if %NULL, the default context will be used) the ID (greater than 0) for the source within the #GMainContext. Gets the local pathname for #GFile, if one exists. This call does no blocking i/o. input #GFile. 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. Set the contents of a %G_TYPE_BOOLEAN #GValue to @v_boolean. a valid #GValue of type %G_TYPE_BOOLEAN boolean value to be set Opens a directory for reading. The names of the files in the directory can then be retrieved using g_dir_read_name(). the path to the directory you are interested in. On Unix in the on-disk encoding. On Windows in UTF-8 Currently must be set to 0. Reserved for future use. return location for a #GError, or %NULL. If non-%NULL, an error will be set if and only if g_dir_open() fails. a newly allocated #GDir on success, %NULL on failure. If non-%NULL, you must free the result with g_dir_close() when you are finished with it. This is an internal function introduced mainly for C marshallers. Deprecated: 2.4: Use g_value_take_string() instead. a valid #GValue of type %G_TYPE_STRING duplicated unowned string to be set Gets the edit name for a file. a #GFileInfo. a string containing the edit name. Creates a new asynchronous queue with the initial reference count of 1. the new #GAsyncQueue. Adds @prerequisite_type to the list of prerequisites of @interface_type. This means that any type implementing @interface_type must also implement @prerequisite_type. Prerequisites can be thought of as an alternative to interface derivation (which GType doesn't support). An interface can have at most one instantiatable prerequisite type. #GType value of an interface type. #GType value of an interface or instantiatable type. Splits an URI list conforming to the text/uri-list mime type defined in RFC 2483 into individual URIs, discarding any comments. The URIs are not validated. an URI list a newly allocated %NULL-terminated list of strings holding the individual URIs. The array should be freed with g_strfreev(). Since: 2.6 Finishes an asynchronous stream read operation. a #GInputStream. a #GAsyncResult. a #GError location to store the error occuring, or %NULL to ignore. number of bytes read in, or -1 on error. Opens a file for reading. The result is a #GFileInputStream that can be used to read the contents of the file. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned. If the file is a directory, the G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on. #GFile to read. a #GCancellable a #GError, or %NULL #GFileInputStream or %NULL on error. Converts an absolute filename to an escaped ASCII-encoded URI, with the path component following Section 3.3. of RFC 2396. an absolute filename specified in the GLib file name encoding, which is the on-disk file name bytes on Unix, and UTF-8 on Windows A UTF-8 encoded hostname, or %NULL for none. location to store the error occuring, or %NULL to ignore errors. Any of the errors in #GConvertError may occur. a newly-allocated string holding the resulting URI, or %NULL on an error. Propagates an error from within the simple asynchronous result to a given destination. a #GSimpleAsyncResult. a location to propegate the error to. %TRUE if the error was propegated to @dest. %FALSE otherwise. Escapes a string for use in a URI. Normally all characters that are not "unreserved" (i.e. ASCII alphanumerical characters plus dash, dot, underscore and tilde) are escaped. But if you specify characters in @reserved_chars_allowed they are not escaped. This is useful for the "reserved" characters in the URI specification, since those are allowed unescaped in some portions of a URI. the unescaped input string. a string of reserved characters that are allowed to be used. %TRUE if the result can include UTF-8 characters. an escaped version of @unescaped. The returned string should be freed when no longer needed. Since: 2.16 Adds a copy of @string to the #GStringChunk, unless the same string has already been added to the #GStringChunk with g_string_chunk_insert_const(). This function is useful if you need to copy a large number of strings but do not want to waste space storing duplicates. But you must remember that there may be several pointers to the same string, and so any changes made to the strings should be done very carefully. Note that g_string_chunk_insert_const() will not return a pointer to a string added with g_string_chunk_insert(), even if they do match. a #GStringChunk the string to add a pointer to the new or existing copy of @string within the #GStringChunk Puts a string into the output stream. a #GDataOutputStream. a string. optional #GCancellable object, %NULL to ignore. a #GError, %NULL to ignore. %TRUE if @string was successfully added to the @stream. Report the result of a performance or measurement test. The test should generally strive to maximize the reported quantities (larger values are better than smaller ones), this and @maximized_quantity can determine sorting order for test result reports. Since: 2.16 the reported value the format string of the report message arguments to pass to the printf() function Computes the canonical decomposition of a Unicode character. a Unicode character. location to store the length of the return value. a newly allocated string of Unicode characters. @result_len is set to the resulting length of the string. Registers an extension point. The name of the extension point the new #GIOExtensionPoint. This object is owned by GIO and should not be freed Creates a #GSimpleAsyncResult from an error condition. a #GObject. a #GAsyncReadyCallback. user data passed to @callback. a #GError location. a #GSimpleAsyncResult. Gets the root of a tree. a #GNode the root of the tree Return value: A random number. a #GRand. A random number. Copies the value of @src_value into @dest_value. An initialized #GValue structure. An initialized #GValue structure of the same type as @src_value. Gets the value of the sort_order attribute from the #GFileInfo. See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER. a #GFileInfo. a #gint32 containing the value of the "standard::sort_order" attribute. Creates a new themed icon for @iconname. a string containing an icon name. a new #GThemedIcon. Calls the given function for each of the key/value pairs in the #GHashTable. The function is passed the key and value of each pair, and the given @user_data parameter. The hash table may not be modified while iterating over it (you can't add/remove items). To remove all items matching a predicate, use g_hash_table_foreach_remove(). See g_hash_table_find() for performance caveats for linear order searches in contrast to g_hash_table_lookup(). a #GHashTable. the function to call for each key/value pair. user data to pass to the function. Return value: a newly allocated %NULL-terminated string array a #GKeyFile a group name a key a locale return location for the number of returned strings or %NULL return location for a #GError or %NULL a newly allocated %NULL-terminated string array or %NULL if the key isn't found. The string array should be freed with g_strfreev(). Since: 2.6 Guesses whether a Unix mount can be ejected. a #GUnixMountEntry %TRUE if @mount_entry is deemed to be ejectable. Gets the position of the element containing the given data (starting from 0). a #GSList the data to find the index of the element containing the data, or -1 if the data is not found Set the pointer at the specified location to %NULL. the memory address of the pointer. Initialize the GLib testing framework, e.g. by seeding the test random number generator, the name for g_get_prgname() and parsing test related command line args. So far, the following arguments are understood: <variablelist> <varlistentry> <term><option>-l</option></term> <listitem><para> list test cases available in a test executable. </para></listitem> </varlistentry> <varlistentry> <term><option>--seed=<replaceable>RANDOMSEED</replaceable></option></term> <listitem><para> provide a random seed to reproduce test runs using random numbers. </para></listitem> </varlistentry> <varlistentry> <term><option>--verbose</option></term> <listitem><para>run tests verbosely.</para></listitem> </varlistentry> <varlistentry> <term><option>-q</option>, <option>--quiet</option></term> <listitem><para>run tests quietly.</para></listitem> </varlistentry> <varlistentry> <term><option>-p <replaceable>TESTPATH</replaceable></option></term> <listitem><para> execute all tests matching <replaceable>TESTPATH</replaceable>. </para></listitem> </varlistentry> <varlistentry> <term><option>-m {perf|slow|thorough|quick}</option></term> <listitem><para> execute tests according to these test modes: <variablelist> <varlistentry> <term>perf</term> <listitem><para> performance tests, may take long and report results. </para></listitem> </varlistentry> <varlistentry> <term>slow, thorough</term> <listitem><para> slow and thorough tests, may take quite long and maximize coverage. </para></listitem> </varlistentry> <varlistentry> <term>quick</term> <listitem><para> quick tests, should run really quickly and give good coverage. </para></listitem> </varlistentry> </variablelist> </para></listitem> </varlistentry> <varlistentry> <term><option>--debug-log</option></term> <listitem><para>debug test logging output.</para></listitem> </varlistentry> <varlistentry> <term><option>-k</option>, <option>--keep-going</option></term> <listitem><para>gtester-specific argument.</para></listitem> </varlistentry> <varlistentry> <term><option>--GTestLogFD <replaceable>N</replaceable></option></term> <listitem><para>gtester-specific argument.</para></listitem> </varlistentry> <varlistentry> <term><option>--GTestSkipCount <replaceable>N</replaceable></option></term> <listitem><para>gtester-specific argument.</para></listitem> </varlistentry> </variablelist> Since: 2.16 Address of the @argc parameter of the main() function. Changed if any arguments were handled. Address of the @argv parameter of main(). Any parameters understood by g_test_init() stripped before return. Reserved for future extension. Currently, you must pass %NULL. Creates a new #GMemoryOutputStream. If @data is non-%NULL, the stream will use that for its internal storage. If @realloc_fn is non-%NULL, it will be used for resizing the internal storage when necessary. To construct a fixed-size output stream, pass %NULL as @realloc_fn. |[ /* a stream that can grow */ stream = g_memory_output_stream_new (NULL, 0, realloc, free); /* a fixed-size stream */ data = malloc (200); stream2 = g_memory_output_stream_new (data, 200, NULL, free); ]| pointer to a chunk of memory to use, or %NULL the size of @data a function with realloc() semantics to be called when @data needs to be grown, or %NULL a function to be called on @data when the stream is finalized, or %NULL A newly created #GMemoryOutputStream object. Associates a string value for @key and @locale under @group_name. If the translation for @key cannot be found then it is created. Since: 2.6 a #GKeyFile a group name a key a locale a string Frees a #GBookmarkFile. Since: 2.12 a #GBookmarkFile Scans for a match in string for the pattern in @regex. The @match_options are combined with the match options specified when the @regex structure was created, letting you have more flexibility in reusing #GRegex structures. Setting @start_position differs from just passing over a shortened string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern that begins with any kind of lookbehind assertion, such as "\b". A #GMatchInfo structure, used to get information on the match, is stored in @match_info if not %NULL. Note that if @match_info is not %NULL then it is created even if the function returns %FALSE, i.e. you must free it regardless if regular expression actually matched. @string is not copied and is used in #GMatchInfo internally. If you use any #GMatchInfo method (except g_match_info_free()) after freeing or modifying @string then the behaviour is undefined. To retrieve all the non-overlapping matches of the pattern in string you can use g_match_info_next(). |[ static void print_uppercase_words (const gchar *string) { /* Print all uppercase-only words. */ GRegex *regex; GMatchInfo *match_info; GError *error = NULL;   regex = g_regex_new ("[A-Z]+", 0, 0, NULL); g_regex_match_full (regex, string, -1, 0, 0, &match_info, &error); while (g_match_info_matches (match_info)) { gchar *word = g_match_info_fetch (match_info, 0); g_print ("Found: %s\n", word); g_free (word); g_match_info_next (match_info, &error); } g_match_info_free (match_info); g_regex_unref (regex); if (error != NULL) { g_printerr ("Error while matching: %s\n", error->message); g_error_free (error); } } ]| a #GRegex structure from g_regex_new() the string to scan for matches the length of @string, or -1 if @string is nul-terminated starting index of the string to match match options pointer to location where to store the #GMatchInfo, or %NULL if you do not need it location to store the error occuring, or %NULL to ignore errors %TRUE is the string matched, %FALSE otherwise Since: 2.14 Associates a list of string values for @key under @group_name. If @key cannot be found then it is created. If @group_name cannot be found then it is created. Since: 2.6 a #GKeyFile a group name a key an array of locale string values number of locale string values in @list Creates a new property of type #GParamSpecOverride. This is used to direct operations to another paramspec, and will not be directly useful unless you are implementing a new base type similar to GObject. Since: 2.4 the name of the property. The property that is being overridden the newly created #GParamSpec Sets the size of the internal buffer to @size. a #GBufferedOutputStream. a #gsize. Starts an asynchronous replacement of @file with the given @contents of @length bytes. @etag will replace the document's current entity tag. When this operation has completed, @callback will be called with @user_user data, and the operation can be finalized with g_file_replace_contents_finish(). If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If @make_backup is %TRUE, this function will attempt to make a backup of @file. input #GFile. string of contents to replace the file with. the length of @contents in bytes. a new <link linkend="gfile-etag">entity tag</link> for the @file. %TRUE if a backup should be created. a set of #GFileCreateFlags. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied the data to pass to callback function Decrements the reference count of a closure after it was previously incremented by the same caller. If no other callers are using the closure, then the closure will be destroyed and freed. #GClosure to decrement the reference count on Emits a signal. Note that g_signal_emitv() doesn't change @return_value if no handlers are connected, in contrast to g_signal_emit() and g_signal_emit_valist(). argument list for the signal emission. The first element in the array is a #GValue for the instance the signal is being emitted on. The rest are any arguments to be passed to the signal. the signal id the detail Location to store the return value of the signal emission. Gets the value of a #GObject attribute. If the attribute does not contain a #GObject, %NULL will be returned. a #GFileInfo. a file attribute key. a #GObject associated with the given @attribute, or %NULL otherwise. Provide a copy of a boxed structure @src_boxed which is of type @boxed_type. The type of @src_boxed. The boxed structure to be copied. The newly created copy of the boxed structure. Behaves exactly like g_build_filename(), but takes the path elements as a string array, instead of varargs. This function is mainly meant for language bindings. %NULL-terminated array of strings containing the path elements. a newly-allocated string that must be freed with g_free(). Since: 2.8 Finishes an asynchronous file replace operation started with g_file_replace_async(). input #GFile. a #GAsyncResult. a #GError, or %NULL a #GFileOutputStream, or %NULL on error. Removes the node link_ from the list and frees it. Compare this to g_slist_remove_link() which removes the node without freeing it. a #GSList node to delete the new head of @list A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs ignored 2 a #GValue array holding the instance and the #GParamSpec* parameter the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Creates a new #GSimpleAsyncResult with a set error. a #GObject. a #GAsyncReadyCallback. user data passed to @callback. a #GQuark. an error code. a string with format characters. a list of values to insert into @format. a #GSimpleAsyncResult. Gets a list of all #GAppInfo s for a given content type. the content type to find a #GAppInfo for #GList of #GAppInfo s for given @content_type or %NULL on error. Creates a new #GParamSpecParam instance specifying a %G_TYPE_PARAM property. See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified a #GType derived from %G_TYPE_PARAM flags for the property specified a newly created parameter specification Finishes an unmount operation, see g_file_unmount_mountable() for details. Finish an asynchronous unmount operation that was started with g_file_unmount_mountable(). input #GFile. a #GAsyncResult. a #GError, or %NULL %TRUE if the operation finished successfully. %FALSE otherwise. Frees one #GList element. It is usually used after g_list_remove_link(). a #GList element Return value: the length of the @queue. a #GAsyncQueue. the length of the @queue. Converts a string to a #gint64 value. This function behaves like the standard strtoll() function does in the C locale. It does this without actually changing the current locale, since that would not be thread-safe. This function is typically used when reading configuration files or other non-user input that should be locale independent. To handle input from the user you should normally use the locale-sensitive system strtoll() function. If the correct value would cause overflow, %G_MAXINT64 or %G_MININT64 is returned, and %ERANGE is stored in %errno. If the base is outside the valid range, zero is returned, and %EINVAL is stored in %errno. If the string conversion fails, zero is returned, and @endptr returns @nptr (if @endptr is non-%NULL). the string to convert to a numeric value. if non-%NULL, it returns the character after the last character used in the conversion. to be used for the conversion, 2..36 or 0 the #gint64 value or zero on error. Since: 2.12 Checks if a supported content type can be removed from an application. a #GAppInfo. %TRUE if it is possible to remove supported content types from a given @appinfo, %FALSE if not. A wrapper for the POSIX mkdir() function. The mkdir() function attempts to create a directory with the given name and permissions. The mode argument is ignored on Windows. See your C library manual for more details about mkdir(). a pathname in the GLib file name encoding (UTF-8 on Windows) permissions to use for the newly created directory 0 if the directory was successfully created, -1 if an error occurred Since: 2.6 Returns: the summary a #GOptionContext the summary Since: 2.12 Registers @property_id as referring to a property with the name @name in a parent class or in an interface implemented by @oclass. This allows this class to <firstterm>override</firstterm> a property implementation in a parent class or to provide the implementation of a property from an interface. <note> Internally, overriding is implemented by creating a property of type #GParamSpecOverride; generally operations that query the properties of the object class, such as g_object_class_find_property() or g_object_class_list_properties() will return the overridden property. However, in one case, the @construct_properties argument of the @constructor virtual function, the #GParamSpecOverride is passed instead, so that the @param_id field of the #GParamSpec will be correct. For virtually all uses, this makes no difference. If you need to get the overridden property, you can call g_param_spec_get_redirect_target(). </note> Since: 2.4 a #GObjectClass the new property ID the name of a property registered in a parent class or in an interface of this class. Determines whether a character is alphabetic (i.e. a letter). Given some UTF-8 text, obtain a character value with g_utf8_get_char(). a Unicode character %TRUE if @c is an alphabetic character Unlinks @link_ so that it will no longer be part of @queue. The link is not freed. @link_ must be part of @queue, Since: 2.4 a #GQueue a #GList link that <emphasis>must</emphasis> be part of @queue Removes a source from its #GMainContext, if any, and mark it as destroyed. The source cannot be subsequently added to another context. a #GSource Loads a loadable icon. For the asynchronous version of this function, see g_loadable_icon_load_async(). a #GLoadableIcon. an integer. a location to store the type of the loaded icon, %NULL to ignore. optional #GCancellable object, %NULL to ignore. a #GError location to store the error occuring, or %NULL to ignore. a #GInputStream to read the icon from. Gets whether the private flag of the bookmark for @uri is set. In the event the URI cannot be found, %FALSE is returned and @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the event that the private flag cannot be found, %FALSE is returned and @error is set to #G_BOOKMARK_FILE_ERROR_INVALID_VALUE. a #GBookmarkFile a valid URI return location for a #GError, or %NULL %TRUE if the private flag is set, %FALSE otherwise. Since: 2.12 Set the callback for a source as a #GClosure. If the source is not one of the standard GLib types, the @closure_callback and @closure_marshal fields of the #GSourceFuncs structure must have been filled in with pointers to appropriate functions. the source a #GClosure Returns: The corresponding #GTypeInterface structure of the parent A #GTypeInterface structure. The corresponding #GTypeInterface structure of the parent type of the instance type to which @g_iface belongs, or %NULL if the parent type doesn't conform to the interface. A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, gchar arg1, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs ignored 2 a #GValue array holding the instance and the #gchar parameter the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Sets the encoding for the input/output of the channel. The internal encoding is always UTF-8. The default encoding for the external file is UTF-8. The encoding %NULL is safe to use with binary data. The encoding can only be set if one of the following conditions is true: <itemizedlist> <listitem><para> The channel was just created, and has not been written to or read from yet. </para></listitem> <listitem><para> The channel is write-only. </para></listitem> <listitem><para> The channel is a file, and the file pointer was just repositioned by a call to g_io_channel_seek_position(). (This flushes all the internal buffers.) </para></listitem> <listitem><para> The current encoding is %NULL or UTF-8. </para></listitem> <listitem><para> One of the (new API) read functions has just returned %G_IO_STATUS_EOF (or, in the case of g_io_channel_read_to_end(), %G_IO_STATUS_NORMAL). </para></listitem> <listitem><para> One of the functions g_io_channel_read_chars() or g_io_channel_read_unichar() has returned %G_IO_STATUS_AGAIN or %G_IO_STATUS_ERROR. This may be useful in the case of %G_CONVERT_ERROR_ILLEGAL_SEQUENCE. Returning one of these statuses from g_io_channel_read_line(), g_io_channel_read_line_string(), or g_io_channel_read_to_end() does <emphasis>not</emphasis> guarantee that the encoding can be changed. </para></listitem> </itemizedlist> Channels which do not meet one of the above conditions cannot call g_io_channel_seek_position() with an offset of %G_SEEK_CUR, and, if they are "seekable", cannot call g_io_channel_write_chars() after calling one of the API "read" functions. a #GIOChannel the encoding type location to store an error of type #GConvertError %G_IO_STATUS_NORMAL if the encoding was successfully set. Frees a #GMarkupParseContext. Can't be called from inside one of the #GMarkupParser functions. a #GMarkupParseContext Creates and initializes an instance of @type if @type is valid and can be instantiated. The type system only performs basic allocation and structure setups for instances: actual instance creation should happen through functions supplied by the type's fundamental type implementation. So use of g_type_create_instance() is reserved for implementators of fundamental types only. E.g. instances of the #GObject hierarchy should be created via g_object_new() and <emphasis>never</emphasis> directly through g_type_create_instance() which doesn't handle things like singleton objects or object construction. Note: Do <emphasis>not</emphasis> use this function, unless you're implementing a fundamental type. Also language bindings should <emphasis>not</emphasis> use this function but g_object_new() instead. An instantiatable type to create an instance for. An allocated and initialized instance, subject to further treatment by the fundamental type implementation. This is just like the standard C qsort() function, but the comparison routine accepts a user data argument. start of array to sort elements in the array size of each element function to compare elements data to pass to @compare_func Gets the value of a boolean attribute. If the attribute does not contain a boolean value, %FALSE will be returned. a #GFileInfo. a file attribute key. the boolean value contained within the attribute. Sets the mount operation's domain. a #GMountOperation. the domain to set. Check whether g_value_transform() is able to transform values of type @src_type into values of type @dest_type. Source type. Target type. %TRUE if the transformation is possible, %FALSE otherwise. Increases the reference count on a #GMainContext object by one. a #GMainContext the @context that was passed in (since 2.6) Sets a human-readable name for the application. This name should be localized if possible, and is intended for display to the user. Contrast with g_set_prgname(), which sets a non-localized name. g_set_prgname() will be called automatically by gtk_init(), but g_set_application_name() will not. Note that for thread safety reasons, this function can only be called once. The application name will be used in contexts such as error messages, or when displaying an application's name in the task list. Since: 2.2 localized name of the application Start a timing test. Call g_test_timer_elapsed() when the task is supposed to be done. Call this function again to restart the timer. Since: 2.16 Checks if a unix mount point is a loopback device. a #GUnixMountPoint. %TRUE if the mount point is a loopback. %FALSE otherwise. Takes over the initial ownership of a closure. Each closure is initially created in a <firstterm>floating</firstterm> state, which means that the initial reference count is not owned by any caller. g_closure_sink() checks to see if the object is still floating, and if so, unsets the floating state and decreases the reference count. If the closure is not floating, g_closure_sink() does nothing. The reason for the existance of the floating state is to prevent cumbersome code sequences like: |[ closure = g_cclosure_new (cb_func, cb_data); g_source_set_closure (source, closure); g_closure_unref (closure); // XXX GObject doesn't really need this ]| Because g_source_set_closure() (and similar functions) take ownership of the initial reference count, if it is unowned, we instead can write: |[ g_source_set_closure (source, g_cclosure_new (cb_func, cb_data)); ]| Generally, this function is used together with g_closure_ref(). Ane example of storing a closure for later notification looks like: |[ static GClosure *notify_closure = NULL; void foo_notify_set_closure (GClosure *closure) { if (notify_closure) g_closure_unref (notify_closure); notify_closure = closure; if (notify_closure) { g_closure_ref (notify_closure); g_closure_sink (notify_closure); } } ]| Because g_closure_sink() may decrement the reference count of a closure (if it hasn't been called on @closure yet) just like g_closure_unref(), g_closure_ref() should be called prior to this function. #GClosure to decrement the initial reference count on, if it's still being held Gets a password from the mount operation. a #GMountOperation. a string containing the password within @op. Resets the given directory. The next call to g_dir_read_name() will return the first entry again. a #GDir* created by g_dir_open() Looks whether the key file has the key @key in the group @group_name. a #GKeyFile a group name a key name return location for a #GError %TRUE if @key is a part of @group_name, %FALSE otherwise. Since: 2.6 Seeks in the stream by the given @offset, modified by @type. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. a #GSeekable. a #goffset. a #GSeekType. optional #GCancellable object, %NULL to ignore. a #GError location to store the error occuring, or %NULL to ignore. %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present. 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_foreach(list, g_free, NULL) and @g_list_free(list) #GList of the registered content types. Feed some data to the #GMarkupParseContext. The data need not be valid UTF-8; an error will be signaled if it's invalid. The data need not be an entire document; you can feed a document into the parser incrementally, via multiple calls to this function. Typically, as you receive data from a network connection or file, you feed each received chunk of data into this function, aborting the process if an error occurs. Once an error is reported, no further data may be fed to the #GMarkupParseContext; all errors are fatal. a #GMarkupParseContext chunk of text to parse length of @text in bytes return location for a #GError %FALSE if an error occurred, %TRUE on success Recursively copies a #GNode and its data. a #GNode the function which is called to copy the data inside each node, or %NULL to use the original data. data to pass to @copy_func a new #GNode containing copies of the data in @node. Since: 2.4 Reads the contents of the symbolic link @filename like the POSIX readlink() function. The returned string is in the encoding used for filenames. Use g_filename_to_utf8() to convert it to UTF-8. the symbolic link return location for a #GError A newly allocated string with the contents of the symbolic link, or %NULL if an error occurred. Since: 2.4 Given the name of the signal and the type of object it connects to, gets the signal's identifying integer. Emitting the signal by number is somewhat faster than using the name each time. Also tries the ancestors of the given type. See g_signal_new() for details on allowed signal names. the signal's name. the type that the signal operates on. the signal's identifying number, or 0 if no signal was found. Decreases the reference count of the asynchronous @queue by 1 and releases the lock. This function must be called while holding the @queue's lock. If the reference count went to 0, the @queue will be destroyed and the memory allocated will be freed. @Deprecated: Since 2.8, reference counting is done atomically so g_async_queue_unref() can be used regardless of the @queue's lock. a #GAsyncQueue. Copies a #GList. <note><para> Note that this is a "shallow" copy. If the list elements consist of pointers to data, the pointers are copied but the actual data is not. </para></note> a #GList a copy of @list Starts an asynchronous eject on a mountable. When this operation has completed, @callback will be called with @user_user data, and the operation can be finalized with g_file_eject_mountable_finish(). If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. flags affecting the operation optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied, or %NULL. the data to pass to callback function Get the contents of a %G_TYPE_CHAR #GValue. a valid #GValue of type %G_TYPE_CHAR character contents of @value Incrementally decode a sequence of binary data from its Base-64 stringified representation. By calling this function multiple times you can convert data in chunks to avoid having to have the full encoded data in memory. The output buffer must be large enough to fit all the data that will be written to it. Since base64 encodes 3 bytes in 4 chars you need at least: @len * 3 / 4 bytes. binary input data max length of @in data to decode output buffer Saved state between steps, initialize to 0 Saved state between steps, initialize to 0 The number of bytes of output that was written Since: 2.12 Converts a string from one character set to another. Note that you should use g_iconv() for streaming conversions<footnoteref linkend="streaming-state"/>. the string to convert the length of the string, or -1 if the string is nul-terminated<footnote id="nul-unsafe"> <para> Note that some encodings may allow nul bytes to occur inside strings. In that case, using -1 for the @len parameter is unsafe. </para> </footnote>. name of character set into which to convert @str character set of @str. location to store the number of bytes in the input string that were successfully converted, or %NULL. Even if the conversion was successful, this may be less than @len if there were partial characters at the end of the input. If the error #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value stored will the byte offset after the last valid input sequence. the number of bytes stored in the output buffer (not including the terminating nul). location to store the error occuring, or %NULL to ignore errors. Any of the errors in #GConvertError may occur. If the conversion was successful, a newly allocated nul-terminated string, which must be freed with g_free(). Otherwise %NULL and @error will be set. Finds a #GIOExtension for an extension point by name. a #GIOExtensionPoint the name of the extension to get the #GIOExtension for @extension_point that has the given name, or %NULL if there is no extension with that name Adds a file descriptor to the set of file descriptors polled for this context. This will very seldomly be used directly. Instead a typical event source will use g_source_add_poll() instead. a #GMainContext (or %NULL for the default context) a #GPollFD structure holding information about a file descriptor to watch. the priority for this file descriptor which should be the same as the priority used for g_source_attach() to ensure that the file descriptor is polled whenever the results may be needed. Execute the tests within @suite and all nested #GTestSuites. The test suites to be executed are filtered according to test path arguments (-p <replaceable>testpath</replaceable>) as parsed by g_test_init(). g_test_run_suite() or g_test_run() may only be called once in a program. a #GTestSuite 0 on success Since: 2.16 Emitted when a file has been changed. a #GFileMonitor. a #GFile. a #GFile. a #GFileMonitorEvent. Checks wether @object has a <link linkend="floating-ref">floating</link> reference. Since: 2.10 a #GObject %TRUE if @object has a floating reference Finishes an asynchronous filesystem info query. See g_file_query_filesystem_info_async(). input #GFile. a #GAsyncResult. a #GError. #GFileInfo for given @file or %NULL on error. Compares two strings for byte-by-byte equality and returns %TRUE if they are equal. It can be passed to g_hash_table_new() as the @key_equal_func parameter, when using strings as keys in a #GHashTable. a key a key to compare with @v1 %TRUE if the two keys match Increments the reference count of the class structure belonging to @type. This function will demand-create the class if it doesn't exist already. Type ID of a classed type. The #GTypeClass structure for the given type ID. Gets the identifier of the given kind for @volume. See the <link linkend="volume-identifier">introduction</link> for more information about volume identifiers. a #GVolume the kind of identifier to return a newly allocated string containing the requested identfier, or %NULL if the #GVolume doesn't have this kind of identifier Removes all the elements in @queue. If queue elements contain dynamically-allocated memory, they should be freed first. Since: 2.14 a #GQueue Finishes setting a display name started with g_file_set_display_name_async(). input #GFile. a #GAsyncResult. a #GError, or %NULL a #GFile or %NULL on error. Decreases the reference count of a source by one. If the resulting reference count is zero the source and associated memory will be destroyed. a #GSource Finishes an asynchronous find mount request. See g_file_find_enclosing_mount_async(). a #GFile a #GAsyncResult a #GError #GMount for given @file or %NULL on error. Emitted when the operation has been cancelled from another thread. Can be used by implementations of cancellable operations. This will be emitted in the thread that tried to cancel the operation, not the thread the is running the operation. a #GCancellable. Copies the file @source to the location specified by @destination asynchronously. For details of the behaviour, see g_file_copy(). If @progress_callback is not %NULL, then that function that will be called just like in g_file_copy(), however the callback will run in the main loop, not in the thread that is doing the I/O operation. When the operation is finished, @callback will be called. You can then call g_file_copy_finish() to get the result of the operation. input #GFile. destination #GFile set of #GFileCopyFlags the <link linkend="io-priority">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. function to callback with progress information user data to pass to @progress_callback a #GAsyncReadyCallback to call when the request is satisfied the data to pass to callback function Finds the previous UTF-8 character in the string before @p. @p does not have to be at the beginning of a UTF-8 character. No check is made to see if the character found is actually valid other than it starts with an appropriate byte. If @p might be the first character of the string, you must use g_utf8_find_prev_char() instead. a pointer to a position within a UTF-8 encoded string a pointer to the found character. An implementation of the standard fprintf() function which supports positional parameters, as specified in the Single Unix Specification. the stream to write to. a standard printf() format string, but notice <link linkend="string-precision">string precision pitfalls</link>. the arguments to insert in the output. the number of bytes printed. Since: 2.2 Set the contents of a %G_TYPE_DOUBLE #GValue to @v_double. a valid #GValue of type %G_TYPE_DOUBLE double value to be set Find the next conversion in a printf-style format string. Partially based on code from printf-parser.c, Copyright (C) 1999-2000, 2002-2003 Free Software Foundation, Inc. a printf-style format string location to store a pointer to the character after the returned conversion. On a %NULL return, returns the pointer to the trailing NUL in the string pointer to the next conversion in @format, or %NULL, if none. Converts a string from UTF-8 to the encoding GLib uses for filenames. Note that on Windows GLib uses UTF-8 for filenames; on other platforms, this function indirectly depends on the <link linkend="setlocale">current locale</link>. a UTF-8 encoded string. the length of the string, or -1 if the string is nul-terminated. location to store the number of bytes in the input string that were successfully converted, or %NULL. Even if the conversion was successful, this may be less than @len if there were partial characters at the end of the input. If the error #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value stored will the byte offset after the last valid input sequence. the number of bytes stored in the output buffer (not including the terminating nul). location to store the error occuring, or %NULL to ignore errors. Any of the errors in #GConvertError may occur. The converted string, or %NULL on an error. Gets the element at the given position in a #GList. a #GList the position of the element, counting from 0 the element, or %NULL if the position is off the end of the #GList Gets an unsigned 32-bit integer contained within the attribute. If the attribute does not contain an unsigned 32-bit integer, or is invalid, 0 will be returned. a #GFileInfo. a file attribute key. an unsigned 32-bit integer from the attribute. Gets the names of icons from within @icon. a #GThemedIcon. a list of icon names. Set the contents of a %G_TYPE_GTYPE #GValue to @v_gtype. Since: 2.12 a valid #GValue of type %G_TYPE_GTYPE #GType to be set Determines if @value will fit inside the size of a pointer value. This is an internal function introduced mainly for C marshallers. An initialized #GValue structure. %TRUE if @value will fit inside a pointer value. Check if @drive has any mountable volumes. a #GDrive. %TRUE if the @drive contains volumes, %FALSE otherwise. Gets a human-readable description of an installed application. a #GAppInfo. a string containing a description of the application @appinfo, or %NULL if none. A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, guint arg1, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs ignored 2 a #GValue array holding the instance and the #guint parameter the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Requests an asynchronous closes of the stream, releasing resources related to it. When the operation is finished @callback will be called. You can then call g_input_stream_close_finish() to get the result of the operation. For behaviour details see g_input_stream_close(). The asyncronous methods have a default fallback that uses threads to implement asynchronicity, so they are optional for inheriting classes. However, if you override one you must override all. A #GInputStream. the <link linkend="io-priority">I/O priority</link> of the request. optional cancellable object callback to call when the request is satisfied the data to pass to callback function Frees all of the memory used by a #GList. The freed elements are returned to the slice allocator. <note><para> If list elements contain dynamically-allocated memory, they should be freed first. </para></note> a #GList Converts a #gdouble to a string, using the '.' as decimal point. To format the number you pass in a printf()-style format string. Allowed conversion specifiers are 'e', 'E', 'f', 'F', 'g' and 'G'. If you just want to want to serialize the value into a string, use g_ascii_dtostr(). A buffer to place the resulting string in The length of the buffer. The printf()-style format to use for the code to use for converting. The #gdouble to convert The pointer to the buffer with the converted string. Emitted when the physical eject button (if any) of a drive have been pressed. a #GDrive. Sets @stream to have actions pending. If the pending flag is already set or @stream is closed, it will return %FALSE and set @error. input stream a #GError location to store the error occuring, or %NULL to ignore. %TRUE if pending was previously unset and is now set. Sets @title as the title of the bookmark for @uri inside the bookmark file @bookmark. If @uri is %NULL, the title of @bookmark is set. If a bookmark for @uri cannot be found then it is created. Since: 2.12 a #GBookmarkFile a valid URI or %NULL a UTF-8 encoded string Creates a new #GHashTable like g_hash_table_new() with a reference count of 1 and allows to specify functions to free the memory allocated for the key and value that get called when removing the entry from the #GHashTable. a function to create a hash value from a key. a function to check two keys for equality. a function to free the memory allocated for the key used when removing the entry from the #GHashTable or %NULL if you don't want to supply such a function. a function to free the memory allocated for the value used when removing the entry from the #GHashTable or %NULL if you don't want to supply such a function. a new #GHashTable. The buffering state can only be set if the channel's encoding is %NULL. For any other encoding, the channel must be buffered. A buffered channel can only be set unbuffered if the channel's internal buffers have been flushed. Newly created channels or channels which have returned %G_IO_STATUS_EOF not require such a flush. For write-only channels, a call to g_io_channel_flush () is sufficient. For all other channels, the buffers may be flushed by a call to g_io_channel_seek_position (). This includes the possibility of seeking with seek type %G_SEEK_CUR and an offset of zero. Note that this means that socket-based channels cannot be set unbuffered once they have had data read from them. On unbuffered channels, it is safe to mix read and write calls from the new and old APIs, if this is necessary for maintaining old code. The default state of the channel is buffered. a #GIOChannel whether to set the channel buffered or unbuffered Given a position @p with a UTF-8 encoded string @str, find the start of the previous UTF-8 character starting before @p. Returns %NULL if no UTF-8 characters are present in @str before @p. @p does not have to be at the beginning of a UTF-8 character. No check is made to see if the character found is actually valid other than it starts with an appropriate byte. pointer to the beginning of a UTF-8 encoded string pointer to some position within @str a pointer to the found character or %NULL. Moves the item pointed to by @src to the position indicated by @dest. After calling this function @dest will point to the position immediately after @src. It is allowed for @src and @dest to point into different sequences. Since: 2.14 a #GSequenceIter pointing to the item to move a #GSequenceIter pointing to the position to which the item is moved. Deletes a file. If the @file is a directory, it will only be deleted if it is empty. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL %TRUE if the file was deleted. %FALSE otherwise. This function is a variant of g_dgettext() which supports a disambiguating message context. GNU gettext uses the '\004' character to separate the message context and message id in @msgctxtid. If 0 is passed as @msgidoffset, this function will fall back to trying to use the deprecated convention of using "|" as a separation character. This uses g_dgettext() internally. See that functions for differences with dgettext() proper. Applications should normally not use this function directly, but use the C_() macro for translations with context. the translation domain to use, or %NULL to use the domain set with textdomain() a combined message context and message id, separated by a \004 character the offset of the message id in @msgctxid The translated string Since: 2.16 Sets the time the bookmark for @uri was added into @bookmark. If no bookmark for @uri is found then it is created. Since: 2.12 a #GBookmarkFile a valid URI a timestamp or -1 to use the current time Determines whether this thread holds the (recursive) ownership of this #GMaincontext. This is useful to know before waiting on another thread that may be blocking to get ownership of @context. a #GMainContext %TRUE if current thread is owner of @context. Since: 2.10 Finishes a stream write operation. a #GOutputStream. a #GAsyncResult. a #GError location to store the error occuring, or %NULL to ignore. a #gssize containing the number of bytes written to the stream. Creates a new empty #GMemoryInputStream. a new #GInputStream Sets the callback function storing the data as a refcounted callback "object". This is used internally. Note that calling g_source_set_callback_indirect() assumes an initial reference count on @callback_data, and thus @callback_funcs->unref will eventually be called once more than @callback_funcs->ref. the source pointer to callback data "object" functions for reference counting @callback_data and getting the callback and data Creates a new option context. The @parameter_string can serve multiple purposes. It can be used to add descriptions for "rest" arguments, which are not parsed by the #GOptionContext, typically something like "FILES" or "FILE1 FILE2...". If you are using #G_OPTION_REMAINING for collecting "rest" arguments, GLib handles this automatically by using the @arg_description of the corresponding #GOptionEntry in the usage summary. Another usage is to give a short summary of the program functionality, like " - frob the strings", which will be displayed in the same line as the usage. For a longer description of the program functionality that should be displayed as a paragraph below the usage line, use g_option_context_set_summary(). Note that the @parameter_string is translated using the function set with g_option_context_set_translate_func(), so it should normally be passed untranslated. a string which is displayed in the first line of <option>--help</option> output, after the usage summary <literal><replaceable>programname</replaceable> [OPTION...]</literal> a newly created #GOptionContext, which must be freed with g_option_context_free() after use. Since: 2.6 Reads an unsigned 8-bit/1-byte value from @stream. a given #GDataInputStream. optional #GCancellable object, %NULL to ignore. #GError for error reporting. an unsigned 8-bit/1-byte value read from the @stream or %0 if an error occurred. Request information for a number of files from the enumerator asynchronously. When all i/o for the operation is finished the @callback will be called with the requested information. The callback can be called with less than @num_files files in case of error or at the end of the enumerator. In case of a partial error the callback will be called with any succeeding items and no error, and on the next request the error will be reported. If a request is cancelled the callback will be called with %G_IO_ERROR_CANCELLED. During an async request no other sync and async calls are allowed, and will result in %G_IO_ERROR_PENDING errors. Any outstanding i/o request with higher priority (lower numerical value) will be executed before an outstanding request with lower priority. Default priority is %G_PRIORITY_DEFAULT. a #GFileEnumerator. the number of file info objects to request the <link linkend="gioscheduler">io priority</link> of the request. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied the data to pass to callback function Looks whether the key file has the group @group_name. a #GKeyFile a group name %TRUE if @group_name is a part of @key_file, %FALSE otherwise. Since: 2.6 Ensures that the contents of @value comply with the specifications set out by @pspec. For example, a #GParamSpecInt might require that integers stored in @value may not be smaller than -42 and not be greater than +42. If @value contains an integer outside of this range, it is modified accordingly, so the resulting value will fit into the range -42 .. +42. a valid #GParamSpec a #GValue of correct type for @pspec whether modifying @value was necessary to ensure validity Finds the first signal handler that matches certain selection criteria. The criteria mask is passed as an OR-ed combination of #GSignalMatchType flags, and the criteria values are passed as arguments. The match @mask has to be non-0 for successful matches. If no handler was found, 0 is returned. The instance owning the signal handler to be found. Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handler has to match. Signal the handler has to be connected to. Signal detail the handler has to be connected to. The closure the handler will invoke. The C closure callback of the handler (useless for non-C closures). The closure data of the handler's closure. A valid non-0 signal handler id for a successful match. Determines whether a character is alphanumeric. Given some UTF-8 text, obtain a character value with g_utf8_get_char(). a Unicode character %TRUE if @c is an alphanumeric character A wrapper for the POSIX utime() function. The utime() function sets the access and modification timestamps of a file. See your C library manual for more details about how utime() works on your system. a pathname in the GLib file name encoding (UTF-8 on Windows) a pointer to a struct utimbuf. 0 if the operation was successful, -1 if an error occurred Since: 2.18 Finishes remounting a mount. If any errors occurred during the operation, @error will be set to contain the errors and %FALSE will be returned. a #GMount. a #GAsyncResult. a #GError location to store the error occuring, or %NULL to ignore. %TRUE if the mount was successfully remounted. %FALSE otherwise. Private helper function to aid implementation of the G_TYPE_CHECK_INSTANCE() macro. @Returns: #TRUE if @instance is valid, #FALSE otherwise. A valid #GTypeInstance structure. Appends @len bytes of @val to @string. Because @len is provided, @val may contain embedded nuls and need not be nul-terminated. Since this function does not stop at nul bytes, it is the caller's responsibility to ensure that @val has at least @len addressable bytes. a #GString bytes to append number of bytes of @val to use @string Returns: %TRUE if a handler is connected to the signal, %FALSE the object whose signal handlers are sought. the signal id. the detail. whether blocked handlers should count as match. %TRUE if a handler is connected to the signal, %FALSE otherwise. Creates a new #GParamSpecEnum instance specifying a %G_TYPE_ENUM property. See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified a #GType derived from %G_TYPE_ENUM default value for the property specified flags for the property specified a newly created parameter specification Determines the byte ordering that is used when writing multi-byte entities (such as integers) to the stream. Set the contents of a %G_TYPE_LONG #GValue to @v_long. a valid #GValue of type %G_TYPE_LONG long integer value to be set A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, gdouble arg1, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs ignored 2 a #GValue array holding the instance and the #gdouble parameter the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Converts a string containing an ISO 8601 encoded date and time to a #GTimeVal and puts it into @time_. an ISO 8601 encoded date string a #GTimeVal %TRUE if the conversion was successful. Since: 2.12 Pushes the @data into the @queue. @data must not be %NULL. a #GAsyncQueue. @data to push into the @queue. Sets an opaque, named pointer on a #GParamSpec. The name is specified through a #GQuark (retrieved e.g. via g_quark_from_static_string()), and the pointer can be gotten back from the @pspec with g_param_spec_get_qdata(). Setting a previously set user data pointer, overrides (frees) the old pointer set, using %NULL as pointer essentially removes the data stored. the #GParamSpec to set store a user data pointer a #GQuark, naming the user data pointer an opaque user data pointer Formats a string according to @format and prefix it to an existing error message. If @err is %NULL (ie: no error variable) then do nothing. If *@err is %NULL (ie: an error variable is present but there is no error condition) then also do nothing. Whether or not it makes sense to take advantage of this feature is up to you. Since: 2.16 a return location for a #GError, or %NULL printf()-style format string arguments to @format Sets the operation result to a boolean within the asynchronous result. a #GSimpleAsyncResult. a #gboolean. Get the contents of a %G_TYPE_ENUM #GValue. a valid #GValue whose type is derived from %G_TYPE_ENUM enum contents of @value Determines if a character is a hexidecimal digit. a Unicode character. %TRUE if the character is a hexadecimal digit Frees all strings contained within the #GStringChunk. After calling g_string_chunk_clear() it is not safe to access any of the strings which were contained within it. Since: 2.14 a #GStringChunk Checks if the @drive has media. Note that the OS may not be polling the drive for media changes; see g_drive_is_media_check_automatic() for more details. a #GDrive. %TRUE if @drive has media, %FALSE otherwise. Adds the second #GList onto the end of the first #GList. Note that the elements of the second #GList are not copied. They are used directly. a #GList the #GList to add to the end of the first #GList the start of the new #GList Sets the operation result within the asynchronous result to the given @op_res. a #GSimpleAsyncResult. a #gssize. Finishes an asynchronous icon load started in g_loadable_icon_load_async(). a #GLoadableIcon. a #GAsyncResult. a location to store the type of the loaded icon, %NULL to ignore. a #GError location to store the error occuring, or %NULL to ignore. a #GInputStream to read the icon from. Checks if a file info structure has an attribute named @attribute. a #GFileInfo. a file attribute key. %TRUE if @Ginfo has an attribute named @attribute, %FALSE otherwise. Get a list of mountable volumes for @drive. The returned list should be freed with g_list_free(), after its elements have been unreffed with g_object_unref(). a #GDrive. #GList containing any #GVolume<!---->s on the given @drive. Decreases the reference count of the asynchronous @queue by 1. If the reference count went to 0, the @queue will be destroyed and the memory allocated will be freed. So you are not allowed to use the @queue afterwards, as it might have disappeared. You do not need to hold the lock to call this function. a #GAsyncQueue. Sets the name of the desktop that the application is running in. This is used by g_app_info_should_show() to evaluate the <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> desktop entry fields. The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop Menu specification</ulink> recognizes the following: <simplelist> <member>GNOME</member> <member>KDE</member> <member>ROX</member> <member>XFCE</member> <member>Old</member> </simplelist> Should be called only once; subsequent calls are ignored. a string specifying what desktop this is A wrapper for the POSIX stat() function. The stat() function Returns: 0 if the information was successfully retrieved, -1 if an error a pathname in the GLib file name encoding (UTF-8 on Windows) a pointer to a <structname>stat</structname> struct, which will be filled with the file information 0 if the information was successfully retrieved, -1 if an error occurred Since: 2.6 Creates a new #GCancellable object. Applications that want to start one or more operations that should be cancellable should create a #GCancellable and pass it to the operations. One #GCancellable can be used in multiple consecutive operations, but not in multiple concurrent operations. a #GCancellable. Makes a duplicate of a file attribute info list. a #GFileAttributeInfoList to duplicate. a copy of the given @list. Creates a new timeout source. The source will not initially be associated with any #GMainContext and must be added to one with g_source_attach() before it will be executed. The scheduling granularity/accuracy of this timeout source will be in seconds. the timeout interval in seconds the newly-created timeout source Since: 2.14 Gets the icon for @mount. a #GMount. a #GIcon. Emits the #GMountOperation::reply signal. a #GMountOperation a #GMountOperationResult Creates a new themed icon for @iconname, and all the names that can be created by shortening @iconname at '-' characters. In the following example, @icon1 and @icon2 are equivalent: |[ const char *names[] = { "gnome-dev-cdrom-audio", "gnome-dev-cdrom", "gnome-dev", "gnome" }; icon1 = g_themed_icon_new_from_names (names, 4); icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio"); ]| a string containing an icon name a new #GThemedIcon. Creates a directory. Note that this will only create a child directory of the immediate parent directory of the path or URI given by the #GFile. To recursively create directories, see g_file_make_directory_with_parents(). This function will fail if the parent directory does not exist, setting @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support creating directories, this function will fail, setting @error to %G_IO_ERROR_NOT_SUPPORTED. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL %TRUE on successful creation, %FALSE otherwise. Specifies a function to be called at normal program termination. Since GLib 2.8.2, on Windows g_atexit() actually is a preprocessor macro that maps to a call to the atexit() function in the C library. This means that in case the code that calls g_atexit(), i.e. atexit(), is in a DLL, the function will be called when the DLL is detached from the program. This typically makes more sense than that the function is called when the GLib DLL is detached, which happened earlier when g_atexit() was a function in the GLib DLL. The behaviour of atexit() in the context of dynamically loaded modules is not formally specified and varies wildly. On POSIX systems, calling g_atexit() (or atexit()) in a dynamically loaded module which is unloaded before the program terminates might well cause a crash at program exit. Some POSIX systems implement atexit() like Windows, and have each dynamically loaded module maintain an own atexit chain that is called when the module is unloaded. On other POSIX systems, before a dynamically loaded module is unloaded, the registered atexit functions (if any) residing in that module are called, regardless where the code that registered them resided. This is presumably the most robust approach. As can be seen from the above, for portability it's best to avoid calling g_atexit() (or atexit()) except in the main executable of a program. the function to call on normal program termination. Converts a #gdouble to a string, using the '.' as decimal point. This functions generates enough precision that converting the string back using g_ascii_strtod() gives the same machine-number (on machines with IEEE compatible 64bit doubles). It is guaranteed that the size of the resulting string will never be larger than @G_ASCII_DTOSTR_BUF_SIZE bytes. A buffer to place the resulting string in The length of the buffer. The #gdouble to convert The pointer to the buffer with the converted string. Reads data into @stream's buffer asynchronously, up to @count size. @io_priority can be used to prioritize reads. For the synchronous version of this function, see g_buffered_input_stream_fill(). #GBufferedInputStream. a #gssize. the <link linkend="io-priority">I/O priority</link> of the request. optional #GCancellable object a #GAsyncReadyCallback. a #gpointer. Hook up a new test case at @testpath, similar to g_test_add_func(). A fixture data structure with setup and teardown function may be provided though, similar to g_test_create_case(). g_test_add() is implemented as a macro, so that the fsetup(), ftest() and fteardown() callbacks can expect a @Fixture pointer as first argument in a type safe manner. Since: 2.16 The test path for a new test case. The type of a fixture data structure. Data argument for the test functions. The function to set up the fixture data. The actual test function. The function to tear down the fixture data. Disconnects all handlers on an instance that match a certain selection criteria. The criteria mask is passed as an OR-ed combination of #GSignalMatchType flags, and the criteria values are passed as arguments. Passing at least one of the %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC or %G_SIGNAL_MATCH_DATA match flags is required for successful matches. If no handlers were found, 0 is returned, the number of disconnected handlers otherwise. The instance to remove handlers from. Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handlers have to match. Signal the handlers have to be connected to. Signal detail the handlers have to be connected to. The closure the handlers will invoke. The C closure callback of the handlers (useless for non-C closures). The closure data of the handlers' closures. The number of handlers that matched. Fork the current test program to execute a test case that might not return or that might abort. The forked test case is aborted and considered failing if its run time exceeds @usec_timeout. The forking behavior can be configured with the #GTestTrapFlags flags. In the following example, the test code forks, the forked child process produces some sample output and exits successfully. The forking parent process then asserts successful child program termination and validates child program outputs. |[ static void test_fork_patterns (void) { if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR)) { g_print ("some stdout text: somagic17\n"); g_printerr ("some stderr text: semagic43\n"); exit (0); /* successful test run */ } g_test_trap_assert_passed(); g_test_trap_assert_stdout ("*somagic17*"); g_test_trap_assert_stderr ("*semagic43*"); } ]| This function is implemented only on Unix platforms. Timeout for the forked test in micro seconds. Flags to modify forking behaviour. %TRUE for the forked child and %FALSE for the executing parent process. Since: 2.16 Request an asynchronous write of @count bytes from @buffer into the stream. When the operation is finished @callback will be called. You can then call g_output_stream_write_finish() to get the result of the operation. During an async request no other sync and async calls are allowed, and will result in %G_IO_ERROR_PENDING errors. A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error. On success, the number of bytes written will be passed to the @callback. It is not an error if this is not the same as the requested size, as it can happen e.g. on a partial I/O error, but generally we try to write as many bytes as requested. Any outstanding I/O request with higher priority (lower numerical value) will be executed before an outstanding request with lower priority. Default priority is %G_PRIORITY_DEFAULT. The asyncronous methods have a default fallback that uses threads to implement asynchronicity, so they are optional for inheriting classes. However, if you override one you must override all. For the synchronous, blocking version of this function, see g_output_stream_write(). A #GOutputStream. the buffer containing the data to write. the number of bytes to write the io priority of the request. optional #GCancellable object, %NULL to ignore. callback to call when the request is satisfied the data to pass to callback function Finds a source with the given user data for the callback. If multiple sources exist with the same user data, the first one found will be returned. a #GMainContext the user_data for the callback. the source, if one was found, otherwise %NULL See g_spawn_async_with_pipes() for a full description; this function simply calls the g_spawn_async_with_pipes() without any pipes. You should call g_spawn_close_pid() on the returned child process reference when you don't need it any more. <note><para> If you are writing a GTK+ application, and the program you are spawning is a graphical application, too, then you may want to use gdk_spawn_on_screen() instead to ensure that the spawned program opens its windows on the right screen. </para></note> <note><para> Note that the returned @child_pid on Windows is a handle to the child process and not its identifier. Process handles and process identifiers are different concepts on Windows. </para></note> child's current working directory, or %NULL to inherit parent's child's argument vector child's environment, or %NULL to inherit parent's flags from #GSpawnFlags function to run in the child just before exec() user data for @child_setup return location for child process reference, or %NULL return location for error %TRUE on success, %FALSE if error is set Looks up the #GParamSpec for a property of a class. a #GObjectClass the name of the property to look up the #GParamSpec for the property, or %NULL if the class doesn't have a property of that name Appends a formatted string onto the end of a #GString. This function is similar to g_string_sprintf() except that the text is appended to the #GString. Deprecated: This function has been renamed to g_string_append_printf() a #GString the string format. See the sprintf() documentation the parameters to insert into the format string Increments the reference count on a closure to force it staying alive while the caller holds a pointer to it. #GClosure to increment the reference count on The @closure passed in, for convenience Sets the seed for the global random number generator, which is used by the <function>g_random_*</function> functions, to @seed. a value to reinitialize the global random number generator. Creates a new #GOptionGroup. the name for the option group, this is used to provide help for the options in this group with <option>--help-</option>@name a description for this group to be shown in <option>--help</option>. This string is translated using the translation domain or translation function of the group a description for the <option>--help-</option>@name option. This string is translated using the translation domain or translation function of the group user data that will be passed to the pre- and post-parse hooks, the error hook and to callbacks of %G_OPTION_ARG_CALLBACK options, or %NULL a function that will be called to free @user_data, or %NULL a newly created option group. It should be added to a #GOptionContext or freed with g_option_group_free(). Since: 2.6 Gets the domain of the mount operation. a #GMountOperation. a string set to the domain. Gets a display name for a file. a #GFileInfo. a string containing the display name. Return value: the maximal number of unused threads the maximal number of unused threads Compares the two #gint values being pointed to and returns %TRUE if they are equal. It can be passed to g_hash_table_new() as the @key_equal_func parameter, when using pointers to integers as keys in a #GHashTable. a pointer to a #gint key. a pointer to a #gint key to compare with @v1. %TRUE if the two keys match. a new #GVolumeMonitor. Emits a signal. Note that g_signal_emit() resets the return value to the default if no handlers are connected, in contrast to g_signal_emitv(). the instance the signal is being emitted on. the signal id the detail parameters to be passed to the signal, followed by a location for the return value. If the return type of the signal is #G_TYPE_NONE, the return value location can be omitted. Gets the drive for the @mount. This is a convenience method for getting the #GVolume and then using that object to get the #GDrive. a #GMount. a #GDrive or %NULL if @mount is not associated with a volume or a drive. Sorts @queue using @func. This function will lock @queue before it sorts the queue and unlock it when it is finished. If you were sorting a list of priority numbers to make sure the lowest priority would be at the top of the queue, you could use: |[ gint32 id1; gint32 id2; id1 = GPOINTER_TO_INT (element1); id2 = GPOINTER_TO_INT (element2); return (id1 > id2 ? +1 : id1 == id2 ? 0 : -1); ]| Since: 2.10 a #GAsyncQueue the #GCompareDataFunc is used to sort @queue. This function is passed two elements of the @queue. The function should return 0 if they are equal, a negative value if the first element should be higher in the @queue or a positive value if the first element should be lower in the @queue than the second element. user data passed to @func Returns: %TRUE if @file_name is an absolute path. a file name. %TRUE if @file_name is an absolute path. Prepends @len bytes of @val to @string. Because @len is provided, @val may contain embedded nuls and need not be nul-terminated. Since this function does not stop at nul bytes, it is the caller's responsibility to ensure that @val has at least @len addressable bytes. a #GString bytes to prepend number of bytes in @val to prepend @string Overwrites part of a string, lengthening it if necessary. This function will work with embedded nuls. a #GString the position at which to start overwriting the string that will overwrite the @string starting at @pos the number of bytes to write from @val @string Since: 2.14 File Descriptor. #GFileInputStream for the given file descriptor. Checks to see if the main loop is currently being run via g_main_loop_run(). a #GMainLoop. %TRUE if the mainloop is currently being run. Creates a new #GString, initialized with the given string. the initial text to copy into the string the new #GString Removes a source from the default main loop context given the user data for the callback. If multiple sources exist with the same user data, only one will be destroyed. the user_data for the callback. %TRUE if a source was found and removed. Checks equality of two given #GFile<!-- -->s. Note that two #GFile<!-- -->s that differ can still refer to the same file on the filesystem due to various forms of filename aliasing. This call does no blocking i/o. the first #GFile. the second #GFile. %TRUE if @file1 and @file2 are equal. %FALSE if either is not a #GFile. Asynchronously sets the attributes of @file with @info. For more details, see g_file_set_attributes_from_info() which is the synchronous version of this call. When the operation is finished, @callback will be called. You can then call g_file_set_attributes_finish() to get the result of the operation. input #GFile. a #GFileInfo. a #GFileQueryInfoFlags. the <link linkend="io-priority">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback. a #gpointer. Returns: %TRUE if automatic help generation is turned on. a #GOptionContext %TRUE if automatic help generation is turned on. Since: 2.6 a #GVolumeMonitor. a #GUnixMountPoint. a #GUnixVolume for the given #GUnixMountPoint. Removes @key in @group_name from the key file. a #GKeyFile a group name a key name to remove return location for a #GError or %NULL %TRUE if the key was removed, %FALSE otherwise Since: 2.6 Gets a child of @file with basename equal to @name. Note that the file with that specific name might not exist, but you can still have a #GFile that points to it. You can use this for instance to create that file. This call does no blocking i/o. input #GFile. string containing the child's basename. a #GFile to a child specified by @name. Requests an asynchronous close of the stream, releasing resources related to it. When the operation is finished @callback will be called. You can then call g_output_stream_close_finish() to get the result of the operation. For behaviour details see g_output_stream_close(). The asyncronous methods have a default fallback that uses threads to implement asynchronicity, so they are optional for inheriting classes. However, if you override one you must override all. A #GOutputStream. the io priority of the request. callback to call when the request is satisfied the data to pass to callback function optional cancellable object Creates a new empty #GBookmarkFile object. Use g_bookmark_file_load_from_file(), g_bookmark_file_load_from_data() or g_bookmark_file_load_from_data_dirs() to read an existing bookmark file. an empty #GBookmarkFile Since: 2.12 Reads an unsigned 64-bit/8-byte value from @stream. In order to get the correct byte order for this read operation, see g_data_stream_get_byte_order(). If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. a given #GDataInputStream. optional #GCancellable object, %NULL to ignore. #GError for error reporting. an unsigned 64-bit/8-byte read from @stream or %0 if an error occurred. Removes and returns the link at the given position. a #GQueue the link's position The @n'th link, or %NULL if @n is off the end of @queue. Since: 2.4 Guesses the content type based on example data. If the function is uncertain, @result_uncertain will be set to %TRUE. a string. a stream of data. the size of @data. a flag indicating the certainty of the result. a string indicating a guessed content type for the given data. Pops data from the @queue. This function blocks until data become available. a #GAsyncQueue. data from the queue. Copies a nul-terminated string into the dest buffer, include the trailing nul, and return a pointer to the trailing nul byte. This is useful for concatenating multiple strings together without having to repeatedly scan for the end. destination buffer. source string. a pointer to trailing nul byte. Inserts a byte into a #GString, expanding it if necessary. a #GString the position to insert the byte the byte to insert @string Obtain the list of attribute namespaces where new attributes can be created by a user. An example of this is extended attributes (in the "xattr" namespace). If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL a #GFileAttributeInfoList describing the writable namespaces. When you are done with it, release it with g_file_attribute_info_list_unref() Return value: the number of unprocessed tasks a #GThreadPool the number of unprocessed tasks Sets @description as the description of the bookmark for @uri. If @uri is %NULL, the description of @bookmark is set. If a bookmark for @uri cannot be found then it is created. Since: 2.12 a #GBookmarkFile a valid URI or %NULL a string Connects a closure to a signal for a particular object. the instance to connect to. a string of the form "signal-name::detail". the closure to connect. whether the handler should be called before or after the default handler of the signal. the handler id Sets a function to be called at regular intervals, with @priority. The function is called repeatedly until it returns %FALSE, at which point the timeout is automatically destroyed and the function will not be called again. Unlike g_timeout_add(), this function operates at whole second granularity. The initial starting point of the timer is determined by the implementation and the implementation is expected to group multiple timers together so that they fire all at the same time. To allow this grouping, the @interval to the first timer is rounded and can deviate up to one second from the specified interval. Subsequent timer iterations will generally run at the specified interval. Note that timeout functions may be delayed, due to the processing of other event sources. Thus they should not be relied on for precise timing. After each call to the timeout function, the time of the next timeout is recalculated based on the current time and the given @interval If you want timing more precise than whole seconds, use g_timeout_add() instead. The grouping of timers to fire at the same time results in a more power and CPU efficient behavior so if your timer is in multiples of seconds and you don't require the first timer exactly one second from now, the use of g_timeout_add_seconds() is preferred over g_timeout_add(). the priority of the timeout source. Typically this will be in the range between #G_PRIORITY_DEFAULT and #G_PRIORITY_HIGH. the time between calls to the function, in seconds function to call data to pass to @function function to call when the timeout is removed, or %NULL the ID (greater than 0) of the event source. Since: 2.14 Inserts a copy of a string into a #GString, expanding it if necessary. a #GString the position to insert the copy of the string the string to insert @string Pops data from the @queue. This function blocks until data become available. This function must be called while holding the @queue's lock. a #GAsyncQueue. data from the queue. Remove the value at position @index_ from @value_array. #GValueArray to remove an element from position of value to remove, must be < value_array->n_values the #GValueArray passed in as @value_array This function essentially limits the life time of the @closure to the life time of the object. That is, when the object is finalized, the @closure is invalidated by calling g_closure_invalidate() on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, g_object_ref() and g_object_unref() are added as marshal guards to the @closure, to ensure that an extra reference count is held on @object during invocation of the @closure. Usually, this function will be called on closures that use this @object as closure data. GObject restricting lifetime of @closure GClosure to watch Return value: Whether the channel will be closed on the final unref of a #GIOChannel. Whether the channel will be closed on the final unref of the GIOChannel data structure. Returns: %TRUE if monitor is canceled. %FALSE otherwise. a #GFileMonitor %TRUE if monitor is canceled. %FALSE otherwise. Get the contents of a %G_TYPE_GTYPE #GValue. Since: 2.12 a valid #GValue of type %G_TYPE_GTYPE the #GType stored in @value Gets the scheme portion of a URI string. RFC 3986 decodes the scheme as: <programlisting> URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] </programlisting> Common schemes include "file", "http", "svn+ssh", etc. a valid URI. The "Scheme" component of the URI, or %NULL on error. The returned string should be freed when no longer needed. Since: 2.16 Classifies a Unicode character by type. a Unicode character the type of the character. Tries to set all attributes in the #GFileInfo on the target values, not stopping on the first error. If there is any error during this operation then @error will be set to the first error. Error on particular fields are flagged by setting the "status" field in the attribute value to %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can also detect further errors. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. a #GFileInfo. #GFileQueryInfoFlags optional #GCancellable object, %NULL to ignore. a #GError, or %NULL %TRUE if there was any error, %FALSE otherwise. Returns: #GRegex object used in @match_info a #GMatchInfo #GRegex object used in @match_info Since: 2.14 Get the contents of a %G_TYPE_BOXED derived #GValue. a valid #GValue of %G_TYPE_BOXED derived type boxed contents of @value Asynchronously creates a new file and returns an output stream for writing to it. The file must not already exist. For more details, see g_file_create() which is the synchronous version of this call. When the operation is finished, @callback will be called. You can then call g_file_create_finish() to get the result of the operation. input #GFile. a set of #GFileCreateFlags. the <link linkend="io-priority">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied the data to pass to callback function Finishes an asynchronous stream splice operation. a #GOutputStream. a #GAsyncResult. a #GError location to store the error occuring, or %NULL to ignore. a #gssize of the number of bytes spliced. Gets the path for @descendant relative to @parent. This call does no blocking i/o. input #GFile. input #GFile. 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. 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. a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename> %TRUE if @mount_path is considered an implementation detail of the OS. Calls the given function for each key/value pair in the #GHashTable. If the function returns %TRUE, then the key/value pair is removed from the #GHashTable. If you supplied key or value destroy functions when creating the #GHashTable, they are used to free the memory allocated for the removed keys and values. See #GHashTableIterator for an alternative way to loop over the key/value pairs in the hash table. a #GHashTable. the function to call for each key/value pair. user data to pass to the function. the number of key/value pairs removed. Finishes an asynchronous eject operation started by g_file_eject_mountable(). input #GFile. a #GAsyncResult. a #GError, or %NULL %TRUE if the @file was ejected successfully. %FALSE otherwise. Get the toplevel test suite for the test path API. the toplevel #GTestSuite Since: 2.16 Checks if an ouput stream has pending actions. a #GOutputStream. %TRUE if @stream has pending actions. Finishes mounting a volume. pointer to a #GVolume. a #GAsyncResult. a #GError. %TRUE, %FALSE if operation failed. Adds a byte onto the end of a #GString, expanding it if necessary. a #GString the byte to append onto the end of @string @string Associates a list of integer values with @key under @group_name. If @key cannot be found then it is created. Since: 2.6 a #GKeyFile a group name a key an array of integer values number of integer values in @list Checks to see if a file is native to the platform. A native file s one expressed in the platform-native filename format, e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local, as it might be on a locally mounted remote filesystem. On some systems non-native files may be available using the native filesystem via a userspace filesystem (FUSE), in these cases this call will return %FALSE, but g_file_get_path() will still return a native path. This call does no blocking i/o. input #GFile. %TRUE if file is native. Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value. If @attribute is of a different type, this operation will fail. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. a string containing the attribute's name. a #guint64 containing the attribute's new value. a #GFileQueryInfoFlags. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise. Finishes flushing an output stream. a #GOutputStream. a GAsyncResult. a #GError location to store the error occuring, or %NULL to ignore. %TRUE if flush operation suceeded, %FALSE otherwise. Gets the icon for @volume. a #GVolume. a #GIcon. Checks if the unix mounts have changed since a given unix time. guint64 to contain a timestamp. %TRUE if the mounts have changed since @time. Gets a signed 64-bit integer contained within the attribute. If the attribute does not contain an signed 64-bit integer, or is invalid, 0 will be returned. a #GFileInfo. a file attribute key. a signed 64-bit integer from the attribute. Gets the name under which @extension was registered. Note that the same type may be registered as extension for multiple extension points, under different names. a #GIOExtension the name of @extension. Return value: A random number. a #GRand. lower closed bound of the interval. upper open bound of the interval. A random number. Insert a copy of @value at specified position into @value_array. #GValueArray to add an element to insertion position, must be <= value_array->n_values #GValue to copy into #GValueArray the #GValueArray passed in as @value_array Gets the "current time" to be used when checking this source. The advantage of calling this function over calling g_get_current_time() directly is that when checking multiple sources, GLib can cache a single value instead of having to repeatedly get the system time. a #GSource #GTimeVal structure in which to store current time. Pushes the @data into the @queue. @data must not be %NULL. This function must be called while holding the @queue's lock. a #GAsyncQueue. @data to push into the @queue. Prior to any use of the type system, g_type_init() has to be called to initialize the type system and assorted other code portions (such as the various fundamental type implementations or the signal system). Finds the element in a #GSList which contains the given data. a #GSList the element data to find the found #GSList element, or %NULL if it is not found Creates a path from a series of elements using @separator as the separator between elements. At the boundary between two elements, any trailing occurrences of separator in the first element, or leading occurrences of separator in the second element are removed and exactly one copy of the separator is inserted. Empty elements are ignored. The number of leading copies of the separator on the result is the same as the number of leading copies of the separator on the first non-empty element. The number of trailing copies of the separator on the result is the same as the number of trailing copies of the separator on the last non-empty element. (Determination of the number of trailing copies is done without stripping leading copies, so if the separator is <literal>ABA</literal>, <literal>ABABA</literal> has 1 trailing copy.) However, if there is only a single non-empty element, and there are no characters in that element not part of the leading or trailing separators, then the result is exactly the original value of that element. Other than for determination of the number of leading and trailing copies of the separator, elements consisting only of copies of the separator are ignored. a string used to separator the elements of the path. the first element in the path remaining elements in path, terminated by %NULL a newly-allocated string that must be freed with g_free(). Reports an error in an asynchronous function in an idle function by directly setting the contents of the #GAsyncResult with the given error information. a #GObject. 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. Registers @name as the name of a new static type derived from #G_TYPE_PARAM. The type system uses the information contained in the #GParamSpecTypeInfo structure pointed to by @info to manage the #GParamSpec type and its instances. 0-terminated string used as the name of the new #GParamSpec type. The #GParamSpecTypeInfo for this #GParamSpec type. The new type identifier. Retrieves the MIME type of the resource pointed by @uri. In the event the URI cannot be found, %NULL is returned and @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the event that the MIME type cannot be found, %NULL is returned and @error is set to #G_BOOKMARK_FILE_ERROR_INVALID_VALUE. a #GBookmarkFile a valid URI return location for a #GError, or %NULL a newly allocated string or %NULL if the specified URI cannot be found. Since: 2.12 Gets a #GFile for @uri. This operation never fails, but the returned object might not support any I/O operation if the uri is malformed or if the uri type is not supported. a#GVfs. a string containing a URI path. a #GFile. Sets the priority of a source. While the main loop is being run, a source will be dispatched if it is ready to be dispatched and no sources at a higher (numerically smaller) priority are ready to be dispatched. a #GSource the new priority. Gets the digest from @checksum as a raw binary vector and places it into @buffer. The size of the digest depends on the type of checksum. Once this function has been called, the #GChecksum is closed and can no longer be updated with g_checksum_update(). Since: 2.16 a #GChecksum output buffer an inout parameter. The caller initializes it to the size of @buffer. After the call it contains the length of the digest. Unmounts a file of type G_FILE_TYPE_MOUNTABLE. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. When the operation is finished, @callback will be called. You can then call g_file_unmount_mountable_finish() to get the result of the operation. input #GFile. flags affecting the operation optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied, or %NULL. the data to pass to callback function Calls @func for each item in the sequence passing @user_data to the function. Since: 2.14 a #GSequence the function to call for each item in @seq user data passed to @func Removes all keys and their associated values from a #GHashTable without calling the key and value destroy functions. Since: 2.12 a #GHashTable. Creates a new #GHashTable with a reference count of 1. a function to create a hash value from a key. Hash values are used to determine where keys are stored within the #GHashTable data structure. The g_direct_hash(), g_int_hash() and g_str_hash() functions are provided for some common types of keys. If hash_func is %NULL, g_direct_hash() is used. a function to check two keys for equality. This is used when looking up keys in the #GHashTable. The g_direct_equal(), g_int_equal() and g_str_equal() functions are provided for the most common types of keys. If @key_equal_func is %NULL, keys are compared directly in a similar fashion to g_direct_equal(), but without the overhead of a function call. a new #GHashTable. Gets the number of nodes in a #GTree. a #GTree. the number of nodes in the #GTree. Checks if an input stream has pending actions. input stream. %TRUE if @stream has pending actions. A convenience function to use gettext() for translating user-visible strings. Since: 2.12 a #GOptionContext the domain to use Gets the value of a byte string attribute. If the attribute does not contain a byte string, %NULL will be returned. a #GFileInfo. a file attribute key. the contents of the @attribute value as a byte string, or %NULL otherwise. Increases the reference count of the object by one and sets a callback to be called when all other references to the object are dropped, or when this is already the last reference to the object and another reference is established. This functionality is intended for binding @object to a proxy object managed by another memory manager. This is done with two paired references: the strong reference added by g_object_add_toggle_ref() and a reverse reference to the proxy object which is either a strong reference or weak reference. The setup is that when there are no other references to @object, only a weak reference is held in the reverse direction from @object to the proxy object, but when there are other references held to @object, a strong reference is held. The @notify callback is called when the reference from @object to the proxy object should be <firstterm>toggled</firstterm> from strong to weak (@is_last_ref true) or weak to strong (@is_last_ref false). Since a (normal) reference must be held to the object before calling g_object_toggle_ref(), the initial state of the reverse link is always strong. Multiple toggle references may be added to the same gobject, however if there are multiple toggle references to an object, none of them will ever be notified until all but one are removed. For this reason, you should only ever use a toggle reference if there is important state in the proxy object. Since: 2.8 a #GObject a function to call when this reference is the last reference to the object, or is no longer the last reference. data to pass to @notify Undoes the effect of a previous g_signal_handler_block() call. A blocked handler is skipped during signal emissions and will not be invoked, unblocking it (for exactly the amount of times it has been blocked before) reverts its "blocked" state, so the handler will be recognized by the signal system and is called upon future or currently ongoing signal emissions (since the order in which handlers are called during signal emissions is deterministic, whether the unblocked handler in question is called as part of a currently ongoing emission depends on how far that emission has proceeded yet). The @handler_id has to be a valid id of a signal handler that is connected to a signal of @instance and is currently blocked. The instance to unblock the signal handler of. Handler id of the handler to be unblocked. A wrapper for the POSIX rename() function. The rename() function renames a file, moving it between directories if required. See your C library manual for more details about how rename() works on your system. It is not possible in general on Windows to rename a file that is open to some process. a pathname in the GLib file name encoding (UTF-8 on Windows) a pathname in the GLib file name encoding 0 if the renaming succeeded, -1 if an error occurred Since: 2.6 Gets the buffer size. a #GIOChannel the size of the buffer. Creates a new #GParamSpecFloat instance specifying a %G_TYPE_FLOAT property. See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified minimum value for the property specified maximum value for the property specified default value for the property specified flags for the property specified a newly created parameter specification Determines the numeric value of a character as a decimal digit. a Unicode character If @c is a decimal digit (according to g_unichar_isdigit()), its numeric value. Otherwise, -1. Removes application registered with @name from the list of applications that have registered a bookmark for @uri inside @bookmark. In the event the URI cannot be found, %FALSE is returned and @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the event that no application with name @app_name has registered a bookmark for @uri, %FALSE is returned and error is set to #G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED. a #GBookmarkFile a valid URI the name of the application return location for a #GError or %NULL %TRUE if the application was successfully removed. Since: 2.12 Get the contents of a %G_TYPE_INT64 #GValue. a valid #GValue of type %G_TYPE_INT64 64bit integer contents of @value Sets a #GOptionGroup as main group of the @context. This has the same effect as calling g_option_context_add_group(), the only difference is that the options in the main group are treated differently when generating <option>--help</option> output. Since: 2.6 a #GOptionContext the group to set as main group Return value: the number of currently unused threads the number of currently unused threads Cuts off the end of the GString, leaving the first @len bytes. a #GString the new size of @string @string Sets whether or not the @stream's buffer should automatically grow. If @auto_grow is true, then each write will just make the buffer larger, and you must manually flush the buffer to actually write out the data to the underlying stream. a #GBufferedOutputStream. a #gboolean. Gets the size of the currently allocated data area (availible from g_memory_output_stream_get_data()). If the stream isn't growable (no realloc was passed to g_memory_output_stream_new()) then this is the max size of the stream and further writes will return G_IO_ERROR_NO_SPACE. Note that for growable streams the returned size may become invalid on the next write or truncate operation on the stream. If you want the number of bytes currently written to the stream, use g_memory_output_stream_get_data_size(). a #GMemoryOutputStream the number of bytes allocated for the data buffer Internal function for gtester to decode test log messages, no ABI guarantees provided. Internal function for gtester to decode test log messages, no ABI guarantees provided. Determines whether a character is a control character. Given some UTF-8 text, obtain a character value with g_utf8_get_char(). a Unicode character %TRUE if @c is a control character Maps a file into memory. On UNIX, this is using the mmap() function. If @writable is %TRUE, the mapped buffer may be modified, otherwise it is an error to modify the mapped buffer. Modifications to the buffer are not visible to other processes mapping the same file, and are not written back to the file. Note that modifications of the underlying file might affect the contents of the #GMappedFile. Therefore, mapping should only be used if the file will not be modified, or if all modifications of the file are done atomically (e.g. using g_file_set_contents()). The path of the file to load, in the GLib filename encoding whether the mapping should be writable return location for a #GError, or %NULL a newly allocated #GMappedFile which must be freed with g_mapped_file_free(), or %NULL if the mapping failed. Since: 2.8 Gets the device path for a unix mount point. a #GUnixMountPoint. a string containing the device path. Sets the callback function for a source. The callback for a source is called from the source's dispatch function. The exact type of @func depends on the type of source; ie. you should not count on @func being called with @data as its first parameter. Typically, you won't use this function. Instead use functions specific to the type of source you are using. the source a callback function the data to pass to callback function a function to call when @data is no longer in use, or %NULL. Like g_sequence_sort(), but uses a #GSequenceIterCompareFunc instead of a GCompareDataFunc as the compare function Since: 2.14 a #GSequence the #GSequenceItercompare used to compare iterators in the sequence. It is called with two iterators pointing into @seq. It should return 0 if the iterators are equal, a negative value if the first iterator comes before the second, and a positive value if the second iterator comes before the first. user data passed to @cmp_func Gets the executable's name for the installed application. a #GAppInfo. a string containing the @appinfo's application binary's name. Return value: a string owned by GLib that must not be modified a string owned by GLib that must not be modified or freed. Since: 2.6 Acquires the @queue's lock. After that you can only call the <function>g_async_queue_*_unlocked()</function> function variants on that @queue. Otherwise it will deadlock. a #GAsyncQueue. Converts all Unicode characters in the string that have a case to uppercase. The exact manner that this is done depends on the current locale, and may result in the number of characters in the string increasing. (For instance, the German ess-zet will be changed to SS.) a UTF-8 encoded string length of @str, in bytes, or -1 if @str is nul-terminated. a newly allocated string, with all characters converted to uppercase. Sets whether a source can be called recursively. If @can_recurse is %TRUE, then while the source is being dispatched then this source will be processed normally. Otherwise, all processing of this source is blocked until the dispatch function returns. a #GSource whether recursion is allowed for this source Finishes an asynchronous load of the @file's contents. The contents are placed in @contents, and @length is set to the size of the @contents string. If @etag_out is present, it will be set to the new entity tag for the @file. input #GFile. a #GAsyncResult. a location to place the contents of the file. a location to place the length of the contents of the file. a location to place the current entity tag for the file. a #GError, or %NULL %TRUE if the load was successful. If %FALSE and @error is present, it will be set appropriately. Return the direct parent type of the passed in type. If the passed in type has no parent, i.e. is a fundamental type, 0 is returned. The derived type. The parent type. Open a file @filename as a #GIOChannel using mode @mode. This channel will be closed when the last reference to it is dropped, so there is no need to call g_io_channel_close() (though doing so will not cause problems, as long as no attempt is made to access the channel after it is closed). A string containing the name of a file One of "r", "w", "a", "r+", "w+", "a+". These have the same meaning as in fopen() A location to return an error of type %G_FILE_ERROR A #GIOChannel on success, %NULL on failure. Inserts @data into @queue before @sibling. @sibling must be part of @queue. Since: 2.4 a #GQueue a #GList link that <emphasis>must</emphasis> be part of @queue the data to insert Frees the memory allocated for @seq. If @seq has a data destroy function associated with it, that function is called on all items in @seq. Since: 2.14 a #GSequence Creates a new #GParamSpecFlags instance specifying a %G_TYPE_FLAGS property. See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified a #GType derived from %G_TYPE_FLAGS default value for the property specified flags for the property specified a newly created parameter specification Finishes closing a stream asynchronously, started from g_input_stream_close_async(). a #GInputStream. a #GAsyncResult. a #GError location to store the error occuring, or %NULL to ignore. %TRUE if the stream was closed successfully. Turns off flag values for a data list. See g_datalist_unset_flags() Since: 2.8 pointer to the location that holds a list the flags to turn off. The values of the flags are restricted by %G_DATALIST_FLAGS_MASK (currently 3: giving two possible boolean flags). A value for @flags that doesn't fit within the mask is an error. Converts a string into a collation key that can be compared with other collation keys produced by the same function using strcmp(). In order to sort filenames correctly, this function treats the dot '.' as a special case. Most dictionary orderings seem to consider it insignificant, thus producing the ordering "event.c" "eventgenerator.c" "event.h" instead of "event.c" "event.h" "eventgenerator.c". Also, we would like to treat numbers intelligently so that "file1" "file10" "file5" is sorted as "file1" "file5" "file10". Note that this function depends on the <link linkend="setlocale">current locale</link>. a UTF-8 encoded string. length of @str, in bytes, or -1 if @str is nul-terminated. a newly allocated string. This string should be freed with g_free() when you are done with it. Since: 2.8 Feeds @data into an existing #GChecksum. The checksum must still be open, that is g_checksum_get_string() or g_checksum_get_digest() must not have been called on @checksum. Since: 2.16 a #GChecksum buffer used to compute the checksum size of the buffer, or -1 if it is a null-terminated string. Get the short description of a #GParamSpec. a valid #GParamSpec the short description of @pspec. Removes all list nodes with data equal to @data. Returns: new head of @list a #GSList data to remove new head of @list Removes @link_ from @queue and frees it. @link_ must be part of @queue. Since: 2.4 a #GQueue a #GList link that <emphasis>must</emphasis> be part of @queue Calls a function for each element of a #GList. a #GList the function to call with each element's data user data to pass to the function Gets the position of the first child of a #GNode which contains the given data. a #GNode the data to find the index of the child of @node which contains @data, or -1 if the data is not found Finishes an asynchronous file append operation started with g_file_append_to_async(). input #GFile. #GAsyncResult a #GError, or %NULL a valid #GFileOutputStream or %NULL on error. Looks whether the string @str ends with @suffix. a nul-terminated string. the nul-terminated suffix to look for. %TRUE if @str end with @suffix, %FALSE otherwise. Since: 2.2 Sets the @attribute to contain the given @attr_value, if possible. a #GFileInfo. a file attribute key. a #GObject. Determines whether a character is a lowercase letter. Given some UTF-8 text, obtain a character value with g_utf8_get_char(). a Unicode character %TRUE if @c is a lowercase letter Creates a new mount operation. a #GMountOperation. Loads all the modules in the specified directory. pathname for a directory containing modules to load. 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(). Creates a new #GParamSpecPool. If @type_prefixing is %TRUE, lookups in the newly created pool will allow to specify the owner as a colon-separated prefix of the property name, like "GtkContainer:border-width". This feature is deprecated, so you should always set @type_prefixing to %FALSE. Whether the pool will support type-prefixed property names. a newly allocated #GParamSpecPool. Inserts @data into @sequence using @func to determine the new position. The sequence must already be sorted according to @cmp_func; otherwise the new position of @data is undefined. a #GSequence the data to insert the #GCompareDataFunc used to compare items in the sequence. It is called with two items of the @seq and @user_data. It should return 0 if the items are equal, a negative value if the first item comes before the second, and a positive value if the second item comes before the first. user data passed to @cmp_func. a #GSequenceIter pointing to the new item. Since: 2.14 This is an internal function introduced mainly for C marshallers. Deprecated: 2.4: Use g_value_take_boxed() instead. a valid #GValue of %G_TYPE_BOXED derived type duplicated unowned boxed value to be set Return value: a #GSequenceIter pointing to the next position after @iter. a #GSequenceIter a #GSequenceIter pointing to the next position after @iter. Since: 2.14 Returns: Location of the #GTypeValueTable associated with @type or A #GType value. Location of the #GTypeValueTable associated with @type or %NULL if there is no #GTypeValueTable associated with @type. Removes a reference added with g_object_add_toggle_ref(). The reference count of the object is decreased by one. Since: 2.8 a #GObject a function to call when this reference is the last reference to the object, or is no longer the last reference. data to pass to @notify Return a newly allocated string, which describes the contents of a #GValue. The main purpose of this function is to describe #GValue contents for debugging output, the way in which the contents are described may change between different GLib versions. #GValue which contents are to be described. Newly allocated string. Parses the command line arguments, recognizing options which have been added to @context. A side-effect of calling this function is that g_set_prgname() will be called. If the parsing is successful, any parsed arguments are removed from the array and @argc and @argv are updated accordingly. A '--' option is stripped from @argv unless there are unparsed options before and after it, or some of the options after it start with '-'. In case of an error, @argc and @argv are left unmodified. If automatic <option>--help</option> support is enabled (see g_option_context_set_help_enabled()), and the @argv array contains one of the recognized help options, this function will produce help output to stdout and call <literal>exit (0)</literal>. Note that function depends on the <link linkend="setlocale">current locale</link> for automatic character set conversion of string and filename arguments. a #GOptionContext a pointer to the number of command line arguments a pointer to the array of command line arguments a return location for errors %TRUE if the parsing was successful, %FALSE if an error occurred Since: 2.6 Gets the ID of an application. An id is a string that identifies the application. The exact format of the id is platform dependent. For instance, on Unix this is the desktop file id from the xdg menu specification. Note that the returned ID may be %NULL, depending on how the @appinfo has been constructed. a #GAppInfo. a string containing the application's ID. The index of the user's choice when a question is asked during the mount operation. See the #GMountOperation::ask-question signal. Set the contents of a %G_TYPE_UINT64 #GValue to @v_uint64. a valid #GValue of type %G_TYPE_UINT64 unsigned 64bit integer value to be set Return value: an #GSequenceIter pointing to the position where @data a #GSequence data for the new item the #GCompareDataFunc used to compare items in the sequence. It is called with two items of the @seq and @user_data. It should return 0 if the items are equal, a negative value if the first item comes before the second, and a positive value if the second item comes before the first. user data passed to @cmp_func. an #GSequenceIter pointing to the position where @data would have been inserted according to @cmp_func and @cmp_data. Since: 2.14 A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs ignored 3 a #GValue array holding instance, arg1 and arg2 the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Decrements the reference count of the class structure being passed in. Once the last reference count of a class has been released, classes may be finalized by the type system, so further dereferencing of a class pointer after g_type_class_unref() are invalid. The #GTypeClass structure to unreference. Set the contents of a %G_TYPE_INT #GValue to @v_int. a valid #GValue of type %G_TYPE_INT integer value to be set Puts a signed 64-bit integer into the stream. a #GDataOutputStream. a #gint64. optional #GCancellable object, %NULL to ignore. a #GError, %NULL to ignore. %TRUE if @data was successfully added to the @stream. Retrieves the number of matched substrings (including substring 0, that is the whole matched text), so 1 is returned if the pattern has no substrings in it and 0 is returned if the match failed. If the last match was obtained using the DFA algorithm, that is using g_regex_match_all() or g_regex_match_all_full(), the retrieved count is not that of the number of capturing parentheses but that of the number of matched substrings. a #GMatchInfo structure Number of matched substrings, or -1 if an error occurred Since: 2.14 Closes the stream, releasing resources related to it. Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED. Closing a stream multiple times will not return an error. Closing a stream will automatically flush any outstanding buffers in the stream. Streams will be automatically closed when the last reference is dropped, but you might want to call this function to make sure resources are released as early as possible. Some streams might keep the backing store of the stream (e.g. a file descriptor) open after the stream is closed. See the documentation for the individual stream for details. On failure the first error that happened will be reported, but the close operation will finish as much as possible. A stream that failed to close will still return %G_IO_ERROR_CLOSED for all operations. Still, it is important to check and report the error to the user, otherwise there might be a loss of data as all data might not be written. If @cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. Cancelling a close will still leave the stream closed, but there some streams can use a faster close that doesn't block to e.g. check errors. On cancellation (as with any error) there is no guarantee that all written data will reach the target. A #GOutputStream. optional cancellable object location to store the error occuring, or %NULL to ignore %TRUE on success, %FALSE on failure Usually if the string passed to g_regex_match*() matches as far as it goes, but is too short to match the entire pattern, %FALSE is returned. There are circumstances where it might be helpful to distinguish this case from other cases in which there is no match. Consider, for example, an application where a human is required to type in data for a field with specific formatting requirements. An example might be a date in the form ddmmmyy, defined by the pattern "^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$". If the application sees the user’s keystrokes one by one, and can check that what has been typed so far is potentially valid, it is able to raise an error as soon as a mistake is made. GRegex supports the concept of partial matching by means of the #G_REGEX_MATCH_PARTIAL flag. When this is set the return code for g_regex_match() or g_regex_match_full() is, as usual, %TRUE for a complete match, %FALSE otherwise. But, when these functions return %FALSE, you can check if the match was partial calling g_match_info_is_partial_match(). When using partial matching you cannot use g_match_info_fetch*(). Because of the way certain internal optimizations are implemented the partial matching algorithm cannot be used with all patterns. So repeated single characters such as "a{2,4}" and repeated single meta-sequences such as "\d+" are not permitted if the maximum number of occurrences is greater than one. Optional items such as "\d?" (where the maximum is one) are permitted. Quantifiers with any values are permitted after parentheses, so the invalid examples above can be coded thus "(a){2,4}" and "(\d)+". If #G_REGEX_MATCH_PARTIAL is set for a pattern that does not conform to the restrictions, matching functions return an error. a #GMatchInfo structure %TRUE if the match was partial, %FALSE otherwise Since: 2.14 Internal function for gtester to free test log messages, no ABI guarantees provided. Returns: the invocation hint of the innermost signal emission. the instance to query the invocation hint of the innermost signal emission. Returns: The corresponding plugin if @type is a dynamic type, The #GType to retrieve the plugin for. The corresponding plugin if @type is a dynamic type, %NULL otherwise. Return value: a newly allocated string containing an absolute pathname in the GLib file name encoding a newly allocated string containing a rendition of the basename of the filename in valid UTF-8 Since: 2.6 Converts a sequence of bytes encoded as UTF-8 to a Unicode character. If @p does not point to a valid UTF-8 encoded character, results are undefined. If you are not sure that the bytes are complete valid Unicode characters, you should use g_utf8_get_char_validated() instead. a pointer to Unicode character encoded as UTF-8 the resulting character Convert a character to ASCII upper case. Unlike the standard C library toupper() function, this only recognizes standard ASCII letters and ignores the locale, returning all non-ASCII characters unchanged, even if they are upper case letters in a particular character set. Also unlike the standard library function, this takes and returns a char, not an int, so don't call it on %EOF but no need to worry about casting to #guchar before passing a possibly non-ASCII character in. any character. the result of converting @c to upper case. If @c is not an ASCII lower case letter, @c is returned unchanged. Registers a new static flags type with the name @name. It is normally more convenient to let <link linkend="glib-mkenums">glib-mkenums</link> generate a my_flags_get_type() function from a usual C enumeration definition than to write one yourself using g_flags_register_static(). A nul-terminated string used as the name of the new type. An array of #GFlagsValue structs for the possible flags values. The array is terminated by a struct with all members being 0. GObject keeps a reference to the data, so it cannot be stack-allocated. The new type identifier. Asynchronously opens @file for appending. For more details, see g_file_append_to() which is the synchronous version of this call. When the operation is finished, @callback will be called. You can then call g_file_append_to_finish() to get the result of the operation. input #GFile. a set of #GFileCreateFlags. the <link linkend="io-priority">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied the data to pass to callback function A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes a flags type. the #GClosure to which the marshaller belongs ignored 2 a #GValue array holding the instance and the flags parameter the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Adds a #GTypeClassCacheFunc to be called before the reference count of a class goes from one to zero. This can be used to prevent premature class destruction. All installed #GTypeClassCacheFunc functions will be chained until one of them returns %TRUE. The functions have to check the class id passed in to figure whether they actually want to cache the class of this type, since all classes are routed through the same #GTypeClassCacheFunc chain. data to be passed to @cache_func a #GTypeClassCacheFunc Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink. See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK. a #GFileInfo. a #gboolean. Retrieves every value inside @hash_table. The returned data is valid until @hash_table is modified. a #GHashTable a #GList containing all the values inside the hash table. The content of the list is owned by the hash table and should not be modified or freed. Use g_list_free() when done using the list. Since: 2.14 Find the #GParamSpec with the given name for an interface. Generally, the interface vtable passed in as @g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek(). Since: 2.4 any interface vtable for the interface, or the default vtable for the interface name of a property to lookup. the #GParamSpec for the property of the interface with the name @property_name, or %NULL if no such property exists. Inserts a new element into the list, using the given comparison function to determine its position. a #GSList the data for the new element the function to compare elements in the list. It should return a number > 0 if the first parameter comes after the second parameter in the sort order. the new start of the #GSList Calls the given function for each key/value pair in the #GHashTable. If the function returns %TRUE, then the key/value pair is removed from the #GHashTable, but no key or value destroy functions are called. See #GHashTableIterator for an alternative way to loop over the key/value pairs in the hash table. a #GHashTable. the function to call for each key/value pair. user data to pass to the function. the number of key/value pairs removed. Return value: bitmask with same meaning as returned by GetLogicalDrives() bitmask with same meaning as returned by GetLogicalDrives() Sets @mask on @info to match specific attribute types. a #GFileInfo. a #GFileAttributeMatcher. Returns: a #GAppInfo if the handle was found, %NULL if there were errors. a #GFile to open. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL a #GAppInfo if the handle was found, %NULL if there were errors. When you are done with it, release it with g_object_unref() Sets the icon for a given #GFileInfo. See %G_FILE_ATTRIBUTE_STANDARD_ICON. a #GFileInfo. a #GIcon. Flush the status from a sequence of calls to g_base64_encode_step(). whether to break long lines pointer to destination buffer Saved state from g_base64_encode_step() Saved state from g_base64_encode_step() The number of bytes of output that was written Since: 2.12 Called when an application has failed to launch, so that it can cancel the application startup notification started in g_app_launch_context_get_startup_notify_id(). a #GAppLaunchContext. the startup notification id that was returned by g_app_launch_context_get_startup_notify_id(). Sets the size of the internal buffer of @stream to @size, or to the size of the contents of the buffer. The buffer can never be resized smaller than its current contents. #GBufferedInputStream. a #gsize. Gets the directory components of a file name. If the file name has no directory components "." is returned. The returned string should be freed when no longer needed. the name of the file. the directory components of the file. Unsafe, need lock. Adds a string to be displayed in <option>--help</option> output after the list of options. This text often includes a bug reporting address. Note that the summary is translated (see g_option_context_set_translate_func()). Since: 2.12 a #GOptionContext a string to be shown in <option>--help</option> output after the list of options, or %NULL Tries to read @count bytes from the stream into the buffer starting at @buffer. Will block during this read. If count is zero returns zero and does nothing. A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error. On success, the number of bytes read into the buffer is returned. It is not an error if this is not the same as the requested size, as it can happen e.g. near the end of a file. Zero is returned on end of file (or if @count is zero), but never otherwise. If @cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an operation was partially finished when the operation was cancelled the partial result will be returned, without an error. On error -1 is returned and @error is set accordingly. a #GInputStream. a buffer to read data into (which should be at least count bytes long). the number of bytes that will be read from the stream optional #GCancellable object, %NULL to ignore. location to store the error occuring, or %NULL to ignore Number of bytes read, or -1 on error Prepend a name to the list of icons from within @icon. <note><para> Note that doing so invalidates the hash computed by prior calls to g_icon_hash(). </para></note> Since: 2.18 a #GThemedIcon name of icon to prepend to list of icons from within @icon. Creates a new #GBufferedInputStream from the given @base_stream, with a buffer set to @size. a #GInputStream. a #gsize. a #GInputStream. Sets the time the bookmark for @uri was last visited. If no bookmark for @uri is found then it is created. The "visited" time should only be set if the bookmark was launched, either using the command line retrieved by g_bookmark_file_get_app_info() or by the default application for the bookmark's MIME type, retrieved using g_bookmark_file_get_mime_type(). Changing the "visited" time does not affect the "modified" time. Since: 2.12 a #GBookmarkFile a valid URI a timestamp or -1 to use the current time Inserts a new element into the list at the given position. a pointer to a #GList the data for the new element the position to insert the element. If this is negative, or is larger than the number of elements in the list, the new element is added on to the end of the list. the new start of the #GList Gets the name for a file. a #GFileInfo. a string containing the file name. Check to see whether the mount operation is being used for an anonymous user. a #GMountOperation. %TRUE if mount operation is anonymous. Appends @unescaped to @string, escaped any characters that are reserved in URIs using URI-style escape sequences. a #GString a string a string of reserved characters allowed to be used set %TRUE if the escaped string may include UTF8 characters @string Since: 2.16 Return value: The number of items in @queue. a #GQueue The number of items in @queue. Since: 2.4 Reverses a UTF-8 string. @str must be valid UTF-8 encoded text. (Use g_utf8_validate() on all text before trying to use UTF-8 utility functions with it.) This function is intended for programmatic uses of reversed strings. It pays no attention to decomposed characters, combining marks, byte order marks, directional indicators (LRM, LRO, etc) and similar characters which might need special handling when reversing a string for display purposes. Note that unlike g_strreverse(), this function returns newly-allocated memory, which should be freed with g_free() when no longer needed. a UTF-8 encoded string the maximum length of @str to use. If @len < 0, then the string is nul-terminated. a newly-allocated string which is the reverse of @str. Since: 2.2 Removes the idle function with the given data. the data for the idle source's callback. %TRUE if an idle source was found and removed. Creates a new #GQueue. a new #GQueue. Checks if the application info should be shown in menus that list available applications. a #GAppInfo. %TRUE if the @appinfo should be shown, %FALSE otherwise. Gets the base name (the last component of the path) for a given #GFile. If called for the top level of a system (such as the filesystem root or a uri like sftp://host/) it will return a single directory separator (and on Windows, possibly a drive letter). The base name is a byte string (*not* UTF-8). It has no defined encoding or rules other than it may not contain zero bytes. If you want to use filenames in a user interface you should use the display name that you can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info(). This call does no blocking i/o. input #GFile. 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. Gets the drive for the @volume. a #GVolume. a #GDrive or %NULL if @volume is not associated with a drive. Sets the character which is used to separate values in lists. Typically ';' or ',' are used as separators. The default list separator is ';'. Since: 2.6 a #GKeyFile the separator Return value: A random number. a #GRand. lower closed bound of the interval. upper open bound of the interval. A random number. A convenience function which creates a main group if it doesn't exist, adds the @entries to it and sets the translation domain. Since: 2.6 a #GOptionContext a %NULL-terminated array of #GOptionEntry<!-- -->s a translation domain to use for translating the <option>--help</option> output for the options in @entries with gettext(), or %NULL This function is meant to be called from the complete_type_info() function of a #GTypePlugin implementation, see the example for g_enum_complete_type_info() above. the type identifier of the type being completed the #GTypeInfo struct to be filled in An array of #GFlagsValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0. A #GParamSpecPool maintains a collection of #GParamSpec<!-- -->s which can be quickly accessed by owner and name. The implementation of the #GObject property system uses such a pool to store the #GParamSpecs of the properties all object types. Inserts @data into the list of tasks to be executed by @pool. When the number of currently running threads is lower than the maximal allowed number of threads, a new thread is started (or reused) with the properties given to g_thread_pool_new (). Otherwise @data stays in the queue until a thread in this pool finishes its previous task and processes @data. @error can be %NULL to ignore errors, or non-%NULL to report errors. An error can only occur when a new thread couldn't be created. In that case @data is simply appended to the queue of work to do. a #GThreadPool a new task for @pool return location for error Adds a byte onto the start of a #GString, expanding it if necessary. a #GString the byte to prepend on the start of the #GString @string Gets the current user's home directory as defined in the password database. Note that in contrast to traditional UNIX tools, this function prefers <filename>passwd</filename> entries over the <envar>HOME</envar> environment variable. One of the reasons for this decision is that applications in many cases need special handling to deal with the case where <envar>HOME</envar> is <simplelist> <member>Not owned by the user</member> <member>Not writeable</member> <member>Not even readable</member> </simplelist> Since applications are in general <emphasis>not</emphasis> written to deal with these situations it was considered better to make g_get_homedir() not pay attention to <envar>HOME</envar> and to return the real home directory for the user. If applications want to pay attention to <envar>HOME</envar>, they can do: |[ const char *homedir = g_getenv ("HOME"); if (!homedir) homedir = g_get_homedir (<!-- -->); ]| the current user's home directory Inserts the (@begin, @end) range at the destination pointed to by ptr. The @begin and @end iters must point into the same sequence. It is allowed for @dest to point to a different sequence than the one pointed into by @begin and @end. If @dest is NULL, the range indicated by @begin and @end is removed from the sequence. If @dest iter points to a place within the (@begin, @end) range, the range does not move. Since: 2.14 a #GSequenceIter a #GSequenceIter a #GSequenceIter Loads a key file from memory into an empty #GKeyFile structure. If the object cannot be created then %error is set to a #GKeyFileError. an empty #GKeyFile struct key file loaded in memory the length of @data in bytes flags from #GKeyFileFlags return location for a #GError, or %NULL %TRUE if a key file could be loaded, %FALSE otherwise Since: 2.6 Splits a string into a maximum of @max_tokens pieces, using the given @delimiter. If @max_tokens is reached, the remainder of @string is appended to the last token. As a special case, the result of splitting the empty string "" is an empty vector, not a vector containing a single string. The reason for this special case is that being able to represent a empty vector is typically more useful than consistent handling of empty elements. If you do need to represent empty elements, you'll need to check for the empty string before calling g_strsplit(). a string to split. a string which specifies the places at which to split the string. The delimiter is not included in any of the resulting strings, unless @max_tokens is reached. the maximum number of pieces to split @string into. If this is less than 1, the string is split completely. a newly-allocated %NULL-terminated array of strings. Use g_strfreev() to free it. Sets the @attribute to contain the given @attr_value, if possible. a #GFileInfo. a file attribute key. an unsigned 64-bit integer. Creates a new asynchronous queue with an initial reference count of 1 and sets up a destroy notify function that is used to free any remaining queue items when the queue is destroyed after the final unref. function to free queue elements the new #GAsyncQueue. Since: 2.16 Clears the current value in @value and resets it to the default value (as if the value had just been initialized). An initialized #GValue structure. the #GValue structure that has been passed in Looks up or registers an enumeration that is implemented with a particular type plugin. If a type with name @type_name was previously registered, the #GType identifier for the type is returned, otherwise the type is newly registered, and the resulting #GType identifier returned. As long as any instances of the type exist, the type plugin will not be unloaded. Since: 2.6 a #GTypeModule name for the type an array of #GEnumValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0. the new or existing type ID Stops a signal's current emission. This is just like g_signal_stop_emission() except it will look up the signal id for you. the object whose signal handlers you wish to stop. a string of the form "signal-name::detail". Pushes @cancellable onto the cancellable stack. The current cancllable can then be recieved using g_cancellable_get_current(). This is useful when implementing cancellable operations in code that does not allow you to pass down the cancellable object. This is typically called automatically by e.g. #GFile operations, so you rarely have to call this yourself. optional #GCancellable object, %NULL to ignore. Sets the value of a date from a #GTimeVal value. Note that the @tv_usec member is ignored, because #GDate can't make use of the additional precision. Since: 2.10 a #GDate #GTimeVal value to set Utility function to check if a particular file exists. This is implemented using g_file_query_info() and as such does blocking I/O. Note that in many cases it is racy to first check for file existence and then execute something based on the outcome of that, because the file might have been created or removed in between the operations. The general approach to handling that is to not check, but just do the operation and handle the errors as they come. As an example of race-free checking, take the case of reading a file, and if it doesn't exist, creating it. There are two racy versions: read it, and on error create it; and: check if it exists, if not create it. These can both result in two processes creating the file (with perhaps a partially written file as the result). The correct approach is to always try to create the file with g_file_create() which will either atomically create the file or fail with a G_IO_ERROR_EXISTS error. However, in many cases an existence check is useful in a user interface, for instance to make a menu item sensitive/insensitive, so that you don't have to fool users that something is possible and then just show and error dialog. If you do this, you should make sure to also handle the errors that can happen due to races when you execute the operation. input #GFile. optional #GCancellable object, %NULL to ignore. %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled). Checks whether @replacement is a valid replacement string (see g_regex_replace()), i.e. that all escape sequences in it are valid. If @has_references is not %NULL then @replacement is checked for pattern references. For instance, replacement text 'foo\n' does not contain references and may be evaluated without information about actual match, but '\0\1' (whole match followed by first subpattern) requires valid #GMatchInfo object. the replacement string location to store information about references in @replacement or %NULL location to store error whether @replacement is a valid replacement string Since: 2.14 Decode a sequence of Base-64 encoded text into binary data zero-terminated string with base64 text to decode The length of the decoded data is written here a newly allocated buffer containing the binary data that @text represents. The returned buffer must be freed with g_free(). Since: 2.12 Return value: whether a test was %TRUE a filename to test in the GLib file name encoding bitfield of #GFileTest flags whether a test was %TRUE Sets the maximal allowed number of threads for @pool. A value of -1 means, that the maximal number of threads is unlimited. Setting @max_threads to 0 means stopping all work for @pool. It is effectively frozen until @max_threads is set to a non-zero value again. A thread is never terminated while calling @func, as supplied by g_thread_pool_new (). Instead the maximal number of threads only has effect for the allocation of new threads in g_thread_pool_push(). A new thread is allocated, whenever the number of currently running threads in @pool is smaller than the maximal number. @error can be %NULL to ignore errors, or non-%NULL to report errors. An error can only occur when a new thread couldn't be created. a #GThreadPool a new maximal number of threads for @pool return location for error Finds the start of the next UTF-8 character in the string after @p. @p does not have to be at the beginning of a UTF-8 character. No check is made to see if the character found is actually valid other than it starts with an appropriate byte. a pointer to a position within a UTF-8 encoded string a pointer to the end of the string, or %NULL to indicate that the string is nul-terminated, in which case the returned value will be a pointer to the found character or %NULL Determines whether a character is a space, tab, or line separator (newline, carriage return, etc.). Given some UTF-8 text, obtain a character value with g_utf8_get_char(). (Note: don't use this to do word breaking; you have to use Pango or equivalent to get word breaking right, the algorithm is fairly complex.) a Unicode character %TRUE if @c is a space character Convert a string from UTF-8 to a 32-bit fixed width representation as UCS-4. A trailing 0 will be added to the string after the converted text. a UTF-8 encoded string the maximum length of @str to use. If @len < 0, then the string is nul-terminated. location to store number of bytes read, or %NULL. If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will be returned in case @str contains a trailing partial character. If an error occurs then the index of the invalid input is stored here. location to store number of characters written or %NULL. The value here stored does not include the trailing 0 character. location to store the error occuring, or %NULL to ignore errors. Any of the errors in #GConvertError other than %G_CONVERT_ERROR_NO_CONVERSION may occur. a pointer to a newly allocated UCS-4 string. This value must be freed with g_free(). If an error occurs, %NULL will be returned and @error set. Gets the first sibling of a #GNode. This could possibly be the node itself. a #GNode the first sibling of @node Searches a #GTree using @search_func. The @search_func is called with a pointer to the key of a key/value pair in the tree, and the passed in @user_data. If @search_func returns 0 for a key/value pair, then g_tree_search_func() will return the value of that pair. If @search_func returns -1, searching will proceed among the key/value pairs that have a smaller key; if @search_func returns 1, searching will proceed among the key/value pairs that have a larger key. a #GTree. a function used to search the #GTree. the data passed as the second argument to the @search_func function. the value corresponding to the found key, or %NULL if the key was not found. Inserts @len bytes of @val into @string at @pos. Because @len is provided, @val may contain embedded nuls and need not be nul-terminated. If @pos is -1, bytes are inserted at the end of the string. Since this function does not stop at nul bytes, it is the caller's responsibility to ensure that @val has at least @len addressable bytes. a #GString position in @string where insertion should happen, or -1 for at the end bytes to insert number of bytes of @val to insert @string Get the contents of a %G_TYPE_STRING #GValue. a valid #GValue of type %G_TYPE_STRING string content of @value Associates a list of string values for @key and @locale under @group_name. If the translation for @key cannot be found then it is created. Since: 2.6 a #GKeyFile a group name a key a locale a %NULL-terminated array of locale string values the length of @list A wrapper for the POSIX rmdir() function. The rmdir() function deletes a directory from the filesystem. See your C library manual for more details about how rmdir() works on your system. a pathname in the GLib file name encoding (UTF-8 on Windows) 0 if the directory was successfully removed, -1 if an error occurred Since: 2.6 Compares two strings for ordering using the linguistically correct rules for the <link linkend="setlocale">current locale</link>. When sorting a large number of strings, it will be significantly faster to obtain collation keys with g_utf8_collate_key() and compare the keys with strcmp() when sorting instead of sorting the original strings. a UTF-8 encoded string a UTF-8 encoded string < 0 if @str1 compares before @str2, 0 if they compare equal, > 0 if @str1 compares after @str2. Asynchronously closes the file enumerator. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in g_file_enumerator_close_finish(). a #GFileEnumerator. the <link linkend="io-priority">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied the data to pass to callback function Creates a duplicate of a #GAppInfo. a #GAppInfo. a duplicate of @appinfo. Returns: ISO 8601 week number of the year. a valid #GDate ISO 8601 week number of the year. Since: 2.6 Checks if any sources have pending events for the given context. a #GMainContext (if %NULL, the default context will be used) %TRUE if events are pending. On some platforms, notably Windows, the #GPid type represents a resource which must be closed to prevent resource leaking. g_spawn_close_pid() is provided for this purpose. It should be used on all platforms, even though it doesn't do anything under UNIX. The process reference to close Gets the display string for the display. This is used to ensure new applications are started on the same display as the launching application. a #GAppLaunchContext. a #GAppInfo. a #GList of files. a display string for the display. A desktop file is hidden if the Hidden key in it is set to True. a #GDesktopAppInfo. %TRUE if hidden, %FALSE otherwise. Frees the memory allocated for the #GString. If @free_segment is %TRUE it also frees the character data. a #GString if %TRUE the actual character data is freed as well the character data of @string (i.e. %NULL if @free_segment is %TRUE) Gets the current flags for a #GIOChannel, including read-only flags such as %G_IO_FLAG_IS_READABLE. The values of the flags %G_IO_FLAG_IS_READABLE and %G_IO_FLAG_IS_WRITEABLE are cached for internal use by the channel when it is created. If they should change at some later point (e.g. partial shutdown of a socket with the UNIX shutdown() function), the user should immediately call g_io_channel_get_flags() to update the internal values of these flags. a #GIOChannel the flags which are set on the channel Removes all items in the (@begin, @end) range. If the sequence has a data destroy function associated with it, this function is called on the data for the removed items. Since: 2.14 a #GSequenceIter a #GSequenceIter Set the contents of a %G_TYPE_ULONG #GValue to @v_ulong. a valid #GValue of type %G_TYPE_ULONG unsigned long integer value to be set Creates a new #GTree with a comparison function that accepts user data. See g_tree_new() for more details. qsort()-style comparison function. data to pass to comparison function. a new #GTree. Determines if a character is typically rendered in a double-width cell under legacy East Asian locales. If a character is wide according to g_unichar_iswide(), then it is also reported wide with this function, but the converse is not necessarily true. See the <ulink url="http://www.unicode.org/reports/tr11/">Unicode Standard Annex #11</ulink> for details. a Unicode character %TRUE if the character is wide in legacy East Asian locales Since: 2.12 Request an asynchronous read of @count bytes from the stream into the buffer starting at @buffer. When the operation is finished @callback will be called. You can then call g_input_stream_read_finish() to get the result of the operation. During an async request no other sync and async calls are allowed, and will result in %G_IO_ERROR_PENDING errors. A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error. On success, the number of bytes read into the buffer will be passed to the callback. It is not an error if this is not the same as the requested size, as it can happen e.g. near the end of a file, but generally we try to read as many bytes as requested. Zero is returned on end of file (or if @count is zero), but never otherwise. Any outstanding i/o request with higher priority (lower numerical value) will be executed before an outstanding request with lower priority. Default priority is %G_PRIORITY_DEFAULT. The asyncronous methods have a default fallback that uses threads to implement asynchronicity, so they are optional for inheriting classes. However, if you override one you must override all. A #GInputStream. a buffer to read data into (which should be at least count bytes long). the number of bytes that will be read from the stream the <link linkend="io-priority">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. callback to call when the request is satisfied the data to pass to callback function Creates a new data input stream for the @base_stream. a #GInputStream. a new #GDataInputStream. Gets the URI for the @file. This call does no blocking i/o. input #GFile. a string containing the #GFile's URI. The returned string should be freed with g_free() when no longer needed. Create a new test suite with the name @suite_name. a name for the suite A newly allocated #GTestSuite instance. Since: 2.16 Decreases the use count of a #GTypeModule by one. If the result is zero, the module will be unloaded. (However, the #GTypeModule will not be freed, and types associated with the #GTypeModule are not unregistered. Once a #GTypeModule is initialized, it must exist forever.) a #GTypeModule Sorts @queue using @func. This function is called while holding the @queue's lock. Since: 2.10 a #GAsyncQueue the #GCompareDataFunc is used to sort @queue. This function is passed two elements of the @queue. The function should return 0 if they are equal, a negative value if the first element should be higher in the @queue or a positive value if the first element should be lower in the @queue than the second element. user data passed to @func Unsafe, need lock fen_lock. Set the contents of a %G_TYPE_STRING #GValue to @v_string. The string is assumed to be static, and is thus not duplicated when setting the #GValue. a valid #GValue of type %G_TYPE_STRING static string to be set #GUnixVolume for the given @mount_path. Finishes ejecting a volume. pointer to a #GVolume. a #GAsyncResult. a #GError. %TRUE, %FALSE if operation failed. Mounts a volume. a #GVolume. flags affecting the operation a #GMountOperation or %NULL to avoid user interaction. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback, or %NULL. a #gpointer. Checks if the unix mount points have changed since a given unix time. guint64 to contain a timestamp. %TRUE if the mount points have changed since @time. Finishes unmounting a mount. If any errors occurred during the operation, @error will be set to contain the errors and %FALSE will be returned. a #GMount. a #GAsyncResult. a #GError location to store the error occuring, or %NULL to ignore. %TRUE if the mount was successfully unmounted. %FALSE otherwise. Gets the size of the buffer in the @stream. a #GBufferedOutputStream. the current size of the buffer. Quotes a string so that the shell (/bin/sh) will interpret the quoted string to mean @unquoted_string. If you pass a filename to the shell, for example, you should first quote it with this function. The return value must be freed with g_free(). The quoting style used is undefined (single or double quotes may be used). a literal string quoted string Creates a new signal. (This is usually done in the class initializer.) A signal name consists of segments consisting of ASCII letters and digits, separated by either the '-' or '_' character. The first character of a signal name must be a letter. Names which violate these rules lead to undefined behaviour of the GSignal system. When registering a signal and looking up a signal, either separator can be used, but they cannot be mixed. the name for the signal the type this signal pertains to. It will also pertain to types which are derived from this type. a combination of #GSignalFlags specifying detail of when the default handler is to be invoked. You should at least specify %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST. The offset of the function pointer in the class structure for this type. Used to invoke a class method generically. Pass 0 to not associate a class method with this signal. the accumulator for this signal; may be %NULL. user data for the @accumulator. the function to translate arrays of parameter values to signal emissions into C language callback invocations. the type of return value, or #G_TYPE_NONE for a signal without a return value. the number of parameter types to follow. a list of types, one for each parameter. the signal id Compares @str1 and @str2 like strcmp(). Handles %NULL strings gracefully. a C string or %NULL another C string or %NULL -1, 0 or 1, if @str1 is <, == or > than @str2. Since: 2.16 References a file attribute matcher. a #GFileAttributeMatcher. a #GFileAttributeMatcher. Emitted when the file name completion information comes available. Set the contents of a %G_TYPE_STRING #GValue to @v_string. a valid #GValue of type %G_TYPE_STRING string to be set Creates a new file info structure. a #GFileInfo. Creates a new unix output stream for @fd. If @close_fd_at_close is %TRUE, the fd will be closed when the output stream is destroyed. unix's file descriptor. a #gboolean. #GOutputStream. If @close_fd_at_close is %TRUE, then @fd will be closed when the #GOutputStream is closed. Converts a string from UTF-8 to the encoding used for strings by the C runtime (usually the same as that used by the operating system) in the <link linkend="setlocale">current locale</link>. On Windows this means the system codepage. a UTF-8 encoded string the length of the string, or -1 if the string is nul-terminated<footnoteref linkend="nul-unsafe"/>. location to store the number of bytes in the input string that were successfully converted, or %NULL. Even if the conversion was successful, this may be less than @len if there were partial characters at the end of the input. If the error #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value stored will the byte offset after the last valid input sequence. the number of bytes stored in the output buffer (not including the terminating nul). location to store the error occuring, or %NULL to ignore errors. Any of the errors in #GConvertError may occur. The converted string, or %NULL on an error. Puts an unsigned 16-bit integer into the output stream. a #GDataOutputStream. a #guint16. optional #GCancellable object, %NULL to ignore. a #GError, %NULL to ignore. %TRUE if @data was successfully added to the @stream. Return value: a newly allocated string or %NULL if the specified a #GKeyFile a group name a key return location for a #GError, or %NULL a newly allocated string or %NULL if the specified key cannot be found. Since: 2.6 Removes a finalization notifier. Notice that notifiers are automatically removed after they are run. a #GClosure data which was passed to g_closure_add_finalize_notifier() when registering @notify_func the callback function to remove Gets a unsigned 64-bit integer contained within the attribute. If the attribute does not contain an unsigned 64-bit integer, or is invalid, 0 will be returned. a #GFileInfo. a file attribute key. a unsigned 64-bit integer from the attribute. Reverses the order of the items in @queue. Since: 2.4 a #GQueue Gets the last element in a #GList. a #GList the last element in the #GList, or %NULL if the #GList has no elements Escapes the special characters used for regular expressions in @string, for instance "a.b*c" becomes "a\.b\*c". This function is useful to dynamically generate regular expressions. @string can contain nul characters that are replaced with "\0", in this case remember to specify the correct length of @string in @length. the string to escape the length of @string, or -1 if @string is nul-terminated a newly-allocated escaped string Since: 2.14 Get the contents of a %G_TYPE_FLAGS #GValue. a valid #GValue whose type is derived from %G_TYPE_FLAGS flags contents of @value Sets the user name within @op to @username. a #GMountOperation. input username. a #GVolumeMonitor. a win32 path. ususally NULL a #GWin32Mount for the given win32 path. Determines if a character is titlecase. Some characters in Unicode which are composites, such as the DZ digraph have three case variants instead of just two. The titlecase form is used at the beginning of a word where only the first letter is capitalized. The titlecase form of the DZ digraph is U+01F2 LATIN CAPITAL LETTTER D WITH SMALL LETTER Z. a Unicode character %TRUE if the character is titlecase Converts a gpointer to a hash value. It can be passed to g_hash_table_new() as the @hash_func parameter, when using pointers as keys in a #GHashTable. a #gpointer key a hash value corresponding to the key. Gets the time the bookmark for @uri was last visited. In the event the URI cannot be found, -1 is returned and @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. a #GBookmarkFile a valid URI return location for a #GError, or %NULL a timestamp. Since: 2.12 Enqueue a pointer to be released with g_free() during the next teardown phase. This is equivalent to calling g_test_queue_destroy() with a destroy callback of g_free(). Since: 2.16 the pointer to be stored. Asynchronously gets the requested information about the filesystem that the specified @file is on. The result is a #GFileInfo object that contains key-value attributes (such as type or size for the file). For more details, see g_file_query_filesystem_info() which is the synchronous version of this call. When the operation is finished, @callback will be called. You can then call g_file_query_info_finish() to get the result of the operation. input #GFile. an attribute query string. the <link linkend="io-priority">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied the data to pass to callback function Adds a new attribute with @name to the @list, setting its @type and @flags. a #GFileAttributeInfoList. the name of the attribute to add. the #GFileAttributeType for the attribute. #GFileAttributeInfoFlags for the attribute. Determines whether a character is numeric (i.e. a digit). This covers ASCII 0-9 and also digits in other languages/scripts. Given some UTF-8 text, obtain a character value with g_utf8_get_char(). a Unicode character %TRUE if @c is a digit Get the contents of a %G_TYPE_ULONG #GValue. a valid #GValue of type %G_TYPE_ULONG unsigned long integer contents of @value Sort @value_array using @compare_func to compare the elements accoring to the semantics of #GCompareDataFunc. The current implementation uses Quick-Sort as sorting algorithm. #GValueArray to sort function to compare elements extra data argument provided for @compare_func the #GValueArray passed in as @value_array Checks if the file enumerator has been closed. a #GFileEnumerator. %TRUE if the @enumerator is closed. Ejects a mount. This is an asynchronous operation, and is finished by calling g_mount_eject_finish() with the @mount and #GAsyncResults data returned in the @callback. a #GMount. flags affecting the unmount if required for eject optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback, or %NULL. user data passed to @callback. Creates a new GSequence. The @data_destroy function, if non-%NULL will be called on all items when the sequence is destroyed and on items that are removed from the sequence. a #GDestroyNotify function, or %NULL a new #GSequence Since: 2.14 Close an IO channel. Any pending data to be written will be flushed, ignoring errors. The channel will not be freed until the last reference is dropped using g_io_channel_unref(). Deprecated:2.2: Use g_io_channel_shutdown() instead. A #GIOChannel Associates a new double value with @key under @group_name. If @key cannot be found then it is created. Since: 2.12 a #GKeyFile a group name a key an double value Compares @value1 with @value2 according to @pspec, and return -1, 0 or +1, if @value1 is found to be less than, equal to or greater than @value2, respectively. a valid #GParamSpec a #GValue of correct type for @pspec a #GValue of correct type for @pspec -1, 0 or +1, for a less than, equal to or greater than result Checks whether @file has the prefix specified by @prefix. In other word, if the names of inital elements of @file<!-- -->s pathname match @prefix. This call does no i/o, as it works purely on names. As such it can sometimes return %FALSE even if @file is inside a @prefix (from a filesystem point of view), because the prefix of @file is an alias of @prefix. input #GFile. input #GFile. %TRUE if the @files's parent, grandparent, etc is @prefix. %FALSE otherwise. Returns: a newly-allocated zero-terminated array of #GType containing an interface type location to return the number of prerequisites, or %NULL a newly-allocated zero-terminated array of #GType containing the prerequisites of @interface_type Connects a closure to a signal for a particular object. the instance to connect to. the id of the signal. the detail. the closure to connect. whether the handler should be called before or after the default handler of the signal. the handler id Gets a human-readable name for the application, as set by g_set_application_name(). This name should be localized if possible, and is intended for display to the user. Contrast with g_get_prgname(), which gets a non-localized name. If g_set_application_name() has not been called, returns the result of g_get_prgname() (which may be %NULL if g_set_prgname() has also not been called). human-readable application name. may return %NULL Since: 2.2 A safer form of the standard sprintf() function. The output is guaranteed to not exceed @n characters (including the terminating nul character), so it is easy to ensure that a buffer overflow cannot occur. See also g_strdup_printf(). In versions of GLib prior to 1.2.3, this function may return -1 if the output was truncated, and the truncated string may not be nul-terminated. In versions prior to 1.3.12, this function returns the length of the output string. The return value of g_snprintf() conforms to the snprintf() function as standardized in ISO C99. Note that this is different from traditional snprintf(), which returns the length of the output string. The format string may contain positional parameters, as specified in the Single Unix Specification. the buffer to hold the output. the maximum number of bytes to produce (including the terminating nul character). a standard printf() format string, but notice <link linkend="string-precision">string precision pitfalls</link>. the arguments to insert in the output. the number of bytes which would be produced if the buffer was large enough. Sets the private flag of the bookmark for @uri. If a bookmark for @uri cannot be found then it is created. Since: 2.12 a #GBookmarkFile a valid URI %TRUE if the bookmark should be marked as private Sets the sort order attribute in the file info structure. See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER. a #GFileInfo. a sort order integer. Set the contents of a pointer #GValue to @v_pointer. a valid #GValue of %G_TYPE_POINTER pointer value to be set Set the contents of a %G_TYPE_CHAR #GValue to @v_char. a valid #GValue of type %G_TYPE_CHAR character value to be set Return value: the value associated with the key as a boolean, a #GKeyFile a group name a key return location for a #GError the value associated with the key as a boolean, or %FALSE if the key was not found or could not be parsed. Since: 2.6 Increases the reference count of the asynchronous @queue by 1. You do not need to hold the lock to call this function. a #GAsyncQueue. the @queue that was passed in (since 2.6) Asynchronously queries the @stream for a #GFileInfo. When completed, @callback will be called with a #GAsyncResult which can be used to finish the operation with g_file_output_stream_query_info_finish(). For the synchronous version of this function, see g_file_output_stream_query_info(). a #GFileOutputStream. a file attribute query string. the <link linkend="gio-GIOScheduler">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. callback to call when the request is satisfied the data to pass to callback function Replacement for g_io_channel_read() with the new API. a #GIOChannel a buffer to read data into the size of the buffer. Note that the buffer may not be complelely filled even if there is data in the buffer if the remaining data is not a complete character. The number of bytes read. This may be zero even on success if count < 6 and the channel's encoding is non-%NULL. This indicates that the next UTF-8 character is too wide for the buffer. a location to return an error of type #GConvertError or #GIOChannelError. the status of the operation. Runs a single iteration for the given main loop. This involves checking to see if any event sources are ready to be processed, then if no events sources are ready and @may_block is %TRUE, waiting for a source to become ready, then dispatching the highest priority events sources that are ready. Otherwise, if @may_block is %FALSE sources are not waited to become ready, only those highest priority events sources will be dispatched (if any), that are ready at this given moment without further waiting. Note that even when @may_block is %TRUE, it is still possible for g_main_context_iteration() to return %FALSE, since the the wait may be interrupted for other reasons than an event source becoming ready. a #GMainContext (if %NULL, the default context will be used) whether the call may block. %TRUE if events were dispatched. Gets an array of all #GParamSpec<!-- -->s owned by @owner_type in the pool. a #GParamSpecPool the owner to look for return location for the length of the returned array a newly allocated array containing pointers to all #GParamSpec<!-- -->s owned by @owner_type in the pool Return value: the values associated with the key as a list of a #GKeyFile a group name a key the number of integers returned return location for a #GError the values associated with the key as a list of integers, or %NULL if the key was not found or could not be parsed. Since: 2.6 Gets a #GFileError constant based on the passed-in @errno. For example, if you pass in %EEXIST this function returns #G_FILE_ERROR_EXIST. Unlike @errno values, you can portably assume that all #GFileError values will exist. Normally a #GFileError value goes into a #GError returned from a function that manipulates files. So you would use g_file_error_from_errno() when constructing a #GError. an "errno" value #GFileError corresponding to the given @errno Finds a source with the given source functions and user data. If multiple sources exist with the same source function and user data, the first one found will be returned. a #GMainContext (if %NULL, the default context will be used). the @source_funcs passed to g_source_new(). the user data from the callback. the source, if one was found, otherwise %NULL Gets properties of an object. In general, a copy is made of the property contents and the caller is responsible for freeing the memory in the appropriate manner for the type, for instance by calling g_free() or g_object_unref(). See g_object_get(). a #GObject name of the first property to get return location for the first property, followed optionally by more name/return location pairs, followed by %NULL Get the contents of a %G_TYPE_UINT64 #GValue. a valid #GValue of type %G_TYPE_UINT64 unsigned 64bit integer contents of @value Gets the byte order for the data input stream. a given #GDataInputStream. the @stream's current #GDataStreamByteOrder. Gets the element at the given position in a #GSList. a #GSList the position of the element, counting from 0 the element, or %NULL if the position is off the end of the #GSList Computes the canonical ordering of a string in-place. This rearranges decomposed characters in the string according to their combining classes. See the Unicode manual for more information. a UCS-4 encoded string. the maximum length of @string to use. Gets the position of the given element in the #GSList (starting from 0). a #GSList an element in the #GSList the position of the element in the #GSList, or -1 if the element is not found Truncates a stream with a given #offset. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an operation was partially finished when the operation was cancelled the partial result will be returned, without an error. a #GSeekable. a #goffset. optional #GCancellable object, %NULL to ignore. a #GError location to store the error occuring, or %NULL to ignore. %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present. Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value. If @attribute is of a different type, this operation will fail. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. a string containing the attribute's name. a #guint32 containing the attribute's new value. a #GFileQueryInfoFlags. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise. Calls @func for each element in the queue passing @user_data to the function. Since: 2.4 a #GQueue the function to call for each element's data user data to pass to @func Removes the first element in @queue that contains @data. Since: 2.4 a #GQueue data to remove. Return value: the #GSequence that @iter points into. a #GSequenceIter the #GSequence that @iter points into. Since: 2.14 Sets the content type attribute for a given #GFileInfo. See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE. a #GFileInfo. a content type. See #GContentType. Return value: the #GHashTable associated with @iter. an initialized #GHashTableIter. the #GHashTable associated with @iter. Since: 2.16 Return value: the value associated with the key as a double, or a #GKeyFile a group name a key return location for a #GError the value associated with the key as a double, or 0.0 if the key was not found or could not be parsed. Since: 2.12 Loads an icon asynchronously. To finish this function, see g_loadable_icon_load_finish(). For the synchronous, blocking version of this function, see g_loadable_icon_load(). a #GLoadableIcon. an integer. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied the data to pass to callback function Bundles up pointers to each of the matching substrings from a match and stores them in an array of gchar pointers. The first element in the returned array is the match number 0, i.e. the entire matched text. If a sub pattern didn't match anything (e.g. sub pattern 1, matching "b" against "(a)?b") then an empty string is inserted. If the last match was obtained using the DFA algorithm, that is using g_regex_match_all() or g_regex_match_all_full(), the retrieved strings are not that matched by sets of parentheses but that of the matched substring. Substrings are matched in reverse order of length, so the first one is the longest match. The strings are fetched from the string passed to the match function, so you cannot call this function after freeing the string. a #GMatchInfo structure a %NULL-terminated array of gchar * pointers. It must be freed using g_strfreev(). If the previous match failed %NULL is returned Since: 2.14 Finishes an asynchronous file info query. See g_file_query_info_async(). input #GFile. a #GAsyncResult. a #GError. #GFileInfo for given @file or %NULL on error. Gets the file attribute with the name @name from @list. a #GFileAttributeInfoList. the name of the attribute to lookup. a #GFileAttributeInfo for the @name, or %NULL if an attribute isn't found. Finishes closing a file enumerator, started from g_file_enumerator_close_async(). If the file enumerator was already closed when g_file_enumerator_close_async() was called, then this function will report %G_IO_ERROR_CLOSED in @error, and return %FALSE. If the file enumerator had pending operation when the close operation was started, then this function will report %G_IO_ERROR_PENDING, and return %FALSE. If @cancellable was not %NULL, then the operation may have been cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be returned. a #GFileEnumerator. a #GAsyncResult. a #GError location to store the error occuring, or %NULL to ignore. %TRUE if the close operation has finished successfully. Set the contents of a %G_TYPE_INT64 #GValue to @v_int64. a valid #GValue of type %G_TYPE_INT64 64bit integer value to be set Sets the application as the default handler for a given type. a #GAppInfo. the content type. a #GError. %TRUE on success, %FALSE on error. Checks whether @ch is a valid Unicode character. Some possible integer values of @ch will not be valid. 0 is considered a valid character, though it's normally a string terminator. a Unicode character %TRUE if @ch is a valid Unicode character Decrements the reference count for the type corresponding to the interface default vtable @g_iface. If the type is dynamic, then when no one is using the interface and all references have been released, the finalize function for the interface's default vtable (the <structfield>class_finalize</structfield> member of #GTypeInfo) will be called. Since: 2.4 the default vtable structure for a interface, as returned by g_type_default_interface_ref() Creates a new #GParamSpecInt64 instance specifying a %G_TYPE_INT64 property. See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified minimum value for the property specified maximum value for the property specified default value for the property specified flags for the property specified a newly created parameter specification A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, GOBject *arg1, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs ignored 2 a #GValue array holding the instance and the #GObject* parameter the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller A simple version of g_spawn_async() that parses a command line with g_shell_parse_argv() and passes it to g_spawn_async(). Runs a command line in the background. Unlike g_spawn_async(), the %G_SPAWN_SEARCH_PATH flag is enabled, other flags are not. Note that %G_SPAWN_SEARCH_PATH can have security implications, so consider using g_spawn_async() directly if appropriate. Possible errors are those from g_shell_parse_argv() and g_spawn_async(). The same concerns on Windows apply as for g_spawn_command_line_sync(). a command line return location for errors %TRUE on success, %FALSE if error is set. Sets @value from an instantiatable type via the value_table's collect_value() function. An initialized #GValue structure. the instance Calls the @complete_interface_info function from the #GTypePluginClass of @plugin. There should be no need to use this function outside of the GObject type system itself. the #GTypePlugin the #GType of an instantiable type to which the interface is added the #GType of the interface whose info is completed the #GInterfaceInfo to fill in Calls the original class closure of a signal. This function should only be called from an overridden class closure; see g_signal_override_class_closure(). the argument list of the signal emission. The first element in the array is a #GValue for the instance the signal is being emitted on. The rest are any arguments to be passed to the signal. Location for the return value. Guesses the name of a Unix mount. The result is a translated string. a #GUnixMountEntry A newly allocated string that must be freed with g_free() Checks if an output stream has already been closed. a #GOutputStream. %TRUE if @stream is closed. %FALSE otherwise. Gets the source tag for the #GSimpleAsyncResult. a #GSimpleAsyncResult. a #gpointer to the source object for the #GSimpleAsyncResult. The notify signal is emitted on an object when one of its properties has been changed. Note that getting this signal doesn't guarantee that the value of the property has actually changed, it may also be emitted when the setter for the property is called to reinstate the previous value. This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: |[ g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view) ]| It is important to note that you must use <link linkend="canonical-parameter-name">canonical</link> parameter names as detail strings for the notify signal. the #GParamSpec of the property which changed the object which received the signal. Set the contents of a %G_TYPE_UINT #GValue to @v_uint. a valid #GValue of type %G_TYPE_UINT unsigned integer value to be set Sets the (writeable) flags in @channel to (@flags & %G_IO_CHANNEL_SET_MASK). a #GIOChannel the flags to set on the IO channel A location to return an error of type #GIOChannelError the status of the operation. Adds a function to be called whenever there are no higher priority events pending to the default main loop. The function is given the default idle priority, #G_PRIORITY_DEFAULT_IDLE. If the function Return value: the ID (greater than 0) of the event source. function to call data to pass to @function. the ID (greater than 0) of the event source. Appends a formatted string onto the end of a #GString. This function is similar to g_string_printf() except that the text is appended to the #GString. a #GString the string format. See the printf() documentation the parameters to insert into the format string Gets the root directory on @mount. a #GMount. a #GFile. Creates a new empty #GKeyFile object. Use g_key_file_load_from_file(), g_key_file_load_from_data(), g_key_file_load_from_dirs() or g_key_file_load_from_data_dirs() to read an existing key file. an empty #GKeyFile. Since: 2.6 Like g_sequence_search(), but uses a #GSequenceIterCompareFunc instead of a #GCompareDataFunc as the compare function. a #GSequence data for the new item the #GSequenceIterCompare function used to compare iterators in the sequence. It is called with two iterators pointing into @seq. It should return 0 if the iterators are equal, a negative value if the first iterator comes before the second, and a positive value if the second iterator comes before the first. user data passed to @iter_cmp a #GSequenceIter pointing to the position in @seq where @data would have been inserted according to @iter_cmp and @cmp_data. Since: 2.14 Decreases the reference count on a #GMainContext object by one. If the result is zero, free the context and free all associated memory. a #GMainContext Creates a new #GDesktopAppInfo. a string containing a file name. a new #GDesktopAppInfo or %NULL on error. Finds an iterator somewhere in the range (@begin, @end). This iterator will be close to the middle of the range, but is not guaranteed to be <emphasis>exactly</emphasis> in the middle. The @begin and @end iterators must both point to the same sequence and @begin must come before or be equal to @end in the sequence. a #GSequenceIter a #GSequenceIter A #GSequenceIter pointing somewhere in the (@begin, @end) range. Since: 2.14 Equivalent to the UNIX gettimeofday() function, but portable. #GTimeVal structure in which to store current time. Checks if a volume can be ejected. a #GVolume. %TRUE if the @volume can be ejected. %FALSE otherwise. Creates a new #GAppInfo from the given information. the commandline to use the application name, or %NULL to use @commandline flags that can specify details of the created #GAppInfo a #GError location to store the error occuring, %NULL to ignore. new #GAppInfo for given command. Return value: a #GSequenceIter pointing to the previous position before a #GSequenceIter a #GSequenceIter pointing to the previous position before @iter. Since: 2.14 Creates a new #GDesktopAppInfo. the desktop file id a new #GDesktopAppInfo, or %NULL if no desktop file with that id Used from an I/O job to send a callback to be run asynchronously in the main loop (main thread). The callback will be run when the main loop is available, but at that time the I/O job might have finished. The return value from the callback is ignored. Note that if you are passing the @user_data from g_io_scheduler_push_job() on to this function you have to ensure that it is not freed before @func is called, either by passing %NULL as @notify to g_io_scheduler_push_job() or by using refcounting for @user_data. a #GIOSchedulerJob a #GSourceFunc callback that will be called in the main thread data to pass to @func a #GDestroyNotify for @user_data, or %NULL Removes the first element of the queue. a #GQueue. the data of the first element in the queue, or %NULL if the queue is empty. Sets the result from a #GError. a #GSimpleAsyncResult. #GError. Sets the @attribute to contain the given @attr_value, if possible. a #GFileInfo. attribute name to set. int64 value to set attribute to. Replaces all occurances of the pattern in @regex with the replacement text. Backreferences of the form '\number' or '\g<number>' in the replacement text are interpolated by the number-th captured subexpression of the match, '\g<name>' refers to the captured subexpression with the given name. '\0' refers to the complete match, but '\0' followed by a number is the octal representation of a character. To include a literal '\' in the replacement, write '\\'. There are also escapes that changes the case of the following text: <variablelist> <varlistentry><term>\l</term> <listitem> <para>Convert to lower case the next character</para> </listitem> </varlistentry> <varlistentry><term>\u</term> <listitem> <para>Convert to upper case the next character</para> </listitem> </varlistentry> <varlistentry><term>\L</term> <listitem> <para>Convert to lower case till \E</para> </listitem> </varlistentry> <varlistentry><term>\U</term> <listitem> <para>Convert to upper case till \E</para> </listitem> </varlistentry> <varlistentry><term>\E</term> <listitem> <para>End case modification</para> </listitem> </varlistentry> </variablelist> If you do not need to use backreferences use g_regex_replace_literal(). The @replacement string must be UTF-8 encoded even if #G_REGEX_RAW was passed to g_regex_new(). If you want to use not UTF-8 encoded stings you can use g_regex_replace_literal(). Setting @start_position differs from just passing over a shortened string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern that begins with any kind of lookbehind assertion, such as "\b". a #GRegex structure the string to perform matches against the length of @string, or -1 if @string is nul-terminated starting index of the string to match text to replace each match with options for the match location to store the error occuring, or %NULL to ignore errors a newly allocated string containing the replacements Since: 2.14 Reads an unsigned 16-bit/2-byte value from @stream. In order to get the correct byte order for this read operation, see g_data_stream_get_byte_order() and g_data_stream_set_byte_order(). a given #GDataInputStream. optional #GCancellable object, %NULL to ignore. #GError for error reporting. an unsigned 16-bit/2-byte value read from the @stream or %0 if an error occurred. Creates a new parse context. A parse context is used to parse marked-up documents. You can feed any number of documents into a context, as long as no errors occur; once an error occurs, the parse context can't continue to parse text (you have to free it and create a new parse context). a #GMarkupParser one or more #GMarkupParseFlags user data to pass to #GMarkupParser functions user data destroy notifier called when the parse context is freed a new #GMarkupParseContext Looks up the #GUnicodeScript for a particular character (as defined by Unicode Standard Annex #24). No check is made for @ch being a valid Unicode character; if you pass in invalid character, the result is undefined. This function is equivalent to pango_script_for_unichar() and the two are interchangeable. a Unicode character the #GUnicodeScript for the character. Since: 2.14 Destroys the #GTree. If keys and/or values are dynamically allocated, you should either free them first or create the #GTree using g_tree_new_full(). In the latter case the destroy functions you supplied will be called on all keys and values before destroying the #GTree. a #GTree. Closes the directory and deallocates all related resources. a #GDir* created by g_dir_open() Sets a flag on the closure to indicate that it's calling environment has become invalid, and thus causes any future invocations of g_closure_invoke() on this @closure to be ignored. Also, invalidation notifiers installed on the closure will be called at this point. Note that unless you are holding a reference to the closure yourself, the invalidation notifiers may unref the closure and cause it to be destroyed, so if you need to access the closure after calling g_closure_invalidate(), make sure that you've previously called g_closure_ref(). Note that g_closure_invalidate() will also be called when the reference count of a closure drops to zero (unless it has already been invalidated before). GClosure to invalidate Sets the required type for @extension_point to @type. All implementations must henceforth have this type. a #GIOExtensionPoint the #GType to require Creates a new buffered output stream with a given buffer size. a #GOutputStream. a #gsize. a #GOutputStream with an internal buffer set to @size. Calls the @unuse_plugin function from the #GTypePluginClass of @plugin. There should be no need to use this function outside of the GObject type system itself. a #GTypePlugin Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value. If @attribute is of a different type, this operation will fail, returning %FALSE. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. a string containing the attribute's name. a string containing the attribute's new value. a #GFileQueryInfoFlags. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise. Breaks the string on the pattern, and returns an array of the tokens. If the pattern contains capturing parentheses, then the text for each of the substrings will also be returned. If the pattern does not match anywhere in the string, then the whole string is returned as the first token. As a special case, the result of splitting the empty string "" is an empty vector, not a vector containing a single string. The reason for this special case is that being able to represent a empty vector is typically more useful than consistent handling of empty elements. If you do need to represent empty elements, you'll need to check for the empty string before calling this function. A pattern that can match empty strings splits @string into separate characters wherever it matches the empty string between characters. For example splitting "ab c" using as a separator "\s*", you will get "a", "b" and "c". Setting @start_position differs from just passing over a shortened string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern that begins with any kind of lookbehind assertion, such as "\b". a #GRegex structure the string to split with the pattern the length of @string, or -1 if @string is nul-terminated starting index of the string to match match time option flags the maximum number of tokens to split @string into. If this is less than 1, the string is split completely return location for a #GError a %NULL-terminated gchar ** array. Free it using g_strfreev() Since: 2.14 Connects a #GCallback function to a signal for a particular object. Similar to g_signal_connect(), but allows to provide a #GClosureNotify for the data which will be called when the signal handler is disconnected and no longer used. Specify @connect_flags if you need <literal>..._after()</literal> or <literal>..._swapped()</literal> variants of this function. the instance to connect to. a string of the form "signal-name::detail". the #GCallback to connect. data to pass to @c_handler calls. a #GClosureNotify for @data. a combination of #GConnectFlags. the handler id A wrapper for the POSIX chmod() function. The chmod() function is used to set the permissions of a file system object. On Windows the file protection mechanism is not at all POSIX-like, and the underlying chmod() function in the C library just sets or clears the FAT-style READONLY attribute. It does not touch any ACL. Software that needs to manage file permissions on Windows exactly should use the Win32 API. See your C library manual for more details about chmod(). a pathname in the GLib file name encoding (UTF-8 on Windows) as in chmod() zero if the operation succeeded, -1 on error. Since: 2.8 Retrieves the text matching the capturing parentheses named @name. If @name is a valid sub pattern name but it didn't match anything (e.g. sub pattern "X", matching "b" against "(?P<X>a)?b") then an empty string is returned. The string is fetched from the string passed to the match function, so you cannot call this function after freeing the string. #GMatchInfo structure name of the subexpression The matched substring, or %NULL if an error occurred. You have to free the string yourself Since: 2.14 Completes an asynchronous function in the main event loop using an idle function. a #GSimpleAsyncResult. Sets the @attribute to contain the given @attr_value, if possible. a #GFileInfo. a file attribute key. a byte string. Puts an unsigned 64-bit integer into the stream. a #GDataOutputStream. a #guint64. optional #GCancellable object, %NULL to ignore. a #GError, %NULL to ignore. %TRUE if @data was successfully added to the @stream. Adds @group to the list of groups to which the bookmark for @uri belongs to. If no bookmark for @uri is found then it is created. Since: 2.12 a #GBookmarkFile a valid URI the group name to be added Adds a new item to the front of @seq a #GSequence the data for the new item an iterator pointing to the new item Since: 2.14 Convert a string from UTF-8 to UTF-16. A 0 character will be added to the result after the converted text. a UTF-8 encoded string the maximum length (number of characters) of @str to use. If @len < 0, then the string is nul-terminated. location to store number of bytes read, or %NULL. If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will be returned in case @str contains a trailing partial character. If an error occurs then the index of the invalid input is stored here. location to store number of <type>gunichar2</type> written, or %NULL. The value stored here does not include the trailing 0. location to store the error occuring, or %NULL to ignore errors. Any of the errors in #GConvertError other than %G_CONVERT_ERROR_NO_CONVERSION may occur. a pointer to a newly allocated UTF-16 string. This value must be freed with g_free(). If an error occurs, %NULL will be returned and @error set. Add a property to an interface; this is only useful for interfaces that are added to GObject-derived types. Adding a property to an interface forces all objects classes with that interface to have a compatible property. The compatible property could be a newly created #GParamSpec, but normally g_object_class_override_property() will be used so that the object class only needs to provide an implementation and inherits the property description, default value, bounds, and so forth from the interface property. This function is meant to be called from the interface's default vtable initialization function (the @class_init member of #GTypeInfo.) It must not be called after after @class_init has been called for any object types implementing this interface. Since: 2.4 any interface vtable for the interface, or the default vtable for the interface. the #GParamSpec for the new property Gets the requested information about specified @file. The result is a #GFileInfo object that contains key-value attributes (such as the type or size of the file). The @attribute value is a string that specifies the file attributes that should be gathered. It is not an error if it's not possible to read a particular requested attribute from a file - it just won't be set. @attribute should be a comma-separated list of attribute or attribute wildcards. The wildcard "*" means all attributes, and a wildcard like "standard::*" means all attributes in the standard namespace. An example attribute query be "standard::*,owner::user". The standard attributes are available as defines, like #G_FILE_ATTRIBUTE_STANDARD_NAME. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. For symlinks, normally the information about the target of the symlink is returned, rather than information about the symlink itself. However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS in @flags the information about the symlink itself will be returned. Also, for symlinks that point to non-existing files the information about the symlink itself will be returned. If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on. input #GFile. an attribute query string. a set of #GFileQueryInfoFlags. optional #GCancellable object, %NULL to ignore. a #GError. a #GFileInfo for the given @file, or %NULL on error. Formats a size (for example the size of a file) into a human readable string. Sizes are rounded to the nearest size prefix (KB, MB, GB) and are displayed rounded to the nearest tenth. E.g. the file size 3292528 bytes will be converted into the string "3.1 MB". The prefix units base is 1024 (i.e. 1 KB is 1024 bytes). a size in bytes. a formatted string containing a human readable file size. Since: 2.16 Removes an element from a #GList. If two elements contain the same data, only the first is removed. If none of the elements contain the data, the #GList is unchanged. a #GList the data of the element to remove the new start of the #GList A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, gpointer arg1, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs ignored 2 a #GValue array holding the instance and the #gpointer parameter the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Sets a function to be called when the child indicated by @pid exits, at the priority @priority. If you obtain @pid from g_spawn_async() or g_spawn_async_with_pipes() you will need to pass #G_SPAWN_DO_NOT_REAP_CHILD as flag to the spawn function for the child watching to work. Note that on platforms where #GPid must be explicitly closed (see g_spawn_close_pid()) @pid must not be closed while the source is still active. Typically, you will want to call g_spawn_close_pid() in the callback function for the source. GLib supports only a single callback per process id. the priority of the idle source. Typically this will be in the range between #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE. process to watch. On POSIX the pid of a child process. On Windows a handle for a process (which doesn't have to be a child). function to call data to pass to @function function to call when the idle is removed, or %NULL the ID (greater than 0) of the event source. Since: 2.4 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. the name of the extension point the #GType to register as extension the name for the extension the priority for the extension a #GIOExtension object for #GType Frees context and all the groups which have been added to it. Since: 2.6 a #GOptionContext Sets the current position in the #GIOChannel, similar to the standard library function fseek(). a #GIOChannel an offset, in bytes, which is added to the position specified by @type the position in the file, which can be %G_SEEK_CUR (the current position), %G_SEEK_SET (the start of the file), or %G_SEEK_END (the end of the file) %G_IO_ERROR_NONE if the operation was successful. Deprecated:2.2: Use g_io_channel_seek_position() instead. Converts all Unicode characters in the string that have a case to lowercase. The exact manner that this is done depends on the current locale, and may result in the number of characters in the string changing. a UTF-8 encoded string length of @str, in bytes, or -1 if @str is nul-terminated. a newly allocated string, with all characters converted to lowercase. Finishes ejecting a mount. If any errors occurred during the operation, @error will be set to contain the errors and %FALSE will be returned. a #GMount. a #GAsyncResult. a #GError location to store the error occuring, or %NULL to ignore. %TRUE if the mount was successfully ejected. %FALSE otherwise. #GIcon is a very minimal interface for icons. It provides functions for checking the equality of two icons and hashing of icons. #GIcon does not provide the actual pixmap for the icon as this is out of GIO's scope, however implementations of #GIcon may contain the name of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon). To obtain a hash of a #GIcon, see g_icon_hash(). To check if two #GIcons are equal, see g_icon_equal(). Interface for icons gio/gio.h Gets the attribute status for an attribute key. a #GFileInfo a file attribute key a #GFileAttributeStatus for the given @attribute, or %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid. This function outputs @bookmark into a file. The write process is guaranteed to be atomic by using g_file_set_contents() internally. a #GBookmarkFile path of the output file return location for a #GError, or %NULL %TRUE if the file was successfully written. Since: 2.12 Turns on flag values for a data list. This function is used to keep a small number of boolean flags in an object with a data list without using any additional space. It is not generally useful except in circumstances where space is very tight. (It is used in the base #GObject type, for example.) Since: 2.8 pointer to the location that holds a list the flags to turn on. The values of the flags are restricted by %G_DATALIST_FLAGS_MASK (currently 3; giving two possible boolean flags). A value for @flags that doesn't fit within the mask is an error. Sets the byte order of the data output stream to @order. a #GDataOutputStream. a %GDataStreamByteOrder. This function works like g_param_spec_set_qdata(), but in addition, a <literal>void (*destroy) (gpointer)</literal> function may be specified which is called with @data as argument when the @pspec is finalized, or the data is being overwritten by a call to g_param_spec_set_qdata() with the same @quark. the #GParamSpec to set store a user data pointer a #GQuark, naming the user data pointer an opaque user data pointer function to invoke with @data as argument, when @data needs to be freed Atomically decrements the reference count of @hash_table by one. If the reference count drops to 0, all keys and values will be destroyed, and all memory allocated by the hash table is released. This function is MT-safe and may be called from any thread. Since: 2.10 a valid #GHashTable. Gets the file descriptor for a cancellable job. This can be used to implement cancellable operations on Unix systems. The returned fd will turn readable when @cancellable is cancelled. a #GCancellable. A valid file descriptor. %-1 if the file descriptor is not supported, or on errors. Checks if a attribute matcher only matches a given attribute. Always Returns: %TRUE if the matcher only matches @attribute. %FALSE otherwise. a #GFileAttributeMatcher. a file attribute key. %TRUE if the matcher only matches @attribute. %FALSE otherwise. Copies %NULL-terminated array of strings. The copy is a deep copy; the new array should be freed by first freeing each string, then the array itself. g_strfreev() does this for you. If called on a %NULL value, g_strdupv() simply returns %NULL. %NULL-terminated array of strings. a new %NULL-terminated array of strings. Checks if a drive can be ejected. pointer to a #GDrive. %TRUE if the @drive can be ejected. %FALSE otherwise. Adds a string onto the end of a #GString, expanding it if necessary. a #GString the string to append onto the end of @string @string Gets the number of bookmarks inside @bookmark. a #GBookmarkFile the number of bookmarks Since: 2.12 Return value: a newly allocated %NULL-terminated array of strings. a #GBookmarkFile return location for the number of returned URIs, or %NULL a newly allocated %NULL-terminated array of strings. Use g_strfreev() to free it. Since: 2.12 Closes an output stream. a #GOutputStream. a #GAsyncResult. a #GError location to store the error occuring, or %NULL to ignore. %TRUE if stream was successfully closed, %FALSE otherwise. Transforms @src_value into @dest_value if possible, and then validates @dest_value, in order for it to conform to @pspec. If @strict_validation is %TRUE this function will only succeed if the transformed @dest_value complied to @pspec without modifications. See also g_value_type_transformable(), g_value_transform() and g_param_value_validate(). a valid #GParamSpec souce #GValue destination #GValue of correct type for @pspec %TRUE requires @dest_value to conform to @pspec without modifications %TRUE if transformation and validation were successful, %FALSE otherwise and @dest_value is left untouched. Like g_sequence_insert_sorted(), but uses a #GSequenceIterCompareFunc instead of a #GCompareDataFunc as the compare function. a #GSequence data for the new item the #GSequenceItercompare used to compare iterators in the sequence. It is called with two iterators pointing into @seq. It should return 0 if the iterators are equal, a negative value if the first iterator comes before the second, and a positive value if the second iterator comes before the first. user data passed to @cmp_func a #GSequenceIter pointing to the new item Since: 2.14 Return value: a #GList containing the desktop ids which claim a mime type. a #GList containing the desktop ids which claim to handle @mime_type. Adds a new element at the tail of the queue. a #GQueue. a single #GList element, <emphasis>not</emphasis> a list with more than one element. Creates a new child_watch source. The source will not initially be associated with any #GMainContext and must be added to one with g_source_attach() before it will be executed. Note that child watch sources can only be used in conjunction with <literal>g_spawn...</literal> when the %G_SPAWN_DO_NOT_REAP_CHILD flag is used. Note that on platforms where #GPid must be explicitly closed (see g_spawn_close_pid()) @pid must not be closed while the source is still active. Typically, you will want to call g_spawn_close_pid() in the callback function for the source. Note further that using g_child_watch_source_new() is not compatible with calling <literal>waitpid(-1)</literal> in the application. Calling waitpid() for individual pids will still work fine. process to watch. On POSIX the pid of a child process. On Windows a handle for a process (which doesn't have to be a child). the newly-created child watch source Since: 2.4 Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info to the given symlink target. a #GFileInfo. a static string containing a path to a symlink target. Compares two unix mount points. a #GUnixMount. a #GUnixMount. 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively. Gets a signed 32-bit integer contained within the attribute. If the attribute does not contain a signed 32-bit integer, or is invalid, 0 will be returned. a #GFileInfo. a file attribute key. a signed 32-bit integer from the attribute. This function creates a new %G_TYPE_BOXED derived type id for a new boxed type with name @name. Boxed type handling functions have to be provided to copy and free opaque boxed structures of this type. Name of the new boxed type. Boxed structure copy function. Boxed structure free function. New %G_TYPE_BOXED derived type id for @name. Creates a new idle source. The source will not initially be associated with any #GMainContext and must be added to one with g_source_attach() before it will be executed. Note that the default priority for idle sources is %G_PRIORITY_DEFAULT_IDLE, as compared to other sources which have a default priority of %G_PRIORITY_DEFAULT. the newly-created idle source Sets a property on an object. a #GObject the name of the property to set the value Adds a copy of the first @len bytes of @string to the #GStringChunk. The copy is nul-terminated. Since this function does not stop at nul bytes, it is the caller's responsibility to ensure that @string has at least @len addressable bytes. The characters in the returned string can be changed, if necessary, though you should not change anything after the end of the string. a #GStringChunk bytes to insert number of bytes of @string to insert, or -1 to insert a nul-terminated string a pointer to the copy of @string within the #GStringChunk Since: 2.4 Removes the node link_ from the list and frees it. Compare this to g_list_remove_link() which removes the node without freeing it. a #GList node to delete from @list the new head of @list Get the contents of a %G_TYPE_UCHAR #GValue. a valid #GValue of type %G_TYPE_UCHAR unsigned character contents of @value Emitted when the unix mount points have changed. Ejects a drive. a #GDrive. flags affecting the unmount if required for eject optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback, or %NULL. a #gpointer. Return value: a %NULL-terminated array of strings owned by GLib that must a %NULL-terminated array of strings owned by GLib that must not be modified or freed. Since: 2.6 Gets the base stream for the filter stream. a #GFilterInputStream. a #GInputStream. Converts a #GString to lowercase. a #GString the #GString. Deprecated:2.2: This function uses the locale-specific tolower() function, which is almost never the right thing. Use g_string_ascii_down() or g_utf8_strdown() instead. Converts a string to upper case. the string to convert. the string Deprecated:2.2: This function is totally broken for the reasons discussed in the g_strncasecmp() docs - use g_ascii_strup() or g_utf8_strup() instead. Return value: the number of key/value pairs in the #GHashTable. a #GHashTable. the number of key/value pairs in the #GHashTable. This function is essentially the same as g_type_class_ref(), except that the classes reference count isn't incremented. As a consequence, this function may return %NULL if the class of the type passed in does not currently exist (hasn't been referenced before). Type ID of a classed type. The #GTypeClass structure for the given type ID or %NULL if the class does not currently exist. Checks whether the bookmark for @uri inside @bookmark has been registered by application @name. In the event the URI cannot be found, %FALSE is returned and @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. a #GBookmarkFile a valid URI the name of the application return location for a #GError or %NULL %TRUE if the application @name was found Since: 2.12 Copies a block of memory @len bytes long, from @src to @dest. The source and destination areas may overlap. In order to use this function, you must include <filename>string.h</filename> yourself, because this macro will typically simply resolve to memmove() and GLib does not include <filename>string.h</filename> for you. the destination address to copy the bytes to. the source address to copy the bytes from. the number of bytes to copy. Sets an error within the asynchronous result without a #GError. Unless writing a binding, see g_simple_async_result_set_error(). a #GSimpleAsyncResult. a #GQuark (usually #G_IO_ERROR). an error code. a formatted error reporting string. va_list of arguments. A marshaller for a #GCClosure with a callback of type <literal>gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal> where the #gint parameter denotes a flags type. the #GClosure to which the marshaller belongs a #GValue which can store the returned #gboolean 2 a #GValue array holding instance and arg1 the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Sends @file to the "Trashcan", if possible. This is similar to deleting it, but the user can recover it before emptying the trashcan. Not all file systems support trashing, so this call can return the %G_IO_ERROR_NOT_SUPPORTED error. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. #GFile to send to trash. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL %TRUE on successful trash, %FALSE otherwise. A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs ignored 2 a #GValue array holding the instance and the #gchar* parameter the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Queries the type system for information about a specific type. This function will fill in a user-provided structure to hold type-specific information. If an invalid #GType is passed in, the @type member of the #GTypeQuery is 0. All members filled into the #GTypeQuery structure should be considered constant and have to be left untouched. the #GType value of a static, classed type. A user provided structure that is filled in with constant values upon success. Emitted when a drive changes. The volume monitor emitting the signal. the drive that changed Gets a choice from the mount operation. a #GMountOperation. an integer containing an index of the user's choice from the choice's list, or %0. Allocate and initialize a new #GValueArray, optionally preserve space for @n_prealloced elements. New arrays always contain 0 elements, regardless of the value of @n_prealloced. number of values to preallocate space for a newly allocated #GValueArray with 0 values Return value: length of @str_array. a %NULL-terminated array of strings. length of @str_array. Since: 2.6 Sets the maximal number of unused threads to @max_threads. If @max_threads is -1, no limit is imposed on the number of unused threads. maximal number of unused threads Sets whether to handle cancellation within the asynchronous operation. a #GSimpleAsyncResult. a #gboolean. Stops emission of "notify" signals on @object. The signals are queued until g_object_thaw_notify() is called on @object. This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified. a #GObject Gets the parent directory for the @file. If the @file represents the root directory of the file system, then %NULL will be returned. This call does no blocking i/o. input #GFile. a #GFile structure to the parent of the given #GFile or %NULL if there is no parent. Sets a list of group names for the item with URI @uri. Each previously set group name list is removed. If @uri cannot be found then an item for it is created. Since: 2.12 a #GBookmarkFile an item's URI an array of group names, or %NULL to remove all groups number of group name values in @groups Gets the number of nodes in a tree. a #GNode which types of children are to be counted, one of %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES the number of nodes in the tree Increases the reference count on a source by one. a #GSource @source Tries to become the owner of the specified context, as with g_main_context_acquire(). But if another thread is the owner, atomically drop @mutex and wait on @cond until that owner releases ownership or until @cond is signaled, then try again (once) to become the owner. a #GMainContext a condition variable a mutex, currently held %TRUE if the operation succeeded, and this thread is now the owner of @context. Reads the partial contents of a file. A #GFileReadMoreCallback should be used to stop reading from the file when appropriate, else this function will behave exactly as g_file_load_contents_async(). This operation can be finished by g_file_load_partial_contents_finish(). Users of this function should be aware that @user_data is passed to both the @read_more_callback and the @callback. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. optional #GCancellable object, %NULL to ignore. a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read. a #GAsyncReadyCallback to call when the request is satisfied the data to pass to the callback functions. Return the value contents as pointer. This function asserts that g_value_fits_pointer() returned %TRUE for the passed in value. This is an internal function introduced mainly for C marshallers. An initialized #GValue structure. %TRUE if @value will fit inside a pointer value. the quark used as %G_IO_CHANNEL_ERROR Returns: whether @handler_id identifies a handler connected to @instance. The instance where a signal handler is sought. the handler id. whether @handler_id identifies a handler connected to @instance. Adds a #GOptionGroup to the @context, so that parsing with @context will recognize the options in the group. Note that the group will be freed together with the context when g_option_context_free() is called, so you must not free the group yourself after adding it to a context. Since: 2.6 a #GOptionContext the group to add 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 file name or path to be parsed. a new #GFile. Determines whether a character is printable. Unlike g_unichar_isgraph(), returns %TRUE for spaces. Given some UTF-8 text, obtain a character value with g_utf8_get_char(). a Unicode character %TRUE if @c is printable Get the contents of a %G_TYPE_INT #GValue. a valid #GValue of type %G_TYPE_INT integer contents of @value Set the contents of a %G_TYPE_ENUM #GValue to @v_enum. a valid #GValue whose type is derived from %G_TYPE_ENUM enum value to be set Removes a file descriptor from the set of file descriptors polled for this source. a #GSource a #GPollFD structure previously passed to g_source_add_poll(). Gets the local #GVfs for the system. a #GVfs. Converts a string to a #gdouble value. This function behaves like the standard strtod() function does in the C locale. It does this without actually changing the current locale, since that would not be thread-safe. This function is typically used when reading configuration files or other non-user input that should be locale independent. To handle input from the user you should normally use the locale-sensitive system strtod() function. To convert from a #gdouble to a string in a locale-insensitive way, use g_ascii_dtostr(). If the correct value would cause overflow, plus or minus %HUGE_VAL is returned (according to the sign of the value), and %ERANGE is stored in %errno. If the correct value would cause underflow, zero is returned and %ERANGE is stored in %errno. This function resets %errno before calling strtod() so that you can reliably detect overflow and underflow. the string to convert to a numeric value. if non-%NULL, it returns the character after the last character used in the conversion. the #gdouble value. Return value: the length of the string in characters pointer to the start of a UTF-8 encoded string. the maximum number of bytes to examine. If @max is less than 0, then the string is assumed to be nul-terminated. If @max is 0, @p will not be examined and may be %NULL. the length of the string in characters Unescapes a whole escaped string. If any of the characters in @illegal_characters or the character zero appears as an escaped character in @escaped_string then that is an error and %NULL will be returned. This is useful it you want to avoid for instance having a slash being expanded in an escaped path element, which might confuse pathname handling. an escaped string to be unescaped. an optional string of illegal characters not to be allowed. an unescaped version of @escaped_string. The returned string should be freed when no longer needed. Since: 2.16 Gets the attribute type, value and status for an attribute key. a #GFileInfo a file attribute key return location for the attribute type, or %NULL return location for the attribute value, or %NULL return location for the attribute status, or %NULL %TRUE if @info has an attribute named @attribute, %FALSE otherwise. Tests if the stream can be truncated. a #GSeekable. %TRUE if the stream can be truncated, %FALSE otherwise. Remove all elemeents in @queue which contains @data. Since: 2.4 a #GQueue data to remove Gets a child of a #GNode, using the given index. The first child is at index 0. If the index is too big, %NULL is returned. a #GNode the index of the desired child the child of @node at index @n The :newline-type property determines what is considered as a line ending when reading complete lines from the stream. Writes a formatted string into a #GString. This is similar to the standard sprintf() function, except that the #GString buffer automatically expands to contain the results. The previous contents of the #GString are destroyed. Deprecated: This function has been renamed to g_string_printf(). a #GString the string format. See the sprintf() documentation the parameters to insert into the format string Gets the number of elements in a #GSList. <note><para> This function iterates over the whole list to count its elements. </para></note> a #GSList the number of elements in the #GSList Asynchronously opens @file for reading. For more details, see g_file_read() which is the synchronous version of this call. When the operation is finished, @callback will be called. You can then call g_file_read_finish() to get the result of the operation. input #GFile. the <link linkend="io-priority">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied the data to pass to callback function Get the contents of a %G_TYPE_FLOAT #GValue. a valid #GValue of type %G_TYPE_FLOAT float contents of @value Call @thread_func on all existing #GThread structures. Note that threads may decide to exit while @thread_func is running, so without intimate knowledge about the lifetime of foreign threads, @thread_func shouldn't access the GThread* pointer passed in as first argument. However, @thread_func will not be called for threads which are known to have exited already. Due to thread lifetime checks, this function has an execution complexity which is quadratic in the number of existing threads. Since: 2.10 function to call for all GThread structures second argument to @thread_func Sets properties on an object. a #GObject name of the first property to set value for the first property, followed optionally by more name/value pairs, followed by %NULL Breaks the string on the pattern, and returns an array of the tokens. If the pattern contains capturing parentheses, then the text for each of the substrings will also be returned. If the pattern does not match anywhere in the string, then the whole string is returned as the first token. This function is equivalent to g_regex_split() but it does not require to compile the pattern with g_regex_new(), avoiding some lines of code when you need just to do a split without extracting substrings, capture counts, and so on. If this function is to be called on the same @pattern more than once, it's more efficient to compile the pattern once with g_regex_new() and then use g_regex_split(). As a special case, the result of splitting the empty string "" is an empty vector, not a vector containing a single string. The reason for this special case is that being able to represent a empty vector is typically more useful than consistent handling of empty elements. If you do need to represent empty elements, you'll need to check for the empty string before calling this function. A pattern that can match empty strings splits @string into separate characters wherever it matches the empty string between characters. For example splitting "ab c" using as a separator "\s*", you will get "a", "b" and "c". the regular expression the string to scan for matches compile options for the regular expression match options a %NULL-terminated gchar ** array. Free it using g_strfreev() Since: 2.14 Report the result of a performance or measurement test. The test should generally strive to minimize the reported quantities (smaller values are better than larger ones), this and @minimized_quantity can determine sorting order for test result reports. Since: 2.16 the reported value the format string of the report message arguments to pass to the printf() function Gets a hash for an icon. #gconstpointer to an icon object. a #guint containing a hash for the @icon, suitable for use in a #GHashTable or similar data structure. Registers a new static enumeration type with the name @name. It is normally more convenient to let <link linkend="glib-mkenums">glib-mkenums</link> generate a my_enum_get_type() function from a usual C enumeration definition than to write one yourself using g_enum_register_static(). A nul-terminated string used as the name of the new type. An array of #GEnumValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0. GObject keeps a reference to the data, so it cannot be stack-allocated. The new type identifier. Each object carries around a table of associations from strings to pointers. This function lets you set an association. If the object already had an association with that name, the old association will be destroyed. #GObject containing the associations. name of the key data to associate with that key Calls a function for each of the children of a #GNode. Note that it doesn't descend beneath the child nodes. a #GNode which types of children are to be visited, one of %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES the function to call for each visited node user data to pass to the function Append a name to the list of icons from within @icon. <note><para> Note that doing so invalidates the hash computed by prior calls to g_icon_hash(). </para></note> a #GThemedIcon name of icon to append to list of icons from within @icon. The setlocale() function in the Microsoft C library uses locale names of the form "English_United States.1252" etc. We want the UNIXish standard form "en_US", "zh_TW" etc. This function gets the current thread locale from Windows - without any encoding info - and returns it as a string of the above form for use in forming file names etc. The returned string should be deallocated with g_free(). newly-allocated locale name. Retrieves the name of the currently open element. If called from the start_element or end_element handlers this will give the element_name as passed to those functions. For the parent elements, see g_markup_parse_context_get_element_stack(). Since: 2.2 a #GMarkupParseContext the name of the currently open element, or %NULL Create a directory if it doesn't already exist. Create intermediate parent directories as needed, too. a pathname in the GLib file name encoding permissions to use for newly created directories 0 if the directory already exists, or was successfully created. Returns -1 if an error occurred, with errno set. Since: 2.8 Gets the type associated with @extension. a #GIOExtension the type of @extension Puts a signed 32-bit integer into the output stream. a #GDataOutputStream. a #gint32. optional #GCancellable object, %NULL to ignore. a #GError, %NULL to ignore. %TRUE if @data was successfully added to the @stream. Copies a @queue. Note that is a shallow copy. If the elements in the queue consist of pointers to data, the pointers are copied, but the actual data is not. a #GQueue A copy of @queue Since: 2.4 Sorts @queue using @compare_func. Since: 2.4 a #GQueue the #GCompareDataFunc used to sort @queue. This function is passed two elements of the queue and should return 0 if they are equal, a negative value if the first comes before the second, and a positive value if the second comes before the first. user data passed to @compare_func Returns: a canonical representation for the string a static string a canonical representation for the string Since: 2.10 Determines if a character is uppercase. a Unicode character %TRUE if @c is an uppercase character A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, gfloat arg1, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs ignored 2 a #GValue array holding the instance and the #gfloat parameter the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Gets the child of @file for a given @display_name (i.e. a UTF8 version of the name). If this function fails, it returns %NULL and @error will be set. This is very useful when constructing a GFile for a new file and the user entered the filename in the user interface, for instance when you select a directory and type a filename in the file selector. This call does no blocking i/o. input #GFile. string to a possible child. #GError. a #GFile to the specified child, or %NULL if the display name couldn't be converted. Associates a new string value with @key under @group_name. If @key cannot be found then it is created. If @group_name cannot be found then it is created. Since: 2.6 a #GKeyFile a group name a key a string Return value: the values associated with the key as a list of a #GKeyFile a group name a key the number of booleans returned return location for a #GError the values associated with the key as a list of booleans, or %NULL if the key was not found or could not be parsed. Since: 2.6 Create a new #GTestCase, named @test_name, this API is fairly low level, calling g_test_add() or g_test_add_func() is preferable. When this test is executed, a fixture structure of size @data_size will be allocated and filled with 0s. Then data_setup() is called to initialize the fixture. After fixture setup, the actual test function data_test() is called. Once the test run completed, the fixture structure is torn down by calling data_teardown() and after that the memory is released. Splitting up a test run into fixture setup, test function and fixture teardown is most usful if the same fixture is used for multiple tests. In this cases, g_test_create_case() will be called with the same fixture, but varying @test_name and @data_test arguments. the name for the test case the size of the fixture data structure test data argument for the test functions the function to set up the fixture data the actual test function the function to teardown the fixture data a newly allocated #GTestCase. Since: 2.16 Copies all of the #GFileAttribute<!-- -->s from @src_info to @dest_info. source to copy attributes from. destination to copy attributes to. Return a pointer to the value at @index_ containd in @value_array. #GValueArray to get a value from index of the value of interest pointer to a value at @index_ in @value_array Removes the source with the given id from the default main context. The id of a #GSource is given by g_source_get_id(), or will be returned by the functions g_source_attach(), g_idle_add(), g_idle_add_full(), g_timeout_add(), g_timeout_add_full(), g_child_watch_add(), g_child_watch_add_full(), g_io_add_watch(), and g_io_add_watch_full(). See also g_source_destroy(). the ID of the source to remove. %TRUE if the source was found and removed. Inserts a new element into the list, using the given comparison function to determine its position. a #GSList the data for the new element the function to compare elements in the list. It should return a number > 0 if the first parameter comes after the second parameter in the sort order. data to pass to comparison function the new start of the #GSList Since: 2.10 Places a comment above @key from @group_name. If @key is %NULL then @comment will be written above @group_name. If both @key and @group_name are %NULL, then @comment will be written above the first group in the file. a #GKeyFile a group name, or %NULL a key a comment return location for a #GError %TRUE if the comment was written, %FALSE otherwise Since: 2.6 Registers a private structure for an instantiatable type; when an object is allocated, the private structures for the type and all of its parent types are allocated sequentially in the same memory block as the public structures. This function should be called in the type's class_init() function. The private structure can be retrieved using the G_TYPE_INSTANCE_GET_PRIVATE() macro. The following example shows attaching a private structure <structname>MyObjectPrivate</structname> to an object <structname>MyObject</structname> defined in the standard GObject fashion. |[ typedef struct _MyObjectPrivate MyObjectPrivate; struct _MyObjectPrivate { int some_field; }; #define MY_OBJECT_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), MY_TYPE_OBJECT, MyObjectPrivate)) static void my_object_class_init (MyObjectClass *klass) { g_type_class_add_private (klass, sizeof (MyObjectPrivate)); } static int my_object_get_some_field (MyObject *my_object) { MyObjectPrivate *priv = MY_OBJECT_GET_PRIVATE (my_object); return priv->some_field; } ]| Since: 2.4 class structure for an instantiatable type size of private structure. An implementation of the standard printf() function which supports positional parameters, as specified in the Single Unix Specification. a standard printf() format string, but notice <link linkend="string-precision">string precision pitfalls</link>. the arguments to insert in the output. the number of bytes printed. Since: 2.2 Looks whether the desktop bookmark has an item with its URI set to @uri. a #GBookmarkFile a valid URI %TRUE if @uri is inside @bookmark, %FALSE otherwise Since: 2.12 Sets an environment variable. Both the variable's name and value should be in the GLib file name encoding. On UNIX, this means that they can be any sequence of bytes. On Windows, they should be in UTF-8. Note that on some systems, when variables are overwritten, the memory used for the previous variables and its value isn't reclaimed. the environment variable to set, must not contain '='. the value for to set the variable to. whether to change the variable if it already exists. %FALSE if the environment variable couldn't be set. Since: 2.4 Sets the application as the default handler for the given file extention. a #GAppInfo. a string containing the file extension (without the dot). a #GError. %TRUE on success, %FALSE on error. Inserts a new element into the list at the given position. a #GSList the data for the new element the position to insert the element. If this is negative, or is larger than the number of elements in the list, the new element is added on to the end of the list. the new start of the #GSList Returns: %TRUE if @node is an ancestor of @descendant a #GNode a #GNode %TRUE if @node is an ancestor of @descendant Converts a string from one character set to another, possibly including fallback sequences for characters not representable in the output. Note that it is not guaranteed that the specification for the fallback sequences in @fallback will be honored. Some systems may do an approximate conversion from @from_codeset to @to_codeset in their iconv() functions, in which case GLib will simply return that approximate conversion. Note that you should use g_iconv() for streaming conversions<footnoteref linkend="streaming-state"/>. the string to convert the length of the string, or -1 if the string is nul-terminated<footnoteref linkend="nul-unsafe"/>. name of character set into which to convert @str character set of @str. UTF-8 string to use in place of character not present in the target encoding. (The string must be representable in the target encoding). If %NULL, characters not in the target encoding will be represented as Unicode escapes \uxxxx or \Uxxxxyyyy. location to store the number of bytes in the input string that were successfully converted, or %NULL. Even if the conversion was successful, this may be less than @len if there were partial characters at the end of the input. the number of bytes stored in the output buffer (not including the terminating nul). location to store the error occuring, or %NULL to ignore errors. Any of the errors in #GConvertError may occur. If the conversion was successful, a newly allocated nul-terminated string, which must be freed with g_free(). Otherwise %NULL and @error will be set. Adds a weak reference from weak_pointer to @object to indicate that the pointer located at @weak_pointer_location is only valid during the lifetime of @object. When the @object is finalized, @weak_pointer will be set to %NULL. The object that should be weak referenced. The memory address of a pointer. Sets the last time the bookmark for @uri was last modified. If no bookmark for @uri is found then it is created. The "modified" time should only be set when the bookmark's meta-data was actually changed. Every function of #GBookmarkFile that modifies a bookmark also changes the modification time, except for g_bookmark_file_set_visited(). Since: 2.12 a #GBookmarkFile a valid URI a timestamp or -1 to use the current time Creates a new #GParamSpecValueArray instance specifying a %G_TYPE_VALUE_ARRAY property. %G_TYPE_VALUE_ARRAY is a %G_TYPE_BOXED type, as such, #GValue structures for this property can be accessed with g_value_set_boxed() and g_value_get_boxed(). See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified a #GParamSpec describing the elements contained in arrays of this property, may be %NULL flags for the property specified a newly created parameter specification Gets the source object from a #GAsyncResult. a #GAsyncResult. the source object for the @res. Asynchronously overwrites the file, replacing the contents, possibly creating a backup copy of the file first. For more details, see g_file_replace() which is the synchronous version of this call. When the operation is finished, @callback will be called. You can then call g_file_replace_finish() to get the result of the operation. input #GFile. an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore. %TRUE if a backup should be created. a set of #GFileCreateFlags. the <link linkend="io-priority">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied the data to pass to callback function Converts all upper case ASCII letters to lower case ASCII letters. a GString passed-in @string pointer, with all the upper case characters converted to lower case in place, with semantics that exactly match g_ascii_tolower(). Gets the icon of the bookmark for @uri. In the event the URI cannot be found, %FALSE is returned and @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. a #GBookmarkFile a valid URI return location for the icon's location or %NULL return location for the icon's MIME type or %NULL return location for a #GError or %NULL %TRUE if the icon for the bookmark for the URI was found. You should free the returned strings. Since: 2.12 Gets the mount path for a unix mount point. a #GUnixMountPoint. a string containing the mount path. Gets the UUID for the @mount. The reference is typically based on the file system UUID for the mount in question and should be considered an opaque string. Returns %NULL if there is no UUID available. a #GMount. the UUID for @mount or %NULL if no UUID can be computed. Sets the seed for the random number generator #GRand to @seed. a #GRand. a value to reinitialize the random number generator. Free a #GValueArray including its contents. #GValueArray to free Resolves a relative path for @file to an absolute path. This call does no blocking i/o. input #GFile. a given relative path string. #GFile to the resolved path. %NULL if @relative_path is %NULL or if @file is invalid. Gets a named field from the objects table of associations (see g_object_set_data()). #GObject containing the associations name of the key for that association the data if found, or %NULL if no such data exists. Return value: a newly-allocated %NULL-terminated array of strings. a #GKeyFile a group name return location for the number of keys returned, or %NULL return location for a #GError, or %NULL a newly-allocated %NULL-terminated array of strings. Use g_strfreev() to free it. Since: 2.6 Set the contents of a %G_TYPE_UCHAR #GValue to @v_uchar. a valid #GValue of type %G_TYPE_UCHAR unsigned character value to be set Checks whether the allocator used by g_malloc() is the system's malloc implementation. If it returns %TRUE memory allocated with malloc() can be used interchangeable with memory allocated using g_malloc(). This function is useful for avoiding an extra copy of allocated memory returned by a non-GLib-based API. A different allocator can be set using g_mem_set_vtable(). if %TRUE, malloc() and g_malloc() can be mixed. Parses a string containing debugging options into a %guint containing bit flags. This is used within GDK and GTK+ to parse the debug options passed on the command line or through environment variables. a list of debug options separated by colons, spaces, or commas; or the string "all" to set all flags, or %NULL. pointer to an array of #GDebugKey which associate strings with bit flags. the number of #GDebugKey<!-- -->s in the array. the combined set of bit flags. Sets the display name for the current #GFileInfo. See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME. a #GFileInfo. a string containing a display name. Compares two unix mounts. first #GUnixMountEntry to compare. second #GUnixMountEntry to compare. 1, 0 or -1 if @mount1 is greater than, equal to, or less than @mount2, respectively. Get the nickname of a #GParamSpec. a valid #GParamSpec the nickname of @pspec. This function is intended for #GObject implementations to re-enforce a <link linkend="floating-ref">floating</link> object reference. Doing this is seldomly required, all #GInitiallyUnowned<!-- -->s are created with a floating reference which usually just needs to be sunken by calling g_object_ref_sink(). Since: 2.10 a #GObject Creates a new %G_TYPE_POINTER derived type id for a new pointer type with name @name. the name of the new pointer type. a new %G_TYPE_POINTER derived type id for @name. Removes the key/value pair currently pointed to by the iterator from its associated #GHashTable. Can only be called after g_hash_table_iter_next() returned %TRUE, and cannot be called more than once for the same key/value pair. If the #GHashTable was created using g_hash_table_new_full(), the key and value are freed using the supplied destroy functions, otherwise you have to make sure that any dynamically allocated values are freed yourself. Since: 2.16 an initialized #GHashTableIter. Adds a pair of notifiers which get invoked before and after the closure callback, respectively. This is typically used to protect the extra arguments for the duration of the callback. See g_object_watch_closure() for an example of marshal guards. a #GClosure data to pass to @pre_marshal_notify a function to call before the closure callback data to pass to @post_marshal_notify a function to call after the closure callback Get the contents of a %G_TYPE_UINT #GValue. a valid #GValue of type %G_TYPE_UINT unsigned integer contents of @value Traverses a tree starting at the given root #GNode. It calls the given function for each node visited. The traversal can be halted at any point by returning %TRUE from @func. the root #GNode of the tree to traverse the order in which nodes are visited - %G_IN_ORDER, %G_PRE_ORDER, %G_POST_ORDER, or %G_LEVEL_ORDER. which types of children are to be visited, one of %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES the maximum depth of the traversal. Nodes below this depth will not be visited. If max_depth is -1 all nodes in the tree are visited. If depth is 1, only the root is visited. If depth is 2, the root and its children are visited. And so on. the function to call for each visited #GNode user data to pass to the function Return value: a string owned by GLib that must not be modified a string owned by GLib that must not be modified or freed. Since: 2.6 Retrieves the current line number and the number of the character on that line. Intended for use in error messages; there are no strict semantics for what constitutes the "current" line number other than "the best number we could come up with for error messages." a #GMarkupParseContext return location for a line number, or %NULL return location for a char-on-line number, or %NULL This function will set the maximum @interval that a thread waiting in the pool for new tasks can be idle for before being stopped. This function is similar to calling g_thread_pool_stop_unused_threads() on a regular timeout, except, this is done on a per thread basis. By setting @interval to 0, idle threads will not be stopped. This function makes use of g_async_queue_timed_pop () using @interval. Since: 2.10 the maximum @interval (1/1000ths of a second) a thread can be idle. Reverts the effect of a previous call to g_object_freeze_notify(). This causes all queued "notify" signals on @object to be emitted. a #GObject Get a reproducible random integer number out of a specified range, see g_test_rand_int() for details on test case random numbers. the minimum value returned by this function the smallest value not to be returned by this function a number with @begin <= number < @end. Since: 2.16 Writes a formatted string into a #GString. This is similar to the standard sprintf() function, except that the #GString buffer automatically expands to contain the results. The previous contents of the #GString are destroyed. a #GString the string format. See the printf() documentation the parameters to insert into the format string This function will be deprecated in the future. Use g_win32_get_package_installation_directory_of_module() instead. Returns: a string containing the complete path to @subdir inside You should pass %NULL for this. The name of a DLL that a package provides, in UTF-8, or %NULL. A subdirectory of the package installation directory, also in UTF-8 a string containing the complete path to @subdir inside the installation directory of @package. The returned string is in the GLib file name encoding, i.e. UTF-8. The return value should be freed with g_free() when no longer needed. If something goes wrong, %NULL is returned. Appends @data to data that can be read from the input stream a #GMemoryInputStream input data length of the data, may be -1 if @data is a nul-terminated string function that is called to free @data, or %NULL Stops a signal's current emission. This will prevent the default method from running, if the signal was %G_SIGNAL_RUN_LAST and you connected normally (i.e. without the "after" flag). Prints a warning if used on a signal which isn't being emitted. the object whose signal handlers you wish to stop. the signal identifier, as returned by g_signal_lookup(). the detail which the signal was emitted with. Gets the human readable description of the content type. a content type string. a short description of the content type @type. Creates a new #GParamSpecLong instance specifying a %G_TYPE_LONG property. See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified minimum value for the property specified maximum value for the property specified default value for the property specified flags for the property specified a newly created parameter specification This is an internal function introduced mainly for C marshallers. Deprecated: 2.4: Use g_value_take_object() instead. a valid #GValue of %G_TYPE_OBJECT derived type object value to be set Inserts a new element into the list before the given position. a pointer to a #GList the list element before which the new element is inserted or %NULL to insert at the end of the list the data for the new element the new start of the #GList Gets the user name of the current user. The encoding of the returned string is system-defined. On UNIX, it might be the preferred file name encoding, or something else, and there is no guarantee that it is even consistent on a machine. On Windows, it is always UTF-8. the user name of the current user. Adds the static @interface_type to @instantiable_type. The information contained in the #GTypeInterfaceInfo structure pointed to by @info is used to manage the relationship. #GType value of an instantiable type. #GType value of an interface type. The #GInterfaceInfo structure for this (@instance_type, @interface_type) combination. Return value: The link at the @n'th position, or %NULL if @n is off the a #GQueue the position of the link The link at the @n'th position, or %NULL if @n is off the end of the list Since: 2.4 Creates a new #GParamSpecInt instance specifying a %G_TYPE_INT property. See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified minimum value for the property specified maximum value for the property specified default value for the property specified flags for the property specified a newly created parameter specification Invokes the closure, i.e. executes the callback represented by the @closure. a #GClosure a #GValue to store the return value. May be %NULL if the callback of @closure doesn't return a value. the length of the @param_values array an array of #GValue<!-- -->s holding the arguments on which to invoke the callback of @closure a context-dependent invocation hint A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, gulong arg1, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs ignored 2 a #GValue array holding the instance and the #gulong parameter the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Recursively copies a #GNode (but does not deep-copy the data inside the nodes, see g_node_copy_deep() if you need that). a #GNode a new #GNode containing the same data pointers A wrapper for the POSIX chdir() function. The function changes the current directory of the process to @path. See your C library manual for more details about chdir(). a pathname in the GLib file name encoding (UTF-8 on Windows) 0 on success, -1 if an error occurred. Since: 2.8 A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, gint arg1, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs ignored 2 a #GValue array holding the instance and the #gint parameter the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Removes a source from the default main loop context given the source functions and user data. If multiple sources exist with the same source functions and user data, only one will be destroyed. The @source_funcs passed to g_source_new() the user data for the callback %TRUE if a source was found and removed. A convenience function to connect multiple signals at once. The signal specs expected by this function have the form "modifier::signal_name", where modifier can be one of the following: <variablelist> <varlistentry> <term>signal</term> <listitem><para> equivalent to <literal>g_signal_connect_data (..., NULL, 0)</literal> </para></listitem> </varlistentry> <varlistentry> <term>object_signal</term> <term>object-signal</term> <listitem><para> equivalent to <literal>g_signal_connect_object (..., 0)</literal> </para></listitem> </varlistentry> <varlistentry> <term>swapped_signal</term> <term>swapped-signal</term> <listitem><para> equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED)</literal> </para></listitem> </varlistentry> <varlistentry> <term>swapped_object_signal</term> <term>swapped-object-signal</term> <listitem><para> equivalent to <literal>g_signal_connect_object (..., G_CONNECT_SWAPPED)</literal> </para></listitem> </varlistentry> <varlistentry> <term>signal_after</term> <term>signal-after</term> <listitem><para> equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_AFTER)</literal> </para></listitem> </varlistentry> <varlistentry> <term>object_signal_after</term> <term>object-signal-after</term> <listitem><para> equivalent to <literal>g_signal_connect_object (..., G_CONNECT_AFTER)</literal> </para></listitem> </varlistentry> <varlistentry> <term>swapped_signal_after</term> <term>swapped-signal-after</term> <listitem><para> equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER)</literal> </para></listitem> </varlistentry> <varlistentry> <term>swapped_object_signal_after</term> <term>swapped-object-signal-after</term> <listitem><para> equivalent to <literal>g_signal_connect_object (..., G_CONNECT_SWAPPED | G_CONNECT_AFTER)</literal> </para></listitem> </varlistentry> </variablelist> |[ menu->toplevel = g_object_connect (g_object_new (GTK_TYPE_WINDOW, "type", GTK_WINDOW_POPUP, "child", menu, NULL), "signal::event", gtk_menu_window_event, menu, "signal::size_request", gtk_menu_window_size_request, menu, "signal::destroy", gtk_widget_destroyed, &menu->toplevel, NULL); ]| a #GObject the spec for the first signal #GCallback for the first signal, followed by data for the first signal, followed optionally by more signal spec/callback/data triples, followed by %NULL @object A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, glong arg1, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs ignored 2 a #GValue array holding the instance and the #glong parameter the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Finds a #GSource given a pair of context and ID. a #GMainContext (if %NULL, the default context will be used) the source ID, as returned by g_source_get_id(). the #GSource if found, otherwise, %NULL Prepares to poll sources within a main loop. The resulting information for polling is determined by calling g_main_context_query (). a #GMainContext location to store priority of highest priority source already ready. %TRUE if some source is ready to be dispatched prior to polling. Internal function, used to extract the fundamental type ID portion. use G_TYPE_FUNDAMENTAL() instead. valid type ID fundamental type ID Inserts a #GNode as the first child of the given parent. the #GNode to place the new #GNode under the #GNode to insert the inserted #GNode 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). a content type string. %TRUE if the file type corresponds to a type that can be executable, %FALSE otherwise. Pops data from the @queue. If no data is received before @end_time, %NULL is returned. This function must be called while holding the @queue's lock. To easily calculate @end_time a combination of g_get_current_time() and g_time_val_add() can be used. a #GAsyncQueue. a #GTimeVal, determining the final time. data from the queue or %NULL, when no data is received before @end_time. Associates a new integer value with @key under @group_name. If @key cannot be found then it is created. Since: 2.6 a #GKeyFile a group name a key an integer value Gets the value of a attribute, formated as a string. This escapes things as needed to make the string valid utf8. a #GFileInfo. a file attribute key. a UTF-8 string associated with the given @attribute. When you're done with the string it must be freed with g_free(). Get the codeset for the current locale. a newly allocated string containing the name of the codeset. This string must be freed with g_free(). An implementation of the GNU vasprintf() function which supports positional parameters, as specified in the Single Unix Specification. This function is similar to g_vsprintf(), except that it allocates a string to hold the output, instead of putting the output in a buffer you allocate in advance. the return location for the newly-allocated string. a standard printf() format string, but notice <link linkend="string-precision">string precision pitfalls</link>. the list of arguments to insert in the output. the number of bytes printed. Since: 2.4 Tries to cast the contents of @src_value into a type appropriate to store in @dest_value, e.g. to transform a %G_TYPE_INT value into a %G_TYPE_FLOAT value. Performing transformations between value types might incur precision lossage. Especially transformations into strings might reveal seemingly arbitrary results and shouldn't be relied upon for production code (such as rcfile value or object property serialization). Source value. Target value. Whether a transformation rule was found and could be applied. Upon failing transformations, @dest_value is left untouched. Retrieves a comment above @key from @group_name. If @key is %NULL then @comment will be read from above @group_name. If both @key and @group_name are %NULL, then @comment will be read from above the first group in the file. a #GKeyFile a group name, or %NULL a key return location for a #GError a comment that should be freed with g_free() Since: 2.6 Unmounts a mount. This is an asynchronous operation, and is finished by calling g_mount_unmount_finish() with the @mount and #GAsyncResults data returned in the @callback. a #GMount. flags affecting the operation optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback, or %NULL. user data passed to @callback. Convert a string from UTF-16 to UCS-4. The result will be terminated with a 0 character. a UTF-16 encoded string the maximum length (number of <type>gunichar2</type>) of @str to use. If @len < 0, then the string is terminated with a 0 character. location to store number of words read, or %NULL. If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will be returned in case @str contains a trailing partial character. If an error occurs then the index of the invalid input is stored here. location to store number of characters written, or %NULL. The value stored here does not include the trailing 0 character. location to store the error occuring, or %NULL to ignore errors. Any of the errors in #GConvertError other than %G_CONVERT_ERROR_NO_CONVERSION may occur. a pointer to a newly allocated UCS-4 string. This value must be freed with g_free(). If an error occurs, %NULL will be returned and @error set. Checks if a unix mount point is mountable by the user. a #GUnixMountPoint. %TRUE if the mount point is user mountable. Checks if the application supports reading files and directories from URIs. a #GAppInfo. %TRUE if the @appinfo supports URIs. Adds a file descriptor to the set of file descriptors polled for this source. This is usually combined with g_source_new() to add an event source. The event source's check function will typically test the @revents field in the #GPollFD struct and return %TRUE if events need to be processed. a #GSource a #GPollFD structure holding information about a file descriptor to watch. Removes the last element of the queue. a #GQueue. the #GList element at the tail of the queue, or %NULL if the queue is empty. Returns: a pointer into @file_name after the root component. a file name. a pointer into @file_name after the root component. Another name for g_cclosure_marshal_BOOLEAN__FLAGS(). Looks up a #GEnumValue by nickname. a #GEnumClass the nickname to look up the #GEnumValue with nickname @nick, or %NULL if the enumeration doesn't have a member with that nickname This function works like g_object_set_qdata(), but in addition, a void (*destroy) (gpointer) function may be specified which is called with @data as argument when the @object is finalized, or the data is being overwritten by a call to g_object_set_qdata() with the same @quark. The GObject to set store a user data pointer A #GQuark, naming the user data pointer An opaque user data pointer Function to invoke with @data as argument, when @data needs to be freed Sets the name of the program. This name should <emphasis>not</emphasis> be localized, contrast with g_set_application_name(). Note that for thread-safety reasons this function can only be called once. the name of the program. Creates a new instance of a #GObject subtype and sets its properties. Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY) which are not explicitly specified are set to their default values. the type id of the #GObject subtype to instantiate the length of the @parameters array an array of #GParameter a new instance of @object_type Executes a child program asynchronously (your program will not block waiting for the child to exit). The child program is specified by the only argument that must be provided, @argv. @argv should be a %NULL-terminated array of strings, to be passed as the argument vector for the child. The first string in @argv is of course the name of the program to execute. By default, the name of the program must be a full path; the <envar>PATH</envar> shell variable will only be searched if you pass the %G_SPAWN_SEARCH_PATH flag. On Windows, note that all the string or string vector arguments to this function and the other g_spawn*() functions are in UTF-8, the GLib file name encoding. Unicode characters that are not part of the system codepage passed in these arguments will be correctly available in the spawned program only if it uses wide character API to retrieve its command line. For C programs built with Microsoft's tools it is enough to make the program have a wmain() instead of main(). wmain() has a wide character argument vector as parameter. At least currently, mingw doesn't support wmain(), so if you use mingw to develop the spawned program, it will have to call the undocumented function __wgetmainargs() to get the wide character argument vector and environment. See gspawn-win32-helper.c in the GLib sources or init.c in the mingw runtime sources for a prototype for that function. Alternatively, you can retrieve the Win32 system level wide character command line passed to the spawned program using the GetCommandLineW() function. On Windows the low-level child process creation API <function>CreateProcess()</function> doesn't use argument vectors, but a command line. The C runtime library's <function>spawn*()</function> family of functions (which g_spawn_async_with_pipes() eventually calls) paste the argument vector elements together into a command line, and the C runtime startup code does a corresponding reconstruction of an argument vector from the command line, to be passed to main(). Complications arise when you have argument vector elements that contain spaces of double quotes. The <function>spawn*()</function> functions don't do any quoting or escaping, but on the other hand the startup code does do unquoting and unescaping in order to enable receiving arguments with embedded spaces or double quotes. To work around this asymmetry, g_spawn_async_with_pipes() will do quoting and escaping on argument vector elements that need it before calling the C runtime spawn() function. The returned @child_pid on Windows is a handle to the child process, not its identifier. Process handles and process identifiers are different concepts on Windows. @envp is a %NULL-terminated array of strings, where each string has the form <literal>KEY=VALUE</literal>. This will become the child's environment. If @envp is %NULL, the child inherits its parent's environment. @flags should be the bitwise OR of any flags you want to affect the function's behaviour. The %G_SPAWN_DO_NOT_REAP_CHILD means that the child will not automatically be reaped; you must use a #GChildWatch source to be notified about the death of the child process. Eventually you must call g_spawn_close_pid() on the @child_pid, in order to free resources which may be associated with the child process. (On Unix, using a #GChildWatch source is equivalent to calling waitpid() or handling the %SIGCHLD signal manually. On Windows, calling g_spawn_close_pid() is equivalent to calling CloseHandle() on the process handle returned in @child_pid). %G_SPAWN_LEAVE_DESCRIPTORS_OPEN means that the parent's open file descriptors will be inherited by the child; otherwise all descriptors except stdin/stdout/stderr will be closed before calling exec() in the child. %G_SPAWN_SEARCH_PATH means that <literal>argv[0]</literal> need not be an absolute path, it will be looked for in the user's <envar>PATH</envar>. %G_SPAWN_STDOUT_TO_DEV_NULL means that the child's standard output will be discarded, instead of going to the same location as the parent's standard output. If you use this flag, @standard_output must be %NULL. %G_SPAWN_STDERR_TO_DEV_NULL means that the child's standard error will be discarded, instead of going to the same location as the parent's standard error. If you use this flag, @standard_error must be %NULL. %G_SPAWN_CHILD_INHERITS_STDIN means that the child will inherit the parent's standard input (by default, the child's standard input is attached to /dev/null). If you use this flag, @standard_input must be %NULL. %G_SPAWN_FILE_AND_ARGV_ZERO means that the first element of @argv is the file to execute, while the remaining elements are the actual argument vector to pass to the file. Normally g_spawn_async_with_pipes() uses @argv[0] as the file to execute, and passes all of @argv to the child. @child_setup and @user_data are a function and user data. On POSIX platforms, the function is called in the child after GLib has performed all the setup it plans to perform (including creating pipes, closing file descriptors, etc.) but before calling exec(). That is, @child_setup is called just before calling exec() in the child. Obviously actions taken in this function will only affect the child, not the parent. On Windows, there is no separate fork() and exec() functionality. Child processes are created and run with a single API call, CreateProcess(). @child_setup is called in the parent process just before creating the child process. You should carefully consider what you do in @child_setup if you intend your software to be portable to Windows. If non-%NULL, @child_pid will on Unix be filled with the child's process ID. You can use the process ID to send signals to the child, or to use g_child_watch_add() (or waitpid()) if you specified the %G_SPAWN_DO_NOT_REAP_CHILD flag. On Windows, @child_pid will be filled with a handle to the child process only if you specified the %G_SPAWN_DO_NOT_REAP_CHILD flag. You can then access the child process using the Win32 API, for example wait for its termination with the <function>WaitFor*()</function> functions, or examine its exit code with GetExitCodeProcess(). You should close the handle with CloseHandle() or g_spawn_close_pid() when you no longer need it. If non-%NULL, the @standard_input, @standard_output, @standard_error locations will be filled with file descriptors for writing to the child's standard input or reading from its standard output or standard error. The caller of g_spawn_async_with_pipes() must close these file descriptors when they are no longer in use. If these parameters are %NULL, the corresponding pipe won't be created. If @standard_input is NULL, the child's standard input is attached to /dev/null unless %G_SPAWN_CHILD_INHERITS_STDIN is set. If @standard_error is NULL, the child's standard error goes to the same location as the parent's standard error unless %G_SPAWN_STDERR_TO_DEV_NULL is set. If @standard_output is NULL, the child's standard output goes to the same location as the parent's standard output unless %G_SPAWN_STDOUT_TO_DEV_NULL is set. @error can be %NULL to ignore errors, or non-%NULL to report errors. If an error is set, the function returns %FALSE. Errors are reported even if they occur in the child (for example if the executable in <literal>argv[0]</literal> is not found). Typically the <literal>message</literal> field of returned errors should be displayed to users. Possible errors are those from the #G_SPAWN_ERROR domain. If an error occurs, @child_pid, @standard_input, @standard_output, and @standard_error will not be filled with valid values. If @child_pid is not %NULL and an error does not occur then the returned process reference must be closed using g_spawn_close_pid(). <note><para> If you are writing a GTK+ application, and the program you are spawning is a graphical application, too, then you may want to use gdk_spawn_on_screen_with_pipes() instead to ensure that the spawned program opens its windows on the right screen. </para></note> child's current working directory, or %NULL to inherit parent's, in the GLib file name encoding child's argument vector, in the GLib file name encoding child's environment, or %NULL to inherit parent's, in the GLib file name encoding flags from #GSpawnFlags function to run in the child just before exec() user data for @child_setup return location for child process ID, or %NULL return location for file descriptor to write to child's stdin, or %NULL return location for file descriptor to read child's stdout, or %NULL return location for file descriptor to read child's stderr, or %NULL return location for error %TRUE on success, %FALSE if an error was set Checks if @mount can be eject. a #GMount. %TRUE if the @mount can be ejected. Copies a #GRand into a new one with the same exact state as before. This way you can take a snapshot of the random number generator for replaying later. a #GRand. the new #GRand. Since: 2.4 This sets an opaque, named pointer on an object. The name is specified through a #GQuark (retrived e.g. via g_quark_from_static_string()), and the pointer can be gotten back from the @object with g_object_get_qdata() until the @object is finalized. Setting a previously set user data pointer, overrides (frees) the old pointer set, using #NULL as pointer essentially removes the data stored. The GObject to set store a user data pointer A #GQuark, naming the user data pointer An opaque user data pointer Reads a 64-bit/8-byte value from @stream. In order to get the correct byte order for this read operation, see g_data_stream_get_byte_order() and g_data_stream_set_byte_order(). If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. a given #GDataInputStream. optional #GCancellable object, %NULL to ignore. #GError for error reporting. a signed 64-bit/8-byte value read from @stream or %0 if an error occurred. Gets a pointer result as returned by the asynchronous function. a #GSimpleAsyncResult. a pointer from the result. Gets the filesystem type for the unix mount. a #GUnixMount. a string containing the file system type. Reads an unsigned 32-bit/4-byte value from @stream. In order to get the correct byte order for this read operation, see g_data_stream_get_byte_order() and g_data_stream_set_byte_order(). If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. a given #GDataInputStream. optional #GCancellable object, %NULL to ignore. #GError for error reporting. an unsigned 32-bit/4-byte value read from the @stream or %0 if an error occurred. Gets the UUID for the @volume. The reference is typically based on the file system UUID for the volume in question and should be considered an opaque string. Returns %NULL if there is no UUID available. a #GVolume. the UUID for @volume or %NULL if no UUID can be computed. Clears the pending flag on @stream. input stream Finishes copying the file started with g_file_copy_async(). input #GFile. a #GAsyncResult. a #GError, or %NULL a %TRUE on success, %FALSE on error. Return value: A random number. lower closed bound of the interval. upper open bound of the interval. A random number. Gets flags values packed in together with the datalist. See g_datalist_set_flags(). pointer to the location that holds a list the flags of the datalist Since: 2.8 Resets the state of the @checksum back to it's initial state. Since: 2.18 the #GChecksum to reset Removes the item pointed to by @iter. It is an error to pass the end iterator to this function. If the sequnce has a data destroy function associated with it, this function is called on the data for the removed item. Since: 2.14 a #GSequenceIter Gets a list of all of the applications currently registered on this system. For desktop files, this includes applications that have <literal>NoDisplay=true</literal> set or are excluded from display by means of <literal>OnlyShowIn</literal> or <literal>NotShowIn</literal>. See g_app_info_should_show(). The returned list does not include applications which have the <literal>Hidden</literal> key set. a newly allocated #GList of references to #GAppInfo<!---->s. Inserts a new element into the list, using the given comparison function to determine its position. a pointer to a #GList the data for the new element the function to compare elements in the list. It should return a number > 0 if the first parameter comes after the second parameter in the sort order. user data to pass to comparison function. the new start of the #GList Since: 2.10 Removes all keys and their associated values from a #GHashTable. If the #GHashTable was created using g_hash_table_new_full(), the keys and values are freed using the supplied destroy functions, otherwise you have to make sure that any dynamically allocated values are freed yourself. Since: 2.12 a #GHashTable Removes a key and its associated value from a #GHashTable. If the #GHashTable was created using g_hash_table_new_full(), the key and value are freed using the supplied destroy functions, otherwise you have to make sure that any dynamically allocated values are freed yourself. a #GHashTable. the key to remove. %TRUE if the key was found and removed from the #GHashTable. Checks if the buffer automatically grows as data is added. a #GBufferedOutputStream. %TRUE if the @stream's buffer automatically grows, %FALSE otherwise. Converts a #GString to uppercase. a #GString @string Deprecated:2.2: This function uses the locale-specific toupper() function, which is almost never the right thing. Use g_string_ascii_up() or g_utf8_strup() instead. Mounts a file of type G_FILE_TYPE_MOUNTABLE. Using @mount_operation, you can request callbacks when, for instance, passwords are needed during authentication. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. When the operation is finished, @callback will be called. You can then call g_file_mount_mountable_finish() to get the result of the operation. input #GFile. flags affecting the operation a #GMountOperation, or %NULL to avoid user interaction. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied, or %NULL. the data to pass to callback function Remove a specified datum from the object's data associations, without invoking the association's destroy handler. #GObject containing the associations name of the key the data if found, or %NULL if no such data exists. Increase the reference count of @object, and possibly remove the <link linkend="floating-ref">floating</link> reference, if @object has a floating reference. In other words, if the object is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged. If the object is not floating, then this call adds a new normal reference increasing the reference count by one. Since: 2.10 a #GObject @object Lists the signals by id that a certain instance or interface type created. Further information about the signals can be acquired through g_signal_query(). Instance or interface type. Location to store the number of signal ids for @itype. Newly allocated array of signal IDs. Determines information necessary to poll this main loop. a #GMainContext maximum priority source to check location to store timeout to be used in polling location to store #GPollFD records that need to be polled. length of @fds. the number of records actually stored in @fds, or, if more than @n_fds records need to be stored, the number of records that need to be stored. Gets the mount path for a unix mount. input #GUnixMountEntry to get the mount path for. the mount path for @mount_entry. Adds a new element on to the start of the list. <note><para> The return value is the new start of the list, which may have changed, so make sure you store the new value. </para></note> |[ /* Notice that it is initialized to the empty list. */ GList *list = NULL; list = g_list_prepend (list, "last"); list = g_list_prepend (list, "first"); ]| a pointer to a #GList the data for the new element the new start of the #GList Frees the memory allocated for the #GQueue. Only call this function if @queue was created with g_queue_new(). If queue elements contain dynamically-allocated memory, they should be freed first. a #GQueue. Given a @leaf_type and a @root_type which is contained in its anchestry, return the type that @root_type is the immediate parent of. In other words, this function determines the type that is derived directly from @root_type which is also a base class of @leaf_type. Given a root type and a leaf type, this function can be used to determine the types and order in which the leaf type is descended from the root type. Descendant of @root_type and the type to be returned. Immediate parent of the returned type. Immediate child of @root_type and anchestor of @leaf_type. Signals to the #GMarkupParseContext that all data has been fed into the parse context with g_markup_parse_context_parse(). This function reports an error if the document isn't complete, for example if elements are still open. a #GMarkupParseContext return location for a #GError %TRUE on success, %FALSE if an error was set Determines the numeric value of a character as a decimal digit. Differs from g_unichar_digit_value() because it takes a char, so there's no worry about sign extension if characters are signed. an ASCII character. If @c is a decimal digit (according to g_ascii_isdigit()), its numeric value. Otherwise, -1. Gets the pattern string associated with @regex, i.e. a copy of the string passed to g_regex_new(). a #GRegex structure the pattern of @regex Since: 2.14 Removes a reference from the given @list. If the reference count falls to zero, the @list is deleted. The #GFileAttributeInfoList to unreference. Compiles the regular expression to an internal form, and does the initial setup of the #GRegex structure. the regular expression compile options for the regular expression match options for the regular expression return location for a #GError a #GRegex structure. Call g_regex_unref() when you are done with it Since: 2.14 Creates a new closure which invokes the function found at the offset @struct_offset in the class structure of the interface or classed type identified by @itype. the #GType identifier of an interface or classed type the offset of the member function of @itype's class structure which is to be invoked by the new closure a new #GCClosure This is similar to g_signal_connect_data(), but uses a closure which ensures that the @gobject stays alive during the call to @c_handler by temporarily adding a reference count to @gobject. Note that there is a bug in GObject that makes this function much less useful than it might seem otherwise. Once @gobject is disposed, the callback will no longer be called, but, the signal handler is <emphasis>not</emphasis> currently disconnected. If the @instance is itself being freed at the same time than this doesn't matter, since the signal will automatically be removed, but if @instance persists, then the signal handler will leak. You should not remove the signal yourself because in a future versions of GObject, the handler <emphasis>will</emphasis> automatically be disconnected. It's possible to work around this problem in a way that will continue to work with future versions of GObject by checking that the signal handler is still connected before disconnected it: <informalexample><programlisting> if (g_signal_handler_is_connected (instance, id)) g_signal_handler_disconnect (instance, id); </programlisting></informalexample> the instance to connect to. a string of the form "signal-name::detail". the #GCallback to connect. the object to pass as data to @c_handler. a combination of #GConnnectFlags. the handler id. Return value: %TRUE if the source has been destroyed a #GSource %TRUE if the source has been destroyed Since: 2.12 Gets a reference to the class for the type that is associated with @extension. a #GIOExtension the #GTypeClass for the type of @extension Create a new test case, similar to g_test_create_case(). However the test is assumed to use no fixture, and test suites are automatically created on the fly and added to the root fixture, based on the slash-separated portions of @testpath. The @test_data argument will be passed as first argument to @test_func. Since: 2.16 Slash-separated test case path name for the test. Test data argument for the test function. The test function to invoke for this test. Returns: the number of the highest back reference a #GRegex the number of the highest back reference Since: 2.14 Similar to g_file_query_info(), but obtains information about the filesystem the @file is on, rather than the file itself. For instance the amount of space available and the type of the filesystem. The @attribute value is a string that specifies the file attributes that should be gathered. It is not an error if it's not possible to read a particular requested attribute from a file - it just won't be set. @attribute should be a comma-separated list of attribute or attribute wildcards. The wildcard "*" means all attributes, and a wildcard like "fs:*" means all attributes in the fs namespace. The standard namespace for filesystem attributes is "fs". Common attributes of interest are #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available), and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem). If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on. input #GFile. an attribute query string. optional #GCancellable object, %NULL to ignore. a #GError. a #GFileInfo or %NULL if there was an error. Return value: the length of the @queue. a #GAsyncQueue. the length of the @queue. Remounts a mount. This is an asynchronous operation, and is finished by calling g_mount_remount_finish() with the @mount and #GAsyncResults data returned in the @callback. Remounting is useful when some setting affecting the operation of the volume has been changed, as these may need a remount to take affect. While this is semantically equivalent with unmounting and then remounting not all backends might need to actually be unmounted. a #GMount. flags affecting the operation a #GMountOperation or %NULL to avoid user interaction. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback, or %NULL. user data passed to @callback. Creates a new signal. (This is usually done in the class initializer.) See g_signal_new() for details on allowed signal names. the name for the signal the type this signal pertains to. It will also pertain to types which are derived from this type. a combination of #GSignalFlags specifying detail of when the default handler is to be invoked. You should at least specify %G_SIGNAL_RUN_FIRST or %G_SIGNAL_RUN_LAST. The closure to invoke on signal emission; may be %NULL. the accumulator for this signal; may be %NULL. user data for the @accumulator. the function to translate arrays of parameter values to signal emissions into C language callback invocations. the type of return value, or #G_TYPE_NONE for a signal without a return value. the length of @param_types. an array types, one for each parameter. the signal id Creates a new #GUnixInputStream for the given @fd. If @close_fd_at_close is %TRUE, the file descriptor will be closed when the stream is closed. unix file descriptor. a #gboolean. a #GUnixInputStream. This function is meant to be called from the complete_type_info() function of a #GTypePlugin implementation, as in the following example: |[ static void my_enum_complete_type_info (GTypePlugin *plugin, GType g_type, GTypeInfo *info, GTypeValueTable *value_table) { static const GEnumValue values[] = { { MY_ENUM_FOO, "MY_ENUM_FOO", "foo" }, { MY_ENUM_BAR, "MY_ENUM_BAR", "bar" }, { 0, NULL, NULL } }; g_enum_complete_type_info (type, info, values); } ]| the type identifier of the type being completed the #GTypeInfo struct to be filled in An array of #GEnumValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0. Runs the asynchronous job in a separated thread. a #GSimpleAsyncResult. a #GSimpleAsyncThreadFunc. the io priority of the request. optional #GCancellable object, %NULL to ignore. If @dest is %NULL, free @src; otherwise, moves @src into *@dest. *@dest must be %NULL. After the move, add a prefix as with g_prefix_error(). Since: 2.16 error return location error to move into the return location printf()-style format string arguments to @format Returns: The nextmost fundamental type ID to be registered, The nextmost fundamental type ID to be registered, or 0 if the type system ran out of fundamental type IDs. This function creates a new thread pool. Whenever you call g_thread_pool_push(), either a new thread is created or an unused one is reused. At most @max_threads threads are running concurrently for this thread pool. @max_threads = -1 allows unlimited threads to be created for this thread pool. The newly created or reused thread now executes the function @func with the two arguments. The first one is the parameter to g_thread_pool_push() and the second one is @user_data. The parameter @exclusive determines, whether the thread pool owns all threads exclusive or whether the threads are shared globally. If @exclusive is %TRUE, @max_threads threads are started immediately and they will run exclusively for this thread pool until it is destroyed by g_thread_pool_free(). If @exclusive is %FALSE, threads are created, when needed and shared between all non-exclusive thread pools. This implies that @max_threads may not be -1 for exclusive thread pools. @error can be %NULL to ignore errors, or non-%NULL to report errors. An error can only occur when @exclusive is set to %TRUE and not all @max_threads threads could be created. a function to execute in the threads of the new thread pool user data that is handed over to @func every time it is called the maximal number of threads to execute concurrently in the new thread pool, -1 means no limit should this thread pool be exclusive? return location for error the new #GThreadPool Removes a key/value pair from a #GTree. If the #GTree was created using g_tree_new_full(), the key and value are freed using the supplied destroy functions, otherwise you have to make sure that any dynamically allocated values are freed yourself. If the key does not exist in the #GTree, the function does nothing. a #GTree. the key to remove. %TRUE if the key was found (prior to 2.8, this function returned nothing) Clears the status information from @info. a #GFileInfo. Returns: The GTypeInterface structure of iface_type if implemented A #GTypeClass structure. An interface ID which this class conforms to. The GTypeInterface structure of iface_type if implemented by @instance_class, %NULL otherwise Removes a key and its associated value from a #GTree without calling the key and value destroy functions. If the key does not exist in the #GTree, the function does nothing. a #GTree. the key to remove. %TRUE if the key was found (prior to 2.8, this function returned nothing) Creates a new icon for a file. a #GFile. a #GIcon for the given @file, or %NULL on error. Creates a new #GTree like g_tree_new() and allows to specify functions to free the memory allocated for the key and value that get called when removing the entry from the #GTree. qsort()-style comparison function. data to pass to comparison function. a function to free the memory allocated for the key used when removing the entry from the #GTree or %NULL if you don't want to supply such a function. a function to free the memory allocated for the value used when removing the entry from the #GTree or %NULL if you don't want to supply such a function. a new #GTree. Gets an output stream for appending data to the file. If the file doesn't already exist it is created. By default files created are generally readable by everyone, but if you pass #G_FILE_CREATE_PRIVATE in @flags the file will be made readable only to the current user, to the level that is supported on the target filesystem. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. Some file systems don't allow all file names, and may return an G_IO_ERROR_INVALID_FILENAME error. If the file is a directory the G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on. input #GFile. a set of #GFileCreateFlags. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL a #GFileOutputStream. Gets the position of the element containing the given data (starting from 0). a #GList the data to find the index of the element containing the data, or -1 if the data is not found If the paramspec redirects operations to another paramspec, Returns: paramspec to which requests on this paramspec should a #GParamSpec paramspec to which requests on this paramspec should be redirected, or %NULL if none. This operation never fails, but the returned object might not support any I/O operations if the @parse_name cannot be parsed by the #GVfs module. a #GVfs. a string to be parsed by the VFS module. a #GFile for the given @parse_name. An implementation of the standard sprintf() function which supports positional parameters, as specified in the Single Unix Specification. A pointer to a memory buffer to contain the resulting string. It is up to the caller to ensure that the allocated buffer is large enough to hold the formatted result a standard printf() format string, but notice <link linkend="string-precision">string precision pitfalls</link>. the arguments to insert in the output. the number of bytes printed. Since: 2.2 A case-insensitive string comparison, corresponding to the standard strncasecmp() function on platforms which support it. It is similar to g_strcasecmp() except it only compares the first @n characters of the strings. a string. a string to compare with @s1. the maximum number of characters to compare. 0 if the strings match, a negative value if @s1 < @s2, or a positive value if @s1 > @s2. Deprecated:2.2: The problem with g_strncasecmp() is that it does the comparison by calling toupper()/tolower(). These functions are locale-specific and operate on single bytes. However, it is impossible to handle things correctly from an I18N standpoint by operating on bytes, since characters may be multibyte. Thus g_strncasecmp() is broken if your string is guaranteed to be ASCII, since it's locale-sensitive, and it's broken if your string is localized, since it doesn't work on many encodings at all, including UTF-8, EUC-JP, etc. There are therefore two replacement functions: g_ascii_strncasecmp(), which only works on ASCII and is not locale-sensitive, and g_utf8_casefold(), which is good for case-insensitive sorting of UTF-8. Gets the element @n places before @list. a #GList the position of the element, counting from 0 the element, or %NULL if the position is off the end of the #GList Whether to use the default fallbacks found by shortening the icon name at '-' characters. If the "names" array has more than one element, ignores any past the first. For example, if the icon name was "gnome-dev-cdrom-audio", the array would become |[ { "gnome-dev-cdrom-audio", "gnome-dev-cdrom", "gnome-dev", "gnome", NULL }; ]| Returns: %TRUE if the volume should be automatically mounted. a #GVolume %TRUE if the volume should be automatically mounted. Gets the data of the element at the given position. a #GSList the position of the element the element's data, or %NULL if the position is off the end of the #GSList Reads a line, including the terminating character(s), from a #GIOChannel into a newly-allocated string. @str_return will contain allocated memory if the return is %G_IO_STATUS_NORMAL. a #GIOChannel The line read from the #GIOChannel, including the line terminator. This data should be freed with g_free() when no longer needed. This is a nul-terminated string. If a @length of zero is returned, this will be %NULL instead. location to store length of the read data, or %NULL location to store position of line terminator, or %NULL A location to return an error of type #GConvertError or #GIOChannelError the status of the operation. Converts a Unicode character into UTF-8, and insert it into the string at the given position. a #GString the position at which to insert character, or -1 to append at the end of the string a Unicode character @string Checks whether @value contains the default value as specified in @pspec. a valid #GParamSpec a #GValue of correct type for @pspec whether @value contains the canonical default for this @pspec Escapes text so that the markup parser will parse it verbatim. Less than, greater than, ampersand, etc. are replaced with the corresponding entities. This function would typically be used when writing out a file to be parsed with the markup parser. Note that this function doesn't protect whitespace and line endings from being processed according to the XML rules for normalization of line endings and attribute values. some valid UTF-8 text length of @text in bytes, or -1 if the text is nul-terminated a newly allocated string with the escaped text If the interface type @g_type is currently in use, returns its default interface vtable. Since: 2.4 an interface type the default vtable for the interface, or %NULL if the type is not currently in use. Calls the @use_plugin function from the #GTypePluginClass of @plugin. There should be no need to use this function outside of the GObject type system itself. a #GTypePlugin Launches the application. Passes @uris to the launched application as arguments, using the optional @launch_context to get information about the details of the launcher (like what screen it is on). On error, @error will be set accordingly. To lauch the application without arguments pass a %NULL @uris list. Note that even if the launch is successful the application launched can fail to start if it runs into problems during startup. There is no way to detect this. a #GAppInfo. a #GList containing URIs to launch. a #GAppLaunchContext. a #GError. %TRUE on successful launch, %FALSE otherwise. Creates a new #GNode containing the given data. Used to create the first node in a tree. the data of the new node a new #GNode A wrapper for the POSIX remove() function. The remove() function deletes a name from the filesystem. See your C library manual for more details about how remove() works on your system. On Unix, remove() removes also directories, as it calls unlink() for files and rmdir() for directories. On Windows, although remove() in the C library only works for files, this function tries first remove() and then if that fails rmdir(), and thus works for both files and directories. Note however, that on Windows, it is in general not possible to remove a file that is open to some process, or mapped into memory. If this function fails on Windows you can't infer too much from the errno value. rmdir() is tried regardless of what caused remove() to fail. Any errno value set by remove() will be overwritten by that set by rmdir(). a pathname in the GLib file name encoding (UTF-8 on Windows) 0 if the file was successfully removed, -1 if an error occurred Since: 2.6 Reverses a #GList. It simply switches the next and prev pointers of each element. a #GList the start of the reversed #GList Passes the results of polling back to the main loop. a #GMainContext the maximum numerical priority of sources to check array of #GPollFD's that was passed to the last call to g_main_context_query() return value of g_main_context_query() %TRUE if some sources are ready to be dispatched. Sorts @seq using @cmp_func. Since: 2.14 a #GSequence the #GCompareDataFunc used to sort @seq. This function is passed two items of @seq and should return 0 if they are equal, a negative value fi the first comes before the second, and a positive value if the second comes before the first. user data passed to @cmp_func Creates a new themed icon for @iconnames. an array of strings containing icon names. the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated a new #GThemedIcon Adds a string to be displayed in <option>--help</option> output before the list of options. This is typically a summary of the program functionality. Note that the summary is translated (see g_option_context_set_translate_func(), g_option_context_set_translation_domain()). Since: 2.12 a #GOptionContext a string to be shown in <option>--help</option> output before the list of options, or %NULL Creates a new #GParamSpecDouble instance specifying a %G_TYPE_DOUBLE property. See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified minimum value for the property specified maximum value for the property specified default value for the property specified flags for the property specified a newly created parameter specification Reads all the remaining data from the file. a #GIOChannel Location to store a pointer to a string holding the remaining data in the #GIOChannel. This data should be freed with g_free() when no longer needed. This data is terminated by an extra nul character, but there may be other nuls in the intervening data. location to store length of the data location to return an error of type #GConvertError or #GIOChannelError %G_IO_STATUS_NORMAL on success. This function never returns %G_IO_STATUS_EOF. Return value: A random number. A random number. Registers a finalization notifier which will be called when the reference count of @closure goes down to 0. Multiple finalization notifiers on a single closure are invoked in unspecified order. If a single call to g_closure_unref() results in the closure being both invalidated and finalized, then the invalidate notifiers will be run before the finalize notifiers. a #GClosure data to pass to @notify_func the callback function to register Compare two strings, ignoring the case of ASCII characters. Unlike the BSD strcasecmp() function, this only recognizes standard ASCII letters and ignores the locale, treating all non-ASCII bytes as if they are not letters. This function should be used only on strings that are known to be in encodings where the bytes corresponding to ASCII letters always represent themselves. This includes UTF-8 and the ISO-8859-* charsets, but not for instance double-byte encodings like the Windows Codepage 932, where the trailing bytes of double-byte characters include all ASCII letters. If you compare two CP932 strings using this function, you will get false matches. string to compare with @s2. string to compare with @s1. 0 if the strings match, a negative value if @s1 < @s2, or a positive value if @s1 > @s2. Deletes an emission hook. the id of the signal the id of the emission hook, as returned by g_signal_add_emission_hook() Computes the checksum for a binary @data of @length. This is a convenience wrapper for g_checksum_new(), g_checksum_get_string() and g_checksum_free(). a #GChecksumType binary blob to compute the digest of length of @data the digest of the binary data as a string in hexadecimal. The returned string should be freed with g_free() when done using it. Since: 2.16 Inserts a new key and value into a #GHashTable. If the key already exists in the #GHashTable its current value is replaced with the new value. If you supplied a @value_destroy_func when creating the #GHashTable, the old value is freed using that function. If you supplied a @key_destroy_func when creating the #GHashTable, the passed key is freed using that function. a #GHashTable. a key to insert. the value to associate with the key. Calls the given function for each of the key/value pairs in the #GTree. The function is passed the key and value of each pair, and the given @data parameter. The tree is traversed in sorted order. The tree may not be modified while iterating over it (you can't add/remove items). To remove all items matching a predicate, you need to add each item to a list in your #GTraverseFunc as you walk over the tree, then walk the list and remove each item. a #GTree. the function to call for each node visited. If this function returns %TRUE, the traversal is stopped. user data to pass to the function. Gets the modification time of the current @info and sets it in @result. a #GFileInfo. a #GTimeVal. Sets the marshaller of @closure. The <literal>marshal_data</literal> of @marshal provides a way for a meta marshaller to provide additional information to the marshaller. (See g_closure_set_meta_marshal().) For GObject's C predefined marshallers (the g_cclosure_marshal_*() functions), what it provides is a callback function to use instead of @closure->callback. a #GClosure a #GClosureMarshal function Return value: the path to the specified special directory, or %NULL the logical id of special directory the path to the specified special directory, or %NULL if the logical id was not found. The returned string is owned by GLib and should not be modified or freed. Since: 2.14 A case-insensitive string comparison, corresponding to the standard strcasecmp() function on platforms which support it. a string. a string to compare with @s1. 0 if the strings match, a negative value if @s1 < @s2, or a positive value if @s1 > @s2. Deprecated:2.2: See g_strncasecmp() for a discussion of why this function is deprecated and how to replace it. If @dest is %NULL, free @src; otherwise, moves @src into *@dest. The error variable @dest points to must be %NULL. error return location error to move into the return location Sets the @attribute to contain the given @attr_value, if possible. a #GFileInfo. a file attribute key. a string. Compares two strings for equality, returning %TRUE if they are equal. For use with #GHashTable. a #GString another #GString %TRUE if they strings are the same length and contain the same bytes Gets the length in bytes of digests of type @checksum_type a #GChecksumType the checksum length, or -1 if @checksum_type is not supported. Since: 2.16 Resets @cancellable to its uncancelled state. a #GCancellable object. Return value: The currently firing source or %NULL. The currently firing source or %NULL. Since: 2.12 Gets a new #GUnixMountMonitor. The default rate limit for which the monitor will report consecutive changes for the mount and mount point entry files is the default for a #GFileMonitor. Use g_unix_mount_monitor_set_rate_limit() to change this. a #GUnixMountMonitor. Associates a list of double values with @key under @group_name. If @key cannot be found then it is created. Since: 2.12 a #GKeyFile a group name a key an array of double values number of double values in @list Removes file descriptor from the set of file descriptors to be polled for a particular context. a #GMainContext a #GPollFD descriptor previously added with g_main_context_add_poll() Return value: the position of @iter a #GSequenceIter the position of @iter Since: 2.14 Sets the @attribute to contain the given value, if possible. a #GFileInfo. a file attribute key. a #GFileAttributeType pointer to the value Converts a string into canonical form, standardizing such issues as whether a character with an accent is represented as a base character and combining accent or as a single precomposed character. The string has to be valid UTF-8, otherwise %NULL is returned. You should generally call g_utf8_normalize() before comparing two Unicode strings. The normalization mode %G_NORMALIZE_DEFAULT only standardizes differences that do not affect the text content, such as the above-mentioned accent representation. %G_NORMALIZE_ALL also standardizes the "compatibility" characters in Unicode, such as SUPERSCRIPT THREE to the standard forms (in this case DIGIT THREE). Formatting information may be lost but for most text operations such characters should be considered the same. For example, g_utf8_collate() normalizes with %G_NORMALIZE_ALL as its first step. %G_NORMALIZE_DEFAULT_COMPOSE and %G_NORMALIZE_ALL_COMPOSE are like %G_NORMALIZE_DEFAULT and %G_NORMALIZE_ALL, but returned a result with composed forms rather than a maximally decomposed form. This is often useful if you intend to convert the string to a legacy encoding or pass it to a system with less capable Unicode handling. a UTF-8 encoded string. length of @str, in bytes, or -1 if @str is nul-terminated. the type of normalization to perform. a newly allocated string, that is the normalized form of @str, or %NULL if @str is not valid UTF-8. Retrieves the text matching the @match_num<!-- -->'th capturing parentheses. 0 is the full text of the match, 1 is the first paren set, 2 the second, and so on. If @match_num is a valid sub pattern but it didn't match anything (e.g. sub pattern 1, matching "b" against "(a)?b") then an empty string is returned. If the match was obtained using the DFA algorithm, that is using g_regex_match_all() or g_regex_match_all_full(), the retrieved string is not that of a set of parentheses but that of a matched substring. Substrings are matched in reverse order of length, so 0 is the longest match. The string is fetched from the string passed to the match function, so you cannot call this function after freeing the string. #GMatchInfo structure number of the sub expression The matched substring, or %NULL if an error occurred. You have to free the string yourself Since: 2.14 Tries to become the owner of the specified context. If some other thread is the owner of the context, Return value: %TRUE if the operation succeeded, and a #GMainContext %TRUE if the operation succeeded, and this thread is now the owner of @context. Writes all of @contents to a file named @filename, with good error checking. If a file called @filename already exists it will be overwritten. This write is atomic in the sense that it is first written to a temporary file which is then renamed to the final name. Notes: <itemizedlist> <listitem> On Unix, if @filename already exists hard links to @filename will break. Also since the file is recreated, existing permissions, access control lists, metadata etc. may be lost. If @filename is a symbolic link, the link itself will be replaced, not the linked file. </listitem> <listitem> On Windows renaming a file will not remove an existing file with the new name, so on Windows there is a race condition between the existing file being removed and the temporary file being renamed. </listitem> <listitem> On Windows there is no way to remove a file that is open to some process, or mapped into memory. Thus, this function will fail if @filename already exists and is open. </listitem> </itemizedlist> If the call was sucessful, it returns %TRUE. If the call was not successful, it returns %FALSE and sets @error. The error domain is #G_FILE_ERROR. Possible error codes are those in the #GFileError enumeration. name of a file to write @contents to, in the GLib file name encoding string to write to the file length of @contents, or -1 if @contents is a nul-terminated string return location for a #GError, or %NULL %TRUE on success, %FALSE if an error occurred Since: 2.8 Returns: The depth of @type. A #GType value. The depth of @type. Retrieves every key inside @hash_table. The returned data is valid until @hash_table is modified. a #GHashTable a #GList containing all the keys inside the hash table. The content of the list is owned by the hash table and should not be modified or freed. Use g_list_free() when done using the list. Since: 2.14 Asynchronously gets the requested information about the files in a directory. The result is a #GFileEnumerator object that will give out #GFileInfo objects for all the files in the directory. For more details, see g_file_enumerate_children() which is the synchronous version of this call. When the operation is finished, @callback will be called. You can then call g_file_enumerate_children_finish() to get the result of the operation. input #GFile. an attribute query string. a set of #GFileQueryInfoFlags. the <link linkend="io-priority">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied the data to pass to callback function Sets the file type in a #GFileInfo to @type. See %G_FILE_ATTRIBUTE_STANDARD_TYPE. a #GFileInfo. a #GFileType. Reads a 16-bit/2-byte value from @stream. In order to get the correct byte order for this read operation, see g_data_stream_get_byte_order() and g_data_stream_set_byte_order(). a given #GDataInputStream. optional #GCancellable object, %NULL to ignore. #GError for error reporting. a signed 16-bit/2-byte value read from @stream or %0 if an error occurred. Associates a list of boolean values with @key under @group_name. If @key cannot be found then it is created. If @group_name is %NULL, the start_group is used. Since: 2.6 a #GKeyFile a group name a key an array of boolean values length of @list Like g_object_set_data() except it adds notification for when the association is destroyed, either by setting it to a different value or when the object is destroyed. Note that the @destroy callback is not called if @data is %NULL. #GObject containing the associations name of the key data to associate with that key function to call when the association is destroyed Get the contents of a %G_TYPE_PARAM #GValue. a valid #GValue whose type is derived from %G_TYPE_PARAM #GParamSpec content of @value Converts a character to the titlecase. a Unicode character the result of converting @c to titlecase. If @c is not an uppercase or lowercase character, @c is returned unchanged. Decreases the reference count on a #GMainLoop object by one. If the result is zero, free the loop and free all associated memory. a #GMainLoop Similar to g_type_init(), but additionally sets debug flags. Bitwise combination of #GTypeDebugFlags values for debugging purposes. Gets the time the bookmark for @uri was added to @bookmark In the event the URI cannot be found, -1 is returned and @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. a #GBookmarkFile a valid URI return location for a #GError, or %NULL a timestamp Since: 2.12 A convenience function to use gettext() for translating user-visible strings. Since: 2.6 a #GOptionGroup the domain to use Gets a file's type (whether it is a regular file, symlink, etc). This is different from the file's content type, see g_file_info_get_content_type(). a #GFileInfo. a #GFileType for the given file. Frees the memory allocated for @checksum. Since: 2.16 a #GChecksum Checks if @mount can be mounted. a #GMount. %TRUE if the @mount can be unmounted. A wrapper for the POSIX freopen() function. The freopen() function opens a file and associates it with an existing stream. See your C library manual for more details about freopen(). a pathname in the GLib file name encoding (UTF-8 on Windows) a string describing the mode in which the file should be opened an existing stream which will be reused, or %NULL A <type>FILE</type> pointer if the file was successfully opened, or %NULL if an error occurred. Since: 2.6 Creates a new filename completer. a #GFilenameCompleter. Puts a signed 16-bit integer into the output stream. a #GDataOutputStream. a #gint16. optional #GCancellable object, %NULL to ignore. a #GError, %NULL to ignore. %TRUE if @data was successfully added to the @stream. Looks up an existing extension point. the name of the extension point the #GIOExtensionPoint, or %NULL if there is no registered extension point with the given name Gets the value corresponding to the given key. Since a #GTree is automatically balanced as key/value pairs are added, key lookup is very fast. a #GTree. the key to look up. the value corresponding to the key, or %NULL if the key was not found. Information about an installed application from a desktop file. Destroys all keys and values in the #GHashTable and decrements its reference count by 1. If keys and/or values are dynamically allocated, you should either free them first or create the #GHashTable with destroy notifiers using g_hash_table_new_full(). In the latter case the destroy functions you supplied will be called on all keys and values during the destruction phase. a #GHashTable. Gets the required type for @extension_point. a #GIOExtensionPoint the #GType that all implementations must have, or #G_TYPE_INVALID if the extension point has no required type Report the last result of g_test_timer_elapsed(). the last result of g_test_timer_elapsed(), as a double Since: 2.16 This function sets the byte order for the given @stream. All subsequent reads from the @stream will be read in the given @order. a given #GDataInputStream. a #GDataStreamByteOrder to set. Determines if a character is typically rendered in a double-width cell. a Unicode character %TRUE if the character is wide Removes an element from a #GSList, without freeing the element. The removed element's next link is set to %NULL, so that it becomes a self-contained list with one element. a #GSList an element in the #GSList the new start of the #GSList, without the element Returns: the number of capturing subpatterns a #GRegex the number of capturing subpatterns Since: 2.14 Gets the time when the bookmark for @uri was last modified. In the event the URI cannot be found, -1 is returned and @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. a #GBookmarkFile a valid URI return location for a #GError, or %NULL a timestamp Since: 2.12 Sets the name for a #GTypeModule a #GTypeModule. a human-readable name to use in error messages. Checks if a cancellable job has been cancelled. a #GCancellable or NULL. %TRUE if @cancellable is cancelled, FALSE if called with %NULL or if item is not cancelled. Writes a Unicode character to @channel. This function cannot be called on a channel with %NULL encoding. a #GIOChannel a character location to return an error of type #GConvertError or #GIOChannelError a #GIOStatus Checks if a file is hidden. a #GFileInfo. %TRUE if the file is a hidden file, %FALSE otherwise. Return value: A random number. lower closed bound of the interval. upper open bound of the interval. A random number. Adds the given number of microseconds to @time_. @microseconds can also be negative to decrease the value of @time_. a #GTimeVal number of microseconds to add to @time Checks if two #GAppInfos are equal. the first #GAppInfo. the second #GAppInfo. %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise. Creates a new #GString with @len bytes of the @init buffer. Because a length is provided, @init need not be nul-terminated, and can contain embedded nul bytes. Since this function does not stop at nul bytes, it is the caller's responsibility to ensure that @init has at least @len addressable bytes. initial contents of the string length of @init to use a new #GString Sets a function to be called when the child indicated by @pid exits, at a default priority, #G_PRIORITY_DEFAULT. If you obtain @pid from g_spawn_async() or g_spawn_async_with_pipes() you will need to pass #G_SPAWN_DO_NOT_REAP_CHILD as flag to the spawn function for the child watching to work. Note that on platforms where #GPid must be explicitly closed (see g_spawn_close_pid()) @pid must not be closed while the source is still active. Typically, you will want to call g_spawn_close_pid() in the callback function for the source. GLib supports only a single callback per process id. process id to watch. On POSIX the pid of a child process. On Windows a handle for a process (which doesn't have to be a child). function to call data to pass to @function the ID (greater than 0) of the event source. Since: 2.4 Checks if a volume can be mounted. a #GVolume. %TRUE if the @volume can be mounted. %FALSE otherwise. Increases the use count of a #GTypeModule by one. If the use count was zero before, the plugin will be loaded. a #GTypeModule %FALSE if the plugin needed to be loaded and loading the plugin failed. Installs a new property. This is usually done in the class initializer. a #GObjectClass the id for the new property the #GParamSpec for the new property Gets the volume monitor used by gio. a reference to the #GVolumeMonitor used by gio. Call g_object_unref() when done with it. Sets the buffer size. a #GIOChannel the size of the buffer, or 0 to let GLib pick a good size Returns: read-only buffer a #GBufferedInputStream. a #gsize to get the number of bytes available in the buffer. read-only buffer Given the signal's identifier, finds its name. Two different signals may have the same name, if they have differing types. the signal's identifying number. the signal name, or %NULL if the signal number was invalid. Sets the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed and takes over the ownership of the callers reference to @v_boxed; the caller doesn't have to unref it any more. Since: 2.4 a valid #GValue of %G_TYPE_BOXED derived type duplicated unowned boxed value to be set Utility function to inspect the #GFileType of a file. This is implemented using g_file_query_info() and as such does blocking I/O. The primary use case of this method is to check if a file is a regular file, directory, or symlink. input #GFile. a set of #GFileQueryInfoFlags passed to g_file_query_info(). optional #GCancellable object, %NULL to ignore. The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file does not exist Since: 2.18 Frees a #GError and associated resources. a #GError Inserts a #GNode beneath the parent before the given sibling. the #GNode to place @node under the sibling #GNode to place @node before. If sibling is %NULL, the node is inserted as the last child of @parent. the #GNode to insert the inserted #GNode Creates a new file attribute info list. a #GFileAttributeInfoList. Sets a function to be called at regular intervals with the default priority, #G_PRIORITY_DEFAULT. The function is called repeatedly until it returns %FALSE, at which point the timeout is automatically destroyed and the function will not be called again. See g_timeout_add_seconds_full() for the differences between g_timeout_add() and g_timeout_add_seconds(). the time between calls to the function, in seconds function to call data to pass to @function the ID (greater than 0) of the event source. Since: 2.14 Initializes @value with the default value of @type. A zero-filled (uninitialized) #GValue structure. Type the #GValue should hold values of. the #GValue structure that has been passed in Gets the current newline type for the @stream. a given #GDataInputStream. #GDataStreamNewlineType for the given @stream. Obtains data which has previously been attached to @type with g_type_set_qdata(). a #GType a #GQuark id to identify the data the data, or %NULL if no data was found Determines the break type of @c. @c should be a Unicode character (to derive a character from UTF-8 encoded text, use g_utf8_get_char()). The break type is used to find word and line breaks ("text boundaries"), Pango implements the Unicode boundary resolution algorithms and normally you would use a function such as pango_break() instead of caring about break types yourself. a Unicode character the break type of @c Checks if a drive can be polled for media changes. a #GDrive. %TRUE if the @drive can be polled for media changes. %FALSE otherwise. Removes a key and its associated value from a #GHashTable without calling the key and value destroy functions. a #GHashTable. the key to remove. %TRUE if the key was found and removed from the #GHashTable. Frees all of the memory used by a #GSList. The freed elements are returned to the slice allocator. a #GSList Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value. If @attribute is of a different type, this operation will fail. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. a string containing the attribute's name. a #guint64 containing the attribute's new value. a #GFileQueryInfoFlags. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL %TRUE if the @attribute was successfully set, %FALSE otherwise. Adds a new element at the tail of the queue. a #GQueue. the data for the new element. A wrapper for the POSIX access() function. This function is used to test a pathname for one or several of read, write or execute permissions, or just existence. On Windows, the file protection mechanism is not at all POSIX-like, and the underlying function in the C library only checks the FAT-style READONLY attribute, and does not look at the ACL of a file at all. This function is this in practise almost useless on Windows. Software that needs to handle file permissions on Windows more exactly should use the Win32 API. See your C library manual for more details about access(). a pathname in the GLib file name encoding (UTF-8 on Windows) as in access() zero if the pathname refers to an existing file system object that has all the tested permissions, or -1 otherwise or on error. Since: 2.8 Gets an array of completion strings for a given initial text. the filename completer. text to be completed. array of strings with possible completions for @initial_text. This array must be freed by g_strfreev() when finished. Gets the byte order for the stream. a #GDataOutputStream. the #GDataStreamByteOrder for the @stream. Gets the icon for a file. a #GFileInfo. #GIcon for the given @info. Associates two functions with @group which will be called from g_option_context_parse() before the first option is parsed and after the last option has been parsed, respectively. Note that the user data to be passed to @pre_parse_func and @post_parse_func can be specified when constructing the group with g_option_group_new(). Since: 2.6 a #GOptionGroup a function to call before parsing, or %NULL a function to call after parsing, or %NULL Adds the application with @name and @exec to the list of applications that have registered a bookmark for @uri into @bookmark. Every bookmark inside a #GBookmarkFile must have at least an application registered. Each application must provide a name, a command line useful for launching the bookmark, the number of times the bookmark has been registered by the application and the last time the application registered this bookmark. If @name is %NULL, the name of the application will be the same returned by g_get_application(); if @exec is %NULL, the command line will be a composition of the program name as returned by g_get_prgname() and the "%u" modifier, which will be expanded to the bookmark's URI. This function will automatically take care of updating the registrations count and timestamping in case an application with the same @name had already registered a bookmark for @uri inside @bookmark. If no bookmark for @uri is found, one is created. Since: 2.12 a #GBookmarkFile a valid URI the name of the application registering the bookmark or %NULL command line to be used to launch the bookmark or %NULL Reverses a #GSList. a #GSList the start of the reversed #GSList This is a convenience function often needed in class initializers. It returns the class structure of the immediate parent type of the class passed in. Since derived classes hold a reference count on their parent classes as long as they are instantiated, the returned class will always exist. This function is essentially equivalent to: <programlisting> g_type_class_peek (g_type_parent (G_TYPE_FROM_CLASS (g_class))); </programlisting> The #GTypeClass structure to retrieve the parent class for. The parent class of @g_class. Returns: A newly allocated string containing the help text a #GOptionContext if %TRUE, only include the main group the #GOptionGroup to create help for, or %NULL A newly allocated string containing the help text Since: 2.14 Gets the GIO Error Quark. a #GQuark. Gets the name of @drive. a #GDrive. a string containing @drive's name. The returned string should be freed when no longer needed. Creates a new #GMainContext structure. the new #GMainContext A safer form of the standard vsprintf() function. The output is guaranteed to not exceed @n characters (including the terminating nul character), so it is easy to ensure that a buffer overflow cannot occur. See also g_strdup_vprintf(). In versions of GLib prior to 1.2.3, this function may return -1 if the output was truncated, and the truncated string may not be nul-terminated. In versions prior to 1.3.12, this function returns the length of the output string. The return value of g_vsnprintf() conforms to the vsnprintf() function as standardized in ISO C99. Note that this is different from traditional vsnprintf(), which returns the length of the output string. The format string may contain positional parameters, as specified in the Single Unix Specification. the buffer to hold the output. the maximum number of bytes to produce (including the terminating nul character). a standard printf() format string, but notice <link linkend="string-precision">string precision pitfalls</link>. the list of arguments to insert in the output. the number of bytes which would be produced if the buffer was large enough. Sets properties on an object. a #GObject name of the first property to set value for the first property, followed optionally by more name/value pairs, followed by %NULL Asynchronously gets the requested information about specified @file. The result is a #GFileInfo object that contains key-value attributes (such as type or size for the file). For more details, see g_file_query_info() which is the synchronous version of this call. When the operation is finished, @callback will be called. You can then call g_file_query_info_finish() to get the result of the operation. input #GFile. an attribute query string. a set of #GFileQueryInfoFlags. the <link linkend="io-priority">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied the data to pass to callback function Renames @file to the specified display name. The display name is converted from UTF8 to the correct encoding for the target filesystem if possible and the @file is renamed to this. If you want to implement a rename operation in the user interface the edit name (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the initial value in the rename widget, and then the result after editing should be passed to g_file_set_display_name(). On success the resulting converted filename is returned. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. a string. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL a #GFile specifying what @file was renamed to, or %NULL if there was an error. Removes a supported type from an application, if possible. a #GAppInfo. a string. a #GError. %TRUE on success, %FALSE on error. Does nothing if @err is %NULL; if @err is non-%NULL, then *@err must be %NULL. A new #GError is created and assigned to *@err. Unlike g_set_error(), @message is not a printf()-style format string. Use this function if @message contains text you don't have control over, that could include printf() escape sequences. a return location for a #GError, or %NULL error domain error code error message Registers @type_id as the predefined identifier and @type_name as the name of a fundamental type. The type system uses the information contained in the #GTypeInfo structure pointed to by @info and the #GTypeFundamentalInfo structure pointed to by @finfo to manage the type and its instances. The value of @flags determines additional characteristics of the fundamental type. A predefined type identifier. 0-terminated string used as the name of the new type. The #GTypeInfo structure for this type. The #GTypeFundamentalInfo structure for this type. Bitwise combination of #GTypeFlags values. The predefined type identifier. Convenience function to ref and sink a #GParamSpec. Since: 2.10 a valid #GParamSpec the #GParamSpec that was passed into this function Adds a string on to the start of a #GString, expanding it if necessary. a #GString the string to prepend on the start of @string @string Sets the newline type for the @stream. Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read chunk ends in "CR" we must read an additional byte to know if this is "CR" or "CR LF", and this might block if there is no more data availible. a #GDataInputStream. the type of new line return as #GDataStreamNewlineType. Converts a Unicode character into UTF-8, and appends it to the string. a #GString a Unicode character @string Creates a new #GParamSpecUInt64 instance specifying a %G_TYPE_UINT64 property. See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified minimum value for the property specified maximum value for the property specified default value for the property specified flags for the property specified a newly created parameter specification Returns: %TRUE if unknown options are ignored. a #GOptionContext %TRUE if unknown options are ignored. Since: 2.6 Removes a weak reference from @object that was previously added using g_object_add_weak_pointer(). The @weak_pointer_location has to match the one used with g_object_add_weak_pointer(). The object that is weak referenced. The memory address of a pointer. Sets the mount operation's password to @password. a #GMountOperation. password to set. Converts from an integer character offset to a pointer to a position within the string. Since 2.10, this function allows to pass a negative @offset to step backwards. It is usually worth stepping backwards from the end instead of forwards if @offset is in the last fourth of the string, since moving forward is about 3 times faster than moving backward. a UTF-8 encoded string a character offset within @str the resulting pointer Gets the encoding for the input/output of the channel. The internal encoding is always UTF-8. The encoding %NULL makes the channel safe for binary data. a #GIOChannel A string containing the encoding, this string is owned by GLib and must not be freed. This function tries to determine the installation directory of a software package based on the location of a DLL of the software package. @hmodule should be the handle of a loaded DLL or %NULL. The function looks up the directory that DLL was loaded from. If @hmodule is NULL, the directory the main executable of the current process is looked up. If that directory's last component is "bin" or "lib", its parent directory is returned, otherwise the directory itself. It thus makes sense to pass only the handle to a "public" DLL of a software package to this function, as such DLLs typically are known to be installed in a "bin" or occasionally "lib" subfolder of the installation folder. DLLs that are of the dynamically loaded module or plugin variety are often located in more private locations deeper down in the tree, from which it is impossible for GLib to deduce the root of the package installation. The typical use case for this function is to have a DllMain() that saves the handle for the DLL. Then when code in the DLL needs to construct names of files in the installation tree it calls this function passing the DLL handle. The Win32 handle for a DLL loaded into the current process, or %NULL a string containing the guessed installation directory for the software package @hmodule is from. The string is in the GLib file name encoding, i.e. UTF-8. The return value should be freed with g_free() when not needed any longer. If the function fails %NULL is returned. Since: 2.16 Inserts a new item just before the item pointed to by @iter. a #GSequenceIter the data for the new item an iterator pointing to the new item Since: 2.14 Loads a desktop bookmark file into an empty #GBookmarkFile structure. If the file could not be loaded then @error is set to either a #GFileError or #GBookmarkFileError. an empty #GBookmarkFile struct the path of a filename to load, in the GLib file name encoding return location for a #GError, or %NULL %TRUE if a desktop bookmark file could be loaded Since: 2.12 Sets the @attribute to contain the given @attr_value, if possible. a #GFileInfo. a file attribute key. an unsigned 32-bit integer. Gets the name of @volume. a #GVolume. the name for the given @volume. The returned string should be freed when no longer needed. Associates a new boolean value with @key under @group_name. If @key cannot be found then it is created. Since: 2.6 a #GKeyFile a group name a key %TRUE or %FALSE Gets the file system type for the mount point. a #GUnixMountPoint. a string containing the file system type. Convert a string from a 32-bit fixed width representation as UCS-4. to UTF-8. The result will be terminated with a 0 byte. a UCS-4 encoded string the maximum length (number of characters) of @str to use. If @len < 0, then the string is terminated with a 0 character. location to store number of characters read, or %NULL. location to store number of bytes written or %NULL. The value here stored does not include the trailing 0 byte. location to store the error occuring, or %NULL to ignore errors. Any of the errors in #GConvertError other than %G_CONVERT_ERROR_NO_CONVERSION may occur. a pointer to a newly allocated UTF-8 string. This value must be freed with g_free(). If an error occurs, %NULL will be returned and @error set. In that case, @items_read will be set to the position of the first invalid input character. Removes an element from a #GSList. If two elements contain the same data, only the first is removed. If none of the elements contain the data, the #GSList is unchanged. a #GSList the data of the element to remove the new start of the #GSList Returns: the data of the last element in the queue, or %NULL if the queue a #GQueue. the data of the last element in the queue, or %NULL if the queue is empty. Return value: the values associated with the key as a list of a #GKeyFile a group name a key the number of doubles returned return location for a #GError the values associated with the key as a list of doubles, or %NULL if the key was not found or could not be parsed. Since: 2.12 Sets @stream to have actions pending. If the pending flag is already set or @stream is closed, it will return %FALSE and set @error. a #GOutputStream. a #GError location to store the error occuring, or %NULL to ignore. %TRUE if pending was previously unset and is now set. Converts a string into a form that is independent of case. The result will not correspond to any particular case, but can be compared for equality or ordered with the results of calling g_utf8_casefold() on other strings. Note that calling g_utf8_casefold() followed by g_utf8_collate() is only an approximation to the correct linguistic case insensitive ordering, though it is a fairly good one. Getting this exactly right would require a more sophisticated collation function that takes case sensitivity into account. GLib does not currently provide such a function. a UTF-8 encoded string length of @str, in bytes, or -1 if @str is nul-terminated. a newly allocated string, that is a case independent form of @str. Tries to skip @count bytes from the stream. Will block during the operation. This is identical to g_input_stream_read(), from a behaviour standpoint, but the bytes that are skipped are not returned to the user. Some streams have an implementation that is more efficient than reading the data. This function is optional for inherited classes, as the default implementation emulates it using read. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an operation was partially finished when the operation was cancelled the partial result will be returned, without an error. a #GInputStream. the number of bytes that will be skipped from the stream optional #GCancellable object, %NULL to ignore. location to store the error occuring, or %NULL to ignore Number of bytes skipped, or -1 on error Sets the state of saving passwords for the mount operation. a #GMountOperation. a set of #GPasswordSave flags. Validates UTF-8 encoded text. @str is the text to validate; if @str is nul-terminated, then @max_len can be -1, otherwise @max_len should be the number of bytes to validate. If @end is non-%NULL, then the end of the valid range will be stored there (i.e. the start of the first invalid character if some bytes were invalid, or the end of the text being validated otherwise). Note that g_utf8_validate() returns %FALSE if @max_len is positive and NUL is met before @max_len bytes have been read. Return value: %TRUE if the text was valid UTF-8 a pointer to character data max bytes to validate, or -1 to go until NUL return location for end of valid data %TRUE if the text was valid UTF-8 Utility function that launches the default application registered to handle the specified uri. Synchronous I/O is done on the uri to detext the type of the file if required. the uri to show an optional #GAppLaunchContext. a #GError. %TRUE on success, %FALSE on error. Finishes an asynchronous read. a #GBufferedInputStream. a #GAsyncResult. a #GError. a #gssize of the read stream, or %-1 on an error. Converts a string into a collation key that can be compared with other collation keys produced by the same function using strcmp(). The results of comparing the collation keys of two strings with strcmp() will always be the same as comparing the two original keys with g_utf8_collate(). Note that this function depends on the <link linkend="setlocale">current locale</link>. a UTF-8 encoded string. length of @str, in bytes, or -1 if @str is nul-terminated. a newly allocated string. This string should be freed with g_free() when you are done with it. Return value: the value associated with the key as an integer, or a #GKeyFile a group name a key return location for a #GError the value associated with the key as an integer, or 0 if the key was not found or could not be parsed. Since: 2.6 In Unicode, some characters are <firstterm>mirrored</firstterm>. This means that their images are mirrored horizontally in text that is laid out from right to left. For instance, "(" would become its mirror image, ")", in right-to-left text. If @ch has the Unicode mirrored property and there is another unicode character that typically has a glyph that is the mirror image of @ch's glyph and @mirrored_ch is set, it puts that character in the address pointed to by @mirrored_ch. Otherwise the original character is put. a Unicode character location to store the mirrored character %TRUE if @ch has a mirrored character, %FALSE otherwise Since: 2.4 Converts a string from one character set to another. Note that you should use g_iconv() for streaming conversions<footnote id="streaming-state"> <para> Despite the fact that @byes_read can return information about partial characters, the <literal>g_convert_...</literal> functions are not generally suitable for streaming. If the underlying converter being used maintains internal state, then this won't be preserved across successive calls to g_convert(), g_convert_with_iconv() or g_convert_with_fallback(). (An example of this is the GNU C converter for CP1255 which does not emit a base character until it knows that the next character is not a mark that could combine with the base character.) </para> </footnote>. the string to convert the length of the string, or -1 if the string is nul-terminated<footnoteref linkend="nul-unsafe"/>. conversion descriptor from g_iconv_open() location to store the number of bytes in the input string that were successfully converted, or %NULL. Even if the conversion was successful, this may be less than @len if there were partial characters at the end of the input. If the error #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value stored will the byte offset after the last valid input sequence. the number of bytes stored in the output buffer (not including the terminating nul). location to store the error occuring, or %NULL to ignore errors. Any of the errors in #GConvertError may occur. If the conversion was successful, a newly allocated nul-terminated string, which must be freed with g_free(). Otherwise %NULL and @error will be set. Checks that the GLib library in use is compatible with the given version. Generally you would pass in the constants #GLIB_MAJOR_VERSION, #GLIB_MINOR_VERSION, #GLIB_MICRO_VERSION as the three arguments to this function; that produces a check that the library in use is compatible with the version of GLib the application or module was compiled against. Compatibility is defined by two things: first the version of the running library is newer than the version @required_major.required_minor.@required_micro. Second the running library must be binary compatible with the version @required_major.required_minor.@required_micro (same major version.) the required major version. the required minor version. the required micro version. %NULL if the GLib library is compatible with the given version, or a string describing the version mismatch. The returned string is owned by GLib and must not be modified or freed. Since: 2.6 Looks up or registers a type that is implemented with a particular type plugin. If a type with name @type_name was previously registered, the #GType identifier for the type is returned, otherwise the type is newly registered, and the resulting #GType identifier returned. When reregistering a type (typically because a module is unloaded then reloaded, and reinitialized), @module and @parent_type must be the same as they were previously. As long as any instances of the type exist, the type plugin will not be unloaded. a #GTypeModule the type for the parent class name for the type type information structure flags field providing details about the type the new or existing type ID Get the contents of a pointer #GValue. a valid #GValue of %G_TYPE_POINTER pointer contents of @value Converts a filename from UTF-8 to the system codepage. On NT-based Windows, on NTFS file systems, file names are in Unicode. It is quite possible that Unicode file names contain characters not representable in the system codepage. (For instance, Greek or Cyrillic characters on Western European or US Windows installations, or various less common CJK characters on CJK Windows installations.) In such a case, and if the filename refers to an existing file, and the file system stores alternate short (8.3) names for directory entries, the short form of the filename is returned. Note that the "short" name might in fact be longer than the Unicode name if the Unicode name has very short pathname components containing non-ASCII characters. If no system codepage name for the file is possible, %NULL is returned. The return value is dynamically allocated and should be freed with g_free() when no longer needed. a UTF-8 encoded filename. The converted filename, or %NULL on conversion failure and lack of short names. Since: 2.8 Allocates a struct of the given size and initializes the initial part as a #GClosure. This function is mainly useful when implementing new types of closures. |[ typedef struct _MyClosure MyClosure; struct _MyClosure { GClosure closure; // extra data goes here }; static void my_closure_finalize (gpointer notify_data, GClosure *closure) { MyClosure *my_closure = (MyClosure *)closure; // free extra data here } MyClosure *my_closure_new (gpointer data) { GClosure *closure; MyClosure *my_closure; closure = g_closure_new_simple (sizeof (MyClosure), data); my_closure = (MyClosure *) closure; // initialize extra data here g_closure_add_finalize_notifier (closure, notify_data, my_closure_finalize); return my_closure; } ]| the size of the structure to allocate, must be at least <literal>sizeof (GClosure)</literal> data to store in the @data field of the newly allocated #GClosure a newly allocated #GClosure Return value: A #GFileInfo or %NULL on error or end of enumerator a #GFileEnumerator. optional #GCancellable object, %NULL to ignore. location to store the error occuring, or %NULL to ignore A #GFileInfo or %NULL on error or end of enumerator Return a newly allocated and 0-terminated array of type IDs, listing the interface types that @type conforms to. The return value has to be g_free()ed after use. The type to list interface types for. Optional #guint pointer to contain the number of interface types. Newly allocated and 0-terminated array of interface types. Converts an <literal>errno</literal> error number to a #GIOChannelError. an <literal>errno</literal> error number, e.g. %EINVAL a #GIOChannelError error number, e.g. %G_IO_CHANNEL_ERROR_INVAL. Like g_sequence_sort_changed(), but uses a #GSequenceIterCompareFunc instead of a #GCompareDataFunc as the compare function. Since: 2.14 a #GSequenceIter the #GSequenceItercompare used to compare iterators in the sequence. It is called with two iterators pointing into @seq. It should return 0 if the iterators are equal, a negative value if the first iterator comes before the second, and a positive value if the second iterator comes before the first. user data passed to @cmp_func Determines if a given character is assigned in the Unicode standard. a Unicode character %TRUE if the character has an assigned value Guesses whether a Unix mount should be displayed in the UI. a #GUnixMountEntry %TRUE if @mount_entry is deemed to be displayable. Finds a #GMount object by it's UUID (see g_mount_get_uuid()) a #GVolumeMonitor. the UUID to look for a #GMount or %NULL if no such mount is available. Blocks a handler of an instance so it will not be called during any signal emissions unless it is unblocked again. Thus "blocking" a signal handler means to temporarily deactive it, a signal handler has to be unblocked exactly the same amount of times it has been blocked before to become active again. The @handler_id has to be a valid signal handler id, connected to a signal of @instance. The instance to block the signal handler of. Handler id of the handler to be blocked. Set the contents of a %G_TYPE_FLOAT #GValue to @v_float. a valid #GValue of type %G_TYPE_FLOAT float value to be set Retrieves the element stack from the internal state of the parser. The returned #GSList is a list of strings where the first item is the currently open tag (as would be returned by g_markup_parse_context_get_element()) and the next item is its immediate parent. This function is intended to be used in the start_element and end_element handlers where g_markup_parse_context_get_element() would merely return the name of the element that is being processed. a #GMarkupParseContext the element stack, which must not be modified Since: 2.16 Try to determine the installation directory for a software package. This function will be deprecated in the future. Use g_win32_get_package_installation_directory_of_module() instead. The use of @package is deprecated. You should always pass %NULL. The original intended use of @package was for a short identifier of the package, typically the same identifier as used for <literal>GETTEXT_PACKAGE</literal> in software configured using GNU autotools. The function first looks in the Windows Registry for the value <literal>#InstallationDirectory</literal> in the key <literal>#HKLM\Software\@package</literal>, and if that value exists and is a string, returns that. It is strongly recommended that packagers of GLib-using libraries for Windows do not store installation paths in the Registry to be used by this function as that interfers with having several parallel installations of the library. Enabling multiple installations of different versions of some GLib-using library, or GLib itself, is desirable for various reasons. For this reason it is recommeded to always pass %NULL as @package to this function, to avoid the temptation to use the Registry. In version 2.18 of GLib the @package parameter will be ignored and this function won't look in the Registry at all. If @package is %NULL, or the above value isn't found in the Registry, but @dll_name is non-%NULL, it should name a DLL loaded into the current process. Typically that would be the name of the DLL calling this function, looking for its installation directory. The function then asks Windows what directory that DLL was loaded from. If that directory's last component is "bin" or "lib", the parent directory is returned, otherwise the directory itself. If that DLL isn't loaded, the function proceeds as if @dll_name was %NULL. If both @package and @dll_name are %NULL, the directory from where the main executable of the process was loaded is used instead in the same way as above. You should pass %NULL for this. The name of a DLL that a package provides in UTF-8, or %NULL. a string containing the installation directory for @package. The string is in the GLib file name encoding, i.e. UTF-8. The return value should be freed with g_free() when not needed any longer. If the function fails %NULL is returned. Creates a new #GParamSpecUChar instance specifying a %G_TYPE_UCHAR property. canonical name of the property specified nick name for the property specified description of the property specified minimum value for the property specified maximum value for the property specified default value for the property specified flags for the property specified a newly created parameter specification Sets the contents of a %G_TYPE_STRING #GValue to @v_string. Since: 2.4 a valid #GValue of type %G_TYPE_STRING duplicated unowned string to be set Sets the rate limit to which the @monitor will report consecutive change events to the same file. a #GFileMonitor. a integer with the limit in milliseconds to poll for changes. If the @cancelalble is cancelled, sets the error to notify that the operation was cancelled. a #GCancellable object. #GError to append error state to. %TRUE if @cancellable was cancelled, %FALSE if it was not. Finishes an asynchronous file create operation started with g_file_create_async(). input #GFile. a #GAsyncResult. a #GError, or %NULL a #GFileOutputStream or %NULL on error. Gets the state of saving passwords for the mount operation. a #GMountOperation. a #GPasswordSave flag. Creates a new #GInputStream from the given @base_stream, with a buffer set to the default size (4 kilobytes). a #GInputStream. a #GInputStream for the given @base_stream. Setting this flag to %TRUE for a channel you have already closed can cause problems. a #GIOChannel Whether to close the channel on the final unref of the GIOChannel data structure. The default value of this is %TRUE for channels created by g_io_channel_new_file (), and %FALSE for all other channels. Returns: the description a #GOptionContext the description Since: 2.12 Close an IO channel. Any pending data to be written will be flushed if @flush is %TRUE. The channel will not be freed until the last reference is dropped using g_io_channel_unref(). a #GIOChannel if %TRUE, flush pending location to store a #GIOChannelError the status of the operation. Looks up or registers a flags type that is implemented with a particular type plugin. If a type with name @type_name was previously registered, the #GType identifier for the type is returned, otherwise the type is newly registered, and the resulting #GType identifier returned. As long as any instances of the type exist, the type plugin will not be unloaded. Since: 2.6 a #GTypeModule name for the type an array of #GFlagsValue structs for the possible flags values. The array is terminated by a struct with all members being 0. the new or existing type ID Gets the icon for a content type. a content type string. #GIcon corresponding to the content type. Convert a string from UCS-4 to UTF-16. A 0 character will be added to the result after the converted text. a UCS-4 encoded string the maximum length (number of characters) of @str to use. If @len < 0, then the string is terminated with a 0 character. location to store number of bytes read, or %NULL. If an error occurs then the index of the invalid input is stored here. location to store number of <type>gunichar2</type> written, or %NULL. The value stored here does not include the trailing 0. location to store the error occuring, or %NULL to ignore errors. Any of the errors in #GConvertError other than %G_CONVERT_ERROR_NO_CONVERSION may occur. a pointer to a newly allocated UTF-16 string. This value must be freed with g_free(). If an error occurs, %NULL will be returned and @error set. Inserts a #GNode beneath the parent after the given sibling. the #GNode to place @node under the sibling #GNode to place @node after. If sibling is %NULL, the node is inserted as the first child of @parent. the #GNode to insert the inserted #GNode Inserts @data into @queue using @func to determine the new position. Since: 2.4 a #GQueue the data to insert the #GCompareDataFunc used to compare elements in the queue. It is called with two elements of the @queue and @user_data. It should return 0 if the elements are equal, a negative value if the first element comes before the second, and a positive value if the second element comes before the first. user data passed to @func. Get a reproducible random integer number. The random numbers generated by the g_test_rand_*() family of functions change with every new test program start, unless the --seed option is given when starting test programs. For individual test cases however, the random number generator is reseeded, to avoid dependencies between tests and to make --seed effective for all test cases. a random number from the seeded random number generator. Since: 2.16 If @is_a_type is a derivable type, check whether @type is a descendant of @is_a_type. If @is_a_type is an interface, check whether @type conforms to it. Type to check anchestry for. Possible anchestor of @type or interface @type could conform to. %TRUE if @type is_a @is_a_type holds true. This function gets back user data pointers stored via g_object_set_qdata(). The GObject to get a stored user data pointer from A #GQuark, naming the user data pointer The user data pointer set, or %NULL Cancels all cancellable I/O jobs. A job is cancellable if a #GCancellable was passed into g_io_scheduler_push_job(). Adds @test_case to @suite. Since: 2.16 a #GTestSuite a #GTestCase A convenience function to disconnect multiple signals at once. The signal specs expected by this function have the form "any_signal", which means to disconnect any signal with matching callback and data, or "any_signal::signal_name", which only disconnects the signal named "signal_name". a #GObject the spec for the first signal #GCallback for the first signal, followed by data for the first signal, followed optionally by more signal spec/callback/data triples, followed by %NULL Same as the standard UNIX routine iconv_open(), but may be implemented via libiconv on UNIX flavors that lack a native implementation. GLib provides g_convert() and g_locale_to_utf8() which are likely more convenient than the raw iconv wrappers. destination codeset source codeset a "conversion descriptor", or (GIConv)-1 if opening the converter failed. Adds a weak reference callback to an object. Weak references are used for notification when an object is finalized. They are called "weak references" because they allow you to safely hold a pointer to an object without calling g_object_ref() (g_object_ref() adds a strong reference, that is, forces the object to stay alive). #GObject to reference weakly callback to invoke before the object is freed extra data to pass to notify Computes the checksum of a string. a #GChecksumType the string to compute the checksum of the length of the string, or -1 if the string is null-terminated. the checksum as a hexadecimal string. The returned string should be freed with g_free() when done using it. Since: 2.16 Frees the memory allocated for the #GRand. a #GRand. Return value: a newly-allocated %NULL-terminated array of strings. a #GKeyFile return location for the number of returned groups, or %NULL a newly-allocated %NULL-terminated array of strings. Use g_strfreev() to free it. Since: 2.6 Calls @func for each item in the range (@begin, @end) passing @user_data to the function. Since: 2.14 a #GSequenceIter a #GSequenceIter a #GFunc user data passed to @func Gets the installed name of the application. a #GAppInfo. the name of the application for @appinfo. A more efficient version of g_type_class_peek() which works only for static types. Since: 2.4 Type ID of a classed type. The #GTypeClass structure for the given type ID or %NULL if the class does not currently exist or is dynamically loaded. Creates a new #GParamSpecBoolean instance specifying a %G_TYPE_BOOLEAN property. See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified default value for the property specified flags for the property specified a newly created parameter specification Gets the <link linkend="gfile-etag">entity tag</link> for a given #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE. a #GFileInfo. a string containing the value of the "etag:value" attribute. Gets the icon for the application. a #GAppInfo. the default #GIcon for @appinfo. Creates a new random number generator initialized with @seed. an array of seeds to initialize the random number generator. an array of seeds to initialize the random number generator. the new #GRand. Since: 2.4 Sets @value to its default value as specified in @pspec. a valid #GParamSpec a #GValue of correct type for @pspec Converts a Unicode character into UTF-8, and prepends it to the string. a #GString a Unicode character @string Ejects a volume. a #GVolume. flags affecting the unmount if required for eject optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback, or %NULL. a #gpointer. Initializes the random number generator by an array of longs. Array can be of arbitrary size, though only the first 624 values are taken. This function is useful if you have many low entropy seeds, or if you require more then 32bits of actual entropy for your application. Since: 2.4 a #GRand. array to initialize with length of array Scans for a match in @string for @pattern. This function is equivalent to g_regex_match() but it does not require to compile the pattern with g_regex_new(), avoiding some lines of code when you need just to do a match without extracting substrings, capture counts, and so on. If this function is to be called on the same @pattern more than once, it's more efficient to compile the pattern once with g_regex_new() and then use g_regex_match(). the regular expression the string to scan for matches compile options for the regular expression match options %TRUE is the string matched, %FALSE otherwise Since: 2.14 Frees a %NULL-terminated array of strings, and the array itself. If called on a %NULL value, g_strfreev() simply returns. a %NULL-terminated array of strings to free. Removes a weak reference callback to an object. #GObject to remove a weak reference from callback to search for data to search for Get the unique name that is assigned to a type ID. Note that this function (like all other GType API) cannot cope with invalid type IDs. %G_TYPE_INVALID may be passed to this function, as may be any other validly registered type ID, but randomized type IDs should not be passed in and will most likely lead to a crash. Type to return name for. Static type name or %NULL. Checks if the @drive supports removable media. a #GDrive. %TRUE if @drive supports removable media, %FALSE otherwise. Same as the standard UNIX routine iconv(), but may be implemented via libiconv on UNIX flavors that lack a native implementation. GLib provides g_convert() and g_locale_to_utf8() which are likely more convenient than the raw iconv wrappers. conversion descriptor from g_iconv_open() bytes to convert inout parameter, bytes remaining to convert in @inbuf converted output bytes inout parameter, bytes available to fill in @outbuf count of non-reversible conversions, or -1 on error Dispatches all pending sources. a #GMainContext Swaps the items pointed to by @a and @b. It is allowed for @a and @b to point into difference sequences. Since: 2.14 a #GSequenceIter a #GSequenceIter Gets the position of a #GNode with respect to its siblings. @child must be a child of @node. The first child is numbered 0, the second 1, and so on. a #GNode a child of @node the position of @child with respect to its siblings Enables or disables automatic generation of <option>--help</option> output. By default, g_option_context_parse() recognizes <option>--help</option>, <option>-?</option>, <option>--help-all</option> and <option>--help-</option><replaceable>groupname</replaceable> and creates suitable output to stdout. Since: 2.6 a #GOptionContext %TRUE to enable <option>--help</option>, %FALSE to disable it Adds a new element on to the end of the list. <note><para> The return value is the new start of the list, which may have changed, so make sure you store the new value. </para></note> <note><para> Note that g_list_append() has to traverse the entire list to find the end, which is inefficient when adding multiple elements. A common idiom to avoid the inefficiency is to prepend the elements and reverse the list when all elements have been added. </para></note> |[ /* Notice that these are initialized to the empty list. */ GList *list = NULL, *number_list = NULL; /* This is a list of strings. */ list = g_list_append (list, "first"); list = g_list_append (list, "second"); /* This is a list of integers. */ number_list = g_list_append (number_list, GINT_TO_POINTER (27)); number_list = g_list_append (number_list, GINT_TO_POINTER (14)); ]| a pointer to a #GList the data for the new element the new start of the #GList Puts a byte into the output stream. a #GDataOutputStream. a #guchar. optional #GCancellable object, %NULL to ignore. a #GError, %NULL to ignore. %TRUE if @data was successfully added to the @stream. Returns: the #GEnumValue for @value, or %NULL if @value is not a a #GEnumClass the value to look up the #GEnumValue for @value, or %NULL if @value is not a member of the enumeration Finishes ejecting a drive. a #GDrive. a #GAsyncResult. a #GError. %TRUE if the drive has been ejected successfully, %FALSE otherwise. Gets the maximum height of all branches beneath a #GNode. This is the maximum distance from the #GNode to all leaf nodes. If @root is %NULL, 0 is returned. If @root has no children, 1 is returned. If @root has children, 2 is returned. And so on. a #GNode the maximum height of the tree beneath @root Retrieves the description of the bookmark for @uri. In the event the URI cannot be found, %NULL is returned and @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. a #GBookmarkFile a valid URI return location for a #GError, or %NULL a newly allocated string or %NULL if the specified URI cannot be found. Since: 2.12 Gets the data of the element at the given position. a #GList the position of the element the element's data, or %NULL if the position is off the end of the #GList Adds a new item to the end of @seq. a #GSequencePointer the data for the new item an iterator pointing to the new item Since: 2.14 Tries to read @count bytes from the stream into the buffer starting at @buffer. Will block during this read. This function is similar to g_input_stream_read(), except it tries to read as many bytes as requested, only stopping on an error or end of stream. On a successful read of @count bytes, or if we reached the end of the stream, %TRUE is returned, and @bytes_read is set to the number of bytes read into @buffer. If there is an error during the operation %FALSE is returned and @error is set to indicate the error status, @bytes_read is updated to contain the number of bytes read into @buffer before the error occurred. a #GInputStream. a buffer to read data into (which should be at least count bytes long). the number of bytes that will be read from the stream location to store the number of bytes that was read from the stream optional #GCancellable object, %NULL to ignore. location to store the error occuring, or %NULL to ignore %TRUE on success, %FALSE if there was an error Gets a #GFile for @path. a #GVfs. a string containing a VFS path. a #GFile. Gets a list of all extensions that implement this extension point. The list is sorted by priority, beginning with the highest priority. a #GIOExtensionPoint a #GList of #GIOExtension<!-- -->s. The list is owned by GIO and should not be modified Set the contents of a %G_TYPE_OBJECT derived #GValue to @v_object. g_value_set_object() increases the reference count of @v_object (the #GValue holds a reference to @v_object). If you do not wish to increase the reference count of the object (i.e. you wish to pass your current reference to the #GValue because you no longer need it), use g_value_take_object() instead. It is important that your #GValue holds a reference to @v_object (either its own, or one it has taken) to ensure that the object won't be destroyed while the #GValue still exists). a valid #GValue of %G_TYPE_OBJECT derived type object value to be set Opens a file for writing in the preferred directory for temporary files (as returned by g_get_tmp_dir()). @tmpl should be a string in the GLib file name encoding containing a sequence of six 'X' characters, as the parameter to g_mkstemp(). However, unlike these functions, the template should only be a basename, no directory components are allowed. If template is %NULL, a default template is used. Note that in contrast to g_mkstemp() (and mkstemp()) @tmpl is not modified, and might thus be a read-only literal string. The actual name used is returned in @name_used if non-%NULL. This string should be freed with g_free() when not needed any longer. The returned name is in the GLib file name encoding. Template for file name, as in g_mkstemp(), basename only, or %NULL, to a default template location to store actual name used, or %NULL return location for a #GError A file handle (as from open()) to the file opened for reading and writing. The file is opened in binary mode on platforms where there is a difference. The file handle should be closed with close(). In case of errors, -1 is returned and @error will be set. Guesses the name of a Unix mount point. The result is a translated string. a #GUnixMountPoint A newly allocated string that must be freed with g_free() Returns: the contents of @file. a #GMappedFile the contents of @file. Since: 2.8 Completes an asynchronous I/O job. a #GSimpleAsyncResult. Gets the icon for @drive. a #GDrive. #GIcon for the @drive. Compares two #gpointer arguments and returns %TRUE if they are equal. It can be passed to g_hash_table_new() as the @key_equal_func parameter, when using pointers as keys in a #GHashTable. a key. a key to compare with @v1. %TRUE if the two keys match. Frees a unix mount. a #GUnixMount. Return the path to the share\locale or lib\locale subfolder of the GLib installation folder. The path is in the system codepage. We have to use system codepage as bindtextdomain() doesn't have a UTF-8 interface. Queries a file output stream for the given @attributes. This function blocks while querying the stream. For the asynchronous version of this function, see g_file_output_stream_query_info_async(). While the stream is blocked, the stream will set the pending flag internally, and any other operations on the stream will fail with %G_IO_ERROR_PENDING. Can fail if the stream was already closed (with @error being set to %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being set to %G_IO_ERROR_PENDING), or if querying info is not supported for the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In all cases of failure, %NULL will be returned. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will be returned. a #GFileOutputStream. a file attribute query string. optional #GCancellable object, %NULL to ignore. a #GError, %NULL to ignore. a #GFileInfo for the @stream, or %NULL on error. Looks up a key in the #GTree, returning the original key and the associated value and a #gboolean which is %TRUE if the key was found. This is useful if you need to free the memory allocated for the original key, for example before calling g_tree_remove(). a #GTree. the key to look up. returns the original key. returns the value associated with the key. %TRUE if the key was found in the #GTree. Frees one #GSList element. It is usually used after g_slist_remove_link(). a #GSList element A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, guchar arg1, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs ignored 2 a #GValue array holding the instance and the #guchar parameter the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Checks if the content type is the generic "unknown" type. On unix this is the "application/octet-stream" mimetype, while on win32 it is "*". a content type string. %TRUE if the type is the unknown type. Copies the bytes from a string into a #GString, destroying any previous contents. It is rather like the standard strcpy() function, except that you do not have to worry about having enough space to copy the string. the destination #GString. Its current contents are destroyed. the string to copy into @string @string If @dirs_only is %TRUE, @completer will only complete directory names, and not file names. the filename completer. a #gboolean. 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. a #GObject. a #GAsyncReadyCallback. user data passed to @callback. the #GError to report Gets a list of the mounts on the system. The returned list should be freed with g_list_free(), after its elements have been unreffed with g_object_unref(). a #GVolumeMonitor. a #GList of #GMount<!-- -->s Inserts a #GNode beneath the parent at the given position. the #GNode to place @node under the position to place @node at, with respect to its siblings If position is -1, @node is inserted as the last child of @parent the #GNode to insert the inserted #GNode A wrapper for the stdio fopen() function. The fopen() function opens a file and associates a new stream with it. Because file descriptors are specific to the C library on Windows, and a file descriptor is partof the <type>FILE</type> struct, the <type>FILE</type> pointer returned by this function makes sense only to functions in the same C library. Thus if the GLib-using code uses a different C library than GLib does, the <type>FILE</type> pointer returned by this function cannot be passed to C library functions like fprintf() or fread(). See your C library manual for more details about fopen(). a pathname in the GLib file name encoding (UTF-8 on Windows) a string describing the mode in which the file should be opened A <type>FILE</type> pointer if the file was successfully opened, or %NULL if an error occurred Since: 2.6 Checks if a unix mount is a system path. a #GUnixMount. %TRUE if the unix mount is for a system path. Unsafe, need lock fen_lock. Retrieves the position of the capturing parentheses named @name. If @name is a valid sub pattern name but it didn't match anything (e.g. sub pattern "X", matching "b" against "(?P<X>a)?b") then @start_pos and @end_pos are set to -1 and %TRUE is returned. #GMatchInfo structure name of the subexpression pointer to location where to store the start position pointer to location where to store the end position %TRUE if the position was fetched, %FALSE otherwise. If the position cannot be fetched, @start_pos and @end_pos are left unchanged Since: 2.14 Gets the file's content type. a #GFileInfo. a string containing the file's content type.s Breaks the string on the pattern, and returns an array of the tokens. If the pattern contains capturing parentheses, then the text for each of the substrings will also be returned. If the pattern does not match anywhere in the string, then the whole string is returned as the first token. As a special case, the result of splitting the empty string "" is an empty vector, not a vector containing a single string. The reason for this special case is that being able to represent a empty vector is typically more useful than consistent handling of empty elements. If you do need to represent empty elements, you'll need to check for the empty string before calling this function. A pattern that can match empty strings splits @string into separate characters wherever it matches the empty string between characters. For example splitting "ab c" using as a separator "\s*", you will get "a", "b" and "c". a #GRegex structure the string to split with the pattern match time option flags a %NULL-terminated gchar ** array. Free it using g_strfreev() Since: 2.14 Calls the @complete_type_info function from the #GTypePluginClass of @plugin. There should be no need to use this function outside of the GObject type system itself. a #GTypePlugin the #GType whose info is completed the #GTypeInfo struct to fill in the #GTypeValueTable to fill in Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file info to the given time value. a #GFileInfo. a #GTimeVal. Finds the first link in @queue which contains @data. a #GQueue data to find The first link in @queue which contains @data. Since: 2.4 Creates a new #GParamSpecUInt instance specifying a %G_TYPE_UINT property. See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified minimum value for the property specified maximum value for the property specified default value for the property specified flags for the property specified a newly created parameter specification This function outputs @bookmark as a string. a #GBookmarkFile return location for the length of the returned string, or %NULL return location for a #GError, or %NULL a newly allocated string holding the contents of the #GBookmarkFile Since: 2.12 Return value: the #GMainContext of @loop a #GMainLoop. the #GMainContext of @loop Replacement for g_io_channel_seek() with the new API. a #GIOChannel The offset in bytes from the position specified by @type a #GSeekType. The type %G_SEEK_CUR is only allowed in those cases where a call to g_io_channel_set_encoding () is allowed. See the documentation for g_io_channel_set_encoding () for details. A location to return an error of type #GIOChannelError the status of the operation. Gets the last sibling of a #GNode. This could possibly be the node itself. a #GNode the last sibling of @node Gets a #GMount for the #GFile. If the #GFileIface for @file does not have a mount (e.g. possibly a remote share), @error will be set to %G_IO_ERROR_NOT_FOUND and %NULL will be returned. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. optional #GCancellable object, %NULL to ignore. a #GError. a #GMount where the @file is located or %NULL on error. Replaces occurances of the pattern in regex with the output of @eval for that occurance. Setting @start_position differs from just passing over a shortened string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern that begins with any kind of lookbehind assertion, such as "\b". a #GRegex structure from g_regex_new() string to perform matches against the length of @string, or -1 if @string is nul-terminated starting index of the string to match options for the match a function to call for each match user data to pass to the function location to store the error occuring, or %NULL to ignore errors a newly allocated string containing the replacements Since: 2.14 Looks up a key in the #GHashTable, returning the original key and the associated value and a #gboolean which is %TRUE if the key was found. This is useful if you need to free the memory allocated for the original key, for example before calling g_hash_table_remove(). a #GHashTable. the key to look up. returns the original key. returns the value associated with the key. %TRUE if the key was found in the #GHashTable. A variant of g_cclosure_new_swap() which uses @object as @user_data and calls g_object_watch_closure() on @object and the created closure. This function is useful when you have a callback closely associated with a #GObject, and want the callback to no longer run after the object is is freed. the function to invoke a #GObject pointer to pass to @callback_func a new #GCClosure Flushes the write buffer for the GIOChannel. a #GIOChannel location to store an error of type #GIOChannelError the status of the operation: One of #G_IO_CHANNEL_NORMAL, #G_IO_CHANNEL_AGAIN, or #G_IO_CHANNEL_ERROR. Gets the volume for the @mount. a #GMount. a #GVolume or %NULL if @mount is not associated with a volume. Searches the string @haystack for the last occurrence of the string @needle, limiting the length of the search to @haystack_len. a nul-terminated string. the maximum length of @haystack. the nul-terminated string to search for. a pointer to the found occurrence, or %NULL if not found. Gets the size of the available data within the stream. #GBufferedInputStream. size of the available stream. Return value: The data for the @n'th element of @queue, or %NULL if @n is a #GQueue the position of the element. The data for the @n'th element of @queue, or %NULL if @n is off the end of @queue. Since: 2.4 Sets a default choice for the mount operation. a #GMountOperation. an integer. Emits a signal. Note that g_signal_emit_by_name() resets the return value to the default if no handlers are connected, in contrast to g_signal_emitv(). the instance the signal is being emitted on. a string of the form "signal-name::detail". parameters to be passed to the signal, followed by a location for the return value. If the return type of the signal is #G_TYPE_NONE, the return value location can be omitted. Adds a new element on to the end of the list. <note><para> The return value is the new start of the list, which may have changed, so make sure you store the new value. </para></note> <note><para> Note that g_slist_append() has to traverse the entire list to find the end, which is inefficient when adding multiple elements. A common idiom to avoid the inefficiency is to prepend the elements and reverse the list when all elements have been added. </para></note> |[ /* Notice that these are initialized to the empty list. */ GSList *list = NULL, *number_list = NULL; /* This is a list of strings. */ list = g_slist_append (list, "first"); list = g_slist_append (list, "second"); /* This is a list of integers. */ number_list = g_slist_append (number_list, GINT_TO_POINTER (27)); number_list = g_slist_append (number_list, GINT_TO_POINTER (14)); ]| a #GSList the data for the new element the new start of the #GSList Gets properties of an object. In general, a copy is made of the property contents and the caller is responsible for freeing the memory in the appropriate manner for the type, for instance by calling g_free() or g_object_unref(). <example> <title>Using g_object_get(<!-- -->)</title> An example of using g_object_get() to get the contents of three properties - one of type #G_TYPE_INT, one of type #G_TYPE_STRING, and one of type #G_TYPE_OBJECT: <programlisting> gint intval; gchar *strval; GObject *objval; g_object_get (my_object, "int-property", &intval, "str-property", &strval, "obj-property", &objval, NULL); // Do something with intval, strval, objval g_free (strval); g_object_unref (objval); </programlisting> </example> a #GObject name of the first property to get return location for the first property, followed optionally by more name/return location pairs, followed by %NULL Finalizes the asynchronous query started by g_file_output_stream_query_info_async(). a #GFileOutputStream. a #GAsyncResult. a #GError, %NULL to ignore. A #GFileInfo for the finished query. Increases the reference count on a #GMainLoop object by one. a #GMainLoop @loop Changes the URI of a bookmark item from @old_uri to @new_uri. Any existing bookmark for @new_uri will be overwritten. If @new_uri is %NULL, then the bookmark is removed. In the event the URI cannot be found, %FALSE is returned and @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. a #GBookmarkFile a valid URI a valid URI, or %NULL return location for a #GError or %NULL %TRUE if the URI was successfully changed Since: 2.12 A wrapper for the POSIX open() function. The open() function is used to convert a pathname into a file descriptor. On POSIX systems file descriptors are implemented by the operating system. On Windows, it's the C library that implements open() and file descriptors. The actual Win32 API for opening files is quite different, see MSDN documentation for CreateFile(). The Win32 API uses file handles, which are more randomish integers, not small integers like file descriptors. Because file descriptors are specific to the C library on Windows, the file descriptor returned by this function makes sense only to functions in the same C library. Thus if the GLib-using code uses a different C library than GLib does, the file descriptor returned by this function cannot be passed to C library functions like write() or read(). See your C library manual for more details about open(). a pathname in the GLib file name encoding (UTF-8 on Windows) as in open() as in open() a new file descriptor, or -1 if an error occurred. The return value can be used exactly like the return value from open(). Since: 2.6 Retrieves the position of the @match_num<!-- -->'th capturing parentheses. 0 is the full text of the match, 1 is the first paren set, 2 the second, and so on. If @match_num is a valid sub pattern but it didn't match anything (e.g. sub pattern 1, matching "b" against "(a)?b") then @start_pos and @end_pos are set to -1 and %TRUE is returned. If the match was obtained using the DFA algorithm, that is using g_regex_match_all() or g_regex_match_all_full(), the retrieved position is not that of a set of parentheses but that of a matched substring. Substrings are matched in reverse order of length, so 0 is the longest match. #GMatchInfo structure number of the sub expression pointer to location where to store the start position pointer to location where to store the end position %TRUE if the position was fetched, %FALSE otherwise. If the position cannot be fetched, @start_pos and @end_pos are left unchanged Since: 2.14 Reads a signed 32-bit/4-byte value from @stream. In order to get the correct byte order for this read operation, see g_data_stream_get_byte_order() and g_data_stream_set_byte_order(). If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. a given #GDataInputStream. optional #GCancellable object, %NULL to ignore. #GError for error reporting. a signed 32-bit/4-byte value read from the @stream or %0 if an error occurred. Lookup the type ID from a given type name, returning 0 if no type has been registered under this name (this is the preferred method to find out by name whether a specific type has been registered yet). Type name to lookup. Corresponding type ID or 0. Removes the first element of the queue. a #GQueue. the #GList element at the head of the queue, or %NULL if the queue is empty. Removes all list nodes with data equal to @data. Returns: new head of @list a #GList data to remove new head of @list Clears the current value in @value and "unsets" the type, this releases all resources associated with this GValue. An unset value is the same as an uninitialized (zero-filled) #GValue structure. An initialized #GValue structure. Sets the icon for the bookmark for @uri. If @href is %NULL, unsets the currently set icon. If no bookmark for @uri is found it is created. Since: 2.12 a #GBookmarkFile a valid URI the URI of the icon for the bookmark, or %NULL the MIME type of the icon for the bookmark A variant of g_type_class_unref() for use in #GTypeClassCacheFunc implementations. It unreferences a class without consulting the chain of #GTypeClassCacheFunc<!-- -->s, avoiding the recursion which would occur otherwise. The #GTypeClass structure to unreference. Return value: the data that @iter points to a #GSequenceIter the data that @iter points to Since: 2.14 Duplicates a #GFile handle. This operation does not duplicate the actual file or directory represented by the #GFile; see g_file_copy() if attempting to copy a file. This call does no blocking i/o. input #GFile. #GFile that is a duplicate of the given #GFile. Checks if a unix mount is mounted read only. a #GUnixMount. %TRUE if @mount_entry is read only. Creates a new #GMainLoop structure. a #GMainContext (if %NULL, the default context will be used). set to %TRUE to indicate that the loop is running. This is not very important since calling g_main_loop_run() will set this to %TRUE anyway. a new #GMainLoop. Loads a key file into an empty #GKeyFile structure. If the file could not be loaded then %error is set to either a #GFileError or #GKeyFileError. an empty #GKeyFile struct the path of a filename to load, in the GLib filename encoding flags from #GKeyFileFlags return location for a #GError, or %NULL %TRUE if a key file could be loaded, %FALSE otherwise Since: 2.6 Internal function for gtester to retrieve test log messages, no ABI guarantees provided. Gets the height of a #GTree. If the #GTree contains no nodes, the height is 0. If the #GTree contains only one root node the height is 1. If the root node has children the height is 2, etc. a #GTree. the height of the #GTree. Gets a property of an object. In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling g_value_unset(). Note that g_object_get_property() is really intended for language bindings, g_object_get() is much more convenient for C programming. a #GObject the name of the property to get return location for the property value Stops a #GMainLoop from running. Any calls to g_main_loop_run() for the loop will return. Note that sources that have already been dispatched when g_main_loop_quit() is called will still be executed. a #GMainLoop Converts a single character to UTF-8. a Unicode character code output buffer, must have at least 6 bytes of space. If %NULL, the length will be computed and returned and nothing will be written to @outbuf. number of bytes written Internal function to parse a signal name into its @signal_id and @detail quark. a string of the form "signal-name::detail". The interface/instance type that introduced "signal-name". Location to store the signal id. Location to store the detail quark. %TRUE forces creation of a #GQuark for the detail. Whether the signal name could successfully be parsed and @signal_id_p and @detail_p contain valid return values. Returns: %TRUE if g_value_copy() is possible with @src_type and @dest_type. source type to be copied. destination type for copying. %TRUE if g_value_copy() is possible with @src_type and @dest_type. Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value. If @attribute is of a different type, this operation will fail. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. a string containing the attribute's name. a #gint32 containing the attribute's new value. a #GFileQueryInfoFlags. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL %TRUE if the @attribute was successfully set to @value in the @file, %FALSE otherwise. Return value: the default main context. the default main context. Frees all memory allocated by the #GStringChunk. After calling g_string_chunk_free() it is not safe to access any of the strings which were contained within it. a #GStringChunk Gets the current directory. The returned string should be freed when no longer needed. The encoding of the returned string is system defined. On Windows, it is always UTF-8. the current directory. Sets the length of a #GString. If the length is less than the current length, the string will be truncated. If the length is greater than the current length, the contents of the newly added area are undefined. (However, as always, string->str[string->len] will be a nul byte.) a #GString the new length @string Removes @group from the list of groups to which the bookmark for @uri belongs to. In the event the URI cannot be found, %FALSE is returned and @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the event no group was defined, %FALSE is returned and @error is set to #G_BOOKMARK_FILE_ERROR_INVALID_VALUE. a #GBookmarkFile a valid URI the group name to be removed return location for a #GError, or %NULL %TRUE if @group was successfully removed. Since: 2.12 Sets the meta-data of application @name inside the list of applications that have registered a bookmark for @uri inside @bookmark. You should rarely use this function; use g_bookmark_file_add_application() and g_bookmark_file_remove_application() instead. @name can be any UTF-8 encoded string used to identify an application. @exec can have one of these two modifiers: "%f", which will be expanded as the local file name retrieved from the bookmark's URI; "%u", which will be expanded as the bookmark's URI. The expansion is done automatically when retrieving the stored command line using the g_bookmark_file_get_app_info() function. @count is the number of times the application has registered the bookmark; if is < 0, the current registration count will be increased by one, if is 0, the application with @name will be removed from the list of registered applications. @stamp is the Unix time of the last registration; if it is -1, the current time will be used. If you try to remove an application by setting its registration count to zero, and no bookmark for @uri is found, %FALSE is returned and @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND; similarly, in the event that no application @name has registered a bookmark for @uri, %FALSE is returned and error is set to #G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED. Otherwise, if no bookmark for @uri is found, one is created. a #GBookmarkFile a valid URI an application's name an application's command line the number of registrations done for this application the time of the last registration for this application return location for a #GError or %NULL %TRUE if the application's meta-data was successfully changed. Since: 2.12 Splits @string into a number of tokens not containing any of the characters in @delimiter. A token is the (possibly empty) longest string that does not contain any of the characters in @delimiters. If @max_tokens is reached, the remainder is appended to the last token. For example the result of g_strsplit_set ("abc:def/ghi", ":/", -1) is a %NULL-terminated vector containing the three strings "abc", "def", and "ghi". The result if g_strsplit_set (":def/ghi:", ":/", -1) is a %NULL-terminated vector containing the four strings "", "def", "ghi", and "". As a special case, the result of splitting the empty string "" is an empty vector, not a vector containing a single string. The reason for this special case is that being able to represent a empty vector is typically more useful than consistent handling of empty elements. If you do need to represent empty elements, you'll need to check for the empty string before calling g_strsplit_set(). Note that this function works on bytes not characters, so it can't be used to delimit UTF-8 strings for anything but ASCII characters. The string to be tokenized A nul-terminated string containing bytes that are used to split the string. The maximum number of tokens to split @string into. If this is less than 1, the string is split completely a newly-allocated %NULL-terminated array of strings. Use g_strfreev() to free it. Since: 2.4 Creates a new closure which invokes @callback_func with @user_data as the first parameter. the function to invoke user data to pass to @callback_func destroy notify to be called when @user_data is no longer used a new #GCClosure This function looks for a key file named @file in the paths specified in @search_dirs, loads the file into @key_file and Return value: %TRUE if a key file could be loaded, %FALSE otherwise an empty #GKeyFile struct a relative path to a filename to open and parse %NULL-terminated array of directories to search return location for a string containing the full path of the file, or %NULL flags from #GKeyFileFlags return location for a #GError, or %NULL %TRUE if a key file could be loaded, %FALSE otherwise Since: 2.14 Reads a line from the data input stream. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. a given #GDataInputStream. a #gsize to get the length of the data read in. optional #GCancellable object, %NULL to ignore. #GError for error reporting. a string with the line that was read in (including the newlines). Set @length to a #gsize to get the length of the read line. Returns %NULL on an error. A wrapper for the POSIX creat() function. The creat() function is used to convert a pathname into a file descriptor, creating a file if necessary. On POSIX systems file descriptors are implemented by the operating system. On Windows, it's the C library that implements creat() and file descriptors. The actual Windows API for opening files is different, see MSDN documentation for CreateFile(). The Win32 API uses file handles, which are more randomish integers, not small integers like file descriptors. Because file descriptors are specific to the C library on Windows, the file descriptor returned by this function makes sense only to functions in the same C library. Thus if the GLib-using code uses a different C library than GLib does, the file descriptor returned by this function cannot be passed to C library functions like write() or read(). See your C library manual for more details about creat(). a pathname in the GLib file name encoding (UTF-8 on Windows) as in creat() a new file descriptor, or -1 if an error occurred. The return value can be used exactly like the return value from creat(). Since: 2.8 Check the result of the last g_test_trap_fork() call. %TRUE if the last forked child terminated successfully. Since: 2.16 Convert a sequence of bytes encoded as UTF-8 to a Unicode character. This function checks for incomplete characters, for invalid characters such as characters that are out of the range of Unicode, and for overlong encodings of valid characters. a pointer to Unicode character encoded as UTF-8 the maximum number of bytes to read, or -1, for no maximum or if @p is nul-terminated the resulting character. If @p points to a partial sequence at the end of a string that could begin a valid character (or if @max_len is zero), returns (gunichar)-2; otherwise, if @p does not point to a valid UTF-8 encoded Unicode character, returns (gunichar)-1. Gets the priority with which @extension was registered. a #GIOExtension the priority of @extension Get the contents of a %G_TYPE_OBJECT derived #GValue. a valid #GValue of %G_TYPE_OBJECT derived type object contents of @value Return value: Whether @iter is the end iterator. a #GSequenceIter Whether @iter is the end iterator. Since: 2.14 Gets the last component of the filename. If @file_name ends with a directory separator it gets the component before the last slash. If @file_name consists only of directory separators (and on Windows, possibly a drive letter), a single separator is returned. If @file_name is empty, it gets ".". the name of the file. a newly allocated string containing the last component of the filename. Appends a formatted string onto the end of a #GString. This function is similar to g_string_append_printf() except that the arguments to the format string are passed as a va_list. Since: 2.14 a #GString the string format. See the printf() documentation the list of arguments to insert in the output Adds @nestedsuite to @suite. Since: 2.16 a #GTestSuite another #GTestSuite Checks to see if a #GFile has a given URI scheme. This call does no blocking i/o. input #GFile. a string containing a URI scheme. %TRUE if #GFile's backend supports the given URI scheme, %FALSE if URI scheme is %NULL, not supported, or #GFile is invalid. Pops data from the @queue. If no data is received before @end_time, %NULL is returned. To easily calculate @end_time a combination of g_get_current_time() and g_time_val_add() can be used. a #GAsyncQueue. a #GTimeVal, determining the final time. data from the queue or %NULL, when no data is received before @end_time. Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink. See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN. a #GFileInfo. a #gboolean. Returns: the #GTypePlugin for the dynamic interface @interface_type the #GType value of an instantiatable type. the #GType value of an interface type. the #GTypePlugin for the dynamic interface @interface_type of @instance_type. Return value: The #GSequenceIter at position @pos a #GSequence a position in @seq, or -1 for the end. The #GSequenceIter at position @pos Since: 2.14 This function gets back user data pointers stored via g_object_set_qdata() and removes the @data from object without invoking it's destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example: |[ void object_add_to_user_list (GObject *object, const gchar *new_string) { // the quark, naming the object data GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); // retrive the old string list GList *list = g_object_steal_qdata (object, quark_string_list); // prepend new string list = g_list_prepend (list, g_strdup (new_string)); // this changed 'list', so we need to set it again g_object_set_qdata_full (object, quark_string_list, list, free_string_list); } static void free_string_list (gpointer data) { GList *node, *list = data; for (node = list; node; node = node->next) g_free (node->data); g_list_free (list); } ]| Using g_object_get_qdata() in the above example, instead of g_object_steal_qdata() would have left the destroy function set, and thus the partial string list would have been freed upon g_object_set_qdata_full(). The GObject to get a stored user data pointer from A #GQuark, naming the user data pointer The user data pointer set, or %NULL Creates a new instance of a #GObject subtype and sets its properties. Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY) which are not explicitly specified are set to their default values. the type id of the #GObject subtype to instantiate the name of the first property the value of the first property, followed optionally by more name/value pairs, followed by %NULL a new instance of @object_type Convert a string from UTF-16 to UTF-8. The result will be terminated with a 0 byte. Note that the input is expected to be already in native endianness, an initial byte-order-mark character is not handled specially. g_convert() can be used to convert a byte buffer of UTF-16 data of ambiguous endianess. a UTF-16 encoded string the maximum length (number of <type>gunichar2</type>) of @str to use. If @len < 0, then the string is terminated with a 0 character. location to store number of words read, or %NULL. If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will be returned in case @str contains a trailing partial character. If an error occurs then the index of the invalid input is stored here. location to store number of bytes written, or %NULL. The value stored here does not include the trailing 0 byte. location to store the error occuring, or %NULL to ignore errors. Any of the errors in #GConvertError other than %G_CONVERT_ERROR_NO_CONVERSION may occur. a pointer to a newly allocated UTF-8 string. This value must be freed with g_free(). If an error occurs, %NULL will be returned and @error set. Sets whether to ignore unknown options or not. If an argument is ignored, it is left in the @argv array after parsing. By default, g_option_context_parse() treats unknown options as error. This setting does not affect non-option arguments (i.e. arguments which don't start with a dash). But note that GOption cannot reliably determine whether a non-option belongs to a preceding unknown option. Since: 2.6 a #GOptionContext %TRUE to ignore unknown options, %FALSE to produce an error when unknown options are met Registers a value transformation function for use in g_value_transform(). A previously registered transformation function for @src_type and @dest_type will be replaced. Source type. Target type. a function which transforms values of type @src_type into value of type @dest_type Increases the reference count of @object. a #GObject the same @object Copies a #GChecksum. If @checksum has been closed, by calling g_checksum_get_string() or g_checksum_get_digest(), the copied checksum will be closed as well. the #GChecksum to copy the copy of the passed #GChecksum. Use g_checksum_free() when finished using it. Since: 2.16 Collects the attributes of the element from the data passed to the #GMarkupParser start_element function, dealing with common error conditions and supporting boolean values. This utility function is not required to write a parser but can save a lot of typing. The @element_name, @attribute_names, @attribute_values and @error parameters passed to the start_element callback should be passed unmodified to this function. Following these arguments is a list of "supported" attributes to collect. It is an error to specify multiple attributes with the same name. If any attribute not in the list appears in the @attribute_names array then an unknown attribute error will result. The #GMarkupCollectType field allows specifying the type of collection to perform and if a given attribute must appear or is optional. The attribute name is simply the name of the attribute to collect. The pointer should be of the appropriate type (see the descriptions under #GMarkupCollectType) and may be %NULL in case a particular attribute is to be allowed but ignored. This function deals with issuing errors for missing attributes (of type %G_MARKUP_ERROR_MISSING_ATTRIBUTE), unknown attributes (of type %G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE) and duplicate attributes (of type %G_MARKUP_ERROR_INVALID_CONTENT) as well as parse errors for boolean-valued attributes (again of type %G_MARKUP_ERROR_INVALID_CONTENT). In all of these cases %FALSE will be returned and @error will be set as appropriate. the current tag name the attribute names the attribute values a pointer to a #GError or %NULL the #GMarkupCollectType of the first attribute the name of the first attribute a pointer to the storage location of the first attribute (or %NULL), followed by more types names and pointers, ending with %G_MARKUP_COLLECT_INVALID. %TRUE if successful Since: 2.16 This returns the string that #GIOChannel uses to determine where in the file a line break occurs. A value of %NULL indicates autodetection. a #GIOChannel a location to return the length of the line terminator The line termination string. This value is owned by GLib and must not be freed. Unreferences @matcher. If the reference count falls below 1, the @matcher is automatically freed. a #GFileAttributeMatcher. A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, gboolean arg1, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs ignored 2 a #GValue array holding the instance and the #gboolean parameter the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Emits the #GFileMonitor::changed signal if a change has taken place. Should be called from file monitor implementations only. The signal will be emitted from an idle handler. a #GFileMonitor. a #GFile. a #GFile. a set of #GFileMonitorEvent flags. A marshaller for a #GCClosure with a callback of type <literal>void (*callback) (gpointer instance, gpointer user_data)</literal>. the #GClosure to which the marshaller belongs ignored 1 a #GValue array holding only the instance the invocation hint given as the last argument to g_closure_invoke() additional data specified when registering the marshaller Gets the name of the file without any leading directory components. It returns a pointer into the given file name string. the name of the file. the name of the file without any leading directory components. Deprecated:2.2: Use g_path_get_basename() instead, but notice that g_path_get_basename() allocates new memory for the returned string, unlike this function which returns a pointer into the argument. Set the contents of a %G_TYPE_BOXED derived #GValue to @v_boxed. The boxed value is assumed to be static, and is thus not duplicated when setting the #GValue. a valid #GValue of %G_TYPE_BOXED derived type static boxed value to be set Gets the name of @mount. a #GMount. the name for the given @mount. The returned string should be freed when no longer needed. Sets the @attribute to contain the given @attr_value, if possible. a #GFileInfo. a file attribute key. a boolean value. Sets the name attribute for the current #GFileInfo. See %G_FILE_ATTRIBUTE_STANDARD_NAME. a #GFileInfo. a string containing a name. Returns: a #GFileOutputStream or %NULL on error. input #GFile. an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore. %TRUE if a backup should be created. a set of #GFileCreateFlags. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL a #GFileOutputStream or %NULL on error. Tries to pop data from the @queue. If no data is available, %NULL is returned. This function must be called while holding the @queue's lock. a #GAsyncQueue. data from the queue or %NULL, when no data is available immediately. Gets the default application for launching applications using this URI scheme for a particular GDesktopAppInfoLookup implementation. The GDesktopAppInfoLookup interface and this function is used to implement g_app_info_get_default_for_uri_scheme() backends in a GIO module. There is no reason for applications to use it directly. Applications should use g_app_info_get_default_for_uri_scheme(). a #GDesktopAppInfoLookup a string containing a URI scheme. #GAppInfo for given @uri_scheme or %NULL on error. Get the contents of a %G_TYPE_BOXED derived #GValue. Upon getting, the boxed value is duplicated and needs to be later freed with g_boxed_free(), e.g. like: g_boxed_free (G_VALUE_TYPE (@value), return_value); a valid #GValue of %G_TYPE_BOXED derived type boxed contents of @value Reverses the order of the children of a #GNode. (It doesn't change the order of the grandchildren.) a #GNode. Removes the specified group, @group_name, from the key file. a #GKeyFile a group name return location for a #GError or %NULL %TRUE if the group was removed, %FALSE otherwise Since: 2.6 Creates a new #GError with the given @domain and @code, and a message formatted with @format. error domain error code printf()-style format for error message parameters for message format a new #GError Closes the stream, releasing resources related to it. Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED. Closing a stream multiple times will not return an error. Streams will be automatically closed when the last reference is dropped, but you might want to call this function to make sure resources are released as early as possible. Some streams might keep the backing store of the stream (e.g. a file descriptor) open after the stream is closed. See the documentation for the individual stream for details. On failure the first error that happened will be reported, but the close operation will finish as much as possible. A stream that failed to close will still return %G_IO_ERROR_CLOSED for all operations. Still, it is important to check and report the error to the user. If @cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. Cancelling a close will still leave the stream closed, but some streams can use a faster close that doesn't block to e.g. check errors. A #GInputStream. optional #GCancellable object, %NULL to ignore. location to store the error occuring, or %NULL to ignore %TRUE on success, %FALSE on failure Checks if two icons are equal. pointer to the first #GIcon. pointer to the second #GIcon. %TRUE if @icon1 is equal to @icon2. %FALSE otherwise. Increases reference count of @regex by 1. a #GRegex @regex Since: 2.14 Tells the current position within the stream. a #GSeekable. the offset from the beginning of the buffer. Moves the data pointed to a new position as indicated by @cmp_func. This function should be called for items in a sequence already sorted according to @cmp_func whenever some aspect of an item changes so that @cmp_func may return different values for that item. Since: 2.14 A #GSequenceIter the #GCompareDataFunc used to compare items in the sequence. It is called with two items of the @seq and @user_data. It should return 0 if the items are equal, a negative value if the first item comes before the second, and a positive value if the second item comes before the first. user data passed to @cmp_func. Converts all lower case ASCII letters to upper case ASCII letters. a GString passed-in @string pointer, with all the lower case characters converted to upper case in place, with semantics that exactly match g_ascii_toupper(). Gets the last element in a #GSList. <note><para> This function iterates over the whole list. </para></note> a #GSList the last element in the #GSList, or %NULL if the #GSList has no elements Return value: the maximal number of threads a #GThreadPool the maximal number of threads Gets the kinds of <link linkend="volume-identifier">identifiers</link> that @volume has. Use g_volume_get_identifer() to obtain the identifiers themselves. a #GVolume a %NULL-terminated array of strings containing kinds of identifiers. Use g_strfreev() to free. Check the result of the last g_test_trap_fork() call. %TRUE if the last forked child got killed due to a fork timeout. Since: 2.16 Lists the properties of an interface.Generally, the interface vtable passed in as @g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek(). Since: 2.4 any interface vtable for the interface, or the default vtable for the interface location to store number of properties returned. a pointer to an array of pointers to #GParamSpec structures. The paramspecs are owned by GLib, but the array should be freed with g_free() when you are done with it. Asynchronously sets the display name for a given #GFile. For more details, see g_set_display_name() which is the synchronous version of this call. When the operation is finished, @callback will be called. You can then call g_file_set_display_name_finish() to get the result of the operation. input #GFile. a string. the <link linkend="io-priority">I/O priority</link> of the request. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied the data to pass to callback function Sets a function to be called at regular intervals, with the given priority. The function is called repeatedly until it returns %FALSE, at which point the timeout is automatically destroyed and the function will not be called again. The @notify function is called when the timeout is destroyed. The first call to the function will be at the end of the first @interval. Note that timeout functions may be delayed, due to the processing of other event sources. Thus they should not be relied on for precise timing. After each call to the timeout function, the time of the next timeout is recalculated based on the current time and the given interval (it does not try to 'catch up' time lost in delays). the priority of the timeout source. Typically this will be in the range between #G_PRIORITY_DEFAULT and #G_PRIORITY_HIGH. the time between calls to the function, in milliseconds (1/1000ths of a second) function to call data to pass to @function function to call when the timeout is removed, or %NULL the ID (greater than 0) of the event source. Initiates startup notification for the applicaiont and returns the DESKTOP_STARTUP_ID for the launched operation, if supported. Startup notification IDs are defined in the FreeDesktop.Org Startup Notifications standard, at <ulink url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt"/>. a #GAppLaunchContext. a #GAppInfo. a #GList of files. a startup notification ID for the application, or %NULL if not supported. Determines if a given character typically takes zero width when rendered. The return value is %TRUE for all non-spacing and enclosing marks (e.g., combining accents), format characters, zero-width space, but not U+00AD SOFT HYPHEN. A typical use of this function is with one of g_unichar_iswide() or g_unichar_iswide_cjk() to determine the number of cells a string occupies when displayed on a grid display (terminals). However, note that not all terminals support zero-width rendering of zero-width marks. a Unicode character %TRUE if the character has zero width Since: 2.14 Sets a function to be called at regular intervals, with the default priority, #G_PRIORITY_DEFAULT. The function is called repeatedly until it returns %FALSE, at which point the timeout is automatically destroyed and the function will not be called again. The first call to the function will be at the end of the first @interval. Note that timeout functions may be delayed, due to the processing of other event sources. Thus they should not be relied on for precise timing. After each call to the timeout function, the time of the next timeout is recalculated based on the current time and the given interval (it does not try to 'catch up' time lost in delays). If you want to have a timer in the "seconds" range and do not care about the exact time of the first call of the timer, use the g_timeout_add_seconds() function; this function allows for more optimizations and more efficient system power usage. the time between calls to the function, in milliseconds (1/1000ths of a second) function to call data to pass to @function the ID (greater than 0) of the event source. Gets the position of the given element in the #GList (starting from 0). a #GList an element in the #GList the position of the element in the #GList, or -1 if the element is not found Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value. If @attribute is of a different type, this operation will fail. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. a string containing the attribute's name. a string containing the attribute's value. #GFileQueryInfoFlags. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL %TRUE if the @attribute was successfully set, %FALSE otherwise. Finishes an asynchronous file read operation started with g_file_read_async(). input #GFile. a #GAsyncResult. a #GError, or %NULL a #GFileInputStream or %NULL on error. Starts an asynchronous load of the @file's contents. For more details, see g_file_load_contents() which is the synchronous version of this call. When the load operation has completed, @callback will be called with @user data. To finish the operation, call g_file_load_contents_finish() with the #GAsyncResult returned by the @callback. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. optional #GCancellable object, %NULL to ignore. a #GAsyncReadyCallback to call when the request is satisfied the data to pass to callback function Inserts a new key and value into a #GTree similar to g_tree_insert(). The difference is that if the key already exists in the #GTree, it gets replaced by the new key. If you supplied a @value_destroy_func when creating the #GTree, the old value is freed using that function. If you supplied a @key_destroy_func when creating the #GTree, the old key is freed using that function. The tree is automatically 'balanced' as new key/value pairs are added, so that the distance from the root to every leaf is as small as possible. a #GTree. the key to insert. the value corresponding to the key. Tries to write @count bytes from @buffer into the stream. Will block during the operation. This function is similar to g_output_stream_write(), except it tries to write as many bytes as requested, only stopping on an error. 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 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. a #GOutputStream. the buffer containing the data to write. the number of bytes to write location to store the number of bytes that was written to the stream optional #GCancellable object, %NULL to ignore. location to store the error occuring, or %NULL to ignore %TRUE on success, %FALSE if there was an error Finds the first child of a #GNode with the given data. a #GNode which types of children are to be searched, one of %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES the data to find the found child #GNode, or %NULL if the data is not found Removes an invalidation notifier. Notice that notifiers are automatically removed after they are run. a #GClosure data which was passed to g_closure_add_invalidate_notifier() when registering @notify_func the callback function to remove Obtains a file monitor for the given file. If no file notification mechanism exists, then regular polling of the file is used. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. a set of #GFileMonitorFlags. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL. a #GFileMonitor for the given @file. Gets the entity tag for the file when it has been written. This must be called after the stream has been written and closed, as the etag can change while writing. a #GFileOutputStream. the entity tag for the stream. Tries to move the file or directory @source to the location specified by @destination. If native move operations are supported then this is used, otherwise a copy + delete fallback is used. The native implementation may support moving directories (for instance on moves inside the same filesystem), but the fallback code does not. If the flag #G_FILE_COPY_OVERWRITE is specified an already existing @destination file is overwritten. If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks will be copied as symlinks, otherwise the target of the @source symlink will be copied. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If @progress_callback is not %NULL, then the operation can be monitored by setting this to a #GFileProgressCallback function. @progress_callback_data will be passed to this function. It is guaranteed that this callback will be called after all data has been transferred with the total number of bytes copied during the operation. If the @source file does not exist then the G_IO_ERROR_NOT_FOUND error is returned, independent on the status of the @destination. If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then the error G_IO_ERROR_EXISTS is returned. If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY error is returned. If trying to overwrite a directory with a directory the G_IO_ERROR_WOULD_MERGE error is returned. If the source is a directory and the target does not exist, or #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the G_IO_ERROR_WOULD_RECURSE error may be returned (if the native move operation isn't available). #GFile pointing to the source location. #GFile pointing to the destination location. set of #GFileCopyFlags. optional #GCancellable object, %NULL to ignore. #GFileProgressCallback function for updates. gpointer to user data for the callback function. #GError for returning error conditions, or %NULL %TRUE on successful move, %FALSE otherwise. Creates a new buffered output stream for a base stream. a #GOutputStream. a #GOutputStream for the given @base_stream. Overrides the class closure (i.e. the default handler) for the given signal for emissions on instances of @instance_type. @instance_type must be derived from the type to which the signal belongs. the signal id the instance type on which to override the class closure for the signal. the closure. Adds the second #GSList onto the end of the first #GSList. Note that the elements of the second #GSList are not copied. They are used directly. a #GSList the #GSList to add to the end of the first #GSList the start of the new #GSList Checks if a unix mount point is read only. a #GUnixMountPoint. %TRUE if a mount point is read only. Converts a string to a #guint64 value. This function behaves like the standard strtoull() function does in the C locale. It does this without actually changing the current locale, since that would not be thread-safe. This function is typically used when reading configuration files or other non-user input that should be locale independent. To handle input from the user you should normally use the locale-sensitive system strtoull() function. If the correct value would cause overflow, %G_MAXUINT64 is returned, and %ERANGE is stored in %errno. If the base is outside the valid range, zero is returned, and %EINVAL is stored in %errno. If the string conversion fails, zero is returned, and @endptr returns @nptr (if @endptr is non-%NULL). the string to convert to a numeric value. if non-%NULL, it returns the character after the last character used in the conversion. to be used for the conversion, 2..36 or 0 the #guint64 value or zero on error. Since: 2.2 Adds the dynamic @interface_type to @instantiable_type. The information contained in the #GTypePlugin structure pointed to by @plugin is used to manage the relationship. the #GType value of an instantiable type. the #GType value of an interface type. the #GTypePlugin structure to retrieve the #GInterfaceInfo from. Creates a new timeout source. The source will not initially be associated with any #GMainContext and must be added to one with g_source_attach() before it will be executed. the timeout interval in milliseconds. the newly-created timeout source Gets the poll function set by g_main_context_set_poll_func(). a #GMainContext the poll function Converts a character to uppercase. a Unicode character the result of converting @c to uppercase. If @c is not an lowercase or titlecase character, or has no upper case equivalent @c is returned unchanged. Creates a new #GParamSpec instance. A property name consists of segments consisting of ASCII letters and digits, separated by either the '-' or '_' character. The first character of a property name must be a letter. Names which violate these rules lead to undefined behaviour. When creating and looking up a #GParamSpec, either separator can be used, but they cannot be mixed. Using '-' is considerably more efficient and in fact required when using property names as detail strings for signals. Beyond the name, #GParamSpec<!-- -->s have two more descriptive strings associated with them, the @nick, which should be suitable for use as a label for the property in a property editor, and the @blurb, which should be a somewhat longer description, suitable for e.g. a tooltip. The @nick and @blurb should ideally be localized. the #GType for the property; must be derived from #G_TYPE_PARAM the canonical name of the property the nickname of the property a short description of the property a combination of #GParamFlags a newly allocated #GParamSpec instance This sets the string that #GIOChannel uses to determine where in the file a line break occurs. a #GIOChannel The line termination string. Use %NULL for autodetect. Autodetection breaks on "\n", "\r\n", "\r", "\0", and the Unicode paragraph separator. Autodetection should not be used for anything other than file-based channels. The length of the termination string. If -1 is passed, the string is assumed to be nul-terminated. This option allows termination strings with embedded nuls. filename of the file to create. new local #GFile. Checks if the VFS is active. a #GVfs. %TRUE if construction of the @vfs was successful and it is now active. Free the boxed structure @boxed which is of type @boxed_type. The type of @boxed. The boxed structure to be freed. Return value: the begin iterator for @seq. a #GSequence the begin iterator for @seq. Since: 2.14 Registers @type_name as the name of a new dynamic type derived from @parent_type. The type system uses the information contained in the #GTypePlugin structure pointed to by @plugin to manage the type and its instances (if not abstract). The value of @flags determines the nature (e.g. abstract or not) of the type. Type from which this type will be derived. 0-terminated string used as the name of the new type. The #GTypePlugin structure to retrieve the #GTypeInfo from. Bitwise combination of #GTypeFlags values. The new type identifier or #G_TYPE_INVALID if registration failed. Creates a directory and any parent directories that may not exist similar to 'mkdir -p'. If the file system does not support creating directories, this function will fail, setting @error to %G_IO_ERROR_NOT_SUPPORTED. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL %TRUE if all directories have been successfully created, %FALSE otherwise. Since: 2.18 Sets the function which is used to translate the contexts user-visible strings, for <option>--help</option> output. If @func is %NULL, strings are not translated. Note that option groups have their own translation functions, this function only affects the @parameter_string (see g_option_context_new()), the summary (see g_option_context_set_summary()) and the description (see g_option_context_set_description()). If you are using gettext(), you only need to set the translation domain, see g_context_group_set_translation_domain(). Since: 2.12 a #GOptionContext the #GTranslateFunc, or %NULL user data to pass to @func, or %NULL a function which gets called to free @data, or %NULL This function returns a #GIOCondition depending on whether there is data to be read/space to write data in the internal buffers in the #GIOChannel. Only the flags %G_IO_IN and %G_IO_OUT may be set. A #GIOChannel A #GIOCondition Finishes an asynchronous replace of the given @file. See g_file_replace_contents_async(). Sets @new_etag to the new entity tag for the document, if present. input #GFile. a #GAsyncResult. 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. a #GError, or %NULL %TRUE on success, %FALSE on failure. Return value: a #GSequenceIter which is @delta positions away from @iter. a #GSequenceIter A positive or negative number indicating how many positions away from @iter the returned #GSequenceIter will be. a #GSequenceIter which is @delta positions away from @iter. Since: 2.14 Obtains the character set for the <link linkend="setlocale">current locale</link>; you might use this character set as an argument to g_convert(), to convert from the current locale's encoding to some other encoding. (Frequently g_locale_to_utf8() and g_locale_from_utf8() are nice shortcuts, though.) On Windows the character set returned by this function is the so-called system default ANSI code-page. That is the character set used by the "narrow" versions of C library and Win32 functions that handle file names. It might be different from the character set used by the C library's current locale. The return value is %TRUE if the locale's encoding is UTF-8, in that case you can perhaps avoid calling g_convert(). The string returned in @charset is not allocated, and should not be freed. return location for character set name %TRUE if the returned charset is UTF-8 Obtains a directory monitor for the given file. This may fail if directory monitoring is not supported. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. input #GFile. a set of #GFileMonitorFlags. optional #GCancellable object, %NULL to ignore. a #GError, or %NULL. a #GFileMonitor for the given @file, or %NULL on error. Returns: %TRUE if the queue is empty. a #GQueue. %TRUE if the queue is empty. This function enqueus a callback @destroy_func() to be executed during the next test case teardown phase. This is most useful to auto destruct allocted test resources at the end of a test run. Resources are released in reverse queue order, that means enqueueing callback A before callback B will cause B() to be called before A() during teardown. Since: 2.16 Destroy callback for teardown phase. Destroy callback data. Returns: the number of bytes written to the stream a #GMemoryOutputStream the number of bytes written to the stream Since: 2.18 Retrieves the number of the subexpression named @name. #GRegex structure name of the subexpression The number of the subexpression or -1 if @name does not exists Since: 2.14 A simple version of g_spawn_sync() with little-used parameters removed, taking a command line instead of an argument vector. See g_spawn_sync() for full details. @command_line will be parsed by g_shell_parse_argv(). Unlike g_spawn_sync(), the %G_SPAWN_SEARCH_PATH flag is enabled. Note that %G_SPAWN_SEARCH_PATH can have security implications, so consider using g_spawn_sync() directly if appropriate. Possible errors are those from g_spawn_sync() and those from g_shell_parse_argv(). If @exit_status is non-%NULL, the exit status of the child is stored there as it would be returned by waitpid(); standard UNIX macros such as WIFEXITED() and WEXITSTATUS() must be used to evaluate the exit status. On Windows, please note the implications of g_shell_parse_argv() parsing @command_line. Parsing is done according to Unix shell rules, not Windows command interpreter rules. Space is a separator, and backslashes are special. Thus you cannot simply pass a @command_line containing canonical Windows paths, like "c:\\program files\\app\\app.exe", as the backslashes will be eaten, and the space will act as a separator. You need to enclose such paths with single quotes, like "'c:\\program files\\app\\app.exe' 'e:\\folder\\argument.txt'". a command line return location for child output return location for child errors return location for child exit status, as returned by waitpid() return location for errors %TRUE on success, %FALSE if an error was set Sets the source functions (can be used to override default implementations) of an unattached source. Since: 2.12 a #GSource the new #GSourceFuncs Replacement for g_io_channel_write() with the new API. On seekable channels with encodings other than %NULL or UTF-8, generic mixing of reading and writing is not allowed. A call to g_io_channel_write_chars () may only be made on a channel from which data has been read in the cases described in the documentation for g_io_channel_set_encoding (). a #GIOChannel a buffer to write data from the size of the buffer. If -1, the buffer is taken to be a nul-terminated string. The number of bytes written. This can be nonzero even if the return value is not %G_IO_STATUS_NORMAL. If the return value is %G_IO_STATUS_NORMAL and the channel is blocking, this will always be equal to @count if @count >= 0. a location to return an error of type #GConvertError or #GIOChannelError the status of the operation. Get the name of a #GParamSpec. a valid #GParamSpec the name of @pspec. Creates a new #GTree. the function used to order the nodes in the #GTree. It should return values similar to the standard strcmp() function - 0 if the two arguments are equal, a negative value if the first argument comes before the second, or a positive value if the first argument comes after the second. a new #GTree. Creates a new #GParamSpecBoxed instance specifying a %G_TYPE_OBJECT derived property. See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified %G_TYPE_OBJECT derived type of this property flags for the property specified a newly created parameter specification Runs all tests under the toplevel suite which can be retrieved with g_test_get_root(). Similar to g_test_run_suite(), the test cases to be run are filtered according to test path arguments (-p <replaceable>testpath</replaceable>) as parsed by g_test_init(). g_test_run_suite() or g_test_run() may only be called once in a program. 0 on success Since: 2.16 Returns: the length of the contents of @file. a #GMappedFile the length of the contents of @file. Since: 2.8 Creates a new #GParamSpecString instance. See g_param_spec_internal() for details on property names. canonical name of the property specified nick name for the property specified description of the property specified default value for the property specified flags for the property specified a newly created parameter specification Get a reproducible random floating pointer number out of a specified range, see g_test_rand_int() for details on test case random numbers. the minimum value returned by this function the minimum value not returned by this function a number with @range_start <= number < @range_end. Since: 2.16 Reads a Unicode character from @channel. This function cannot be called on a channel with %NULL encoding. a #GIOChannel a location to return a character a location to return an error of type #GConvertError or #GIOChannelError a #GIOStatus Converts @time_ into an ISO 8601 encoded string, relative to the Coordinated Universal Time (UTC). a #GTimeVal a newly allocated string containing an ISO 8601 date Since: 2.12 Using the standard algorithm for regular expression matching only the longest match in the string is retrieved. This function uses a different algorithm so it can retrieve all the possible matches. For more documentation see g_regex_match_all_full(). A #GMatchInfo structure, used to get information on the match, is stored in @match_info if not %NULL. Note that if @match_info is not %NULL then it is created even if the function returns %FALSE, i.e. you must free it regardless if regular expression actually matched. a #GRegex structure from g_regex_new() the string to scan for matches match options pointer to location where to store the #GMatchInfo, or %NULL if you do not need it %TRUE is the string matched, %FALSE otherwise Since: 2.14 Blocks all handlers on an instance that match a certain selection criteria. The criteria mask is passed as an OR-ed combination of #GSignalMatchType flags, and the criteria values are passed as arguments. Passing at least one of the %G_SIGNAL_MATCH_CLOSURE, %G_SIGNAL_MATCH_FUNC or %G_SIGNAL_MATCH_DATA match flags is required for successful matches. If no handlers were found, 0 is returned, the number of blocked handlers otherwise. The instance to block handlers from. Mask indicating which of @signal_id, @detail, @closure, @func and/or @data the handlers have to match. Signal the handlers have to be connected to. Signal detail the handlers have to be connected to. The closure the handlers will invoke. The C closure callback of the handlers (useless for non-C closures). The closure data of the handlers' closures. The number of handlers that matched. Determines if @type is a subset of @supertype. a content type string. a string. %TRUE if @type is a kind of @supertype, %FALSE otherwise.