| 1 | /*
|
|---|
| 2 | ** Copyright (C) 1991, 1997 Free Software Foundation, Inc.
|
|---|
| 3 | **
|
|---|
| 4 | ** This file is part of TACK.
|
|---|
| 5 | **
|
|---|
| 6 | ** TACK is free software; you can redistribute it and/or modify
|
|---|
| 7 | ** it under the terms of the GNU General Public License as published by
|
|---|
| 8 | ** the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 9 | ** any later version.
|
|---|
| 10 | **
|
|---|
| 11 | ** TACK is distributed in the hope that it will be useful,
|
|---|
| 12 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 14 | ** GNU General Public License for more details.
|
|---|
| 15 | **
|
|---|
| 16 | ** You should have received a copy of the GNU General Public License
|
|---|
| 17 | ** along with TACK; see the file COPYING. If not, write to
|
|---|
| 18 | ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|---|
| 19 | ** Boston, MA 02110-1301, USA
|
|---|
| 20 | */
|
|---|
| 21 |
|
|---|
| 22 | /* $Id: tack.h,v 1.14 2005/09/17 19:49:16 tom Exp $ */
|
|---|
| 23 |
|
|---|
| 24 | #ifndef NCURSES_TACK_H_incl
|
|---|
| 25 | #define NCURSES_TACK_H_incl 1
|
|---|
| 26 |
|
|---|
| 27 | /* terminfo action checker include file */
|
|---|
| 28 |
|
|---|
| 29 | #define MAJOR_VERSION 1
|
|---|
| 30 | #define MINOR_VERSION 1
|
|---|
| 31 |
|
|---|
| 32 | #ifdef HAVE_CONFIG_H
|
|---|
| 33 | #include <ncurses_cfg.h>
|
|---|
| 34 | #else
|
|---|
| 35 | #define RETSIGTYPE void
|
|---|
| 36 | #define GCC_UNUSED /*nothing*/
|
|---|
| 37 | #define HAVE_GETTIMEOFDAY 1
|
|---|
| 38 | #define HAVE_SELECT 1
|
|---|
| 39 | #define HAVE_SYS_TIME_H 1
|
|---|
| 40 | #define HAVE_SYS_TIME_SELECT 1
|
|---|
| 41 | #endif
|
|---|
| 42 |
|
|---|
| 43 | #include <sys/types.h>
|
|---|
| 44 | #include <stdlib.h>
|
|---|
| 45 | #include <unistd.h>
|
|---|
| 46 | #include <ctype.h>
|
|---|
| 47 | #include <string.h>
|
|---|
| 48 |
|
|---|
| 49 | #include <curses.h>
|
|---|
| 50 | #include <term_entry.h>
|
|---|
| 51 |
|
|---|
| 52 | #if USE_RCS_IDS
|
|---|
| 53 | #define MODULE_ID(id) static const char Ident[] = id;
|
|---|
| 54 | #else
|
|---|
| 55 | #define MODULE_ID(id) /*nothing*/
|
|---|
| 56 | #endif
|
|---|
| 57 |
|
|---|
| 58 | #if !HAVE_STRSTR
|
|---|
| 59 | extern char *_nc_strstr(const char *, const char *);
|
|---|
| 60 | #define strstr(h,n) _nc_strstr(h,n)
|
|---|
| 61 | #endif
|
|---|
| 62 |
|
|---|
| 63 | #define UChar(c) ((unsigned char)(c))
|
|---|
| 64 |
|
|---|
| 65 | extern FILE *log_fp;
|
|---|
| 66 | extern FILE *debug_fp;
|
|---|
| 67 | extern int debug_level;
|
|---|
| 68 | extern char temp[];
|
|---|
| 69 | extern char tty_basename[];
|
|---|
| 70 | extern char tty_shortname[];
|
|---|
| 71 |
|
|---|
| 72 | #define SYNC_FAILED 0
|
|---|
| 73 | #define SYNC_TESTED 1
|
|---|
| 74 | #define SYNC_NOT_TESTED 2
|
|---|
| 75 | #define SYNC_NEEDED 3
|
|---|
| 76 |
|
|---|
| 77 | extern int tty_can_sync;
|
|---|
| 78 | extern int total_pads_sent; /* count pad characters sent */
|
|---|
| 79 | extern int total_caps_sent; /* count caps sent */
|
|---|
| 80 | extern int total_printing_characters; /* count printing characters sent */
|
|---|
| 81 | extern int no_alarm_event; /* TRUE if the alarm has not gone off yet */
|
|---|
| 82 | extern unsigned long usec_run_time; /* length of last test in microseconds */
|
|---|
| 83 | extern int raw_characters_sent; /* Total output characters */
|
|---|
| 84 |
|
|---|
| 85 | /* Stopwatch event timers */
|
|---|
| 86 | #define TIME_TEST 0
|
|---|
| 87 | #define TIME_SYNC 1
|
|---|
| 88 | #define TIME_FLUSH 2
|
|---|
| 89 | #define MAX_TIMERS 3
|
|---|
| 90 |
|
|---|
| 91 | /* definitions for pad.c */
|
|---|
| 92 |
|
|---|
| 93 | #define EXIT_CONDITION (no_alarm_event && (tt_delay_used < tt_delay_max))
|
|---|
| 94 | #define SLOW_TERMINAL_EXIT if (!test_complete && !EXIT_CONDITION) { break; }
|
|---|
| 95 | #define CAP_NOT_FOUND if (auto_pad_mode) return
|
|---|
| 96 |
|
|---|
| 97 | extern char letters[26+1];
|
|---|
| 98 | #define NEXT_LETTER letter = letters[letter_number =\
|
|---|
| 99 | letters[letter_number + 1] ? letter_number + 1 : 0]
|
|---|
| 100 |
|
|---|
| 101 | extern int test_complete; /* counts number of tests completed */
|
|---|
| 102 | extern char letter;
|
|---|
| 103 | extern int letter_number;
|
|---|
| 104 | extern int augment, repeats;
|
|---|
| 105 | extern long char_sent;
|
|---|
| 106 | extern const char *pad_repeat_test; /* commands that force repeat */
|
|---|
| 107 |
|
|---|
| 108 | extern int replace_mode;
|
|---|
| 109 | extern int char_count, line_count, expand_chars;
|
|---|
| 110 | extern int can_go_home, can_clear_screen;
|
|---|
| 111 |
|
|---|
| 112 | extern int translate_mode, scan_mode;
|
|---|
| 113 | extern int auto_pad_mode; /* TRUE for auto time tests */
|
|---|
| 114 | extern int char_mask;
|
|---|
| 115 | extern int hex_out; /* Display output in hex */
|
|---|
| 116 |
|
|---|
| 117 | /* Parity bit macros */
|
|---|
| 118 | #define STRIP_PARITY 0x7f
|
|---|
| 119 | #define ALLOW_PARITY 0xff
|
|---|
| 120 |
|
|---|
| 121 | /* select_delay_type: 0 -> reset all delays
|
|---|
| 122 | 1 -> force long delays
|
|---|
| 123 | 2 -> do not change the delays */
|
|---|
| 124 | extern int select_delay_type;
|
|---|
| 125 |
|
|---|
| 126 | /* select_xon_xoff: 0 -> reset xon/xoff
|
|---|
| 127 | 1 -> set xon/xoff
|
|---|
| 128 | 2 -> do not change xon/xoff */
|
|---|
| 129 | extern int select_xon_xoff;
|
|---|
| 130 |
|
|---|
| 131 | extern int tty_frame_size;
|
|---|
| 132 | extern unsigned tty_baud_rate;
|
|---|
| 133 | extern unsigned long tty_cps; /* The number of characters per second */
|
|---|
| 134 | extern int not_a_tty, nodelay_read;
|
|---|
| 135 | extern int send_reset_init;
|
|---|
| 136 |
|
|---|
|
|---|