![]() | Programming Guide | ![]() |
Updates the list of memory-resident files
int sm_formlist(struct form_list *ptr_to_form_list);
ptr_to_form_list- A pointer to the form list to update.
C only
sm_formlistadds JPL modules and screens to the memory-resident form list. Each member of the list is a structure that contains the name of the JPL module or screen as a character string and its address in memory. You usually call this function frommain. You can also call it elsewhere in an application program to augment to the memory resident list.The library functions sm_r_form, sm_r_window, and sm_r_at_cur search for the specified screen in the memory-resident list before they try to read it from disk. The
callcommand and library functionsm_jplcallsearch the memory-resident list when they look for a JPL procedure to execute.Because no count is given with the list, be careful to end the list with a null entry.
To make a JPL module or screen memory resident:
- Use the bin2c utility to create a static C structure initialized with the binary content of the object.
- Compile and link the structure with the application executable.
Alternatively, read the object into memory after opening it with the C function
fopen.
#include <smdefs.h>
/* Add 2 screens to memory-resident form list. */
struct form_list new_list[] =
{
{"new_form1", new_form1},
{"new_form2", new_form2},
{0, 0}
};
sm_formlist(new_list);