glib-Miscellaneous-Macros.html   [plain text]


<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Miscellaneous Macros</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="GLib Reference Manual"><link rel="up" href="glib-fundamentals.html" title="GLib Fundamentals"><link rel="previous" href="glib-Numerical-Definitions.html" title="Numerical Definitions"><link rel="next" href="glib-Atomic-Operations.html" title="Atomic Operations"><link rel="chapter" href="glib.html" title="GLib Overview"><link rel="refentry" href="glib-building.html" title="Compiling the GLib package"><link rel="refentry" href="glib-cross-compiling.html" title="Cross-compiling the GLib package"><link rel="refentry" href="glib-compiling.html" title="Compiling GLib Applications"><link rel="refentry" href="glib-running.html" title="Running GLib Applications"><link rel="refentry" href="glib-changes.html" title="Changes to GLib"><link rel="refentry" href="glib-resources.html" title="Mailing lists and bug reports"><link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals"><link rel="refentry" href="glib-Basic-Types.html" title="Basic Types"><link rel="refentry" href="glib-Limits-of-Basic-Types.html" title="Limits of Basic Types"><link rel="refentry" href="glib-Standard-Macros.html" title="Standard Macros"><link rel="refentry" href="glib-Type-Conversion-Macros.html" title="Type Conversion Macros"><link rel="refentry" href="glib-Byte-Order-Macros.html" title="Byte Order Macros"><link rel="refentry" href="glib-Numerical-Definitions.html" title="Numerical Definitions"><link rel="refentry" href="glib-Miscellaneous-Macros.html" title="Miscellaneous Macros"><link rel="refentry" href="glib-Atomic-Operations.html" title="Atomic Operations"><link rel="chapter" href="glib-core.html" title="GLib Core Application Support"><link rel="refentry" href="glib-The-Main-Event-Loop.html" title="The Main Event Loop"><link rel="refentry" href="glib-Threads.html" title="
Threads"><link rel="refentry" href="glib-Thread-Pools.html" title="Thread Pools"><link rel="refentry" href="glib-Asynchronous-Queues.html" title="Asynchronous Queues"><link rel="refentry" href="glib-Dynamic-Loading-of-Modules.html" title="Dynamic Loading of Modules"><link rel="refentry" href="glib-Memory-Allocation.html" title="Memory Allocation"><link rel="refentry" href="glib-IO-Channels.html" title="IO Channels"><link rel="refentry" href="glib-Error-Reporting.html" title="Error Reporting"><link rel="refentry" href="glib-Warnings-and-Assertions.html" title="Message Output and Debugging Functions"><link rel="refentry" href="glib-Message-Logging.html" title="Message Logging"><link rel="chapter" href="glib-utilities.html" title="GLib Utilities"><link rel="refentry" href="glib-String-Utility-Functions.html" title="String Utility Functions"><link rel="refentry" href="glib-Character-Set-Conversion.html" title="Character Set Conversion"><link rel="refentry" href="glib-Unicode-Manipulation.html" title="Unicode Manipulation"><link rel="refentry" href="glib-I18N.html" title="Internationalization"><link rel="refentry" href="glib-Date-and-Time-Functions.html" title="Date and Time Functions"><link rel="refentry" href="glib-Random-Numbers.html" title="Random Numbers"><link rel="refentry" href="glib-Hook-Functions.html" title="Hook Functions"><link rel="refentry" href="glib-Miscellaneous-Utility-Functions.html" title="Miscellaneous Utility Functions"><link rel="refentry" href="glib-Lexical-Scanner.html" title="Lexical Scanner"><link rel="refentry" href="glib-Automatic-String-Completion.html" title="Automatic String Completion"><link rel="refentry" href="glib-Timers.html" title="Timers"><link rel="refentry" href="glib-Spawning-Processes.html" title="Spawning Processes"><link rel="refentry" href="glib-File-Utilities.html" title="File Utilities"><link rel="refentry" href="glib-Shell-related-Utilities.html" title="Shell-related Utilities"><link rel="refentry" href="glib-Glob-style-pattern-matching.html" title="Glob-style pattern matching"><link rel="refentry" href="glib-Simple-XML-Subset-Parser.html" title="Simple XML Subset Parser"><link rel="refentry" href="glib-Windows-Compatability-Functions.html" title="Windows Compatibility Functions"><link rel="chapter" href="glib-data-types.html" title="GLib Data Types"><link rel="refentry" href="glib-Memory-Chunks.html" title="Memory Chunks"><link rel="refentry" href="glib-Doubly-Linked-Lists.html" title="Doubly-Linked Lists"><link rel="refentry" href="glib-Singly-Linked-Lists.html" title="Singly-Linked Lists"><link rel="refentry" href="glib-Double-ended-Queues.html" title="Double-ended Queues"><link rel="refentry" href="glib-Trash-Stacks.html" title="Trash Stacks"><link rel="refentry" href="glib-Hash-Tables.html" title="Hash Tables"><link rel="refentry" href="glib-Strings.html" title="Strings"><link rel="refentry" href="glib-String-Chunks.html" title="String Chunks"><link rel="refentry" href="glib-Arrays.html" title="Arrays"><link rel="refentry" href="glib-Pointer-Arrays.html" title="Pointer Arrays"><link rel="refentry" href="glib-Byte-Arrays.html" title="Byte Arrays"><link rel="refentry" href="glib-Balanced-Binary-Trees.html" title="Balanced Binary Trees"><link rel="refentry" href="glib-N-ary-Trees.html" title="N-ary Trees"><link rel="refentry" href="glib-Quarks.html" title="Quarks"><link rel="refentry" href="glib-Keyed-Data-Lists.html" title="Keyed Data Lists"><link rel="refentry" href="glib-Datasets.html" title="Datasets"><link rel="refentry" href="glib-Relations-and-Tuples.html" title="Relations and Tuples"><link rel="refentry" href="glib-Caches.html" title="Caches"><link rel="refentry" href="glib-Memory-Allocators.html" title="Memory Allocators"><link rel="chapter" href="tools.html" title="GLib Tools"><link rel="refentry" href="glib-gettextize.html" title="glib-gettextize"><link rel="index" href="ix01.html" title="Index"><link rel="section" href="glib-Miscellaneous-Macros.html#id2994189" title="Description"><link rel="section" href="glib-Miscellaneous-Macros.html#id2994201" title="Details"><meta name="generator" content="GTK-Doc V1.2 (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" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="glib-Numerical-Definitions.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="glib-fundamentals.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-Atomic-Operations.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="glib-Miscellaneous-Macros"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Miscellaneous Macros</span></h2><p>Miscellaneous Macros &#8212; specialized macros which are not used often.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">

