Other API ConventionsOther API Conventions — General information about the Glk API |
The glk.h
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 “long” or “int” or some other C definition.
Note that all constants are #defines. All functions are currently actual function declarations (as opposed to macros), but this may change in future Glk revisions. As in the standard C library, if Glk function is defined by a macro, an actual function of the same name will also be available.
Functions that return or generate boolean values will produce only 0 (FALSE
) or 1 (TRUE
). Functions that accept boolean arguments will accept any value, with zero indicating FALSE
and nonzero indicating TRUE
.
NULL
(when used in this document) refers to the C null pointer. 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.
Some functions have pointer arguments, acting as “variable” or “reference” 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 NULL
to indicate that you do not care about that value.