BEA Logo BEA Tuxedo Release 7.1

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

 

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

   BEA Tuxedo FML Function Reference

Fjoin, Fjoin32(3fml)

Name

Fjoin(), Fjoin32() - join source into destination buffer

Synopsis

#include stdio.h> 
#include "fml.h"
int
Fjoin(FBFR *dest, FBFR *src)
#include "fml32.h"
int
Fjoin32(FBFR32 *dest, FBFR32 *src)

Description

Fjoin() is used to join two fielded buffers based on matching fieldid/occurrence. dest and src are pointers to the destination and source fielded buffers respectively. For fields that match on fieldid/occurrence, the field value is updated in the destination buffer with the value in the source buffer. Fields in the destination buffer that have no corresponding fieldid/occurrence in the source buffer are deleted. If joining buffers results in the removal of a FLD_PTR field, the memory area referenced by the pointer is not modified or freed.

This function may fail due to lack of space if the new values are larger than the old; in this case, the destination buffer is modified. If this happens, however, the destination buffer may be re-allocated using Frealloc() and repeated calls to the Fjoin() function. Even if the destination buffer has been partially updated, the correct results are obtained by repeating the Fjoin() function.

Fjoin32() is used with 32-bit FML.

A thread in a multithreaded application may issue a call to Fjoin() or Fjoin32() while running in any context state, including TPINVALIDCONTEXT.

Return Values

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

Errors

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

[FALIGNERR]

"fielded buffer not aligned"
Either the source buffer or the destination buffer does not begin on the proper boundary.

[FNOTFLD]

"buffer not fielded"
Either the source buffer or the destination buffer is not a fielded buffer or has not been initialized by Finit().

[FNOSPACE]

"no space in fielded buffer"
A field value is to be added or changed in a field buffer but there is not enough space remaining in the buffer.

Example

In the following example:

FBFR *src, *dest;  ...  if(Fjoin(dest,src)  0)  F_error("pgm_name");

if dest has fields A, B, and two occurrences of C, and src has fields A, C, and D, the resultant dest will have source field value A and source field value C.

See Also

Introduction to FML Functions, Fconcat, Fconcat32(3fml), Fojoin, Fojoin32(3fml), Fproj, Fproj32(3fml), Fprojcpy, Fprojcpy32(3fml), Frealloc, Frealloc32(3fml)