ZOO-Project
|
#include "cpl_vsi.h"
#include "service_internal.h"
#include "service_callback.h"
#include "dirent.h"
Data Structures | |
union | semun |
arg for semctl system calls. More... | |
Macros | |
#define | _LARGEFILE64_SOURCE 1 |
#define | ERROR_MSG_MAX_LENGTH 1024 |
#define | MAX_RETRIES 10 |
Number of time to try to access a semaphores set. More... | |
Functions | |
struct zooLock * | lockFile (maps *conf, const char *filename, const char mode) |
Lock a file for read, write and upload. More... | |
int | unlockFile (maps *conf, struct zooLock *s) |
Remove a lock. More... | |
char * | getStatusId (maps *conf, char *pid) |
Read the sid file attached of a service if any. More... | |
semid | acquireLock (maps *conf) |
Acquire the global lock. More... | |
char * | _getStatusFile (maps *conf, char *pid) |
Read the cache file of a running service. More... | |
char * | _getStatus (maps *conf, char *lid) |
Get the ongoing status of a running service. More... | |
void | unhandleStatus (maps *conf) |
Stop handling status repport. More... | |
int | _updateStatus (maps *conf) |
Update the current status of the running service. More... | |
int | getKeyValue (maps *conf) |
Set in the pre-allocated key the zoo_sem_[OSID] string where [OSID] is the lid (if any) or osid value from the [lenv] section. More... | |
int | getShmLockId (maps *conf, int nsems) |
Try to create or access a semaphore set. More... | |
int | removeShmLock (maps *conf, int nsems) |
Try to remove a semaphore set. More... | |
int | lockShm (int id) |
Lock a semaphore set. More... | |
int | unlockShm (int id) |
unLock a semaphore set. More... | |
char * | getStatus (int pid) |
Get the current status of the running service. More... | |
int | updateStatus (maps *conf, const int percentCompleted, const char *message) |
Update the status of an ongoing service. More... | |
char * | getInputValue (maps *inputs, const char *parameterName, size_t *numberOfBytes) |
Access an input value. More... | |
char * | readVSIFile (maps *conf, const char *dataSource) |
Read a file using the GDAL VSI API. More... | |
int | setOutputValue (maps *outputs, const char *parameterName, char *data, size_t numberOfBytes) |
Set an output value. More... | |
char * | file_exists (const char *dir, const char *name) |
Check if file exists in specified folder. More... | |
union semun |
#define _LARGEFILE64_SOURCE 1 |
#define ERROR_MSG_MAX_LENGTH 1024 |
#define MAX_RETRIES 10 |
Number of time to try to access a semaphores set.
char* _getStatus | ( | maps * | conf, |
char * | lid | ||
) |
Get the ongoing status of a running service.
conf | the maps containing the setting of the main.cfg file |
pid | the service identifier (usid key from the [lenv] section) |
char* _getStatusFile | ( | maps * | conf, |
char * | pid | ||
) |
Read the cache file of a running service.
conf | the maps containing the setting of the main.cfg file |
pid | the service identifier (usid key from the [lenv] section) |
int _updateStatus | ( | maps * | conf | ) |
Update the current status of the running service.
conf | the map containing the setting of the main.cfg file |
Acquire the global lock.
conf | the maps containing the setting of the main.cfg file |
char* file_exists | ( | const char * | dir, |
const char * | name | ||
) |
Check if file exists in specified folder.
dir | the folder in which to search for file |
name | the name of the file (not full path) |
char* getInputValue | ( | maps * | inputs, |
const char * | parameterName, | ||
size_t * | numberOfBytes | ||
) |
Access an input value.
inputs | the maps to search for the input value |
parameterName | the input name to fetch the value |
numberOfBytes | the resulting size of the value to add (for binary values), -1 for basic char* data |
int getKeyValue | ( | maps * | conf | ) |
Set in the pre-allocated key the zoo_sem_[OSID] string where [OSID] is the lid (if any) or osid value from the [lenv] section.
conf | the map containing the setting of the main.cfg file |
int getShmLockId | ( | maps * | conf, |
int | nsems | ||
) |
Try to create or access a semaphore set.
conf | the map containing the setting of the main.cfg file |
nsems | number of semaphores |
char* getStatus | ( | int | pid | ) |
Get the current status of the running service.
pid | the semaphores |
char* getStatusId | ( | maps * | conf, |
char * | pid | ||
) |
Read the sid file attached of a service if any.
conf | the maps containing the setting of the main.cfg file |
pid | the service identifier (usid key from the [lenv] section) |
Lock a file for read, write and upload.
conf | the main configuration maps |
filename | the file to lock |
mode | define access: 'r' for read, 'w' for write |
int lockShm | ( | int | id | ) |
Lock a semaphore set.
id | the semaphores set indetifier |
char* readVSIFile | ( | maps * | conf, |
const char * | dataSource | ||
) |
Read a file using the GDAL VSI API.
conf | the maps containing the settings of the main.cfg file |
dataSource | the datasource name to read |
int removeShmLock | ( | maps * | conf, |
int | nsems | ||
) |
Try to remove a semaphore set.
conf | the map containing the setting of the main.cfg file |
nsems | number of semaphores |
int setOutputValue | ( | maps * | outputs, |
const char * | parameterName, | ||
char * | data, | ||
size_t | numberOfBytes | ||
) |
Set an output value.
outputs | the maps to define the output value |
parameterName | the output name to set the value |
data | the value to set |
numberOfBytes | size of the value to add (for binary values), -1 for basic char* data |
void unhandleStatus | ( | maps * | conf | ) |
Stop handling status repport.
conf | the map containing the setting of the main.cfg file |
Remove a lock.
conf | the main configuration maps |
s | the zooLock structure |
int unlockShm | ( | int | id | ) |
unLock a semaphore set.
id | the semaphores set indetifier |
int updateStatus | ( | maps * | conf, |
const int | percentCompleted, | ||
const char * | message | ||
) |
Update the status of an ongoing service.
conf | the maps containing the settings of the main.cfg file |
percentCompleted | percentage of completude of execution of the service |
message | information about the current step executed |