1 /***************************************************************************
2  begin       : Sat Jun 28 2003
3  copyright   : (C) 2003 by Martin Preuss
4  email       : martin@libchipcard.de
5 
6  ***************************************************************************
7  *                                                                         *
8  *   This library is free software; you can redistribute it and/or         *
9  *   modify it under the terms of the GNU Lesser General Public            *
10  *   License as published by the Free Software Foundation; either          *
11  *   version 2.1 of the License, or (at your option) any later version.    *
12  *                                                                         *
13  *   This library is distributed in the hope that it will be useful,       *
14  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
15  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
16  *   Lesser General Public License for more details.                       *
17  *                                                                         *
18  *   You should have received a copy of the GNU Lesser General Public      *
19  *   License along with this library; if not, write to the Free Software   *
20  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
21  *   MA  02111-1307  USA                                                   *
22  *                                                                         *
23  ***************************************************************************/
24 
25 
26 #ifndef GWEN_LIST1_P_H
27 #define GWEN_LIST1_P_H
28 
29 
30 #include "list1.h"
31 
32 
33 
34 struct GWEN_LIST1_ELEMENT {
35   GWEN_LIST1 *listPtr;
36   void *data;
37   GWEN_LIST1_ELEMENT *prevElement;
38   GWEN_LIST1_ELEMENT *nextElement;
39 };
40 
41 
42 struct GWEN_LIST1 {
43   uint32_t count;
44   GWEN_LIST1_ELEMENT *firstElement;
45   GWEN_LIST1_ELEMENT *lastElement;
46 
47   GWEN_LIST1_SORT_FN sortFunction;
48 };
49 
50 
51 
52 
53 typedef struct GWEN_LIST1_SORT_CTX GWEN_LIST1_SORT_CTX;
54 struct GWEN_LIST1_SORT_CTX {
55   GWEN_LIST1 *list;
56   int param;
57 };
58 static GWEN_LIST1_SORT_CTX *GWEN_List1_SortCtx_new(GWEN_LIST1 *list, int param);
59 static void GWEN_List1_SortCtx_free(GWEN_LIST1_SORT_CTX *ctx);
60 
61 
62 
63 
64 typedef struct GWEN_LIST1_SORT_ELEM GWEN_LIST1_SORT_ELEM;
65 struct GWEN_LIST1_SORT_ELEM {
66   GWEN_LIST1_SORT_CTX *context;
67   GWEN_LIST1_ELEMENT *element;
68 };
69 static GWEN_LIST1_SORT_ELEM *GWEN_List1_SortElem_new(GWEN_LIST1_SORT_CTX *ctx, GWEN_LIST1_ELEMENT *elem);
70 static void GWEN_List1_SortElem_free(GWEN_LIST1_SORT_ELEM *e);
71 
72 
73 
74 
75 #endif
76 
77 
78