<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN'
                      'http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd' [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="glib-Basic-Types">
<refmeta>
<refentrytitle role="top_of_page" id="glib-Basic-Types.top_of_page">Basic Types</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GLIB Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Basic Types</refname>
<refpurpose>standard GLib types, defined for ease-of-use
and portability</refpurpose>
</refnamediv>

<refsect1 id="glib-Basic-Types.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GINT64-CONSTANT:CAPS">G_GINT64_CONSTANT</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GUINT64-CONSTANT:CAPS">G_GUINT64_CONSTANT</link><phrase role="c_punctuation">()</phrase></entry></row>


<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GOFFSET-CONSTANT:CAPS">G_GOFFSET_CONSTANT</link><phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="glib-Basic-Types.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gboolean">gboolean</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gpointer">gpointer</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gconstpointer">gconstpointer</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gchar">gchar</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="guchar">guchar</link></entry></row>

<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gint">gint</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MININT:CAPS">G_MININT</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXINT:CAPS">G_MAXINT</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="guint">guint</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXUINT:CAPS">G_MAXUINT</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gshort">gshort</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MINSHORT:CAPS">G_MINSHORT</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXSHORT:CAPS">G_MAXSHORT</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gushort">gushort</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXUSHORT:CAPS">G_MAXUSHORT</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="glong">glong</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MINLONG:CAPS">G_MINLONG</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXLONG:CAPS">G_MAXLONG</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gulong">gulong</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXULONG:CAPS">G_MAXULONG</link></entry></row>

<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gint8">gint8</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MININT8:CAPS">G_MININT8</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXINT8:CAPS">G_MAXINT8</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="guint8">guint8</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXUINT8:CAPS">G_MAXUINT8</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gint16">gint16</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MININT16:CAPS">G_MININT16</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXINT16:CAPS">G_MAXINT16</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GINT16-MODIFIER:CAPS">G_GINT16_MODIFIER</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GINT16-FORMAT:CAPS">G_GINT16_FORMAT</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="guint16">guint16</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXUINT16:CAPS">G_MAXUINT16</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GUINT16-FORMAT:CAPS">G_GUINT16_FORMAT</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gint32">gint32</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MININT32:CAPS">G_MININT32</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXINT32:CAPS">G_MAXINT32</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GINT32-MODIFIER:CAPS">G_GINT32_MODIFIER</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GINT32-FORMAT:CAPS">G_GINT32_FORMAT</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="guint32">guint32</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXUINT32:CAPS">G_MAXUINT32</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GUINT32-FORMAT:CAPS">G_GUINT32_FORMAT</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gint64">gint64</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MININT64:CAPS">G_MININT64</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXINT64:CAPS">G_MAXINT64</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GINT64-MODIFIER:CAPS">G_GINT64_MODIFIER</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GINT64-FORMAT:CAPS">G_GINT64_FORMAT</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="guint64">guint64</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXUINT64:CAPS">G_MAXUINT64</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GUINT64-FORMAT:CAPS">G_GUINT64_FORMAT</link></entry></row>

<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gfloat">gfloat</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MINFLOAT:CAPS">G_MINFLOAT</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXFLOAT:CAPS">G_MAXFLOAT</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gdouble">gdouble</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MINDOUBLE:CAPS">G_MINDOUBLE</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXDOUBLE:CAPS">G_MAXDOUBLE</link></entry></row>

<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gsize">gsize</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXSIZE:CAPS">G_MAXSIZE</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GSIZE-MODIFIER:CAPS">G_GSIZE_MODIFIER</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GSIZE-FORMAT:CAPS">G_GSIZE_FORMAT</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gssize">gssize</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MINSSIZE:CAPS">G_MINSSIZE</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXSSIZE:CAPS">G_MAXSSIZE</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GSSIZE-MODIFIER:CAPS">G_GSSIZE_MODIFIER</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GSSIZE-FORMAT:CAPS">G_GSSIZE_FORMAT</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="goffset">goffset</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MINOFFSET:CAPS">G_MINOFFSET</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-MAXOFFSET:CAPS">G_MAXOFFSET</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GOFFSET-MODIFIER:CAPS">G_GOFFSET_MODIFIER</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GOFFSET-FORMAT:CAPS">G_GOFFSET_FORMAT</link></entry></row>

<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="gintptr">gintptr</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GINTPTR-MODIFIER:CAPS">G_GINTPTR_MODIFIER</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GINTPTR-FORMAT:CAPS">G_GINTPTR_FORMAT</link></entry></row>
<row><entry role="typedef_keyword">typedef</entry><entry role="function_name"><link linkend="guintptr">guintptr</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-GUINTPTR-FORMAT:CAPS">G_GUINTPTR_FORMAT</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>

<refsect1 id="glib-Basic-Types.includes"><title>Includes</title><synopsis>#include &lt;glib.h&gt;
</synopsis></refsect1>

<refsect1 id="glib-Basic-Types.description" role="desc">
<title role="desc.title">Description</title>
<para>GLib defines a number of commonly used types, which can be divided
into several groups:</para>
<itemizedlist>
<listitem><para>New types which are not part of standard C (but are defined in
various C standard library header files) — <link linkend="gboolean"><type>gboolean</type></link>, <link linkend="gssize"><type>gssize</type></link>.</para></listitem>
<listitem><para>Integer types which are guaranteed to be the same size across
all platforms — <link linkend="gint8"><type>gint8</type></link>, <link linkend="guint8"><type>guint8</type></link>, <link linkend="gint16"><type>gint16</type></link>, <link linkend="guint16"><type>guint16</type></link>, <link linkend="gint32"><type>gint32</type></link>,
<link linkend="guint32"><type>guint32</type></link>, <link linkend="gint64"><type>gint64</type></link>, <link linkend="guint64"><type>guint64</type></link>.</para></listitem>
<listitem><para>Types which are easier to use than their standard C counterparts -
<link linkend="gpointer"><type>gpointer</type></link>, <link linkend="gconstpointer"><type>gconstpointer</type></link>, <link linkend="guchar"><type>guchar</type></link>, <link linkend="guint"><type>guint</type></link>, <link linkend="gushort"><type>gushort</type></link>, <link linkend="gulong"><type>gulong</type></link>.</para></listitem>
<listitem><para>Types which correspond exactly to standard C types, but are
included for completeness — <link linkend="gchar"><type>gchar</type></link>, <link linkend="gint"><type>gint</type></link>, <link linkend="gshort"><type>gshort</type></link>, <link linkend="glong"><type>glong</type></link>,
<link linkend="gfloat"><type>gfloat</type></link>, <link linkend="gdouble"><type>gdouble</type></link>.</para></listitem>
<listitem>
<para>Types which correspond exactly to standard C99 types, but are available
to use even if your compiler does not support C99 — <link linkend="gsize"><type>gsize</type></link>, <link linkend="goffset"><type>goffset</type></link>,
<link linkend="gintptr"><type>gintptr</type></link>, <link linkend="guintptr"><type>guintptr</type></link>.</para>
</listitem>
</itemizedlist>
<para>GLib also defines macros for the limits of some of the standard
integer and floating point types, as well as macros for suitable
<link linkend="printf"><function>printf()</function></link> formats for these types.</para>
<para>Note that depending on the platform and build configuration, the format
macros might not be compatible with the system provided <link linkend="printf"><function>printf()</function></link> function,
because GLib might use a different <link linkend="printf"><function>printf()</function></link> implementation internally.
The format macros will always work with GLib API (like <link linkend="g-print"><function>g_print()</function></link>), and with
any C99 compatible <link linkend="printf"><function>printf()</function></link> implementation.</para>

</refsect1>
<refsect1 id="glib-Basic-Types.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="G-GINT64-CONSTANT:CAPS" role="macro">
<title>G_GINT64_CONSTANT()</title>
<indexterm zone="G-GINT64-CONSTANT:CAPS"><primary sortas="GINT64_CONSTANT">G_GINT64_CONSTANT</primary></indexterm>
<programlisting language="C">#define G_GINT64_CONSTANT(val)&#160;(val##L)
</programlisting>
<para>This macro is used to insert 64-bit integer literals
into the source code.</para>
<refsect3 id="G-GINT64-CONSTANT.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a literal integer value, e.g. 0x1d636b02300a7aa7</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="G-GUINT64-CONSTANT:CAPS" role="macro" condition="since:2.10">
<title>G_GUINT64_CONSTANT()</title>
<indexterm zone="G-GUINT64-CONSTANT:CAPS" role="2.10"><primary sortas="GUINT64_CONSTANT">G_GUINT64_CONSTANT</primary></indexterm>
<programlisting language="C">#define G_GUINT64_CONSTANT(val)&#160;(val##UL)
</programlisting>
<para>This macro is used to insert 64-bit unsigned integer
literals into the source code.</para>
<refsect3 id="G-GUINT64-CONSTANT.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a literal integer value, e.g. 0x1d636b02300a7aa7U</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.10">2.10</link></para></refsect2>
<refsect2 id="G-GOFFSET-CONSTANT:CAPS" role="macro" condition="since:2.20">
<title>G_GOFFSET_CONSTANT()</title>
<indexterm zone="G-GOFFSET-CONSTANT:CAPS" role="2.20"><primary sortas="GOFFSET_CONSTANT">G_GOFFSET_CONSTANT</primary></indexterm>
<programlisting language="C">#define G_GOFFSET_CONSTANT(val) G_GINT64_CONSTANT(val)
</programlisting>
<para>This macro is used to insert <link linkend="goffset"><type>goffset</type></link> 64-bit integer literals
into the source code.</para>
<para>See also <link linkend="G-GINT64-CONSTANT:CAPS"><type>G_GINT64_CONSTANT</type></link>.</para>
<refsect3 id="G-GOFFSET-CONSTANT.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a literal integer value, e.g. 0x1d636b02300a7aa7</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since: <link linkend="api-index-2.20">2.20</link></para></refsect2>

</refsect1>
<refsect1 id="glib-Basic-Types.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="gboolean" role="typedef">
<title>gboolean</title>
<indexterm zone="gboolean"><primary sortas="boolean">gboolean</primary></indexterm>
<programlisting language="C">typedef gint   gboolean;
</programlisting>
<para>A standard boolean type.
Variables of this type should only contain the value
<link linkend="TRUE:CAPS"><literal>TRUE</literal></link> or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>.</para>
<para>Never directly compare the contents of a <link linkend="gboolean"><type>gboolean</type></link> variable with the values
<link linkend="TRUE:CAPS"><literal>TRUE</literal></link> or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>. Use <literal>if (condition)</literal> to check a <link linkend="gboolean"><type>gboolean</type></link> is "true", instead
of <literal>if (condition == TRUE)</literal>. Likewise use <literal>if (!condition)</literal> to check a
<link linkend="gboolean"><type>gboolean</type></link> is "false".</para>
<para>There is no validation when assigning to a <link linkend="gboolean"><type>gboolean</type></link> variable and so it could
contain any value represented by a <link linkend="gint"><type>gint</type></link>. This is why the use of <literal>if
(condition)</literal> is recommended. All non-zero values in C evaluate to "true".</para>
</refsect2>
<refsect2 id="gpointer" role="typedef">
<title>gpointer</title>
<indexterm zone="gpointer"><primary sortas="pointer">gpointer</primary></indexterm>
<programlisting language="C">typedef void* gpointer;
</programlisting>
<para>An untyped pointer.
<link linkend="gpointer"><type>gpointer</type></link> looks better and is easier to use than void*.</para>
</refsect2>
<refsect2 id="gconstpointer" role="typedef">
<title>gconstpointer</title>
<indexterm zone="gconstpointer"><primary sortas="constpointer">gconstpointer</primary></indexterm>
<programlisting language="C">typedef const void *gconstpointer;
</programlisting>
<para>An untyped pointer to constant data.
The data pointed to should not be changed.</para>
<para>This is typically used in function prototypes to indicate
that the data pointed to will not be altered by the function.</para>
</refsect2>
<refsect2 id="gchar" role="typedef">
<title>gchar</title>
<indexterm zone="gchar"><primary sortas="char">gchar</primary></indexterm>
<programlisting language="C">typedef char   gchar;
</programlisting>
<para>Corresponds to the standard C char type.</para>
</refsect2>
<refsect2 id="guchar" role="typedef">
<title>guchar</title>
<indexterm zone="guchar"><primary sortas="uchar">guchar</primary></indexterm>
<programlisting language="C">typedef unsigned char   guchar;
</programlisting>
<para>Corresponds to the standard C unsigned char type.</para>
</refsect2>
<refsect2 id="gint" role="typedef">
<title>gint</title>
<indexterm zone="gint"><primary sortas="int">gint</primary></indexterm>
<programlisting language="C">typedef int    gint;
</programlisting>
<para>Corresponds to the standard C int type.
Values of this type can range from <link linkend="G-MININT:CAPS"><type>G_MININT</type></link> to <link linkend="G-MAXINT:CAPS"><type>G_MAXINT</type></link>.</para>
</refsect2>
<refsect2 id="G-MININT:CAPS" role="macro">
<title>G_MININT</title>
<indexterm zone="G-MININT:CAPS"><primary sortas="MININT">G_MININT</primary></indexterm>
<programlisting language="C">#define G_MININT&#160;INT_MIN
</programlisting>
<para>The minimum value which can be held in a <link linkend="gint"><type>gint</type></link>.</para>
</refsect2>
<refsect2 id="G-MAXINT:CAPS" role="macro">
<title>G_MAXINT</title>
<indexterm zone="G-MAXINT:CAPS"><primary sortas="MAXINT">G_MAXINT</primary></indexterm>
<programlisting language="C">#define G_MAXINT&#160;INT_MAX
</programlisting>
<para>The maximum value which can be held in a <link linkend="gint"><type>gint</type></link>.</para>
</refsect2>
<refsect2 id="guint" role="typedef">
<title>guint</title>
<indexterm zone="guint"><primary sortas="uint">guint</primary></indexterm>
<programlisting language="C">typedef unsigned int    guint;
</programlisting>
<para>Corresponds to the standard C unsigned int type.
Values of this type can range from 0 to <link linkend="G-MAXUINT:CAPS"><type>G_MAXUINT</type></link>.</para>
</refsect2>
<refsect2 id="G-MAXUINT:CAPS" role="macro">
<title>G_MAXUINT</title>
<indexterm zone="G-MAXUINT:CAPS"><primary sortas="MAXUINT">G_MAXUINT</primary></indexterm>
<programlisting language="C">#define G_MAXUINT&#160;UINT_MAX
</programlisting>
<para>The maximum value which can be held in a <link linkend="guint"><type>guint</type></link>.</para>
</refsect2>
<refsect2 id="gshort" role="typedef">
<title>gshort</title>
<indexterm zone="gshort"><primary sortas="short">gshort</primary></indexterm>
<programlisting language="C">typedef short  gshort;
</programlisting>
<para>Corresponds to the standard C short type.
Values of this type can range from <link linkend="G-MINSHORT:CAPS"><type>G_MINSHORT</type></link> to <link linkend="G-MAXSHORT:CAPS"><type>G_MAXSHORT</type></link>.</para>
</refsect2>
<refsect2 id="G-MINSHORT:CAPS" role="macro">
<title>G_MINSHORT</title>
<indexterm zone="G-MINSHORT:CAPS"><primary sortas="MINSHORT">G_MINSHORT</primary></indexterm>
<programlisting language="C">#define G_MINSHORT&#160;SHRT_MIN
</programlisting>
<para>The minimum value which can be held in a <link linkend="gshort"><type>gshort</type></link>.</para>
</refsect2>
<refsect2 id="G-MAXSHORT:CAPS" role="macro">
<title>G_MAXSHORT</title>
<indexterm zone="G-MAXSHORT:CAPS"><primary sortas="MAXSHORT">G_MAXSHORT</primary></indexterm>
<programlisting language="C">#define G_MAXSHORT&#160;SHRT_MAX
</programlisting>
<para>The maximum value which can be held in a <link linkend="gshort"><type>gshort</type></link>.</para>
</refsect2>
<refsect2 id="gushort" role="typedef">
<title>gushort</title>
<indexterm zone="gushort"><primary sortas="ushort">gushort</primary></indexterm>
<programlisting language="C">typedef unsigned short  gushort;
</programlisting>
<para>Corresponds to the standard C unsigned short type.
Values of this type can range from 0 to <link linkend="G-MAXUSHORT:CAPS"><type>G_MAXUSHORT</type></link>.</para>
</refsect2>
<refsect2 id="G-MAXUSHORT:CAPS" role="macro">
<title>G_MAXUSHORT</title>
<indexterm zone="G-MAXUSHORT:CAPS"><primary sortas="MAXUSHORT">G_MAXUSHORT</primary></indexterm>
<programlisting language="C">#define G_MAXUSHORT&#160;USHRT_MAX
</programlisting>
<para>The maximum value which can be held in a <link linkend="gushort"><type>gushort</type></link>.</para>
</refsect2>
<refsect2 id="glong" role="typedef">
<title>glong</title>
<indexterm zone="glong"><primary sortas="long">glong</primary></indexterm>
<programlisting language="C">typedef long   glong;
</programlisting>
<para>Corresponds to the standard C long type.
Values of this type can range from <link linkend="G-MINLONG:CAPS"><type>G_MINLONG</type></link> to <link linkend="G-MAXLONG:CAPS"><type>G_MAXLONG</type></link>.</para>
</refsect2>
<refsect2 id="G-MINLONG:CAPS" role="macro">
<title>G_MINLONG</title>
<indexterm zone="G-MINLONG:CAPS"><primary sortas="MINLONG">G_MINLONG</primary></indexterm>
<programlisting language="C">#define G_MINLONG&#160;LONG_MIN
</programlisting>
<para>The minimum value which can be held in a <link linkend="glong"><type>glong</type></link>.</para>
</refsect2>
<refsect2 id="G-MAXLONG:CAPS" role="macro">
<title>G_MAXLONG</title>
<indexterm zone="G-MAXLONG:CAPS"><primary sortas="MAXLONG">G_MAXLONG</primary></indexterm>
<programlisting language="C">#define G_MAXLONG&#160;LONG_MAX
</programlisting>
<para>The maximum value which can be held in a <link linkend="glong"><type>glong</type></link>.</para>
</refsect2>
<refsect2 id="gulong" role="typedef">
<title>gulong</title>
<indexterm zone="gulong"><primary sortas="ulong">gulong</primary></indexterm>
<programlisting language="C">typedef unsigned long   gulong;
</programlisting>
<para>Corresponds to the standard C unsigned long type.
Values of this type can range from 0 to <link linkend="G-MAXULONG:CAPS"><type>G_MAXULONG</type></link>.</para>
</refsect2>
<refsect2 id="G-MAXULONG:CAPS" role="macro">
<title>G_MAXULONG</title>
<indexterm zone="G-MAXULONG:CAPS"><primary sortas="MAXULONG">G_MAXULONG</primary></indexterm>
<programlisting language="C">#define G_MAXULONG&#160;ULONG_MAX
</programlisting>
<para>The maximum value which can be held in a <link linkend="gulong"><type>gulong</type></link>.</para>
</refsect2>
<refsect2 id="gint8" role="typedef">
<title>gint8</title>
<indexterm zone="gint8"><primary sortas="int8">gint8</primary></indexterm>
<programlisting language="C">typedef signed char gint8;
</programlisting>
<para>A signed integer guaranteed to be 8 bits on all platforms.
Values of this type can range from <link linkend="G-MININT8:CAPS"><type>G_MININT8</type></link> (= -128) to
<link linkend="G-MAXINT8:CAPS"><type>G_MAXINT8</type></link> (= 127).</para>
</refsect2>
<refsect2 id="G-MININT8:CAPS" role="macro" condition="since:2.4">
<title>G_MININT8</title>
<indexterm zone="G-MININT8:CAPS" role="2.4"><primary sortas="MININT8">G_MININT8</primary></indexterm>
<programlisting language="C">#define G_MININT8&#160;((gint8) (-G_MAXINT8 - 1))
</programlisting>
<para>The minimum value which can be held in a <link linkend="gint8"><type>gint8</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.4">2.4</link></para></refsect2>
<refsect2 id="G-MAXINT8:CAPS" role="macro" condition="since:2.4">
<title>G_MAXINT8</title>
<indexterm zone="G-MAXINT8:CAPS" role="2.4"><primary sortas="MAXINT8">G_MAXINT8</primary></indexterm>
<programlisting language="C">#define G_MAXINT8&#160;((gint8)  0x7f)
</programlisting>
<para>The maximum value which can be held in a <link linkend="gint8"><type>gint8</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.4">2.4</link></para></refsect2>
<refsect2 id="guint8" role="typedef">
<title>guint8</title>
<indexterm zone="guint8"><primary sortas="uint8">guint8</primary></indexterm>
<programlisting language="C">typedef unsigned char guint8;
</programlisting>
<para>An unsigned integer guaranteed to be 8 bits on all platforms.
Values of this type can range from 0 to <link linkend="G-MAXUINT8:CAPS"><type>G_MAXUINT8</type></link> (= 255).</para>
</refsect2>
<refsect2 id="G-MAXUINT8:CAPS" role="macro" condition="since:2.4">
<title>G_MAXUINT8</title>
<indexterm zone="G-MAXUINT8:CAPS" role="2.4"><primary sortas="MAXUINT8">G_MAXUINT8</primary></indexterm>
<programlisting language="C">#define G_MAXUINT8&#160;((guint8) 0xff)
</programlisting>
<para>The maximum value which can be held in a <link linkend="guint8"><type>guint8</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.4">2.4</link></para></refsect2>
<refsect2 id="gint16" role="typedef">
<title>gint16</title>
<indexterm zone="gint16"><primary sortas="int16">gint16</primary></indexterm>
<programlisting language="C">typedef signed short gint16;
</programlisting>
<para>A signed integer guaranteed to be 16 bits on all platforms.
Values of this type can range from <link linkend="G-MININT16:CAPS"><type>G_MININT16</type></link> (= -32,768) to
<link linkend="G-MAXINT16:CAPS"><type>G_MAXINT16</type></link> (= 32,767).</para>
<para>To print or scan values of this type, use
<link linkend="G-GINT16-MODIFIER:CAPS"><literal>G_GINT16_MODIFIER</literal></link> and/or <link linkend="G-GINT16-FORMAT:CAPS"><literal>G_GINT16_FORMAT</literal></link>.</para>
</refsect2>
<refsect2 id="G-MININT16:CAPS" role="macro" condition="since:2.4">
<title>G_MININT16</title>
<indexterm zone="G-MININT16:CAPS" role="2.4"><primary sortas="MININT16">G_MININT16</primary></indexterm>
<programlisting language="C">#define G_MININT16&#160;((gint16) (-G_MAXINT16 - 1))
</programlisting>
<para>The minimum value which can be held in a <link linkend="gint16"><type>gint16</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.4">2.4</link></para></refsect2>
<refsect2 id="G-MAXINT16:CAPS" role="macro" condition="since:2.4">
<title>G_MAXINT16</title>
<indexterm zone="G-MAXINT16:CAPS" role="2.4"><primary sortas="MAXINT16">G_MAXINT16</primary></indexterm>
<programlisting language="C">#define G_MAXINT16&#160;((gint16)  0x7fff)
</programlisting>
<para>The maximum value which can be held in a <link linkend="gint16"><type>gint16</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.4">2.4</link></para></refsect2>
<refsect2 id="G-GINT16-MODIFIER:CAPS" role="macro" condition="since:2.4">
<title>G_GINT16_MODIFIER</title>
<indexterm zone="G-GINT16-MODIFIER:CAPS" role="2.4"><primary sortas="GINT16_MODIFIER">G_GINT16_MODIFIER</primary></indexterm>
<programlisting language="C">#define G_GINT16_MODIFIER "h"
</programlisting>
<para>The platform dependent length modifier for conversion specifiers
for scanning and printing values of type <link linkend="gint16"><type>gint16</type></link> or <link linkend="guint16"><type>guint16</type></link>. 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.</para>
<para>The following example prints "0x7b";</para>
<informalexample><programlisting role="example"><![CDATA[
gint16 value = 123;
g_print ("%#" G_GINT16_MODIFIER "x", value);
]]></programlisting></informalexample>
<para></para>
<para role="since">Since: <link linkend="api-index-2.4">2.4</link></para></refsect2>
<refsect2 id="G-GINT16-FORMAT:CAPS" role="macro">
<title>G_GINT16_FORMAT</title>
<indexterm zone="G-GINT16-FORMAT:CAPS"><primary sortas="GINT16_FORMAT">G_GINT16_FORMAT</primary></indexterm>
<programlisting language="C">#define G_GINT16_FORMAT "hi"
</programlisting>
<para>This is the platform dependent conversion specifier for scanning and
printing values of type <link linkend="gint16"><type>gint16</type></link>. 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.</para>
<informalexample><programlisting role="example"><![CDATA[
gint16 in;
gint32 out;
sscanf ("42", "%" G_GINT16_FORMAT, &in)
out = in * 1000;
g_print ("%" G_GINT32_FORMAT, out);
]]></programlisting></informalexample>
<para></para>
</refsect2>
<refsect2 id="guint16" role="typedef">
<title>guint16</title>
<indexterm zone="guint16"><primary sortas="uint16">guint16</primary></indexterm>
<programlisting language="C">typedef unsigned short guint16;
</programlisting>
<para>An unsigned integer guaranteed to be 16 bits on all platforms.
Values of this type can range from 0 to <link linkend="G-MAXUINT16:CAPS"><type>G_MAXUINT16</type></link> (= 65,535).</para>
<para>To print or scan values of this type, use
<link linkend="G-GINT16-MODIFIER:CAPS"><literal>G_GINT16_MODIFIER</literal></link> and/or <link linkend="G-GUINT16-FORMAT:CAPS"><literal>G_GUINT16_FORMAT</literal></link>.</para>
</refsect2>
<refsect2 id="G-MAXUINT16:CAPS" role="macro" condition="since:2.4">
<title>G_MAXUINT16</title>
<indexterm zone="G-MAXUINT16:CAPS" role="2.4"><primary sortas="MAXUINT16">G_MAXUINT16</primary></indexterm>
<programlisting language="C">#define G_MAXUINT16&#160;((guint16) 0xffff)
</programlisting>
<para>The maximum value which can be held in a <link linkend="guint16"><type>guint16</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.4">2.4</link></para></refsect2>
<refsect2 id="G-GUINT16-FORMAT:CAPS" role="macro">
<title>G_GUINT16_FORMAT</title>
<indexterm zone="G-GUINT16-FORMAT:CAPS"><primary sortas="GUINT16_FORMAT">G_GUINT16_FORMAT</primary></indexterm>
<programlisting language="C">#define G_GUINT16_FORMAT "hu"
</programlisting>
<para>This is the platform dependent conversion specifier for scanning
and printing values of type <link linkend="guint16"><type>guint16</type></link>. See also <link linkend="G-GINT16-FORMAT:CAPS"><type>G_GINT16_FORMAT</type></link></para>
</refsect2>
<refsect2 id="gint32" role="typedef">
<title>gint32</title>
<indexterm zone="gint32"><primary sortas="int32">gint32</primary></indexterm>
<programlisting language="C">typedef signed int gint32;
</programlisting>
<para>A signed integer guaranteed to be 32 bits on all platforms.
Values of this type can range from <link linkend="G-MININT32:CAPS"><type>G_MININT32</type></link> (= -2,147,483,648)
to <link linkend="G-MAXINT32:CAPS"><type>G_MAXINT32</type></link> (= 2,147,483,647).</para>
<para>To print or scan values of this type, use
<link linkend="G-GINT32-MODIFIER:CAPS"><literal>G_GINT32_MODIFIER</literal></link> and/or <link linkend="G-GINT32-FORMAT:CAPS"><literal>G_GINT32_FORMAT</literal></link>.</para>
</refsect2>
<refsect2 id="G-MININT32:CAPS" role="macro" condition="since:2.4">
<title>G_MININT32</title>
<indexterm zone="G-MININT32:CAPS" role="2.4"><primary sortas="MININT32">G_MININT32</primary></indexterm>
<programlisting language="C">#define G_MININT32&#160;((gint32) (-G_MAXINT32 - 1))
</programlisting>
<para>The minimum value which can be held in a <link linkend="gint32"><type>gint32</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.4">2.4</link></para></refsect2>
<refsect2 id="G-MAXINT32:CAPS" role="macro" condition="since:2.4">
<title>G_MAXINT32</title>
<indexterm zone="G-MAXINT32:CAPS" role="2.4"><primary sortas="MAXINT32">G_MAXINT32</primary></indexterm>
<programlisting language="C">#define G_MAXINT32&#160;((gint32)  0x7fffffff)
</programlisting>
<para>The maximum value which can be held in a <link linkend="gint32"><type>gint32</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.4">2.4</link></para></refsect2>
<refsect2 id="G-GINT32-MODIFIER:CAPS" role="macro" condition="since:2.4">
<title>G_GINT32_MODIFIER</title>
<indexterm zone="G-GINT32-MODIFIER:CAPS" role="2.4"><primary sortas="GINT32_MODIFIER">G_GINT32_MODIFIER</primary></indexterm>
<programlisting language="C">#define G_GINT32_MODIFIER ""
</programlisting>
<para>The platform dependent length modifier for conversion specifiers
for scanning and printing values of type <link linkend="gint32"><type>gint32</type></link> or <link linkend="guint32"><type>guint32</type></link>. It
is a string literal. See also <link linkend="G-GINT16-MODIFIER:CAPS"><type>G_GINT16_MODIFIER</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.4">2.4</link></para></refsect2>
<refsect2 id="G-GINT32-FORMAT:CAPS" role="macro">
<title>G_GINT32_FORMAT</title>
<indexterm zone="G-GINT32-FORMAT:CAPS"><primary sortas="GINT32_FORMAT">G_GINT32_FORMAT</primary></indexterm>
<programlisting language="C">#define G_GINT32_FORMAT "i"
</programlisting>
<para>This is the platform dependent conversion specifier for scanning
and printing values of type <link linkend="gint32"><type>gint32</type></link>. See also <link linkend="G-GINT16-FORMAT:CAPS"><type>G_GINT16_FORMAT</type></link>.</para>
</refsect2>
<refsect2 id="guint32" role="typedef">
<title>guint32</title>
<indexterm zone="guint32"><primary sortas="uint32">guint32</primary></indexterm>
<programlisting language="C">typedef unsigned int guint32;
</programlisting>
<para>An unsigned integer guaranteed to be 32 bits on all platforms.
Values of this type can range from 0 to <link linkend="G-MAXUINT32:CAPS"><type>G_MAXUINT32</type></link> (= 4,294,967,295).</para>
<para>To print or scan values of this type, use
<link linkend="G-GINT32-MODIFIER:CAPS"><literal>G_GINT32_MODIFIER</literal></link> and/or <link linkend="G-GUINT32-FORMAT:CAPS"><literal>G_GUINT32_FORMAT</literal></link>.</para>
</refsect2>
<refsect2 id="G-MAXUINT32:CAPS" role="macro" condition="since:2.4">
<title>G_MAXUINT32</title>
<indexterm zone="G-MAXUINT32:CAPS" role="2.4"><primary sortas="MAXUINT32">G_MAXUINT32</primary></indexterm>
<programlisting language="C">#define G_MAXUINT32&#160;((guint32) 0xffffffff)
</programlisting>
<para>The maximum value which can be held in a <link linkend="guint32"><type>guint32</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.4">2.4</link></para></refsect2>
<refsect2 id="G-GUINT32-FORMAT:CAPS" role="macro">
<title>G_GUINT32_FORMAT</title>
<indexterm zone="G-GUINT32-FORMAT:CAPS"><primary sortas="GUINT32_FORMAT">G_GUINT32_FORMAT</primary></indexterm>
<programlisting language="C">#define G_GUINT32_FORMAT "u"
</programlisting>
<para>This is the platform dependent conversion specifier for scanning
and printing values of type <link linkend="guint32"><type>guint32</type></link>. See also <link linkend="G-GINT16-FORMAT:CAPS"><type>G_GINT16_FORMAT</type></link>.</para>
</refsect2>
<refsect2 id="gint64" role="typedef">
<title>gint64</title>
<indexterm zone="gint64"><primary sortas="int64">gint64</primary></indexterm>
<programlisting language="C">typedef signed long gint64;
</programlisting>
<para>A signed integer guaranteed to be 64 bits on all platforms.
Values of this type can range from <link linkend="G-MININT64:CAPS"><type>G_MININT64</type></link>
(= -9,223,372,036,854,775,808) to <link linkend="G-MAXINT64:CAPS"><type>G_MAXINT64</type></link>
(= 9,223,372,036,854,775,807).</para>
<para>To print or scan values of this type, use
<link linkend="G-GINT64-MODIFIER:CAPS"><literal>G_GINT64_MODIFIER</literal></link> and/or <link linkend="G-GINT64-FORMAT:CAPS"><literal>G_GINT64_FORMAT</literal></link>.</para>
</refsect2>
<refsect2 id="G-MININT64:CAPS" role="macro">
<title>G_MININT64</title>
<indexterm zone="G-MININT64:CAPS"><primary sortas="MININT64">G_MININT64</primary></indexterm>
<programlisting language="C">#define G_MININT64&#160;((gint64) (-G_MAXINT64 - G_GINT64_CONSTANT(1)))
</programlisting>
<para>The minimum value which can be held in a <link linkend="gint64"><type>gint64</type></link>.</para>
</refsect2>
<refsect2 id="G-MAXINT64:CAPS" role="macro">
<title>G_MAXINT64</title>
<indexterm zone="G-MAXINT64:CAPS"><primary sortas="MAXINT64">G_MAXINT64</primary></indexterm>
<programlisting language="C">#define G_MAXINT64&#160;G_GINT64_CONSTANT(0x7fffffffffffffff)
</programlisting>
<para>The maximum value which can be held in a <link linkend="gint64"><type>gint64</type></link>.</para>
</refsect2>
<refsect2 id="G-GINT64-MODIFIER:CAPS" role="macro" condition="since:2.4">
<title>G_GINT64_MODIFIER</title>
<indexterm zone="G-GINT64-MODIFIER:CAPS" role="2.4"><primary sortas="GINT64_MODIFIER">G_GINT64_MODIFIER</primary></indexterm>
<programlisting language="C">#define G_GINT64_MODIFIER "l"
</programlisting>
<para>The platform dependent length modifier for conversion specifiers
for scanning and printing values of type <link linkend="gint64"><type>gint64</type></link> or <link linkend="guint64"><type>guint64</type></link>.
It is a string literal.</para>
<para>Some platforms do not support printing 64-bit integers, even
though the types are supported. On such platforms <link linkend="G-GINT64-MODIFIER:CAPS"><literal>G_GINT64_MODIFIER</literal></link>
is not defined.</para>
<para role="since">Since: <link linkend="api-index-2.4">2.4</link></para></refsect2>
<refsect2 id="G-GINT64-FORMAT:CAPS" role="macro">
<title>G_GINT64_FORMAT</title>
<indexterm zone="G-GINT64-FORMAT:CAPS"><primary sortas="GINT64_FORMAT">G_GINT64_FORMAT</primary></indexterm>
<programlisting language="C">#define G_GINT64_FORMAT "li"
</programlisting>
<para>This is the platform dependent conversion specifier for scanning
and printing values of type <link linkend="gint64"><type>gint64</type></link>. See also <link linkend="G-GINT16-FORMAT:CAPS"><type>G_GINT16_FORMAT</type></link>.</para>
<para>Some platforms do not support scanning and printing 64-bit integers,
even though the types are supported. On such platforms <link linkend="G-GINT64-FORMAT:CAPS"><literal>G_GINT64_FORMAT</literal></link>
is not defined. Note that <link linkend="scanf"><function>scanf()</function></link> may not support 64-bit integers, even
if <link linkend="G-GINT64-FORMAT:CAPS"><literal>G_GINT64_FORMAT</literal></link> is defined. Due to its weak error handling, <link linkend="scanf"><function>scanf()</function></link>
is not recommended for parsing anyway; consider using <link linkend="g-ascii-strtoull"><function>g_ascii_strtoull()</function></link>
instead.</para>
</refsect2>
<refsect2 id="guint64" role="typedef">
<title>guint64</title>
<indexterm zone="guint64"><primary sortas="uint64">guint64</primary></indexterm>
<programlisting language="C">typedef unsigned long guint64;
</programlisting>
<para>An unsigned integer guaranteed to be 64-bits on all platforms.
Values of this type can range from 0 to <link linkend="G-MAXUINT64:CAPS"><type>G_MAXUINT64</type></link>
(= 18,446,744,073,709,551,615).</para>
<para>To print or scan values of this type, use
<link linkend="G-GINT64-MODIFIER:CAPS"><literal>G_GINT64_MODIFIER</literal></link> and/or <link linkend="G-GUINT64-FORMAT:CAPS"><literal>G_GUINT64_FORMAT</literal></link>.</para>
</refsect2>
<refsect2 id="G-MAXUINT64:CAPS" role="macro">
<title>G_MAXUINT64</title>
<indexterm zone="G-MAXUINT64:CAPS"><primary sortas="MAXUINT64">G_MAXUINT64</primary></indexterm>
<programlisting language="C">#define G_MAXUINT64&#160;G_GUINT64_CONSTANT(0xffffffffffffffff)
</programlisting>
<para>The maximum value which can be held in a <link linkend="guint64"><type>guint64</type></link>.</para>
</refsect2>
<refsect2 id="G-GUINT64-FORMAT:CAPS" role="macro">
<title>G_GUINT64_FORMAT</title>
<indexterm zone="G-GUINT64-FORMAT:CAPS"><primary sortas="GUINT64_FORMAT">G_GUINT64_FORMAT</primary></indexterm>
<programlisting language="C">#define G_GUINT64_FORMAT "lu"
</programlisting>
<para>This is the platform dependent conversion specifier for scanning
and printing values of type <link linkend="guint64"><type>guint64</type></link>. See also <link linkend="G-GINT16-FORMAT:CAPS"><type>G_GINT16_FORMAT</type></link>.</para>
<para>Some platforms do not support scanning and printing 64-bit integers,
even though the types are supported. On such platforms <link linkend="G-GUINT64-FORMAT:CAPS"><literal>G_GUINT64_FORMAT</literal></link>
is not defined.  Note that <link linkend="scanf"><function>scanf()</function></link> may not support 64-bit integers, even
if <link linkend="G-GINT64-FORMAT:CAPS"><literal>G_GINT64_FORMAT</literal></link> is defined. Due to its weak error handling, <link linkend="scanf"><function>scanf()</function></link>
is not recommended for parsing anyway; consider using <link linkend="g-ascii-strtoull"><function>g_ascii_strtoull()</function></link>
instead.</para>
</refsect2>
<refsect2 id="gfloat" role="typedef">
<title>gfloat</title>
<indexterm zone="gfloat"><primary sortas="float">gfloat</primary></indexterm>
<programlisting language="C">typedef float   gfloat;
</programlisting>
<para>Corresponds to the standard C float type.
Values of this type can range from -<link linkend="G-MAXFLOAT:CAPS"><type>G_MAXFLOAT</type></link> to <link linkend="G-MAXFLOAT:CAPS"><type>G_MAXFLOAT</type></link>.</para>
</refsect2>
<refsect2 id="G-MINFLOAT:CAPS" role="macro">
<title>G_MINFLOAT</title>
<indexterm zone="G-MINFLOAT:CAPS"><primary sortas="MINFLOAT">G_MINFLOAT</primary></indexterm>
<programlisting language="C">#define G_MINFLOAT&#160;FLT_MIN
</programlisting>
<para>The minimum positive value which can be held in a <link linkend="gfloat"><type>gfloat</type></link>.</para>
<para>If you are interested in the smallest value which can be held
in a <link linkend="gfloat"><type>gfloat</type></link>, use -<link linkend="G-MAXFLOAT:CAPS"><literal>G_MAXFLOAT</literal></link>.</para>
</refsect2>
<refsect2 id="G-MAXFLOAT:CAPS" role="macro">
<title>G_MAXFLOAT</title>
<indexterm zone="G-MAXFLOAT:CAPS"><primary sortas="MAXFLOAT">G_MAXFLOAT</primary></indexterm>
<programlisting language="C">#define G_MAXFLOAT&#160;FLT_MAX
</programlisting>
<para>The maximum value which can be held in a <link linkend="gfloat"><type>gfloat</type></link>.</para>
</refsect2>
<refsect2 id="gdouble" role="typedef">
<title>gdouble</title>
<indexterm zone="gdouble"><primary sortas="double">gdouble</primary></indexterm>
<programlisting language="C">typedef double  gdouble;
</programlisting>
<para>Corresponds to the standard C double type.
Values of this type can range from -<link linkend="G-MAXDOUBLE:CAPS"><type>G_MAXDOUBLE</type></link> to <link linkend="G-MAXDOUBLE:CAPS"><type>G_MAXDOUBLE</type></link>.</para>
</refsect2>
<refsect2 id="G-MINDOUBLE:CAPS" role="macro">
<title>G_MINDOUBLE</title>
<indexterm zone="G-MINDOUBLE:CAPS"><primary sortas="MINDOUBLE">G_MINDOUBLE</primary></indexterm>
<programlisting language="C">#define G_MINDOUBLE&#160;DBL_MIN
</programlisting>
<para>The minimum positive value which can be held in a <link linkend="gdouble"><type>gdouble</type></link>.</para>
<para>If you are interested in the smallest value which can be held
in a <link linkend="gdouble"><type>gdouble</type></link>, use -<link linkend="G-MAXDOUBLE:CAPS"><literal>G_MAXDOUBLE</literal></link>.</para>
</refsect2>
<refsect2 id="G-MAXDOUBLE:CAPS" role="macro">
<title>G_MAXDOUBLE</title>
<indexterm zone="G-MAXDOUBLE:CAPS"><primary sortas="MAXDOUBLE">G_MAXDOUBLE</primary></indexterm>
<programlisting language="C">#define G_MAXDOUBLE&#160;DBL_MAX
</programlisting>
<para>The maximum value which can be held in a <link linkend="gdouble"><type>gdouble</type></link>.</para>
</refsect2>
<refsect2 id="gsize" role="typedef">
<title>gsize</title>
<indexterm zone="gsize"><primary sortas="size">gsize</primary></indexterm>
<programlisting language="C">typedef unsigned long gsize;
</programlisting>
<para>An unsigned integer type of the result of the sizeof operator,
corresponding to the size_t type defined in C99.
This type is wide enough to hold the numeric value of a pointer,
so it is usually 32 bit wide on a 32-bit platform and 64 bit wide
on a 64-bit platform. Values of this type can range from 0 to
<link linkend="G-MAXSIZE:CAPS"><type>G_MAXSIZE</type></link>.</para>
<para>To print or scan values of this type, use
<link linkend="G-GSIZE-MODIFIER:CAPS"><literal>G_GSIZE_MODIFIER</literal></link> and/or <link linkend="G-GSIZE-FORMAT:CAPS"><literal>G_GSIZE_FORMAT</literal></link>.</para>
</refsect2>
<refsect2 id="G-MAXSIZE:CAPS" role="macro" condition="since:2.4">
<title>G_MAXSIZE</title>
<indexterm zone="G-MAXSIZE:CAPS" role="2.4"><primary sortas="MAXSIZE">G_MAXSIZE</primary></indexterm>
<programlisting language="C">#define G_MAXSIZE&#160;G_MAXULONG
</programlisting>
<para>The maximum value which can be held in a <link linkend="gsize"><type>gsize</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.4">2.4</link></para></refsect2>
<refsect2 id="G-GSIZE-MODIFIER:CAPS" role="macro" condition="since:2.6">
<title>G_GSIZE_MODIFIER</title>
<indexterm zone="G-GSIZE-MODIFIER:CAPS" role="2.6"><primary sortas="GSIZE_MODIFIER">G_GSIZE_MODIFIER</primary></indexterm>
<programlisting language="C">#define G_GSIZE_MODIFIER "l"
</programlisting>
<para>The platform dependent length modifier for conversion specifiers
for scanning and printing values of type <link linkend="gsize"><type>gsize</type></link>. It
is a string literal.</para>
<para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="G-GSIZE-FORMAT:CAPS" role="macro" condition="since:2.6">
<title>G_GSIZE_FORMAT</title>
<indexterm zone="G-GSIZE-FORMAT:CAPS" role="2.6"><primary sortas="GSIZE_FORMAT">G_GSIZE_FORMAT</primary></indexterm>
<programlisting language="C">#define G_GSIZE_FORMAT "lu"
</programlisting>
<para>This is the platform dependent conversion specifier for scanning
and printing values of type <link linkend="gsize"><type>gsize</type></link>. See also <link linkend="G-GINT16-FORMAT:CAPS"><type>G_GINT16_FORMAT</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="gssize" role="typedef">
<title>gssize</title>
<indexterm zone="gssize"><primary sortas="ssize">gssize</primary></indexterm>
<programlisting language="C">typedef signed long gssize;
</programlisting>
<para>A signed variant of <link linkend="gsize"><type>gsize</type></link>, corresponding to the
ssize_t defined on most platforms.
Values of this type can range from <link linkend="G-MINSSIZE:CAPS"><type>G_MINSSIZE</type></link>
to <link linkend="G-MAXSSIZE:CAPS"><type>G_MAXSSIZE</type></link>.</para>
<para>To print or scan values of this type, use
<link linkend="G-GSSIZE-MODIFIER:CAPS"><literal>G_GSSIZE_MODIFIER</literal></link> and/or <link linkend="G-GSSIZE-FORMAT:CAPS"><literal>G_GSSIZE_FORMAT</literal></link>.</para>
</refsect2>
<refsect2 id="G-MINSSIZE:CAPS" role="macro" condition="since:2.14">
<title>G_MINSSIZE</title>
<indexterm zone="G-MINSSIZE:CAPS" role="2.14"><primary sortas="MINSSIZE">G_MINSSIZE</primary></indexterm>
<programlisting language="C">#define G_MINSSIZE&#160;G_MINLONG
</programlisting>
<para>The minimum value which can be held in a <link linkend="gssize"><type>gssize</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-MAXSSIZE:CAPS" role="macro" condition="since:2.14">
<title>G_MAXSSIZE</title>
<indexterm zone="G-MAXSSIZE:CAPS" role="2.14"><primary sortas="MAXSSIZE">G_MAXSSIZE</primary></indexterm>
<programlisting language="C">#define G_MAXSSIZE&#160;G_MAXLONG
</programlisting>
<para>The maximum value which can be held in a <link linkend="gssize"><type>gssize</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-GSSIZE-MODIFIER:CAPS" role="macro" condition="since:2.6">
<title>G_GSSIZE_MODIFIER</title>
<indexterm zone="G-GSSIZE-MODIFIER:CAPS" role="2.6"><primary sortas="GSSIZE_MODIFIER">G_GSSIZE_MODIFIER</primary></indexterm>
<programlisting language="C">#define G_GSSIZE_MODIFIER "l"
</programlisting>
<para>The platform dependent length modifier for conversion specifiers
for scanning and printing values of type <link linkend="gssize"><type>gssize</type></link>. It
is a string literal.</para>
<para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="G-GSSIZE-FORMAT:CAPS" role="macro" condition="since:2.6">
<title>G_GSSIZE_FORMAT</title>
<indexterm zone="G-GSSIZE-FORMAT:CAPS" role="2.6"><primary sortas="GSSIZE_FORMAT">G_GSSIZE_FORMAT</primary></indexterm>
<programlisting language="C">#define G_GSSIZE_FORMAT "li"
</programlisting>
<para>This is the platform dependent conversion specifier for scanning
and printing values of type <link linkend="gssize"><type>gssize</type></link>. See also <link linkend="G-GINT16-FORMAT:CAPS"><type>G_GINT16_FORMAT</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.6">2.6</link></para></refsect2>
<refsect2 id="goffset" role="typedef" condition="since:2.14">
<title>goffset</title>
<indexterm zone="goffset" role="2.14"><primary sortas="offset">goffset</primary></indexterm>
<programlisting language="C">typedef gint64 goffset;
</programlisting>
<para>A signed integer type that is used for file offsets,
corresponding to the POSIX type <literal>off_t</literal> as if compiling with
<literal>_FILE_OFFSET_BITS</literal> set to 64. <link linkend="goffset"><type>goffset</type></link> is always 64 bits wide, even on
32-bit architectures.
Values of this type can range from <link linkend="G-MINOFFSET:CAPS"><type>G_MINOFFSET</type></link> to
<link linkend="G-MAXOFFSET:CAPS"><type>G_MAXOFFSET</type></link>.</para>
<para>To print or scan values of this type, use
<link linkend="G-GOFFSET-MODIFIER:CAPS"><literal>G_GOFFSET_MODIFIER</literal></link> and/or <link linkend="G-GOFFSET-FORMAT:CAPS"><literal>G_GOFFSET_FORMAT</literal></link>.</para>
<para role="since">Since: <link linkend="api-index-2.14">2.14</link></para></refsect2>
<refsect2 id="G-MINOFFSET:CAPS" role="macro">
<title>G_MINOFFSET</title>
<indexterm zone="G-MINOFFSET:CAPS"><primary sortas="MINOFFSET">G_MINOFFSET</primary></indexterm>
<programlisting language="C">#define G_MINOFFSET&#160;G_MININT64
</programlisting>
<para>The minimum value which can be held in a <link linkend="goffset"><type>goffset</type></link>.</para>
</refsect2>
<refsect2 id="G-MAXOFFSET:CAPS" role="macro">
<title>G_MAXOFFSET</title>
<indexterm zone="G-MAXOFFSET:CAPS"><primary sortas="MAXOFFSET">G_MAXOFFSET</primary></indexterm>
<programlisting language="C">#define G_MAXOFFSET&#160;G_MAXINT64
</programlisting>
<para>The maximum value which can be held in a <link linkend="goffset"><type>goffset</type></link>.</para>
</refsect2>
<refsect2 id="G-GOFFSET-MODIFIER:CAPS" role="macro" condition="since:2.20">
<title>G_GOFFSET_MODIFIER</title>
<indexterm zone="G-GOFFSET-MODIFIER:CAPS" role="2.20"><primary sortas="GOFFSET_MODIFIER">G_GOFFSET_MODIFIER</primary></indexterm>
<programlisting language="C">#define G_GOFFSET_MODIFIER      G_GINT64_MODIFIER
</programlisting>
<para>The platform dependent length modifier for conversion specifiers
for scanning and printing values of type <link linkend="goffset"><type>goffset</type></link>. It is a string
literal. See also <link linkend="G-GINT64-MODIFIER:CAPS"><type>G_GINT64_MODIFIER</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.20">2.20</link></para></refsect2>
<refsect2 id="G-GOFFSET-FORMAT:CAPS" role="macro" condition="since:2.20">
<title>G_GOFFSET_FORMAT</title>
<indexterm zone="G-GOFFSET-FORMAT:CAPS" role="2.20"><primary sortas="GOFFSET_FORMAT">G_GOFFSET_FORMAT</primary></indexterm>
<programlisting language="C">#define G_GOFFSET_FORMAT        G_GINT64_FORMAT
</programlisting>
<para>This is the platform dependent conversion specifier for scanning
and printing values of type <link linkend="goffset"><type>goffset</type></link>. See also <link linkend="G-GINT64-FORMAT:CAPS"><type>G_GINT64_FORMAT</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.20">2.20</link></para></refsect2>
<refsect2 id="gintptr" role="typedef" condition="since:2.18">
<title>gintptr</title>
<indexterm zone="gintptr" role="2.18"><primary sortas="intptr">gintptr</primary></indexterm>
<programlisting language="C">typedef signed long gintptr;
</programlisting>
<para>Corresponds to the C99 type intptr_t,
a signed integer type that can hold any pointer.</para>
<para>To print or scan values of this type, use
<link linkend="G-GINTPTR-MODIFIER:CAPS"><literal>G_GINTPTR_MODIFIER</literal></link> and/or <link linkend="G-GINTPTR-FORMAT:CAPS"><literal>G_GINTPTR_FORMAT</literal></link>.</para>
<para role="since">Since: <link linkend="api-index-2.18">2.18</link></para></refsect2>
<refsect2 id="G-GINTPTR-MODIFIER:CAPS" role="macro" condition="since:2.22">
<title>G_GINTPTR_MODIFIER</title>
<indexterm zone="G-GINTPTR-MODIFIER:CAPS" role="2.22"><primary sortas="GINTPTR_MODIFIER">G_GINTPTR_MODIFIER</primary></indexterm>
<programlisting language="C">#define G_GINTPTR_MODIFIER      "l"
</programlisting>
<para>The platform dependent length modifier for conversion specifiers
for scanning and printing values of type <link linkend="gintptr"><type>gintptr</type></link> or <link linkend="guintptr"><type>guintptr</type></link>.
It is a string literal.</para>
<para role="since">Since: <link linkend="api-index-2.22">2.22</link></para></refsect2>
<refsect2 id="G-GINTPTR-FORMAT:CAPS" role="macro" condition="since:2.22">
<title>G_GINTPTR_FORMAT</title>
<indexterm zone="G-GINTPTR-FORMAT:CAPS" role="2.22"><primary sortas="GINTPTR_FORMAT">G_GINTPTR_FORMAT</primary></indexterm>
<programlisting language="C">#define G_GINTPTR_FORMAT        "li"
</programlisting>
<para>This is the platform dependent conversion specifier for scanning
and printing values of type <link linkend="gintptr"><type>gintptr</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.22">2.22</link></para></refsect2>
<refsect2 id="guintptr" role="typedef" condition="since:2.18">
<title>guintptr</title>
<indexterm zone="guintptr" role="2.18"><primary sortas="uintptr">guintptr</primary></indexterm>
<programlisting language="C">typedef unsigned long guintptr;
</programlisting>
<para>Corresponds to the C99 type uintptr_t,
an unsigned integer type that can hold any pointer.</para>
<para>To print or scan values of this type, use
<link linkend="G-GINTPTR-MODIFIER:CAPS"><literal>G_GINTPTR_MODIFIER</literal></link> and/or <link linkend="G-GUINTPTR-FORMAT:CAPS"><literal>G_GUINTPTR_FORMAT</literal></link>.</para>
<para role="since">Since: <link linkend="api-index-2.18">2.18</link></para></refsect2>
<refsect2 id="G-GUINTPTR-FORMAT:CAPS" role="macro" condition="since:2.22">
<title>G_GUINTPTR_FORMAT</title>
<indexterm zone="G-GUINTPTR-FORMAT:CAPS" role="2.22"><primary sortas="GUINTPTR_FORMAT">G_GUINTPTR_FORMAT</primary></indexterm>
<programlisting language="C">#define G_GUINTPTR_FORMAT       "lu"
</programlisting>
<para>This is the platform dependent conversion specifier
for scanning and printing values of type <link linkend="guintptr"><type>guintptr</type></link>.</para>
<para role="since">Since: <link linkend="api-index-2.22">2.22</link></para></refsect2>

</refsect1>

</refentry>
