Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

gd_madd_spec(3) [debian man page]

gd_add_spec(3)							      GETDATA							    gd_add_spec(3)

NAME
gd_add_spec, gd_madd_spec -- add a field to a dirfile SYNOPSIS
#include <getdata.h> int gd_add_spec(DIRFILE *dirfile, const char *line, int fragment_index); int gd_madd_spec(DIRFILE *dirfile, const char *line, const char *parent); DESCRIPTION
The gd_add_spec() function adds the field described by the field specification line in line to the dirfile specified by dirfile. The gd_madd_spec() function behaves similarly, but adds the field as a metafield under the field indicated by the field parent. Field specifi- cation lines are described in detail in dirfile-format(5). Since Standards Version 7 (see dirfile(5)) permits specifying metafield without the use of the /META directive, gd_add_spec() may also be used to add metafields, by specifying the metafield's full field code. See dirfile-format(5) for full details. When using gd_madd_spec(), line should only contain a field specification, and not a /META directive. Passing these functions a directive line instead of a field specification line will result in a syntax error. These functions never call the registered parser callback function, even if line contains a syntax error. RETURN VALUE
On success, gd_add_spec() and gd_madd_spec() return zero. On error, -1 is returned and the dirfile error is set to a non-zero error val- ue. Possible error values are: GD_E_ACCMODE The specified dirfile was opened read-only. GD_E_ALLOC The library was unable to allocate memory. GD_E_BAD_CODE The parent field code was not found, or was already a metafield. GD_E_BAD_DIRFILE The supplied dirfile was invalid. GD_E_BAD_INDEX The fragment_index argument was out of range. GD_E_FORMAT A syntax error was encountered in line. GD_E_LINE_TOO_LONG The supplied line was longer than the parser was able to deal with. Lines are limited by the storage size of ssize_t. On 32-bit systems, this limits line to 2**31 bytes. The limit is larger on 64-bit systems. GD_E_PROTECTED The metadata of the fragment was protected from change. Or, the creation of a RAW field was attempted and the data of the fragment was protected. GD_E_RAW_IO An I/O error occurred while creating an empty binary file to be associated with a newly added RAW field. GD_E_UNKNOWN_ENCODING The encoding scheme of the indicated format specification fragment is not known to the library. As a result, the library was un- able to create an empty binary file to be associated with a newly added RAW field. GD_E_UNSUPPORTED The encoding scheme of the indicated format specification fragment does not support creating an empty binary file to be associated with a newly added RAW field. The dirfile error may be retrieved by calling gd_error(3). A descriptive error string for the last error encountered can be obtained from a call to gd_error_string(3). SEE ALSO
gd_add(3), gd_add_bit(3), gd_add_carray(3), gd_add_const(3), gd_add_divide(3), gd_add_lincom(3), gd_add_linterp(3), gd_add_multiply(3), gd_add_phase(3), gd_add_recip(3), gd_add_raw(3), gd_error(3), gd_error_string(3), gd_madd(3), gd_madd_bit(3), gd_madd_carray(3), gd_madd_const(3), gd_madd_divide(3), gd_madd_lincom(3), gd_madd_linterp(3), gd_madd_multiply(3), gd_madd_phase(3), gd_madd_polynom(3), gd_madd_recip(3), gd_madd_string(3), gd_metaflush(3), gd_open(3), dirfile-format(5) Version 0.7.0 4 November 2010 gd_add_spec(3)

Check Out this Related Man Page

gd_reference(3) 						      GETDATA							   gd_reference(3)

NAME
gd_reference -- retrieve or set the reference field for a dirfile SYNOPSIS
#include <getdata.h> const char *gd_reference(DIRFILE *dirfile, const char *field_code); DESCRIPTION
The gd_reference() function sets or retrieves the reference field (see dirfile(5)) associated with the dirfile specified by dirfile. If the field_code argument is non-NULL, the reference field for the dirfile will be set to the field specified. If field_code is NULL, the reference field is not modified. The field code should refer to a RAW field, and may not contain a representation suffix. RETURN VALUE
On success, gd_reference() returns the field code of the dirfile's reference field, which will be field_code, if field_code is non-NULL. If no RAW fields are defined in the dirfile, this function will return NULL, without raising an error. On error, NULL is returned and the dirfile error is set to a non-zero error value. Possible error values are: GD_E_ACCMODE The specified dirfile was opened read-only. GD_E_ALLOC The library was unable to allocate memory. GD_E_BAD_CODE The field specified by field_code was not found. GD_E_BAD_DIRFILE The supplied dirfile was invalid. GD_E_BAD_FIELD_TYPE The field specified by field_code was not a RAW field. GD_E_PROTECTED The metadata of the primary format specification fragment (the file named format in the root dirfile directory) was protected from change. The dirfile error may be retrieved by calling gd_error(3). A descriptive error string for the last error encountered can be obtained from a call to gd_error_string(3). SEE ALSO
gd_metaflush(3), gd_open(3), gd_error(3), gd_error_string(3), dirfile(5), dirfile-format(5) Version 0.7.0 20 July 2010 gd_reference(3)
Man Page