1form_field_buffer(3X) form_field_buffer(3X)
2
3
4
6 form_field_buffer - field buffer control
7
9 #include <form.h>
10 int set_field_buffer(FIELD *field, int buf, const char *value);
11 char *field_buffer(const FIELD *field, int buffer);
12 int set_field_status(FIELD *field, bool status);
13 bool field_status(const FIELD *field);
14 int set_max_field(FIELD *field, int max);
15
17 The function set_field_buffer sets the numbered buffer of the given
18 field to contain a given string. Buffer 0 is the displayed value of
19 the field; other numbered buffers may be allocated by applications
20 through the nbuf argument of (see form_field_new(3X)) but are not
21 manipulated by the forms library. The function field_buffer returns
22 the address of the buffer. Please note that this buffer has always the
23 length of the buffer, that means that it may typically contain trailing
24 spaces. If you entered leading spaces the buffer may also contain them.
25 If you want the raw data, you must write your own routine that copies
26 the value out of the buffer and removes the leading and trailing spa‐
27 ces. Please note also, that subsequent operations on the form will
28 probably change the content of the buffer. So do not use it for long
29 term storage of the entered form data.
30
31 The function set_field_status sets the associated status flag of field;
32 field_status gets the current value. The status flag is set to a
33 nonzero value whenever the field changes.
34
35 The function set_max_field sets the maximum size for a dynamic field.
36 An argument of 0 turns off any maximum size threshold for that field.
37
39 The field_buffer function returns NULL on error. It sets errno accord‐
40 ing to their success:
41
42 E_OK The routine succeeded.
43
44 E_BAD_ARGUMENT
45 Routine detected an incorrect or out-of-range argument.
46
47 The field_status function returns TRUE or FALSE.
48
49 The remaining routines return one of the following:
50
51 E_OK The routine succeeded.
52
53 E_SYSTEM_ERROR
54 System error occurred (see errno).
55
56 E_BAD_ARGUMENT
57 Routine detected an incorrect or out-of-range argument.
58
60 curses(3X) and related pages whose names begin "form_" for detailed
61 descriptions of the entry points.
62
64 The header file <form.h> automatically includes the header file
65
66 When configured for wide-characters, field_buffer returns a pointer to
67 temporary storage (allocated and freed by the library). The applica‐
68 tion should not attempt to modify the data. It will be freed on the
69 next call to field_buffer to return the same buffer. <curses.h>.
70
72 These routines emulate the System V forms library. They were not sup‐
73 ported on Version 7 or BSD versions.
74
76 Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S.
77 Raymond.
78
79
80
81 form_field_buffer(3X)