src/server/webdav/saxhandler.cpp

changeset 91
fac51f87def0
parent 87
bdec069d2239
child 92
382bff43c6eb
equal deleted inserted replaced
90:279f343bbf6c 91:fac51f87def0
30 #include <stdlib.h> 30 #include <stdlib.h>
31 #include <string.h> 31 #include <string.h>
32 #include <iostream> 32 #include <iostream>
33 33
34 #include "../ucx/string.h" 34 #include "../ucx/string.h"
35 #include "../ucx/dlist.h" 35 #include "../ucx/list.h"
36 #include "../util/pool.h" 36 #include "../util/pool.h"
37 37
38 #include "saxhandler.h" 38 #include "saxhandler.h"
39 39
40 using namespace std; 40 using namespace std;
41 41
42 void xstack_push(UcxDlist **stack, XmlElement *elm) { 42 void xstack_push(UcxList **stack, XmlElement *elm) {
43 *stack = ucx_dlist_prepend(*stack, elm); 43 *stack = ucx_list_prepend(*stack, elm);
44 } 44 }
45 45
46 XmlElement* xstack_pop(UcxDlist **stack) { 46 XmlElement* xstack_pop(UcxList **stack) {
47 if(*stack == NULL) { 47 if(*stack == NULL) {
48 return NULL; 48 return NULL;
49 } 49 }
50 XmlElement* ret = (XmlElement*)(*stack)->data; 50 XmlElement* ret = (XmlElement*)(*stack)->data;
51 UcxDlist *newstack = ucx_dlist_remove(*stack, *stack); 51 UcxList *newstack = ucx_list_remove(*stack, *stack);
52 *stack = newstack; 52 *stack = newstack;
53 return ret; 53 return ret;
54 } 54 }
55 55
56 56
119 if(property != NULL) { 119 if(property != NULL) {
120 const char *xmlns = (property->xmlns) ? property->xmlns->xmlns : ""; 120 const char *xmlns = (property->xmlns) ? property->xmlns->xmlns : "";
121 121
122 if(!strcmp(ns, xmlns) && !strcmp(name, property->name)) { 122 if(!strcmp(ns, xmlns) && !strcmp(name, property->name)) {
123 // add property to DavRequest 123 // add property to DavRequest
124 UcxDlist *elm = (UcxDlist*)pool_malloc(pool, sizeof(UcxDlist)); 124 UcxList *elm = (UcxList*)pool_malloc(pool, sizeof(UcxList));
125 elm->prev = NULL; 125 elm->prev = NULL;
126 elm->next = NULL; 126 elm->next = NULL;
127 elm->data = property; 127 elm->data = property;
128 //printf("saxhandler: add property: {%s}\n", property->name); 128 //printf("saxhandler: add property: {%s}\n", property->name);
129 davrq->properties = ucx_dlist_concat(davrq->properties, elm); 129 davrq->properties = ucx_list_concat(davrq->properties, elm);
130 130
131 property = NULL; 131 property = NULL;
132 } 132 }
133 } 133 }
134 134
158 158
159 updateMode = -1; 159 updateMode = -1;
160 } 160 }
161 161
162 ProppatchHandler::~ProppatchHandler() { 162 ProppatchHandler::~ProppatchHandler() {
163 ucx_dlist_free(xmlStack); 163 ucx_list_free(xmlStack);
164 } 164 }
165 165
166 void ProppatchHandler::startElement( 166 void ProppatchHandler::startElement(
167 const XMLCh *const uri, 167 const XMLCh *const uri,
168 const XMLCh* const localname, 168 const XMLCh* const localname,
234 */ 234 */
235 235
236 /* add the property to the proppatch request */ 236 /* add the property to the proppatch request */
237 switch(updateMode) { 237 switch(updateMode) {
238 case 0: { 238 case 0: {
239 davrq->setProps = ucx_dlist_append( 239 davrq->setProps = ucx_list_append(
240 davrq->setProps, 240 davrq->setProps,
241 rootElement); 241 rootElement);
242 break; 242 break;
243 } 243 }
244 case 1: { 244 case 1: {
245 davrq->removeProps = ucx_dlist_append( 245 davrq->removeProps = ucx_list_append(
246 davrq->removeProps, 246 davrq->removeProps,
247 rootElement); 247 rootElement);
248 break; 248 break;
249 } 249 }
250 } 250 }

mercurial