BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   Tuxedo Doc Home   |   Programming   |   Topic List   |   Previous   |   Next   |   Contents

   Programming a BEA Tuxedo Application Using FML

VIEWS Functions

Fvftos

This function transfers data from a fielded buffer to a C structure using a specified view description.

int
Fvftos(FBFR *fbfr, char *cstruct, char *view)

Here:

If the named view is not found, Fvftos returns -1, and Ferror is set to FBADVIEW.

When data is being transferred from a fielded buffer to a C structure, the following rules apply:

For example, the following code puts string1 into cust.action[0] and abc into cust.bug[0]. All other members in the cust structure should contain null values.

#include <stdio.h>
#include "fml.h"
#include "custdb.flds.h"
#include "custdb.h"
struct custdb cust;
FBFR *fbfr;
. . .
fbfr = Falloc(800,1000);
Fvinit((char *)&cust,"custdb"); /* initialize cust */
str = "string1";
Fadd(fbfr,ACTION,str,(FLDLEN)8);
str = "abc";
Fadd(fbfr,BUG_CURS,str,(FLDLEN)4);
Fvftos(fbfr,(char *)&cust,"custdb");
. . .

View custdb is defined in VIEWS Examples in FML and VIEWS Examples.

For more information, refer to Fvftos, Fvftos32(3fml) in the BEA Tuxedo FML Function Reference.

Fvstof

This function transfers data from a C structure to a fielded buffer using a specified view description.

int
Fvstof(FBFR *fbfr, char *cstruct, int mode, char *view)

Here:

The transfer process obeys the rules listed under the FML function corresponding to the mode parameter: Fupdate, Fjoin, Fojoin, or Fconcat.

If the named view is not found, Fvstof returns -1, and Ferror is set to FBADVIEW.

Note: Null values are not transferred from a structure member to a fielded buffer. That is, during a structure-to-field transfer, if a structure member contains the (default or user-specified) null value defined for that member, the member is ignored.

For more information, refer to Fvftos, Fvftos32(3fml) in the BEA Tuxedo FML Function Reference.

Fvnull

Fvnull is used to determine whether an occurrence in a C structure contains the null value for that field.

int
Fvnull(char *cstruct, char *cname, FLDOCC oc, char *view)

Here:

Fvnull returns:

For more information, refer to Fvnull, Fvnull32(3fml) in the BEA Tuxedo FML Function Reference.

Fvsinit

This function initializes all elements in a C structure to their appropriate null value.

int
Fvsinit(char *cstruct, char *view)

Here:

For more information, refer to Fvsinit, Fvsinit32(3fml) in the BEA Tuxedo FML Function Reference.

Fvopt

This function allows users to change flag options at run time.

int
Fvopt(char *cname, int option, char *view)

Here:

The following list describes possible values for the option parameter.

F_FTOS

Allows one-way mapping from fielded buffers to C structures. Similar to the S option in view descriptions.

F_STOF

Allows one-way mapping from C structures to fielded buffers. Similar to the F option in view descriptions.

F_BOTH

Allows two-way mapping between C structures and fielded buffers.

F_OFF

Turns off mapping of the specified member. Similar to the N option in view descriptions.

Note that changes to view descriptions are not permanent. They are guaranteed only until another view description is accessed.

For more information, refer to Fvopt, Fvopt32(3fml) in the BEA Tuxedo FML Function Reference.

Fvselinit

This function initializes an individual member of a C structure to its appropriate null value. It sets the ACM of the element to 0, if the C flag is used in the view file; it sets the ALMs to the length of the associated null value, if the L flag is used in the view file.

int
Fvselinit(char *cstruct, char *cname, char *view)

Here:

For more information, refer to Fvselinit, Fvselinit32(3fml) in the BEA Tuxedo FML Function Reference.