[Top] [Prev] [Next] [Bottom]

mods(3)

mods(3)

Name

mods-modified mask field routines

Synopsis

#include "fml.h" 
#include "mods.h"

get_mods(fbfr,mod_array,size_mod_array)
FBFR *fbfr;
struct track_mods *mod_array;
int size_mod_array;

mods_needed(fbfr)
FBFR *fbfr;

set_mods(fbfr,fldid,occno,cmd)
FBFR *fbfr;
FLDID fldid;
int occno;
char *cmd;

int fld_mod(fbfr, fldid, occno)
FBFR *fbfr;
FLDID fldid;
int occno;

Description

The mods routines are used by servers communicating with mio(1) to determine which mask fields have been modified. All the routines described below, have fbfr as their first argument. fbfr is the fielded buffer returned to a server by mio.

get_mods() places the fldid and occurrence numbers of fields that have been modified on a mio mask into an array of structures, mod_array, supplied by the caller. Only size_mod_array entries will be made in mod_array. mods_needed() should be called to determine the actual size_mod_array needed to hold all modified field entries. Once a field has been changed on a mask, it will exist in the list of modified fields until one of the following three things happens: a new mask is displayed, the modified field is reset with a call to set_mods(), or the user clears the entire screen with the clear screen function key. get_mods() returns a -1 on an error, and a non-negative number indicating the number of entries placed in mod_array on success. When an error indication is returned, Ferror contains the reason for the error.

mods_needed() returns the number of entries needed in mod_array to hold all modified field information returned by get_mods(). It returns a -1 on an internal failure, in which case Ferror contains the reason for failure. The value returned by mods_needed() may be passed directly to get_mods(). If get_mods() finds a -1 in its size_mod_array parameter it will also return a 0.

set_mods() sets the modified status of all fields on an mio mask with field identifier fldid and occurence number occno based on cmd. cmd may be either of the strings "MOD_SET" or "MOD_RESET", enclosed in quotation marks as shown. If cmd is "MOD_RESET" the indicated fields are not returned in the modified list until they are changed again. If cmd is "MOD_SET" the indicated fields always appear in the modified list, until one of the three conditions listed under the get_mods() routine is met. If fldid is zero then cmd applies to all protected and unprotected fields on the mask. set_mods() returns a 0 on an invalid cmd, a -1 on an FML error, in which case the reason for the error is in Ferror, and a 1 on success. If the Ferror is FNOSPACE the caller should Frealloc(3) the fielded buffer and try again.

fld_mod() returns a 1 if a field specified by fldid and occno was modified. It returns a 0 if the specified field was not modified, and a -1 on an internal error. The internal error is usually due to a failed malloc(3).

Servers in which mods routines are called must link in libtfrm.a with the -f option of buildserver(1).

Notices

Only modifications to fields done through the standard input are tracked. Modifications from other sources, such as asynchronous updates, are not tracked.

See Also

buildserver(1), Frealloc(3), TUXEDO FML Guide



[Top] [Prev] [Next] [Bottom]