[Asterisk-cvs] asterisk/include/asterisk astobj.h,1.12,1.13
kpfleming at lists.digium.com
kpfleming at lists.digium.com
Sun May 1 14:01:14 CDT 2005
Update of /usr/cvsroot/asterisk/include/asterisk
In directory localhost.localdomain:/tmp/cvs-serv21888/include/asterisk
Modified Files:
astobj.h
Log Message:
add direct object unlink macro to ASTOBJ api
various minor cleanups in chan_sip
Index: astobj.h
===================================================================
RCS file: /usr/cvsroot/asterisk/include/asterisk/astobj.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- astobj.h 21 Apr 2005 06:02:44 -0000 1.12
+++ astobj.h 1 May 2005 18:08:14 -0000 1.13
@@ -187,6 +187,26 @@
ASTOBJ_CONTAINER_UNLOCK(container); \
} while(0)
+#define ASTOBJ_CONTAINER_UNLINK(container,obj) \
+ ({ \
+ typeof((container)->head) found = NULL; \
+ typeof((container)->head) prev = NULL; \
+ ASTOBJ_CONTAINER_TRAVERSE(container, !found, do { \
+ if (iterator == obj) { \
+ found = iterator; \
+ found->next[0] = NULL; \
+ ASTOBJ_CONTAINER_WRLOCK(container); \
+ if (prev) \
+ prev->next[0] = next; \
+ else \
+ (container)->head = next; \
+ ASTOBJ_CONTAINER_UNLOCK(container); \
+ } \
+ prev = iterator; \
+ } while (0)); \
+ found; \
+ })
+
#define ASTOBJ_CONTAINER_FIND_UNLINK(container,namestr) \
({ \
typeof((container)->head) found = NULL; \
More information about the svn-commits
mailing list