diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-06-02 21:37:54 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-06-02 21:37:54 +0000 |
commit | 30b3a17bbd15ea6ee4e4d5c34b5491bceeae8b2c (patch) | |
tree | 6120f098ec3ea63a4652cbe673cc566fae6f8a42 /lib/libform/form_field_validation.3 | |
parent | b8d379a3b8bd8bdd763abd7ea8cdc4e53351f610 (diff) |
SYSV-style form library; from ncurses
Diffstat (limited to 'lib/libform/form_field_validation.3')
-rw-r--r-- | lib/libform/form_field_validation.3 | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/lib/libform/form_field_validation.3 b/lib/libform/form_field_validation.3 new file mode 100644 index 00000000000..682b21296b1 --- /dev/null +++ b/lib/libform/form_field_validation.3 @@ -0,0 +1,72 @@ +'\" t +.TH form_field_validation 3X "" +.SH NAME +\fBform_field_validation\fR - data type validation for fields +.SH SYNOPSIS +\fB#include <form.h>\fR +.br +int set_field_type(FIELD *field, FIELDTYPE *type, ...); +.br +FIELDTYPE *field_type(FIELD *field); +.br +char *field_arg(FIELD *field); +.br +.SH DESCRIPTION +The function \fBset_field_type\fR declares a data type for a given form field. +This is the type checked by validation functions. The types are as follows: +.TP 5 +TYPE_ALNUM +Alphanumeric data. Requires a third argument, a minimum field width. +.TP 5 +TYPE_ALPHA +Character data. Requires a third argument, a minimum field width. +.TP 5 +TYPE_ENUM +Accept one of a specified set of strings. Requires a third (char **) +argument pointing to a string list; a fourth flag argument to enable +case-sensitivity; and a fifth flag argument specifying whether a partial +match must be a unique one (if this flag is off, a prefix matches the first +of any set of more than one list elements with that prefix). +.TP 5 +TYPE_INTEGER +Integer data, parsable to an integer by \fBatoi(3)\fR. Requires a third +integer precision argument that sets zero-padding, a fourth argument +constraining minimum value, and a fifth constraining maximum value. +.TP 5 +TYPE_NUMERIC +Numeric data (may have a decimal-point part). Requires following +arguments as for TYPE_INTEGER data. +.TP 5 +TYPE_REGEXP +Regular expression data. Requires a regular expression third argument; +the data is valid if the regular expression matches it. Regular expressions +are in the format of \fBregcomp\fR(3x) and \fBregexec\fR(3X). + +It is possible to set up new programmer-defined field types. See the +\fBform_fieldtype\fR(3X) manual page. +.SH RETURN VALUE +The functions \fBfield_type\fR and \fB\field_argfR return \fBNULL\fR on +error. The function \fBset_field_type\fR returns one of the following: +.TP 5 +\fBE_OK\fR +The routine succeeded. +.TP 5 +\fBE_SYSTEM_ERROR\fR +System error occurred (see \fBerrno\fR). +.SH SEE ALSO +\fBcurses\fR(3X), \fBform\fR(3X). +.SH NOTES +The header file \fB<form.h>\fR automatically includes the header file +\fB<curses.h>\fR. +.SH PORTABILITY +These routines emulate the System V forms library. They were not supported on +Version 7 or BSD versions. +.SH AUTHORS +Juergen Pfeifer. Manual pages and adaptation for new curses by Eric +S. Raymond. +.\"# +.\"# The following sets edit modes for GNU EMACS +.\"# Local Variables: +.\"# mode:nroff +.\"# fill-column:79 +.\"# End: |