From 60b2ba6ef9ed779d750958b6422f05c93a4a2d91 Mon Sep 17 00:00:00 2001 From: sr Date: Mon, 3 Sep 2012 21:00:26 +0200 Subject: [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 --- src/server/xmlutil.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/server/xmlutil.h') 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 -- cgit v1.2.3-55-g7522