PURPOSE

Falloc, Falloc32 - allocate and initialize fielded buffer

SYNOPSIS

#include <stdio.h>
#include "fml.h"
FBFR *
Falloc(FLDOCC F, FLDLEN V)
#include "fml32.h"
FBFR32 *
Falloc32(FLDOCC32 F, FLDLEN32 V)

DESCRIPTION

Falloc() dynamically allocates space using malloc(3) for a fielded buffer and calls Finit() to initialize it. The parameters are the number of fields, F, and the number of bytes of value space, V, for all fields that are to be stored in the buffer.

Falloc32 is used for larger buffers with more fields.

RETURN VALUES

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

ERRORS

Under the following conditions, Falloc() fails and sets Ferror to:

[FMALLOC]

"malloc failed" Allocation of space dynamically using malloc(3) failed.
[FEINVAL]

"invalid argument to function" One of the arguments to the function invoked was invalid, (for example, number of fields is less than 0, V is 0 or total size is greater than 65534).

SEE ALSO

Fintro(3fml),
Ffree(3fml),
Fielded(3fml),
Finit(3fml),
Fneeded(3fml),
Frealloc(3fml),
Fsizeof(3fml),
Funused(3fml),
malloc(3) in a UNIX system reference manual