![]() | ![]() | Programming Guide |
Opens a library
int sm_l_open (char *lib_name);
lib_name- The name of the library to open. Panther searches for
lib_namein the current directory, then along the path given tosm_initcrt, and finally along the path defined bySMPATH.
1 The library file's identifier.
- -1 The library cannot be opened or read.
Use
sm_l_opento open a library before you use a JPL module, a menu, or a screen that is in that library.sm_l_openopens a library in these steps:
- Allocates space in which to store information about the library.
If you define the
SMFLIBSvariable in your setup file as a list of library names, Panther automatically callssm_l_openfor those libraries.Panther has no limit on the number of libraries you can have open at the same time. Note that some systems have severe limits on memory or simultaneously open files.
/* Prompt for the name of a library until a
* valid one is found. Assume the memory-resident
* screen contains one field for entering the library
* name, with suitable instructions. */int ld;
extern char libquery[];
if (sm_d_form (libquery) < 0)
sm_cancel ();
sm_d_msg_line ("Please enter the name of\
your library.");
do {
sm_input (IN_DATA);
} while ((ld = sm_l_open (sm_fptr (1))) < 0);
sm_form, sm_jplcall, sm_jplpublic, sm_l_close, sm_window
![]()
![]()
![]()
![]()