BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   Tuxedo Doc Home   |   Reference   |   Topic List   |   Previous   |   Next   |   Contents

   BEA Tuxedo FML Function Reference

Fextread, Fextread32(3fml)

Name

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()). 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(), that is:

[flag] fldname or fldid tab> fldval (or fldname, if flag is \Q\Q='')

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 (-) must be provided after each completed input buffer.

For values of type FLD_FML32 and FLD_VIEW32, Fextread32() generates nested FML32 buffers and VIEW32 fields, respectively. This function ignores the FLD_PTR field type. No error is returned if a value of type FLD_PTR is supplied to the function.

Fextread32() is used with 32-bit FML.

A thread in a multithreaded application may issue a call to Fextread() or Fextread32() while running in any context state, including TPINVALIDCONTEXT.

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() failed.

[FEINVAL]

"invalid parameter"
The value of iop is NULL.

Portability

This function is not supported using the BEA Tuxedo System Workstation DLL for OS/2 and Microsoft Windows.

See Also

Introduction to FML Functions, Fprint, Fprint32(3fml)