Fojoin, Fojoin32 - outer join source into destination buffer
#include <stdio.h> #include "fml.h" int Fojoin(FBFR *dest, FBFR *src) #include "fml32.h" int Fojoin32(FBFR32 *dest, FBFR32 *src)
Fojoin() is similar to Fjoin(3fml), but it keeps fields from the destination buffer, dest, that have no corresponding fieldid/occurrence in the source buffer, src. Fields that exist in the source buffer that have no corresponding fieldid/occurrence in the destination buffer are not added to the destination buffer.
As with Fjoin(3fml), this function can fail for lack of space; it can be re-issued again after allocating more space to complete the operation.
Fojoin32 is used with 32-bit FML.
This function returns -1 on error and sets Ferror to indicate the error condition.
Under the following conditions, Fojoin() fails and sets Ferror to:
In the following example,
if(Fojoin(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 contain the source field value A, the destination field value B,the source field value C, and the second destination field value C.