#include &lt;glib.h&gt;


#define     <a href="glib-Miscellaneous-Macros.html#G-INLINE-FUNC-CAPS">G_INLINE_FUNC</a>

#define     <a href="glib-Miscellaneous-Macros.html#G-STMT-START-CAPS">G_STMT_START</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-STMT-END-CAPS">G_STMT_END</a>

#define     <a href="glib-Miscellaneous-Macros.html#G-BEGIN-DECLS-CAPS">G_BEGIN_DECLS</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-END-DECLS-CAPS">G_END_DECLS</a>

#define     <a href="glib-Miscellaneous-Macros.html#G-N-ELEMENTS-CAPS">G_N_ELEMENTS</a>                    (arr)

#define     <a href="glib-Miscellaneous-Macros.html#G-VA-COPY-CAPS">G_VA_COPY</a>

#define     <a href="glib-Miscellaneous-Macros.html#G-STRINGIFY-CAPS">G_STRINGIFY</a>                     (macro_or_string)

#define     <a href="glib-Miscellaneous-Macros.html#G-GNUC-EXTENSION-CAPS">G_GNUC_EXTENSION</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GNUC-CONST-CAPS">G_GNUC_CONST</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GNUC-DEPRECATED-CAPS">G_GNUC_DEPRECATED</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GNUC-NORETURN-CAPS">G_GNUC_NORETURN</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GNUC-UNUSED-CAPS">G_GNUC_UNUSED</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GNUC-PURE-CAPS">G_GNUC_PURE</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GNUC-PRINTF-CAPS">G_GNUC_PRINTF</a>                   ( format_idx, arg_idx )
#define     <a href="glib-Miscellaneous-Macros.html#G-GNUC-SCANF-CAPS">G_GNUC_SCANF</a>                    ( format_idx, arg_idx )
#define     <a href="glib-Miscellaneous-Macros.html#G-GNUC-FORMAT-CAPS">G_GNUC_FORMAT</a>                   ( arg_idx )
#define     <a href="glib-Miscellaneous-Macros.html#G-GNUC-FUNCTION-CAPS">G_GNUC_FUNCTION</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GNUC-PRETTY-FUNCTION-CAPS">G_GNUC_PRETTY_FUNCTION</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GNUC-NO-INSTRUMENT-CAPS">G_GNUC_NO_INSTRUMENT</a>

