libacfutils
A general purpose library of utility functions designed to make it easier to develop addons for the X-Plane flight simulator.
Loading...
Searching...
No Matches
list.h
Go to the documentation of this file.
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license in the file COPYING
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file COPYING.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25/*
26 * Copyright 2023 Saso Kiselkov. All rights reserved.
27 */
37#ifndef _ACF_UTILS_LIST_H_
38#define _ACF_UTILS_LIST_H_
39
40#include "core.h"
41#include "list_impl.h"
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
56typedef struct list_node list_node_t;
70typedef struct list list_t;
71
72API_EXPORT void list_create(list_t *, size_t, size_t);
73API_EXPORT void list_destroy(list_t *);
74
75API_EXPORT void list_insert_after(list_t *, void *, void *);
76API_EXPORT void list_insert_before(list_t *, void *, void *);
77API_EXPORT void list_insert_head(list_t *, void *);
78API_EXPORT void list_insert_tail(list_t *, void *);
79API_EXPORT void list_remove(list_t *, void *);
80API_EXPORT void *list_remove_head(list_t *);
81API_EXPORT void *list_remove_tail(list_t *);
82API_EXPORT void list_move_tail(list_t *, list_t *);
83
84API_EXPORT void *list_head(const list_t *);
85API_EXPORT void *list_tail(const list_t *);
86API_EXPORT void *list_next(const list_t *, const void *);
87API_EXPORT void *list_prev(const list_t *, const void *);
88API_EXPORT void *list_get_i(const list_t *, size_t);
89API_EXPORT int list_is_empty(const list_t *);
90
91API_EXPORT void list_link_init(list_node_t *);
92API_EXPORT void list_link_replace(list_node_t *, list_node_t *);
93
94API_EXPORT int list_link_active(const list_node_t *);
95API_EXPORT size_t list_count(const list_t *);
96
97#ifdef __cplusplus
98}
99#endif
100
101#endif /* _ACF_UTILS_LIST_H_ */
void list_link_replace(list_node_t *, list_node_t *)
Definition list.c:489
int list_link_active(const list_node_t *)
Definition list.c:525
void * list_tail(const list_t *)
Definition list.c:304
void * list_get_i(const list_t *, size_t)
Definition list.c:412
void list_destroy(list_t *)
Definition list.c:136
void * list_head(const list_t *)
Definition list.c:292
int list_is_empty(const list_t *)
Definition list.c:534
void list_create(list_t *, size_t, size_t)
Definition list.c:113
void list_move_tail(list_t *, list_t *)
Definition list.c:436
void list_insert_after(list_t *, void *, void *)
Definition list.c:159
void list_insert_before(list_t *, void *, void *)
Definition list.c:181
void * list_remove_tail(list_t *)
Definition list.c:277
void * list_prev(const list_t *, const void *)
Definition list.c:388
void list_insert_head(list_t *, void *)
Definition list.c:199
void * list_next(const list_t *, const void *)
Definition list.c:344
void list_link_init(list_node_t *)
Definition list.c:510
size_t list_count(const list_t *)
Definition list.c:543
void list_remove(list_t *, void *)
Definition list.c:226
void * list_remove_head(list_t *)
Definition list.c:251
void list_insert_tail(list_t *, void *)
Definition list.c:213