[Top] [Prev] [Next] [Bottom]

Ffinds (3FML)

Ffinds (3FML)

Name

Ffinds, Ffinds32-return ptr to string representation

Synopsis

#include <stdio.h>  
#include "fml.h"
char *
Ffinds(FBFR *fbfr, FLDID fieldid, FLDOCC oc)
#include "fml32.h"
char *
Ffinds32(FBFR32 *fbfr, FLDID32 fieldid, FLDOCC32 oc)

Description

Ffinds() is provided to handle the case of conversion to a user type of FLD_STRING. fbfr is a pointer to a fielded buffer. fieldid is a field identifier. oc is the occurrence number of the field. The specified field occurrence is found and converted from its type in the buffer to a null-terminated string. Basically, this macro calls its conversion function counterpart, CFfind(3), providing a utype of FLD_STRING, and a ulen of 0. The duration of the validity of the pointer returned by Ffinds() is the same as that described for CFfind(3).

Ffinds32 is used with 32-bit FML.

Return Values

This function returns NULL on error and sets Ferror to indicate the error condition.

Errors

Under the following conditions, Ffinds() 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().

[FNOTPRES]
"field not present"
A field occurrence is requested but the specified field and/or occurrence was not found in the fielded buffer.

[FBADFLD]
"unknown field number or type"
A field identifier is specified which is not valid.

[FTYPERR]
"invalid field type"
A field type is specified which is not valid.

[FMALLOC]
"malloc failed"
Allocation of space dynamically using malloc(3) failed while converting carray to string.

See Also

Fintro(3), CFfind(3), Ffind(3)



[Top] [Prev] [Next] [Bottom]