JULEA
jlist.h
Go to the documentation of this file.
1 /*
2  * JULEA - Flexible storage framework
3  * Copyright (C) 2010-2024 Michael Kuhn
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program 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 Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
23 #ifndef JULEA_LIST_H
24 #define JULEA_LIST_H
25 
26 #if !defined(JULEA_H) && !defined(JULEA_COMPILATION)
27 #error "Only <julea.h> can be included directly."
28 #endif
29 
30 #include <glib.h>
31 
32 G_BEGIN_DECLS
33 
40 struct JList;
41 
42 typedef struct JList JList;
43 
44 typedef void (*JListFreeFunc)(gpointer);
45 
57 
65 JList* j_list_ref(JList* list);
66 
76 void j_list_unref(JList* list);
77 
78 G_DEFINE_AUTOPTR_CLEANUP_FUNC(JList, j_list_unref)
79 
80 
90 guint j_list_length(JList* list);
91 
101 void j_list_append(JList* list, gpointer data);
102 
112 void j_list_prepend(JList* list, gpointer data);
113 
121 gpointer j_list_get_first(JList* list);
122 
130 gpointer j_list_get_last(JList* list);
131 
137 void j_list_delete_all(JList* list);
138 
143 G_END_DECLS
144 
145 #endif
void j_list_unref(JList *list)
Definition: jlist.c:99
guint j_list_length(JList *list)
Definition: jlist.c:114
gpointer j_list_get_last(JList *list)
Definition: jlist.c:193
void(* JListFreeFunc)(gpointer)
Definition: jlist.h:44
JList * j_list_ref(JList *list)
Definition: jlist.c:87
JList * j_list_new(JListFreeFunc free_func)
Definition: jlist.c:70
gpointer j_list_get_first(JList *list)
Definition: jlist.c:176
void j_list_append(JList *list, gpointer data)
Definition: jlist.c:124
void j_list_delete_all(JList *list)
Definition: jlist.c:210
void j_list_prepend(JList *list, gpointer data)
Definition: jlist.c:153
Definition: jlist.c:43
JListFreeFunc free_func
Definition: jlist.c:61