Returns only the record/subrecord header information.
#include <smsutapi.h> CCODE NWSMGetRecordHeaderOnly ( BUFFERPTR *buffer, UINT32 *bufferSize, NWSM_RECORD_HEADER_INFO *recordHeaderInfo);
(IN/OUT) Points to the beginning of the SIDF data or subdata set in a transfer buffer on input. Points to the data set data on output.
(IN/OUT) Points to the size of the transfer buffer minus the transfer buffer header size on input. Points to the size of the data left in the transfer buffer on output.
(OUT) Points to the next section (record or subrecord).
The following table lists the return values associated with the function.
To get the data set information and data set data, call NWSMGetDataSetInfo.
NWSMGetRecordHeaderOnly indicates one of two conditions: a new record or a record containing data that spans a transfer buffer.
A new record is indicated as follows:
recordHeaderInfo->isSubRecord = FALSE; recordHeaderInfo->dataSetInfoRetrieved = DATA_SET_INFO_NOT_STARTED;
A record containing spanned data is indicated as follows:
recordHeaderInfo->isSubRecord = TRUE; recordHeaderInfo->dataSetInfoRetrieved = DATA_SET_INFO_DOES_NOT_EXIST;
/* Simplified example from the FILES.C file. It assumes that there is a media transfer buffer, and that it starts on the first record. */ UINT32 bufferSize, maxTransferBufferSize, transferBufferDataOffset; BUFFERPTR bufferPtr; NWSM_RECORD_HEADER_INFO recordHeaderInfo = {0}; while(there are buffers on the media) { /* This function is not defined. It gets the next transfer buffer from the media and points to the beginning of the transfer buffer. */ GetTheNextBuffer(&bufferPtr); /* Point to the transfer buffer data. maxTransferBufferSize and transferBufferDataOffset are returned by NWSMSDSessionOpenForReading.*/ bufferSize = maxTransferBufferSize - transferBufferDataOffset; bufferPtr += bufferSize; while (bufferSize) /* While there is data in the transfer buffer. */ { /* Get the next record/subrecord from the transfer buffer. */ NWSMGetRecordHeaderOnly(&bufferPtr, &bufferSize, &recordHeaderInfo); /* If a record/subrecord, get the data from the transfer buffer. Note: DATA_SET_INFO_SPANNED is set by NWSMGetDataSetInfo. */ if ((recordHeaderInfo.dataSetInfoRetrieved==DATA_SET_INFO_NOT_STARTED) || (recordHeaderInfo.dataSetInfoRetrieved == DATA_SET_INFO_SPANNED)) NWSMGetDataSetInfo(&bufferPtr, &bufferSize, &recordHeaderInfo); if (!bufferSize) break; /* All data retrieved from current transfer buffer. Break and get the next transfer buffer. */ if (recordHeaderInfo.dataSetInfoRetrieved == DATA_SET_INFO_COMPLETE) { /* dataSetName and scanInformation can now be used. */ } /* Update the buffer's information. */ bufferPtr += recordHeaderInfo.recordSize; bufferSize -= recordHeaderInfo.recordSize; } /* end while(bufferSize) */ }