1 #include "parseconfig.h"
2 
3 #define O_CMDLINE		"cmdline", "options"
4 #define O_OPTIONS		"config",  "options"
5 
6 #define O_HELP		        O_CMDLINE, "help"
7 #define O_VERSION		O_CMDLINE, "version"
8 #define O_WRITECONF		O_CMDLINE, "writeconf"
9 #define O_FILE_LIST		O_CMDLINE, "file-list"
10 #define O_TEXT_MODE		O_CMDLINE, "text-mode"
11 #define O_AUTO_ZOOM		O_CMDLINE, "auto-zoom"
12 #define O_DEVICE_INFO		O_CMDLINE, "device-info"
13 
14 #define O_AUTO_UP		O_OPTIONS, "auto-up"
15 #define O_AUTO_DOWN		O_OPTIONS, "auto-down"
16 #define O_FIT_WIDTH		O_OPTIONS, "fit-width"
17 #define O_QUIET		        O_OPTIONS, "quiet"
18 #define O_VERBOSE		O_OPTIONS, "verbose"
19 #define O_RANDOM		O_OPTIONS, "random"
20 #define O_ONCE		        O_OPTIONS, "once"
21 #define O_COMMENTS		O_OPTIONS, "comments"
22 #define O_EDIT		        O_OPTIONS, "edit"
23 #define O_BACKUP		O_OPTIONS, "backup"
24 #define O_PRESERVE		O_OPTIONS, "preserve"
25 #define O_READ_AHEAD		O_OPTIONS, "read-ahead"
26 
27 #define O_CACHE_MEM    	        O_OPTIONS, "cache-mem"
28 #define O_BLEND_MSECS		O_OPTIONS, "blend-msecs"
29 #define O_VT		        O_OPTIONS, "vt"
30 #define O_SCROLL		O_OPTIONS, "scroll"
31 #define O_TIMEOUT		O_OPTIONS, "timeout"
32 #define O_PCD_RES		O_OPTIONS, "photocd-res"
33 #define O_INTERACTIVE	O_OPTIONS, "interactive"
34 
35 #define O_DEVICE                O_OPTIONS, "device"
36 #define O_OUTPUT                O_OPTIONS, "output"
37 #define O_OPENGL                O_OPTIONS, "opengl"
38 #define O_PAGEFLIP              O_OPTIONS, "pageflip"
39 #define O_FONT                  O_OPTIONS, "font"
40 #define O_VIDEO_MODE            O_OPTIONS, "video-mode"
41 
42 #define GET_HELP()		cfg_get_bool(O_HELP,          0)
43 #define GET_VERSION()		cfg_get_bool(O_VERSION,       0)
44 #define GET_WRITECONF()		cfg_get_bool(O_WRITECONF,     0)
45 #define GET_TEXT_MODE()		cfg_get_bool(O_TEXT_MODE,     0)
46 #define GET_AUTO_ZOOM()		cfg_get_bool(O_AUTO_ZOOM,     0)
47 #define GET_DEVICE_INFO()	cfg_get_bool(O_DEVICE_INFO,   0)
48 
49 #define GET_AUTO_UP()		cfg_get_bool(O_AUTO_UP,       0)
50 #define GET_AUTO_DOWN()		cfg_get_bool(O_AUTO_DOWN,     0)
51 #define GET_FIT_WIDTH()		cfg_get_bool(O_FIT_WIDTH,     0)
52 #define GET_QUIET()		cfg_get_bool(O_QUIET,         0)
53 #define GET_VERBOSE()		cfg_get_bool(O_VERBOSE,       1)
54 #define GET_RANDOM()		cfg_get_bool(O_RANDOM,        0)
55 #define GET_ONCE()		cfg_get_bool(O_ONCE,          0)
56 #define GET_COMMENTS()		cfg_get_bool(O_COMMENTS,      0)
57 #define GET_EDIT()		cfg_get_bool(O_EDIT,          0)
58 #define GET_BACKUP()		cfg_get_bool(O_BACKUP,        0)
59 #define GET_PRESERVE()		cfg_get_bool(O_PRESERVE,      0)
60 #define GET_READ_AHEAD()       	cfg_get_bool(O_READ_AHEAD,    0)
61 
62 #define GET_CACHE_MEM()         cfg_get_int(O_CACHE_MEM,    256)
63 #define GET_BLEND_MSECS()       cfg_get_int(O_BLEND_MSECS,    0)
64 #define GET_VT()                cfg_get_int(O_VT,             0)
65 #define GET_SCROLL()            cfg_get_int(O_SCROLL,        50)
66 #define GET_TIMEOUT()           cfg_get_int(O_TIMEOUT,        0)
67 #define GET_PCD_RES()           cfg_get_int(O_PCD_RES,        3)
68 #define GET_INTERACTIVE()       cfg_get_bool(O_INTERACTIVE,   1)
69 
70 #define GET_OPENGL()       	cfg_get_bool(O_OPENGL,        0)
71 #define GET_PAGEFLIP()       	cfg_get_bool(O_PAGEFLIP,      1)
72 
73 /* -------------------------------------------------------------------------- */
74 
75 extern struct cfg_cmdline fbi_cmd[];
76 extern struct cfg_cmdline fbi_cfg[];
77 extern struct cfg_cmdline fbpdf_cmd[];
78 extern struct cfg_cmdline fbpdf_cfg[];
79 void fbi_read_config(const char *name);
80 void fbi_write_config(void);
81 
82