/usr/share/gtk-doc/html/libgimpbase/libgimpbase-gimpenv.html is in libgimp2.0-doc 2.6.12-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>gimpenv</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GIMP Base Library Reference Manual">
<link rel="up" href="libgimpbase.html" title="Part I. GIMP Base Library">
<link rel="prev" href="libgimpbase-gimpdatafiles.html" title="gimpdatafiles">
<link rel="next" href="libgimpbase-gimpmemsize.html" title="gimpmemsize">
<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="libgimpbase-gimpdatafiles.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="libgimpbase.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">GIMP Base Library Reference Manual</th>
<td><a accesskey="n" href="libgimpbase-gimpmemsize.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libgimpbase-gimpenv.synopsis" class="shortcut">Top</a>
|
<a href="#libgimpbase-gimpenv.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libgimpbase-gimpenv"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libgimpbase-gimpenv.top_of_page"></a>gimpenv</span></h2>
<p>gimpenv — Functions to access the GIMP environment.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libgimpbase-gimpenv.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis"><span class="returnvalue">void</span> <a class="link" href="libgimpbase-gimpenv.html#gimp-env-init" title="gimp_env_init ()">gimp_env_init</a> (<em class="parameter"><code><span class="type">gboolean</span> plug_in</code></em>);
const <span class="returnvalue">gchar</span> * <a class="link" href="libgimpbase-gimpenv.html#gimp-directory" title="gimp_directory ()">gimp_directory</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
const <span class="returnvalue">gchar</span> * <a class="link" href="libgimpbase-gimpenv.html#gimp-data-directory" title="gimp_data_directory ()">gimp_data_directory</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
const <span class="returnvalue">gchar</span> * <a class="link" href="libgimpbase-gimpenv.html#gimp-locale-directory" title="gimp_locale_directory ()">gimp_locale_directory</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
const <span class="returnvalue">gchar</span> * <a class="link" href="libgimpbase-gimpenv.html#gimp-plug-in-directory" title="gimp_plug_in_directory ()">gimp_plug_in_directory</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
const <span class="returnvalue">gchar</span> * <a class="link" href="libgimpbase-gimpenv.html#gimp-sysconf-directory" title="gimp_sysconf_directory ()">gimp_sysconf_directory</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
const <span class="returnvalue">gchar</span> * <a class="link" href="libgimpbase-gimpenv.html#gimp-user-directory" title="gimp_user_directory ()">gimp_user_directory</a> (<em class="parameter"><code><a class="link" href="libgimpbase-gimpbaseenums.html#GimpUserDirectory" title="enum GimpUserDirectory"><span class="type">GimpUserDirectory</span></a> type</code></em>);
<span class="returnvalue">gchar</span> * <a class="link" href="libgimpbase-gimpenv.html#gimp-personal-rc-file" title="gimp_personal_rc_file ()">gimp_personal_rc_file</a> (<em class="parameter"><code>const <span class="type">gchar</span> *basename</code></em>);
const <span class="returnvalue">gchar</span> * <a class="link" href="libgimpbase-gimpenv.html#gimp-gtkrc" title="gimp_gtkrc ()">gimp_gtkrc</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">GList</span> * <a class="link" href="libgimpbase-gimpenv.html#gimp-path-parse" title="gimp_path_parse ()">gimp_path_parse</a> (<em class="parameter"><code>const <span class="type">gchar</span> *path</code></em>,
<em class="parameter"><code><span class="type">gint</span> max_paths</code></em>,
<em class="parameter"><code><span class="type">gboolean</span> check</code></em>,
<em class="parameter"><code><span class="type">GList</span> **check_failed</code></em>);
<span class="returnvalue">gchar</span> * <a class="link" href="libgimpbase-gimpenv.html#gimp-path-to-str" title="gimp_path_to_str ()">gimp_path_to_str</a> (<em class="parameter"><code><span class="type">GList</span> *path</code></em>);
<span class="returnvalue">void</span> <a class="link" href="libgimpbase-gimpenv.html#gimp-path-free" title="gimp_path_free ()">gimp_path_free</a> (<em class="parameter"><code><span class="type">GList</span> *path</code></em>);
<span class="returnvalue">gchar</span> * <a class="link" href="libgimpbase-gimpenv.html#gimp-path-get-user-writable-dir" title="gimp_path_get_user_writable_dir ()">gimp_path_get_user_writable_dir</a> (<em class="parameter"><code><span class="type">GList</span> *path</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libgimpbase-gimpenv.description"></a><h2>Description</h2>
<p>
A set of functions to find the locations of GIMP's data directories and
configuration files.
</p>
</div>
<div class="refsect1">
<a name="libgimpbase-gimpenv.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="gimp-env-init"></a><h3>gimp_env_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gimp_env_init (<em class="parameter"><code><span class="type">gboolean</span> plug_in</code></em>);</pre>
<p>
You don't need to care about this function. It is being called for
you automatically (by means of the <code class="function">MAIN()</code> macro that every plug-in
runs). Calling it again will cause a fatal error.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>plug_in</code></em> :</span></p></td>
<td>must be <code class="literal">TRUE</code> if this function is called from a plug-in</td>
</tr></tbody>
</table></div>
<p class="since">Since GIMP 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gimp-directory"></a><h3>gimp_directory ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> * gimp_directory (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Returns the user-specific GIMP settings directory. If the
environment variable GIMP2_DIRECTORY exists, it is used. If it is
an absolute path, it is used as is. If it is a relative path, it
is taken to be a subdirectory of the home directory. If it is a
relative path, and no home directory can be determined, it is taken
to be a subdirectory of <a class="link" href="libgimpbase-gimpenv.html#gimp-data-directory" title="gimp_data_directory ()"><code class="function">gimp_data_directory()</code></a>.
</p>
<p>
The usual case is that no GIMP2_DIRECTORY environment variable
exists, and then we use the GIMPDIR subdirectory of the home
directory. If no home directory exists, we use a per-user
subdirectory of <a class="link" href="libgimpbase-gimpenv.html#gimp-data-directory" title="gimp_data_directory ()"><code class="function">gimp_data_directory()</code></a>. In any case, we always
return some non-empty string, whether it corresponds to an existing
directory or not.
</p>
<p>
The returned string is owned by GIMP and must not be modified or
freed. The returned string is in the encoding used for filenames by
GLib, which isn't necessarily UTF-8. (On Windows it always is
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-specific GIMP settings directory.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-data-directory"></a><h3>gimp_data_directory ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> * gimp_data_directory (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Returns the top directory for GIMP data. If the environment
variable GIMP2_DATADIR exists, that is used. It should be an
absolute pathname. Otherwise, on Unix the compile-time defined
directory is used. On Windows, the installation directory as deduced
from the executable's full filename is used.
</p>
<p>
The returned string is owned by GIMP and must not be modified or
freed. The returned string is in the encoding used for filenames by
GLib, which isn't necessarily UTF-8. (On Windows it always is
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 top directory for GIMP data.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-locale-directory"></a><h3>gimp_locale_directory ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> * gimp_locale_directory (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Returns the top directory for GIMP locale files. If the environment
variable GIMP2_LOCALEDIR exists, that is used. It should be an
absolute pathname. Otherwise, on Unix the compile-time defined
directory is used. On Windows, the installation directory as deduced
from the executable's full filename is used.
</p>
<p>
The returned string is owned by GIMP and must not be modified or
freed. The returned string is in the encoding used for filenames by
the C library, which isn't necessarily UTF-8. (On Windows, unlike
the other similar functions here, the return value from this
function is in the system codepage, never in UTF-8. It can thus be
passed directly to the <code class="function">bindtextdomain()</code> function from libintl which
does not handle 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 top directory for GIMP locale files.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-plug-in-directory"></a><h3>gimp_plug_in_directory ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> * gimp_plug_in_directory (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Returns the top directory for GIMP plug_ins and modules. If the
environment variable GIMP2_PLUGINDIR exists, that is used. It
should be an absolute pathname. Otherwise, on Unix the compile-time
defined directory is used. On Windows, the installation directory as
deduced from the executable's full filename is used.
</p>
<p>
The returned string is owned by GIMP and must not be modified or
freed. The returned string is in the encoding used for filenames by
GLib, which isn't necessarily UTF-8. (On Windows it always is
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 top directory for GIMP plug_ins and modules.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-sysconf-directory"></a><h3>gimp_sysconf_directory ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> * gimp_sysconf_directory (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Returns the top directory for GIMP config files. If the environment
variable GIMP2_SYSCONFDIR exists, that is used. It should be an
absolute pathname. Otherwise, on Unix the compile-time defined
directory is used. On Windows, the installation directory as deduced
from the executable's full filename is used.
</p>
<p>
The returned string is owned by GIMP and must not be modified or
freed. The returned string is in the encoding used for filenames by
GLib, which isn't necessarily UTF-8. (On Windows it always is
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 top directory for GIMP config files.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-user-directory"></a><h3>gimp_user_directory ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> * gimp_user_directory (<em class="parameter"><code><a class="link" href="libgimpbase-gimpbaseenums.html#GimpUserDirectory" title="enum GimpUserDirectory"><span class="type">GimpUserDirectory</span></a> type</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gimp_user_directory</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
This procedure is deprecated! Use <code class="function">g_get_user_special_dir()</code> instead.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td>the type of user directory to retrieve</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The path to the specified user directory, or <code class="literal">NULL</code> if the
logical ID was not found.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since GIMP 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gimp-personal-rc-file"></a><h3>gimp_personal_rc_file ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> * gimp_personal_rc_file (<em class="parameter"><code>const <span class="type">gchar</span> *basename</code></em>);</pre>
<p>
Returns the name of a file in the user-specific GIMP settings directory.
</p>
<p>
The returned string is allocated dynamically and *SHOULD* be freed
with <code class="function">g_free()</code> after use. The returned string is in the encoding
used for filenames by GLib, which isn't necessarily
UTF-8. (On Windows it always is 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>basename</code></em> :</span></p></td>
<td>The basename of a rc_file.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The name of a file in the user-specific GIMP settings directory.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-gtkrc"></a><h3>gimp_gtkrc ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> * gimp_gtkrc (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Returns the name of GIMP's application-specific gtkrc file.
</p>
<p>
The returned string is owned by GIMP and must not be modified or
freed. The returned string is in the encoding used for filenames by
GLib, which isn't necessarily UTF-8. (On Windows it always is
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 name of GIMP's application-specific gtkrc file.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-path-parse"></a><h3>gimp_path_parse ()</h3>
<pre class="programlisting"><span class="returnvalue">GList</span> * gimp_path_parse (<em class="parameter"><code>const <span class="type">gchar</span> *path</code></em>,
<em class="parameter"><code><span class="type">gint</span> max_paths</code></em>,
<em class="parameter"><code><span class="type">gboolean</span> check</code></em>,
<em class="parameter"><code><span class="type">GList</span> **check_failed</code></em>);</pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td>A list of directories separated by <span class="type">G_SEARCHPATH_SEPARATOR</span>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>max_paths</code></em> :</span></p></td>
<td>The maximum number of directories to return.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>check</code></em> :</span></p></td>
<td>
<code class="literal">TRUE</code> if you want the directories to be checked.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>check_failed</code></em> :</span></p></td>
<td>Returns a <span class="type">GList</span> of path elements for which the
check failed.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A <span class="type">GList</span> of all directories in <em class="parameter"><code>path</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-path-to-str"></a><h3>gimp_path_to_str ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> * gimp_path_to_str (<em class="parameter"><code><span class="type">GList</span> *path</code></em>);</pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td>A list of directories as returned by <a class="link" href="libgimpbase-gimpenv.html#gimp-path-parse" title="gimp_path_parse ()"><code class="function">gimp_path_parse()</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A searchpath string separated by <span class="type">G_SEARCHPATH_SEPARATOR</span>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-path-free"></a><h3>gimp_path_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gimp_path_free (<em class="parameter"><code><span class="type">GList</span> *path</code></em>);</pre>
<p>
This function frees the memory allocated for the list and the strings
it contains.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td>A list of directories as returned by <a class="link" href="libgimpbase-gimpenv.html#gimp-path-parse" title="gimp_path_parse ()"><code class="function">gimp_path_parse()</code></a>.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gimp-path-get-user-writable-dir"></a><h3>gimp_path_get_user_writable_dir ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> * gimp_path_get_user_writable_dir (<em class="parameter"><code><span class="type">GList</span> *path</code></em>);</pre>
<p>
Note that you have to <code class="function">g_free()</code> the returned string.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td>A list of directories as returned by <a class="link" href="libgimpbase-gimpenv.html#gimp-path-parse" title="gimp_path_parse ()"><code class="function">gimp_path_parse()</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The first directory in <em class="parameter"><code>path</code></em> where the user has write permission.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.18</div>
</body>
</html>
|