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.
Remarks
The data in the buffer is in the format: &Name=value.