#define     <a href="glib-Miscellaneous-Macros.html#G-LIKELY-CAPS">G_LIKELY</a>                        (expr)
#define     <a href="glib-Miscellaneous-Macros.html#G-UNLIKELY-CAPS">G_UNLIKELY</a>                      (expr)

#define     <a href="glib-Miscellaneous-Macros.html#G-STRLOC-CAPS">G_STRLOC</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-STRFUNC-CAPS">G_STRFUNC</a>

#define     <a href="glib-Miscellaneous-Macros.html#G-GINT16-MODIFIER-CAPS">G_GINT16_MODIFIER</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GINT16-FORMAT-CAPS">G_GINT16_FORMAT</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GUINT16-FORMAT-CAPS">G_GUINT16_FORMAT</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GINT32-MODIFIER-CAPS">G_GINT32_MODIFIER</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GINT32-FORMAT-CAPS">G_GINT32_FORMAT</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GUINT32-FORMAT-CAPS">G_GUINT32_FORMAT</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GINT64-MODIFIER-CAPS">G_GINT64_MODIFIER</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GINT64-FORMAT-CAPS">G_GINT64_FORMAT</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GUINT64-FORMAT-CAPS">G_GUINT64_FORMAT</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GSIZE-MODIFIER-CAPS">G_GSIZE_MODIFIER</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GSIZE-FORMAT-CAPS">G_GSIZE_FORMAT</a>
#define     <a href="glib-Miscellaneous-Macros.html#G-GSSIZE-FORMAT-CAPS">G_GSSIZE_FORMAT</a>

