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

📄 glib-standard-macros.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>Standard Macros</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-Limits-of-Basic-Types.html" title="Limits of Basic Types"><link rel="next" href="glib-Type-Conversion-Macros.html" title="Type Conversion Macros"><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-Limits-of-Basic-Types.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-Type-Conversion-Macros.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="#id2829964" class="shortcut">Top</a>                  &#160;|&#160;                  <a href="#id2830146" class="shortcut">Description</a></nobr></td></tr></table><div class="refentry" lang="en"><a name="glib-Standard-Macros"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><a name="id2829964"></a><span class="refentrytitle">Standard Macros</span></h2><p>Standard Macros &#8212; commonly-used macros.</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;#define             <a class="link" href="glib-Standard-Macros.html#G-OS-WIN32:CAPS">G_OS_WIN32</a>#define             <a class="link" href="glib-Standard-Macros.html#G-OS-BEOS:CAPS">G_OS_BEOS</a>#define             <a class="link" href="glib-Standard-Macros.html#G-OS-UNIX:CAPS">G_OS_UNIX</a>#define             <a class="link" href="glib-Standard-Macros.html#G-DIR-SEPARATOR:CAPS">G_DIR_SEPARATOR</a>#define             <a class="link" href="glib-Standard-Macros.html#G-DIR-SEPARATOR-S:CAPS">G_DIR_SEPARATOR_S</a>#define             <a class="link" href="glib-Standard-Macros.html#G-IS-DIR-SEPARATOR:CAPS">G_IS_DIR_SEPARATOR</a>                  (c)#define             <a class="link" href="glib-Standard-Macros.html#G-SEARCHPATH-SEPARATOR:CAPS">G_SEARCHPATH_SEPARATOR</a>#define             <a class="link" href="glib-Standard-Macros.html#G-SEARCHPATH-SEPARATOR-S:CAPS">G_SEARCHPATH_SEPARATOR_S</a>#define             <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS">TRUE</a>#define             <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS">FALSE</a>#define             <a class="link" href="glib-Standard-Macros.html#NULL:CAPS">NULL</a>#define             <a class="link" href="glib-Standard-Macros.html#MIN:CAPS">MIN</a>                                 (a, b)#define             <a class="link" href="glib-Standard-Macros.html#MAX:CAPS">MAX</a>                                 (a, b)#define             <a class="link" href="glib-Standard-Macros.html#ABS:CAPS">ABS</a>                                 (a)#define             <a class="link" href="glib-Standard-Macros.html#CLAMP:CAPS">CLAMP</a>                               (x, low, high)#define             <a class="link" href="glib-Standard-Macros.html#G-STRUCT-MEMBER:CAPS">G_STRUCT_MEMBER</a>                     (member_type, struct_p, struct_offset)#define             <a class="link" href="glib-Standard-Macros.html#G-STRUCT-MEMBER-P:CAPS">G_STRUCT_MEMBER_P</a>                   (struct_p, struct_offset)#define             <a class="link" href="glib-Standard-Macros.html#G-STRUCT-OFFSET:CAPS">G_STRUCT_OFFSET</a>                     (struct_type, member)#define             <a class="link" href="glib-Standard-Macros.html#G-MEM-ALIGN:CAPS">G_MEM_ALIGN</a>#define             <a class="link" href="glib-Standard-Macros.html#G-CONST-RETURN:CAPS">G_CONST_RETURN</a></pre></div><div class="refsect1" lang="en"><a name="id2830146"></a><h2>Description</h2><p>These macros provide a few commonly-used features.</p></div><div class="refsect1" lang="en"><a name="id2830162"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2830172"></a><h3><a name="G-OS-WIN32:CAPS"></a>G_OS_WIN32</h3><a class="indexterm" name="id2830184"></a><pre class="programlisting">#define G_OS_WIN32</pre><p>This macro is defined only on Windows. So you can bracketWindows-specific code in "#ifdef G_OS_WIN32".</p></div><hr><div class="refsect2" lang="en"><a name="id2830208"></a><h3><a name="G-OS-BEOS:CAPS"></a>G_OS_BEOS</h3><a class="indexterm" name="id2830214"></a><pre class="programlisting">#define G_OS_BEOS</pre><p>This macro is defined only on BeOS. So you can bracketBeOS-specific code in "#ifdef G_OS_BEOS".</p></div><hr><div class="refsect2" lang="en"><a name="id2830228"></a><h3><a name="G-OS-UNIX:CAPS"></a>G_OS_UNIX</h3><a class="indexterm" name="id2830243"></a><pre class="programlisting">#define G_OS_UNIX</pre><p>This macro is defined only on UNIX. So you can bracketUNIX-specific code in "#ifdef G_OS_UNIX".</p></div><hr><div class="refsect2" lang="en"><a name="id2830260"></a><h3><a name="G-DIR-SEPARATOR:CAPS"></a>G_DIR_SEPARATOR</h3><a class="indexterm" name="id2830276"></a><pre class="programlisting">#define             G_DIR_SEPARATOR</pre><p>The directory separator character.This is '/' on UNIX machines and '\' under Windows.</p></div><hr><div class="refsect2" lang="en"><a name="id2830293"></a><h3><a name="G-DIR-SEPARATOR-S:CAPS"></a>G_DIR_SEPARATOR_S</h3><a class="indexterm" name="id2830305"></a><pre class="programlisting">#define             G_DIR_SEPARATOR_S</pre><p>The directory separator as a string.This is "/" on UNIX machines and "\" under Windows.</p></div><hr><div class="refsect2" lang="en"><a name="id2830322"></a><h3><a name="G-IS-DIR-SEPARATOR:CAPS"></a>G_IS_DIR_SEPARATOR()</h3><a class="indexterm" name="id2830336"></a><pre class="programlisting">#define             G_IS_DIR_SEPARATOR(c)</pre><p>Checks whether a character is a directory separator. It returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> for '/' on UNIXmachines and for '\' or '/' under Windows.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>c</code></em>&#160;:</span></p></td><td>a character</td></tr></tbody></table></div><p class="since">Since 2.6</p></div><hr><div class="refsect2" lang="en"><a name="id2830389"></a><h3><a name="G-SEARCHPATH-SEPARATOR:CAPS"></a>G_SEARCHPATH_SEPARATOR</h3><a class="indexterm" name="id2830402"></a><pre class="programlisting">#define             G_SEARCHPATH_SEPARATOR</pre><p>The search path separator character.This is ':' on UNIX machines and ';' under Windows.</p></div><hr><div class="refsect2" lang="en"><a name="id2830419"></a><h3><a name="G-SEARCHPATH-SEPARATOR-S:CAPS"></a>G_SEARCHPATH_SEPARATOR_S</h3><a class="indexterm" name="id2830433"></a><pre class="programlisting">#define             G_SEARCHPATH_SEPARATOR_S</pre><p>The search path separator as a string.This is ":" on UNIX machines and ";" under Windows.</p></div><hr><div class="refsect2" lang="en"><a name="id2830450"></a><h3><a name="TRUE:CAPS"></a>TRUE</h3><a class="indexterm" name="id2830462"></a><pre class="programlisting">#define	TRUE	(!FALSE)</pre><p>Defines the <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> value for the <a class="link" href="glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> type.</p></div><hr><div class="refsect2" lang="en"><a name="id2830496"></a><h3><a name="FALSE:CAPS"></a>FALSE</h3><a class="indexterm" name="id2830508"></a><pre class="programlisting">#define	FALSE	(0)</pre><p>Defines the <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> value for the <a class="link" href="glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> type.</p></div><hr><div class="refsect2" lang="en"><a name="id2830542"></a><h3><a name="NULL:CAPS"></a>NULL</h3><a class="indexterm" name="id2830554"></a><pre class="programlisting">#define             NULL</pre><p>Defines the standard <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> pointer.</p></div><hr><div class="refsect2" lang="en"><a name="id2830580"></a><h3><a name="MIN:CAPS"></a>MIN()</h3><a class="indexterm" name="id2830593"></a><pre class="programlisting">#define MIN(a, b)  (((a) &lt; (b)) ? (a) : (b))</pre><p>Calculates the minimum of <em class="parameter"><code>a</code></em> and <em class="parameter"><code>b</code></em>.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>a</code></em>&#160;:</span></p></td><td>a numeric value.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>b</code></em>&#160;:</span></p></td><td>a numeric value.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td><td>the minimum of <em class="parameter"><code>a</code></em> and <em class="parameter"><code>b</code></em>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2830674"></a><h3><a name="MAX:CAPS"></a>MAX()</h3>

⌨️ 快捷键说明

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