diff options
-rw-r--r-- | programs/xterm/MANIFEST | 5 | ||||
-rw-r--r-- | programs/xterm/Tekproc.c | 3 | ||||
-rw-r--r-- | programs/xterm/button.c | 13 | ||||
-rw-r--r-- | programs/xterm/charclass.c | 4 | ||||
-rw-r--r-- | programs/xterm/charproc.c | 8 | ||||
-rw-r--r-- | programs/xterm/fontutils.c | 74 | ||||
-rw-r--r-- | programs/xterm/main.c | 201 | ||||
-rw-r--r-- | programs/xterm/menu.c | 10 | ||||
-rw-r--r-- | programs/xterm/os2main.c | 48 | ||||
-rw-r--r-- | programs/xterm/resize.c | 240 | ||||
-rw-r--r-- | programs/xterm/screen.c | 58 | ||||
-rw-r--r-- | programs/xterm/xterm.h | 6 | ||||
-rw-r--r-- | programs/xterm/xterm.log.html | 15 |
13 files changed, 192 insertions, 493 deletions
diff --git a/programs/xterm/MANIFEST b/programs/xterm/MANIFEST index f4855fe69..e440270e4 100644 --- a/programs/xterm/MANIFEST +++ b/programs/xterm/MANIFEST @@ -1,4 +1,4 @@ -MANIFEST for xterm-141, version xterm-141 +MANIFEST for xterm-149, version xterm-149 -------------------------------------------------------------------------------- MANIFEST this file 256colres.h resource-definitions for 256-color mode @@ -78,10 +78,13 @@ vms.h system headers and definitions for vms.c wcwidth.c wide-character utility functions wcwidth.h interface of wcwidth.c xcharmouse.h Jason Bacon's mouse-defs, cleaned up a little +xstrings.c a few common string functions +xstrings.h interface of xstrings.c xterm.dat application defaults for VMS port of 'xterm' xterm.h common includes, definitions and prototypes for 'xterm' xterm.man manual page for 'xterm' xterm_axp.opt linker options file for VMS port of 'xterm' +xterm_io.h split-out definitions of termio/termios/sgtty and winsize from main.c, os2main.c, screen.c and resize.c xtermcfg.hin configure script: template for xtermcfg.h tektests subdirectory tektests/aitest.tek tek4014 demo: draw a globe diff --git a/programs/xterm/Tekproc.c b/programs/xterm/Tekproc.c index 4296765a5..1b38f8f6b 100644 --- a/programs/xterm/Tekproc.c +++ b/programs/xterm/Tekproc.c @@ -1,6 +1,6 @@ /* * $XConsortium: Tekproc.c /main/120 1996/11/29 10:33:20 swick $ - * $XFree86: xc/programs/xterm/Tekproc.c,v 3.29 2000/02/08 17:19:27 dawes Exp $ + * $XFree86: xc/programs/xterm/Tekproc.c,v 3.30 2000/03/31 20:13:41 dawes Exp $ * * Warning, there be crufty dragons here. */ @@ -58,7 +58,6 @@ in this Software without prior written authorization from the X Consortium. #include <xterm.h> -#include <X11/Xos.h> #include <X11/Xatom.h> #include <X11/Xutil.h> #include <X11/cursorfont.h> diff --git a/programs/xterm/button.c b/programs/xterm/button.c index 353fb2b24..9c025b0c6 100644 --- a/programs/xterm/button.c +++ b/programs/xterm/button.c @@ -50,7 +50,7 @@ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ -/* $XFree86: xc/programs/xterm/button.c,v 3.51 2000/09/26 15:57:26 tsi Exp $ */ +/* $XFree86: xc/programs/xterm/button.c,v 3.52 2000/11/28 23:07:33 dawes Exp $ */ /* button.c Handles button events in the terminal emulator. @@ -61,14 +61,9 @@ button.c Handles button events in the terminal emulator. #include <xterm.h> -#include <X11/Xatom.h> - #include <stdio.h> -#ifdef MINIX -#include <X11/Xos.h> -#endif - +#include <X11/Xatom.h> #include <X11/Xmu/Atoms.h> #include <X11/Xmu/StdSel.h> @@ -989,9 +984,9 @@ static void _GetSelection( } #if OPT_TRACE && OPT_WIDE_CHARS -static void GettingSelection(char *tag, char *line, int len) +static void GettingSelection(char *tag, Char *line, int len) { - char *cp; + Char *cp; Trace("Getting %s\n", tag); for (cp = line; cp < line + len; cp++) diff --git a/programs/xterm/charclass.c b/programs/xterm/charclass.c index 9eb02e49c..84f693de8 100644 --- a/programs/xterm/charclass.c +++ b/programs/xterm/charclass.c @@ -20,15 +20,13 @@ * but merging in new intervals is significantly more hassle and * not worth the effort here. */ -/* $XFree86$ */ +/* $XFree86: xc/programs/xterm/charclass.c,v 1.1 2000/08/26 04:33:53 dawes Exp $ */ #include <xterm.h> #include <charclass.h> #if OPT_WIDE_CHARS -#include <stdlib.h> - struct classentry { int class; int first; diff --git a/programs/xterm/charproc.c b/programs/xterm/charproc.c index 33c733839..37e4ef8f8 100644 --- a/programs/xterm/charproc.c +++ b/programs/xterm/charproc.c @@ -1,6 +1,6 @@ /* * $XConsortium: charproc.c /main/196 1996/12/03 16:52:46 swick $ - * $XFree86: xc/programs/xterm/charproc.c,v 3.111 2000/11/01 01:12:37 dawes Exp $ + * $XFree86: xc/programs/xterm/charproc.c,v 3.112 2000/11/29 08:39:24 keithp Exp $ */ /* @@ -86,11 +86,11 @@ in this Software without prior written authorization from the X Consortium. #include <version.h> #include <xterm.h> -#include <X11/Xos.h> #include <X11/Xatom.h> #include <X11/Xutil.h> #include <X11/cursorfont.h> #include <X11/StringDefs.h> +#include <X11/Shell.h> #include <X11/Xmu/Atoms.h> #include <X11/Xmu/CharSet.h> #include <X11/Xmu/Converters.h> @@ -127,10 +127,6 @@ in this Software without prior written authorization from the X Consortium. #define HANDLE_STRUCT_NOTIFY 1 #endif -#if !defined(NO_ACTIVE_ICON) || defined(HANDLE_STRUCT_NOTIFY) -#include <X11/Shell.h> -#endif /* NO_ACTIVE_ICON */ - extern char *ProgramName; static int in_put (void); diff --git a/programs/xterm/fontutils.c b/programs/xterm/fontutils.c index 2eb4c6593..db4ae551f 100644 --- a/programs/xterm/fontutils.c +++ b/programs/xterm/fontutils.c @@ -469,10 +469,23 @@ same_font_size(XFontStruct *nfs, XFontStruct *bfs) static int is_fixed_font(XFontStruct *fs) { - return (fs->min_bounds.width == fs->max_bounds.width - && fs->min_bounds.width == fs->min_bounds.width); + return (fs->min_bounds.width == fs->max_bounds.width); } +/* + * Check if the font looks like a double width font (i.e. contains + * characters of width X and 2X + */ +#if OPT_WIDE_CHARS +static int +is_double_width_font(XFontStruct *fs) +{ + return (2 * fs->min_bounds.width == fs->max_bounds.width); +} +#else +#define is_double_width_font(fs) 0 +#endif + #define EmptyFont(fs) (fs != 0 \ && ((fs)->ascent + (fs)->descent == 0 \ || (fs)->max_bounds.width == 0)) @@ -555,22 +568,29 @@ xtermLoadFont ( * and 12x13ja as the corresponding fonts for 9x18 and 6x13. */ if_OPT_WIDE_CHARS(screen, { - if (wfontname == 0) { + if (wfontname == 0 && !is_double_width_font(nfs)) { fp = get_font_name_props(screen->display, nfs, normal); if (fp != 0) { wfontname = wide_font_name(fp); TRACE(("...derived wide %s\n", wfontname)); } } - if (wfontname - && (wfs = XLoadQueryFont(screen->display, wfontname)) == 0) { + + if (wfontname) { + wfs = XLoadQueryFont(screen->display, wfontname); + } else { + wfs = nfs; } + if (wbfontname) { wbfs = XLoadQueryFont(screen->display, wbfontname); + } else if (is_double_width_font(bfs)) { + wbfs = bfs; } else { wbfs = wfs; TRACE(("...cannot load wide bold font %s\n", wbfontname)); } + if (EmptyFont(wbfs)) goto bad; /* can't use a 0-sized font */ }) @@ -830,32 +850,24 @@ xtermComputeFontInfo (TScreen *screen, struct _vtwin *win, XFontStruct *font, in if (!screen->renderFont && term->misc.face_name && XRenderFindVisualFormat (dpy, DefaultVisual (dpy, DefaultScreen (dpy)))) { - XftPattern *pat, *match; - XftResult result; - - pat = XftNameParse (term->misc.face_name); - XftPatternBuild (pat, - XFT_FAMILY, XftTypeString, "mono", - XFT_SIZE, XftTypeInteger, term->misc.face_size, - XFT_SPACING, XftTypeInteger, XFT_MONO, - 0); - match = XftFontMatch (dpy, DefaultScreen (dpy), pat, &result); - screen->renderFont = XftFontOpenPattern (dpy, match); - if (!screen->renderFont && match) - XftPatternDestroy (match); + screen->renderFont = XftFontOpen (dpy, DefaultScreen (dpy), + XFT_FAMILY, XftTypeString, term->misc.face_name, + XFT_FAMILY, XftTypeString, "mono", + XFT_SIZE, XftTypeInteger, term->misc.face_size, + XFT_SPACING, XftTypeInteger, XFT_MONO, + 0); if (screen->renderFont) { - XftPatternBuild (pat, - XFT_WEIGHT, XftTypeInteger, XFT_WEIGHT_BOLD, - XFT_CHAR_WIDTH, XftTypeInteger, screen->renderFont->max_advance_width, - 0); - match = XftFontMatch (dpy, DefaultScreen (dpy), pat, &result); - screen->renderFontBold = XftFontOpenPattern (dpy, match); - if (!screen->renderFontBold && match) - XftPatternDestroy (match); + screen->renderFontBold = XftFontOpen (dpy, DefaultScreen (dpy), + XFT_FAMILY, XftTypeString, term->misc.face_name, + XFT_FAMILY, XftTypeString, "mono", + XFT_SIZE, XftTypeInteger, term->misc.face_size, + XFT_WEIGHT, XftTypeInteger, XFT_WEIGHT_BOLD, + XFT_SPACING, XftTypeInteger, XFT_MONO, + XFT_CHAR_WIDTH, XftTypeInteger, + screen->renderFont->max_advance_width, + 0); } - if (pat) - XftPatternDestroy (pat); } if (screen->renderFont) { @@ -867,7 +879,11 @@ xtermComputeFontInfo (TScreen *screen, struct _vtwin *win, XFontStruct *font, in else #endif { - win->f_width = (font->max_bounds.width); + if (is_double_width_font(font)) { + win->f_width = (font->min_bounds.width); + } else { + win->f_width = (font->max_bounds.width); + } win->f_height = (font->ascent + font->descent); win->f_ascent = font->ascent; win->f_descent = font->descent; diff --git a/programs/xterm/main.c b/programs/xterm/main.c index 13924ac63..72baf19e0 100644 --- a/programs/xterm/main.c +++ b/programs/xterm/main.c @@ -64,7 +64,7 @@ SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/xterm/main.c,v 3.121 2000/10/27 18:31:14 dawes Exp $ */ +/* $XFree86: xc/programs/xterm/main.c,v 3.122 2000/11/01 01:12:39 dawes Exp $ */ /* main.c */ @@ -74,8 +74,6 @@ SOFTWARE. #include <X11/StringDefs.h> #include <X11/Shell.h> - -#include <X11/Xos.h> #include <X11/cursorfont.h> #include <X11/Xlocale.h> @@ -91,6 +89,7 @@ SOFTWARE. #include <menu.h> #include <main.h> #include <xstrings.h> +#include <xterm_io.h> #if OPT_WIDE_CHARS #include <charclass.h> @@ -101,12 +100,10 @@ SOFTWARE. #include <cmdreg.h> #include <stderr.h> #include <thread.h> -#define _POSIX_SOURCE #include <limits.h> #include <module/proc.h> #include <module/name.h> -#define USE_TERMIOS #define NILCAP ((capability *)NULL) #endif @@ -114,7 +111,6 @@ SOFTWARE. #include <sys/nbio.h> #define setpgrp(pid, pgid) setpgid(pid, pgid) -#define USE_TERMIOS #define MNX_LASTLOG #define WTMP /* Remap or define non-existing termios flags */ @@ -137,10 +133,6 @@ SOFTWARE. #define WTMP #endif -#if defined(SVR4) && !defined(__sgi) -#define USE_TERMIOS -#endif - #ifdef USE_ISPTS_FLAG static Bool IsPts = False; #endif @@ -155,49 +147,25 @@ static Bool IsPts = False; #define KANJI #endif -#ifdef TIOCSLTC -#define HAS_LTCHARS -#endif - #ifdef linux -#define USE_TERMIOS #define USE_SYSV_PGRP #define USE_SYSV_SIGNALS #define WTMP -#undef HAS_LTCHARS #ifdef __GLIBC__ #if (__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1)) #include <pty.h> -#include <stdlib.h> /* getpt() */ #endif #endif #endif #ifdef __MVS__ -#define SVR4 -#define USE_POSIX_TERMIOS #define USE_SYSV_PGRP #define USE_SYSV_SIGNALS -#undef HAS_LTCHARS #endif #ifdef __CYGWIN__ -#define SYSV -#define SVR4 #define LASTLOG #define WTMP -#define ATT -#endif - -#ifdef __QNX__ -#define USE_POSIX_TERMIOS -#include <ioctl.h> -#endif - -#ifdef Lynx -#define USE_SYSV_TERMIO -#undef HAS_LTCHARS -#include <termio.h> #endif #ifdef SCO325 @@ -218,10 +186,6 @@ static Bool IsPts = False; #define TTY_GROUP_NAME "tty" #endif -#ifndef __CYGWIN__ -#include <sys/ioctl.h> -#endif - #include <sys/stat.h> #ifdef Lynx @@ -236,56 +200,20 @@ static Bool IsPts = False; #endif #endif -#if defined(USE_POSIX_TERMIOS) -#include <termios.h> -#elif defined(USE_TERMIOS) -#include <termios.h> -/* this hacked termios support only works on SYSV */ -#define USE_SYSV_TERMIO -#define termio termios -#undef TCGETA -#define TCGETA TCGETS -#undef TCSETA -#define TCSETA TCSETS -#elif defined(SYSV) -#include <sys/termio.h> -#elif defined(sun) && !defined(SVR4) -#include <sys/ttycom.h> -#ifdef TIOCSWINSZ -#undef TIOCSSIZE -#endif -#endif /* USE_POSIX_TERMIOS */ - -#ifdef SVR4 -#undef HAS_LTCHARS /* defined, but not useable */ -#endif -#define USE_TERMCAP_ENVVARS /* every one uses this except SYSV maybe */ - -#if defined(__sgi) && (OSMAJORVERSION >= 5) -#undef TIOCLSET /* defined, but not useable */ -#endif - -#if defined(__GNU__) || defined(__MVS__) -#undef TIOCLSET -#undef TIOCSLTC -#endif - #ifdef SYSV /* { */ #ifdef USE_USG_PTYS /* AT&T SYSV has no ptyio.h */ -#include <sys/stream.h> /* get typedef used in ptem.h */ #include <sys/stropts.h> /* for I_PUSH */ -#if !defined(SVR4) || defined(SCO325) -#include <sys/ptem.h> /* get struct winsize */ -#endif #include <poll.h> /* for POLLIN */ #endif /* USE_USG_PTYS */ -#define USE_SYSV_TERMIO + #define USE_SYSV_SIGNALS #define USE_SYSV_PGRP + #if !defined(TIOCSWINSZ) #define USE_SYSV_ENVVARS /* COLUMNS/LINES vs. TERMCAP */ #endif + /* * now get system-specific includes */ @@ -330,8 +258,6 @@ static Bool IsPts = False; #ifdef __QNX__ -#undef TIOCSLTC /* <sgtty.h> conflicts with <termios.h> */ -#undef TIOCLSET #ifndef __QNXNTO__ #define ttyslot() 1 #else @@ -344,14 +270,14 @@ extern __inline__ ttyslot() {return 1;} /* yuk */ #ifndef linux #ifndef VMS #ifndef USE_POSIX_TERMIOS -#ifndef USE_SYSV_TERMIO +#ifndef USE_ANY_SYSV_TERMIO #include <sgtty.h> #endif #endif /* USE_POSIX_TERMIOS */ -#ifndef Lynx -#include <sys/resource.h> -#else +#ifdef Lynx #include <resource.h> +#else +#include <sys/resource.h> #endif #define HAS_BSD_GROUPS #endif /* !VMS */ @@ -376,10 +302,8 @@ extern __inline__ ttyslot() {return 1;} /* yuk */ #ifndef NOFILE #define NOFILE OPEN_MAX #endif -#elif !defined(MINIX) && !defined(WIN32) && !defined(Lynx) && !defined(__GNU__) && !defined(__MVS__) -#ifndef VMS +#elif !(defined(VMS) || defined(MINIX) || defined(WIN32) || defined(Lynx) || defined(__GNU__) || defined(__MVS__)) #include <sys/param.h> /* for NOFILE */ -#endif /* !VMS */ #endif #if defined(BSD) && (BSD >= 199103) @@ -403,12 +327,6 @@ extern time_t time (); #define ttyslot() 1 #endif /* apollo */ -#ifdef sun -#include <sys/filio.h> -#endif - -#include <sys/types.h> - #if defined(USE_UTEMPTER) #include <utempter.h> @@ -439,17 +357,15 @@ extern struct utmp *getutid __((struct utmp *_Id)); #include <local/openpty.h> #endif /* PUCC_PTYD */ -#ifndef UTMP_FILENAME -#ifdef UTMP_FILE +#if !defined(UTMP_FILENAME) +#if defined(UTMP_FILE) #define UTMP_FILENAME UTMP_FILE -#else -#ifdef _PATH_UTMP +#elif defined(_PATH_UTMP) #define UTMP_FILENAME _PATH_UTMP #else #define UTMP_FILENAME "/etc/utmp" #endif #endif -#endif #ifndef LASTLOG_FILENAME #ifdef _PATH_LASTLOG @@ -459,21 +375,17 @@ extern struct utmp *getutid __((struct utmp *_Id)); #endif #endif -#ifndef WTMP_FILENAME -#ifdef WTMP_FILE +#if !defined(WTMP_FILENAME) +#if defined(WTMP_FILE) #define WTMP_FILENAME WTMP_FILE -#else -#ifdef _PATH_WTMP +#elif defined(_PATH_WTMP) #define WTMP_FILENAME _PATH_WTMP -#else -#ifdef SYSV +#elif defined(SYSV) #define WTMP_FILENAME "/etc/wtmp" #else #define WTMP_FILENAME "/usr/adm/wtmp" #endif #endif -#endif -#endif #include <signal.h> @@ -540,15 +452,6 @@ static Bool xterm_exiting = False; */ static char **command_to_exec = NULL; -#ifdef USE_SYSV_TERMIO -#ifndef ICRNL -#include <sys/termio.h> -#endif -#if defined (__sgi) || (defined(__linux__) && defined(__sparc__)) -#undef TIOCLSET /* XXX why is this undef-ed again? */ -#endif -#endif /* USE_SYSV_TERMIO */ - #define TERMCAP_ERASE "kb" #define VAL_INITIAL_ERASE A2E(127) @@ -612,7 +515,7 @@ static char **command_to_exec = NULL; #endif #ifndef VMS -#ifdef USE_SYSV_TERMIO +#ifdef USE_ANY_SYSV_TERMIO /* The following structures are initialized in main() in order ** to eliminate any assumptions about the internal order of their ** contents. @@ -628,7 +531,7 @@ static unsigned int d_lmode; #elif defined(USE_POSIX_TERMIOS) static struct termios d_tio; -#else /* !USE_SYSV_TERMIO && !USE_POSIX_TERMIOS */ +#else /* !USE_ANY_SYSV_TERMIO && !USE_POSIX_TERMIOS */ static struct sgttyb d_sg = { 0, 0, 0177, CKILL, EVENP|ODDP|ECHO|XTABS|CRMOD }; @@ -648,7 +551,7 @@ static struct jtchars d_jtc = { 'J', 'B' }; #endif /* sony */ -#endif /* USE_SYSV_TERMIO */ +#endif /* USE_ANY_SYSV_TERMIO */ #endif /* ! VMS */ /* @@ -1471,7 +1374,7 @@ main (int argc, char *argv[]) d_tio.c_cc[VREPRINT]= TREPRINT_DEF; d_tio.c_cc[VLNEXT]= TLNEXT_DEF; d_tio.c_cc[VDISCARD]= TDISCARD_DEF; -#elif defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS) /* { */ +#elif defined(USE_ANY_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS) /* { */ /* Initialization is done here rather than above in order ** to prevent any assumptions about the order of the contents ** of the various terminal structures (which may change from @@ -1961,7 +1864,7 @@ main (int argc, char *argv[]) } } if(i >= 0) { -#if defined(USE_SYSV_TERMIO) && !defined(SVR4) && !defined(linux) +#if defined(USE_ANY_SYSV_TERMIO) && !defined(SVR4) && !defined(linux) /* SYSV has another pointer which should be part of the ** FILE structure but is actually a separate array. */ @@ -1975,9 +1878,9 @@ main (int argc, char *argv[]) stderr->_file = i; #endif _bufend(stderr) = old_bufend; -#else /* USE_SYSV_TERMIO */ +#else /* USE_ANY_SYSV_TERMIO */ freopen(dbglogfile, "w", stderr); -#endif /* USE_SYSV_TERMIO */ +#endif /* USE_ANY_SYSV_TERMIO */ /* mark this file as close on exec */ (void) fcntl(i, F_SETFD, 1); @@ -2037,7 +1940,7 @@ main (int argc, char *argv[]) if (fcntl(screen->respond, F_SETFD, mode) == -1) Error(1); nbio_register(screen->respond); -#elif defined(USE_SYSV_TERMIO) || defined(__MVS__) +#elif defined(USE_ANY_SYSV_TERMIO) || defined(__MVS__) if (0 > (mode = fcntl(screen->respond, F_GETFL, 0))) Error(1); #ifdef O_NDELAY @@ -2047,7 +1950,7 @@ main (int argc, char *argv[]) #endif /* O_NDELAY */ if (fcntl(screen->respond, F_SETFL, mode)) Error(1); -#else /* !MINIX && !USE_SYSV_TERMIO */ +#else /* !MINIX && !USE_ANY_SYSV_TERMIO */ mode = 1; if (ioctl (screen->respond, FIONBIO, (char *)&mode) == -1) SysError (ERROR_FIONBIO); #endif /* MINIX, etc */ @@ -2479,7 +2382,7 @@ spawn (void) int initial_erase = VAL_INITIAL_ERASE; #endif int tty = -1; -#ifdef USE_SYSV_TERMIO +#ifdef USE_ANY_SYSV_TERMIO struct termio tio; #ifdef TIOCLSET unsigned lmode; @@ -2489,7 +2392,7 @@ spawn (void) #endif /* HAS_LTCHARS */ #elif defined(USE_POSIX_TERMIOS) struct termios tio; -#else /* !USE_SYSV_TERMIO && !USE_POSIX_TERMIOS */ +#else /* !USE_ANY_SYSV_TERMIO && !USE_POSIX_TERMIOS */ int ldisc = 0; int discipline; unsigned lmode; @@ -2500,7 +2403,7 @@ spawn (void) int jmode; struct jtchars jtc; #endif /* sony */ -#endif /* USE_SYSV_TERMIO */ +#endif /* USE_ANY_SYSV_TERMIO */ char termcap [TERMCAP_SIZE]; char newtc [TERMCAP_SIZE]; @@ -2514,7 +2417,7 @@ spawn (void) struct ttysize ts; #elif defined(TIOCSWINSZ) struct winsize ws; -#endif +#endif /* sun vs TIOCSWINSZ */ struct passwd *pw = NULL; #ifdef HAVE_UTMP #if defined(UTMPX_FOR_UTMP) @@ -2591,9 +2494,9 @@ spawn (void) #ifdef TIOCLSET lmode = d_lmode; #endif /* TIOCLSET */ -#if defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS) +#if defined(USE_ANY_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS) tio = d_tio; -#else /* not USE_SYSV_TERMIO and not USE_POSIX_TERMIOS */ +#else /* not USE_ANY_SYSV_TERMIO and not USE_POSIX_TERMIOS */ sg = d_sg; tc = d_tc; discipline = d_disipline; @@ -2601,7 +2504,7 @@ spawn (void) jmode = d_jmode; jtc = d_jtc; #endif /* sony */ -#endif /* USE_SYSV_TERMIO or USE_POSIX_TERMIOS */ +#endif /* USE_ANY_SYSV_TERMIO or USE_POSIX_TERMIOS */ } else { SysError(ERROR_OPDEVTTY); } @@ -2621,13 +2524,13 @@ spawn (void) if(ioctl(tty, TIOCLGET, &lmode) == -1) lmode = d_lmode; #endif /* TIOCLSET */ -#ifdef USE_SYSV_TERMIO +#ifdef USE_ANY_SYSV_TERMIO if(ioctl(tty, TCGETA, &tio) == -1) tio = d_tio; #elif defined(USE_POSIX_TERMIOS) if (tcgetattr(tty, &tio) == -1) tio = d_tio; -#else /* !USE_SYSV_TERMIO && !USE_POSIX_TERMIOS */ +#else /* !USE_ANY_SYSV_TERMIO && !USE_POSIX_TERMIOS */ if(ioctl(tty, TIOCGETP, (char *)&sg) == -1) sg = d_sg; if(ioctl(tty, TIOCGETC, (char *)&tc) == -1) @@ -2640,17 +2543,17 @@ spawn (void) if(ioctl(tty, TIOCKGETC, (char *)&jtc) == -1) jtc = d_jtc; #endif /* sony */ -#endif /* USE_SYSV_TERMIO */ +#endif /* USE_ANY_SYSV_TERMIO */ #if OPT_INITIAL_ERASE if (resource.ptyInitialErase) { -#ifdef USE_SYSV_TERMIO +#ifdef USE_ANY_SYSV_TERMIO initial_erase = tio.c_cc[VERASE]; #elif defined(USE_POSIX_TERMIOS) initial_erase = tio.c_cc[VERASE]; -#else /* !USE_SYSV_TERMIO && !USE_POSIX_TERMIOS */ +#else /* !USE_ANY_SYSV_TERMIO && !USE_POSIX_TERMIOS */ initial_erase = sg.sg_erase; -#endif /* USE_SYSV_TERMIO */ +#endif /* USE_ANY_SYSV_TERMIO */ } TRACE(("%s @%d, ptyInitialErase:%d, backarrow_is_erase:%d, initial_erase:%d (from /dev/tty)\n", __FILE__, __LINE__, @@ -2681,7 +2584,7 @@ spawn (void) #if OPT_INITIAL_ERASE if (resource.ptyInitialErase) { -#ifdef USE_SYSV_TERMIO +#ifdef USE_ANY_SYSV_TERMIO struct termio my_tio; if(ioctl(screen->respond, TCGETA, &my_tio) == 0) initial_erase = my_tio.c_cc[VERASE]; @@ -2689,11 +2592,11 @@ spawn (void) struct termios my_tio; if (tcgetattr(screen->respond, &my_tio) == 0) initial_erase = my_tio.c_cc[VERASE]; -#else /* !USE_SYSV_TERMIO && !USE_POSIX_TERMIOS */ +#else /* !USE_ANY_SYSV_TERMIO && !USE_POSIX_TERMIOS */ struct sgttyb my_sg; if(ioctl(screen->respond, TIOCGETP, (char *)&my_sg) == 0) initial_erase = my_sg.sg_erase; -#endif /* USE_SYSV_TERMIO */ +#endif /* USE_ANY_SYSV_TERMIO */ } if (resource.backarrow_is_erase) if (initial_erase == 127) { /* see input.c */ @@ -3054,7 +2957,7 @@ spawn (void) * set up the tty modes */ { -#if defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS) +#if defined(USE_ANY_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS) #if defined(umips) || defined(CRAY) || defined(linux) /* If the control tty had its modes screwed around with, eg. by lineedit in the shell, or emacs, etc. then tio @@ -3236,7 +3139,7 @@ spawn (void) if (tcsetattr (tty, TCSANOW, &tio) == -1) HsSysError(cp_pipe[1], ERROR_TIOCSETP); #endif /* USE_POSIX_TERMIOS */ -#else /* USE_SYSV_TERMIO or USE_POSIX_TERMIOS */ +#else /* USE_ANY_SYSV_TERMIO or USE_POSIX_TERMIOS */ sg.sg_flags &= ~(ALLDELAY | XTABS | CBREAK | RAW); sg.sg_flags |= ECHO | CRMOD; /* make sure speed is set on pty so that editors work right*/ @@ -3290,7 +3193,7 @@ spawn (void) if (ioctl (tty, TIOCKSETC, (char *)&jtc) == -1) HsSysError (cp_pipe[1], ERROR_TIOCKSETC); #endif /* sony */ -#endif /* !USE_SYSV_TERMIO */ +#endif /* !USE_ANY_SYSV_TERMIO */ #if defined(TIOCCONS) || defined(SRIOCSREDIR) if (Console) { #ifdef TIOCCONS @@ -3331,7 +3234,7 @@ spawn (void) if (! resource.ptyInitialErase && !override_tty_modes && !ttymodelist[XTTYMODE_erase].set) { -#ifdef USE_SYSV_TERMIO +#ifdef USE_ANY_SYSV_TERMIO if(ioctl(tty, TCGETA, &tio) == -1) tio = d_tio; tio.c_cc[VERASE] = initial_erase; @@ -3341,12 +3244,12 @@ spawn (void) tio = d_tio; tio.c_cc[VERASE] = initial_erase; tcsetattr(tty, TCSANOW, &tio); -#else /* !USE_SYSV_TERMIO && !USE_POSIX_TERMIOS */ +#else /* !USE_ANY_SYSV_TERMIO && !USE_POSIX_TERMIOS */ if(ioctl(tty, TIOCGETP, (char *)&sg) == -1) sg = d_sg; sg.sg_erase = initial_erase; ioctl(tty, TIOCSETP, (char *)&sg); -#endif /* USE_SYSV_TERMIO */ +#endif /* USE_ANY_SYSV_TERMIO */ } #endif @@ -3769,11 +3672,11 @@ spawn (void) shname_minus = (char *)malloc(strlen(shname) + 2); (void) strcpy(shname_minus, "-"); (void) strcat(shname_minus, shname); -#if !defined(USE_SYSV_TERMIO) && !defined(USE_POSIX_TERMIOS) +#if !defined(USE_ANY_SYSV_TERMIO) && !defined(USE_POSIX_TERMIOS) ldisc = XStrCmp("csh", shname + strlen(shname) - 3) == 0 ? NTTYDISC : 0; ioctl(0, TIOCSETD, (char *)&ldisc); -#endif /* !USE_SYSV_TERMIO && !USE_POSIX_TERMIOS */ +#endif /* !USE_ANY_SYSV_TERMIO && !USE_POSIX_TERMIOS */ #ifdef USE_LOGIN_DASH_P if (term->misc.login_shell && pw && added_utmp_entry) @@ -4609,8 +4512,8 @@ int GetBytesAvailable (int fd) else return 0; #elif defined(MINIX) - /* The answer doesn't have to correct. Calling nbio_isinprogress is - * much cheaper than called nbio_select. + /* The answer doesn't have to be correct. Calling nbio_isinprogress() is + * much cheaper than nbio_select(). */ if (nbio_isinprogress(fd, ASIO_READ)) return 0; diff --git a/programs/xterm/menu.c b/programs/xterm/menu.c index 249e67493..c15215e69 100644 --- a/programs/xterm/menu.c +++ b/programs/xterm/menu.c @@ -1,5 +1,5 @@ /* $XConsortium: menu.c /main/66 1996/12/01 23:46:59 swick $ */ -/* $XFree86: xc/programs/xterm/menu.c,v 3.37 2000/09/22 10:42:07 alanh Exp $ */ +/* $XFree86: xc/programs/xterm/menu.c,v 3.38 2000/11/01 01:12:40 dawes Exp $ */ /* Copyright 1999-2000 by Thomas E. Dickey @@ -49,7 +49,7 @@ in this Software without prior written authorization from the X Consortium. */ -#include <ptyx.h> +#include <xterm.h> #include <data.h> #include <menu.h> #include <fontutils.h> @@ -71,12 +71,6 @@ in this Software without prior written authorization from the X Consortium. #include <stdio.h> #include <signal.h> -#ifdef MINIX -#include <X11/Xos.h> -#endif - -#include <xterm.h> - static void do_8bit_control PROTO_XT_CALLBACK_ARGS; static void do_allow132 PROTO_XT_CALLBACK_ARGS; static void do_allowsends PROTO_XT_CALLBACK_ARGS; diff --git a/programs/xterm/os2main.c b/programs/xterm/os2main.c index c21170d74..b1d4b0856 100644 --- a/programs/xterm/os2main.c +++ b/programs/xterm/os2main.c @@ -5,7 +5,7 @@ #ifndef lint static char *rid="$XConsortium: main.c,v 1.227.1.2 95/06/29 18:13:15 kaleb Exp $"; #endif /* lint */ -/* $XFree86: xc/programs/xterm/os2main.c,v 3.40 2000/09/22 10:42:08 alanh Exp $ */ +/* $XFree86: xc/programs/xterm/os2main.c,v 3.41 2000/11/01 01:12:41 dawes Exp $ */ /*********************************************************** @@ -71,8 +71,6 @@ SOFTWARE. #include <X11/StringDefs.h> #include <X11/Shell.h> - -#include <X11/Xos.h> #include <X11/cursorfont.h> #ifdef I18N #include <X11/Xlocale.h> @@ -90,21 +88,16 @@ SOFTWARE. #include <menu.h> #include <main.h> #include <xstrings.h> - -#include <sys/termio.h> +#include <xterm_io.h> int setpgrp(pid_t pid ,gid_t pgid) {} int chown(const char* fn, pid_t pid, gid_t gid) {} char *ttyname(int fd) { return "/dev/tty"; } -#include <sys/ioctl.h> #include <sys/stat.h> - #include <sys/param.h> /* for NOFILE */ - #include <stdio.h> #include <time.h> - #include <signal.h> static SIGNAL_T reapchild (int n); @@ -714,43 +707,6 @@ Atom wm_delete_window; #ifdef __EMX__ -#define XFREE86_PTY 0x76 - -#define XTY_TIOCSETA 0x48 -#define XTY_TIOCSETAW 0x49 -#define XTY_TIOCSETAF 0x4a -#define XTY_TIOCCONS 0x4d -#define XTY_TIOCSWINSZ 0x53 -#define XTY_ENADUP 0x5a -#define XTY_TRACE 0x5b -#define XTY_TIOCGETA 0x65 -#define XTY_TIOCGWINSZ 0x66 -#define PTMS_GETPTY 0x64 -#define PTMS_BUFSZ 14 -#ifndef NCCS -#define NCCS 11 -#endif - -#define TIOCSWINSZ 113 -#define TIOCGWINSZ 117 - -struct pt_termios -{ - unsigned short c_iflag; - unsigned short c_oflag; - unsigned short c_cflag; - unsigned short c_lflag; - unsigned char c_cc[NCCS]; - long _reserved_[4]; -}; - -struct winsize { - unsigned short ws_row; /* rows, in characters */ - unsigned short ws_col; /* columns, in characters */ - unsigned short ws_xpixel; /* horizontal size, pixels */ - unsigned short ws_ypixel; /* vertical size, pixels */ -}; - int ptioctl(int fd, int func, void* data) { APIRET rc; diff --git a/programs/xterm/resize.c b/programs/xterm/resize.c index de68085df..14c996e4a 100644 --- a/programs/xterm/resize.c +++ b/programs/xterm/resize.c @@ -1,6 +1,6 @@ /* * $XConsortium: resize.c,v 1.34 95/05/24 22:12:04 gildea Exp $ - * $XFree86: xc/programs/xterm/resize.c,v 3.42 2000/09/22 10:42:08 alanh Exp $ + * $XFree86: xc/programs/xterm/resize.c,v 3.43 2000/11/01 01:12:42 dawes Exp $ */ /* @@ -29,86 +29,30 @@ /* resize.c */ -#ifdef HAVE_CONFIG_H -#include <xtermcfg.h> - -#else - -#if defined(__EMX__) || defined(__CYGWIN__) || defined(SCO) || defined(sco) -#define USE_TERMCAP 1 -#endif - -#endif - -#include <X11/Xos.h> +#include <xterm.h> #include <stdio.h> #include <ctype.h> #include <xstrings.h> - -#if defined(att) -#define ATT -#endif - -#if defined(sgi) && defined(SVR4) -#undef SYSV -#undef SVR4 -#define SYSV -#endif - -#ifdef SVR4 -#undef SYSV /* predefined on Solaris 2.4 */ -#define SYSV -#define ATT -#endif - -#if (defined(ATT) && !defined(__sgi)) || (defined(SYSV) && defined(i386)) || (defined (__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1)) -#define USE_USG_PTYS -#endif +#include <xterm_io.h> #ifdef APOLLO_SR9 #define CANT_OPEN_DEV_TTY #endif -#if defined(__EMX__) || defined(__CYGWIN__) -#define USE_SYSV_TERMIO -#endif - -#ifdef macII -#define USE_SYSV_TERMIO -#undef SYSV /* pretend to be bsd */ -#endif /* macII */ - -#ifdef linux -#define USE_TERMIOS -#endif - -#ifdef __MVS__ -#define USE_TERMIOS -#endif - -#ifdef Lynx -#define USE_SYSV_TERMIO -#endif - #ifdef __OpenBSD__ #define USE_TERMINFO #include <term.h> #endif #ifndef USE_TERMINFO /* avoid conflict with configure script */ -#if defined(SCO) || defined(sco) || defined(linux) +#if defined(__QNX__) || defined(SCO) || defined(sco) || defined(linux) #define USE_TERMINFO #endif #endif -#if defined(SYSV) || defined(__CYGWIN__) -#define USE_SYSV_TERMIO -#elif defined(__QNX__) -#define USE_TERMINFO +#if defined(__QNX__) #include <unix.h> -#elif !defined(USE_TERMCAP) -#define USE_TERMCAP -#endif /* SYSV */ +#endif /* * Some OS's may want to use both, like SCO for example. We catch here anyone @@ -118,82 +62,31 @@ #define USE_TERMINFO #endif -#if defined(CSRG_BASED) -#define USE_TERMIOS -#endif - -#ifndef __CYGWIN__ -#include <sys/ioctl.h> -#endif - -#ifdef USE_SYSV_TERMIO -# ifndef Lynx -# include <sys/termio.h> -# else -# include <termio.h> -# endif -#else /* else not USE_SYSV_TERMIO */ -# ifdef USE_TERMIOS -# include <termios.h> -# else /* not USE_TERMIOS */ -# include <sgtty.h> -# endif /* USE_TERMIOS */ -#endif /* USE_SYSV_TERMIO */ - -#ifdef SYSV -#ifdef USE_USG_PTYS -#include <sys/stream.h> -#ifndef SVR4 -#include <sys/ptem.h> -#endif -#endif -#endif - #include <signal.h> #include <pwd.h> -#ifndef X_NOT_STDC_ENV -#include <stdlib.h> -#else -char *getenv(); -#endif - -#ifdef USE_SYSV_TERMIO #ifdef X_NOT_POSIX #if !defined(SYSV) && !defined(i386) extern struct passwd *getpwuid(); /* does ANYBODY need this? */ #endif /* SYSV && i386 */ #endif /* X_NOT_POSIX */ + +#ifndef bzero #define bzero(s, n) memset(s, 0, n) -#endif /* USE_SYSV_TERMIO */ +#endif #ifdef MINIX -#define USE_SYSV_TERMIO -#include <sys/termios.h> -#define termio termios -#define TCGETA TCGETS -#define TCSETAW TCSETSW #ifndef IUCLC #define IUCLC 0 #endif #endif -#ifndef DFT_TERMTYPE -#define DFT_TERMTYPE "xterm" -#endif - -#ifndef GCC_UNUSED -#define GCC_UNUSED /* nothing */ -#endif - #ifdef __MVS__ -#define ESC(string) "\047" string +#define ESCAPE(string) "\047" string #else -#define ESC(string) "\033" string +#define ESCAPE(string) "\033" string #endif -#define CharOf(ch) ((unsigned char)(ch)) - #define EMULATIONS 2 #define SUN 1 #define VT100 0 @@ -225,52 +118,49 @@ char *emuname[EMULATIONS] = { char *myname; int shell_type = SHELL_UNKNOWN; char *getsize[EMULATIONS] = { - ESC("7") ESC("[r") ESC("[999;999H") ESC("[6n"), - ESC("[18t"), + ESCAPE("7") ESCAPE("[r") ESCAPE("[999;999H") ESCAPE("[6n"), + ESCAPE("[18t"), }; -#if !defined(sun) || defined(SVR4) -#ifdef TIOCSWINSZ +#if defined(TIOCSSIZE) && (defined(sun) && !defined(SVR4)) +#elif defined(TIOCSWINSZ) char *getwsize[EMULATIONS] = { /* size in pixels */ 0, - ESC("[14t"), + ESCAPE("[14t"), }; -#endif /* TIOCSWINSZ */ -#endif /* sun */ +#endif /* sun vs TIOCSWINSZ */ char *restore[EMULATIONS] = { - ESC("8"), + ESCAPE("8"), 0, }; char *setname = ""; char *setsize[EMULATIONS] = { 0, - ESC("[8;%s;%st"), + ESCAPE("[8;%s;%st"), }; -#ifdef USE_SYSV_TERMIO + +#ifdef USE_ANY_SYSV_TERMIO struct termio tioorig; -#else /* not USE_SYSV_TERMIO */ -# ifdef USE_TERMIOS +#elif defined(USE_TERMIOS) struct termios tioorig; -# else /* not USE_TERMIOS */ +#else struct sgttyb sgorig; -# endif /* USE_TERMIOS */ -#endif /* USE_SYSV_TERMIO */ +#endif /* USE_ANY_SYSV_TERMIO/USE_TERMIOS */ + char *size[EMULATIONS] = { - ESC("[%d;%dR"), - ESC("[8;%d;%dt"), + ESCAPE("[%d;%dR"), + ESCAPE("[8;%d;%dt"), }; char sunname[] = "sunsize"; int tty; FILE *ttyfp; -#if !defined(sun) || defined(SVR4) -#ifdef TIOCSWINSZ + +#if defined(TIOCSSIZE) && (defined(sun) && !defined(SVR4)) +#elif defined(TIOCSWINSZ) char *wsize[EMULATIONS] = { 0, - ESC("[4;%hd;%hdt"), + ESCAPE("[4;%hd;%hdt"), }; -#endif /* TIOCSWINSZ */ -#endif /* sun */ - -#include <proto.h> +#endif /* sun vs TIOCSWINSZ */ static SIGNAL_T onintr (int sig); static SIGNAL_T resize_timeout (int sig); @@ -278,6 +168,8 @@ static int checkdigits (char *str); static void Usage (void); static void readstring (FILE *fp, char *buf, char *str); +#undef US /* may conflict with curses.h */ + #ifdef USE_TERMCAP #ifdef HAVE_TERMCAP_H #include <termcap.h> @@ -311,30 +203,24 @@ main (int argc, char **argv) struct passwd *pw; int i; int rows, cols; -#ifdef USE_SYSV_TERMIO +#ifdef USE_ANY_SYSV_TERMIO struct termio tio; -#else /* not USE_SYSV_TERMIO */ -#ifdef USE_TERMIOS +#elif defined(USE_TERMIOS) struct termios tio; -#else /* not USE_TERMIOS */ +#else struct sgttyb sg; -#endif /* USE_TERMIOS */ -#endif /* USE_SYSV_TERMIO */ +#endif /* USE_ANY_SYSV_TERMIO/USE_TERMIOS */ #ifdef USE_TERMCAP int ok_tcap = 1; char termcap [TERMCAP_SIZE]; char newtc [TERMCAP_SIZE]; #endif /* USE_TERMCAP */ char buf[BUFSIZ]; -#if defined(sun) && !defined(SVR4) -#ifdef TIOCSSIZE +#if defined(TIOCSSIZE) && (defined(sun) && !defined(SVR4)) struct ttysize ts; -#endif /* TIOCSSIZE */ -#else /* sun */ -#ifdef TIOCSWINSZ +#elif defined(TIOCSWINSZ) struct winsize ws; -#endif /* TIOCSWINSZ */ -#endif /* sun */ +#endif /* sun vs TIOCSWINSZ */ char *name_of_tty; #ifdef CANT_OPEN_DEV_TTY extern char *ttyname(); @@ -424,7 +310,7 @@ main (int argc, char **argv) } #endif /* USE_TERMINFO */ -#ifdef USE_SYSV_TERMIO +#ifdef USE_ANY_SYSV_TERMIO ioctl (tty, TCGETA, &tioorig); tio = tioorig; tio.c_iflag &= ~(ICRNL | IUCLC); @@ -432,8 +318,7 @@ main (int argc, char **argv) tio.c_cflag |= CS8; tio.c_cc[VMIN] = 6; tio.c_cc[VTIME] = 1; -#else /* else not USE_SYSV_TERMIO */ -#if defined(USE_TERMIOS) +#elif defined(USE_TERMIOS) tcgetattr(tty, &tioorig); tio = tioorig; tio.c_iflag &= ~ICRNL; @@ -446,20 +331,17 @@ main (int argc, char **argv) sg = sgorig; sg.sg_flags |= RAW; sg.sg_flags &= ~ECHO; -#endif /* USE_TERMIOS */ -#endif /* USE_SYSV_TERMIO */ +#endif /* USE_ANY_SYSV_TERMIO/USE_TERMIOS */ signal(SIGINT, onintr); signal(SIGQUIT, onintr); signal(SIGTERM, onintr); -#ifdef USE_SYSV_TERMIO +#ifdef USE_ANY_SYSV_TERMIO ioctl (tty, TCSETAW, &tio); -#else /* not USE_SYSV_TERMIO */ -#ifdef USE_TERMIOS +#elif defined(USE_TERMIOS) tcsetattr(tty, TCSADRAIN, &tio); #else /* not USE_TERMIOS */ ioctl (tty, TIOCSETP, &sg); -#endif /* USE_TERMIOS */ -#endif /* USE_SYSV_TERMIO */ +#endif /* USE_ANY_SYSV_TERMIO/USE_TERMIOS */ if (argc == 2) { sprintf (buf, setsize[emu], argv[0], argv[1]); @@ -473,17 +355,14 @@ main (int argc, char **argv) } if(restore[emu]) write(tty, restore[emu], strlen(restore[emu])); -#if defined(sun) && !defined(SVR4) -#ifdef TIOCGSIZE +#if defined(TIOCSSIZE) && (defined(sun) && !defined(SVR4)) /* finally, set the tty's window size */ if (ioctl (tty, TIOCGSIZE, &ts) != -1) { ts.ts_lines = rows; ts.ts_cols = cols; ioctl (tty, TIOCSSIZE, &ts); } -#endif /* TIOCGSIZE */ -#else /* sun */ -#ifdef TIOCGWINSZ +#elif defined(TIOCSWINSZ) /* finally, set the tty's window size */ if(getwsize[emu]) { /* get the window size in pixels */ @@ -509,18 +388,15 @@ main (int argc, char **argv) ws.ws_col = cols; ioctl (tty, TIOCSWINSZ, &ws); } -#endif /* TIOCGWINSZ */ -#endif /* sun */ +#endif /* sun vs TIOCSWINSZ */ -#ifdef USE_SYSV_TERMIO +#ifdef USE_ANY_SYSV_TERMIO ioctl (tty, TCSETAW, &tioorig); -#else /* not USE_SYSV_TERMIO */ -#ifdef USE_TERMIOS +#elif defined(USE_TERMIOS) tcsetattr(tty, TCSADRAIN, &tioorig); #else /* not USE_TERMIOS */ ioctl (tty, TIOCSETP, &sgorig); -#endif /* USE_TERMIOS */ -#endif /* USE_SYSV_TERMIO */ +#endif /* USE_ANY_SYSV_TERMIO/USE_TERMIOS */ signal(SIGINT, SIG_DFL); signal(SIGQUIT, SIG_DFL); signal(SIGTERM, SIG_DFL); @@ -610,7 +486,7 @@ readstring(register FILE *fp, register char *buf, char *str) setitimer(ITIMER_REAL, &it, (struct itimerval *)NULL); #endif if ((c = getc(fp)) == 0233) { /* meta-escape, CSI */ - *buf++ = c = ESC("")[0]; + *buf++ = c = ESCAPE("")[0]; *buf++ = '['; } else { *buf++ = c; @@ -651,14 +527,12 @@ resize_timeout(int sig) static SIGNAL_T onintr(int sig GCC_UNUSED) { -#ifdef USE_SYSV_TERMIO +#ifdef USE_ANY_SYSV_TERMIO ioctl (tty, TCSETAW, &tioorig); -#else /* not USE_SYSV_TERMIO */ -#ifdef USE_TERMIOS +#elif defined(USE_TERMIOS) tcsetattr (tty, TCSADRAIN, &tioorig); #else /* not USE_TERMIOS */ ioctl (tty, TIOCSETP, &sgorig); -#endif /* use TERMIOS */ -#endif /* USE_SYSV_TERMIO */ +#endif /* USE_ANY_SYSV_TERMIO/USE_TERMIOS */ exit(1); } diff --git a/programs/xterm/screen.c b/programs/xterm/screen.c index 1a18ac221..5b51f5370 100644 --- a/programs/xterm/screen.c +++ b/programs/xterm/screen.c @@ -54,7 +54,7 @@ * SOFTWARE. */ -/* $XFree86: xc/programs/xterm/screen.c,v 3.51 2000/08/25 21:51:13 dawes Exp $ */ +/* $XFree86: xc/programs/xterm/screen.c,v 3.52 2000/09/22 10:42:08 alanh Exp $ */ /* screen.c */ @@ -63,64 +63,10 @@ #include <error.h> #include <data.h> #include <xcharmouse.h> +#include <xterm_io.h> #include <signal.h> -#ifdef SVR4 -#include <termios.h> -#elif !defined(__CYGWIN__) -#include <sys/ioctl.h> -#endif - -#if defined(__CYGWIN__) && !defined(TIOCSPGRP) -#include <termios.h> -#define TIOCSPGRP (_IOW('t', 118, pid_t)) -#endif - -#ifdef __hpux -#include <sys/termio.h> -#endif - -#ifdef SYSV -#if !defined(DGUX) /* Intel DG/ux uses termios.h */ -#include <sys/termio.h> -#endif /* DGUX */ -#ifdef USE_USG_PTYS -#include <sys/stream.h> /* get typedef used in ptem.h */ -#include <sys/ptem.h> -#endif -#elif defined(sun) && !defined(SVR4) -#include <sys/ttycom.h> -#ifdef TIOCSWINSZ -#undef TIOCSSIZE -#endif -#endif - -#ifdef MINIX -#include <termios.h> -#endif - -#ifdef ISC -#ifndef SYSV -#include <sys/termio.h> -#endif -#define TIOCGPGRP TCGETPGRP -#define TIOCSPGRP TCSETPGRP -#endif - -#ifdef __EMX__ -extern int ptioctl(int fd, int func, void* data); -#define ioctl ptioctl -#define TIOCSWINSZ 113 -#define TIOCGWINSZ 117 -struct winsize { - unsigned short ws_row; /* rows, in characters */ - unsigned short ws_col; /* columns, in characters */ - unsigned short ws_xpixel; /* horizontal size, pixels */ - unsigned short ws_ypixel; /* vertical size, pixels */ -}; -#endif - /* * Allocates memory for a 2-dimensional array of chars and returns a pointer * thereto. Each line is formed from a set of char arrays, with an index diff --git a/programs/xterm/xterm.h b/programs/xterm/xterm.h index 40c5c9e47..a8fd29516 100644 --- a/programs/xterm/xterm.h +++ b/programs/xterm/xterm.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/xterm/xterm.h,v 3.64 2000/11/01 01:12:43 dawes Exp $ */ +/* $XFree86: xc/programs/xterm/xterm.h,v 3.65 2000/12/07 10:12:34 dickey Exp $ */ /************************************************************ @@ -88,6 +88,10 @@ authorization. #define HAVE_TCGETATTR 1 #endif +#if defined(__EMX__) || defined(__CYGWIN__) || defined(SCO) || defined(sco) +#define USE_TERMCAP 1 +#endif + #if defined(UTMP) #define HAVE_UTMP 1 #endif diff --git a/programs/xterm/xterm.log.html b/programs/xterm/xterm.log.html index 197fce560..829068561 100644 --- a/programs/xterm/xterm.log.html +++ b/programs/xterm/xterm.log.html @@ -196,6 +196,21 @@ xc/programs/Xserver/hw/xfree86). <H1><A NAME="xterm_149">Patch #149 - 2000/12/6 - XFree86 4.0.1h</A></H1> <ul> + <li>restructured includes for <code>termios.h</code>, + <code>termio.h</code> and related definitions for main.c, os2main.c, + screen.c and resize.c so they will share equivalent definitions in a + new header <code>xterm_io.h</code>. This is intended to solve some + problems mainly for HPUX which appear to arise from inconsistent + definitions for SIGWINCH- and HAS_LTCHARS-related symbols (reports + by Bruno Betro, Jeremie Petit and Clint Olsen). + + <li>improve usability of double-width fonts by allowing normal fonts + to be given as double-width (from a patch by Fabrice Bellard + <bellard@email.enst.fr>). + + <li>correct a few compiler warnings in TRACE() macros for + signed/unsigned variable differences (reported by Clint Olsen). + <li>expanded description of environment variables in manual-page. <li>modify OPT_TCAP_QUERY feature to always return the termcap or |