demo "lists" prepsano na for each(...) a prelozi se
[svn/Cll1h/.git] / cll1.h
diff --git a/cll1.h b/cll1.h
index 4e01a9f2455bad3271d13946116e4ef48552f323..3e09887de7d725552e52a795d7e3f99ac3fc7454 100644 (file)
--- a/cll1.h
+++ b/cll1.h
@@ -1,8 +1,8 @@
 
-/* C<<1 header file v0.6 - style sheet for ANSI C  */
+/* C<<1 header file v0.7 - style sheet for ANSI C  */
 /* Please pronounce as "cee-shift-left-by-one" :)  */
 
-/* Copyright (G) 2004 Michael xChaos Polak, x@n.cz
+/* Copyright (G) 2004-2007 Michael xChaos Polak, x(at)n.cz
 
    The C<<1 header file is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -47,7 +47,7 @@
 #define push(A,B) ((A && A!=B)?A->_next=B:0,B=A)
 #define pop(A,B) (B?((A?free(A):0),A=B=B->_next):(A=NULL))
 #define append(A,B) if(B) { void *N=A; A->_next=NULL; search(A,B,!A->_next) {A->_next=N; break;}} else push(A,B);
-#define remove(A,B,C) { void **_D=NULL; search(A,B,C) { if(_D)*_D=A->_next; else B=A->_next; free(A); A=NULL;} else _D=(void *)&(A->_next); }
+#define remove(A,B,C) { void **_D=NULL; for each(A,B) if(C) { if(_D)*_D=A->_next; else B=A->_next; free(A);} else _D=(void *)&(A->_next); }
 #define drop(A,B) for( A=B; A || (B=NULL); B=A, A=A->_next, free(B) )
 
 /* Dynamic list iterations and sequences, updated 2003-05-29 by xCh. */
@@ -59,7 +59,7 @@
 /* Enlightened iterations usable in for() , updated 2007-12-11 by xCh. */
 
 #define range(VAR,FROM,TO) (VAR=FROM; VAR <= TO; VAR++)
-#define each ((A,B) A=B; A; A=A->_next)
+#define each(A,B) ( A=B; A; A=A->_next)
 #define lines(STR,F) ()
 
 /* EXP macros for Dummysort sequences, updated 2003-05-29 by xCh. */
This page took 0.133127 seconds and 4 git commands to generate.