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

Ftypcvt (3FML)

Ftypcvt (3FML)

Name

Ftypcvt, Ftypcvt32-convert from one field type to another

Synopsis

#include <stdio.h>  
#include "fml.h"

char *
Ftypcvt(FLDLEN *tolen, int totype, char *fromval, int fromtype,
FLDLEN fromlen)

#include "fml32.h"

char *
Ftypcvt32(FLDLEN32 *tolen, int totype, char *fromval, int fromtype,
FLDLEN32 fromlen)

Description

Ftypcvt() converts the value *fromval, which has type fromtype, and length fromlen (if fromtype is FLD\_CARRAY; otherwise, fromlen is inferred from fromtype), to a value of type totype. Ftypcvt() returns a pointer to the converted value, and sets *tolen to the converted length, upon success. Upon failure, Ftypcvt() returns NULL.

Ftypcvt32 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, Ftypcvt() fails and sets Ferror to:

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

[FEINVAL]
"invalid argument to function"
One of the arguments to the function invoked was invalid, (for example, a NULL tolen or fromval parameter was specified).

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

See Also

Fintro(3), CFadd(3), CFchg(3), CFget(3), CFgetalloc(3), CFfind(3)



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