HttpParseBuffer

Parses a given buffer for an index and returns the name and value pair.

Syntax

    #include <httpexp.h>
    
    int HttpParseBuffer (
      char   *pBuffer,
      int     index,
      char   *pzTokenName,
      int    *pzTokenNameMaxLen,
      char   *pzTokenValue,
      int    *pzTokenValueMaxLen,
      char   *pzBufferProcessedTo);
    

Parameters

pBuffer
(IN) Points to a NULL terminated buffer to parse.
index
(IN) Specifies the index value of the Name-Value pair to parse for.
pzTokenName
(OUT) Points to the NULL terminated name to find in the specified buffer. The check is case sensitive.
pzTokenNameMaxLen
(IN/OUT) Points to an int that contains the maximum length of the pzTokenName buffer. On return, the length is the length of the name found or the length of the buffer needed if the original pzTokenName buffer is too small.
pzTokenValue
(OUT) Points to the buffer that receives the token value.
pzTokenValueMaxLen
(IN/OUT) Points to an int that contains the maximum length of the pzTokenValue buffer. On return, the length is the length of the value found or the length of the buffer needed if the original pzTokenValue buffer is too small.
pzBufferProcessedTo
(OUT) Points to where the pointer to the first character after the Name Value Pair is placed.

Return Values

If successful, returns 0. Otherwise, returns a nonzero error code.

Decimal

Name

Description

119

ERR_BUFFER_TOO_SMALL

The pzTokenValue buffer is too small.

121

ERR_NO_ITEMS_FOUND

Name does not exist in buffer

135

ERR_CREATE_FILE_INVALID_NAME

The pzTokenName buffer does not point to a valid buffer.

255

ERR_BAD_PARAMETER

Invalid input parameters.

Remarks

The data in the buffer is in the format: &Name=value.