X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=docs%2Freference%2Fglk-api-conventions.sgml;fp=docs%2Freference%2Fglk-api-conventions.sgml;h=e796e5217f54c612e633d027c223f295e34a6f19;hb=904fed6618b22e84597efd60c3784e57d44f3ef1;hp=0000000000000000000000000000000000000000;hpb=16a17e66c632c5f0a654a3999b57eeb61730a473;p=projects%2Fchimara%2Fchimara.git diff --git a/docs/reference/glk-api-conventions.sgml b/docs/reference/glk-api-conventions.sgml new file mode 100644 index 0000000..e796e52 --- /dev/null +++ b/docs/reference/glk-api-conventions.sgml @@ -0,0 +1,36 @@ + + + + +Other API Conventions +3 +CHIMARA Library + + +Other API Conventions +General information about the Glk API + + +Description + +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, and all functions are actual function declarations (as opposed to macros.) + + +There are a few places where macros would be more efficient — glk_gestalt() and glk_gestalt_ext(), for example — but they are not likely to be CPU bottlenecks, and clarity seems more important. + + +%FALSE is 0; %TRUE is 1. %NULL is also 0. + + +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 a %NULL pointer to indicate that you do not care about that value. + + +