1 #ifndef __GLOBALS_H 2 # define __GLOBALS_H 3 /*! 4 * \file globals.h 5 * \brief Declarations of all GLOBAL common variables used 6 * (except all common variables that depend to the RC section). 7 */ 8 /* 9 * Copyright (c) 1994, 95, 96, 1997, 2000 Thomas Esken 10 * Copyright (c) 2010, 2011, 2013 Free Software Foundation, Inc. 11 * 12 * This software doesn't claim completeness, correctness or usability. 13 * On principle I will not be liable for ANY damages or losses (implicit 14 * or explicit), which result from using or handling my software. 15 * If you use this software, you agree without any exception to this 16 * agreement, which binds you LEGALLY !! 17 * 18 * This program is free software; you can redistribute it and/or modify 19 * it under the terms of the `GNU General Public License' as published by 20 * the `Free Software Foundation'; either version 3, or (at your option) 21 * any later version. 22 * 23 * You should have received a copy of the `GNU General Public License' 24 * along with this program; if not, write to the: 25 * 26 */ 27 28 29 30 /* 31 * $Id: globals.h 3.01 2000/06/14 03:00:01 tom Exp $ 32 */ 33 34 35 36 /* 37 * GLOBAL variables declarations. 38 */ 39 /*! The table of supported date formats. */ 40 extern Df_struct supported_date_format[]; 41 42 /*! Points to the used date format. */ 43 extern Df_struct *date_format; 44 45 /*! The table of long-style options. */ 46 extern const Lopt_struct lopt[]; 47 48 /*! The table of Gregorian Reformation dates. */ 49 extern Greg_struct greg_reform_date[]; 50 51 /*! Points to the used Gregorian Reformation date. */ 52 extern Greg_struct *greg; 53 54 /*! Effective hls 1 end (current day). */ 55 extern Hls_struct ehls1e; 56 57 /*! Effective hls 1 start (current day). */ 58 extern Hls_struct ehls1s; 59 60 /*! Effective hls 2 end (holiday). */ 61 extern Hls_struct ehls2e; 62 63 /*! Effective hls 2 start (holiday). */ 64 extern Hls_struct ehls2s; 65 66 /*! Used if a list/range of months/years is given. */ 67 extern Ml_struct *month_list; 68 69 /*! Actual size of all string vectors. */ 70 extern Uint maxlen_max; 71 72 /*! Amount of days in months. */ 73 extern const int dvec[]; 74 75 /*! Number of past days of month. */ 76 extern const int mvec[]; 77 78 /*! Actual day. */ 79 extern int act_day; 80 81 /*! Actual hour. */ 82 extern int act_hour; 83 84 /*! Actual minute. */ 85 extern int act_min; 86 87 /*! Actual month. */ 88 extern int act_month; 89 90 /*! Actual second. */ 91 extern int act_sec; 92 93 /*! Actual year. */ 94 extern int act_year; 95 96 /*! Buffer of actual day. */ 97 extern int buf_ad; 98 99 /*! Buffer of actual month. */ 100 extern int buf_am; 101 102 /*! Buffer of actual year. */ 103 extern int buf_ay; 104 105 /*! True actual day as reported by the operating system. */ 106 extern int true_day; 107 108 /*! True actual month as reported by the operating system. */ 109 extern int true_month; 110 111 /*! True actual year as reported by the operating system. */ 112 extern int true_year; 113 114 /*! Current day. */ 115 extern int day; 116 117 /*! Starting month of a fiscal year. */ 118 extern int fiscal_month; 119 120 /*! Format length of a standard/special/both day. */ 121 extern int format_len; 122 123 /*! Is current year a leap year? */ 124 extern int is_leap_year; 125 126 /*! Is output directed to channel 1? */ 127 extern int is_tty1; 128 129 /*! Is output directed to channel 2? */ 130 extern int is_tty2; 131 132 /*! Is output displayed on a terminal? */ 133 extern int is_tty; 134 135 /*! Maximum string length of a textual day_name(). */ 136 extern int len_dayname_max; 137 138 /*! Maximum string length of a textual month_name(). */ 139 extern int len_monthname_max; 140 141 /*! Maximum string length of a textual day_suffix() [if any]. */ 142 extern int len_suffix_max; 143 144 /*! String length of the maximum year able to compute. */ 145 extern int len_year_max; 146 147 /*! Current month. */ 148 extern int month; 149 150 /*! Number of month columns of a year calendar. */ 151 extern int out_cols; 152 153 /*! Number of month rows of a year calendar. */ 154 extern int out_rows; 155 156 /*! `-s<0,1...7|day name>'. */ 157 extern int start_day; 158 159 /*! `--time-offset=t|@|[t|@][+|-]MMMM|HH:[MM]' for correcting astronomically based data. */ 160 extern int time_hour_offset; 161 162 /*! `--time-offset=t|@|[t|@][+|-]MMMM|HH:[MM]' for correcting astronomically based data. */ 163 extern int time_min_offset; 164 165 /*! `--transform-year=BASE_YEAR'. */ 166 extern int transform_year; 167 168 /*! `--debug[=0...WARN_LVL_MAX]'. */ 169 extern int warning_level; 170 171 /*! Current year. */ 172 extern int year; 173 174 /*! Vector of holiday dates (legal days). */ 175 extern char hd_ldays[]; 176 177 /*! `--cc-holidays=CC[+CC+...]'. */ 178 extern char *cc; 179 180 /*! The "DD" text. */ 181 extern char *dd_lit; 182 183 /*! The "ARG" text. */ 184 extern char *larg_lit; 185 186 /*! The "MM" text. */ 187 extern char *mm_lit; 188 189 /*! Stores the actual program name. */ 190 extern char *prgr_name; 191 192 /*! General purpose text buffer 1. */ 193 extern char *s1; 194 195 /*! General purpose text buffer 2. */ 196 extern char *s2; 197 198 /*! General purpose text buffer 3. */ 199 extern char *s3; 200 201 /*! General purpose text buffer 4. */ 202 extern char *s4; 203 204 /*! Character for separating HH:MM time values. */ 205 extern char *time_sep; 206 207 /*! `--translate-string=CHARACTER_PAIR...'. */ 208 extern char *translate_string; 209 210 /*! Pointer to the $TZ (timezone) environment variable. */ 211 extern char *tz; 212 213 /*! The "WWW" text. */ 214 extern char *www_lit; 215 216 /*! The "YY" text. */ 217 extern char *yy_lit; 218 219 /*! The "YYYY" text. */ 220 extern char *yyyy_lit; 221 222 /*! `-jb'. */ 223 extern Bool cal_both_dates_flag; 224 225 /*! `-j'. */ 226 extern Bool cal_special_flag; 227 228 /*! `-K'. */ 229 extern Bool cal_with_week_number; 230 231 /*! Use Astronomical holidays. */ 232 extern Bool hdy_astronomical; 233 234 /*! Use Bahai calendar holidays. */ 235 extern Bool hdy_bahai; 236 237 /*! Use Celtic calendar holidays. */ 238 extern Bool hdy_celtic; 239 240 /*! Use Chinese calendar holidays. */ 241 extern Bool hdy_chinese; 242 243 /*! Use Chinese flexible calendar holidays. */ 244 extern Bool hdy_chinese_flexible; 245 246 /*! Use Christian Western churches calendar holidays. */ 247 extern Bool hdy_christian; 248 249 /*! Use Hebrew calendar holidays. */ 250 extern Bool hdy_hebrew; 251 252 /*! Use Islamic CIVIL calendar holidays. */ 253 extern Bool hdy_islamic; 254 255 /*! Use Japanese calendar holidays. */ 256 extern Bool hdy_japanese; 257 258 /*! Use Japanese flexible calendar holidays. */ 259 extern Bool hdy_japanese_flexible; 260 261 /*! Use Multicultural New_Year's_Day holidays. */ 262 extern Bool hdy_multicultural_new_year; 263 264 /*! Use Orthodox Christian Eastern churches NEW calendar holidays. */ 265 extern Bool hdy_orthodox_new; 266 267 /*! Use Orthodox Christian Eastern churches OLD calendar holidays. */ 268 extern Bool hdy_orthodox_old; 269 270 /*! Use Persian Jalaali calendar holidays. */ 271 extern Bool hdy_persian; 272 273 /*! Use Zodiacal Marker holidays. */ 274 extern Bool hdy_zodiacal_marker; 275 276 /*! Use Bahai calendar months. */ 277 extern Bool mth_bahai; 278 279 /*! Use Chinese calendar months. */ 280 extern Bool mth_chinese; 281 282 /*! Use Chinese flexible calendar months. */ 283 extern Bool mth_chinese_flexible; 284 285 /*! Use Coptic calendar months. */ 286 extern Bool mth_coptic; 287 288 /*! Use Ethiopic calendar months. */ 289 extern Bool mth_ethiopic; 290 291 /*! Use French Revolutionary calendar months. */ 292 extern Bool mth_french_revolutionary; 293 294 /*! Use Hebrew calendar months. */ 295 extern Bool mth_hebrew; 296 297 /*! Use Indian CIVIL calendar months. */ 298 extern Bool mth_indian_civil; 299 300 /*! Use Islamic CIVIL calendar months. */ 301 extern Bool mth_islamic; 302 303 /*! Use Japanese calendar months. */ 304 extern Bool mth_japanese; 305 306 /*! Use Japanese flexible calendar months. */ 307 extern Bool mth_japanese_flexible; 308 309 /*! Use Old-Armenic calendar months. */ 310 extern Bool mth_old_armenic; 311 312 /*! Use Old-Egyptic calendar months. */ 313 extern Bool mth_old_egyptic; 314 315 /*! Use Persian Jalaali calendar months. */ 316 extern Bool mth_persian; 317 318 /*! Must we emulate the highlighting sequences? */ 319 extern Bool emu_hls; 320 321 /*! `-jnb'. */ 322 extern Bool hd_both_dates_flag; 323 324 /*! `-N'. */ 325 extern Bool hd_legal_days_only; 326 327 /*! `-n|N-'. */ 328 extern Bool hd_sort_des_flag; 329 330 /*! `-jn'. */ 331 extern Bool hd_special_flag; 332 333 /*! `-G'. */ 334 extern Bool hd_suppr_list_sep_flag; 335 336 /*! `-X'. */ 337 extern Bool hd_title_flag; 338 339 /*! `-H<yes>|<no>'. */ 340 extern Bool highlight_flag; 341 342 /*! `-n|N'. */ 343 extern Bool holiday_flag; 344 345 /*! Argument is `..' -> current quarter of actual year. */ 346 extern Bool is_3month_mode2; 347 348 /*! Argument is `.' or `.+' or `.-'. */ 349 extern Bool is_3month_mode; 350 351 /*! Is an extended list of months/years given? */ 352 extern Bool is_ext_list; 353 354 /*! Is an extended range of months/years given? */ 355 extern Bool is_ext_range; 356 357 /*! Is an extended list/range of years given? */ 358 extern Bool is_ext_year; 359 360 /*! `:' char found in argument (MM:YYYY). */ 361 extern Bool is_fiscal_year; 362 363 /*! Is a special range of a selected month of years given? */ 364 extern Bool is_special_range; 365 366 /*! Is a special range of selected months of years given? */ 367 extern Bool is_multi_range; 368 369 /*! `--iso-week-number=<yes>|<no>'. */ 370 extern Bool iso_week_number; 371 372 /*! `-O' (compute leap years as done by Eastern churches). */ 373 extern Bool orthodox_calendar; 374 375 /*! `-i'. */ 376 extern Bool special_calsheet_flag; 377 378 /*! `-u'. */ 379 extern Bool suppr_cal_flag; 380 381 /*! Day number leaded with zeroes format specifier given in date format? */ 382 extern Bool use_day_zeroleaded; 383 384 /*! 3 char day name format specifier given in date format? */ 385 extern Bool use_short3_day_name; 386 387 /*! Year number leaded with zeroes format specifier given in date format? */ 388 extern Bool use_year_zeroleaded; 389 390 391 392 # ifdef DJG 393 /*! Set to SHRT_MAX for checking the maximum table range. */ 394 extern Usint testval; 395 # else /* !DJG */ 396 /* Set to INT_MAX for checking the maximum table range. */ 397 extern Uint testval; 398 # endif /* !DJG */ 399 400 401 402 # ifdef GCAL_EMAIL 403 /*! Temporary file which is send by the mailer. */ 404 extern FILE *tfp; 405 406 /*! Name of tempfile used by the mailer. */ 407 extern char *tfn; 408 409 /*! Email address Gcal's output is send to. */ 410 extern char *email_adr; 411 # endif /* GCAL_EMAIL */ 412 413 414 415 # ifdef GCAL_EPAGER 416 /*! Name of external pager program. */ 417 extern char *ext_pager; 418 # endif /* GCAL_EPAGER */ 419 420 421 422 # ifdef GCAL_NLS 423 /*! Support of English language? */ 424 extern Bool is_en; 425 # endif /* GCAL_NLS */ 426 427 428 429 # if USE_PAGER 430 /*! Number of tty columns. */ 431 extern int tty_cols; 432 433 /*! Number of tty rows. */ 434 extern int tty_rows; 435 436 /*! `-p'. */ 437 extern Bool pager_flag; 438 # endif /* USE_PAGER */ 439 440 441 442 # if (USE_PAGER || USE_HLS) && defined(GCAL_TCAP) 443 # if MUST_DCL_OSPEED && USE_HLS 444 /*! Terminal output baud rate. */ 445 extern short ospeed; 446 447 /*! 448 On Solaris2, sys/types.h #includes sys/reg.h, which #defines PC. 449 Unfortunately, PC is a global variable used by the Termcap library. 450 */ 451 # ifdef PC 452 # undef PC 453 # endif 454 455 /*! Padding character. */ 456 extern char PC; 457 # endif /* MUST_DCL_OSPEED && USE_HLS */ 458 # endif /* (USE_PAGER || USE_HLS) && GCAL_TCAP */ 459 #endif /* __GLOBALS_H */ 460