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

Last change on this file since 471 was 471, checked in by djay, 10 years ago

Remove leaks from DescribeProcess? and JavaScript? support. Fix wrong ulinet update on previous commit. Use the new updateStatus/setOutputValue functions as described in #88 from longProcess. Add default value for QREncode service in ZCFG. Fix name of profile service in the ZCFG file.

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