/* * tiny-spool.h - common definitions for the tiny spooling system. */ #define SPOOL_DIR "tiny-spooldir" /* top-level spool directory */ #define SPOOL_DIR_IN SPOOL_DIR"/in" /* temporary spool for 'lpc'. */ #define SPOOL_DIR_COMMON SPOOL_DIR"/common" /* common spool directory. */ #define SPOOL_DIR_OUT SPOOL_DIR"/out" /* temporary spool for 'lpd'. */ #define SPOOL_COUNTER SPOOL_DIR"/counter" /* path to counter file. */ #define SEM_ID 667 /* ID for the semaphore set. */ #define SEM_MUTEX 0 /* semaphore in set for mutex. */ #define SEM_COUNTER 1 /* semaphore in set for counter. */ #define MAX_PATH 255 /* max length of a path name. */ /* external functions. */ /* get an ID of the seaphore set, possibly creating and initializing */ /* it, if it did not exist already. */ extern int sem_set_get(char* caller, int create); /* signal the 'counter' semaphore in the given set. */ extern void sem_signal_counter(int sem_set_id); /* wait on the 'producer' semaphore in the given set. */ extern void sem_wait_counter(int sem_set_id); /* signal the 'mutex' semaphore in the given set. */ extern void sem_signal_mutex(int sem_set_id); /* wait on the 'mutex' semaphore in the given set. */ extern void sem_wait_mutex(int sem_set_id);