Programming Guide |
Gets the contents of a field
char *sm_fptr(int field_number);char *sm_e_fptr(char *field_name, int element);char *sm_i_fptr(char *field_name, int occurrence);char *sm_n_fptr(char *field_name);char *sm_o_fptr(int field_number, int occurrence);
field_name
field_number- The field with the data to get.
element
- The element that contains the data to get.
occurrence
- The occurrence that contains the data to get.
C only
- · A pointer to the field's contents.
sm_fptr
returns the contents of the specified field. Panther strips leading or trailing blanks.
sm_fptr
shares with several other functions a pool of buffers where it stores returned data. Consequently, you should immediately process or copy the value returned by this function.
#include <smdefs.h>
/* This function reports the contents of a field. */
void report(fieldname)
char *fieldname;
{
char buf[256], *stuf;
if ((stuf = sm_n_fptr(fieldname)) == NULL)
return;
sprintf(buf, "Field '%s' contains '%s'",
fieldname, stuf);
sm_femsg(0, buf);
}