Changeset 889 for trunk/zoo-project/zoo-kernel/service.h
- Timestamp:
- Jan 3, 2019, 12:44:57 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service.h
r847 r889 40 40 #endif 41 41 42 // knut: add bool if necessary 43 #ifndef __cplusplus 44 #ifndef WIN32 45 #include <stdbool.h> 46 #else 47 typedef int bool; 48 #define false 0 49 #define true 1 50 #endif 51 #endif 52 #ifndef __bool_true_false_are_defined 53 #define __bool_true_false_are_defined 1 54 #endif 55 42 56 #ifdef WIN32 43 57 #define strncasecmp _strnicmp … … 47 61 #define snprintf _snprintf 48 62 #endif 63 /* knut: see new definition of bool above 49 64 #if defined(_MSC_VER) && _MSC_VER < 1800 50 65 #define false 0 … … 52 67 #define bool int 53 68 #endif 69 */ 54 70 #define zStrdup _strdup 55 71 #define zMkdir _mkdir … … 124 140 #ifndef WIN32 125 141 #include <ctype.h> 126 #include <stdbool.h> 142 //#include <stdbool.h> // knut: see new definition of bool above 127 143 #endif 128 144 … … 274 290 struct registry* next; //!< the next registry pointer 275 291 } registry; 292 293 // knut 294 enum WPSException { 295 /* 296 * StatusOK is not a WPS exception, it is added 297 * here for convenience. 298 */ 299 StatusOK, 300 /* 301 * See WPS 1.0 specification, Table 38 and Table 62. 302 */ 303 MissingParameterValue, 304 InvalidParameterValue, 305 NoApplicableCode, 306 NotEnoughStorage, 307 ServerBusy, 308 FileSizeExceeded, 309 StorageNotSupported, 310 VersionNegotiationFailed, 311 /* 312 * See WPS 2.0 specification, Tables 41, 46, 48, and 50. 313 */ 314 NoSuchProcess, 315 NoSuchMode, 316 NoSuchInput, 317 NoSuchOutput, 318 DataNotAccessible, 319 SizeExceeded, 320 TooManyInputs, 321 TooManyOutputs, 322 NoSuchFormat, 323 WrongInputData, 324 InternalServerError, 325 NoSuchJob, 326 ResultNotReady 327 }; 328 329 static const char* const WPSExceptionCode[] = { 330 "StatusOK", 331 "MissingParameterValue", 332 "InvalidParameterValue", 333 "NoApplicableCode", 334 "NotEnoughStorage", 335 "ServerBusy", 336 "FileSizeExceeded", 337 "StorageNotSupported", 338 "VersionNegotiationFailed", 339 "NoSuchProcess", 340 "NoSuchMode", 341 "NoSuchInput", 342 "NoSuchOutput", 343 "DataNotAccessible", 344 "SizeExceeded", 345 "TooManyInputs", 346 "TooManyOutputs", 347 "NoSuchFormat", 348 "WrongInputData", 349 "InternalServerError", 350 "NoSuchJob", 351 "ResultNotReady" 352 }; 353 354 static const char* const WPSExceptionText[] = { 355 "No problem detected", 356 "Operation request does not include a parameter value, and this server did not declare a default value for that parameter.", 357 "Operation request contains an invalid parameter value.", 358 "No other exceptionCode specified by this service and server applies to this exception.", 359 "The server does not have enough space available to store the inputs and outputs associated with the request.", 360 "The server is too busy to accept and queue the request at this time.", 361 "The file size of one of the input parameters was too large for this process to handle.", 362 "Execute operation request included transmission=”reference” for one of the outputs, but storage is not offered by this server.", 363 "Service version for a ComplexData xlink:href input was not supported by the referenced server, and version negotiation failed.", 364 "One of the identifiers passed does not match with any of the processes offered by this server.", 365 "The process does not permit the desired execution mode.", 366 "One or more of the input identifiers passed does not match with any of the input identifiers of this process.", 367 "One or more of the output identifiers passed does not match with any of the input identifiers of this process.", 368 "One of the referenced input data sets was inaccessible.", 369 "The size of one of the input parameters was too large for this process to handle.", 370 "Too many input items have been specified.", 371 "Too many output items have been specified.", 372 "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.", 373 "One or more of inputs for which the service was able to retrieve the data but could not read it.", 374 "", 375 "The JobID from the request does not match any of the Jobs running on this server.", 376 "The result for the requested JobID has not yet been generated." 377 }; 276 378 277 379 ZOO_DLL_EXPORT void _dumpMap(map*); … … 340 442 ZOO_DLL_EXPORT int snprintf(char *buffer, size_t n, const char *format, ...); 341 443 #endif 444 445 // knut: some new utility functions; logMessage is primarily intended for debugging 446 ZOO_DLL_EXPORT bool nonempty(map* map); 447 ZOO_DLL_EXPORT bool hasvalue(maps* source, const char* node, const char* key, map** kvp); 448 ZOO_DLL_EXPORT void setErrorMessage(maps*& conf, const char* service, WPSException exc, const char* message = NULL); 449 ZOO_DLL_EXPORT void logMessage(const char* source, const char* function, int line, const char* file = NULL, const char* message = NULL); 450 #define zooLogMsg(file,message) logMessage(__FILE__, __func__, __LINE__, (file), (message)) 451 #define zooLog logMessage(__FILE__, __func__, __LINE__) 452 342 453 #ifdef __cplusplus 343 454 }
Note: See TracChangeset
for help on using the changeset viewer.