3 #if defined(GLOBALS_IMPL)
4 #define GLOBAL(type,name,value) type name = value;
6 #define GLOBAL(type,name,value) extern type name;
10 * Front-end modes and global usage
12 * The front end might be in one of three modes: FS, repod, or S3. FS mode
13 * is distinguished from the other two by having proxy_host=NULL. (In fact
14 * what the "-f" flag does is set cfg_file=NULL, which suppresses parsing of
15 * the config file; it's the parser that sets proxy_host to some other value.)
16 * If proxy_host!=NULL then proxy_port and s3mode are also valid. If s3mode
17 * in turn is non-zero then proxy_key and proxy_secret are also valid. I've
18 * marked the relevant globals with the modes where they're valid.
20 * NONE OF THIS affects the back ends used for replication. There can be
21 * multiple such back ends, each individually repod or S3 mode with their
25 GLOBAL(int, verbose
, 0)
26 GLOBAL(char *, cfg_file
, "repo.json")
27 GLOBAL(const char *, proxy_host
, NULL
) /* always */
28 GLOBAL(unsigned short, proxy_port
, MY_PORT
+1) /* repod/S3 */
29 GLOBAL(const char *, proxy_key
, "foo") /* S3 only */
30 GLOBAL(const char *, proxy_secret
, "bar") /* S3 only */
31 GLOBAL(unsigned int, s3mode
, 0) /* repod/S3 */
32 GLOBAL(const char *, db_host
, "localhost")
33 GLOBAL(unsigned short, db_port
, 27017)
34 GLOBAL(char *, me
, "here")
36 #define I2P(x) ((void *)(long)(x))
37 #define P2I(x) ((int)(long)(x))
39 #define DPRINTF(fmt,args...) do { \
46 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
47 # define __attribute__(x) /* empty */
51 #ifndef ATTRIBUTE_UNUSED
52 # define ATTRIBUTE_UNUSED __attribute__ ((__unused__))