Repository navigation
Expand file tree
/
Copy pathgslist.h
More file actions
117 lines (106 loc) · 5.67 KB
/
Copy pathgslist.h
File metadata and controls
117 lines (106 loc) · 5.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/* GLIB - Library of useful routines for C programming
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/*
* Modified by the GLib Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GLib Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GLib at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __prelog_G_SLIST_H__
#define __prelog_G_SLIST_H__
typedef struct _PrelogSList PrelogSList;
struct _PrelogSList
{
void *data;
PrelogSList *next;
};
#define PRELOG_INT_TO_POINTER(i) ((void *) (long) (i))
#define PRELOG_POINTER_TO_INT(p) ((int) (long) (p))
#define PRELOG_POINTER_TO_UINT(p) ((unsigned int) (unsigned long) (p))
typedef int (*PrelogCompareFunc) (const void *, const void *);
typedef int (*PrelogCompareDataFunc) (const void *, const void *, void *);
typedef void (*PrelogDestroyNotify) (void *);
typedef void * (*PrelogCopyFunc) (const void *, void *);
typedef void (*PrelogFunc) (void *, void *);
typedef int (*PrelogEqualFunc) (const void *, const void *);
typedef unsigned int (*PrelogHashFunc) (const void *);
typedef void (*PrelogHFunc) (void *, void *, void *);
/* Singly linked lists
*/
PrelogSList* prelog_slist_alloc (void);
void prelog_slist_free (PrelogSList *list);
void prelog_slist_free_1 (PrelogSList *list);
#define prelog_slist_free1 prelog_slist_free_1
void prelog_slist_free_full (PrelogSList *list,
PrelogDestroyNotify);
PrelogSList* prelog_slist_append (PrelogSList *list,
void * data);
PrelogSList* prelog_slist_prepend (PrelogSList *list,
void * data);
PrelogSList* prelog_slist_insert (PrelogSList *list,
void * data,
int position);
PrelogSList* prelog_slist_insert_sorted (PrelogSList *list,
void * data,
PrelogCompareFunc);
PrelogSList* prelog_slist_insert_sorted_with_data (PrelogSList *list,
void * data,
PrelogCompareDataFunc,
void * user_data);
PrelogSList* prelog_slist_insert_before (PrelogSList *slist,
PrelogSList *sibling,
void * data);
PrelogSList* prelog_slist_concat (PrelogSList *list1,
PrelogSList *list2);
PrelogSList* prelog_slist_remove (PrelogSList *list,
const void * data);
PrelogSList* prelog_slist_remove_all (PrelogSList *list,
const void * data);
PrelogSList* prelog_slist_remove_link (PrelogSList *list,
PrelogSList *link_);
PrelogSList* prelog_slist_delete_link (PrelogSList *list,
PrelogSList *link_);
PrelogSList* prelog_slist_reverse (PrelogSList *list);
PrelogSList* prelog_slist_copy (PrelogSList *list);
PrelogSList* prelog_slist_copy_deep (PrelogSList *list,
PrelogCopyFunc,
void * user_data);
PrelogSList* prelog_slist_nth (PrelogSList *list,
unsigned int n);
PrelogSList* prelog_slist_find (PrelogSList *list,
const void * data);
PrelogSList* prelog_slist_find_custom (PrelogSList *list,
const void * data,
PrelogCompareFunc);
int prelog_slist_position (PrelogSList *list,
PrelogSList *llink);
int prelog_slist_index (PrelogSList *list,
const void * data);
PrelogSList* prelog_slist_last (PrelogSList *list);
unsigned int prelog_slist_length (PrelogSList *list);
void prelog_slist_foreach (PrelogSList *list,
PrelogFunc,
void * user_data);
PrelogSList* prelog_slist_sort (PrelogSList *list,
PrelogCompareFunc);
PrelogSList* prelog_slist_sort_with_data (PrelogSList *list,
PrelogCompareDataFunc,
void * user_data);
void * prelog_slist_nth_data (PrelogSList *list,
unsigned int n);
#define prelog_slist_next(slist) ((slist) ? (((prelogSList *)(slist))->next) : NULL)
#endif /* __prelog_SLIST_H__ */