e796e5217f54c612e633d027c223f295e34a6f19
[projects/chimara/chimara.git] / docs / reference / glk-api-conventions.sgml
1 <?xml version="1.0"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3                "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
4 ]>
5 <refentry id="chimara-Other-API-Conventions">
6 <refmeta>
7 <refentrytitle>Other API Conventions</refentrytitle>
8 <manvolnum>3</manvolnum>
9 <refmiscinfo>CHIMARA Library</refmiscinfo>
10 </refmeta>
11 <refnamediv>
12 <refname>Other API Conventions</refname>
13 <refpurpose>General information about the Glk API</refpurpose>
14 </refnamediv>
15 <refsect1>
16 <title>Description</title>
17 <para>
18 The <filename class="headerfile">glk.h</filename> header file is the same on all platforms, with the sole exception of the typedef of #glui32 and #glsi32. These will always be defined as 32-bit unsigned and signed integer types, which may be <quote><type>long</type></quote> or <quote><type>int</type></quote> or some other C definition.
19 </para>
20 <para>
21 Note that all constants are &num;defines, and all functions are actual function declarations (as opposed to macros.)
22 </para>
23 <note><para>
24 There are a few places where macros would be more efficient &mdash; glk_gestalt() and glk_gestalt_ext(), for example &mdash; but they are not likely to be CPU bottlenecks, and clarity seems more important.
25 </para></note>
26 <para>
27 %FALSE is 0; %TRUE is 1. %NULL is also 0.
28 </para>
29 <para>
30 As stated above, it is illegal to pass %NULL to a function which is expecting a valid object reference, unless the function definition says otherwise.
31 </para>
32 <para>
33 Some functions have pointer arguments, acting as <quote>variable</quote> or <quote>reference</quote> arguments; the function's intent is to return some value in the space pointed to by the argument. Unless the function says otherwise, it is legal to pass a %NULL pointer to indicate that you do not care about that value.
34 </para>
35 </refsect1>
36 </refentry>