NWSMSetNewRecordHeader

Creates a record or a subrecord header.

Syntax

  #include <smsutapi.h> 
   
  CCODE NWSMSetNewRecordHeader( 
     BUFFERPTR  *buffer, 
     UINT32     *bufferSize, 
     UINT32     *bufferData, 
     NWBOOLEAN   setCRC, 
     NWSM_RECORD_HEADER_INFO 
                *recordHeaderInfo);
  

Parameters

buffer

(OUT) Points to the beginning of the buffer to contain the SIDF data set header on input. Points to where the data set data should be placed on output.

bufferSize

(IN/OUT) Points to the amount of free space in buffer.

bufferData

(IN/OUT) Points to the total number of bytes written to buffer.

setCRC

(IN) Specifies the CRC flag:

  • CRC_NO The CRC field is set to zero.
  • CRC_YES A CRC value is calculated for the entire data set.
  • CRC_LATER The engine will generate the CRC value.
recordHeaderInfo

(IN/OUT) Points to the data for the record header and data set information.

Return Values

The following table lists the return values associated with the function.

0x00000000

Successful

0xFFFBFFFD

NWSMUT_INVALID_PARAMETER

0xFFFBFFFA

NWSM_BUFFER_OVERFLOW

0xFFFBFFF0

NWSM_BUFFER_UNDERFLOW

Remarks

If a record is being created, set recordHeaderInfo.isSubRecord to FALSE. When NWSMSetNewRecordHeader is called, a data set header is created and placed into buffer. The data set information is formatted according to SIDF and placed, along with the data set' s data, after the header.

If a subrecord is being created, set recordHeaderInfo.isSubRecord to TRUE. When NWSMSetNewRecordHeader is called, a data set subheader is created and placed into buffer. Call NWSMUpdateRecordHeader to place the rest of the data into buffer.

If buffer already contains 36 KB of data, bufferData must be set to 32 KB. NWSMSetNewRecordHeader will add the number of bytes copied into buffer to the current value.

If CRC is specified, the CRC data for the last section field is set to zero.

The following figure shows the buffer area represented by bufferData and bufferSize:

The buffer area represented by bufferData and bufferSize

See Also

NWSMUpdateRecordHeader