home *** CD-ROM | disk | FTP | other *** search
- /*
- * 92/02/01 07:30:28
- * @(#) mytinfo term.tail 3.2 92/02/01 public domain, By Ross Ridge
- *
- */
-
- #ifdef _USE_TERMIO
- #ifndef ICANON
- #include <termio.h>
- #endif
- #if defined(_USE_WINSZ) && defined(xenix)
- #include <sys/stream.h>
- #include <sys/ptem.h>
- #endif
- #endif
-
- #ifdef _USE_SGTTY
- #ifndef CBREAK
- #include <sgtty.h>
- #endif
- #endif
-
- typedef struct _terminal {
- int fd;
- #ifdef _USE_SMALLMEM
- unsigned short baudrate;
- unsigned pad:1, xon:1, termcap:1;
- #else
- int pad;
- int xon;
- int termcap;
- long baudrate;
- #endif
- char padch;
- short true_lines, true_columns;
- struct strbuf {
- struct strbuf *next;
- #ifdef _USE_SMALLMEM
- short len;
- #else
- int len;
- #endif
- char buf[_MAX_CHUNK];
- } *strbuf;
- char *name, *name_long, *name_all;
- #ifdef _USE_SGTTY
- struct sgtty_str {
- struct sgttyb v6;
- #ifdef TIOCGETC
- struct tchars v7;
- #endif
- #ifdef TIOCLGET
- int bsd;
- #endif
- #ifdef TIOCGLTC
- struct ltchars bsd_new;
- #endif
- } prog_mode, shell_mode;
- #else /* _USE_SGTTY */
- #ifdef _USE_TERMIO
- struct termio prog_mode, shell_mode;
- #endif
- #endif /* else _USE_SGTTY */
- #ifdef _USE_WINSZ
- #ifdef TIOCGWINSZ
- struct winsize prog_winsz, shell_winsz;
- #endif
- #endif
- char bools[NUM_OF_BOOLS];
- short nums[NUM_OF_NUMS];
- char *strs[NUM_OF_STRS];
- } TERMINAL;
-
- #ifndef _CUR_TERM
- #ifdef SINGLE
- #define _CUR_TERM _term_buf
- #else
- #define _CUR_TERM (*cur_term)
- #endif
- #endif
-
- extern TERMINAL *cur_term;
- extern TERMINAL _term_buf;
-
- #ifdef USE_PROTOTYPES
- extern char *tparm(char *, ...);
- extern int setupterm(char *, int, int *), set_curterm(TERMINAL *);
- extern int del_curterm(TERMINAL *), tputs(char *, int, int (*)());
- extern int putp(char *);
- extern int tigetflag(char *), tigetnum(char *);
- extern char *tigetstr(char *);
- extern int def_prog_mode(void), def_shell_mode(void);
- extern int reset_prog_mode(void), reset_shell_mode(void);
- #else
- extern char *tparm();
- extern int setupterm(), set_curterm();
- extern int del_curterm(), tputs();
- extern int putp();
- extern int tigetflag(), tigetnum();
- extern char *tigetstr();
- extern int def_prog_mode(), def_shell_mode();
- extern int reset_prog_mode(), reset_shell_mode();
- #endif
-
- extern char *boolnames[], *boolcodes[], *boolfnames[];
- extern char *numnames[], *numcodes[], *numfnames[];
- extern char *strnames[], *strcodes[], *strfnames[];
-
- #ifndef OK
- #undef ERR
- #define OK (0)
- #define ERR (-1)
- #endif
-
- #endif /* _TERM_H_ */
-