ZOO-Project
Data Structures | Macros | Functions
service_internal.c File Reference
#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 zooLocklockFile (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...
 

Data Structure Documentation

union semun

arg for semctl system calls.

Data Fields
ushort * array array for GETALL & SETALL
struct semid_ds * buf buffer for IPC_STAT & IPC_SET
int val value for SETVAL

Macr