2 .\"***************************************************************************
3 .\" Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. *
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: *
13 .\" The above copyright notice and this permission notice shall be included *
14 .\" in all copies or substantial portions of the Software. *
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. *
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 *
28 .\"***************************************************************************
30 .\" $Id: form_field_buffer.3x,v 1.15 2008/10/18 18:35:17 tom Exp $
31 .TH form_field_buffer 3X ""
33 \fBform_field_buffer\fR - field buffer control
35 \fB#include <form.h>\fR
37 int set_field_buffer(FIELD *field, int buf, const char *value);
39 char *field_buffer(const FIELD *field, int buffer);
41 int set_field_status(FIELD *field, bool status);
43 bool field_status(const FIELD *field);
45 int set_max_field(FIELD *field, int max);
48 The function \fBset_field_buffer\fR sets the numbered buffer of the given field
49 to contain a given string:
53 Buffer 0 is the displayed value of the field.
56 Other numbered buffers may be allocated by applications through the \fBnbuf\fR
57 argument of (see \fBform_field_new\fR(3X))
58 but are not manipulated by the forms library.
61 The function \fBfield_buffer\fR returns a pointer to
62 the contents of the given numbered buffer:
66 The buffer contents always have the same length,
67 and are padded with trailing spaces
68 as needed to ensure this length is the same.
71 The buffer may contain leading spaces, depending on how it was set.
74 The buffer contents are set with \fBset_field_buffer\fP,
75 or as a side effect of any editing operations on the corresponding field.
78 Editing operations are based on the \fIwindow\fP which displays the field,
79 rather than a \fIstring\fP.
80 The window contains only printable characters, and is filled with blanks.
81 If you want the raw data, you must write your
82 own routine that copies the value out of the buffer and removes the leading
86 Because editing operations change the content of the buffer to
87 correspond to the window, you should not rely on using buffers
88 for long-term storage of form data.
91 The function \fBset_field_status\fR sets the associated status flag of
92 \fIfield\fR; \fBfield_status\fR gets the current value. The status flag
93 is set to a nonzero value whenever the field changes.
95 The function \fBset_max_field\fR sets the maximum size for a dynamic field.
96 An argument of 0 turns off any maximum size threshold for that field.
98 The \fBfield_buffer\fR function returns NULL on error.
99 It sets errno according to their success:
102 The routine succeeded.
105 Routine detected an incorrect or out-of-range argument.
107 The \fBfield_status\fR function returns \fBTRUE\fR or \fBFALSE\fR.
109 The remaining routines return one of the following:
112 The routine succeeded.
115 System error occurred (see \fBerrno\fR).
118 Routine detected an incorrect or out-of-range argument.
120 \fBcurses\fR(3X) and related pages whose names begin "form_" for detailed
121 descriptions of the entry points.
123 The header file \fB<form.h>\fR automatically includes the header file
125 When configured for wide-characters, \fBfield_buffer\fP returns a pointer
126 to temporary storage (allocated and freed by the library).
127 The application should not attempt to modify the data.
128 It will be freed on the next call to \fBfield_buffer\fP to return the
132 These routines emulate the System V forms library. They were not supported on
133 Version 7 or BSD versions.
135 Juergen Pfeifer. Manual pages and adaptation for new curses by Eric
138 .\"# The following sets edit modes for GNU EMACS
139 .\"# Local Variables: