]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - man/form_field_validation.3x
ncurses 6.2 - patch 20201107
[ncurses.git] / man / form_field_validation.3x
index 5950ecf96b36b3addddde0983105667956051869..6da08ab9951d6d6abe96398c3cac8c6347f774fb 100644 (file)
@@ -1,5 +1,6 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2017,2018 Free Software Foundation, Inc.              *
+.\" Copyright 2018-2019,2020 Thomas E. Dickey                                *
+.\" Copyright 1998-2010,2017 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            *
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_field_validation.3x,v 1.22 2018/07/14 22:39:06 tom Exp $
+.\" $Id: form_field_validation.3x,v 1.27 2020/10/18 00:07:45 tom Exp $
 .TH form_field_validation 3X ""
+.ie \n(.g .ds `` \(lq
+.el       .ds `` ``
+.ie \n(.g .ds '' \(rq
+.el       .ds '' ''
 .de bP
 .ie n  .IP \(bu 4
 .el    .IP \(bu 2
 \fBform_field_validation\fR \- data type validation for fields
 .SH SYNOPSIS
 \fB#include <form.h>\fR
+.sp
+\fBint set_field_type(FIELD *\fP\fIfield\fP\fB, FIELDTYPE *\fP\fItype\fP\fB, ...);\fP
 .br
-int set_field_type(FIELD *field, FIELDTYPE *type, ...);
-.br
-FIELDTYPE *field_type(const FIELD *field);
+\fBFIELDTYPE *field_type(const FIELD *\fP\fIfield\fP\fB);\fP
 .br
-void *field_arg(const FIELD *field);
+\fBvoid *field_arg(const FIELD *\fP\fIfield\fP\fB);\fP
 .sp
-FIELDTYPE *TYPE_ALNUM;
+\fBFIELDTYPE *TYPE_ALNUM;\fP
 .br
-FIELDTYPE *TYPE_ALPHA;
+\fBFIELDTYPE *TYPE_ALPHA;\fP
 .br
-FIELDTYPE *TYPE_ENUM;
+\fBFIELDTYPE *TYPE_ENUM;\fP
 .br
-FIELDTYPE *TYPE_INTEGER;
+\fBFIELDTYPE *TYPE_INTEGER;\fP
 .br
-FIELDTYPE *TYPE_NUMERIC;
+\fBFIELDTYPE *TYPE_NUMERIC;\fP
 .br
-FIELDTYPE *TYPE_REGEXP;
+\fBFIELDTYPE *TYPE_REGEXP;\fP
 .br
-FIELDTYPE *TYPE_IPV4;
+\fBFIELDTYPE *TYPE_IPV4;\fP
 .br
 .SH DESCRIPTION
 The function \fBset_field_type\fR declares a data type for a given form field.
@@ -63,14 +68,16 @@ 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.
+Alphanumeric data.
+Requires a third \fBint\fR argument, a minimum field width.
 .TP 5
 TYPE_ALPHA
-Character data.  Requires a third \fBint\fR argument, a minimum field width.
+Character data.
+Requires a third \fBint\fR argument, a minimum field width.
 .TP 5
 TYPE_ENUM
-Accept one of a specified set of strings.  Requires additional
-parameters:
+Accept one of a specified set of strings.
+Requires additional parameters:
 .RS
 .bP
 a third \fB(char **)\fR argument pointing to a string list;
@@ -99,10 +106,10 @@ and a fifth \fBlong\fR constraining maximum value.
 If the maximum value is less than or equal to the minimum value, the range is
 simply ignored.
 On return, the field buffer is formatted according to the
-\fBprintf\fR format specification ".*ld", where the '*' is replaced by the
-precision argument.
+\fBprintf\fR format specification \*(``.*ld\*('',
+where the \*(``*\*('' is replaced by the precision argument.
 .IP
-For details of the precision handling see \fBprintf's\fR man-page.
+For details of the precision handling see \fBprintf\fR(3).
 .RE
 .TP 5
 TYPE_NUMERIC
@@ -121,10 +128,10 @@ If the maximum value is less than or equal to the minimum value,
 the range is simply ignored.
 .IP
 On return, the field buffer is formatted according to the
-\fBprintf\fR format specification ".*f", where the '*' is replaced by the
-precision argument.
+\fBprintf\fR format specification \*(``.*f\*('',
+where the \*(``*\*('' is replaced by the precision argument.
 .IP
-For details of the precision handling see \fBprintf's\fR man-page.
+For details of the precision handling see \fBprintf\fR(3).
 .RE
 .TP 5
 TYPE_REGEXP
@@ -156,17 +163,17 @@ The address itself is not validated.
 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(3X) manual page.
+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 \fBfield_arg\fR return \fBNULL\fR on
-error. The function \fBset_field_type\fR returns one of the following:
+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
 .B E_OK
 The routine succeeded.
 .TP 5
 .B E_SYSTEM_ERROR
-System error occurred (see \fBerrno\fR).
+System error occurred (see \fBerrno\fR(3)).
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fBform\fR(3X),
@@ -175,8 +182,9 @@ System error occurred (see \fBerrno\fR).
 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
+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.
+Juergen Pfeifer.
+Manual pages and adaptation for new curses by Eric S. Raymond.