field(S) 6 January 1993 field(S) Name field - FIELD library routines Syntax cc . . . -lform -lcurses #include <form.h> FIELD *dup_field (field, frow, fcol) FIELD *field; int frow, fcol; char *field_arg (field) FIELD *field; int field_back (field) FIELD *field; char *field_buffer (field, buf) FIELD *field; int buf; int field_fore (field) FIELD *field; int field_info (field, rows, cols, frow, fcol, nrow, nbuf) FIELD *field; int *rows, *cols, *frow, *fcol, *nrow, nbuf; int field_just (field) FIELD *field; int field_opts_off (field, opts) FIELD *field; OPTIONS opts; int field_opts_on (field, opts) FIELD *field; OPTIONS opts; OPTIONS field_opts (field) FIELD *field; int field_pad (field) FIELD *field; int field_status (field) FIELD *field; FIELDTYPE *field_type (field) FIELD *field; char *field_userptr (field) FIELD *field; int free_field (field) FIELD *field; FIELD *link_field (field, frow, fcol) FIELD *field; int frow, fcol; FIELD *new_field (r, c, frow, fcol, nrow, nbuf) int r, c, frow, fcol, nrow, nbuf; int move_field (field, frow, fcol) FIELD *field; int frow, fcol; int set_field_back (field, back) FIELD *field; int back; int set_field_buffer (field, buf, value) FIELD *field; int buf; char *value; int set_field_fore (field, fore) FIELD *field; int fore; int set_field_just (field, justification) FIELD *field; int justification; int set_field_opts (field, opts) FIELD *field; OPTIONS opts; int set_field_pad (field, pad) FIELD *field; int pad; int set_field_status (field, status) FIELD *field; int status; int set_field_type (field, type, [arg_1, arg_2, . . . ] ) FIELD *field; FIELDTYPE *type; int set_field_userptr (field, userptr) FIELD *field; char *userptr; options: O_ACTIVE O_AUTOSKIP O_BLANK O_EDIT O_NULLOK O_PUBLIC O_WRAP Description These FIELD routines run on any terminal supported by curses(S). Once you compile your program, sourcing the header file form.h with the #include statement, you should link it with the form and curses library routines. Functions The following is a list of FIELD routines: dupfield (field, frow, fcol) duplicates the given field at the named location newfield (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. linkfield (field, frow, fcol) also duplicates the given field at the named location. However, it shares the field buffers between both occur- rences of the field and permits the setting of different attributes for each field. freefield (field) frees the storage allocated for the given field fieldarg (field) returns a pointer to the field arguments associated with the field type of field fieldinfo (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 movefield (field, frow, fcol) moves the disconnected field to the loca- tion frow, fcol in the form subwindow setfieldtype (field, type, [ arg1, arg2, . . . ] ) associates the given field type with field. Certain field types take additional argu- ments. ``TYPE_ALNUM'', for instance, requires one, the minimum width specification for the field. fieldtype (field) returns a pointer to the field type of field setfieldjust (field, justification) sets the justification for the given field. Justification may be NOJUSTIFICATION, JUSTIFYRIGHT, JUSTIFYLEFT, or JUSTIFYCENTER. fieldjust (field) returns the indicator of the justification for the field setfieldfore (field, fore) sets the foreground attribute of field. The foreground attribute is the curses visual display attribute used to dis- play the field characters. fieldfore (field) returns the foreground attribute of field setfieldback (field, back) sets the background attribute of field. The background attribute is the curses visual display attribute used to dis- play the area immediately surrounding the field characters. fieldback (field) returns the background attribute of field setfieldpad (field, pad) sets the pad (blank) character for field fieldpad (field) returns the pad character for field setfieldbuffer (field, buf, value) sets buffer buf of field to value. Buffer 0 stores the displayed value of the field. fieldbuffer (field, buf) returns the value of field buffer buf setfieldstatus (field, status) sets the field's status flag to status. Every field has an associated status flag that is set whenever the field's value (field buffer 0) changes. fieldstatus (field) returns the status of field. Every field has an associated user pointer that you can use to store pertinent data. setfielduserptr (field, userptr) sets the field's user pointer. fielduserptr (field) returns the field's user pointer setfieldopts (field, opts) turns on the named options of the field and turns off its remaining options. Options are boolean values. fieldoptson (field, opts) turns on the named options fieldoptsoff (field, opts) turns off the named options fieldopts (field) returns the field's options setting. To set options, you can apply boolean operators to the value returned by fieldopts() and let the result be the second argument to setfieldopts( ). options: OACTIVE field visited during processing OAUTOSKIP moves to start of next field when current field full OBLANK whole field erased if first character entered before any other character changed OEDIT field can be edited ONULLOK can leave blank field without validating it OPUBLIC field displayed as data entered OVISIBLE field displayed OWRAP words not fitting on field line are wrapped to next line Diagnostics The following values are returned by one or more routines that return an integer. For specific information on which routines and values returned, see the User Interfaces Guide. EBADARGUMENT argument is incorrect EBADSTATE called from inappropriate routine ECONNECTED object is connected ECURRENT field is current field EINVALIDFIELD field is invalid ENOTCONNECTED object is not connected ENOROOM form does not fit in subwindow EOK function returned successfully EPOSTED form is posted EREQUESTDENIED recognized request failed ESYSTEMERROR system error EUNKNOWNCOMMAND unknown command was given to the form driver See also curses(S), fieldtype(S), form(S), item(S), menu(S), panel(S), tam(S) Standards conformance field is not part of any currently supported standard; it is an extension of AT&T System V provided by the Santa Cruz Operation.