NetSurf
parameter.h
Go to the documentation of this file.
1/*
2 * Copyright 2010 John-Mark Bell <jmb@netsurf-browser.org>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef NETSURF_UTILS_HTTP_PARAMETER_H_
20#define NETSURF_UTILS_HTTP_PARAMETER_H_
21
22#include <libwapcaplet/libwapcaplet.h>
23
24#include "utils/errors.h"
25
27
28/**
29 * Find a named item in an HTTP parameter list
30 *
31 * \param list List to search
32 * \param name Name of item to search for
33 * \param value Pointer to location to receive value
34 * \return NSERROR_OK on success,
35 * NSERROR_NOT_FOUND if requested item does not exist
36 */
38 lwc_string *name, lwc_string **value);
39
40/**
41 * Iterate over a parameter list
42 *
43 * \param cur Pointer to current iteration position, list head to start
44 * \param name Pointer to location to receive item name
45 * \param value Pointer to location to receive item value
46 * \return Pointer to next iteration position, or NULL for end of iteration
47 */
49 lwc_string **name, lwc_string **value);
50
51/**
52 * Destroy a list of HTTP parameters
53 *
54 * \param list List to destroy
55 */
57
58#endif
59
Error codes.
nserror
Enumeration of error codes.
Definition: errors.h:29
void http_parameter_list_destroy(http_parameter *list)
Destroy a list of HTTP parameters.
Definition: parameter.c:149
const http_parameter * http_parameter_list_iterate(const http_parameter *cur, lwc_string **name, lwc_string **value)
Iterate over a parameter list.
Definition: parameter.c:136
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.
Definition: parameter.c:114
Representation of an HTTP parameter.
Definition: parameter.c:31
lwc_string * name
Parameter name.
Definition: parameter.c:34
lwc_string * value
Parameter value.
Definition: parameter.c:35