table of contents
other versions
- wheezy 5.9-10
- jessie 5.9+20140913-1
- testing 6.0+20161126-1
- unstable 6.0+20161126-1
- experimental 6.0+20170408-1
field_buffer(3FORM) | field_buffer(3FORM) |
NAME¶
form_field_buffer - field buffer controlSYNOPSIS¶
#include <form.h>DESCRIPTION¶
The function set_field_buffer sets the numbered buffer of the given field to contain a given string:- •
- Buffer 0 is the displayed value of the field.
- •
- Other numbered buffers may be allocated by applications through the nbuf argument of (see field_new(3FORM)) but are not manipulated by the forms library.
- •
- The buffer contents always have the same length, and are padded with trailing spaces as needed to ensure this length is the same.
- •
- The buffer may contain leading spaces, depending on how it was set.
- •
- The buffer contents are set with set_field_buffer, or as a side effect of any editing operations on the corresponding field.
- •
- Editing operations are based on the window which displays the field, rather than a string. The window contains only printable characters, and is filled with blanks. If you want the raw data, you must write your own routine that copies the value out of the buffer and removes the leading and trailing spaces.
- •
- Because editing operations change the content of the buffer to correspond to the window, you should not rely on using buffers for long-term storage of form data.
RETURN VALUE¶
The field_buffer function returns NULL on error. It sets errno according to their success:- E_OK
- The routine succeeded.
- E_BAD_ARGUMENT
- Routine detected an incorrect or out-of-range argument.
- E_OK
- The routine succeeded.
- E_SYSTEM_ERROR
- System error occurred (see errno).
- E_BAD_ARGUMENT
- Routine detected an incorrect or out-of-range argument.