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