Programming Guide |
Initializes the display and Panther data structures
int sm_initcrt(char *path);void sm_jinitcrt(char *path);void sm_jxinitcrt(char *path);
path
- Specifies where to look for a library file after Panther searches the current directory. If you supply an empty string, Panther looks only in the current directory or in the paths specified by SMPATH. Panther searches for library files in these areas:
- The current directory.
- The directory specified by
path
.- The paths specified in the environment variable
SMPATH
.
C only
sm_initcrt
is called automatically by Panther. Use this function only if you write your own executive.A custom executive should call
sm_initcrt
when screen handling starts—that is, before any screens display and the keyboard opens for screen input.sm_initcrt
can be preceded only by those functions that set options, such as sm_option, and those that install functions or configuration files such as sm_install or sm_vinit.
sm_initcrt
performs these tasks:
- Sets a path that Panther uses to search for libraries.
- Calls an optional user-defined initialization function. This function initializes the character string
sm_term
. Ifsm_term
contains the terminal type,sm_initcrt
proceeds to step 4.- Tries to ascertain the terminal type with this search algorithm:
- Finds and reads the setup file specified by
SMVARS
or the default configuration filesmvars
. If theSMSETUP
variable is set, it also finds and reads this setup file.- Finds and reads the binary message file specified by SMMSGS. If
SMMSGS
cannot be found, Panther aborts initialization.- Finds and reads the binary video and keyboard files defined by SMVIDEO and SMKEY, respectively. These variables are defined in the
SMVARS
orSMSETUP
setup files, or in the environment. If Panther cannot determine which files to use, it prompts for a terminal type and repeats this step.- Allocates memory for various data structures shared among Panther library functions.
- Initializes the operating system's terminal channel. It is set to no echo and non-buffered input, if appropriate.
- Initializes the operating system display.
/* To initialize Panther without supplying a path
* for screens:
*/
sm_initcrt("");