Go to the documentation of this file.
25 #ifndef ZOO_SERVICE_INTERNAL_H
26 #define ZOO_SERVICE_INTERNAL_H 1
33 #define DEFAULT_SERVICE_URL "http://www.zoo-project.org/"
40 #define _(String) dgettext ("zoo-kernel",String)
44 #define _ss(String) dgettext ("zoo-services",String)
49 #define ZOO_LOCK_CREATE_FAILED -4
53 #define ZOO_LOCK_ACQUIRE_FAILED -5
57 #define ZOO_LOCK_RELEASE_FAILED -6
61 #define ZOO_LOCK_MAX_RETRY 180
64 #include <sys/types.h>
86 #if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
88 #include <CoreServices/CoreServices.h>
89 #include <SystemConfiguration/SystemConfiguration.h>
95 #define F_SETLK 8 // Non-Blocking set or clear a lock
96 #define F_SETLKW 9 // Blocking set or clear a lock
98 #define F_RDLCK 1 // read lock
99 #define F_WRLCK 2 // write lock
100 #define F_UNLCK 3 // remove lock
ZOO_DLL_EXPORT char * _getStatus(maps *, char *)
Get the ongoing status of a running service.
Definition: service_internal.c:372
struct flock lock
The lock.
Definition: service_internal.h:116
ZOO_DLL_EXPORT int updateStatus(maps *, const int, const char *)
Update the status of an ongoing service.
Definition: service_internal.c:846
ZOO_DLL_EXPORT bool hasDbs(maps *)
Verify if the server rely on database backend.
Definition: service_internal.c:1040
ZOO_DLL_EXPORT char * _getStatusField(maps *, char *, const char *)
Definition: service_internal.c:1011
ZOO_DLL_EXPORT struct zooLock * lockFile(maps *, const char *, const char)
Lock a file for read, write and upload.
Definition: service_internal.c:98
ZOO_DLL_EXPORT char * getInputValue(maps *, const char *, size_t *)
Access an input value.
Definition: service_internal.c:864
ZOO_DLL_EXPORT char * readVSIFile(maps *, const char *)
Read a file using the GDAL VSI API.
Definition: service_internal.c:934
FILE * lockfile
The pointer to the lock file.
Definition: service_internal.h:117
The lock structure used by the ZOO-Kernel to ensure atomicity of operations.
Definition: service_internal.h:115
ZOO_DLL_EXPORT semid acquireLock(maps *)
Acquire the global lock.
Definition: service_internal.c:265
char * filename
The filename to lock.
Definition: service_internal.h:118
ZOO_DLL_EXPORT semid getShmLockId(maps *, int)
Try to create or access a semaphore set.
Definition: service_internal.c:678
static zooLock ** zoo_file_locks
Definition: service_internal.h:121
linked list of map pointer
Definition: service.h:678
ZOO_DLL_EXPORT bool validateVRT(maps *, const char *)
Validate that the VRT contains only allowed path.
Definition: service_internal.c:886
ZOO_DLL_EXPORT int unlockShm(semid)
ZOO_DLL_EXPORT char * _getStatusFile(maps *, char *)
Read the cache file of a running service.
Definition: service_internal.c:304
ZOO_DLL_EXPORT int unlockFile(maps *, struct zooLock *)
Remove a lock.
Definition: service_internal.c:200
ZOO_DLL_EXPORT int _updateStatus(maps *)
Update the current status of the running service.
Definition: service_internal.c:450
ZOO_DLL_EXPORT int lockShm(semid)
static int zoo_file_locks_cnt
Definition: service_internal.h:122
ZOO_DLL_EXPORT int setOutputValue(maps *, const char *, char *, size_t)
Set an output value.
Definition: service_internal.c:963
#define ZOO_DLL_EXPORT
Definition: service.h:34
ZOO_DLL_EXPORT char * file_exists(const char *dir, const char *name)
Check if file exists in specified folder.
Definition: service_internal.c:991
#define semid
Cross platform type used for Lock identifier.
Definition: service_internal.h:151
ZOO_DLL_EXPORT int removeShmLock(maps *, int)
Try to remove a semaphore set.
Definition: service_internal.c:750
struct zooLock zooLock
The lock structure used by the ZOO-Kernel to ensure atomicity of operations.
ZOO_DLL_EXPORT char * getStatusId(maps *, char *)
Read the sid file attached of a service if any.
Definition: service_internal.c:236
ZOO_DLL_EXPORT bool isAsyncCall(maps *)
Verify if an Execute request has been invoked asynchronously.
Definition: service_internal.c:1022
ZOO_DLL_EXPORT void unhandleStatus(maps *)
Stop handling status repport.
Definition: service_internal.c:432
ZOO_DLL_EXPORT char * getStatus(int)
Get the current status of the running service.
Definition: service_internal.c:812