/* ------------------------------------------------------------------------- */ /* */ /* evtimer.h - include declarations and function prototypes for evtimer.c */ /* running event timer program by JFB, 12/93 */ /* */ /* ------------------------------------------------------------------------- */ #include #include #include #include #include #include #include #include #include #include /* ------------------------------------------------------------------------- */ #define ESC 0x1B #define MONOCHROME 1 /* colors used in screen displays, monochrome or color */ #ifdef MONOCHROME #define background_color BLACK #define border_color LIGHTGRAY #define text_color LIGHTGRAY #define highlight_color WHITE #else #define background_color BLUE #define border_color CYAN #define text_color LIGHTGRAY #define highlight_color WHITE #endif /* -- initialized global variables ---------------------------------------- */ WNDPTR *menuwnd, *mainwnd; char data_buffer[10000]; char *filename = "event.out"; char *start_time="0:00:00"; clock_t initial_ticks; int count = 1; extern int CheckSnow; /* needed for ancient CGA monitors */ /* -- Top menu selection list ---------------------------------------------- */ TMNUFLDS menu1[] = { { 'Q', 2, " Quit " }, { 'G', 10, " GO " }, { 'F', 18, " File " }, { 'O', 26, " Options " }, { 'R', 37, " Reset " }, { 'H', 46, " Help " }, { NULL, NULL, NULL } }; TMNUFLDS *menulist[] = {menu1, NULL}; TMNUTYPE tmenu = { NULL, /* initial window pointer */ 1, 1, 3, 80, /* upper r,c & lower r,c */ text_color, background_color, /* window colors */ SINGLEALL, border_color, background_color, /* border definition */ " Event Timer by JFB ", /* border title */ TOP, MIDDLE, border_color, background_color, /* title loc. and colors */ background_color, text_color, /* select box colors */ 0, 0, menulist /* initial bar pos, window pos, point to menu items */ }; /* -- Options pulldown menu selections ------------------------------------- */ PMNUFLDS options[] = { { 'U', " count Up "}, { 'D', " count Down "}, { 'B', " Begin at "}, { 'Q', " Quit "}, { 0 , NULL } }; PMNUTYPE optmenu = { NULL, 3, 28, 8, 42, /* window sizes */ text_color, background_color, /* window colors */ SINGLEALL, border_color, background_color, /* border info */ "", TOP, MIDDLE, border_color, background_color, /* title info */ background_color, text_color, /* select bar info */ 0, options /* init pointer */ }; /* -- File pulldown menu selections ---------------------------------------- */ PMNUFLDS filesoptions[] = { { 'N', " New "}, { 'S', " Save "}, { 'D', " Directory "}, { 'Q', " Quit "}, { 0 , NULL } }; PMNUTYPE filesmenu = { NULL, 3, 20, 8, 32, /* window sizes */ text_color, background_color, /* window colors */ SINGLEALL, border_color, background_color, /* border info */ "", TOP, MIDDLE, border_color, background_color, /* title info */ background_color, text_color, /* select bar info */ 0, filesoptions /* init pointer */ }; /* -- Function Prototypes -------------------------------------------------- */ int options_menu ( void ); int do_timing ( void ); int wait_for_keyin ( void ); void help_popup ( void ); int output_times ( void ); char *get_time ( void ); int set_start_time ( void ); void count_up ( void ); void count_down ( void ); int new_file ( void ); int do_dir ( void ); void close_window ( WNDPTR *wnd );