1form_field_buffer(3X)                                    form_field_buffer(3X)
2
3
4

NAME

6       form_field_buffer - field buffer control
7

SYNOPSIS

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

DESCRIPTION

17       The  function  set_field_buffer  sets  the numbered buffer of the given
18       field to contain a given string:
19
20          -  Buffer 0 is the displayed value of the field.
21
22          -  Other numbered buffers may be allocated by  applications  through
23             the nbuf argument of (see form_field_new(3X)) but are not manipu‐
24             lated by the forms library.
25
26       The function field_buffer returns a pointer  to  the  contents  of  the
27       given numbered buffer:
28
29          -  The  buffer  contents always have the same length, and are padded
30             with trailing spaces as needed to ensure this length is the same.
31
32          -  The buffer may contain leading spaces, depending on  how  it  was
33             set.
34
35          -  The  buffer  contents are set with set_field_buffer, or as a side
36             effect of any editing operations on the corresponding field.
37
38          -  Editing operations are based on the  window  which  displays  the
39             field,  rather than a string.  The window contains only printable
40             characters, and is filled with blanks.  If you want the raw data,
41             you  must write your own routine that copies the value out of the
42             buffer and removes the leading and trailing spaces.
43
44          -  Because editing operations change the content of  the  buffer  to
45             correspond  to  the  window, you should not rely on using buffers
46             for long-term storage of form data.
47
48       The function set_field_status sets the associated status flag of field;
49       field_status  gets  the  current  value.   The  status flag is set to a
50       nonzero value whenever the field changes.
51
52       The function set_max_field sets the maximum size for a  dynamic  field.
53       An argument of 0 turns off any maximum size threshold for that field.
54

RETURN VALUE

56       The field_buffer function returns NULL on error.  It sets errno accord‐
57       ing to their success:
58
59       E_OK The routine succeeded.
60
61       E_BAD_ARGUMENT
62            Routine detected an incorrect or out-of-range argument.
63
64       The field_status function returns TRUE or FALSE.
65
66       The remaining routines return one of the following:
67
68       E_OK The routine succeeded.
69
70       E_SYSTEM_ERROR
71            System error occurred (see errno).
72
73       E_BAD_ARGUMENT
74            Routine detected an incorrect or out-of-range argument.
75

SEE ALSO

77       curses(3X) and related pages whose names  begin  "form_"  for  detailed
78       descriptions of the entry points.
79

NOTES

81       The header file <form.h> automatically includes the header file
82
83       When  configured for wide-characters, field_buffer returns a pointer to
84       temporary storage (allocated and freed by the library).   The  applica‐
85       tion  should  not  attempt to modify the data.  It will be freed on the
86       next call to field_buffer to return the same buffer.  <curses.h>.
87

PORTABILITY

89       These routines emulate the System V forms library.  They were not  sup‐
90       ported on Version 7 or BSD versions.
91

AUTHORS

93       Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric S.
94       Raymond.
95
96
97
98                                                         form_field_buffer(3X)
Impressum