NetSurf
|
#include <stdlib.h>
#include <string.h>
#include "utils/http.h"
#include "utils/http/generics.h"
#include "utils/http/parameter_internal.h"
#include "utils/http/primitives.h"
Go to the source code of this file.
Data Structures | |
struct | http_parameter |
Representation of an HTTP parameter. More... | |
Functions | |
static void | http_destroy_parameter (http_parameter *self) |
Destructor for an HTTP parameter. More... | |
nserror | http__parse_parameter (const char **input, http_parameter **parameter) |
Parse an HTTP parameter. More... | |
nserror | http_parameter_list_find_item (const http_parameter *list, lwc_string *name, lwc_string **value) |
Find a named item in an HTTP parameter list. More... | |
const http_parameter * | http_parameter_list_iterate (const http_parameter *cur, lwc_string **name, lwc_string **value) |
Iterate over a parameter list. More... | |
void | http_parameter_list_destroy (http_parameter *list) |
Destroy a list of HTTP parameters. More... | |
nserror http__parse_parameter | ( | const char ** | input, |
http_parameter ** | parameter | ||
) |
Parse an HTTP parameter.
input | Pointer to current input byte. Updated on exit. |
parameter | Pointer to location to receive on-heap parameter. |
The returned parameter is owned by the caller.
Definition at line 61 of file parameter.c.
References HTTP__ITEM_INIT, http__parse_quoted_string(), http__parse_token(), http__skip_LWS(), http_destroy_parameter(), http_parameter::name, NSERROR_NOMEM, NSERROR_NOT_FOUND, NSERROR_OK, and http_parameter::value.
Referenced by http__parse_challenge(), http_parse_content_disposition(), and http_parse_content_type().
|
static |
Destructor for an HTTP parameter.
self | Parameter to destroy |
Definition at line 43 of file parameter.c.
References http_parameter::name, and http_parameter::value.
Referenced by http__parse_parameter().
void http_parameter_list_destroy | ( | http_parameter * | list | ) |
Destroy a list of HTTP parameters.
list | List to destroy |
Definition at line 149 of file parameter.c.
References http__item_list_destroy.
Referenced by http__parse_challenge(), http_content_disposition_destroy(), http_content_type_destroy(), http_destroy_challenge(), http_parse_content_disposition(), and http_parse_content_type().
nserror http_parameter_list_find_item | ( | const http_parameter * | list, |
lwc_string * | name, | ||
lwc_string ** | value | ||
) |
Find a named item in an HTTP parameter list.
list | List to search |
name | Name of item to search for |
value | Pointer to location to receive value |
Definition at line 114 of file parameter.c.
References http_parameter::base, http_parameter::name, http__item::next, NSERROR_NOT_FOUND, NSERROR_OK, and http_parameter::value.
Referenced by download_context_process_headers(), html_create_html_data(), nscss_create(), and textplain_create().
const http_parameter * http_parameter_list_iterate | ( | const http_parameter * | cur, |
lwc_string ** | name, | ||
lwc_string ** | value | ||
) |
Iterate over a parameter list.
cur | Pointer to current iteration position, list head to start |
name | Pointer to location to receive item name |
value | Pointer to location to receive item value |
Definition at line 136 of file parameter.c.
References http_parameter::base, http_parameter::name, http__item::next, and http_parameter::value.