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