PURPOSE

Fvsinit, Fvsinit32 - initialize C structure to null

SYNOPSIS


#include <stdio.h>
#include "fml.h"
int
Fvsinit(char *cstruct, char *view)
#include "fml32.h"
int
Fvsinit32(char *cstruct, char *view)

DESCRIPTION

Fvsinit() initializes all members in a C structure to the null values specified in the view description, view. cstruct is a pointer to a C structure. view is a pointer to a compiled view description.

Fvsinit() sets the associated count member of an element to 0 if the C flag was used when the view was compiled, and sets the associated length member to the length of the associated null value if the L flag was used in the view file.

Fvsinit32 is used for views defined with viewc32 or VIEW32 typed buffers for larger views with more fields.

RETURN VALUES

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

ERRORS

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

[FEINVAL]
"invalid argument to function"
One of the arguments to the function invoked was invalid, (for example, specifying a NULL cstruct parameter invalid Fvsinit).
 
[FBADVIEW]
"cannot find or get view"
The view description specified was NULL or was not found in the files specified by VIEWDIR or VIEWFILES.

SEE ALSO

Fintro(3fml),
Fvselinit(3fml),
viewfile(5)