summaryrefslogtreecommitdiff
path: root/src/list.h
diff options
context:
space:
mode:
authorfcolin2002-04-04 08:50:07 +0000
committerfcolin2002-04-04 08:50:07 +0000
commit0804a5e035f41c70db089ccec7d06c6ebec09a56 (patch)
tree91e3f3a6f2abbb88a15c1804968f8569d07f152f /src/list.h
parent866c546f6a438e7f7cbc15aaa189f7afaac99d10 (diff)
downloadivy-c-0804a5e035f41c70db089ccec7d06c6ebec09a56.zip
ivy-c-0804a5e035f41c70db089ccec7d06c6ebec09a56.tar.gz
ivy-c-0804a5e035f41c70db089ccec7d06c6ebec09a56.tar.bz2
ivy-c-0804a5e035f41c70db089ccec7d06c6ebec09a56.tar.xz
replace LIST_ IVY_LIST_ collision macro
Diffstat (limited to 'src/list.h')
-rw-r--r--src/list.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/list.h b/src/list.h
index 7afbe8b..0c31223 100644
--- a/src/list.h
+++ b/src/list.h
@@ -14,11 +14,11 @@
* copyright notice regarding this software
*/
-#define LIST_ITER( list, p, cond ) \
+#define IVY_LIST_ITER( list, p, cond ) \
p = list; \
while ( p && (cond) ) p = p->next
-#define LIST_REMOVE( list, p ) \
+#define IVY_LIST_REMOVE( list, p ) \
{ \
void *toRemove; \
if ( list == p ) \
@@ -29,7 +29,7 @@
else \
{\
toRemove = p;\
- LIST_ITER( list, p, ( p->next != toRemove ));\
+ IVY_LIST_ITER( list, p, ( p->next != toRemove ));\
if ( p )\
{\
/* somme tricky swapping to use a untyped variable */\
@@ -44,7 +44,7 @@
} \
}
-#define LIST_ADD(list, p ) \
+#define IVY_LIST_ADD(list, p ) \
if ((p = malloc( sizeof( *p ))))\
{ \
memset( p, 0 , sizeof( *p ));\
@@ -52,14 +52,13 @@
list = p; \
}
-#define LIST_EACH( list, p ) \
+#define IVY_LIST_EACH( list, p ) \
for ( p = list ; p ; p = p -> next )
-#define LIST_EACH_SAFE( list, p, next )\
+#define IVY_LIST_EACH_SAFE( list, p, next )\
for ( p = list ; (next = p ? p->next: p ),p ; p = next )
-
-#define LIST_EMPTY( list ) \
+#define IVY_LIST_EMPTY( list ) \
{ \
void *p; \
while( list ) \