~ubuntu-branches/ubuntu/saucy/glib2.0/saucy-proposed

« back to all changes in this revision

Viewing changes to docs/reference/glib/html/glib-Miscellaneous-Utility-Functions.html

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2013-08-21 10:08:49 UTC
  • mfrom: (1.63.24)
  • Revision ID: package-import@ubuntu.com-20130821100849-enhti9o2tk0iug5r
Tags: 2.37.6-1ubuntu1
* Resynchronise with Debian, remaining change:
  - Build-Depend on python:any for cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
<html>
3
3
<head>
4
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
 
<title>Miscellaneous Utility Functions</title>
 
5
<title>GLib Reference Manual: Miscellaneous Utility Functions</title>
6
6
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7
7
<link rel="home" href="index.html" title="GLib Reference Manual">
8
8
<link rel="up" href="glib-utilities.html" title="GLib Utilities">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
</head>
14
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
 
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
16
 
<tr valign="middle">
17
 
<td><a accesskey="p" href="glib-Hook-Functions.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
 
<td><a accesskey="u" href="glib-utilities.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19
 
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20
 
<th width="100%" align="center">GLib Reference Manual</th>
21
 
<td><a accesskey="n" href="glib-Lexical-Scanner.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22
 
</tr>
23
 
<tr><td colspan="5" class="shortcuts">
24
 
<a href="#glib-Miscellaneous-Utility-Functions.synopsis" class="shortcut">Top</a>
 
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="10"><tr valign="middle">
 
16
<td width="100%" align="left">
 
17
<a href="#" class="shortcut">Top</a>
25
18
                   | 
26
19
                  <a href="#glib-Miscellaneous-Utility-Functions.description" class="shortcut">Description</a>
27
 
</td></tr>
28
 
</table>
 
20
</td>
 
21
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
 
22
<td><a accesskey="u" href="glib-utilities.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
 
23
<td><a accesskey="p" href="glib-Hook-Functions.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
 
24
<td><a accesskey="n" href="glib-Lexical-Scanner.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
 
25
</tr></table>
29
26
<div class="refentry">
30
27
<a name="glib-Miscellaneous-Utility-Functions"></a><div class="titlepage"></div>
31
28
<div class="refnamediv"><table width="100%"><tr>
451
448
</p>
452
449
<p>
453
450
</p>
454
 
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
451
<div class="warning">
455
452
<h3 class="title">Warning</h3>
456
453
<p>
457
454
Environment variable handling in UNIX is not thread-safe, and your
511
508
</p>
512
509
<p>
513
510
</p>
514
 
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
511
<div class="warning">
515
512
<h3 class="title">Warning</h3>
516
513
<p>
517
514
Environment variable handling in UNIX is not thread-safe, and your
1025
1022
</p>
1026
1023
<p>
1027
1024
</p>
1028
 
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1025
<div class="note">
1029
1026
<h3 class="title">Note</h3>
1030
1027
<p>
1031
1028
  Before version 2.36 this function would ignore the
1062
1059
<a name="g-get-tmp-dir"></a><h3>g_get_tmp_dir ()</h3>
1063
1060
<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>
1064
1061
<p>
1065
 
Gets the directory to use for temporary files. This is found from 
1066
 
inspecting the environment variables <code class="envar">TMPDIR</code>, 
1067
 
<code class="envar">TMP</code>, and <code class="envar">TEMP</code> in that order. If none 
1068
 
of those are defined "/tmp" is returned on UNIX and "C:\" on Windows. 
1069
 
The encoding of the returned string is system-defined. On Windows, 
1070
 
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.
 
1062
Gets the directory to use for temporary files.
 
1063
</p>
 
1064
<p>
 
1065
On UNIX, this is taken from the <code class="envar">TMPDIR</code> environment
 
1066
variable.  If the variable is not set, <code class="literal">P_tmpdir</code> is
 
1067
used, as defined by the system C library.  Failing that, a hard-coded
 
1068
default of "/tmp" is returned.
 
1069
</p>
 
1070
<p>
 
1071
On Windows, the <code class="envar">TEMP</code> environment variable is used,
 
1072
with the root directory of the Windows installation (eg: "C:\") used
 
1073
as a default.
 
1074
</p>
 
1075
<p>
 
1076
The encoding of the returned string is system-defined. On Windows, it
 
1077
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.
1071
1078
</p>
1072
1079
<div class="variablelist"><table border="0" class="variablelist">
1073
1080
<colgroup>
1107
1114
<div class="refsect2">
1108
1115
<a name="g-basename"></a><h3>g_basename ()</h3>
1109
1116
<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>
1110
 
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1117
<div class="warning">
1111
1118
<h3 class="title">Warning</h3>
1112
1119
<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
1113
1120
    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
1141
1148
<div class="refsect2">
1142
1149
<a name="g-dirname"></a><h3>g_dirname</h3>
1143
1150
<pre class="programlisting">#define             g_dirname</pre>
1144
 
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1151
<div class="warning">
1145
1152
<h3 class="title">Warning</h3>
1146
1153
<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>
1147
1154
</div>
1602
1609
<div class="refsect2">
1603
1610
<a name="g-format-size-for-display"></a><h3>g_format_size_for_display ()</h3>
1604
1611
<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>
1605
 
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1612
<div class="warning">
1606
1613
<h3 class="title">Warning</h3>
1607
1614
<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
1608
1615
    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>
1812
1819
<div class="refsect2">
1813
1820
<a name="g-atexit"></a><h3>g_atexit ()</h3>
1814
1821
<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>
1815
 
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1822
<div class="warning">
1816
1823
<h3 class="title">Warning</h3>
1817
1824
<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>
1818
1825
</div>
1950
1957
<div class="refsect2">
1951
1958
<a name="GVoidFunc"></a><h3>GVoidFunc ()</h3>
1952
1959
<pre class="programlisting"><span class="returnvalue">void</span>                (*GVoidFunc)                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
1953
 
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1960
<div class="warning">
1954
1961
<h3 class="title">Warning</h3>
1955
1962
<p><code class="literal">GVoidFunc</code> is deprecated and should not be used in newly-written code.</p>
1956
1963
</div>