FIELD(S) UNIX System V FIELD(S)
Name
field - FIELD library routines
Syntax
#include <form.h>
cc [ flags ] files -lform -lcurses [ libraries ]
FIELD * new_field (r, c, frow, fcol, nrow, nbuf)
int r, c, frow, fcol, nrow, nbuf;
FIELD * dup_field (field, frow, fcol)
FIELD * field;
int frow, fcol;
FIELD * link_field (field, frow, fcol)
FIELD * field;
int frow, fcol;
int free_field (field)
FIELD * field;
int field_info (field, rows, cols, frow, fcol, nrow, nbuf)
FIELD * field;
int * rows, * cols, * frow, * fcol, * nrow, nbuf;
int move_field (field, frow, fcol)
FIELD * field;
int frow, fcol;
int set_field_type (field, type, [arg_1, arg_2, ...])
FIELD * field;
FIELDTYPE * type;
FIELDTYPE * field_type (field)
FIELD * field;
char * field_arg (field)
FIELD * field;
int set_field_just (field, justification)
FIELD * field;
int justification;
int field_just (field)
FIELD * field;
int set_field_fore (field, fore)
FIELD * field;
int fore;
int field_fore (field)
FIELD * field;
int set_field_back (field, back)
FIELD * field;
int back;
int field_back (field)
FIELD * field;
int set_field_pad (field, pad)
FIELD * field;
int pad;
int field_pad (field)
FIELD * field;
int set_field_buffer (field, buf, value)
FIELD * field;
int buf;
char * value;
char * field_buffer (field, buf)
FIELD * field;
int buf;
int set_field_status (field, status)
FIELD * field;
int status;
int field_status (field)
FIELD * field;
int set_field_userptr (field, userptr)
FIELD * field;
char * userptr;
char * field_userptr (field)
FIELD * field;
int set_field_opts (field, opts)
FIELD * field;
OPTIONS opts;
int field_opts_on (field, opts)
FIELD * field;
OPTIONS opts;
int field_opts_off (field, opts)
FIELD * field;
OPTIONS opts;
OPTIONS field_opts (field)
FIELD * field;
options:
O_ACTIVE
O_PUBLIC
O_EDIT
O_WRAP
O_BLANK
O_AUTOSKIP
O_NULLOK
Description
These FIELD routines run on any terminal supported by
curses(S), the low-level ETI library. Once you compile your
UNIX program #includeing the header file form.h, you should
link it with the form and curses library routines.
Functions
The following is a list of FIELD routines. For a complete
description of each routine, see the Programmer's Guide.
new_field(r,c, frow,fcol,nrow, nbuf) creates a new field
with r rows, c columns; starting at frow, fcol in the
subwindow of the form to contain the field; with nrow
offscreen rows and nbuf additional work buffers. It returns
a pointer to the created field. In general, you should
store these field pointers in an array.
dup_field(field,frow, fcol) duplicates the given field at
the named location.
link_field(field,frow, fcol) also duplicates the given field
at the named location. However, unlike dup_field() it
shares the field buffers between both occurrences of the
field and permits the setting of different attributes for
each field.
free_field(field) frees the storage allocated for the given
field.
field_info(field,rows, cols,frow,fcol, nrow,nbuf) returns
the size, position, and other named field characteristics to
the locations pointed to by the pointer arguments rows,
cols, frow, fcol, nrow, and nbuf.
move_field(field,frow, fcol) moves the disconnected field to
the location frow, fcol in the form subwindow.
set_field_type(field,type, arg_1,arg_2,...]) associates the
given field type with field. Certain field types take
additional arguments. TYPE_ALNUM, for instance, requires
one, the minimum width specification for the field.
field_type(field) returns a pointer to the field type of
field.
field_arg(field) returns a pointer to the field arguments
associated with the field type of field.
set_field_just(field,justification) sets the justification
for the given field. Justification may be NO_JUSTIFICATION,
JUSTIFY_RIGHT, JUSTIFY_LEFT, or JUSTIFY_CENTER.
field_just(field) returns the indicator of the justification
for the field.
set_field_fore(field,fore) sets the foreground attribute of
field. The foreground attribute is the low-level visual
display attribute used to display the field characters.
field_fore(field) returns the foreground attribute of field.
set_field_back(field,back) sets the background attribute of
field. The background attribute is the low-level visual
display attribute used to display the area immediately
surrounding the field characters.
field_back(field) returns the background attribute of field.
set_field_pad(field,pad) sets the pad (blank) character for
field.
field_pad(field) returns the pad character for field.
set_field_buffer(field,buf, value) sets buffer buf of field
to value. Buffer 0 stores the displayed value of the field.
field_buffer(field,buf) returns the value of field buffer
buf.
Every field has an associated status flag that is set
whenever the field's value (field buffer 0) changes.
set_field_status(field,status) sets the field's status flag
to status.
field_status(field) returns the status of field.
Every field has an associated user pointer that you can use
to store pertinent data.
set_field_userptr(field,userptr) sets the field's user
pointer.
field_userptr(field) returns the field's user pointer.
set_field_opts(field,opts) turns on the named options of the
field and turns off all its remaining options. Options are
boolean values.
field_opts_on(field,opts) turns on the named options.
field_opts_off(field,opts) turns off the named options.
field_opts(field) returns the field's options setting. To
set options, you can apply boolean operators to the value
returned by field_opts() and let the result be the second
argument to set_field_opts().
options:
O_VISIBLE field displayed
O_ACTIVE field visited during processing
O_PUBLIC field displayed as data entered
O_EDIT field can be edited
O_WRAP words not fitting on field line are wrapped to
next line
O_BLANK whole field erased if first character entered
before any other character changed
O_AUTOSKIP moves to start of next field when current field
full
O_NULLOK can leave blank field without validating it
Diagnostics
The following values are returned by one or more routines
that return an integer. For specific information on which
routines return which value, see the Programmer's Guide.
E_OK function returned successfully
E_CONNECTED object is connected
E_SYSTEM_ERROR system error
E_BAD_ARGUMENT argument is incorrect
E_CURRENT field is current field
E_POSTED form is posted
E_INVALID_FIELD field is invalid
E_NOT_CONNECTED object is not connected
E_NO_ROOM form does not fit in subwindow
E_BAD_STATE called from inappropriate routine
E_UNKNOWN_COMMAND unknown command was given to the form
driver
E_REQUEST_DENIED recognized request failed
See Also
curses(S), fieldtype(S), form(S), item(S), menu(S),
panel(S), tam(S)
(printed 6/20/89)