]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - man/form_fieldtype.3x
ncurses 6.2 - patch 20201205
[ncurses.git] / man / form_fieldtype.3x
index 028e9b0befccfcb978bc238693c39e36c045596c..d5b7cefa841d0849408097b22d67ceb13703319c 100644 (file)
@@ -1,6 +1,7 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
+.\" Copyright 2018-2019,2020 Thomas E. Dickey                                *
+.\" Copyright 1998-2006,2010 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_fieldtype.3x,v 1.16 2010/12/04 18:40:45 tom Exp $
+.\" $Id: form_fieldtype.3x,v 1.23 2020/10/24 09:05:17 tom Exp $
 .TH form_fieldtype 3X ""
 .SH NAME
 \fBform_fieldtype\fR \- define validation-field types
 .SH SYNOPSIS
 \fB#include <form.h>\fR
+.sp
+\fBFIELDTYPE *new_fieldtype(\fP
+    \fBbool (* const \fP\fIfield_check\fP\fB)(FIELD *, const void *),\fP
+    \fBbool (* const \fP\fIchar_check\fP\fB)(int, const void *));\fP
 .br
-FIELDTYPE *new_fieldtype(
-    bool (* const field_check)(FIELD *, const void *),
-    bool (* const char_check)(int, const void *));
-.br
-int free_fieldtype(FIELDTYPE *fieldtype);
-.br
-int set_fieldtype_arg(
-    FIELDTYPE *fieldtype,
-    void *(* const make_arg)(va_list *),
-    void *(* const copy_arg)(const void *),
-    void  (* const free_arg)(void *));
-.br
-int set_fieldtype_choice(
-    FIELDTYPE *fieldtype,
-    bool (* const next_choice)(FIELD *, const void *),
-    bool (* const prev_choice)(FIELD *, const void *));
-.br
-FIELDTYPE *link_fieldtype(FIELDTYPE *type1,
-                          FIELDTYPE *type2);
+\fBint free_fieldtype(FIELDTYPE *\fP\fIfieldtype\fP\fB);\fP
+.sp
+\fBint set_fieldtype_arg(\fP
+    \fBFIELDTYPE *\fP\fIfieldtype\fP\fB,\fP
+    \fBvoid *(* const \fP\fImake_arg\fP\fB)(va_list *),\fP
+    \fBvoid *(* const \fP\fIcopy_arg\fP\fB)(const void *),\fP
+    \fBvoid  (* const \fP\fIfree_arg\fP\fB)(void *));\fP
 .br
+\fBint set_fieldtype_choice(\fP
+    \fBFIELDTYPE *\fP\fIfieldtype\fP\fB,\fP
+    \fBbool (* const \fP\fInext_choice\fP\fB)(FIELD *, const void *),\fP
+    \fBbool (* const \fP\fIprev_choice\fP\fB)(FIELD *, const void *));\fP
+.sp
+\fBFIELDTYPE *link_fieldtype(FIELDTYPE *\fP\fItype1\fP\fB,\fP
+                          \fBFIELDTYPE *\fP\fItype2\fP\fB);\fP
 .SH DESCRIPTION
 The function \fBnew_fieldtype\fR creates a new field type usable for data
-validation.  You supply it with \fIfield_check\fR, a predicate to check the
+validation.
+You supply it with \fIfield_check\fR, a predicate to check the
 validity of an entered data string whenever the user attempts to leave a field.
 The (FIELD *) argument is passed in so the validation predicate can see the
 field's buffer, sizes and other attributes; the second argument is an
@@ -69,8 +70,8 @@ the character to be checked and a pointer to an argument-block structure.
 The function \fBfree_fieldtype\fR frees the space allocated for a given
 validation type.
 .PP
-The function \fBset_fieldtype_arg\fR associates three storage-management functions
-with a field type.
+The function \fBset_fieldtype_arg\fR associates
+three storage-management functions with a field type.
 The \fImake_arg\fR function is automatically applied to the
 list of arguments you give \fBset_field_type\fR when attaching validation
 to a field; its job is to bundle these into an allocated argument-block
@@ -97,7 +98,7 @@ These functions take the field pointer and an
 argument-block structure as arguments.
 .SH RETURN VALUE
 The pointer-valued routines return NULL on error.
-They set errno according to their success:
+They set \fBerrno\fP according to their success:
 .TP 5
 .B E_OK
 The routine succeeded.
@@ -124,7 +125,7 @@ The field is already connected to a form.
 The field is the current field.
 .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).
 .SH NOTES
@@ -135,8 +136,9 @@ All of the \fB(char *)\fR arguments of these functions should actually be
 \fB(void *)\fR.  The type has been left uncorrected for strict compatibility
 with System V.
 .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.