1 | /** |
---|
2 | * Author : Gérald FENOY |
---|
3 | * |
---|
4 | * Copyright (c) 2009-2010 GeoLabs SARL |
---|
5 | * |
---|
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
---|
7 | * of this software and associated documentation files (the "Software"), to deal |
---|
8 | * in the Software without restriction, including without limitation the rights |
---|
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
---|
10 | * copies of the Software, and to permit persons to whom the Software is |
---|
11 | * furnished to do so, subject to the following conditions: |
---|
12 | * |
---|
13 | * The above copyright notice and this permission notice shall be included in |
---|
14 | * all copies or substantial portions of the Software. |
---|
15 | * |
---|
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
---|
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
---|
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
---|
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
---|
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
---|
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
---|
22 | * THE SOFTWARE. |
---|
23 | */ |
---|
24 | |
---|
25 | #ifndef ZOO_SERVICE_INTERNAL_H |
---|
26 | #define ZOO_SERVICE_INTERNAL_H 1 |
---|
27 | |
---|
28 | #pragma once |
---|
29 | |
---|
30 | #define DEFAULT_SERVICE_URL "http://dev.geolabs.fr/zoo-wps/" |
---|
31 | #define TIME_SIZE 40 |
---|
32 | |
---|
33 | #include <sys/types.h> |
---|
34 | #include <unistd.h> |
---|
35 | #include <time.h> |
---|
36 | #include <ctype.h> |
---|
37 | #ifndef WIN32 |
---|
38 | #include <xlocale.h> |
---|
39 | #endif |
---|
40 | #include "service.h" |
---|
41 | #include <openssl/sha.h> |
---|
42 | #include <openssl/hmac.h> |
---|
43 | #include <openssl/evp.h> |
---|
44 | #include <openssl/bio.h> |
---|
45 | #include <openssl/buffer.h> |
---|
46 | |
---|
47 | extern int getServiceFromFile(char*,service**); |
---|
48 | extern int conf_read(char*,maps*); |
---|
49 | |
---|
50 | #ifdef __cplusplus |
---|
51 | extern "C" { |
---|
52 | #endif |
---|
53 | #include <libxml/parser.h> |
---|
54 | static char* SERVICE_URL; |
---|
55 | static xmlNsPtr usedNs[5]; |
---|
56 | static char* nsName[5]; |
---|
57 | static int nbNs=0; |
---|
58 | |
---|
59 | |
---|
60 | void URLDecode(char *); |
---|
61 | char *url_encode(char *); |
---|
62 | char* getEncoding(maps*); |
---|
63 | |
---|
64 | int zooXmlSearchForNs(char*); |
---|
65 | int zooXmlAddNs(xmlNodePtr,char*,char*); |
---|
66 | void zooXmlCleanupNs(); |
---|
67 | |
---|
68 | void printExceptionReportResponse(maps*,map*); |
---|
69 | void printProcessResponse(maps*,map*,int,service*,char*,int,maps*,maps*); |
---|
70 | xmlNodePtr printGetCapabilitiesHeader(xmlDocPtr,char*,maps*); |
---|
71 | void printGetCapabilitiesForProcess(maps*,xmlNodePtr,service*); |
---|
72 | xmlNodePtr printDescribeProcessHeader(xmlDocPtr,char*,maps*); |
---|
73 | void printDescribeProcessForProcess(maps*,xmlNodePtr,service*,int); |
---|
74 | void printDocument(maps*,xmlDocPtr,int); |
---|
75 | void printDescription(xmlNodePtr,xmlNsPtr,char*,map*); |
---|
76 | void printIOType(xmlDocPtr,xmlNodePtr,xmlNsPtr,xmlNsPtr,elements*,maps*,char*); |
---|
77 | void printOutputDefinitions1(xmlDocPtr,xmlNodePtr,xmlNsPtr,xmlNsPtr,elements*,maps*,char*); |
---|
78 | |
---|
79 | void outputResponse(service*,maps*,maps*,map*,int,maps*,int); |
---|
80 | |
---|
81 | char *base64(const unsigned char*,int); |
---|
82 | |
---|
83 | char* addDefaultValues(maps**,elements*,maps*,char*); |
---|
84 | |
---|
85 | /*defined in zoo_loader.c*/ |
---|
86 | int errorException(maps *m, const char *message, const char *errorcode); |
---|
87 | |
---|
88 | #ifdef __cplusplus |
---|
89 | } |
---|
90 | #endif |
---|
91 | |
---|
92 | #endif |
---|