Programming Guide



sm_formlist

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.

Environment

C only

Returns

Description

sm_formlist adds 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 from main. 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 call command and library function sm_jplcall search 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:

  1. Use the bin2c utility to create a static C structure initialized with the binary content of the object.
  2. Compile and link the structure with the application executable.

Alternatively, read the object into memory after opening it with the C function fopen.

Example

#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);

See Also

sm_rmformlist