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

Last change on this file since 578 was 578, checked in by knut, 9 years ago

Added function getLastErrorMessage() (service_internal.c). Fixed problems caused by differing return types for GetLastError?() (unsigned int) and dlerror() (char*). Added DEBUG-conditional macros for diagnostic output in zoo_service_loader.c.

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr
File size: 5.3 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
[34]33#include <libintl.h>
34#include <locale.h>
35#define _(String) dgettext ("zoo-kernel",String)
36#define _ss(String) dgettext ("zoo-services",String)
37
[507]38#define ZOO_LOCK_CREATE_FAILED -4
39#define ZOO_LOCK_ACQUIRE_FAILED -5
40#define ZOO_LOCK_RELEASE_FAILED -6
41
[26]42#include <sys/stat.h>
[1]43#include <sys/types.h>
[478]44#include "cgic.h"
[216]45#ifndef WIN32
[26]46#include <sys/ipc.h>
47#include <sys/shm.h>
[507]48#include <sys/sem.h>
[216]49#else
50#include <direct.h>
51#endif
[26]52#include <stdio.h>
[1]53#include <time.h>
54#include <ctype.h>
[453]55#ifdef WIN32
56#ifndef USE_RUBY
57#include <unistd.h>
58#endif
59#endif
[1]60#ifndef WIN32
61#include <xlocale.h>
62#endif
[490]63#include "ulinet.h"
64
[1]65#include "service.h"
66#include <openssl/sha.h>
[291]67#include <openssl/md5.h>
[1]68#include <openssl/hmac.h>
69#include <openssl/evp.h>
70#include <openssl/bio.h>
71#include <openssl/buffer.h>
72
[114]73extern   int conf_read(const char*,maps*);
[1]74
[26]75#ifdef USE_JS
[364]76#ifdef WIN32
77#define XP_WIN 1
78#else
[26]79#define XP_UNIX 0
[364]80#endif
[26]81#include "service_internal_js.h"
82#endif
83
[453]84
[1]85#ifdef __cplusplus
86extern "C" {
87#endif
88#include <libxml/parser.h>
[280]89#include <libxml/xpath.h>
90
[1]91  static char* SERVICE_URL;
[280]92  static xmlNsPtr usedNs[10];
93  static char* nsName[10];
[490]94  static xmlDocPtr iDocs[10];
[9]95  static int nbNs=0;
[490]96  static int nbDocs=0;
[1]97
[465]98  int getServiceFromYAML(maps*,char*,service**,char *name);
99  int readServiceFile(maps*, char*,service**,char *);
[501]100  int isValidLang(maps*,const char*);
[576]101  void addLangAttr(xmlNodePtr,maps*);
[465]102
[375]103  void printHeaders(maps*);
[216]104  void unhandleStatus(maps*);
[471]105  int _updateStatus(maps*);
[507]106  char* _getStatus(maps*,int);
[26]107  char* getStatus(int);
[507]108  int removeShmLock(maps*, int);
109#ifndef WIN32
110#define semid int
111#else
112#define semid HANDLE
113#endif
114  semid getShmLockId(maps*,int);
115  int lockShm(semid);
116  int unlockShm(semid);
[9]117
[26]118#ifdef USE_JS
119  char* JSValToChar(JSContext*,jsval*);
[274]120  JSBool JSUpdateStatus(JSContext*,uintN,jsval *);
[26]121#endif
122 
[550]123  void readGeneratedFile(maps*,map*,char*);
124
[1]125  void URLDecode(char *);
126  char *url_encode(char *);
[328]127  char *url_decode(char *);
[9]128  char* getEncoding(maps*);
129
[114]130  int zooXmlSearchForNs(const char*);
131  int zooXmlAddNs(xmlNodePtr,const char*,const char*);
[9]132  void zooXmlCleanupNs();
[490]133
134  int zooXmlAddDoc(xmlNodePtr,const char*,const char*);
135  void zooXmlCleanupDocs();
[1]136 
137  void printExceptionReportResponse(maps*,map*);
[26]138  xmlNodePtr createExceptionReportNode(maps*,map*,int);
[114]139  void printProcessResponse(maps*,map*,int,service*,const char*,int,maps*,maps*);
[576]140  xmlNodePtr printWPSHeader(xmlDocPtr,maps*,const char*,const char*);
141  xmlNodePtr printGetCapabilitiesHeader(xmlDocPtr,maps*);
[1]142  void printGetCapabilitiesForProcess(maps*,xmlNodePtr,service*);
[469]143  void printDescribeProcessForProcess(maps*,xmlNodePtr,service*);
[490]144  void printFullDescription(int,elements*,const char*,xmlNsPtr,xmlNodePtr);
[9]145  void printDocument(maps*,xmlDocPtr,int);
[114]146  void printDescription(xmlNodePtr,xmlNsPtr,const char*,map*);
147  void printIOType(xmlDocPtr,xmlNodePtr,xmlNsPtr,xmlNsPtr,xmlNsPtr,elements*,maps*,const char*);
148  map* parseBoundingBox(const char*);
[76]149  void printBoundingBox(xmlNsPtr,xmlNodePtr,map*);
150  void printBoundingBoxDocument(maps*,maps*,FILE*);
[576]151  void printOutputDefinitions(xmlDocPtr,xmlNodePtr,xmlNsPtr,xmlNsPtr,elements*,maps*,const char*);
152
[1]153  void outputResponse(service*,maps*,maps*,map*,int,maps*,int);
154
[216]155  char *base64(const char*,int);
156  char *base64d(const char*,int,int*);
[88]157  void ensureDecodedBase64(maps**);
[576]158  void checkValidValue(map*,map**,const char*,const char**,int);
159  char* addDefaultValues(maps**,elements*,maps*,int,map**);
[1]160
[459]161  int errorException(maps *, const char *, const char *, const char*);
[9]162
[576]163  xmlNodePtr soapEnvelope(maps*,xmlNodePtr);
[280]164  int checkForSoapEnvelope(xmlDocPtr);
165
[446]166  void addToCache(maps*,char*,char*,char*,int);
[280]167  char* isInCache(maps*,char*);
[492]168  int runHttpRequests(maps**,maps**,HINTERNET*);
169  int loadRemoteFile(maps**,map**,HINTERNET*,char*);
[392]170
[469]171  char *readVSIFile(maps*,const char*);
172  void parseIdentifier(maps*,char*,char*,char*);
[471]173  int updateStatus( maps*,const int,const char*);
174  char* getInputValue( maps*,const char*,size_t*);
175  int  setOutputValue( maps*, const char*, char*, size_t);
[578]176 
177  char* getLastErrorMessage();
[1]178#ifdef __cplusplus
179}
180#endif
181
182#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