PURPOSE
Fextread, Fextread32 - build fielded buffer from
printed format
SYNOPSIS
#include <stdio.h>
#include "fml.h"
int
Fextread(FBFR *fbfr, FILE *iop)
#include "fml32.h"
int
Fextread32(FBFR32 *fbfr, FILE *iop)
DESCRIPTION
Fextread() may be used to construct a fielded
buffer from its printed format (that is, from the output of Fprint(3fml)).
The parameters are a pointer to a fielded buffer, fbfr,
and a pointer to a file stream, iop. The input file format
is basically the same as the output format of Fprint(3fml),
that is: [flag] fldname or fldid
<tab> fldval (or fldname, if flag is
"=")
The optional flags and their meanings are as follows:
- +
- occurrence 0 of the field in the fielded buffer should be
changed to the value provided.
-
- -
- occurrence 0 of the field named should be deleted from
the fielded buffer. The tab character is required; any
field value is ignored.
-
- =
- In this case, the last field on the input line is the
name of a field in the fielded buffer. The value of
occurrence 0 of that field should be assigned to
occurrence 0 of the first field named on the input line.
-
- #
- the line is treated as a comment and is ignored.
If no flag is specified, a new occurrence of the field
named by fldname with value fldval is added to the
fielded buffer. A trailing newline (\n) must be
provided following each completed input buffer.
Fextread32 is used with 32-bit FML.
RETURN VALUES
This function returns -1 on error and sets Ferror
to indicate the error condition.
ERRORS
Under the following conditions, Fextread() fails and sets Ferror
to:
- [FALIGNERR]
- "fielded buffer not aligned"
The buffer does not begin on the proper boundary.
-
- [FNOTFLD]
- "buffer not fielded"
The buffer is not a fielded buffer or has not been
initialized by Finit().
-
- [FNOSPACE]
- "no space in fielded buffer"
A field value is to be added or changed in a field buffer
but there is not enough space remaining in the buffer.
-
- [FBADFLD]
- "unknown field number or type"
A field number is specified which is not valid.
-
- [FEUNIX]
- "UNIX system call error"
A UNIX system call error occurred. The external integer
errno should have been set to indicate the error by the
system call, and the external integer Uunixerr (values
defined in Uunix.h) is set to the system call
that returned the error.
-
- [FBADNAME]
- "unknown field name"
A field name is specified which cannot be found in the
field tables.
-
- [FSYNTAX]
- "bad syntax in format"
A syntax error was found in the external buffer format.
Possible errors are: an unexpected end-of-file indicator,
input lines not in the form fieldid or name
<tab> value two control characters, field
values greater than 1000 characters, or an invalid hex
escape sequence.
-
- [FNOTPRES]
- "field not present"
A field to be deleted is not found in the fielded buffer.
-
- [FMALLOC]
- "malloc failed"
Allocation of space dynamically using malloc(3) failed.
-
- [FEINVAL]
- "invalid parameter"
The value of iop is NULL.
PORTABILTY
This function is not supported using the TUXEDO System /WS DLL
for OS/2 and Microsoft Windows.
SEE ALSO
Fintro(3fml),
Fprint(3fml)