source: trunk/zoo-project/zoo-kernel/service_internal.h @ 476

Last change on this file since 476 was 476, checked in by djay, 5 years ago

Upgrade dirent-win32 to dirent API for Microsoft Visual Studio. Fix for second empty range node.

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr
File size: 4.6 KB
Line 
1/**
2 * Author : Gérald FENOY
3 *
4 * Copyright (c) 2009-2013 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://www.zoo-project.org/"
31#define TIME_SIZE 40
32
33#include "cgic.h"
34#include <libintl.h>
35#include <locale.h>
36#define _(String) dgettext ("zoo-kernel",String)
37#define _ss(String) dgettext ("zoo-services",String)
38
39#include <sys/stat.h>
40#include <sys/types.h>
41#ifndef WIN32
42#include <sys/ipc.h>
43#include <sys/shm.h>
44#else
45#include <direct.h>
46#endif
47#include <stdio.h>
48#include <time.h>
49#include <ctype.h>
50#ifdef WIN32
51#ifndef USE_RUBY
52#include <unistd.h>
53#endif
54#endif
55#ifndef WIN32
56#include <xlocale.h>
57#endif
58#include <dirent.h>
59#include "service.h"
60#include <openssl/sha.h>
61#include <openssl/md5.h>
62#include <openssl/hmac.h>
63#include <openssl/evp.h>
64#include <openssl/bio.h>
65#include <openssl/buffer.h>
66
67#include "ulinet.h"
68
69extern   int conf_read(const char*,maps*);
70
71#ifdef USE_JS
72#ifdef WIN32
73#define XP_WIN 1
74#else
75#define XP_UNIX 0
76#endif
77#include "service_internal_js.h"
78#endif
79
80
81#ifdef __cplusplus
82extern "C" {
83#endif
84#include <libxml/parser.h>
85#include <libxml/xpath.h>
86
87  static char* SERVICE_URL;
88  static xmlNsPtr usedNs[10];
89  static char* nsName[10];
90  static int nbNs=0;
91
92  int getServiceFromYAML(maps*,char*,service**,char *name);
93  int readServiceFile(maps*, char*,service**,char *);
94 
95
96  void printHeaders(maps*);
97  void unhandleStatus(maps*);
98  int _updateStatus(maps*);
99  char* getStatus(int);
100
101#ifdef USE_JS
102  char* JSValToChar(JSContext*,jsval*);
103  JSBool JSUpdateStatus(JSContext*,uintN,jsval *);
104#endif
105 
106  void URLDecode(char *);
107  char *url_encode(char *);
108  char *url_decode(char *);
109  char* getEncoding(maps*);
110
111  int zooXmlSearchForNs(const char*);
112  int zooXmlAddNs(xmlNodePtr,const char*,const char*);
113  void zooXmlCleanupNs();
114 
115  void printExceptionReportResponse(maps*,map*);
116  xmlNodePtr createExceptionReportNode(maps*,map*,int);
117  void printProcessResponse(maps*,map*,int,service*,const char*,int,maps*,maps*);
118  xmlNodePtr printGetCapabilitiesHeader(xmlDocPtr,const char*,maps*);
119  void printGetCapabilitiesForProcess(maps*,xmlNodePtr,service*);
120  xmlNodePtr printDescribeProcessHeader(xmlDocPtr,const char*,maps*);
121  void printDescribeProcessForProcess(maps*,xmlNodePtr,service*);
122  void printFullDescription(elements*,const char*,xmlNsPtr,xmlNodePtr);
123  void printDocument(maps*,xmlDocPtr,int);
124  void printDescription(xmlNodePtr,xmlNsPtr,const char*,map*);
125  void printIOType(xmlDocPtr,xmlNodePtr,xmlNsPtr,xmlNsPtr,xmlNsPtr,elements*,maps*,const char*);
126  map* parseBoundingBox(const char*);
127  void printBoundingBox(xmlNsPtr,xmlNodePtr,map*);
128  void printBoundingBoxDocument(maps*,maps*,FILE*);
129  void printOutputDefinitions1(xmlDocPtr,xmlNodePtr,xmlNsPtr,xmlNsPtr,elements*,maps*,const char*);
130 
131  void outputResponse(service*,maps*,maps*,map*,int,maps*,int);
132
133  char *base64(const char*,int);
134  char *base64d(const char*,int,int*);
135  void ensureDecodedBase64(maps**);
136
137  char* addDefaultValues(maps**,elements*,maps*,int);
138
139  int errorException(maps *, const char *, const char *, const char*);
140
141  int checkForSoapEnvelope(xmlDocPtr);
142
143  void addToCache(maps*,char*,char*,char*,int);
144  char* isInCache(maps*,char*);
145  int loadRemoteFile(maps**,map**,HINTERNET,char*);
146
147#ifdef USE_MS
148  char *readVSIFile(maps*,const char*);
149#endif
150  void parseIdentifier(maps*,char*,char*,char*);
151  int updateStatus( maps*,const int,const char*);
152  char* getInputValue( maps*,const char*,size_t*);
153  int  setOutputValue( maps*, const char*, char*, size_t);
154
155#ifdef __cplusplus
156}
157#endif
158
159#endif
Note: See TracBrowser for help on using the repository browser.

Search

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png