next up previous index
Next: Terminal I/O Up: Chapter 2: GNO Compliance Previous: Chapter 2: GNO Compliance   Index

Detecting the GNO Environment

If your application requires the GNO Kernel to be active (if it makes any kernel calls), you can make sure of this by making a kernStatus call at the beginning of your program. The call will return no error if the kernel is active, or it will return an error code of $0001 (Tool locator -- tool not found), in which case the value returned will be invalid. The call actually returns a 1 if no error occurs, but the value returned will be indeterminate if the kernel is not active, so you should only check for an error (the function toolerror(3) or the variable _toolErr in C, the value in the A register in assembly).

You can also determine the current version of the GNO Kernel by making the kernVersion call. The format of the version number returned is the same as the standard ToolBox calls. For example a return value of $0201 indicates a version of 2.1.

kernStatus and kernVersion are defined in the <gno/gno.h> header file.


next up previous index
Next: Terminal I/O Up: Chapter 2: GNO Compliance Previous: Chapter 2: GNO Compliance   Index
Feedback