uputblob
Used during Fetch to send the segmented data to the Uniface kernel.
void
uputblob
(uc, fnum, segdata,
seglen, nextseg)
struct uctrl
*uc;
int
fnum;
unsigned char
*segdata;
long
seglen;
int
nextseg;
Parameters
- uc—address of the current control block.
- fnum—field number of the segmented pointer field.
- segdata—pointer to the memory allocated by the connector where the Uniface kernel can read the segmented field data.
- seglen—length of the segment being sent to the Uniface kernel.
- nextseg—NULL when sending the first segment to the Uniface kernel. Not NULL when sending the next segment.
Return Values
Not applicable.
Description
Used during Fetch
to send the segmented data to the Uniface kernel. The DBMS connector
continues to call uputblob
until
all the data is sent, always setting seglen to
the actual amount of data passed.
You can use the following variables:
struct uctrl *ControlBlock; /* UNIFACE connector control block */ *pointer /* struct ufldlst *FieldList; /* Pointer to array of field list */ /* structures */ unsigned char Segment[MAXSEGSIZE]; /* Buffer to store segments of */ /* segmented field */ long SegmentLength; /* Actual length of segment */ int FieldNumber; /* Field number of segmented pointer */ /* field */ int NextSegmentFlag; /* Flag to differentiate between first */ /* and subsequent segments */
Sample code fragment for uputblob
:
for (FieldList = ControlBlock->uflist, FieldNumber = 0; FieldNumber < ControlBlock->ufnum; FieldNumber++, FieldList++) { if (!(FieldList–>ufbits & 8)) continue; /* Not a segmented field */ NextSegmentFlag = 0; /* Indicate first segment */ do { SegmentLength = GetSegmentFromDB(Segment); /* Fictitious routine to get */ /* segmented field segments from */ /* the database */ if (SegmentLength) /* Segments are available */ { uputblob(ControlBlock, FieldNumber, Segment, SegmentLength, NextSegmentFlag); /* Give segments to UNIFACE */ } NextSegmentFlag = 1; } while (SegmentLength); }