Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
| 18 | typedef struct _xmlLink xmlLink; |
| 19 | typedef xmlLink *xmlLinkPtr; |
| 20 | |
| 21 | typedef struct _xmlList xmlList; |
| 22 | typedef xmlList *xmlListPtr; |
| 23 | |
| 24 | typedef void (*xmlListDeallocator) (xmlLinkPtr lk); |
| 25 | typedef int (*xmlListDataCompare) (const void *data0, const void *data1); |
| 26 | typedef int (*xmlListWalker) (const void *data, const void *user); |
| 27 | |
| 28 | /* Creation/Deletion */ |
| 29 | xmlListPtr xmlListCreate (xmlListDeallocator deallocator, |
| 30 | xmlListDataCompare compare); |
| 31 | void xmlListDelete (xmlListPtr l); |
| 32 | |
| 33 | /* Basic Operators */ |
| 34 | void * xmlListSearch (xmlListPtr l, |
| 35 | void *data); |
| 36 | void * xmlListReverseSearch (xmlListPtr l, |
| 37 | void *data); |
| 38 | int xmlListInsert (xmlListPtr l, |
| 39 | void *data) ; |
| 40 | int xmlListAppend (xmlListPtr l, |
| 41 | void *data) ; |
| 42 | int xmlListRemoveFirst (xmlListPtr l, |
| 43 | void *data); |
| 44 | int xmlListRemoveLast (xmlListPtr l, |
| 45 | void *data); |
| 46 | int xmlListRemoveAll (xmlListPtr l, |
| 47 | void *data); |
| 48 | void xmlListClear (xmlListPtr l); |
| 49 | int xmlListEmpty (xmlListPtr l); |
| 50 | xmlLinkPtr xmlListFront (xmlListPtr l); |
| 51 | xmlLinkPtr xmlListEnd (xmlListPtr l); |
| 52 | int xmlListSize (xmlListPtr l); |
| 53 | |
| 54 | void xmlListPopFront (xmlListPtr l); |
| 55 | void xmlListPopBack (xmlListPtr l); |
| 56 | int xmlListPushFront (xmlListPtr l, |
| 57 | void *data); |
| 58 | int xmlListPushBack (xmlListPtr l, |
| 59 | void *data); |
| 60 | |
| 61 | /* Advanced Operators */ |
| 62 | void xmlListReverse (xmlListPtr l); |
| 63 | void xmlListSort (xmlListPtr l); |
| 64 | void xmlListWalk (xmlListPtr l, |
| 65 | xmlListWalker walker, |
| 66 | const void *user); |
| 67 | void xmlListReverseWalk (xmlListPtr l, |
| 68 | xmlListWalker walker, |
| 69 | const void *user); |
| 70 | void xmlListMerge (xmlListPtr l1, |
| 71 | xmlListPtr l2); |
| 72 | xmlListPtr xmlListDup (const xmlListPtr old); |
| 73 | int xmlListCopy (xmlListPtr cur, |
| 74 | const xmlListPtr old); |
| 75 | /* Link operators */ |
| 76 | void * xmlLinkGetData (xmlLinkPtr lk); |
| 77 | |
| 78 | /* xmlListUnique() */ |
| 79 | /* xmlListSwap */ |
| 80 | |
| 81 | |