</pre></div><div class="refsect1" lang="en"><a name="id2994189"></a><h2>Description</h2><p>
These macros provide more specialized features which are not needed so often
by application programmers.
</p></div><div class="refsect1" lang="en"><a name="id2994201"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2994206"></a><h3><a name="G-INLINE-FUNC-CAPS"></a>G_INLINE_FUNC</h3><a class="indexterm" name="id2994217"></a><pre class="programlisting">#define     G_INLINE_FUNC</pre><p>
Used to declare inline functions. If inline functions are not supported on
the particular platform, the macro evaluates to the empty string.
</p></div><hr><div class="refsect2" lang="en"><a name="id2994235"></a><h3><a name="G-STMT-START-CAPS"></a>G_STMT_START</h3><a class="indexterm" name="id2994246"></a><pre class="programlisting">#define     G_STMT_START</pre><p>
Used within multi-statement macros so that they can be used in places where
only one statement is expected by the compiler.
</p></div><hr><div class="refsect2" lang="en"><a name="id2994263"></a><h3><a name="G-STMT-END-CAPS"></a>G_STMT_END</h3><a class="indexterm" name="id2994274"></a><pre class="programlisting">#define     G_STMT_END</pre><p>
Used within multi-statement macros so that they can be used in places where
only one statement is expected by the compiler.
</p></div><hr><div class="refsect2" lang="en"><a name="id2994291"></a><h3><a name="G-BEGIN-DECLS-CAPS"></a>G_BEGIN_DECLS</h3><a class="indexterm" name="id2994302"></a><pre class="programlisting">#define     G_BEGIN_DECLS</pre><p>
Used (along with <a href="glib-Miscellaneous-Macros.html#G-END-DECLS-CAPS"><span class="type">G_END_DECLS</span></a>) to bracket header files. If the
compiler in use is a C++ compiler, adds <tt class="literal">extern "C"</tt> 
around the header.
</p></div><hr><div class="refsect2" lang="en"><a name="id2994333"></a><h3><a name="G-END-DECLS-CAPS"></a>G_END_DECLS</h3><a class="indexterm" name="id2994344"></a><pre class="programlisting">#define     G_END_DECLS</pre><p>
Used (along with <a href="glib-Miscellaneous-Macros.html#G-BEGIN-DECLS-CAPS"><span class="type">G_BEGIN_DECLS</span></a>) to bracket header files. If the
compiler in use is a C++ compiler, adds <tt class="literal">extern "C"</tt> 
around the header.
</p></div><hr><div class="refsect2" lang="en"><a name="id2994374"></a><h3><a name="G-N-ELEMENTS-CAPS"></a>G_N_ELEMENTS()</h3><a class="indexterm" name="id2994385"></a><pre class="programlisting">#define G_N_ELEMENTS(arr)		(sizeof (arr) / sizeof ((arr)[0]))
</pre><p>
Determines the number of elements in an array. The array must be
declared so the compiler knows its size at compile-time; this 
macro will not work on an array allocated on the heap, only static
arrays or arrays on the stack.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>arr</tt></i> :</span></td><td>the array


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2994423"></a><h3><a name="G-VA-COPY-CAPS"></a>G_VA_COPY</h3><a class="indexterm" name="id2994434"></a><pre class="programlisting">#define     G_VA_COPY</pre><p>
Portable way to copy <span class="type">va_list</span> variables.
</p><p>
In order to use this function, you must include <tt class="filename">string.h</tt> 
yourself, because this macro may use <tt class="function"><tt class="function">memmove()</tt></tt> and GLib 
does not include <tt class="function">string.h</tt> for you.
</p></div><hr><div class="refsect2" lang="en"><a name="id2994485"></a><h3><a name="G-STRINGIFY-CAPS"></a>G_STRINGIFY()</h3><a class="indexterm" name="id2994496"></a><pre class="programlisting">#define G_STRINGIFY(macro_or_string)	G_STRINGIFY_ARG (macro_or_string)
</pre><p>
Accepts a macro or a string and converts it into a string.
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>macro_or_string</tt></i> :</span></td><td>a macro or a string.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2994531"></a><h3><a name="G-GNUC-EXTENSION-CAPS"></a>G_GNUC_EXTENSION</h3><a class="indexterm" name="id2994543"></a><pre class="programlisting">#define     G_GNUC_EXTENSION</pre><p>
Expands to <tt class="literal">__extension__</tt> when <span><b class="command">gcc</b></span> is 
used as the compiler.
This simply tells <span><b class="command">gcc</b></span> not to warn about the following non-standard code
when compiling with the <tt class="option">-pedantic</tt> option.
</p></div><hr><div class="refsect2" lang="en"><a name="id2994582"></a><h3><a name="G-GNUC-CONST-CAPS"></a>G_GNUC_CONST</h3><a class="indexterm" name="id2994592"></a><pre class="programlisting">#define     G_GNUC_CONST</pre><p>
Expands to the GNU C <tt class="literal">const</tt> function attribute if the compiler is <span><b class="command">gcc</b></span>.
Declaring a function as const enables better optimization of the function.
A const function doesn't examine any values except its parameters,
and has no effects except its return value.
See the GNU C documentation for details. 
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
A function that has pointer arguments and examines the data pointed to 
must <span class="emphasis"><em>not</em></span> be declared const. Likewise, a function that 
calls a non-const function usually must not be const. It doesn't make sense 
for a const function to return void.
</p></div></div><hr><div class="refsect2" lang="en"><a name="id2994636"></a><h3><a name="G-GNUC-DEPRECATED-CAPS"></a>G_GNUC_DEPRECATED</h3><a class="indexterm" name="id2994648"></a><pre class="programlisting">#define     G_GNUC_DEPRECATED</pre><p>
Expands to the GNU C <tt class="literal">deprecated</tt> attribute if the compiler 
is <span><b class="command">gcc</b></span>.
It can be used to mark typedefs, variables and functions as deprecated. 
When called with the <tt class="option">-Wdeprecated</tt> option, the compiler will 
generate warnings when deprecated interfaces are used.
See the GNU C documentation for details. 
</p><p>Since 2.2


