#ifndef _SYSTEM_H_e18ede92_ #define _SYSTEM_H_e18ede92_ /* Arguments to system_lock. */ #define SYS_NOWAIT 0x00000001 /* don't block */ #define SYS_WAIT 0x00000002 /* can block */ #define SYS_SHARED 0x00000004 /* get shared lock */ #define SYS_EXCLUSIVE 0x00000008 /* get exclusive lock */ #define SYS_FAILEXIT 0x00000010 /* fprintf() and exit() on failure */ #include "profile.h" /* Returns "the system profile"; on first call, calls profile_read(0) and saves that as "the system profile" and returns it. If no profile is available, prints a gripe and exit(1)s. */ extern PROFILE *system_get_profile(void); /* Returns the system's idea of the user's homedir, namely, $HOME, or "." if $HOME is not set. */ extern const char *system_homedir(void); /* Returns . */ extern const char *system_mmdir(void); /* Returns folder directory. */ extern const char *system_folder_dir(void); /* Locks the whole mail system for the calling process. Argument is SYS_WAIT or SYS_NOWAIT, |ed with SYS_SHARED or SYS_EXCLUSIVE. Returns -1 and sets errno for failure, 0 for success; if SYS_WAIT set, blocks until it gets the lock. Optinally include SYS_FAILEXIT, in which case system_lock() will fprintf(stderr,...) and exit() on failure. */ extern int system_lock(unsigned int); /* Unlocks the lock set by system_lock(). */ extern void system_unlock(void); #endif