HTP 0.5
htp_list.h
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (c) 2009-2010 Open Information Security Foundation
3 * Copyright (c) 2010-2013 Qualys, Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met:
9 *
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12
13 * - Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16
17 * - Neither the name of the Qualys, Inc. nor the names of its
18 * contributors may be used to endorse or promote products derived from
19 * this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 ***************************************************************************/
33
39#ifndef HTP_LIST_H
40#define HTP_LIST_H
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
46// The default list implementation is array-based. The
47// linked list version is not fully implemented yet.
48#define htp_list_t htp_list_array_t
49#define htp_list_add htp_list_array_push
50#define htp_list_create htp_list_array_create
51#define htp_list_init htp_list_array_init
52#define htp_list_clear htp_list_array_clear
53#define htp_list_destroy htp_list_array_destroy
54#define htp_list_release htp_list_array_release
55#define htp_list_get htp_list_array_get
56#define htp_list_pop htp_list_array_pop
57#define htp_list_push htp_list_array_push
58#define htp_list_replace htp_list_array_replace
59#define htp_list_size htp_list_array_size
60#define htp_list_shift htp_list_array_shift
61
62// Data structures
63
66
67#include "htp_core.h"
68#include "bstr.h"
69
70// Functions
71
79
88
97
105
114
123void *htp_list_array_get(const htp_list_array_t *l, size_t idx);
124
132
142
154
162
170
171
172// Linked list
173
180
188
196
204
213
221
222#ifdef __cplusplus
223}
224#endif
225
226#endif /* HTP_LIST_H */
227
int htp_status_t
Definition: htp_core.h:46
htp_status_t htp_list_array_replace(htp_list_array_t *l, size_t idx, void *e)
Definition: htp_list.c:184
int htp_list_linked_empty(const htp_list_linked_t *l)
void * htp_list_array_get(const htp_list_array_t *l, size_t idx)
Definition: htp_list.c:99
void htp_list_array_clear(htp_list_array_t *l)
Definition: htp_list.c:77
size_t htp_list_array_size(const htp_list_array_t *l)
Definition: htp_list.c:194
htp_status_t htp_list_array_push(htp_list_array_t *l, void *e)
Definition: htp_list.c:130
void htp_list_array_destroy(htp_list_array_t *l)
Definition: htp_list.c:86
void * htp_list_linked_shift(htp_list_linked_t *l)
htp_status_t htp_list_array_init(htp_list_array_t *l, size_t size)
void htp_list_array_release(htp_list_array_t *l)
Definition: htp_list.c:93
htp_status_t htp_list_linked_push(htp_list_linked_t *l, void *e)
htp_list_array_t * htp_list_array_create(size_t size)
Definition: htp_list.c:61
void * htp_list_array_shift(htp_list_array_t *l)
Definition: htp_list.c:200
htp_list_linked_t * htp_list_linked_create(void)
void * htp_list_array_pop(htp_list_array_t *l)
Definition: htp_list.c:110
void * htp_list_linked_pop(htp_list_linked_t *l)
void htp_list_linked_destroy(htp_list_linked_t *l)
Definition: htp_list_private.h:50
Definition: htp_list_private.h:63