summaryrefslogtreecommitdiff
path: root/lib/libform/form_field_validation.3
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2010-01-12 23:22:15 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2010-01-12 23:22:15 +0000
commit6ee254699bf787d78835419be2b3241fb037d444 (patch)
tree07fe67dab517e4990f344fe2c00e65cef4d25b81 /lib/libform/form_field_validation.3
parent0b62f5dc36fc7203a74cdc812c4234ae188fdfd2 (diff)
Update to ncurses 5.7, with local changes reapplied.
This is around eight years worth of changes (previously we were around ncurses 5.2), too many to list - many bug fixes and also a few new functions. A major bump for libcurses, libpanel, libform and libmenu. ok deraadt
Diffstat (limited to 'lib/libform/form_field_validation.3')
-rw-r--r--lib/libform/form_field_validation.331
1 files changed, 23 insertions, 8 deletions
diff --git a/lib/libform/form_field_validation.3 b/lib/libform/form_field_validation.3
index 267a59847e0..660d46e35cd 100644
--- a/lib/libform/form_field_validation.3
+++ b/lib/libform/form_field_validation.3
@@ -1,7 +1,7 @@
-.\" $OpenBSD: form_field_validation.3,v 1.8 2003/05/16 08:48:27 jmc Exp $
+.\" $OpenBSD: form_field_validation.3,v 1.9 2010/01/12 23:22:07 nicm Exp $
.\"
.\"***************************************************************************
-.\" Copyright (c) 1998 Free Software Foundation, Inc. *
+.\" Copyright (c) 1998-2003,2006 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" copy of this software and associated documentation files (the *
@@ -28,7 +28,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.'" $From: form_field_validation.3x,v 1.10 1998/03/11 21:12:53 juergen Exp $
+.\" $Id: form_field_validation.3,v 1.9 2010/01/12 23:22:07 nicm Exp $
.TH form_field_validation 3 ""
.SH NAME
\fBform_field_validation\fR - data type validation for fields
@@ -40,10 +40,25 @@ int set_field_type(FIELD *field, FIELDTYPE *type, ...);
FIELDTYPE *field_type(const FIELD *field);
.br
void *field_arg(const FIELD *field);
+.sp
+FIELDTYPE *TYPE_ALNUM;
+.br
+FIELDTYPE *TYPE_ALPHA;
+.br
+FIELDTYPE *TYPE_ENUM;
+.br
+FIELDTYPE *TYPE_INTEGER;
+.br
+FIELDTYPE *TYPE_NUMERIC;
+.br
+FIELDTYPE *TYPE_REGEXP;
+.br
+FIELDTYPE *TYPE_IPV4;
.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:
+This is the type checked by validation functions.
+The predefined types are as follows:
.TP 5
TYPE_ALNUM
Alphanumeric data. Requires a third \fBint\fR argument, a minimum field width.
@@ -86,7 +101,7 @@ For details of the precision handling see \fBprintf's\fR man-page.
TYPE_REGEXP
Regular expression data. Requires a regular expression \fB(char *)\fR third argument;
the data is valid if the regular expression matches it. Regular expressions
-are in the format of \fBregcomp\fR(3) and \fBregexec\fR(3). Please notice
+are in the format of \fBregcomp\fR and \fBregexec\fR. Please notice
that the regular expression must match the whole field. If you have for
example an eight character wide field, a regular expression "^[0-9]*$" always
means that you have to fill all eight positions with digits. If you want to
@@ -100,17 +115,17 @@ is checked whether or not the buffer has the form a.b.c.d, where a,b,c and d are
numbers between 0 and 255. Trailing blanks in the buffer are ignored. The address
itself is not validated. Please note that this is an ncurses extension. This
field type may not be available in other curses implementations.
-
+.PP
It is possible to set up new programmer-defined field types. See the
\fBform_fieldtype\fR(3) manual page.
.SH RETURN VALUE
The functions \fBfield_type\fR and \fBfield_arg\fR return \fBNULL\fR on
error. The function \fBset_field_type\fR returns one of the following:
.TP 5
-\fBE_OK\fR
+.B E_OK
The routine succeeded.
.TP 5
-\fBE_SYSTEM_ERROR\fR
+.B E_SYSTEM_ERROR
System error occurred (see \fBerrno\fR).
.SH SEE ALSO
\fBcurses\fR(3), \fBform\fR(3).