12.07.2015 Views

JYACC FORMAKER C Programmer's Guide Contents 1 ... - Prolifics

JYACC FORMAKER C Programmer's Guide Contents 1 ... - Prolifics

JYACC FORMAKER C Programmer's Guide Contents 1 ... - Prolifics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Initialization errors in file I/O are reported using the C library functionperror; these messages are system-dependent. Other errors encountered before themessage file is loaded provoke hard-coded messages; afterward, all errormessages are taken from the message file.Video and keyboard initialization are next attempted, in that order, usingsm_keyinit and sm_vinit respectively. If after all this <strong>JYACC</strong> <strong>FORMAKER</strong> stillcan't determine which configuration files to use, it will prompt you for aterminal type and retry the entire sequence. Finally, <strong>JYACC</strong> <strong>FORMAKER</strong> initializesthe terminal and its operating system channel.After ensuring that the environment is set up, sm_initcrt initializes theoperating system's terminal channel. It is set to "no echo" and non-bufferedinput. If other changes are desired (e.g. from 7 to 8 data bits), they can bemade in the user initialization routine.Next the initialization string found in the video file is transmitted to theterminal. The Video Manual gives details; here we simply note that system callscan be embedded in the string. Often this feature can be used in lieu of a userinitialization routine.5 Keyboard InputKeystrokes are processed in three steps. First, the sequence of charactersgenerated by one key is identified. Next the sequence is translated to aninternal value, or logical character. Finally, the internal value is eitheracted upon or returned to the application ("key routing"). All three steps aretable-driven. Hooks are provided at several points for application processing;they are described in Section 7.5.1 Logical Characters or Keys<strong>JYACC</strong> <strong>FORMAKER</strong> processes characters internally as logical values, whichfrequently (but not always) correspond to the physical ASCII codes used byterminal keyboards and displays. Specific keys or sequences of keys are mappedto logical values by the key translation table, and logical characters aremapped to video output by the MODE and GRAPH commands in the video file. Formost keys, such as the normal displayable characters, no explicit mapping isnecessary. Certain ranges of logical characters are interpreted specially by<strong>JYACC</strong> <strong>FORMAKER</strong>; they are....0x0100 to 0x01ff: operations such as tab, scrolling, cursor motion0x6101 to 0x7801: function keys PF1 - PF240x4101 to 0x5801: shifted function keys SPF1 - SPF240x6102 to 0x7802: application keys APP1 - APP245.2 Key TranslationThe first two steps together are controlled by the key translation table, whichis loaded during initialization. The name of the table is found in theenvironment (see Section 4 for details). The table itself is derived from anASCII file which can be modified by any editor; a screen-oriented program,modkey, is also supplied for creating and modifying key translation tables (seethe Configuration <strong>Guide</strong>).After the table is read into memory, it has the form of an array of structures:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!