</p></div><hr><div class="refsect2" lang="en"><a name="id2994687"></a><h3><a name="G-GNUC-NORETURN-CAPS"></a>G_GNUC_NORETURN</h3><a class="indexterm" name="id2994699"></a><pre class="programlisting">#define     G_GNUC_NORETURN</pre><p>
Expands to the GNU C <tt class="literal">noreturn</tt> function attribute if the 
compiler is <span><b class="command">gcc</b></span>.
It is used for declaring functions which never return.
It enables optimization of the function, and avoids possible compiler
warnings. See the GNU C documentation for details. 
</p></div><hr><div class="refsect2" lang="en"><a name="id2994729"></a><h3><a name="G-GNUC-UNUSED-CAPS"></a>G_GNUC_UNUSED</h3><a class="indexterm" name="id2994740"></a><pre class="programlisting">#define     G_GNUC_UNUSED</pre><p>
Expands to the GNU C <tt class="literal">unused</tt> function attribute if the compiler is <span><b class="command">gcc</b></span>.
It is used for declaring functions which may never be used.
It avoids possible compiler warnings. See the GNU C documentation for details. 
</p></div><hr><div class="refsect2" lang="en"><a name="id2994770"></a><h3><a name="G-GNUC-PURE-CAPS"></a>G_GNUC_PURE</h3><a class="indexterm" name="id2994782"></a><pre class="programlisting">#define     G_GNUC_PURE</pre><p>
Expands to the GNU C <tt class="literal">pure</tt> function attribute if the compiler is <span><b class="command">gcc</b></span>.
Declaring a function as pure enables better optimization of the function.
A pure function has no effects except its return value and the return 
value depends only on the parameters and/or global variables.
See the GNU C documentation for details. 
</p></div><hr><div class="refsect2" lang="en"><a name="id2994813"></a><h3><a name="G-GNUC-PRINTF-CAPS"></a>G_GNUC_PRINTF()</h3><a class="indexterm" name="id2994824"></a><pre class="programlisting">#define     G_GNUC_PRINTF( format_idx, arg_idx )</pre><p>
Expands to the GNU C <tt class="literal">format</tt> function attribute if the compiler is <span><b class="command">gcc</b></span>.
This is used for declaring functions which take a variable number of
arguments, with the same syntax as <tt class="function"><tt class="function">printf()</tt></tt>.
It allows the compiler to type-check the arguments passed to the function.
See the GNU C documentation for details. 
</p><div class="informalexample"><pre class="programlisting">
gint g_snprintf (gchar  *string,
                 gulong       n,
                 gchar const *format,
                 ...) G_GNUC_PRINTF (3, 4);
</pre></div><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>format_idx</tt></i> :</span></td><td>the index of the argument corresponding to the format string.
(The arguments are numbered from 1).
</td></tr><tr><td><span class="term"><i class="parameter"><tt>arg_idx</tt></i> :</span></td><td>the index of the first of the format arguments.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2994914"></a><h3><a name="G-GNUC-SCANF-CAPS"></a>G_GNUC_SCANF()</h3><a class="indexterm" name="id2994925"></a><pre class="programlisting">#define     G_GNUC_SCANF( format_idx, arg_idx )</pre><p>
Expands to the GNU C <tt class="literal">format</tt> function attribute if the compiler is <span><b class="command">gcc</b></span>.
This is used for declaring functions which take a variable number of
arguments, with the same syntax as <tt class="function"><tt class="function">scanf()</tt></tt>.
It allows the compiler to type-check the arguments passed to the function.
See the GNU C documentation for details. 
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>format_idx</tt></i> :</span></td><td>the index of the argument corresponding to the format string.
(The arguments are numbered from 1).
</td></tr><tr><td><span class="term"><i class="parameter"><tt>arg_idx</tt></i> :</span></td><td>the index of the first of the format arguments.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2995005"></a><h3><a name="G-GNUC-FORMAT-CAPS"></a>G_GNUC_FORMAT()</h3><a class="indexterm" name="id2995016"></a><pre class="programlisting">#define     G_GNUC_FORMAT( arg_idx )</pre><p>
Expands to the GNU C <tt class="literal">format_arg</tt> function attribute if the compiler is <span><b class="command">gcc</b></span>.
This function attribute specifies that a function takes a format
string for a <tt class="function"><tt class="function">printf()</tt></tt>, <tt class="function"><tt class="function">scanf()</tt></tt>, 
<tt class="function"><tt class="function">strftime()</tt></tt> or <tt class="function"><tt class="function">strfmon()</tt></tt> style
function and modifies it, so that the result can be passed to a 
<tt class="function"><tt class="function">printf()</tt></tt>, <tt class="function"><tt class="function">scanf()</tt></tt>, 
<tt class="function"><tt class="function">strftime()</tt></tt> or <tt class="function"><tt class="function">strfmon()</tt></tt> style 
function (with the remaining arguments to the format function the same as 
they would have been for the unmodified string). 
See the GNU C documentation for details. 
</p><div class="informalexample"><pre class="programlisting">
gchar *g_dgettext (gchar *domain_name, gchar *msgid) G_GNUC_FORMAT (2);
</pre></div><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>arg_idx</tt></i> :</span></td><td>the index of the argument.


