diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2018-08-20 21:12:06 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2018-08-20 21:12:06 -0400 |
commit | 63e87c2d0c9d263f14c77b68f85c67d46ece82a9 (patch) | |
tree | 6260365cbf7d24f37d27669e8538227fcb72e243 /gtk+-mingw/share/gtk-doc/html/glib/glib-Miscellaneous-Utility-Functions.html | |
parent | a4460f6d9453bbd7e584937686449cef3e19f052 (diff) |
Diffstat (limited to 'gtk+-mingw/share/gtk-doc/html/glib/glib-Miscellaneous-Utility-Functions.html')
-rw-r--r-- | gtk+-mingw/share/gtk-doc/html/glib/glib-Miscellaneous-Utility-Functions.html | 1896 |
1 files changed, 0 insertions, 1896 deletions
diff --git a/gtk+-mingw/share/gtk-doc/html/glib/glib-Miscellaneous-Utility-Functions.html b/gtk+-mingw/share/gtk-doc/html/glib/glib-Miscellaneous-Utility-Functions.html deleted file mode 100644 index a3bb478..0000000 --- a/gtk+-mingw/share/gtk-doc/html/glib/glib-Miscellaneous-Utility-Functions.html +++ /dev/null @@ -1,1896 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<title>Miscellaneous Utility Functions</title> -<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> -<link rel="home" href="index.html" title="GLib Reference Manual"> -<link rel="up" href="glib-utilities.html" title="GLib Utilities"> -<link rel="prev" href="glib-Hook-Functions.html" title="Hook Functions"> -<link rel="next" href="glib-Lexical-Scanner.html" title="Lexical Scanner"> -<meta name="generator" content="GTK-Doc V1.18 (XML mode)"> -<link rel="stylesheet" href="style.css" type="text/css"> -</head> -<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> -<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"> -<tr valign="middle"> -<td><a accesskey="p" href="glib-Hook-Functions.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td> -<td><a accesskey="u" href="glib-utilities.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td> -<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td> -<th width="100%" align="center">GLib Reference Manual</th> -<td><a accesskey="n" href="glib-Lexical-Scanner.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td> -</tr> -<tr><td colspan="5" class="shortcuts"> -<a href="#glib-Miscellaneous-Utility-Functions.synopsis" class="shortcut">Top</a> - | - <a href="#glib-Miscellaneous-Utility-Functions.description" class="shortcut">Description</a> -</td></tr> -</table> -<div class="refentry"> -<a name="glib-Miscellaneous-Utility-Functions"></a><div class="titlepage"></div> -<div class="refnamediv"><table width="100%"><tr> -<td valign="top"> -<h2><span class="refentrytitle"><a name="glib-Miscellaneous-Utility-Functions.top_of_page"></a>Miscellaneous Utility Functions</span></h2> -<p>Miscellaneous Utility Functions — a selection of portable utility functions</p> -</td> -<td valign="top" align="right"></td> -</tr></table></div> -<div class="refsynopsisdiv"> -<a name="glib-Miscellaneous-Utility-Functions.synopsis"></a><h2>Synopsis</h2> -<pre class="synopsis"> -#include <glib.h> - -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-application-name" title="g_get_application_name ()">g_get_application_name</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<span class="returnvalue">void</span> <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-set-application-name" title="g_set_application_name ()">g_set_application_name</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *application_name</code></em>); -<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-prgname" title="g_get_prgname ()">g_get_prgname</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<span class="returnvalue">void</span> <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-set-prgname" title="g_set_prgname ()">g_set_prgname</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *prgname</code></em>); -<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> ** <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-environ" title="g_get_environ ()">g_get_environ</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-environ-getenv" title="g_environ_getenv ()">g_environ_getenv</a> (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **envp</code></em>, - <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *variable</code></em>); -<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> ** <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-environ-setenv" title="g_environ_setenv ()">g_environ_setenv</a> (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **envp</code></em>, - <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *variable</code></em>, - <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *value</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="type">gboolean</span></a> overwrite</code></em>); -<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> ** <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-environ-unsetenv" title="g_environ_unsetenv ()">g_environ_unsetenv</a> (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **envp</code></em>, - <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *variable</code></em>); -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-getenv" title="g_getenv ()">g_getenv</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *variable</code></em>); -<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-setenv" title="g_setenv ()">g_setenv</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *variable</code></em>, - <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *value</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="type">gboolean</span></a> overwrite</code></em>); -<span class="returnvalue">void</span> <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-unsetenv" title="g_unsetenv ()">g_unsetenv</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *variable</code></em>); -<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> ** <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-listenv" title="g_listenv ()">g_listenv</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-user-name" title="g_get_user_name ()">g_get_user_name</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-real-name" title="g_get_real_name ()">g_get_real_name</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-user-cache-dir" title="g_get_user_cache_dir ()">g_get_user_cache_dir</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-user-data-dir" title="g_get_user_data_dir ()">g_get_user_data_dir</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-user-config-dir" title="g_get_user_config_dir ()">g_get_user_config_dir</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-user-runtime-dir" title="g_get_user_runtime_dir ()">g_get_user_runtime_dir</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -enum <a class="link" href="glib-Miscellaneous-Utility-Functions.html#GUserDirectory" title="enum GUserDirectory">GUserDirectory</a>; -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-user-special-dir" title="g_get_user_special_dir ()">g_get_user_special_dir</a> (<em class="parameter"><code><a class="link" href="glib-Miscellaneous-Utility-Functions.html#GUserDirectory" title="enum GUserDirectory"><span class="type">GUserDirectory</span></a> directory</code></em>); -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * const * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-system-data-dirs" title="g_get_system_data_dirs ()">g_get_system_data_dirs</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * const * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-system-config-dirs" title="g_get_system_config_dirs ()">g_get_system_config_dirs</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<span class="returnvalue">void</span> <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-reload-user-special-dirs-cache" title="g_reload_user_special_dirs_cache ()">g_reload_user_special_dirs_cache</a> (<em class="parameter"><code><span class="type">void</span></code></em>); - -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-host-name" title="g_get_host_name ()">g_get_host_name</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-home-dir" title="g_get_home_dir ()">g_get_home_dir</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-tmp-dir" title="g_get_tmp_dir ()">g_get_tmp_dir</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-current-dir" title="g_get_current_dir ()">g_get_current_dir</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-basename" title="g_basename ()">g_basename</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *file_name</code></em>); -#define <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-dirname" title="g_dirname">g_dirname</a> -<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-path-is-absolute" title="g_path_is_absolute ()">g_path_is_absolute</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *file_name</code></em>); -const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-path-skip-root" title="g_path_skip_root ()">g_path_skip_root</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *file_name</code></em>); -<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-path-get-basename" title="g_path_get_basename ()">g_path_get_basename</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *file_name</code></em>); -<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-path-get-dirname" title="g_path_get_dirname ()">g_path_get_dirname</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *file_name</code></em>); -<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-build-filename" title="g_build_filename ()">g_build_filename</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *first_element</code></em>, - <em class="parameter"><code>...</code></em>); -<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-build-filenamev" title="g_build_filenamev ()">g_build_filenamev</a> (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **args</code></em>); -<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-build-path" title="g_build_path ()">g_build_path</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *separator</code></em>, - <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *first_element</code></em>, - <em class="parameter"><code>...</code></em>); -<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-build-pathv" title="g_build_pathv ()">g_build_pathv</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *separator</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **args</code></em>); - -<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-format-size" title="g_format_size ()">g_format_size</a> (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint64" title="guint64"><span class="type">guint64</span></a> size</code></em>); -enum <a class="link" href="glib-Miscellaneous-Utility-Functions.html#GFormatSizeFlags" title="enum GFormatSizeFlags">GFormatSizeFlags</a>; -<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-format-size-full" title="g_format_size_full ()">g_format_size_full</a> (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint64" title="guint64"><span class="type">guint64</span></a> size</code></em>, - <em class="parameter"><code><a class="link" href="glib-Miscellaneous-Utility-Functions.html#GFormatSizeFlags" title="enum GFormatSizeFlags"><span class="type">GFormatSizeFlags</span></a> flags</code></em>); -<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-format-size-for-display" title="g_format_size_for_display ()">g_format_size_for_display</a> (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#goffset" title="goffset"><span class="type">goffset</span></a> size</code></em>); - -<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-find-program-in-path" title="g_find_program_in_path ()">g_find_program_in_path</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *program</code></em>); - -<a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-bit-nth-lsf" title="g_bit_nth_lsf ()">g_bit_nth_lsf</a> (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="type">gulong</span></a> mask</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> nth_bit</code></em>); -<a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-bit-nth-msf" title="g_bit_nth_msf ()">g_bit_nth_msf</a> (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="type">gulong</span></a> mask</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> nth_bit</code></em>); -<a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="returnvalue">guint</span></a> <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-bit-storage" title="g_bit_storage ()">g_bit_storage</a> (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="type">gulong</span></a> number</code></em>); - -<a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="returnvalue">guint</span></a> <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-spaced-primes-closest" title="g_spaced_primes_closest ()">g_spaced_primes_closest</a> (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> num</code></em>); - -<span class="returnvalue">void</span> <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-atexit" title="g_atexit ()">g_atexit</a> (<em class="parameter"><code><a class="link" href="glib-Miscellaneous-Utility-Functions.html#GVoidFunc" title="GVoidFunc ()"><span class="type">GVoidFunc</span></a> func</code></em>); - -<a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="returnvalue">guint</span></a> <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-parse-debug-string" title="g_parse_debug_string ()">g_parse_debug_string</a> (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>, - <em class="parameter"><code>const <a class="link" href="glib-Miscellaneous-Utility-Functions.html#GDebugKey" title="struct GDebugKey"><span class="type">GDebugKey</span></a> *keys</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> nkeys</code></em>); -struct <a class="link" href="glib-Miscellaneous-Utility-Functions.html#GDebugKey" title="struct GDebugKey">GDebugKey</a>; - -<span class="returnvalue">void</span> (<a class="link" href="glib-Miscellaneous-Utility-Functions.html#GVoidFunc" title="GVoidFunc ()">*GVoidFunc</a>) (<em class="parameter"><code><span class="type">void</span></code></em>); -<span class="returnvalue">void</span> (<a class="link" href="glib-Miscellaneous-Utility-Functions.html#GFreeFunc" title="GFreeFunc ()">*GFreeFunc</a>) (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>); - -<span class="returnvalue">void</span> <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-qsort-with-data" title="g_qsort_with_data ()">g_qsort_with_data</a> (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> pbase</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> total_elems</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="type">gsize</span></a> size</code></em>, - <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()"><span class="type">GCompareDataFunc</span></a> compare_func</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> user_data</code></em>); - -<span class="returnvalue">void</span> <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-nullify-pointer" title="g_nullify_pointer ()">g_nullify_pointer</a> (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> *nullify_location</code></em>); -</pre> -</div> -<div class="refsect1"> -<a name="glib-Miscellaneous-Utility-Functions.description"></a><h2>Description</h2> -<p> -These are portable utility functions. -</p> -</div> -<div class="refsect1"> -<a name="glib-Miscellaneous-Utility-Functions.details"></a><h2>Details</h2> -<div class="refsect2"> -<a name="g-get-application-name"></a><h3>g_get_application_name ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_get_application_name (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Gets a human-readable name for the application, as set by -<a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-set-application-name" title="g_set_application_name ()"><code class="function">g_set_application_name()</code></a>. This name should be localized if -possible, and is intended for display to the user. Contrast with -<a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-prgname" title="g_get_prgname ()"><code class="function">g_get_prgname()</code></a>, which gets a non-localized name. If -<a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-set-application-name" title="g_set_application_name ()"><code class="function">g_set_application_name()</code></a> has not been called, returns the result of -<a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-prgname" title="g_get_prgname ()"><code class="function">g_get_prgname()</code></a> (which may be <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-set-prgname" title="g_set_prgname ()"><code class="function">g_set_prgname()</code></a> has also not -been called). -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>human-readable application name. may return <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> -</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-set-application-name"></a><h3>g_set_application_name ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> g_set_application_name (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *application_name</code></em>);</pre> -<p> -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 <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-set-prgname" title="g_set_prgname ()"><code class="function">g_set_prgname()</code></a>, which sets a non-localized name. -<a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-set-prgname" title="g_set_prgname ()"><code class="function">g_set_prgname()</code></a> will be called automatically by <a href="http://developer.gnome.org/devel/gtk/gtk3-General.html#gtk-init"><code class="function">gtk_init()</code></a>, -but <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-set-application-name" title="g_set_application_name ()"><code class="function">g_set_application_name()</code></a> will not. -</p> -<p> -Note that for thread safety reasons, this function can only -be called once. -</p> -<p> -The application name will be used in contexts such as error messages, -or when displaying an application's name in the task list. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>application_name</code></em> :</span></p></td> -<td>localized name of the application</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-get-prgname"></a><h3>g_get_prgname ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_get_prgname (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Gets the name of the program. This name should <span class="emphasis"><em>not</em></span> -be localized, contrast with <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-application-name" title="g_get_application_name ()"><code class="function">g_get_application_name()</code></a>. -(If you are using GDK or GTK+ the program name is set in <a href="http://developer.gnome.org/devel/gdk/gdk3-General.html#gdk-init"><code class="function">gdk_init()</code></a>, -which is called by <a href="http://developer.gnome.org/devel/gtk/gtk3-General.html#gtk-init"><code class="function">gtk_init()</code></a>. The program name is found by taking -the last component of <code class="literal">argv[0]</code>.) -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the name of the program. The returned string belongs -to GLib and must not be modified or freed.</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-set-prgname"></a><h3>g_set_prgname ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> g_set_prgname (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *prgname</code></em>);</pre> -<p> -Sets the name of the program. This name should <span class="emphasis"><em>not</em></span> -be localized, contrast with <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-set-application-name" title="g_set_application_name ()"><code class="function">g_set_application_name()</code></a>. Note that for -thread-safety reasons this function can only be called once. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>prgname</code></em> :</span></p></td> -<td>the name of the program.</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-get-environ"></a><h3>g_get_environ ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> ** g_get_environ (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Gets the list of environment variables for the current process. -</p> -<p> -The list is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> terminated and each item in the list is of the -form 'NAME=VALUE'. -</p> -<p> -This is equivalent to direct access to the 'environ' global variable, -except portable. -</p> -<p> -The return value is freshly allocated and it should be freed with -<a class="link" href="glib-String-Utility-Functions.html#g-strfreev" title="g_strfreev ()"><code class="function">g_strfreev()</code></a> when it is no longer needed. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the list of -environment variables. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span> -</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.28</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-environ-getenv"></a><h3>g_environ_getenv ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_environ_getenv (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **envp</code></em>, - <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *variable</code></em>);</pre> -<p> -Returns the value of the environment variable <em class="parameter"><code>variable</code></em> in the -provided list <em class="parameter"><code>envp</code></em>. -</p> -<p> -The name and value are in the GLib file name encoding. -On UNIX, this means the actual bytes which might or might not -be in some consistent character set and encoding. On Windows, -it is in UTF-8. On Windows, in case the environment variable's -value contains references to other environment variables, they -are expanded. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>envp</code></em> :</span></p></td> -<td>an environment -list (eg, as returned from <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-environ" title="g_get_environ ()"><code class="function">g_get_environ()</code></a>), or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> -for an empty environment list. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>variable</code></em> :</span></p></td> -<td>the environment variable to get, in the GLib file name -encoding</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the value of the environment variable, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if -the environment variable is not set in <em class="parameter"><code>envp</code></em>. The returned -string is owned by <em class="parameter"><code>envp</code></em>, and will be freed if <em class="parameter"><code>variable</code></em> is -set or unset again.</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.32</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-environ-setenv"></a><h3>g_environ_setenv ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> ** g_environ_setenv (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **envp</code></em>, - <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *variable</code></em>, - <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *value</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="type">gboolean</span></a> overwrite</code></em>);</pre> -<p> -Sets the environment variable <em class="parameter"><code>variable</code></em> in the provided list -<em class="parameter"><code>envp</code></em> to <em class="parameter"><code>value</code></em>. -</p> -<p> -Both the variable's name and value should be in the GLib -file name encoding. On UNIX, this means that they can be -arbitrary byte strings. On Windows, they should be in UTF-8. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>envp</code></em> :</span></p></td> -<td>an environment -list that can be freed using <a class="link" href="glib-String-Utility-Functions.html#g-strfreev" title="g_strfreev ()"><code class="function">g_strfreev()</code></a> (e.g., as returned from <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-environ" title="g_get_environ ()"><code class="function">g_get_environ()</code></a>), or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> -for an empty environment list. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>variable</code></em> :</span></p></td> -<td>the environment variable to set, must not contain '='</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td> -<td>the value for to set the variable to</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>overwrite</code></em> :</span></p></td> -<td>whether to change the variable if it already exists</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the -updated environment list. Free it using <a class="link" href="glib-String-Utility-Functions.html#g-strfreev" title="g_strfreev ()"><code class="function">g_strfreev()</code></a>. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span> -</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.32</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-environ-unsetenv"></a><h3>g_environ_unsetenv ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> ** g_environ_unsetenv (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **envp</code></em>, - <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *variable</code></em>);</pre> -<p> -Removes the environment variable <em class="parameter"><code>variable</code></em> from the provided -environment <em class="parameter"><code>envp</code></em>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>envp</code></em> :</span></p></td> -<td>an environment -list that can be freed using <a class="link" href="glib-String-Utility-Functions.html#g-strfreev" title="g_strfreev ()"><code class="function">g_strfreev()</code></a> (e.g., as returned from <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-environ" title="g_get_environ ()"><code class="function">g_get_environ()</code></a>), -or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> for an empty environment list. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>variable</code></em> :</span></p></td> -<td>the environment variable to remove, must not contain '='</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the -updated environment list. Free it using <a class="link" href="glib-String-Utility-Functions.html#g-strfreev" title="g_strfreev ()"><code class="function">g_strfreev()</code></a>. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span> -</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.32</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-getenv"></a><h3>g_getenv ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_getenv (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *variable</code></em>);</pre> -<p> -Returns the value of an environment variable. -</p> -<p> -The name and value are in the GLib file name encoding. On UNIX, -this means the actual bytes which might or might not be in some -consistent character set and encoding. On Windows, it is in UTF-8. -On Windows, in case the environment variable's value contains -references to other environment variables, they are expanded. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>variable</code></em> :</span></p></td> -<td>the environment variable to get, in the GLib file name -encoding</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the value of the environment variable, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if -the environment variable is not found. The returned string -may be overwritten by the next call to <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-getenv" title="g_getenv ()"><code class="function">g_getenv()</code></a>, <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-setenv" title="g_setenv ()"><code class="function">g_setenv()</code></a> -or <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-unsetenv" title="g_unsetenv ()"><code class="function">g_unsetenv()</code></a>.</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-setenv"></a><h3>g_setenv ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_setenv (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *variable</code></em>, - <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *value</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="type">gboolean</span></a> overwrite</code></em>);</pre> -<p> -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 arbitrary byte strings. On Windows, they should be in -UTF-8. -</p> -<p> -Note that on some systems, when variables are overwritten, the memory -used for the previous variables and its value isn't reclaimed. -</p> -<p> -</p> -<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> -<h3 class="title">Warning</h3> -<p> -Environment variable handling in UNIX is not thread-safe, and your -program may crash if one thread calls <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-setenv" title="g_setenv ()"><code class="function">g_setenv()</code></a> while another -thread is calling <code class="function">getenv()</code>. (And note that many functions, such as -<code class="function">gettext()</code>, call <code class="function">getenv()</code> internally.) This function is only safe to -use at the very start of your program, before creating any other -threads (or creating objects that create worker threads of their -own). -</p> -<p> -If you need to set up the environment for a child process, you can -use <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-environ" title="g_get_environ ()"><code class="function">g_get_environ()</code></a> to get an environment array, modify that with -<a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-environ-setenv" title="g_environ_setenv ()"><code class="function">g_environ_setenv()</code></a> and <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-environ-unsetenv" title="g_environ_unsetenv ()"><code class="function">g_environ_unsetenv()</code></a>, and then pass that -array directly to <code class="function">execvpe()</code>, <a class="link" href="glib-Spawning-Processes.html#g-spawn-async" title="g_spawn_async ()"><code class="function">g_spawn_async()</code></a>, or the like. -</p> -</div> -<p> -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>variable</code></em> :</span></p></td> -<td>the environment variable to set, must not contain '='.</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td> -<td>the value for to set the variable to.</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>overwrite</code></em> :</span></p></td> -<td>whether to change the variable if it already exists.</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> if the environment variable couldn't be set.</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.4</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-unsetenv"></a><h3>g_unsetenv ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> g_unsetenv (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *variable</code></em>);</pre> -<p> -Removes an environment variable from the environment. -</p> -<p> -Note that on some systems, when variables are overwritten, the -memory used for the previous variables and its value isn't reclaimed. -</p> -<p> -</p> -<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> -<h3 class="title">Warning</h3> -<p> -Environment variable handling in UNIX is not thread-safe, and your -program may crash if one thread calls <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-unsetenv" title="g_unsetenv ()"><code class="function">g_unsetenv()</code></a> while another -thread is calling <code class="function">getenv()</code>. (And note that many functions, such as -<code class="function">gettext()</code>, call <code class="function">getenv()</code> internally.) This function is only safe -to use at the very start of your program, before creating any other -threads (or creating objects that create worker threads of their -own). -</p> -<p> -If you need to set up the environment for a child process, you can -use <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-environ" title="g_get_environ ()"><code class="function">g_get_environ()</code></a> to get an environment array, modify that with -<a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-environ-setenv" title="g_environ_setenv ()"><code class="function">g_environ_setenv()</code></a> and <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-environ-unsetenv" title="g_environ_unsetenv ()"><code class="function">g_environ_unsetenv()</code></a>, and then pass that -array directly to <code class="function">execvpe()</code>, <a class="link" href="glib-Spawning-Processes.html#g-spawn-async" title="g_spawn_async ()"><code class="function">g_spawn_async()</code></a>, or the like. -</p> -</div> -<p> -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>variable</code></em> :</span></p></td> -<td>the environment variable to remove, must not contain '='</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.4</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-listenv"></a><h3>g_listenv ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> ** g_listenv (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Gets the names of all variables set in the environment. -</p> -<p> -Programs that want to be portable to Windows should typically use -this function and <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-getenv" title="g_getenv ()"><code class="function">g_getenv()</code></a> 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 <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-getenv" title="g_getenv ()"><code class="function">g_getenv()</code></a> provide. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated -list of strings which must be freed with <a class="link" href="glib-String-Utility-Functions.html#g-strfreev" title="g_strfreev ()"><code class="function">g_strfreev()</code></a>. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span> -</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.8</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-get-user-name"></a><h3>g_get_user_name ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_get_user_name (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -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. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the user name of the current user.</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-get-real-name"></a><h3>g_get_real_name ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_get_real_name (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Gets the real name of the user. This usually comes from the user's entry -in the <code class="filename">passwd</code> 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. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the user's real name.</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-get-user-cache-dir"></a><h3>g_get_user_cache_dir ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_get_user_cache_dir (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Returns a base directory in which to store non-essential, cached -data specific to particular user. -</p> -<p> -On UNIX platforms this is determined using the mechanisms described in -the <a class="ulink" href="http://www.freedesktop.org/Standards/basedir-spec" target="_top"> -XDG Base Directory Specification</a>. -In this case the directory retrieved will be XDG_CACHE_HOME. -</p> -<p> -On Windows is the directory that serves as a common repository for -temporary Internet files. A typical path is -C:\Documents and Settings\username\Local Settings\Temporary Internet Files. -See documentation for CSIDL_INTERNET_CACHE. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a string owned by GLib that must not be modified -or freed.</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.6</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-get-user-data-dir"></a><h3>g_get_user_data_dir ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_get_user_data_dir (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Returns a base directory in which to access application data such -as icons that is customized for a particular user. -</p> -<p> -On UNIX platforms this is determined using the mechanisms described in -the <a class="ulink" href="http://www.freedesktop.org/Standards/basedir-spec" target="_top"> -XDG Base Directory Specification</a>. -In this case the directory retrieved will be XDG_DATA_HOME. -</p> -<p> -On Windows this is the folder to use for local (as opposed to -roaming) application data. See documentation for -CSIDL_LOCAL_APPDATA. Note that on Windows it thus is the same as -what <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-user-config-dir" title="g_get_user_config_dir ()"><code class="function">g_get_user_config_dir()</code></a> returns. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a string owned by GLib that must not be modified -or freed.</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.6</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-get-user-config-dir"></a><h3>g_get_user_config_dir ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_get_user_config_dir (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Returns a base directory in which to store user-specific application -configuration information such as user preferences and settings. -</p> -<p> -On UNIX platforms this is determined using the mechanisms described in -the <a class="ulink" href="http://www.freedesktop.org/Standards/basedir-spec" target="_top"> -XDG Base Directory Specification</a>. -In this case the directory retrieved will be XDG_CONFIG_HOME. -</p> -<p> -On Windows this is the folder to use for local (as opposed to -roaming) application data. See documentation for -CSIDL_LOCAL_APPDATA. Note that on Windows it thus is the same as -what <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-user-data-dir" title="g_get_user_data_dir ()"><code class="function">g_get_user_data_dir()</code></a> returns. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a string owned by GLib that must not be modified -or freed.</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.6</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-get-user-runtime-dir"></a><h3>g_get_user_runtime_dir ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_get_user_runtime_dir (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Returns a directory that is unique to the current user on the local -system. -</p> -<p> -On UNIX platforms this is determined using the mechanisms described in -the <a class="ulink" href="http://www.freedesktop.org/Standards/basedir-spec" target="_top"> -XDG Base Directory Specification</a>. This is the directory -specified in the <code class="envar">XDG_RUNTIME_DIR</code> environment variable. -In the case that this variable is not set, GLib will issue a warning -message to stderr and return the value of <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-user-cache-dir" title="g_get_user_cache_dir ()"><code class="function">g_get_user_cache_dir()</code></a>. -</p> -<p> -On Windows this is the folder to use for local (as opposed to -roaming) application data. See documentation for -CSIDL_LOCAL_APPDATA. Note that on Windows it thus is the same as -what <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-user-config-dir" title="g_get_user_config_dir ()"><code class="function">g_get_user_config_dir()</code></a> returns. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a string owned by GLib that must not be modified or freed.</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.28</p> -</div> -<hr> -<div class="refsect2"> -<a name="GUserDirectory"></a><h3>enum GUserDirectory</h3> -<pre class="programlisting">typedef enum { - G_USER_DIRECTORY_DESKTOP, - G_USER_DIRECTORY_DOCUMENTS, - G_USER_DIRECTORY_DOWNLOAD, - G_USER_DIRECTORY_MUSIC, - G_USER_DIRECTORY_PICTURES, - G_USER_DIRECTORY_PUBLIC_SHARE, - G_USER_DIRECTORY_TEMPLATES, - G_USER_DIRECTORY_VIDEOS, - - G_USER_N_DIRECTORIES -} GUserDirectory; -</pre> -<p> -These are logical ids for special directories which are defined -depending on the platform used. You should use <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-user-special-dir" title="g_get_user_special_dir ()"><code class="function">g_get_user_special_dir()</code></a> -to retrieve the full path associated to the logical id. -</p> -<p> -The <a class="link" href="glib-Miscellaneous-Utility-Functions.html#GUserDirectory" title="enum GUserDirectory"><span class="type">GUserDirectory</span></a> enumeration can be extended at later date. Not -every platform has a directory for every logical id in this -enumeration. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><a name="G-USER-DIRECTORY-DESKTOP:CAPS"></a><span class="term"><code class="literal">G_USER_DIRECTORY_DESKTOP</code></span></p></td> -<td>the user's Desktop directory -</td> -</tr> -<tr> -<td><p><a name="G-USER-DIRECTORY-DOCUMENTS:CAPS"></a><span class="term"><code class="literal">G_USER_DIRECTORY_DOCUMENTS</code></span></p></td> -<td>the user's Documents directory -</td> -</tr> -<tr> -<td><p><a name="G-USER-DIRECTORY-DOWNLOAD:CAPS"></a><span class="term"><code class="literal">G_USER_DIRECTORY_DOWNLOAD</code></span></p></td> -<td>the user's Downloads directory -</td> -</tr> -<tr> -<td><p><a name="G-USER-DIRECTORY-MUSIC:CAPS"></a><span class="term"><code class="literal">G_USER_DIRECTORY_MUSIC</code></span></p></td> -<td>the user's Music directory -</td> -</tr> -<tr> -<td><p><a name="G-USER-DIRECTORY-PICTURES:CAPS"></a><span class="term"><code class="literal">G_USER_DIRECTORY_PICTURES</code></span></p></td> -<td>the user's Pictures directory -</td> -</tr> -<tr> -<td><p><a name="G-USER-DIRECTORY-PUBLIC-SHARE:CAPS"></a><span class="term"><code class="literal">G_USER_DIRECTORY_PUBLIC_SHARE</code></span></p></td> -<td>the user's shared directory -</td> -</tr> -<tr> -<td><p><a name="G-USER-DIRECTORY-TEMPLATES:CAPS"></a><span class="term"><code class="literal">G_USER_DIRECTORY_TEMPLATES</code></span></p></td> -<td>the user's Templates directory -</td> -</tr> -<tr> -<td><p><a name="G-USER-DIRECTORY-VIDEOS:CAPS"></a><span class="term"><code class="literal">G_USER_DIRECTORY_VIDEOS</code></span></p></td> -<td>the user's Movies directory -</td> -</tr> -<tr> -<td><p><a name="G-USER-N-DIRECTORIES:CAPS"></a><span class="term"><code class="literal">G_USER_N_DIRECTORIES</code></span></p></td> -<td>the number of enum values -</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.14</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-get-user-special-dir"></a><h3>g_get_user_special_dir ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_get_user_special_dir (<em class="parameter"><code><a class="link" href="glib-Miscellaneous-Utility-Functions.html#GUserDirectory" title="enum GUserDirectory"><span class="type">GUserDirectory</span></a> directory</code></em>);</pre> -<p> -Returns the full path of a special directory using its logical id. -</p> -<p> -On Unix this is done using the XDG special user directories. -For compatibility with existing practise, <a class="link" href="glib-Miscellaneous-Utility-Functions.html#G-USER-DIRECTORY-DESKTOP:CAPS"><code class="literal">G_USER_DIRECTORY_DESKTOP</code></a> -falls back to <code class="filename">$HOME/Desktop</code> when XDG special -user directories have not been set up. -</p> -<p> -Depending on the platform, the user might be able to change the path -of the special directory without requiring the session to restart; GLib -will not reflect any change once the special directories are loaded. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>directory</code></em> :</span></p></td> -<td>the logical id of special directory</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the path to the specified special directory, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> -if the logical id was not found. The returned string is owned by -GLib and should not be modified or freed.</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.14</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-get-system-data-dirs"></a><h3>g_get_system_data_dirs ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * const * g_get_system_data_dirs (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Returns an ordered list of base directories in which to access -system-wide application data. -</p> -<p> -On UNIX platforms this is determined using the mechanisms described in -the <a class="ulink" href="http://www.freedesktop.org/Standards/basedir-spec" target="_top"> -XDG Base Directory Specification</a> -In this case the list of directories retrieved will be XDG_DATA_DIRS. -</p> -<p> -On Windows the first elements in the list are the Application Data -and Documents folders for All Users. (These can be determined only -on Windows 2000 or later and are not present in the list on other -Windows versions.) See documentation for CSIDL_COMMON_APPDATA and -CSIDL_COMMON_DOCUMENTS. -</p> -<p> -Then follows the "share" subfolder in the installation folder for -the package containing the DLL that calls this function, if it can -be determined. -</p> -<p> -Finally the list contains the "share" subfolder in the installation -folder for GLib, and in the installation folder for the package the -application's .exe file belongs to. -</p> -<p> -The installation folders above are determined by looking up the -folder where the module (DLL or EXE) in question is located. If the -folder's name is "bin", its parent is used, otherwise the folder -itself. -</p> -<p> -Note that on Windows the returned list can vary depending on where -this function is called. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings owned by GLib that must -not be modified or freed. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span> -</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.6</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-get-system-config-dirs"></a><h3>g_get_system_config_dirs ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * const * g_get_system_config_dirs (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Returns an ordered list of base directories in which to access -system-wide configuration information. -</p> -<p> -On UNIX platforms this is determined using the mechanisms described in -the <a class="ulink" href="http://www.freedesktop.org/Standards/basedir-spec" target="_top"> -XDG Base Directory Specification</a>. -In this case the list of directories retrieved will be XDG_CONFIG_DIRS. -</p> -<p> -On Windows is the directory that contains application data for all users. -A typical path is C:\Documents and Settings\All Users\Application Data. -This folder is used for application data that is not user specific. -For example, an application can store a spell-check dictionary, a database -of clip art, or a log file in the CSIDL_COMMON_APPDATA folder. -This information will not roam and is available to anyone using the computer. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings owned by GLib that must -not be modified or freed. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span> -</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.6</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-reload-user-special-dirs-cache"></a><h3>g_reload_user_special_dirs_cache ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> g_reload_user_special_dirs_cache (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Resets the cache used for <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-user-special-dir" title="g_get_user_special_dir ()"><code class="function">g_get_user_special_dir()</code></a>, so -that the latest on-disk version is used. Call this only -if you just changed the data on disk yourself. -</p> -<p> -Due to threadsafety issues this may cause leaking of strings -that were previously returned from <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-user-special-dir" title="g_get_user_special_dir ()"><code class="function">g_get_user_special_dir()</code></a> -that can't be freed. We ensure to only leak the data for -the directories that actually changed value though. -</p> -<p class="since">Since 2.22</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-get-host-name"></a><h3>g_get_host_name ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_get_host_name (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Return a name for the machine. -</p> -<p> -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. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the host name of the machine.</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.8</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-get-home-dir"></a><h3>g_get_home_dir ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_get_home_dir (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Gets the current user's home directory as defined in the -password database. -</p> -<p> -Note that in contrast to traditional UNIX tools, this function -prefers <code class="filename">passwd</code> entries over the <code class="envar">HOME</code> -environment variable. -</p> -<p> -One of the reasons for this decision is that applications in many -cases need special handling to deal with the case where -<code class="envar">HOME</code> is -</p> -<table border="0" summary="Simple list" class="simplelist"> -<tr><td>Not owned by the user</td></tr> -<tr><td>Not writeable</td></tr> -<tr><td>Not even readable</td></tr> -</table> -<p> -Since applications are in general <span class="emphasis"><em>not</em></span> written -to deal with these situations it was considered better to make -<a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-home-dir" title="g_get_home_dir ()"><code class="function">g_get_home_dir()</code></a> not pay attention to <code class="envar">HOME</code> and to -return the real home directory for the user. If applications -want to pay attention to <code class="envar">HOME</code>, they can do: -</p> -<div class="informalexample"><pre class="programlisting"> - const char *homedir = g_getenv ("HOME"); - if (!homedir) - homedir = g_get_home_dir (); -</pre></div> -<p> -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the current user's home directory</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-get-tmp-dir"></a><h3>g_get_tmp_dir ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_get_tmp_dir (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Gets the directory to use for temporary files. This is found from -inspecting the environment variables <code class="envar">TMPDIR</code>, -<code class="envar">TMP</code>, and <code class="envar">TEMP</code> 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 <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> or the empty string. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the directory to use for temporary files.</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-get-current-dir"></a><h3>g_get_current_dir ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_get_current_dir (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Gets the current directory. -</p> -<p> -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. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the current directory</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-basename"></a><h3>g_basename ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_basename (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *file_name</code></em>);</pre> -<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> -<h3 class="title">Warning</h3> -<p><code class="literal">g_basename</code> has been deprecated since version 2.2 and should not be used in newly-written code. Use <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-path-get-basename" title="g_path_get_basename ()"><code class="function">g_path_get_basename()</code></a> instead, but notice - that <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-path-get-basename" title="g_path_get_basename ()"><code class="function">g_path_get_basename()</code></a> allocates new memory for the - returned string, unlike this function which returns a pointer - into the argument.</p> -</div> -<p> -Gets the name of the file without any leading directory -components. It returns a pointer into the given file name -string. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>file_name</code></em> :</span></p></td> -<td>the name of the file</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the name of the file without any leading -directory components</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-dirname"></a><h3>g_dirname</h3> -<pre class="programlisting">#define g_dirname</pre> -<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> -<h3 class="title">Warning</h3> -<p><code class="literal">g_dirname</code> is deprecated and should not be used in newly-written code. use <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-path-get-dirname" title="g_path_get_dirname ()"><code class="function">g_path_get_dirname()</code></a> instead</p> -</div> -<p> -Gets the directory components of a file name. -</p> -<p> -If the file name has no directory components "." is returned. -The returned string should be freed when no longer needed. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>file_name</code></em> :</span></p></td> -<td>the name of the file</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the directory components of the file</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-path-is-absolute"></a><h3>g_path_is_absolute ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> g_path_is_absolute (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *file_name</code></em>);</pre> -<p> -Returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the given <em class="parameter"><code>file_name</code></em> is an absolute file name. -Note that this is a somewhat vague concept on Windows. -</p> -<p> -On POSIX systems, an absolute file name is well-defined. It always -starts from the single root directory. For example "/usr/local". -</p> -<p> -On Windows, the concepts of current drive and drive-specific -current directory introduce vagueness. This function interprets as -an absolute file name one that either begins with a directory -separator such as "\Users\tml" or begins with the root on a drive, -for example "C:\Windows". The first case also includes UNC paths -such as "\\myserver\docs\foo". In all cases, either slashes or -backslashes are accepted. -</p> -<p> -Note that a file name relative to the current drive root does not -truly specify a file uniquely over time and across processes, as -the current drive is a per-process value and can be changed. -</p> -<p> -File names relative the current directory on some specific drive, -such as "D:foo/bar", are not interpreted as absolute by this -function, but they obviously are not relative to the normal current -directory as returned by <code class="function">getcwd()</code> or <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-get-current-dir" title="g_get_current_dir ()"><code class="function">g_get_current_dir()</code></a> -either. Such paths should be avoided, or need to be handled using -Windows-specific code. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>file_name</code></em> :</span></p></td> -<td>a file name</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>file_name</code></em> is absolute</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-path-skip-root"></a><h3>g_path_skip_root ()</h3> -<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_path_skip_root (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *file_name</code></em>);</pre> -<p> -Returns a pointer into <em class="parameter"><code>file_name</code></em> after the root component, -i.e. after the "/" in UNIX or "C:\" under Windows. If <em class="parameter"><code>file_name</code></em> -is not an absolute path it returns <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>file_name</code></em> :</span></p></td> -<td>a file name</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a pointer into <em class="parameter"><code>file_name</code></em> after the root component</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-path-get-basename"></a><h3>g_path_get_basename ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_path_get_basename (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *file_name</code></em>);</pre> -<p> -Gets the last component of the filename. -</p> -<p> -If <em class="parameter"><code>file_name</code></em> ends with a directory separator it gets the component -before the last slash. If <em class="parameter"><code>file_name</code></em> consists only of directory -separators (and on Windows, possibly a drive letter), a single -separator is returned. If <em class="parameter"><code>file_name</code></em> is empty, it gets ".". -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>file_name</code></em> :</span></p></td> -<td>the name of the file</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a newly allocated string containing the last -component of the filename</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-path-get-dirname"></a><h3>g_path_get_dirname ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_path_get_dirname (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *file_name</code></em>);</pre> -<p> -Gets the directory components of a file name. -</p> -<p> -If the file name has no directory components "." is returned. -The returned string should be freed when no longer needed. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>file_name</code></em> :</span></p></td> -<td>the name of the file</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the directory components of the file</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-build-filename"></a><h3>g_build_filename ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_build_filename (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *first_element</code></em>, - <em class="parameter"><code>...</code></em>);</pre> -<p> -Creates a filename from a series of elements using the correct -separator for filenames. -</p> -<p> -On Unix, this function behaves identically to <code class="literal">g_build_path -(G_DIR_SEPARATOR_S, first_element, ....)</code>. -</p> -<p> -On Windows, it takes into account that either the backslash -(<code class="literal">\</code> or slash (<code class="literal">/</code>) 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. -</p> -<p> -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. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>first_element</code></em> :</span></p></td> -<td>the first element in the path</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td> -<td>remaining elements in path, terminated by <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a newly-allocated string that must be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>.</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-build-filenamev"></a><h3>g_build_filenamev ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_build_filenamev (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **args</code></em>);</pre> -<p> -Behaves exactly like <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-build-filename" title="g_build_filename ()"><code class="function">g_build_filename()</code></a>, but takes the path elements -as a string array, instead of varargs. This function is mainly -meant for language bindings. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>args</code></em> :</span></p></td> -<td> -<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings containing the path elements. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a newly-allocated string that must be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>.</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.8</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-build-path"></a><h3>g_build_path ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_build_path (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *separator</code></em>, - <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *first_element</code></em>, - <em class="parameter"><code>...</code></em>);</pre> -<p> -Creates a path from a series of elements using <em class="parameter"><code>separator</code></em> 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. -</p> -<p> -Empty elements are ignored. -</p> -<p> -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. -</p> -<p> -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 <code class="literal">ABA</code>, <code class="literal">ABABA</code> -has 1 trailing copy.) -</p> -<p> -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. -</p> -<p> -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. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>separator</code></em> :</span></p></td> -<td>a string used to separator the elements of the path.</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>first_element</code></em> :</span></p></td> -<td>the first element in the path</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td> -<td>remaining elements in path, terminated by <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a newly-allocated string that must be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>.</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-build-pathv"></a><h3>g_build_pathv ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_build_pathv (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *separator</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **args</code></em>);</pre> -<p> -Behaves exactly like <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-build-path" title="g_build_path ()"><code class="function">g_build_path()</code></a>, but takes the path elements -as a string array, instead of varargs. This function is mainly -meant for language bindings. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>separator</code></em> :</span></p></td> -<td>a string used to separator the elements of the path.</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>args</code></em> :</span></p></td> -<td> -<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings containing the path elements. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a newly-allocated string that must be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>.</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.8</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-format-size"></a><h3>g_format_size ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_format_size (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint64" title="guint64"><span class="type">guint64</span></a> size</code></em>);</pre> -<p> -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.2 MB". -</p> -<p> -The prefix units base is 1000 (i.e. 1 kB is 1000 bytes). -</p> -<p> -This string should be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a> when not needed any longer. -</p> -<p> -See <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-format-size-full" title="g_format_size_full ()"><code class="function">g_format_size_full()</code></a> for more options about how the size might be -formatted. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td> -<td>a size in bytes</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a newly-allocated formatted string containing a human readable -file size</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.30</p> -</div> -<hr> -<div class="refsect2"> -<a name="GFormatSizeFlags"></a><h3>enum GFormatSizeFlags</h3> -<pre class="programlisting">typedef enum { - G_FORMAT_SIZE_DEFAULT = 0, - G_FORMAT_SIZE_LONG_FORMAT = 1 << 0, - G_FORMAT_SIZE_IEC_UNITS = 1 << 1 -} GFormatSizeFlags; -</pre> -<p> -Flags to modify the format of the string returned by <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-format-size-full" title="g_format_size_full ()"><code class="function">g_format_size_full()</code></a>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><a name="G-FORMAT-SIZE-DEFAULT:CAPS"></a><span class="term"><code class="literal">G_FORMAT_SIZE_DEFAULT</code></span></p></td> -<td>behave the same as <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-format-size" title="g_format_size ()"><code class="function">g_format_size()</code></a> -</td> -</tr> -<tr> -<td><p><a name="G-FORMAT-SIZE-LONG-FORMAT:CAPS"></a><span class="term"><code class="literal">G_FORMAT_SIZE_LONG_FORMAT</code></span></p></td> -<td>include the exact number of bytes as part - of the returned string. For example, "45.6 kB (45,612 bytes)". -</td> -</tr> -<tr> -<td><p><a name="G-FORMAT-SIZE-IEC-UNITS:CAPS"></a><span class="term"><code class="literal">G_FORMAT_SIZE_IEC_UNITS</code></span></p></td> -<td>use IEC (base 1024) units with "KiB"-style - suffixes. IEC units should only be used for reporting things with - a strong "power of 2" basis, like RAM sizes or RAID stripe sizes. - Network and storage sizes should be reported in the normal SI units. -</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-format-size-full"></a><h3>g_format_size_full ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_format_size_full (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint64" title="guint64"><span class="type">guint64</span></a> size</code></em>, - <em class="parameter"><code><a class="link" href="glib-Miscellaneous-Utility-Functions.html#GFormatSizeFlags" title="enum GFormatSizeFlags"><span class="type">GFormatSizeFlags</span></a> flags</code></em>);</pre> -<p> -Formats a size. -</p> -<p> -This function is similar to <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-format-size" title="g_format_size ()"><code class="function">g_format_size()</code></a> but allows for flags -that modify the output. See <a class="link" href="glib-Miscellaneous-Utility-Functions.html#GFormatSizeFlags" title="enum GFormatSizeFlags"><span class="type">GFormatSizeFlags</span></a>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td> -<td>a size in bytes</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td> -<td> -<a class="link" href="glib-Miscellaneous-Utility-Functions.html#GFormatSizeFlags" title="enum GFormatSizeFlags"><span class="type">GFormatSizeFlags</span></a> to modify the output</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a newly-allocated formatted string containing a human -readable file size</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.30</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-format-size-for-display"></a><h3>g_format_size_for_display ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_format_size_for_display (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#goffset" title="goffset"><span class="type">goffset</span></a> size</code></em>);</pre> -<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> -<h3 class="title">Warning</h3> -<p><code class="literal">g_format_size_for_display</code> has been deprecated since version 2.30 and should not be used in newly-written code. This function is broken due to its use of SI - suffixes to denote IEC units. Use <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-format-size" title="g_format_size ()"><code class="function">g_format_size()</code></a> instead.</p> -</div> -<p> -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". -</p> -<p> -The prefix units base is 1024 (i.e. 1 KB is 1024 bytes). -</p> -<p> -This string should be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a> when not needed any longer. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td> -<td>a size in bytes</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a newly-allocated formatted string containing a human -readable file size</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.16</p> -</div> -<hr> -<div class="refsect2"> -<a name="g-find-program-in-path"></a><h3>g_find_program_in_path ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * g_find_program_in_path (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *program</code></em>);</pre> -<p> -Locates the first executable named <em class="parameter"><code>program</code></em> in the user's path, in the -same way that <code class="function">execvp()</code> would locate it. Returns an allocated string -with the absolute path name, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if the program is not found in -the path. If <em class="parameter"><code>program</code></em> is already an absolute path, returns a copy of -<em class="parameter"><code>program</code></em> if <em class="parameter"><code>program</code></em> exists and is executable, and <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> otherwise. - -On Windows, if <em class="parameter"><code>program</code></em> does not have a file type suffix, tries -with the suffixes .exe, .cmd, .bat and .com, and the suffixes in -the <code class="envar">PATHEXT</code> environment variable. -</p> -<p> -On Windows, it looks for the file in the same way as <code class="function">CreateProcess()</code> -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 <code class="envar">PATH</code> environment -variable. If the program is found, the return value contains the -full name including the type suffix. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>program</code></em> :</span></p></td> -<td>a program name in the GLib file name encoding</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a newly-allocated string with the absolute path, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> -</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-bit-nth-lsf"></a><h3>g_bit_nth_lsf ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> g_bit_nth_lsf (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="type">gulong</span></a> mask</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> nth_bit</code></em>);</pre> -<p> -Find the position of the first bit set in <em class="parameter"><code>mask</code></em>, searching -from (but not including) <em class="parameter"><code>nth_bit</code></em> upwards. Bits are numbered -from 0 (least significant) to sizeof(<a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="type">gulong</span></a>) * 8 - 1 (31 or 63, -usually). To start searching from the 0th bit, set <em class="parameter"><code>nth_bit</code></em> to -1. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>mask</code></em> :</span></p></td> -<td>a <a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="type">gulong</span></a> containing flags</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>nth_bit</code></em> :</span></p></td> -<td>the index of the bit to start the search from</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the index of the first bit set which is higher than <em class="parameter"><code>nth_bit</code></em> -</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-bit-nth-msf"></a><h3>g_bit_nth_msf ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> g_bit_nth_msf (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="type">gulong</span></a> mask</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> nth_bit</code></em>);</pre> -<p> -Find the position of the first bit set in <em class="parameter"><code>mask</code></em>, searching -from (but not including) <em class="parameter"><code>nth_bit</code></em> downwards. Bits are numbered -from 0 (least significant) to sizeof(<a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="type">gulong</span></a>) * 8 - 1 (31 or 63, -usually). To start searching from the last bit, set <em class="parameter"><code>nth_bit</code></em> to --1 or GLIB_SIZEOF_LONG * 8. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>mask</code></em> :</span></p></td> -<td>a <a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="type">gulong</span></a> containing flags</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>nth_bit</code></em> :</span></p></td> -<td>the index of the bit to start the search from</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the index of the first bit set which is lower than <em class="parameter"><code>nth_bit</code></em> -</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-bit-storage"></a><h3>g_bit_storage ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="returnvalue">guint</span></a> g_bit_storage (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="type">gulong</span></a> number</code></em>);</pre> -<p> -Gets the number of bits used to hold <em class="parameter"><code>number</code></em>, -e.g. if <em class="parameter"><code>number</code></em> is 4, 3 bits are needed. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>number</code></em> :</span></p></td> -<td>a <a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the number of bits used to hold <em class="parameter"><code>number</code></em> -</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-spaced-primes-closest"></a><h3>g_spaced_primes_closest ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="returnvalue">guint</span></a> g_spaced_primes_closest (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> num</code></em>);</pre> -<p> -Gets the smallest prime number from a built-in array of primes which -is larger than <em class="parameter"><code>num</code></em>. This is used within GLib to calculate the optimum -size of a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>. -</p> -<p> -The built-in array of primes ranges from 11 to 13845163 such that -each prime is approximately 1.5-2 times the previous prime. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>num</code></em> :</span></p></td> -<td>a <a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the smallest prime number from a built-in array of primes -which is larger than <em class="parameter"><code>num</code></em> -</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-atexit"></a><h3>g_atexit ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> g_atexit (<em class="parameter"><code><a class="link" href="glib-Miscellaneous-Utility-Functions.html#GVoidFunc" title="GVoidFunc ()"><span class="type">GVoidFunc</span></a> func</code></em>);</pre> -<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> -<h3 class="title">Warning</h3> -<p><code class="literal">g_atexit</code> has been deprecated since version 2.32 and should not be used in newly-written code. It is best to avoid <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-atexit" title="g_atexit ()"><code class="function">g_atexit()</code></a>.</p> -</div> -<p> -Specifies a function to be called at normal program termination. -</p> -<p> -Since GLib 2.8.2, on Windows <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-atexit" title="g_atexit ()"><code class="function">g_atexit()</code></a> actually is a preprocessor -macro that maps to a call to the <code class="function">atexit()</code> function in the C -library. This means that in case the code that calls <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-atexit" title="g_atexit ()"><code class="function">g_atexit()</code></a>, -i.e. <code class="function">atexit()</code>, 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 <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-atexit" title="g_atexit ()"><code class="function">g_atexit()</code></a> was a function in the GLib -DLL. -</p> -<p> -The behaviour of <code class="function">atexit()</code> in the context of dynamically loaded -modules is not formally specified and varies wildly. -</p> -<p> -On POSIX systems, calling <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-atexit" title="g_atexit ()"><code class="function">g_atexit()</code></a> (or <code class="function">atexit()</code>) in a dynamically -loaded module which is unloaded before the program terminates might -well cause a crash at program exit. -</p> -<p> -Some POSIX systems implement <code class="function">atexit()</code> like Windows, and have each -dynamically loaded module maintain an own atexit chain that is -called when the module is unloaded. -</p> -<p> -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. -</p> -<p> -As can be seen from the above, for portability it's best to avoid -calling <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-atexit" title="g_atexit ()"><code class="function">g_atexit()</code></a> (or <code class="function">atexit()</code>) except in the main executable of a -program. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td> -<td>the function to call on normal program termination. <span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span> -</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-parse-debug-string"></a><h3>g_parse_debug_string ()</h3> -<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="returnvalue">guint</span></a> g_parse_debug_string (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>, - <em class="parameter"><code>const <a class="link" href="glib-Miscellaneous-Utility-Functions.html#GDebugKey" title="struct GDebugKey"><span class="type">GDebugKey</span></a> *keys</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> nkeys</code></em>);</pre> -<p> -Parses a string containing debugging options -into a <a class="link" href="glib-Basic-Types.html#guint" title="guint"><code class="literal">guint</code></a> containing bit flags. This is used -within GDK and GTK+ to parse the debug options passed on the -command line or through environment variables. -</p> -<p> -If <em class="parameter"><code>string</code></em> is equal to <code class="code">"all"</code>, all flags are set. Any flags -specified along with <code class="code">"all"</code> in <em class="parameter"><code>string</code></em> are inverted; thus, -<code class="code">"all,foo,bar"</code> or <code class="code">"foo,bar,all"</code> sets all flags -except those corresponding to <code class="code">"foo"</code> and <code class="code">"bar"</code>. -</p> -<p> -If <em class="parameter"><code>string</code></em> is equal to <code class="code">"help"</code>, all the available keys in <em class="parameter"><code>keys</code></em> -are printed out to standard error. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td> -<td>a list of debug options separated by colons, spaces, or -commas, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>keys</code></em> :</span></p></td> -<td>pointer to an array of <a class="link" href="glib-Miscellaneous-Utility-Functions.html#GDebugKey" title="struct GDebugKey"><span class="type">GDebugKey</span></a> which associate -strings with bit flags. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=nkeys]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>nkeys</code></em> :</span></p></td> -<td>the number of <a class="link" href="glib-Miscellaneous-Utility-Functions.html#GDebugKey" title="struct GDebugKey"><span class="type">GDebugKey</span></a>s in the array.</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the combined set of bit flags.</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="GDebugKey"></a><h3>struct GDebugKey</h3> -<pre class="programlisting">struct GDebugKey { - const gchar *key; - guint value; -}; -</pre> -<p> -Associates a string with a bit flag. -Used in <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-parse-debug-string" title="g_parse_debug_string ()"><code class="function">g_parse_debug_string()</code></a>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GDebugKey.key"></a>key</code></em>;</span></p></td> -<td>the string</td> -</tr> -<tr> -<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="GDebugKey.value"></a>value</code></em>;</span></p></td> -<td>the flag</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="GVoidFunc"></a><h3>GVoidFunc ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> (*GVoidFunc) (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> -<h3 class="title">Warning</h3> -<p><code class="literal">GVoidFunc</code> is deprecated and should not be used in newly-written code.</p> -</div> -<p> -Declares a type of function which takes no arguments -and has no return value. It is used to specify the type -function passed to <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-atexit" title="g_atexit ()"><code class="function">g_atexit()</code></a>. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="GFreeFunc"></a><h3>GFreeFunc ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> (*GFreeFunc) (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre> -<p> -Declares a type of function which takes an arbitrary -data pointer argument and has no return value. It is -not currently used in GLib or GTK+. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td> -<td>a data pointer</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-qsort-with-data"></a><h3>g_qsort_with_data ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> g_qsort_with_data (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> pbase</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> total_elems</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="type">gsize</span></a> size</code></em>, - <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()"><span class="type">GCompareDataFunc</span></a> compare_func</code></em>, - <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre> -<p> -This is just like the standard C <code class="function">qsort()</code> function, but -the comparison routine accepts a user data argument. -</p> -<p> -This is guaranteed to be a stable sort since version 2.32. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>pbase</code></em> :</span></p></td> -<td>start of array to sort</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>total_elems</code></em> :</span></p></td> -<td>elements in the array</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td> -<td>size of each element</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>compare_func</code></em> :</span></p></td> -<td>function to compare elements</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td> -<td>data to pass to <em class="parameter"><code>compare_func</code></em> -</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="g-nullify-pointer"></a><h3>g_nullify_pointer ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> g_nullify_pointer (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> *nullify_location</code></em>);</pre> -<p> -Set the pointer at the specified location to <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>nullify_location</code></em> :</span></p></td> -<td>the memory address of the pointer.</td> -</tr></tbody> -</table></div> -</div> -</div> -</div> -<div class="footer"> -<hr> - Generated by GTK-Doc V1.18</div> -</body> -</html>
\ No newline at end of file |