00001
00002
00003
00004
00005
00006
00007 #ifndef V_VList_h
00008 #define V_VList_h 1
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "viaio/Vlib.h"
00026
00027
00028 #include <stdio.h>
00029
00030
00031 #include <X11/Xfuncproto.h>
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037
00038
00039
00040
00041
00042
00043 typedef struct V_Node *VNodePtrType;
00044 struct V_Node {
00045 VPointer item;
00046 VNodePtrType prev;
00047 VNodePtrType next;
00048 };
00049
00050
00051 typedef struct V_List {
00052 VNodePtrType current;
00053 VNodePtrType head;
00054 VNodePtrType tail;
00055 int count;
00056 } *VList;
00057
00058
00059
00060
00061
00062
00063 #define VListCount(vlist) ((vlist)->count)
00064 #define VListCurr(vlist) ((vlist)->current->item)
00065 #define VListGetCurr(vlist) ((vlist)->current)
00066 #define VListSetCurr(vlist,curr) ((void) ((vlist)->current = (curr)))
00067
00068
00069
00070
00071
00072
00073
00074
00075 extern VList VListCreate (
00076 #if NeedFunctionPrototypes
00077 void
00078 #endif
00079 );
00080
00081 extern VPointer VListFirst (
00082 #if NeedFunctionPrototypes
00083 VList
00084 #endif
00085 );
00086
00087 extern VPointer VListLast (
00088 #if NeedFunctionPrototypes
00089 VList
00090 #endif
00091 );
00092
00093 extern VPointer VListNext (
00094 #if NeedFunctionPrototypes
00095 VList
00096 #endif
00097 );
00098
00099 extern VPointer VListPrev (
00100 #if NeedFunctionPrototypes
00101 VList
00102 #endif
00103 );
00104
00105 extern void VListAdd (
00106 #if NeedFunctionPrototypes
00107 VList ,
00108 VPointer
00109 #endif
00110 );
00111
00112 extern void VListInsert (
00113 #if NeedFunctionPrototypes
00114 VList ,
00115 VPointer
00116 #endif
00117 );
00118
00119 extern void VListAppend (
00120 #if NeedFunctionPrototypes
00121 VList ,
00122 VPointer
00123 #endif
00124 );
00125
00126 extern void VListPrepend (
00127 #if NeedFunctionPrototypes
00128 VList ,
00129 VPointer
00130 #endif
00131 );
00132
00133 extern VPointer VListRemove (
00134 #if NeedFunctionPrototypes
00135 VList
00136 #endif
00137 );
00138
00139 extern void VListConcat (
00140 #if NeedFunctionPrototypes
00141 VList ,
00142 VList
00143 #endif
00144 );
00145
00146 extern void VListDestroy (
00147 #if NeedFunctionPrototypes
00148 VList ,
00149 void (*) (
00150 #if NeedNestedPrototypes
00151 VPointer
00152 #endif
00153 )
00154 #endif
00155 );
00156
00157 extern VPointer VListTrim (
00158 #if NeedFunctionPrototypes
00159 VList
00160 #endif
00161 );
00162
00163 extern VPointer VListSearch (
00164 #if NeedFunctionPrototypes
00165 VList ,
00166 int (*) () ,
00167 VPointer
00168 #endif
00169 );
00170
00171 #ifdef __cplusplus
00172 }
00173 #endif
00174
00175 #endif