blob: ec2512e43b446dfd96cfccfd5e3fbd23294cd5a7 [file] [log] [blame]
<!-- ##### SECTION Title ##### -->
Basic Types
<!-- ##### SECTION Short_Description ##### -->
standard GLib types, defined for ease-of-use and portability
<!-- ##### SECTION Long_Description ##### -->
<para>
GLib defines a number of commonly used types, which can be divided into
4 groups:
<itemizedlist>
<listitem><para>
New types which are not part of standard C - #gboolean, #gsize, #gssize.
</para></listitem>
<listitem><para>
Integer types which are guaranteed to be the same size across all platforms -
#gint8, #guint8, #gint16, #guint16, #gint32, #guint32, #gint64, #guint64.
</para></listitem>
<listitem><para>
Types which are easier to use than their standard C counterparts -
#gpointer, #gconstpointer, #guchar, #guint, #gushort, #gulong.
</para></listitem>
<listitem><para>
Types which correspond exactly to standard C types, but are included
for completeness - #gchar, #gint, #gshort, #glong, #gfloat, #gdouble.
</para></listitem>
</itemizedlist>
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### TYPEDEF gboolean ##### -->
<para>
A standard <type>boolean</type> type.
Variables of this type should only contain the value %TRUE or %FALSE.
</para>
<!-- ##### TYPEDEF gpointer ##### -->
<para>
An untyped pointer.
#gpointer looks better and is easier to use than <type>void*</type>.
</para>
<!-- ##### TYPEDEF gconstpointer ##### -->
<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>
<!-- ##### TYPEDEF gchar ##### -->
<para>
Corresponds to the standard C <type>char</type> type.
</para>
<!-- ##### TYPEDEF guchar ##### -->
<para>
Corresponds to the standard C <type>unsigned char</type> type.
</para>
<!-- ##### TYPEDEF gint ##### -->
<para>
Corresponds to the standard C <type>int</type> type.
Values of this type can range from #G_MININT to #G_MAXINT.
</para>
<!-- ##### TYPEDEF guint ##### -->
<para>
Corresponds to the standard C <type>unsigned int</type> type.
Values of this type can range from 0 to #G_MAXUINT.
</para>
<!-- ##### TYPEDEF gshort ##### -->
<para>
Corresponds to the standard C <type>short</type> type.
Values of this type can range from #G_MINSHORT to #G_MAXSHORT.
</para>
<!-- ##### TYPEDEF gushort ##### -->
<para>
Corresponds to the standard C <type>unsigned short</type> type.
Values of this type can range from 0 to #G_MAXUSHORT.
</para>
<!-- ##### TYPEDEF glong ##### -->
<para>
Corresponds to the standard C <type>long</type> type.
Values of this type can range from #G_MINLONG to #G_MAXLONG.
</para>
<!-- ##### TYPEDEF gulong ##### -->
<para>
Corresponds to the standard C <type>unsigned long</type> type.
Values of this type can range from 0 to #G_MAXULONG.
</para>
<!-- ##### FUNCTION guint64 ##### -->
<para>
An unsigned integer guaranteed to be 64 bits on all platforms.
Values of this type can range from 0 to 18,446,744,073,709,551,615.
</para>
@Returns:
<!-- ##### TYPEDEF gfloat ##### -->
<para>
Corresponds to the standard C <type>float</type> type.
Values of this type can range from -#G_MAXFLOAT to #G_MAXFLOAT.
</para>
<!-- ##### TYPEDEF gdouble ##### -->
<para>
Corresponds to the standard C <type>double</type> type.
Values of this type can range from -#G_MAXDOUBLE to #G_MAXDOUBLE.
</para>