]> mj.ucw.cz Git - libucw.git/blobdiff - lib/lists.h
Implemented the URL regex replace mechanism.
[libucw.git] / lib / lists.h
index 4f605697eb6b4587a71a5e7e735da0bce19618e2..9c9cabf2088e8849675b56ee3b165e44d28b3198 100644 (file)
@@ -20,6 +20,8 @@ typedef struct list list;
 #define DO_FOR_ALL(n,list) for((n)=HEAD(list);(NODE (n))->next; \
                                 n=(void *)((NODE (n))->next))
 #define EMPTY_LIST(list) (!(list).head.next->next)
+#define OFFSETOF(s, i) ((unsigned int)&((s *)0)->i)
+#define SKIP_BACK(s, i, p) ((s *)((char *)p - OFFSETOF(s, i)))
 
 void add_tail(list *, node *);
 void add_head(list *, node *);