![]() |
![]() |
|
|
Fproj, Fproj32(3fml)
Name
Fproj(), Fproj32() - projection on buffer
Synopsis
#include <stdio.h>
#include "fml.h"
int
Fproj(FBFR *fbfr, FLDID *fieldid)
#include "fml32.h"
int
Fproj32(FBFR32 *fbfr, FLDID32 *fieldid)
Description
Fproj() is used to update a buffer so as to keep only the desired fields. fbfr is a pointer to a fielded buffer. The desired fields are specified in an array of field identifiers pointed to by fieldid. The last entry in the array must be BADFLDID. The update is done in place; fields that are not in the result of the projection are deleted from the fielded buffer. The array of field identifiers may be rearranged. (If they are not already in numeric order, they are sorted.) If updating buffers results in the removal of a FLD_PTR field, the memory area referenced by the pointer is not modified or freed.
Fproj32() is used with 32-bit FML.
A thread in a multithreaded application may issue a call to Fproj() or Fproj32() 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, Fproj() fails and sets Ferror to:
The buffer does not begin on the proper boundary.
The buffer is not a fielded buffer or has not been initialized by Finit().
Example
#include "fld.tbl.h"
FBFR *fbfr;
FLDID fieldid[20];
...
fieldid[0] = A; /* field ID for field A */
fieldid[1] = D; /* field ID for field D */
fieldid[2] = BADFLDID; /* sentinel value */
...
if(Fproj(fbfr, fieldid) 0)
F_error("pgm_name");
If the buffer has fields A, B, C, and D, the example results in a buffer that contains only occurrences of fields A and D. The entries in the array of field identifiers do not need to be in any specific order, but the last value in the array of field identifiers must be field identifier 0 (BADFLDID).
See Also
Introduction to FML Functions, Fjoin, Fjoin32(3fml), Fojoin, Fojoin32(3fml), Fprojcpy, Fprojcpy32(3fml)
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|