The following keywords may vary between different contexts where the macro processor is used. The actual keywords are programmable within the macro preprocessor system, so as to better match the syntax of the file format to which the preprocessor is being applied. Here, we will use italicized generic names for these keywords, but the correspondence to actual keyword names (given in the documentation for the specific file formats) should be obvious. The square brackets indicate ``optional''.
If the optional ``eval'' keyword is not included, the replacement text, if any, will replace the macro in lines of text being macro expanded.
If ``eval'' is included (this is verbatim but case-insensitive), the replacement text is assumed to be executable as a single line script. The script will be executed, and the result (or return value) will be converted to a text string (if necessary) and taken as the replacement text.
In various contexts, other special keywords may be recognized. These are described elsewhere.
Examples:
The examples below illustrate some simple constructs that improve portability of input files, using the predefined macros and generic keywords. In real input, the actual keywords appropriate for the type of file should be used.
The IF keyword, and product name and RELEASE predefines, were implemented in release 3.0.5, so use is not compatible with older releases. Nevertheless, files can be made portably version dependent through use of IFDEF and/or IFNDEF.
IFNDEF RELEASE
# old release
text...
ELSE
IF RELEASE == 30050
# release xic-3.0.5
text...
ELSE
# a later release
text...
ENDIF
ENDIF
Often, it is necessary to know what operating system is being used. Usually, there are really only two categories: Windows, and everything else.
IF OSTYPE == "Windows"
# running Windows
text...
ELSE
# not running Windows
text...
ENDIF
It may be necessary to disable certain setup if not running the full Xic feature set, for example, if the same file is used for different Xic feature sets.
IF FEATURESET == "FULL"
# running Xic
text...
ELSE
IF FEATURESET == "EDITOR"
# running XicII
text...
ELSE
IF FEATURESET == "VIEWER"
# running Xiv
text...
ELSE
# impossible!
ENDIF
ENDIF
ENDIF