PURPOSE

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(3fml),
CFadd(3fml),
CFchg(3fml),
CFget(3fml),
CFgetalloc(3fml),
CFfind(3fml)