summaryrefslogtreecommitdiffstats
path: root/libcsoap/soap-service.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcsoap/soap-service.c')
-rw-r--r--libcsoap/soap-service.c94
1 files changed, 50 insertions, 44 deletions
diff --git a/libcsoap/soap-service.c b/libcsoap/soap-service.c
index e8ef81d..91be66e 100644
--- a/libcsoap/soap-service.c
+++ b/libcsoap/soap-service.c
@@ -1,5 +1,5 @@
/******************************************************************
-* $Id: soap-service.c,v 1.4 2004/09/19 07:05:03 snowdrop Exp $
+* $Id: soap-service.c,v 1.5 2006/01/10 11:21:55 snowdrop Exp $
*
* CSOAP Project: A SOAP client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -25,65 +25,71 @@
#include <nanohttp/nanohttp-common.h>
#include <string.h>
-SoapServiceNode *soap_service_node_new(SoapService *service,
- SoapServiceNode *next)
+SoapServiceNode *
+soap_service_node_new (SoapService * service, SoapServiceNode * next)
{
- SoapServiceNode *node ;
+ SoapServiceNode *node;
- node = (SoapServiceNode*)malloc(sizeof(SoapServiceNode));
- node->service = service;
- node->next = next;
+ node = (SoapServiceNode *) malloc (sizeof (SoapServiceNode));
+ node->service = service;
+ node->next = next;
- return node;
+ return node;
}
-SoapService *soap_service_new(const char* urn,
- const char *method,
- SoapServiceFunc f)
+SoapService *
+soap_service_new (const char *urn, const char *method, SoapServiceFunc f)
{
- SoapService *service;
-
-
- service = (SoapService*)malloc(sizeof(SoapService));
- service->func = f;
-
- if (urn != NULL) {
- service->urn = (char*)malloc(strlen(urn)+1);
- strcpy(service->urn, urn);
- } else {
- log_warn1("urn is NULL");
- service->urn = "";
- }
-
- if (method != NULL) {
- service->method = (char*)malloc(strlen(method)+1);
- strcpy(service->method, method);
- } else {
- log_warn1("method is NULL");
- service->method = "";
- }
-
- return service;
+ SoapService *service;
+
+
+ service = (SoapService *) malloc (sizeof (SoapService));
+ service->func = f;
+
+ if (urn != NULL)
+ {
+ service->urn = (char *) malloc (strlen (urn) + 1);
+ strcpy (service->urn, urn);
+ }
+ else
+ {
+ log_warn1 ("urn is NULL");
+ service->urn = "";
+ }
+
+ if (method != NULL)
+ {
+ service->method = (char *) malloc (strlen (method) + 1);
+ strcpy (service->method, method);
+ }
+ else
+ {
+ log_warn1 ("method is NULL");
+ service->method = "";
+ }
+
+ return service;
}
-void soap_service_free(SoapService *service)
+void
+soap_service_free (SoapService * service)
{
- log_verbose2("enter: service=%p", service);
+ log_verbose2 ("enter: service=%p", service);
- if (service == NULL) return;
+ if (service == NULL)
+ return;
- if (strcmp(service->urn, ""))
- free(service->urn);
+ if (strcmp (service->urn, ""))
+ free (service->urn);
- if (strcmp(service->method, ""))
- free(service->method);
+ if (strcmp (service->method, ""))
+ free (service->method);
- free(service);
- log_verbose1("leave with success");
+ free (service);
+ log_verbose1 ("leave with success");
}
-