]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/form_field_buffer.3x
ncurses 5.3
[ncurses.git] / man / form_field_buffer.3x
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright (c) 1998,2002 Free Software Foundation, Inc.                   *
4 .\"                                                                          *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
6 .\" copy of this software and associated documentation files (the            *
7 .\" "Software"), to deal in the Software without restriction, including      *
8 .\" without limitation the rights to use, copy, modify, merge, publish,      *
9 .\" distribute, distribute with modifications, sublicense, and/or sell       *
10 .\" copies of the Software, and to permit persons to whom the Software is    *
11 .\" furnished to do so, subject to the following conditions:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23 .\"                                                                          *
24 .\" Except as contained in this notice, the name(s) of the above copyright   *
25 .\" holders shall not be used in advertising or otherwise to promote the     *
26 .\" sale, use or other dealings in this Software without prior written       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: form_field_buffer.3x,v 1.9 2002/01/19 22:48:23 tom Exp $
31 .TH form_field_buffer 3X ""
32 .SH NAME
33 \fBform_field_buffer\fR - field buffer control
34 .SH SYNOPSIS
35 \fB#include <form.h>\fR
36 .br
37 int set_field_buffer(FIELD *field, int buf, const char *value);
38 .br
39 char *field_buffer(const FIELD *field, int buffer);
40 .br
41 int set_field_status(FIELD *field, bool status);
42 .br
43 bool field_status(const FIELD *field);
44 .br
45 int set_max_field(FIELD *field, int max);
46 .br
47 .SH DESCRIPTION
48 The function \fBset_field_buffer\fR sets the numbered buffer of the given field
49 to contain a given string.  Buffer 0 is the displayed value of the field; other
50 numbered buffers may be allocated by applications through the \fBnbuf\fR
51 argument of (see \fBform_field_new\fR(3X)) but are not manipulated by the forms
52 library.  The function \fBfield_buffer\fR returns the address of the buffer.
53 Please note that this buffer has always the length of the buffer, that means 
54 that it may typically contain trailing spaces. If you entered leading spaces
55 the buffer may also contain them. If you want the raw data, you must write your
56 own routine that copies the value out of the buffer and removes the leading
57 and trailing spaces. Please note also, that subsequent operations on the form
58 will probably change the content of the buffer. So don't use it for long term
59 storage of the entered form data.
60
61 The function \fBset_field_status\fR sets the associated status flag of
62 \fIfield\fR; \fBfield_status\fR gets the current value.  The status flag
63 is set to a nonzero value whenever the field changes.
64
65 The function \fBset_max_field\fR sets the maximum size for a dynamic field.
66 An argument of 0 turns off any maximum size threshold for that field.
67 .SH RETURN VALUE
68 The \fBfield_buffer\fR function returns NULL on error.
69
70 The \fBfield_status\fR function returns \fBTRUE\fR or \fBFALSE\fR.
71
72 The remaining routines return one of the following:
73 .TP 5
74 \fBE_OK\fR
75 The routine succeeded.
76 .TP 5
77 \fBE_SYSTEM_ERROR\fR
78 System error occurred (see \fBerrno\fR).
79 .TP 5
80 \fBE_BAD_ARGUMENT\fR
81 Routine detected an incorrect or out-of-range argument.
82 .SH SEE ALSO
83 \fBcurses\fR(3X) and related pages whose names begin "form_" for detailed
84 descriptions of the entry points.
85 .SH NOTES
86 The header file \fB<form.h>\fR automatically includes the header file
87 \fB<curses.h>\fR.
88 .SH PORTABILITY
89 These routines emulate the System V forms library.  They were not supported on
90 Version 7 or BSD versions.
91 .SH AUTHORS
92 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
93 S. Raymond.
94 .\"#
95 .\"# The following sets edit modes for GNU EMACS
96 .\"# Local Variables:
97 .\"# mode:nroff
98 .\"# fill-column:79
99 .\"# End: