From fc13964422ceccee84640cdc71a308dd48976560 Mon Sep 17 00:00:00 2001 From: rans Date: Thu, 2 Sep 2004 11:48:28 +0000 Subject: Just changed casts to libxml2's BAD_CAST x --- libcsoap/soap-client.c | 18 +++++++++++------- libcsoap/soap-env.c | 45 ++++++++++++++++++++++----------------------- libcsoap/soap-env.h | 10 +++++----- libcsoap/soap-fault.c | 4 ++-- libcsoap/soap-xml.c | 4 ++-- libcsoap/soap-xml.h | 3 ++- 6 files changed, 44 insertions(+), 40 deletions(-) (limited to 'libcsoap') diff --git a/libcsoap/soap-client.c b/libcsoap/soap-client.c index a0038fb..2c0bb4a 100644 --- a/libcsoap/soap-client.c +++ b/libcsoap/soap-client.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: soap-client.c,v 1.5 2004/08/30 15:26:53 snowdrop Exp $ +* $Id: soap-client.c,v 1.6 2004/09/02 11:48:28 rans Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -28,10 +28,14 @@ /*--------------------------------- */ static SoapEnv *_soap_client_build_result(hresponse_t *res); /*--------------------------------- */ - -int soap_client_init_args(int argc, char *argv[]) -{ - return !httpc_init(argc, argv); + + +int soap_client_init_args(int argc, char *argv[]) + +{ + + return !httpc_init(argc, argv); + } SoapEnv* @@ -62,7 +66,7 @@ soap_client_invoke(SoapEnv *call, const char *url, const char *soap_action) if (soap_action != NULL) { httpc_set_header(conn, "SoapAction", soap_action); } - res = httpc_post(conn, url, strlen(content), content); + res = httpc_post(conn, url, (int)strlen(content), content); /* Free buffer */ xmlBufferFree(buffer); @@ -93,7 +97,7 @@ SoapEnv* _soap_client_build_result(hresponse_t *res) - doc = xmlParseDoc((xmlChar *)res->body); + doc = xmlParseDoc(BAD_CAST res->body); if (doc == NULL) { return soap_env_new_with_fault(Fault_Client, "Response is not in XML format!","",""); diff --git a/libcsoap/soap-env.c b/libcsoap/soap-env.c index 474e32e..cd9e6d5 100644 --- a/libcsoap/soap-env.c +++ b/libcsoap/soap-env.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: soap-env.c,v 1.4 2004/08/26 17:06:18 rans Exp $ +* $Id: soap-env.c,v 1.5 2004/09/02 11:48:28 rans Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -24,6 +24,7 @@ #include #include #include +#include static char *soap_env_ns = "http://schemas.xmlsoap.org/soap/envelope/"; static char *soap_env_enc = "http://schemas.xmlsoap.org/soap/encoding/"; @@ -57,15 +58,15 @@ Parameters: struct XmlNodeHolder { xmlNodePtr node; }; static -void xmlbuilder_start_element(const char* element_name, int attr_count, - char **keys, char **values, void* userData); +void xmlbuilder_start_element(const xmlChar* element_name, int attr_count, + xmlChar **keys, xmlChar **values, void* userData); static -void xmlbuilder_characters(const char* element_name, - const char* chars, void* userData); +void xmlbuilder_characters(const xmlChar* element_name, + const xmlChar* chars, void* userData); static -void xmlbuilder_end_element(const char* element_name, void* userData); +void xmlbuilder_end_element(const xmlChar* element_name, void* userData); /* ---------------------------------------------------------------------------- */ @@ -118,17 +119,17 @@ SoapEnv *soap_env_new_with_method(const char *urn, const char *method) { xmlDocPtr env; SoapEnv *call; - char buffer[1054]; + xmlChar buffer[1054]; log_verbose2("URN = '%s'", urn); log_verbose2("Method = '%s'",method); - sprintf(buffer, _SOAP_MSG_TEMPLATE_, + xmlStrPrintf(buffer, 1054, BAD_CAST _SOAP_MSG_TEMPLATE_, soap_env_ns, soap_env_enc, soap_xsi_ns, - soap_xsd_ns, method, urn, method); + soap_xsd_ns, BAD_CAST method, BAD_CAST urn, BAD_CAST method); - env = xmlParseDoc((xmlChar *)buffer); + env = xmlParseDoc(buffer); call = soap_env_new_from_doc(env); return call; @@ -143,7 +144,7 @@ soap_env_add_item(SoapEnv *call, const char *type, xmlNodePtr newnode; - newnode = xmlNewTextChild(call->cur, NULL, (const xmlChar *)name, (const xmlChar *)value); + newnode = xmlNewTextChild(call->cur, NULL, BAD_CAST name, BAD_CAST value); if (newnode == NULL) { log_error1("Can not create new xml node"); @@ -151,7 +152,7 @@ soap_env_add_item(SoapEnv *call, const char *type, } if (type) { - if (!xmlNewProp(newnode, (const xmlChar *)"xsi:type", (const xmlChar *)type)) { + if (!xmlNewProp(newnode, BAD_CAST "xsi:type", BAD_CAST type)) { log_error1("Can not create new xml attribute"); return NULL; } @@ -186,7 +187,7 @@ soap_env_add_custom(SoapEnv *call, void *obj, XmlSerializerCallback cb, holder.node = soap_env_get_method(call); - cb(obj, name, + cb(obj, BAD_CAST name, xmlbuilder_start_element, xmlbuilder_characters, xmlbuilder_end_element, &holder); @@ -269,7 +270,7 @@ SoapEnv *soap_env_new_from_buffer(const char* buffer) if (buffer == NULL) return NULL; - doc = xmlParseDoc((xmlChar*)buffer); + doc = xmlParseDoc(BAD_CAST buffer); if (doc == NULL) return NULL; env = soap_env_new_from_doc(doc); @@ -300,7 +301,7 @@ soap_env_get_body(SoapEnv* env) node = soap_xml_get_children(env->root); while (node != NULL) { - if (!strcmp((const char*)node->name, "Body")) + if (!xmlStrcmp(node->name, BAD_CAST "Body")) return node; node = soap_xml_get_next(node); } @@ -365,13 +366,11 @@ _soap_env_get_body(SoapEnv* env) if (nodeset->nodeNr < 1) { log_error1("No Body (nodeNr)!"); - xmlXPathFreeNodeSet (nodeset); xmlXPathFreeObject(xpathobj); return NULL; } body = nodeset->nodeTab[0]; /* body is */ - xmlXPathFreeNodeSet (nodeset); xmlXPathFreeObject(xpathobj); return body; @@ -401,7 +400,7 @@ int soap_env_find_urn(SoapEnv *env, char *urn) ns = xmlSearchNs(body->doc, node, node->ns->prefix); if (ns != NULL) { strcpy(urn, (char*)ns->href); - return 1; /* namesapce found! */ + return 1; /* namespace found! */ } } @@ -443,7 +442,7 @@ int soap_env_find_methodname(SoapEnv *env, char *method) static -void xmlbuilder_start_element(const char* element_name, int attr_count, char **keys, char **values, void* userData) +void xmlbuilder_start_element(const xmlChar* element_name, int attr_count, xmlChar **keys, xmlChar **values, void* userData) { struct XmlNodeHolder *holder = (struct XmlNodeHolder*)userData; xmlNodePtr parent = NULL; @@ -452,12 +451,12 @@ void xmlbuilder_start_element(const char* element_name, int attr_count, char **k parent = holder->node; if (parent == NULL) return; - holder->node = xmlNewChild(parent, NULL, (const xmlChar *)element_name, NULL); + holder->node = xmlNewChild(parent, NULL, element_name, NULL); } static -void xmlbuilder_characters(const char* element_name, const char* chars, void* userData) +void xmlbuilder_characters(const xmlChar* element_name, const xmlChar* chars, void* userData) { struct XmlNodeHolder *holder = (struct XmlNodeHolder*)userData; xmlNodePtr parent = NULL; @@ -466,11 +465,11 @@ void xmlbuilder_characters(const char* element_name, const char* chars, void* us parent = holder->node; if (parent == NULL) return; - xmlNewTextChild(parent, NULL, (const xmlChar *)element_name, (const xmlChar *)chars); + xmlNewTextChild(parent, NULL, element_name, chars); } static -void xmlbuilder_end_element(const char* element_name, void* userData) +void xmlbuilder_end_element(const xmlChar * element_name, void* userData) { struct XmlNodeHolder *holder = (struct XmlNodeHolder*)userData; diff --git a/libcsoap/soap-env.h b/libcsoap/soap-env.h index 5f29c14..4625890 100644 --- a/libcsoap/soap-env.h +++ b/libcsoap/soap-env.h @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: soap-env.h,v 1.5 2004/06/08 12:54:09 snowdrop Exp $ + * $Id: soap-env.h,v 1.6 2004/09/02 11:48:28 rans Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -163,10 +163,10 @@ SoapEnv *soap_env_new_from_buffer(const char* buffer); /* --------------------------------------------------- */ typedef void (*XmlSerializerCallback) - (void* /*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* /*obj*/, const xmlChar * /*root_element_name*/, + void (*OnStartElement)(const xmlChar* element_name, int attr_count, xmlChar **keys, xmlChar **values, void* userData), + void (*OnCharacters)(const xmlChar* element_name, const xmlChar* chars, void* userData), + void (*OnEndElement)(const xmlChar* element_name, void* userData), void* /* userdata*/); diff --git a/libcsoap/soap-fault.c b/libcsoap/soap-fault.c index b002ddc..698c044 100644 --- a/libcsoap/soap-fault.c +++ b/libcsoap/soap-fault.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: soap-fault.c,v 1.3 2004/08/26 17:06:18 rans Exp $ +* $Id: soap-fault.c,v 1.4 2004/09/02 11:48:28 rans Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -108,7 +108,7 @@ xmlDocPtr soap_fault_build(fault_code_t fcode, faultactor?faultactor:"", detail?detail:""); - fault = xmlParseDoc((xmlChar *)buffer); + fault = xmlParseDoc(BAD_CAST buffer); free(buffer); if (fault == NULL) { diff --git a/libcsoap/soap-xml.c b/libcsoap/soap-xml.c index 1cae5b1..95b23c0 100644 --- a/libcsoap/soap-xml.c +++ b/libcsoap/soap-xml.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: soap-xml.c,v 1.4 2004/08/26 17:06:18 rans Exp $ +* $Id: soap-xml.c,v 1.5 2004/09/02 11:48:28 rans Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -66,7 +66,7 @@ soap_xpath_eval(xmlDocPtr doc, const char *xpath) xmlXPathObjectPtr result; context = xmlXPathNewContext(doc); - result = xmlXPathEvalExpression((xmlChar*)xpath, context); + result = xmlXPathEvalExpression(BAD_CAST xpath, context); if(xmlXPathNodeSetIsEmpty(result->nodesetval)){ /* no result */ return NULL; diff --git a/libcsoap/soap-xml.h b/libcsoap/soap-xml.h index 7976a42..8083346 100644 --- a/libcsoap/soap-xml.h +++ b/libcsoap/soap-xml.h @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: soap-xml.h,v 1.3 2004/02/03 08:59:22 snowdrop Exp $ + * $Id: soap-xml.h,v 1.4 2004/09/02 11:48:28 rans Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -25,6 +25,7 @@ #define cSOAP_XML_H #include +#include #include -- cgit v1.1-32-gdbae