Programming Guide


Opens a library

int sm_l_open(char *lib_name);

The name of the library to open. Panther searches for lib_name in the current directory, then along the path given to sm_initcrt, and finally along the path defined by SMPATH.



Use sm_l_open to open a library before you use a JPL module, a menu, or a screen that is in that library. sm_l_open opens a library in these steps:

If you define the SMFLIBS variable in your setup file as a list of library names, Panther automatically calls sm_l_open for 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_d_msg_line("Please enter the name of your library.");

do {
} while ((ld = sm_l_open(sm_fptr (1))) < 0);

See Also

sm_form, sm_jplcall, sm_jplpublic, sm_l_close, sm_window