blob: a708ef206cf55f30ae3b056880f1482f3896a524 [file] [log] [blame]
Owen Taylor3473f882001-02-23 17:55:21 +00001/*
2 * list.h: lists interfaces
3 *
4 * Copyright (C) 2000 Gary Pennington and Daniel Veillard.
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
11 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
12 * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
13 * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
14 *
15 * Author: Gary.Pennington@uk.sun.com
16 */
17
18typedef struct _xmlLink xmlLink;
19typedef xmlLink *xmlLinkPtr;
20
21typedef struct _xmlList xmlList;
22typedef xmlList *xmlListPtr;
23
24typedef void (*xmlListDeallocator) (xmlLinkPtr lk);
25typedef int (*xmlListDataCompare) (const void *data0, const void *data1);
26typedef int (*xmlListWalker) (const void *data, const void *user);
27
28/* Creation/Deletion */
29xmlListPtr xmlListCreate (xmlListDeallocator deallocator,
30 xmlListDataCompare compare);
31void xmlListDelete (xmlListPtr l);
32
33/* Basic Operators */
34void * xmlListSearch (xmlListPtr l,
35 void *data);
36void * xmlListReverseSearch (xmlListPtr l,
37 void *data);
38int xmlListInsert (xmlListPtr l,
39 void *data) ;
40int xmlListAppend (xmlListPtr l,
41 void *data) ;
42int xmlListRemoveFirst (xmlListPtr l,
43 void *data);
44int xmlListRemoveLast (xmlListPtr l,
45 void *data);
46int xmlListRemoveAll (xmlListPtr l,
47 void *data);
48void xmlListClear (xmlListPtr l);
49int xmlListEmpty (xmlListPtr l);
50xmlLinkPtr xmlListFront (xmlListPtr l);
51xmlLinkPtr xmlListEnd (xmlListPtr l);
52int xmlListSize (xmlListPtr l);
53
54void xmlListPopFront (xmlListPtr l);
55void xmlListPopBack (xmlListPtr l);
56int xmlListPushFront (xmlListPtr l,
57 void *data);
58int xmlListPushBack (xmlListPtr l,
59 void *data);
60
61/* Advanced Operators */
62void xmlListReverse (xmlListPtr l);
63void xmlListSort (xmlListPtr l);
64void xmlListWalk (xmlListPtr l,
65 xmlListWalker walker,
66 const void *user);
67void xmlListReverseWalk (xmlListPtr l,
68 xmlListWalker walker,
69 const void *user);
70void xmlListMerge (xmlListPtr l1,
71 xmlListPtr l2);
72xmlListPtr xmlListDup (const xmlListPtr old);
73int xmlListCopy (xmlListPtr cur,
74 const xmlListPtr old);
75/* Link operators */
76void * xmlLinkGetData (xmlLinkPtr lk);
77
78/* xmlListUnique() */
79/* xmlListSwap */
80
81