⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 glib-basic-types.html

📁 最新gtk中文资料集
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"><title>Basic Types</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="GLib Reference Manual"><link rel="up" href="glib-fundamentals.html" title="GLib Fundamentals"><link rel="prev" href="glib-Version-Information.html" title="Version Information"><link rel="next" href="glib-Limits-of-Basic-Types.html" title="Limits of Basic Types"><meta name="generator" content="GTK-Doc V1.9 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="chapter" href="glib.html" title="GLib Overview"><link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals"><link rel="chapter" href="glib-core.html" title="GLib Core Application Support"><link rel="chapter" href="glib-utilities.html" title="GLib Utilities"><link rel="chapter" href="glib-data-types.html" title="GLib Data Types"><link rel="chapter" href="tools.html" title="GLib Tools"><link rel="index" href="ix01.html" title="Index"><link rel="index" href="ix02.html" title="Index of deprecated symbols"><link rel="index" href="ix03.html" title="Index of new symbols in 2.2"><link rel="index" href="ix04.html" title="Index of new symbols in 2.4"><link rel="index" href="ix05.html" title="Index of new symbols in 2.6"><link rel="index" href="ix06.html" title="Index of new symbols in 2.8"><link rel="index" href="ix07.html" title="Index of new symbols in 2.10"><link rel="index" href="ix08.html" title="Index of new symbols in 2.12"><link rel="index" href="ix09.html" title="Index of new symbols in 2.14"><link rel="index" href="ix10.html" title="Index of new symbols in 2.16"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="glib-Version-Information.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-Limits-of-Basic-Types.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr><tr><td colspan="5" class="shortcuts"><nobr><a href="#id2823819" class="shortcut">Top</a>                  &#160;|&#160;                  <a href="#id2824058" class="shortcut">Description</a></nobr></td></tr></table><div class="refentry" lang="en"><a name="glib-Basic-Types"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><a name="id2823819"></a><span class="refentrytitle">Basic Types</span></h2><p>Basic Types &#8212; standard GLib types, defined for ease-of-use and portability</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">#include &lt;glib.h&gt;typedef             <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>;typedef             <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>;typedef             <a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a>;typedef             <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>;typedef             <a class="link" href="glib-Basic-Types.html#guchar">guchar</a>;typedef             <a class="link" href="glib-Basic-Types.html#gint">gint</a>;typedef             <a class="link" href="glib-Basic-Types.html#guint">guint</a>;typedef             <a class="link" href="glib-Basic-Types.html#gshort">gshort</a>;typedef             <a class="link" href="glib-Basic-Types.html#gushort">gushort</a>;typedef             <a class="link" href="glib-Basic-Types.html#glong">glong</a>;typedef             <a class="link" href="glib-Basic-Types.html#gulong">gulong</a>;typedef             <a class="link" href="glib-Basic-Types.html#gint8">gint8</a>;typedef             <a class="link" href="glib-Basic-Types.html#guint8">guint8</a>;typedef             <a class="link" href="glib-Basic-Types.html#gint16">gint16</a>;typedef             <a class="link" href="glib-Basic-Types.html#guint16">guint16</a>;typedef             <a class="link" href="glib-Basic-Types.html#gint32">gint32</a>;typedef             <a class="link" href="glib-Basic-Types.html#guint32">guint32</a>;#define             <a class="link" href="glib-Basic-Types.html#G-HAVE-GINT64:CAPS">G_HAVE_GINT64</a>typedef             <a class="link" href="glib-Basic-Types.html#gint64">gint64</a>;GLIB_VAR            <a class="link" href="glib-Basic-Types.html#guint64">guint64</a>                             ();#define             <a class="link" href="glib-Basic-Types.html#G-GINT64-CONSTANT:CAPS">G_GINT64_CONSTANT</a>                   (val)#define             <a class="link" href="glib-Basic-Types.html#G-GUINT64-CONSTANT:CAPS">G_GUINT64_CONSTANT</a>                  (val)typedef             <a class="link" href="glib-Basic-Types.html#gfloat">gfloat</a>;typedef             <a class="link" href="glib-Basic-Types.html#gdouble">gdouble</a>;typedef             <a class="link" href="glib-Basic-Types.html#gsize">gsize</a>;typedef             <a class="link" href="glib-Basic-Types.html#gssize">gssize</a>;typedef             <a class="link" href="glib-Basic-Types.html#goffset">goffset</a>;</pre></div><div class="refsect1" lang="en"><a name="id2824058"></a><h2>Description</h2><p>GLib defines a number of commonly used types, which can be divided into4 groups:</p><div class="itemizedlist"><ul type="disc"><li><p>New types which are not part of standard C - <a class="link" href="glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>, <a class="link" href="glib-Basic-Types.html#gsize"><span class="type">gsize</span></a>, <a class="link" href="glib-Basic-Types.html#gssize"><span class="type">gssize</span></a>.</p></li><li><p>Integer types which are guaranteed to be the same size across all platforms -<a class="link" href="glib-Basic-Types.html#gint8"><span class="type">gint8</span></a>, <a class="link" href="glib-Basic-Types.html#guint8"><span class="type">guint8</span></a>, <a class="link" href="glib-Basic-Types.html#gint16"><span class="type">gint16</span></a>, <a class="link" href="glib-Basic-Types.html#guint16"><span class="type">guint16</span></a>, <a class="link" href="glib-Basic-Types.html#gint32"><span class="type">gint32</span></a>, <a class="link" href="glib-Basic-Types.html#guint32"><span class="type">guint32</span></a>, <a class="link" href="glib-Basic-Types.html#gint64"><span class="type">gint64</span></a>, <a class="link" href="glib-Basic-Types.html#guint64"><span class="type">guint64</span></a>.</p></li><li><p>Types which are easier to use than their standard C counterparts -<a class="link" href="glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>, <a class="link" href="glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a>, <a class="link" href="glib-Basic-Types.html#guchar"><span class="type">guchar</span></a>, <a class="link" href="glib-Basic-Types.html#guint"><span class="type">guint</span></a>, <a class="link" href="glib-Basic-Types.html#gushort"><span class="type">gushort</span></a>, <a class="link" href="glib-Basic-Types.html#gulong"><span class="type">gulong</span></a>.</p></li><li><p>Types which correspond exactly to standard C types, but are includedfor completeness - <a class="link" href="glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>, <a class="link" href="glib-Basic-Types.html#gint"><span class="type">gint</span></a>, <a class="link" href="glib-Basic-Types.html#gshort"><span class="type">gshort</span></a>, <a class="link" href="glib-Basic-Types.html#glong"><span class="type">glong</span></a>, <a class="link" href="glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a>, <a class="link" href="glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a>.</p></li></ul></div><p></p></div><div class="refsect1" lang="en"><a name="id2824277"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2824288"></a><h3><a name="gboolean"></a>gboolean</h3><a class="indexterm" name="id2824300"></a><pre class="programlisting">typedef gint   gboolean;</pre><p>A standard <span class="type">boolean</span> type.Variables of this type should only contain the value <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> or <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</p></div><hr><div class="refsect2" lang="en"><a name="id2824341"></a><h3><a name="gpointer"></a>gpointer</h3><a class="indexterm" name="id2824353"></a><pre class="programlisting">typedef void* gpointer;</pre><p>An untyped pointer.<a class="link" href="glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> looks better and is easier to use than <span class="type">void*</span>.</p></div><hr><div class="refsect2" lang="en"><a name="id2824380"></a><h3><a name="gconstpointer"></a>gconstpointer</h3><a class="indexterm" name="id2824393"></a><pre class="programlisting">typedef const void *gconstpointer;</pre><p>An untyped pointer to constant data.The data pointed to should not be changed.</p><p>This is typically used in function prototypes to indicate that thedata pointed to will not be altered by the function.</p></div><hr><div class="refsect2" lang="en"><a name="id2824415"></a><h3><a name="gchar"></a>gchar</h3><a class="indexterm" name="id2824427"></a><pre class="programlisting">typedef char   gchar;</pre><p>Corresponds to the standard C <span class="type">char</span> type.</p></div><hr><div class="refsect2" lang="en"><a name="id2824446"></a><h3><a name="guchar"></a>guchar</h3><a class="indexterm" name="id2824458"></a><pre class="programlisting">typedef unsigned char   guchar;</pre><p>Corresponds to the standard C <span class="type">unsigned char</span> type.</p></div><hr><div class="refsect2" lang="en"><a name="id2824478"></a><h3><a name="gint"></a>gint</h3><a class="indexterm" name="id2824490"></a><pre class="programlisting">typedef int    gint;</pre><p>Corresponds to the standard C <span class="type">int</span> type.Values of this type can range from <a class="link" href="glib-Limits-of-Basic-Types.html#G-MININT:CAPS"><span class="type">G_MININT</span></a> to <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXINT:CAPS"><span class="type">G_MAXINT</span></a>.</p></div><hr><div class="refsect2" lang="en"><a name="id2824528"></a><h3><a name="guint"></a>guint</h3><a class="indexterm" name="id2824540"></a><pre class="programlisting">typedef unsigned int    guint;</pre><p>Corresponds to the standard C <span class="type">unsigned int</span> type.Values of this type can range from 0 to <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUINT:CAPS"><span class="type">G_MAXUINT</span></a>.</p></div><hr><div class="refsect2" lang="en"><a name="id2824570"></a><h3><a name="gshort"></a>gshort</h3><a class="indexterm" name="id2824582"></a><pre class="programlisting">typedef short  gshort;</pre><p>Corresponds to the standard C <span class="type">short</span> type.Values of this type can range from <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINSHORT:CAPS"><span class="type">G_MINSHORT</span></a> to <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXSHORT:CAPS"><span class="type">G_MAXSHORT</span></a>.</p></div><hr><div class="refsect2" lang="en"><a name="id2824619"></a><h3><a name="gushort"></a>gushort</h3><a class="indexterm" name="id2824631"></a><pre class="programlisting">typedef unsigned short  gushort;</pre><p>Corresponds to the standard C <span class="type">unsigned short</span> type.Values of this type can range from 0 to <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUSHORT:CAPS"><span class="type">G_MAXUSHORT</span></a>.</p></div><hr><div class="refsect2" lang="en"><a name="id2824661"></a><h3><a name="glong"></a>glong</h3><a class="indexterm" name="id2824673"></a><pre class="programlisting">typedef long   glong;</pre><p>Corresponds to the standard C <span class="type">long</span> type.Values of this type can range from <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINLONG:CAPS"><span class="type">G_MINLONG</span></a> to <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXLONG:CAPS"><span class="type">G_MAXLONG</span></a>.</p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -