IPC@CHIP® RTOS-PPC – API Documentation

Header image

Main page


int CGI_GetArgument ( char **  name,
char **  value,
rpCgiPtr  CgiRequest 
)

Returns the next available argument (name-value pair).

Parameters:
[out] name Output Parameter: A pointer to a valid char-pointer variable. After the function call the char-pointer variable points to a c-string with the argument-name.
[out] value Output Parameter: A pointer to a valid char-pointer variable. After the function call the char-pointer variable points to a c-string with the argument-value.
[in] CgiRequest Input Parameter: The CGI request pointer which was passed to the CGI function.
Returns:
zero (CGI_ARGUMENT_ERR_OK) on success, -1 (CGI_ARGUMENT_ERR_NONE) on failure, which means no more arguments available.
Note:
On the first call the function returns the first found argument. On next calls the function returns the next found argument, until no more arguments could be found. Note that this function must be called within the context of a CGI function. The pointers returned by the function are valid only while the CGI function is active. On return from the CGI function the pointer will become invalid.

The name, value pairs returned by this function are already decoded. You don't have to call CGI_UrlDeocde() yourself.
Example:
char *name;
char *value;

while ( CGI_GetArgument( &name, &value, CgiRequest ) == CGI_ARGUMENT_ERR_OK )
{
   printf("Argument found:\r\n"
          "Name : %s\r\n"
          "Value: %s\r\n",
          name, value);
}
Since:
SC2x3 V1.00 - CLIB V1.00





Top of page | Main page

Copyright © 2017 Beck IPC GmbH
Generated on Thu Jan 26 16:21:36 2017 by Doxygen 1.6.1