Initializes the display and Panther data structuresint sm_initcrt(char *path);void sm_jinitcrt(char *path);void sm_jxinitcrt(char *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
- The paths specified in the environment variable
sm_initcrtis called automatically by Panther. Use this function only if you write your own executive.
A custom executive should call
sm_initcrtwhen screen handling starts—that is, before any screens display and the keyboard opens for screen input.
sm_initcrtcan 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_initcrtperforms 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_termcontains the terminal type,
sm_initcrtproceeds to step 4.
- Tries to ascertain the terminal type with this search algorithm:
- Finds and reads the setup file specified by
SMVARSor the default configuration file
smvars. If the
SMSETUPvariable is set, it also finds and reads this setup file.
- Finds and reads the binary message file specified by SMMSGS. If
SMMSGScannot 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
SMSETUPsetup 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: