Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / gnulib-lib / glib / glist.in.h
1 /* GLIB - Library of useful routines for C programming
2  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public
6  * License as published by the Free Software Foundation; either
7  * version 3 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GLib Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GLib at ftp://ftp.gtk.org/pub/gtk/. 
25  */
26
27 /*
28  * Modified by Bruno Haible for use as a gnulib module.
29  */
30
31 #ifndef __G_LIST_H__
32 #define __G_LIST_H__
33
34 #if 0
35 #include <glib/gmem.h>
36 #endif
37
38 G_BEGIN_DECLS
39
40 typedef struct _GList GList;
41
42 struct _GList
43 {
44   gpointer data;
45   GList *next;
46   GList *prev;
47 };
48
49 /* Doubly linked lists
50  */
51 #if 0
52 GList*   g_list_alloc                   (void) G_GNUC_WARN_UNUSED_RESULT;
53 #endif
54 void     g_list_free                    (GList            *list);
55 #if 0
56 void     g_list_free_1                  (GList            *list);
57 #define  g_list_free1                   g_list_free_1
58 #endif
59 GList*   g_list_append                  (GList            *list,
60                                          gpointer          data) G_GNUC_WARN_UNUSED_RESULT;
61 GList*   g_list_prepend                 (GList            *list,
62                                          gpointer          data) G_GNUC_WARN_UNUSED_RESULT;
63 #if 0
64 GList*   g_list_insert                  (GList            *list,
65                                          gpointer          data,
66                                          gint              position) G_GNUC_WARN_UNUSED_RESULT;
67 GList*   g_list_insert_sorted           (GList            *list,
68                                          gpointer          data,
69                                          GCompareFunc      func) G_GNUC_WARN_UNUSED_RESULT;
70 GList*   g_list_insert_sorted_with_data (GList            *list,
71                                          gpointer          data,
72                                          GCompareDataFunc  func,
73                                          gpointer          user_data) G_GNUC_WARN_UNUSED_RESULT;
74 GList*   g_list_insert_before           (GList            *list,
75                                          GList            *sibling,
76                                          gpointer          data) G_GNUC_WARN_UNUSED_RESULT;
77 GList*   g_list_concat                  (GList            *list1,
78                                          GList            *list2) G_GNUC_WARN_UNUSED_RESULT;
79 GList*   g_list_remove                  (GList            *list,
80                                          gconstpointer     data) G_GNUC_WARN_UNUSED_RESULT;
81 GList*   g_list_remove_all              (GList            *list,
82                                          gconstpointer     data) G_GNUC_WARN_UNUSED_RESULT;
83 GList*   g_list_remove_link             (GList            *list,
84                                          GList            *llink) G_GNUC_WARN_UNUSED_RESULT;
85 #endif
86 GList*   g_list_delete_link             (GList            *list,
87                                          GList            *link_) G_GNUC_WARN_UNUSED_RESULT;
88 #if 0
89 GList*   g_list_reverse                 (GList            *list) G_GNUC_WARN_UNUSED_RESULT;
90 GList*   g_list_copy                    (GList            *list) G_GNUC_WARN_UNUSED_RESULT;
91 GList*   g_list_nth                     (GList            *list,
92                                          guint             n);
93 GList*   g_list_nth_prev                (GList            *list,
94                                          guint             n);
95 GList*   g_list_find                    (GList            *list,
96                                          gconstpointer     data);
97 GList*   g_list_find_custom             (GList            *list,
98                                          gconstpointer     data,
99                                          GCompareFunc      func);
100 gint     g_list_position                (GList            *list,
101                                          GList            *llink);
102 gint     g_list_index                   (GList            *list,
103                                          gconstpointer     data);
104 #endif
105 GList*   g_list_last                    (GList            *list);
106 #if 0
107 GList*   g_list_first                   (GList            *list);
108 guint    g_list_length                  (GList            *list);
109 void     g_list_foreach                 (GList            *list,
110                                          GFunc             func,
111                                          gpointer          user_data);
112 GList*   g_list_sort                    (GList            *list,
113                                          GCompareFunc      compare_func) G_GNUC_WARN_UNUSED_RESULT;
114 GList*   g_list_sort_with_data          (GList            *list,
115                                          GCompareDataFunc  compare_func,
116                                          gpointer          user_data)  G_GNUC_WARN_UNUSED_RESULT;
117 gpointer g_list_nth_data                (GList            *list,
118                                          guint             n);
119
120
121 #define g_list_previous(list)           ((list) ? (((GList *)(list))->prev) : NULL)
122 #endif
123 #define g_list_next(list)               ((list) ? (((GList *)(list))->next) : NULL)
124 #if 0
125
126 #ifndef G_DISABLE_DEPRECATED
127 void     g_list_push_allocator          (gpointer          allocator);
128 void     g_list_pop_allocator           (void);
129 #endif
130
131 #endif
132
133 G_END_DECLS
134
135 #endif /* __G_LIST_H__ */
136