1form_field_buffer(3X) form_field_buffer(3X)
2
3
4
6 form_field_buffer - field buffer control
7
9 #include <form.h>
10
11 int set_field_buffer(FIELD *field, int buf, const char *value);
12 char *field_buffer(const FIELD *field, int buffer);
13 int set_field_status(FIELD *field, bool status);
14 bool field_status(const FIELD *field);
15 int set_max_field(FIELD *field, int max);
16
18 The function set_field_buffer sets the numbered buffer of the given
19 field to contain a given string:
20
21 · Buffer 0 is the displayed value of the field.
22
23 · Other numbered buffers may be allocated by applications through
24 the nbuf argument of (see form_field_new(3X)) but are not manip‐
25 ulated by the forms library.
26
27 The function field_buffer returns a pointer to the contents of the
28 given numbered buffer:
29
30 · The buffer contents always have the same length, and are padded
31 with trailing spaces as needed to ensure this length is the
32 same.
33
34 · The buffer may contain leading spaces, depending on how it was
35 set.
36
37 · The buffer contents are set with set_field_buffer, or as a side
38 effect of any editing operations on the corresponding field.
39
40 · Editing operations are based on the window which displays the
41 field, rather than a string. The window contains only printable
42 characters, and is filled with blanks. If you want the raw
43 data, you must write your own routine that copies the value out
44 of the buffer and removes the leading and trailing spaces.
45
46 · Because editing operations change the content of the buffer to
47 correspond to the window, you should not rely on using buffers
48 for long-term storage of form data.
49
50 The function set_field_status sets the associated status flag of field;
51 field_status gets the current value. The status flag is set to a
52 nonzero value whenever the field changes.
53
54 The function set_max_field sets the maximum size for a dynamic field.
55 An argument of 0 turns off any maximum size threshold for that field.
56
58 The field_buffer function returns NULL on error. It sets errno accord‐
59 ing to their success:
60
61 E_OK The routine succeeded.
62
63 E_BAD_ARGUMENT
64 Routine detected an incorrect or out-of-range argument.
65
66 The field_status function returns TRUE or FALSE.
67
68 The remaining routines return one of the following:
69
70 E_OK The routine succeeded.
71
72 E_SYSTEM_ERROR
73 System error occurred (see errno).
74
75 E_BAD_ARGUMENT
76 Routine detected an incorrect or out-of-range argument.
77
79 curses(3X) and related pages whose names begin "form_" for detailed
80 descriptions of the entry points.
81
83 The header file <form.h> automatically includes the header file
84
85 When configured for wide characters, field_buffer returns a pointer to
86 temporary storage (allocated and freed by the library). The applica‐
87 tion should not attempt to modify the data. It will be freed on the
88 next call to field_buffer to return the same buffer. <curses.h>.
89
91 These routines emulate the System V forms library. They were not sup‐
92 ported on Version 7 or BSD versions.
93
95 Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S.
96 Raymond.
97
98
99
100 form_field_buffer(3X)