</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2995185"></a><h3><a name="G-GNUC-FUNCTION-CAPS"></a>G_GNUC_FUNCTION</h3><a class="indexterm" name="id2995197"></a><pre class="programlisting">#define     G_GNUC_FUNCTION</pre><p>
Expands to the GNU C <tt class="literal">__FUNCTION__</tt> variable if the 
compiler is <span><b class="command">gcc</b></span>, or "" if it isn't. The GNU C 
<tt class="literal">__FUNCTION__</tt> variable contains the name of the 
current function. See the GNU C documentation for details. 
</p></div><hr><div class="refsect2" lang="en"><a name="id2995232"></a><h3><a name="G-GNUC-PRETTY-FUNCTION-CAPS"></a>G_GNUC_PRETTY_FUNCTION</h3><a class="indexterm" name="id2995243"></a><pre class="programlisting">#define     G_GNUC_PRETTY_FUNCTION</pre><p>
Expands to the GNU C <tt class="literal">__PRETTY_FUNCTION__</tt> variable 
if the compiler is <span><b class="command">gcc</b></span>, or "" if it isn't.
The GNU C <tt class="literal">__PRETTY_FUNCTION__</tt> variable contains the 
name of the current function. For a C program this is the same as the 
<tt class="literal">__FUNCTION__</tt> variable but for C++ it also includes 
extra information such as the class and function prototype. See the 
GNU C documentation for details. 
</p></div><hr><div class="refsect2" lang="en"><a name="id2995288"></a><h3><a name="G-GNUC-NO-INSTRUMENT-CAPS"></a>G_GNUC_NO_INSTRUMENT</h3><a class="indexterm" name="id2995299"></a><pre class="programlisting">#define     G_GNUC_NO_INSTRUMENT</pre><p>
Expands to the GNU C <tt class="literal">no_instrument_function</tt> function 
attribute if the compiler is <span><b class="command">gcc</b></span>. Functions with this 
attribute will not be 
instrumented for profiling, when the compiler is called with the
<tt class="option">-finstrument-functions</tt> option.
See the GNU C documentation for details. 
</p></div><hr><div class="refsect2" lang="en"><a name="id2995334"></a><h3><a name="G-LIKELY-CAPS"></a>G_LIKELY()</h3><a class="indexterm" name="id2995345"></a><pre class="programlisting">#define     G_LIKELY(expr)</pre><p>
Hints the compiler that the expression is likely to evaluate to a true
value. The compiler may use this information for optimizations.
</p><div class="informalexample"><pre class="programlisting">
if (G_LIKELY (<tt class="function">random()</tt> != 1))
  g_print ("not one");
</pre></div><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>expr</tt></i> :</span></td><td>the expression
</td></tr></tbody></table></div><p>Since 2.2


</p></div><hr><div class="refsect2" lang="en"><a name="id2995404"></a><h3><a name="G-UNLIKELY-CAPS"></a>G_UNLIKELY()</h3><a class="indexterm" name="id2995414"></a><pre class="programlisting">#define     G_UNLIKELY(expr)</pre><p>
Hints the compiler that the expression is unlikely to evaluate to a true
value. The compiler may use this information for optimizations.
</p><div class="informalexample"><pre class="programlisting">
if (G_UNLIKELY (<tt class="function">random()</tt> == 1))
  g_print ("a random one");
</pre></div><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>expr</tt></i> :</span></td><td>the expression
</td></tr></tbody></table></div><p>Since 2.2


</p></div><hr><div class="refsect2" lang="en"><a name="id2995473"></a><h3><a name="G-STRLOC-CAPS"></a>G_STRLOC</h3><a class="indexterm" name="id2995483"></a><pre class="programlisting">#define     G_STRLOC</pre><p>
Expands to a string identifying the current code position. 
</p></div><hr><div class="refsect2" lang="en"><a name="id2995499"></a><h3><a name="G-STRFUNC-CAPS"></a>G_STRFUNC</h3><a class="indexterm" name="id2995511"></a><pre class="programlisting">#define     G_STRFUNC</pre><p>

</p></div><hr><div class="refsect2" lang="en"><a name="id2995525"></a><h3><a name="G-GINT16-MODIFIER-CAPS"></a>G_GINT16_MODIFIER</h3><a class="indexterm" name="id2995537"></a><pre class="programlisting">#define G_GINT16_MODIFIER "h"
</pre><p>
The platform dependent length modifier for constructing <tt class="function">printf()</tt> conversion
specifiers for values of type <a href="glib-Basic-Types.html#gint16"><span class="type">gint16</span></a>. It is a string literal, but doesn't
include the percent-sign, such that you can add precision and length
modifiers between percent-sign and conversion specifier and append a 
conversion specifier.
</p><p>
The following example prints "0x7b";
</p><div class="informalexample"><pre class="programlisting">
gint16 value = 123;
g_print ("%#" G_GINT16_MODIFIER "x", value);
</pre></div><p>
</p><p>Since 2.4


</p></div><hr><div class="refsect2" lang="en"><a name="id2995594"></a><h3><a name="G-GINT16-FORMAT-CAPS"></a>G_GINT16_FORMAT</h3><a class="indexterm" name="id2995605"></a><pre class="programlisting">#define G_GINT16_FORMAT "hi"
</pre><p>
This is the platform dependent conversion specifier for scanning and
printing values of type <a href="glib-Basic-Types.html#gint16"><span class="type">gint16</span></a>. It is a string literal, but doesn't
include the percent-sign, such that you can add precision and length
modifiers between percent-sign and conversion specifier.
</p><p>
</p><div class="informalexample"><pre class="programlisting">
gint16 in;
gint32 out;
sscanf ("42", "%" G_GINT16_FORMAT, &amp;in)
out = in * 1000;
g_print ("%" G_GINT32_FORMAT, out);
</pre></div><p>
</p></div><hr><div class="refsect2" lang="en"><a name="id2995647"></a><h3><a name="G-GUINT16-FORMAT-CAPS"></a>G_GUINT16_FORMAT</h3><a class="indexterm" name="id2995658"></a><pre class="programlisting">#define G_GUINT16_FORMAT "hu"
</pre><p>
This is the platform dependent conversion specifier for scanning and
printing values of type <a href="glib-Basic-Types.html#guint16"><span class="type">guint16</span></a>. See also <a href="glib-Miscellaneous-Macros.html#G-GINT16-FORMAT-CAPS"><span class="type">G_GINT16_FORMAT</span></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id2995692"></a><h3><a name="G-GINT32-MODIFIER-CAPS"></a>G_GINT32_MODIFIER</h3><a class="indexterm" name="id2995703"></a><pre class="programlisting">#define G_GINT32_MODIFIER ""
</pre><p>
The platform dependent length modifier for constructing <tt class="function">printf()</tt> conversion
specifiers for values of type <a href="glib-Basic-Types.html#gint32"><span class="type">gint32</span></a>. See also <a href="glib-Miscellaneous-Macros.html#G-GINT16-MODIFIER-CAPS"><span class="type">G_GINT16_MODIFIER</span></a>.
</p><p>Since 2.4


</p></div><hr><div class="refsect2" lang="en"><a name="id2995751"></a><h3><a name="G-GINT32-FORMAT-CAPS"></a>G_GINT32_FORMAT</h3><a class="indexterm" name="id2995762"></a><pre class="programlisting">#define G_GINT32_FORMAT "i"
</pre><p>
This is the platform dependent conversion specifier for scanning and
printing values of type <a href="glib-Basic-Types.html#gint32"><span class="type">gint32</span></a>. See also <a href="glib-Miscellaneous-Macros.html#G-GINT16-FORMAT-CAPS"><span class="type">G_GINT16_FORMAT</span></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id2995796"></a><h3><a name="G-GUINT32-FORMAT-CAPS"></a>G_GUINT32_FORMAT</h3><a class="indexterm" name="id2995807"></a><pre class="programlisting">#define G_GUINT32_FORMAT "u"
</pre><p>
This is the platform dependent conversion specifier for scanning and
printing values of type <a href="glib-Basic-Types.html#guint32"><span class="type">guint32</span></a>. See also <a href="glib-Miscellaneous-Macros.html#G-GINT16-FORMAT-CAPS"><span class="type">G_GINT16_FORMAT</span></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id2995841"></a><h3><a name="G-GINT64-MODIFIER-CAPS"></a>G_GINT64_MODIFIER</h3><a class="indexterm" name="id2995852"></a><pre class="programlisting">#define G_GINT64_MODIFIER "ll"
</pre><p>
The platform dependent length modifier for constructing <tt class="function">printf()</tt> conversion
specifiers for values of type <a href="glib-Basic-Types.html#gint64"><span class="type">gint64</span></a>. See also <a href="glib-Miscellaneous-Macros.html#G-GINT16-MODIFIER-CAPS"><span class="type">G_GINT16_MODIFIER</span></a>.
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
Some platforms do not support printing 64 bit integers,
even though the types are supported. On such platforms <a href="glib-Miscellaneous-Macros.html#G-GINT64-MODIFIER-CAPS"><span class="type">G_GINT64_MODIFIER</span></a>
is not defined.
</p></div><p>Since 2.4


</p></div><hr><div class="refsect2" lang="en"><a name="id2995918"></a><h3><a name="G-GINT64-FORMAT-CAPS"></a>G_GINT64_FORMAT</h3><a class="indexterm" name="id2995929"></a><pre class="programlisting">#define G_GINT64_FORMAT "lli"
</pre><p>
This is the platform dependent conversion specifier for scanning and
printing values of type <a href="glib-Basic-Types.html#gint64"><span class="type">gint64</span></a>. See also <a href="glib-Miscellaneous-Macros.html#G-GINT16-FORMAT-CAPS"><span class="type">G_GINT16_FORMAT</span></a>.
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
Some platforms do not support scanning and printing 64 bit integers,
even though the types are supported. On such platforms <a href="glib-Miscellaneous-Macros.html#G-GINT64-FORMAT-CAPS"><span class="type">G_GINT64_FORMAT</span></a>
is not defined. Note that <tt class="function">scanf()</tt> may not support 64 bit integers, even
if <a href="glib-Miscellaneous-Macros.html#G-GINT64-FORMAT-CAPS"><span class="type">G_GINT64_FORMAT</span></a> is defined. Due to its weak error handling, <tt class="function">scanf()</tt> is not 
recommended for parsing anyway; consider using <tt class="function">g_strtoull()</tt> instead.
</p></div></div><hr><div class="refsect2" lang="en"><a name="id2996022"></a><h3><a name="G-GUINT64-FORMAT-CAPS"></a>G_GUINT64_FORMAT</h3><a class="indexterm" name="id2996034"></a><pre class="programlisting">#define G_GUINT64_FORMAT "llu"
</pre><p>
This is the platform dependent conversion specifier for scanning and
printing values of type <a href="glib-Basic-Types.html#guint64"><span class="type">guint64</span></a>. See also <a href="glib-Miscellaneous-Macros.html#G-GINT16-FORMAT-CAPS"><span class="type">G_GINT16_FORMAT</span></a>.
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
Some platforms do not support scanning and printing 64 bit integers,
even though the types are supported. On such platforms <a href="glib-Miscellaneous-Macros.html#G-GUINT64-FORMAT-CAPS"><span class="type">G_GUINT64_FORMAT</span></a>
is not defined.  Note that <tt class="function">scanf()</tt> may not support 64 bit integers, even
if <a href="glib-Miscellaneous-Macros.html#G-GINT64-FORMAT-CAPS"><span class="type">G_GINT64_FORMAT</span></a> is defined. Due to its weak error handling, <tt class="function">scanf()</tt> is not 
recommended for parsing anyway; consider using <tt class="function">g_strtoull()</tt> instead.
</p></div></div><hr><div class="refsect2" lang="en"><a name="id2996127"></a><h3><a name="G-GSIZE-MODIFIER-CAPS"></a>G_GSIZE_MODIFIER</h3><a class="indexterm" name="id2996138"></a><pre class="programlisting">#define G_GSIZE_MODIFIER ""
</pre><p>

</p></div><hr><div class="refsect2" lang="en"><a name="id2996154"></a><h3><a name="G-GSIZE-FORMAT-CAPS"></a>G_GSIZE_FORMAT</h3><a class="indexterm" name="id2996164"></a><pre class="programlisting">#define G_GSIZE_FORMAT "u"
</pre><p>

</p></div><hr><div class="refsect2" lang="en"><a name="id2996179"></a><h3><a name="G-GSSIZE-FORMAT-CAPS"></a>G_GSSIZE_FORMAT</h3><a class="indexterm" name="id2996191"></a><pre class="programlisting">#define G_GSSIZE_FORMAT "i"
</pre><p>

</p></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="glib-Numerical-Definitions.html"><b>&lt;&lt; Numerical Definitions</b></a></td><td align="right"><a accesskey="n" href="glib-Atomic-Operations.html"><b>Atomic Operations &gt;&gt;</b></a></td></tr></table></body></html>