[579] | 1 | /* |
---|
[1] | 2 | * Author : Gérald FENOY |
---|
| 3 | * |
---|
[917] | 4 | * Copyright (c) 2009-2019 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_H |
---|
| 26 | #define ZOO_SERVICE_H 1 |
---|
| 27 | |
---|
| 28 | #pragma once |
---|
| 29 | |
---|
[216] | 30 | #ifdef WIN32 |
---|
[680] | 31 | #define ZOO_DLL_EXPORT __declspec( dllexport ) |
---|
| 32 | #else |
---|
| 33 | #define ZOO_DLL_EXPORT |
---|
| 34 | #endif |
---|
| 35 | |
---|
[917] | 36 | // knut: add bool if necessary |
---|
| 37 | #ifndef __cplusplus |
---|
| 38 | #ifndef WIN32 |
---|
| 39 | #include <stdbool.h> |
---|
| 40 | #else |
---|
| 41 | typedef int bool; |
---|
| 42 | #define false 0 |
---|
| 43 | #define true 1 |
---|
[843] | 44 | #endif |
---|
[847] | 45 | #endif |
---|
[889] | 46 | #ifndef __bool_true_false_are_defined |
---|
[917] | 47 | #define __bool_true_false_are_defined 1 |
---|
[889] | 48 | #endif |
---|
| 49 | |
---|
[843] | 50 | #ifdef WIN32 |
---|
[917] | 51 | #define strtok_r strtok_s |
---|
[375] | 52 | #define strncasecmp _strnicmp |
---|
| 53 | #define strcasecmp _stricmp |
---|
[757] | 54 | #if defined(_MSC_VER) && _MSC_VER < 1900 |
---|
| 55 | #define snprintf _snprintf |
---|
[453] | 56 | #endif |
---|
| 57 | #define zStrdup _strdup |
---|
| 58 | #define zMkdir _mkdir |
---|
[917] | 59 | #define zGetpid _getpid |
---|
[453] | 60 | #define zOpen _open |
---|
[917] | 61 | #define zClose _close |
---|
| 62 | #define zUnlink _unlink |
---|
| 63 | #define zDup _dup |
---|
| 64 | #define zDup2 _dup2 |
---|
[453] | 65 | #define zWrite _write |
---|
[507] | 66 | #define zSleep Sleep |
---|
[514] | 67 | #include <sys/timeb.h> |
---|
| 68 | struct ztimeval { |
---|
| 69 | long tv_sec; /* seconds */ |
---|
| 70 | long tv_usec; /* and microseconds */ |
---|
| 71 | }; |
---|
[554] | 72 | static int zGettimeofday(struct ztimeval* tp, void* tzp) |
---|
[514] | 73 | { |
---|
[554] | 74 | if (tp == 0) { |
---|
| 75 | return -1; |
---|
| 76 | } |
---|
| 77 | |
---|
[917] | 78 | struct _timeb theTime; |
---|
[514] | 79 | _ftime(&theTime); |
---|
| 80 | tp->tv_sec = theTime.time; |
---|
| 81 | tp->tv_usec = theTime.millitm * 1000; |
---|
[554] | 82 | |
---|
| 83 | return 0; // The gettimeofday() function shall return 0 on success |
---|
[514] | 84 | } |
---|
[712] | 85 | |
---|
[917] | 86 | #define zStatStruct struct _stati64 |
---|
| 87 | #define zStat _stati64 |
---|
| 88 | |
---|
[379] | 89 | #else |
---|
[975] | 90 | #include <sys/stat.h> |
---|
[579] | 91 | /** |
---|
| 92 | * The crossplatform strdup alias |
---|
| 93 | */ |
---|
[453] | 94 | #define zStrdup strdup |
---|
[579] | 95 | /** |
---|
| 96 | * The crossplatform mkdir alias |
---|
| 97 | */ |
---|
[975] | 98 | static int zMkdir(const char* pccPath){ |
---|
| 99 | return mkdir(pccPath,0777); |
---|
| 100 | } |
---|
[579] | 101 | /** |
---|
| 102 | * The crossplatform open alias |
---|
| 103 | */ |
---|
[454] | 104 | #define zOpen open |
---|
[579] | 105 | /** |
---|
[917] | 106 | * The crossplatform close alias |
---|
| 107 | */ |
---|
| 108 | #define zClose close |
---|
| 109 | /** |
---|
| 110 | * The crossplatform unlink alias |
---|
| 111 | */ |
---|
| 112 | #define zUnlink unlink |
---|
| 113 | /** |
---|
| 114 | * The crossplatform dup alias |
---|
| 115 | */ |
---|
| 116 | #define zDup dup |
---|
| 117 | /** |
---|
| 118 | * The crossplatform dup2 alias |
---|
| 119 | */ |
---|
| 120 | #define zDup2 dup2 |
---|
| 121 | /** |
---|
[579] | 122 | * The crossplatform write alias |
---|
| 123 | */ |
---|
[454] | 124 | #define zWrite write |
---|
[917] | 125 | #include "unistd.h" |
---|
[579] | 126 | /** |
---|
| 127 | * The crossplatform sleep alias |
---|
| 128 | */ |
---|
[917] | 129 | static int zSleep(const long millisecond){ |
---|
| 130 | return usleep(millisecond*1000); |
---|
| 131 | } |
---|
[579] | 132 | /** |
---|
| 133 | * The crossplatform gettimeofday alias |
---|
| 134 | */ |
---|
[514] | 135 | #define zGettimeofday gettimeofday |
---|
[579] | 136 | /** |
---|
| 137 | * The crossplatform timeval alias |
---|
| 138 | */ |
---|
[514] | 139 | #define ztimeval timeval |
---|
[917] | 140 | /** |
---|
| 141 | * The crossplatform getpid alias |
---|
| 142 | */ |
---|
| 143 | #define zGetpid getpid |
---|
| 144 | |
---|
| 145 | #define zStatStruct struct stat64 |
---|
| 146 | #define zStat stat64 |
---|
| 147 | |
---|
[216] | 148 | #endif |
---|
| 149 | |
---|
[1] | 150 | #ifdef __cplusplus |
---|
| 151 | extern "C" { |
---|
| 152 | #endif |
---|
| 153 | |
---|
[444] | 154 | #ifdef WIN32 |
---|
| 155 | #ifdef USE_MS |
---|
| 156 | #include <mapserver.h> |
---|
| 157 | #endif |
---|
| 158 | #endif |
---|
[1] | 159 | #include <stdlib.h> |
---|
| 160 | #include <ctype.h> |
---|
[712] | 161 | |
---|
[1] | 162 | #include <stdio.h> |
---|
[712] | 163 | |
---|
[1] | 164 | #include <string.h> |
---|
[364] | 165 | #ifndef WIN32 |
---|
[618] | 166 | #include <ctype.h> |
---|
[917] | 167 | #include <stdbool.h> |
---|
[490] | 168 | #endif |
---|
[9] | 169 | |
---|
[579] | 170 | /** |
---|
| 171 | * The global accepted status for a service |
---|
| 172 | */ |
---|
[1] | 173 | #define SERVICE_ACCEPTED 0 |
---|
[579] | 174 | /** |
---|
| 175 | * The global started status for a service |
---|
| 176 | */ |
---|
[1] | 177 | #define SERVICE_STARTED 1 |
---|
[579] | 178 | /** |
---|
| 179 | * The global paused status for a service |
---|
| 180 | */ |
---|
[1] | 181 | #define SERVICE_PAUSED 2 |
---|
[579] | 182 | /** |
---|
| 183 | * The global succeeded status for a service |
---|
| 184 | */ |
---|
[1] | 185 | #define SERVICE_SUCCEEDED 3 |
---|
[579] | 186 | /** |
---|
| 187 | * The global failed status for a service |
---|
| 188 | */ |
---|
[1] | 189 | #define SERVICE_FAILED 4 |
---|
[962] | 190 | /** |
---|
| 191 | * The global dismissed status for a service |
---|
| 192 | */ |
---|
| 193 | #define SERVICE_DISMISSED 5 |
---|
[9] | 194 | |
---|
[579] | 195 | /** |
---|
| 196 | * The memory size to create an elements |
---|
| 197 | */ |
---|
[917] | 198 | #define ELEMENTS_SIZE (sizeof(char*)+(((2*sizeof(char*))+sizeof(maps*))*3)+sizeof(char*)+((sizeof(map*) + sizeof(iotype*))*2)+(2*sizeof(elements*))) |
---|
[579] | 199 | /** |
---|
| 200 | * The memory size to create a map |
---|
| 201 | */ |
---|
[788] | 202 | //#define MAP_SIZE (2*sizeof(char*))+sizeof(NULL) // knut: size of NULL pointer may be different from regular pointer (platform dependent) |
---|
| 203 | #define MAP_SIZE (2*sizeof(char*))+sizeof(map*) |
---|
[579] | 204 | /** |
---|
| 205 | * The memory size to create an iotype |
---|
| 206 | */ |
---|
[788] | 207 | //#define IOTYPE_SIZE MAP_SIZE+sizeof(NULL) |
---|
| 208 | #define IOTYPE_SIZE sizeof(map*) + sizeof(iotype*) |
---|
[579] | 209 | /** |
---|
| 210 | * The memory size to create a maps |
---|
| 211 | */ |
---|
[788] | 212 | //#define MAPS_SIZE (2*sizeof(char*))+sizeof(map*)+MAP_SIZE |
---|
[790] | 213 | #define MAPS_SIZE sizeof(char*)+sizeof(map*)+(2*sizeof(maps*)) |
---|
[579] | 214 | /** |
---|
| 215 | * The memory size to create a service |
---|
| 216 | */ |
---|
[788] | 217 | //#define SERVICE_SIZE (ELEMENTS_SIZE*2)+(MAP_SIZE*2)+sizeof(char*) |
---|
[917] | 218 | #define SERVICE_SIZE sizeof(char*) + 3*sizeof(map*) + 2*sizeof(elements*) |
---|
[607] | 219 | /** |
---|
| 220 | * The memory size to create a services |
---|
| 221 | */ |
---|
[788] | 222 | //#define SERVICES_SIZE SERVICE_SIZE+sizeof(services*) |
---|
| 223 | #define SERVICES_SIZE sizeof(service*)+sizeof(services*) |
---|
[607] | 224 | /** |
---|
| 225 | * The memory size to create a registry |
---|
| 226 | */ |
---|
[788] | 227 | //#define REGISTRY_SIZE SERVICES_SIZE+sizeof(char*) |
---|
| 228 | #define REGISTRY_SIZE sizeof(char*)+sizeof(services*)+sizeof(registry*) |
---|
[1] | 229 | |
---|
[26] | 230 | #define SHMSZ 27 |
---|
[1] | 231 | |
---|
[465] | 232 | #include "version.h" |
---|
[1] | 233 | |
---|
[375] | 234 | #ifdef DEBUG_STACK |
---|
| 235 | void debugStack(const char* file,const int line){ |
---|
| 236 | int stack; |
---|
| 237 | fprintf(stderr,"stack %p (%s: %d) \n",&stack,file,line); |
---|
| 238 | } |
---|
| 239 | #endif |
---|
| 240 | |
---|
[9] | 241 | /** |
---|
[579] | 242 | * KVP linked list |
---|
[9] | 243 | */ |
---|
[1] | 244 | typedef struct map{ |
---|
[607] | 245 | char* name; //!< the key |
---|
| 246 | char* value; //!< the value |
---|
| 247 | struct map* next; //!< the pointer to the next map if any or NULL |
---|
[1] | 248 | } map; |
---|
| 249 | |
---|
| 250 | #ifdef WIN32 |
---|
| 251 | #define NULLMAP ((map*) 0) |
---|
[917] | 252 | // knut: see new definition above |
---|
| 253 | //#define bool int |
---|
| 254 | //#define true 1 |
---|
| 255 | //#define false 0 |
---|
[1] | 256 | #else |
---|
| 257 | #define NULLMAP NULL |
---|
| 258 | #endif |
---|
| 259 | |
---|
[114] | 260 | /** |
---|
[579] | 261 | * linked list of map pointer |
---|
[114] | 262 | * |
---|
| 263 | * Small object to store WPS KVP set. |
---|
| 264 | */ |
---|
| 265 | typedef struct maps{ |
---|
[607] | 266 | char* name; //!< the maps name |
---|
| 267 | struct map* content; //!< the content map |
---|
[790] | 268 | struct maps* child; //!< the child maps |
---|
[607] | 269 | struct maps* next; //!< the pointer to the next maps if any or NULL |
---|
[114] | 270 | } maps; |
---|
[601] | 271 | |
---|
[579] | 272 | /** |
---|
| 273 | * Not named linked list |
---|
[114] | 274 | * |
---|
[781] | 275 | * Used to store information about formats, such as mimeType, encoding ... |
---|
[114] | 276 | */ |
---|
[1] | 277 | typedef struct iotype{ |
---|
[607] | 278 | struct map* content; //!< the content map |
---|
| 279 | struct iotype* next; //!< the pointer to the next iotype if any or NULL |
---|
[1] | 280 | } iotype; |
---|
| 281 | |
---|
[114] | 282 | /** |
---|
[579] | 283 | * Metadata information about input or output. |
---|
[114] | 284 | * |
---|
[781] | 285 | * The elements are used to store metadata information defined in the ZCFG. |
---|
[114] | 286 | */ |
---|
[1] | 287 | typedef struct elements{ |
---|
[607] | 288 | char* name; //!< the name |
---|
| 289 | struct map* content; //!< the content map |
---|
| 290 | struct map* metadata; //!< the metadata map |
---|
[917] | 291 | struct map* additional_parameters; //!< the additional parameters map |
---|
[607] | 292 | char* format; //!< the format: LiteralData or ComplexData or BoundingBoxData |
---|
| 293 | struct iotype* defaults; //!< the default iotype |
---|
| 294 | struct iotype* supported; //!< the supported iotype |
---|
[640] | 295 | struct elements* child; //!< the pointer to the children element if any (or NULL) |
---|
[607] | 296 | struct elements* next; //!< the pointer to the next element if any (or NULL) |
---|
[1] | 297 | } elements; |
---|
| 298 | |
---|
[579] | 299 | /** |
---|
[781] | 300 | * Metadata information about a full Service. |
---|
[579] | 301 | */ |
---|
[1] | 302 | typedef struct service{ |
---|
[607] | 303 | char* name; //!< the name |
---|
| 304 | struct map* content; //!< the content map |
---|
| 305 | struct map* metadata; //!< the metadata map |
---|
[917] | 306 | struct map* additional_parameters; //!< the additional parameters map |
---|
[607] | 307 | struct elements* inputs; //!< the inputs elements |
---|
| 308 | struct elements* outputs; //!< the outputs elements |
---|
[1] | 309 | } service; |
---|
| 310 | |
---|
[579] | 311 | /** |
---|
[607] | 312 | * Services chained list. |
---|
[579] | 313 | */ |
---|
[1] | 314 | typedef struct services{ |
---|
[607] | 315 | struct service* content; //!< the content service pointer |
---|
| 316 | struct services* next; //!< the pointer to the next services* |
---|
[1] | 317 | } services; |
---|
| 318 | |
---|
[579] | 319 | /** |
---|
[607] | 320 | * Profile registry. |
---|
| 321 | */ |
---|
| 322 | typedef struct registry{ |
---|
| 323 | char *name; //!< the name |
---|
| 324 | struct services* content; //!< the content services pointer |
---|
| 325 | struct registry* next; //!< the next registry pointer |
---|
| 326 | } registry; |
---|
[917] | 327 | |
---|
[889] | 328 | // knut |
---|
| 329 | enum WPSException { |
---|
[917] | 330 | /* |
---|
| 331 | * StatusOK is not a WPS exception, it is added |
---|
| 332 | * here for convenience. |
---|
| 333 | */ |
---|
| 334 | StatusOK, |
---|
| 335 | /* |
---|
| 336 | * See WPS 1.0 specification, Table 38 and Table 62. |
---|
| 337 | */ |
---|
| 338 | MissingParameterValue, |
---|
| 339 | InvalidParameterValue, |
---|
| 340 | NoApplicableCode, |
---|
| 341 | NotEnoughStorage, |
---|
| 342 | ServerBusy, |
---|
| 343 | FileSizeExceeded, |
---|
| 344 | StorageNotSupported, |
---|
| 345 | VersionNegotiationFailed, |
---|
| 346 | /* |
---|
| 347 | * See WPS 2.0 specification, Tables 41, 46, 48, and 50. |
---|
| 348 | */ |
---|
| 349 | NoSuchProcess, |
---|
| 350 | NoSuchMode, |
---|
| 351 | NoSuchInput, |
---|
| 352 | NoSuchOutput, |
---|
| 353 | DataNotAccessible, |
---|
| 354 | SizeExceeded, |
---|
| 355 | TooManyInputs, |
---|
| 356 | TooManyOutputs, |
---|
| 357 | NoSuchFormat, |
---|
| 358 | WrongInputData, |
---|
| 359 | InternalServerError, |
---|
| 360 | NoSuchJob, |
---|
| 361 | ResultNotReady |
---|
| 362 | }; |
---|
| 363 | |
---|
[889] | 364 | static const char* const WPSExceptionCode[] = { |
---|
[917] | 365 | "StatusOK", |
---|
| 366 | "MissingParameterValue", |
---|
| 367 | "InvalidParameterValue", |
---|
| 368 | "NoApplicableCode", |
---|
| 369 | "NotEnoughStorage", |
---|
| 370 | "ServerBusy", |
---|
| 371 | "FileSizeExceeded", |
---|
| 372 | "StorageNotSupported", |
---|
| 373 | "VersionNegotiationFailed", |
---|
| 374 | "NoSuchProcess", |
---|
| 375 | "NoSuchMode", |
---|
| 376 | "NoSuchInput", |
---|
| 377 | "NoSuchOutput", |
---|
| 378 | "DataNotAccessible", |
---|
| 379 | "SizeExceeded", |
---|
| 380 | "TooManyInputs", |
---|
| 381 | "TooManyOutputs", |
---|
| 382 | "NoSuchFormat", |
---|
| 383 | "WrongInputData", |
---|
| 384 | "InternalServerError", |
---|
| 385 | "NoSuchJob", |
---|
| 386 | "ResultNotReady" |
---|
| 387 | }; |
---|
[607] | 388 | |
---|
[889] | 389 | static const char* const WPSExceptionText[] = { |
---|
[917] | 390 | "No problem detected", |
---|
| 391 | "Operation request does not include a parameter value, and this server did not declare a default value for that parameter.", |
---|
| 392 | "Operation request contains an invalid parameter value.", |
---|
| 393 | "No other exceptionCode specified by this service and server applies to this exception.", |
---|
| 394 | "The server does not have enough space available to store the inputs and outputs associated with the request.", |
---|
| 395 | "The server is too busy to accept and queue the request at this time.", |
---|
| 396 | "The file size of one of the input parameters was too large for this process to handle.", |
---|
| 397 | "Execute operation request included transmission=”reference” for one of the outputs, but storage is not offered by this server.", |
---|
| 398 | "Service version for a ComplexData xlink:href input was not supported by the referenced server, and version negotiation failed.", |
---|
| 399 | "One of the identifiers passed does not match with any of the processes offered by this server.", |
---|
| 400 | "The process does not permit the desired execution mode.", |
---|
| 401 | "One or more of the input identifiers passed does not match with any of the input identifiers of this process.", |
---|
| 402 | "One or more of the output identifiers passed does not match with any of the input identifiers of this process.", |
---|
| 403 | "One of the referenced input data sets was inaccessible.", |
---|
| 404 | "The size of one of the input parameters was too large for this process to handle.", |
---|
| 405 | "Too many input items have been specified.", |
---|
| 406 | "Too many output items have been specified.", |
---|
| 407 | "One or more of the input or output formats specified in the request did not match with any of the formats defined for that particular input or output.", |
---|
| 408 | "One or more of inputs for which the service was able to retrieve the data but could not read it.", |
---|
| 409 | "", |
---|
| 410 | "The JobID from the request does not match any of the Jobs running on this server.", |
---|
| 411 | "The result for the requested JobID has not yet been generated." |
---|
[889] | 412 | }; |
---|
| 413 | |
---|
[680] | 414 | ZOO_DLL_EXPORT void _dumpMap(map*); |
---|
| 415 | ZOO_DLL_EXPORT void dumpMap(map*); |
---|
| 416 | ZOO_DLL_EXPORT void dumpMaps(maps* m); |
---|
[682] | 417 | ZOO_DLL_EXPORT void dumpMapToFile(map*,FILE*); // (used only internally) |
---|
| 418 | ZOO_DLL_EXPORT void dumpMapsToFile(maps*,char*,int); |
---|
[680] | 419 | ZOO_DLL_EXPORT map* createMap(const char*,const char*); |
---|
[790] | 420 | ZOO_DLL_EXPORT maps* createMaps(const char*); |
---|
[680] | 421 | ZOO_DLL_EXPORT int count(map*); |
---|
| 422 | ZOO_DLL_EXPORT bool hasKey(map*,const char*); |
---|
| 423 | ZOO_DLL_EXPORT maps* getMaps(maps*,const char*); |
---|
| 424 | ZOO_DLL_EXPORT map* getMap(map*,const char*); |
---|
| 425 | ZOO_DLL_EXPORT map* getLastMap(map*); |
---|
| 426 | ZOO_DLL_EXPORT map* getMapFromMaps(maps*,const char*,const char*); |
---|
| 427 | ZOO_DLL_EXPORT void freeMap(map**); |
---|
| 428 | ZOO_DLL_EXPORT void freeMaps(maps** mo); |
---|
[917] | 429 | ZOO_DLL_EXPORT iotype* createIoType(); |
---|
[790] | 430 | ZOO_DLL_EXPORT elements* createEmptyElements(); |
---|
[917] | 431 | ZOO_DLL_EXPORT elements* createElements(const char*); |
---|
[790] | 432 | ZOO_DLL_EXPORT void setElementsName(elements**,char*); |
---|
[680] | 433 | ZOO_DLL_EXPORT bool hasElement(elements*,const char*); |
---|
[949] | 434 | ZOO_DLL_EXPORT elements* getElements(elements*,const char*); |
---|
[680] | 435 | ZOO_DLL_EXPORT void freeIOType(iotype**); |
---|
| 436 | ZOO_DLL_EXPORT void freeElements(elements**); |
---|
[790] | 437 | ZOO_DLL_EXPORT void setServiceName(service**,char*); |
---|
[917] | 438 | ZOO_DLL_EXPORT service* createService(); |
---|
[680] | 439 | ZOO_DLL_EXPORT void freeService(service**); |
---|
| 440 | ZOO_DLL_EXPORT void addToMap(map*,const char*,const char*); |
---|
| 441 | ZOO_DLL_EXPORT void addIntToMap(map*,const char*,const int); |
---|
[917] | 442 | ZOO_DLL_EXPORT void addIntToMapArray(map*,const char*,int,const int); |
---|
[738] | 443 | ZOO_DLL_EXPORT map* addToMapWithSize(map*,const char*,const char*,int); |
---|
[680] | 444 | ZOO_DLL_EXPORT void addMapToMap(map**,map*); |
---|
| 445 | ZOO_DLL_EXPORT void addMapToIoType(iotype**,map*); |
---|
| 446 | ZOO_DLL_EXPORT map* getMapOrFill(map**,const char*,const char*); |
---|
| 447 | ZOO_DLL_EXPORT bool contains(map*,map*); |
---|
| 448 | ZOO_DLL_EXPORT iotype* getIoTypeFromElement(elements*,char*, map*); |
---|
| 449 | ZOO_DLL_EXPORT void loadMapBinary(map**,map*,int); |
---|
| 450 | ZOO_DLL_EXPORT void loadMapBinaries(map**,map*); |
---|
| 451 | ZOO_DLL_EXPORT maps* dupMaps(maps**); |
---|
| 452 | ZOO_DLL_EXPORT void addMapsToMaps(maps**,maps*); |
---|
| 453 | ZOO_DLL_EXPORT map* getMapArray(map*,const char*,int); |
---|
| 454 | ZOO_DLL_EXPORT void setMapArray(map*,const char*,int,const char*); |
---|
| 455 | ZOO_DLL_EXPORT map* getMapType(map*); |
---|
| 456 | ZOO_DLL_EXPORT int addMapsArrayToMaps(maps**,maps*,char*); |
---|
| 457 | ZOO_DLL_EXPORT void setMapInMaps(maps*,const char*,const char*,const char*); |
---|
| 458 | ZOO_DLL_EXPORT void dumpElements(elements*); |
---|
[790] | 459 | ZOO_DLL_EXPORT void dumpElementsAsYAML(elements*,int); |
---|
[680] | 460 | ZOO_DLL_EXPORT elements* dupElements(elements*); |
---|
| 461 | ZOO_DLL_EXPORT void addToElements(elements**,elements*); |
---|
| 462 | ZOO_DLL_EXPORT void dumpService(service*); |
---|
| 463 | ZOO_DLL_EXPORT void dumpServiceAsYAML(service*); |
---|
| 464 | ZOO_DLL_EXPORT service* dupService(service*); |
---|
| 465 | ZOO_DLL_EXPORT void dumpRegistry(registry*); |
---|
| 466 | ZOO_DLL_EXPORT bool addServiceToRegistry(registry**,char*,service*); |
---|
| 467 | ZOO_DLL_EXPORT void freeRegistry(registry**); |
---|
| 468 | ZOO_DLL_EXPORT service* getServiceFromRegistry(registry*,char*,char*); |
---|
| 469 | ZOO_DLL_EXPORT void inheritMap(map**,map*); |
---|
| 470 | ZOO_DLL_EXPORT void inheritIOType(iotype**,iotype*); |
---|
| 471 | ZOO_DLL_EXPORT void inheritElements(elements**,elements*); |
---|
| 472 | ZOO_DLL_EXPORT void inheritance(registry*,service**); |
---|
| 473 | ZOO_DLL_EXPORT void mapsToCharXXX(maps*,char***); |
---|
| 474 | ZOO_DLL_EXPORT void charxxxToMaps(char***,maps**); |
---|
[757] | 475 | #if defined(_MSC_VER) && _MSC_VER < 1800 |
---|
[712] | 476 | // snprintf for Visual Studio compiler; |
---|
| 477 | // it is also used by services (e.g., GetStatus), therefore exported to shared library |
---|
| 478 | ZOO_DLL_EXPORT int snprintf(char *buffer, size_t n, const char *format, ...); |
---|
[757] | 479 | #endif |
---|
[889] | 480 | |
---|
| 481 | // knut: some new utility functions; logMessage is primarily intended for debugging |
---|
| 482 | ZOO_DLL_EXPORT bool nonempty(map* map); |
---|
| 483 | ZOO_DLL_EXPORT bool hasvalue(maps* source, const char* node, const char* key, map** kvp); |
---|
[917] | 484 | #ifdef __cplusplus |
---|
[889] | 485 | ZOO_DLL_EXPORT void setErrorMessage(maps*& conf, const char* service, WPSException exc, const char* message = NULL); |
---|
[917] | 486 | ZOO_DLL_EXPORT void logMessage(const char* source, const char* function, int line, const char* file = NULL, const char* message = NULL); |
---|
| 487 | #endif |
---|
[889] | 488 | #define zooLogMsg(file,message) logMessage(__FILE__, __func__, __LINE__, (file), (message)) |
---|
| 489 | #define zooLog logMessage(__FILE__, __func__, __LINE__) |
---|
[957] | 490 | |
---|
| 491 | // knut : function for pre-allocated memory for a map value; |
---|
| 492 | // processing algorithms may be able to write directly to this space, thereby avoiding unneccesary copying of data |
---|
| 493 | ZOO_DLL_EXPORT char* allocateMapValue(map* node, size_t num_bytes); |
---|
| 494 | |
---|
[1] | 495 | #ifdef __cplusplus |
---|
| 496 | } |
---|
| 497 | #endif |
---|
| 498 | |
---|
| 499 | #endif |
---|