summaryrefslogtreecommitdiffstats
path: root/wsdl2c/CallList.c
diff options
context:
space:
mode:
authorGravatar snowdrop2004-06-03 13:13:07 +0000
committerGravatar snowdrop2004-06-03 13:13:07 +0000
commit5dee322ce245ef858b3d0e6591cdc19d76e4cb30 (patch)
tree0ba0dfe188a4e9da2ebf2c9f32eb8b2e9a9a3401 /wsdl2c/CallList.c
parent4666292be1927bdb2e319f417a08ab17c91de784 (diff)
downloadcsoap-5dee322ce245ef858b3d0e6591cdc19d76e4cb30.tar.gz
csoap-5dee322ce245ef858b3d0e6591cdc19d76e4cb30.tar.bz2
initial import
Diffstat (limited to 'wsdl2c/CallList.c')
-rw-r--r--wsdl2c/CallList.c116
1 files changed, 116 insertions, 0 deletions
diff --git a/wsdl2c/CallList.c b/wsdl2c/CallList.c
new file mode 100644
index 0000000..62eafcb
--- /dev/null
+++ b/wsdl2c/CallList.c
@@ -0,0 +1,116 @@
+/** Generated by xsd2c */
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "CallList.h"
+
+
+struct CallList* CallList_Create()
+{
+ struct CallList* _res;
+ _res = (struct CallList*)malloc(sizeof(struct CallList));
+
+ _res->operation_head = NULL;
+ _res->operation_tail = NULL;
+
+ return _res;
+}
+
+void CallList_Free(struct CallList* obj)
+{
+ struct CallFunc_List* operation_cur;
+ struct CallFunc_List* operation_tmp;
+ if (obj == NULL) return;
+
+ operation_cur = obj->operation_head;
+ while (operation_cur != NULL)
+ {
+ operation_tmp = operation_cur->next;
+ free(operation_cur);
+ operation_cur = operation_tmp;
+ }
+ free(obj);
+}
+
+void CallList_Sax_Serialize(struct CallList* obj,
+ const char *root_element_name,
+ void (*OnStartElement)(const char* element_name, int attr_count, char **keys, char **values, void* userData),
+ void (*OnCharacters)(const char* element_name, const char* chars, void* userData),
+ void (*OnEndElement)(const char* element_name, void* userData),
+ void* userData)
+{
+ int attrCount, curCount;
+ char **keys;
+ char **values;
+ char buffer[255];
+
+ struct CallFunc_List* operation_cur;
+
+ attrCount = 0;
+
+ keys = (char**)malloc(sizeof(char*)*attrCount);
+ values = (char**)malloc(sizeof(char*)*attrCount);
+
+ curCount = 0;
+
+
+ OnStartElement(root_element_name, attrCount, keys, values, userData);
+ operation_cur = obj->operation_head;
+ while (operation_cur != NULL)
+ {
+ if (operation_cur->value)
+ CallFunc_Sax_Serialize(operation_cur->value, "operation", OnStartElement, OnCharacters, OnEndElement, userData);
+
+ operation_cur = operation_cur->next;
+ }
+
+ OnEndElement(root_element_name, userData);
+}
+
+#ifndef _DESERIALIZER_DISABLED_
+
+struct CallList* CallList_Deserialize(xmlNodePtr xmlRoot)
+{
+ xmlNodePtr cur;
+ xmlChar *key;
+ struct CallList* obj;
+ obj = CallList_Create();
+ cur = xmlRoot->xmlChildrenNode;
+ while (cur != NULL) {
+ if (cur->type != XML_ELEMENT_NODE) {
+ cur = cur->next;
+ continue;
+ }
+ printf("CallList->%s\n", cur->name);
+ if ((!xmlStrcmp(cur->name, (const xmlChar *)"operation"))){
+ CallList_Add_operation( obj, CallFunc_Deserialize(cur) );
+ }
+ // TODO:
+ cur = cur->next;
+ }
+ return obj;
+}
+
+#endif
+struct CallFunc_List* CallList_Get_operation(struct CallList* obj)
+{
+ return obj->operation_head;
+}
+
+void CallList_Add_operation(struct CallList* obj, struct CallFunc* operation)
+{
+ struct CallFunc_List* operation_node;
+ operation_node = (struct CallFunc_List*)malloc(sizeof(struct CallFunc_List));
+ operation_node->value = operation;
+ operation_node->next = NULL;
+ if (obj->operation_tail)
+ {
+ obj->operation_tail->next = operation_node;
+ }
+ if (obj->operation_head == NULL)
+ {
+ obj->operation_head = operation_node;
+ }
+ obj->operation_tail = operation_node;
+}
+