1 /* 2 * +-------------------------------------------------------+ 3 * | | 4 * | videogen | 5 * | | 6 * | a simple XFree86 Modeline calculator | 7 * | (c) 1997-2003, Szabolcs Rumi | 8 * | | 9 * | http://www.dynaweb.hu/opensource/videogen | 10 * | | 11 * | the videogen package is distributed under the | 12 * | GNU General Public License Version 2 (GPLv2) | 13 * | | 14 * +-------------------------------------------------------+ 15 */ 16 17 #ifndef VIDEOGEN_H 18 # define VIDEOGEN_H 19 20 21 22 23 24 #define ERR_SYSTEM 100 /* environmental or system error */ 25 #define ERR_CMDLINE 101 /* command line error */ 26 #define ERR_CFGFILE 102 /* config file error */ 27 #define ERR_RES 103 /* bad resolution */ 28 #define ERR_MDC 104 /* bad max dot clock */ 29 #define ERR_MHF 105 /* bad max horizontal freq */ 30 #define ERR_MVF 106 /* bad max vertical freq */ 31 32 33 34 #define VL_QUIET 0 35 #define VL_VERBOSE 1 36 #define VL_DEBUG 2 37 38 39 40 41 42 typedef struct { 43 unsigned int hres; 44 unsigned int vres; 45 } resolution_t; 46 47 extern char *cfgfile; 48 extern unsigned int verbose; 49 extern unsigned int fbset; 50 extern unsigned int nvidia; 51 extern unsigned int num_modes; 52 extern resolution_t modes[]; 53 extern double max_dotclk; 54 extern double max_hfreq; 55 extern double max_vfreq; 56 extern double desired_vfreq; 57 extern double hvisible; 58 extern double vvisible; 59 extern double hfporch; 60 extern double hbporch; 61 extern double hsync; 62 extern double vfporch; 63 extern double vbporch; 64 extern double vsync; 65 66 67 68 extern void banner (void); 69 extern void usage (void); 70 71 extern int pmsg (int, char *, ...); 72 extern char *tpathexp (char *, char *); 73 74 75 76 77 78 #define ARG_FOUND 0x1 79 #define ARG_FOUND_PARM 0x2 80 81 typedef struct 82 { 83 char *ao_option; /* option string to be matched */ 84 char *ao_parameter; /* argument parameter parsed */ 85 int ao_flags; /* flags */ 86 } 87 arg_opt_t; 88 89 typedef struct 90 { 91 int aindex; /* command line argument currently examined */ 92 int oindex; /* option the current argument is believed to match */ 93 94 int argc; /* argc to be parsed */ 95 char **argv; /* argv to be parsed */ 96 97 arg_opt_t (*options)[]; /* pre-defined options list */ 98 } 99 arg_parse_t; 100 101 extern arg_opt_t opts[]; 102 extern int arg_action (arg_parse_t *); 103 extern int arg_parse (arg_parse_t *, int (*) (arg_parse_t *)); 104 105 106 107 extern int commit_verbose (int, unsigned int *, unsigned int); 108 extern int commit_fbset (int, unsigned int *, unsigned int); 109 extern int commit_nvidia (int, unsigned int *, unsigned int); 110 extern int commit_mode (int, resolution_t (*)[], unsigned int *, unsigned int, unsigned int); 111 extern int commit_max_dotclk (int, double *, double); 112 extern int commit_max_hfreq (int, double *, double); 113 extern int commit_max_vfreq (int, double *, double); 114 extern int commit_desired_vfreq (int, double *, double); 115 extern int commit_hvisible (int, double *, double); 116 extern int commit_vvisible (int, double *, double); 117 extern int commit_hfporch (int, double *, double); 118 extern int commit_hbporch (int, double *, double); 119 extern int commit_hsync (int, double *, double); 120 extern int commit_vfporch (int, double *, double); 121 extern int commit_vbporch (int, double *, double); 122 extern int commit_vsync (int, double *, double); 123 124 125 126 127 128 #endif /* !VIDEOGEN_H */ 129 /* EOF */ 130