25 #ifndef ZOO_SERVICE_INTERNAL_H
26 #define ZOO_SERVICE_INTERNAL_H 1
33 #define DEFAULT_SERVICE_URL "http://www.zoo-project.org/"
44 #define _(String) dgettext ("zoo-kernel",String)
48 #define _ss(String) dgettext ("zoo-services",String)
53 #define ZOO_LOCK_CREATE_FAILED -4
57 #define ZOO_LOCK_ACQUIRE_FAILED -5
61 #define ZOO_LOCK_RELEASE_FAILED -6
65 #define ZOO_LOCK_MAX_RETRY 180
68 #include <sys/types.h>
90 #if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
92 #include <CoreServices/CoreServices.h>
93 #include <SystemConfiguration/SystemConfiguration.h>
99 #define F_SETLK 8 // Non-Blocking set or clear a lock
100 #define F_SETLKW 9 // Blocking set or clear a lock
102 #define F_RDLCK 1 // read lock
103 #define F_WRLCK 2 // write lock
104 #define F_UNLCK 3 // remove lock
static zooLock ** zoo_file_locks
Definition: service_internal.h:125
struct flock lock
The lock.
Definition: service_internal.h:120
ZOO_DLL_EXPORT char * getStatus(int)
Get the current status of the running service.
Definition: service_internal.c:807
static int zoo_file_locks_cnt
Definition: service_internal.h:126
ZOO_DLL_EXPORT semid getShmLockId(maps *, int)
Try to create or access a semaphore set.
Definition: service_internal.c:673
ZOO_DLL_EXPORT int unlockShm(semid)
ZOO_DLL_EXPORT char * _getStatus(maps *, char *)
Get the ongoing status of a running service.
Definition: service_internal.c:367
FILE * lockfile
The pointer to the lock file.
Definition: service_internal.h:121
ZOO_DLL_EXPORT semid acquireLock(maps *)
Acquire the global lock.
Definition: service_internal.c:261
ZOO_DLL_EXPORT int lockShm(semid)
ZOO_DLL_EXPORT int unlockFile(maps *, struct zooLock *)
Remove a lock.
Definition: service_internal.c:198
ZOO_DLL_EXPORT struct zooLock * lockFile(maps *, const char *, const char)
Lock a file for read, write and upload.
Definition: service_internal.c:96
ZOO_DLL_EXPORT void unhandleStatus(maps *)
Stop handling status repport.
Definition: service_internal.c:427
linked list of map pointer
Definition: main_conf_read.y:292
The lock structure used by the ZOO-Kernel to ensure atomicity of operations.
Definition: service_internal.h:119
ZOO_DLL_EXPORT int _updateStatus(maps *)
Update the current status of the running service.
Definition: service_internal.c:445
ZOO_DLL_EXPORT char * readVSIFile(maps *, const char *)
Read a file using the GDAL VSI API.
Definition: service_internal.c:880
ZOO_DLL_EXPORT char * _getStatusFile(maps *, char *)
Read the cache file of a running service.
Definition: service_internal.c:300
ZOO_DLL_EXPORT char * getInputValue(maps *, const char *, size_t *)
Access an input value.
Definition: service_internal.c:858
ZOO_DLL_EXPORT char * file_exists(const char *dir, const char *name)
Check if file exists in specified folder.
Definition: service_internal.c:937
ZOO_DLL_EXPORT int setOutputValue(maps *, const char *, char *, size_t)
Set an output value.
Definition: service_internal.c:909
ZOO_DLL_EXPORT int removeShmLock(maps *, int)
Try to remove a semaphore set.
Definition: service_internal.c:745
ZOO_DLL_EXPORT char * getStatusId(maps *, char *)
Read the sid file attached of a service if any.
Definition: service_internal.c:233
struct zooLock zooLock
The lock structure used by the ZOO-Kernel to ensure atomicity of operations.
ZOO_DLL_EXPORT int updateStatus(maps *, const int, const char *)
Update the status of an ongoing service.
Definition: service_internal.c:841
#define semid
Cross platform type used for Lock identifier.
Definition: service_internal.h:153
char * filename
The filename to lock.
Definition: service_internal.h:122