summaryrefslogtreecommitdiffstats
path: root/src/server/xmlutil.h
diff options
context:
space:
mode:
authorsr2012-09-03 21:00:26 +0200
committersr2012-09-03 21:00:26 +0200
commit60b2ba6ef9ed779d750958b6422f05c93a4a2d91 (patch)
tree46fdacf6a9439947e91af4c3d9de3006d41e5380 /src/server/xmlutil.h
parent[*] Fixed and unified formatting (diff)
downloaddnbd3-60b2ba6ef9ed779d750958b6422f05c93a4a2d91.tar.gz
dnbd3-60b2ba6ef9ed779d750958b6422f05c93a4a2d91.tar.xz
dnbd3-60b2ba6ef9ed779d750958b6422f05c93a4a2d91.zip
[SERVER] Check which dnbd3 devices are idle and ready to use for proxy mode
[SERVER] Skeleton of server-to-server communication [SERVER] Update access-time of images in use by actual clients [*] Add dnbd3_host_t type to handle address+port+addrtype consistently across the project
Diffstat (limited to 'src/server/xmlutil.h')
-rw-r--r--src/server/xmlutil.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/server/xmlutil.h b/src/server/xmlutil.h
index 46a5790..971d8a9 100644
--- a/src/server/xmlutil.h
+++ b/src/server/xmlutil.h
@@ -22,5 +22,17 @@ xmlChar *getTextFromPath(xmlDocPtr doc, char *xpath);
xmlXPathFreeContext(_makro_xpathCtx); \
} while(0)
+#define NUM_POINTERS_IN_LIST 20
+#define NEW_POINTERLIST \
+ void *_makro_ptrlist[NUM_POINTERS_IN_LIST]; \
+ int _makro_usedcount = 0
+
+#define FREE_POINTERLIST do { \
+ int _makro_i_; \
+ for (_makro_i_ = 0; _makro_i_ < _makro_usedcount; ++_makro_i_) { \
+ xmlFree(_makro_ptrlist[_makro_i_]); \
+ } } while(0)
+
+#define XML_GETPROP(_node, _name) (xmlChar*)(_makro_ptrlist[(_makro_usedcount >= NUM_POINTERS_IN_LIST ? 0 : _makro_usedcount++)] = xmlGetNoNsProp(_node, BAD_CAST _name))
#endif