NWSMPadBlankSpace

Inserts a blank space section if there is room in the buffer, or fills the unused area of a buffer with zeros.

Syntax

  #include <smsutapi.h> 
   
  void NWSMPadBlankSpace ( 
     BUFFERPTR   bufferPtr, 
     UINT32      unusedSize);
  

Parameters

bufferPtr

(OUT) Points to the area in the buffer to fill with blank spaces or zeros.

unusedSize

(IN) Specifies the size of the area in buffer to pad.

Remarks

If unusedSize is less than MIN_BLANK_SPACE_SECTION_SIZE, the unused area is filled with zeros. If unusedSize is larger than or equal to MIN_BLANK_SPACE_SECTION_SIZE, the Blank Space section is put into the unused area.

NWSMPadBlankSpace Example

  #define BUFFER_SIZE 2048 /* Arbitrary size. */ 
  char buf[BUFFER_SIZE]; 
  BUFFERPTR bufferPtr = buf; 
  UINT32 unusedSize = BUFFER_SIZE; 
   
  /* Put data into buffer pointed to by bufferPtr. */ 
  /* Update buffer information. */ 
  bufferPtr = bufferPtr + amount of data put into buffer; 
  unusedSize -= (bufferPtr - buf); 
   
  /* Pad unused buffer area. */ 
  NWSMPadBlankSpace(bufferPtr, unusedSize);