Index: xc/ChangeLog =================================================================== RCS file: /cvs/xorg/xc/ChangeLog,v retrieving revision 1.641 diff -u -2 -0 -r1.641 ChangeLog --- xc/ChangeLog 4 Jan 2005 22:05:09 -0000 1.641 +++ xc/ChangeLog 6 Jan 2005 00:30:09 -0000 @@ -1,20 +1,134 @@ +2005-01-05 Roland Mainz + * xc/programs/xterm/INSTALL + * xc/programs/xterm/MANIFEST + * xc/programs/xterm/Makefile.in + * xc/programs/xterm/Tekproc.c + * xc/programs/xterm/VTPrsTbl.c + * xc/programs/xterm/VTparse.def + * xc/programs/xterm/VTparse.h + * xc/programs/xterm/XTerm.ad + * xc/programs/xterm/aclocal.m4 + * xc/programs/xterm/button.c + * xc/programs/xterm/charclass.c + * xc/programs/xterm/charproc.c + * xc/programs/xterm/configure + * xc/programs/xterm/configure.in + * xc/programs/xterm/ctlseqs.ms + * xc/programs/xterm/cursor.c + * xc/programs/xterm/doublechr.c + * xc/programs/xterm/fontutils.c + * xc/programs/xterm/fontutils.h + * xc/programs/xterm/input.c + * xc/programs/xterm/main.c + * xc/programs/xterm/main.h + * xc/programs/xterm/menu.c + * xc/programs/xterm/menu.h + * xc/programs/xterm/misc.c + * xc/programs/xterm/os2main.c + * xc/programs/xterm/plink.sh + * xc/programs/xterm/precompose.c + * xc/programs/xterm/print.c + * xc/programs/xterm/ptyx.h + * xc/programs/xterm/resize.c + * xc/programs/xterm/screen.c + * xc/programs/xterm/scrollbar.c + * xc/programs/xterm/testxmc.c + * xc/programs/xterm/trace.c + * xc/programs/xterm/util.c + * xc/programs/xterm/uxterm + * xc/programs/xterm/version.h + * xc/programs/xterm/xstrings.c + * xc/programs/xterm/xterm.h + * xc/programs/xterm/xterm.log.html + * xc/programs/xterm/xterm.man + * xc/programs/xterm/xterm_io.h + * xc/programs/xterm/xtermcfg.hin + * xc/programs/xterm/unicode/README + * xc/programs/xterm/unicode/make-precompose.sh + * xc/programs/xterm/unicode/precompose.c.head + Bugzilla #1979 (https://bugs.freedesktop.org/show_bug.cgi?id=1979) + attachment #xxx (https://bugs.freedesktop.org/attachment.cgi?id=xxx): + Update xterm from version #196 to version #197: + - modify configure script to remove empty "-DPROJECTROOT=" + definition which resulted unusable values for luit's default path. + - update precompose.c based on Unicode 4.0.1 + - several minor fixes based on Intel compiler warnings. + - change default translations so a BtnDown which is not recognized + is simply ignored rather than emitting a bell. That makes it less + obtrusive when the user tries to use a mouse which provides more + capabilities than the X mouse driver supports, e.g., one with a + horizontal scroll wheel (Debian #265133). + - note in xterm's manpage that translations is not specific to xterm + (Debian #278897). + - modify uxterm script to use locale program to verify if the + derived locale is installed (Debian #246398). + - correct font handling for active icon when in UTF-8 mode (report + by Paolo Liberatore). + - make active-icon and toolbar configurations work together. + - modify the criteria for disowning primary selection. Previously, + this happened anytime the cursor was moved before the end of the + selection. That would ensure that any insert/delete of char or + line, as well as scrolling, would disown the selection. The new + criteria change this to checking if the operations would modify + the data which is highlighted (Debian #277832). + - reimplement DECALN with functions for vt420 rectangles, fixes + selection for this case. + - implement vt420 rectangle operations. + - add parsing, for debug/test of vt220 soft-fonts. + - add menu entry, actions and escape sequence to allow + enabling/disabling toolbars at runtime. + - improve rendering for Xft, allow it to draw non-linedrawing + characters such as "pi", which were drawn from internal tables + with patch #180 (Freedesktop.org Bugzilla #1260). + - add configure option --enable-mini-luit, ifdef'd the mini-luit + feature with OPT_MINI_LUIT. + - add mini-luit feature, which supports Latin9 directly rather than + via luit, provided that Unicode fonts are used (Freedesktop.org + Bugzilla #1571, request by Stefan Dirsch, patch by Michael + Schroeder). + - for Linux, if IUTF8 is defined, e.g., on recent 2.6.x kernels, set + the corresponding flag for the slave pty, to enable UTF-8 + interpretation of backspace in cooked mode (Freedesktop.org + Bugzilla #1578, request by Stefan Dirsch). + - modify faceSize resource to use a floating-point internal value + (adapted from patch by Sam Stephenson). + - correct handling selection of tabs over cleared space in UTF-8 + mode. In this special case, xterm represents the whitespace with a + null rather than a space character (Debian #276447). + - amend fix for infinite loop from patch #192 to check if there + is wrapped text to output in a following iteration (Debian + #273202). + - fixes ifdef'd with __INTERIX to allow building with Interix + (Windows Services for UNIX) 3.5 using the xlibs libraries from + freedesktop.org (patch by Min Sik Kim). + - amend solution for Debian #252873, #260471 from patch #194 by + making the cursor not explicitly colored if only the foreground + color is set, and the cursor is on a blank space (Debian #275473). + - correct logic for send/receive mode (SRM) with regard to control + characters. + - fix masking of invisible text in wide-character mode, which did + not work for line-drawing characters. + - incorporate CF_XOPEN_SOURCE into configure script, replacing + CF_GNU_SOURCE. + Patch by Thomas Dickey . + 2005-01-04 Roland Mainz * xc/programs/glxgears/glxgears.c Bugzilla #2220 (https://bugs.freedesktop.org/show_bug.cgi?id=2220) attachment #1630 (https://bugs.freedesktop.org/attachment.cgi?id=1630): Make glxgears a better GL client via calling |glFinish()| between frame swaps to avoid that the GL instruction queue gets spammed, sometimes even killing all interactive usage of the Xserver. 2005-01-04 Egbert Eich * config/cf/xorg.cf: - made structure of PPC64 part look more like the other structures. - added VBE driver to PPC64. I don't know if this really makes sense, but since we are building the int10 module we should also build the vbe module. - added i915 DRM driver to list of drivers for the AMD64 architecture. - added a check for gcc versions > 3 for setting GccAliasingFlags. Index: xc/programs/xterm/INSTALL =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/INSTALL,v retrieving revision 1.3 diff -u -2 -0 -r1.3 INSTALL --- xc/programs/xterm/INSTALL 13 Aug 2004 12:57:19 -0000 1.3 +++ xc/programs/xterm/INSTALL 6 Jan 2005 00:30:28 -0000 @@ -1,22 +1,22 @@ --- $XTermId: INSTALL,v 1.75 2004/05/13 00:41:20 tom Exp $ --- $XFree86: xc/programs/xterm/INSTALL,v 3.35 2004/05/13 00:41:20 dickey Exp $ +-- $XTermId: INSTALL,v 1.77 2004/12/01 01:27:46 tom Exp $ +-- $XFree86: xc/programs/xterm/INSTALL,v 3.36 2004/12/01 01:27:46 dickey Exp $ -- Thomas E. Dickey Xterm is normally built as part of the X Window System source tree, using imake to generate a Makefile from Imakefile. You can also use the configure script to generate a Makefile from Makefile.in: + If you have imake (or xmkmf), then you can use those directly, or use the configure script, which normally uses those tools to obtain the special definitions needed to build xterm. Ultimately, imake will not be necessary, since it is possible to add configure tests that derive the information that imake would supply. + You need the Athena widgets (or a clone, such as Xaw3d or neXtaw), to provide the popup menus. Even if you have imake, the configure script is still convenient because it allows you to build different configurations more easily than with imake, simply by specifying options to the configure script. @@ -270,40 +270,47 @@ --enable-logfile-exec enable exec'd logfile filter Compile-in code that allows logging piped via an external filter. --enable-logging enable logging Compile-in code that allows logging. Logging was disabled in X11R5 xterm because of security problems. They were addressed in X11R6, but the feature was not reinstated. --enable-luit enable support for luit filter (Unicode translation) Luit is a filter that can be run between an arbitrary application and a UTF-8 terminal emulator. It will convert application output from the locale's encoding into UTF-8, and convert terminal input from UTF-8 into the locale's encoding. This sets "--enable-wide-chars" as a side-effect. + --enable-mini-luit enable support for poor man's luit filter (Latin-9) + + Provide built-in support for Latin-9, relying on having specified + Unicode (ISO10646) fonts and setting the locale resource to "checkfont". + + This sets "--enable-luit" as a side-effect. + --enable-sco-fkeys enable support for SCO-style function keys Compile-in code to support SCO-style function keys. --enable-tcap-query enable termcap query/report Compile-in code to support experimental DCS '+' control sequence, which allows an application to ask xterm what control sequences it would transmit for specified function keys, given the termcap or terminfo names. --enable-toolbar enable pulldown menus on toolbar Compile-in code that builds a toolbar with pulldown menus. The normal popup menus are still available. --enable-trace test: set to enable debugging traces Compile-in code to trace xterm's internal states. Index: xc/programs/xterm/MANIFEST =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/MANIFEST,v retrieving revision 1.3 diff -u -2 -0 -r1.3 MANIFEST --- xc/programs/xterm/MANIFEST 20 Aug 2004 18:46:39 -0000 1.3 +++ xc/programs/xterm/MANIFEST 6 Jan 2005 00:30:28 -0000 @@ -1,21 +1,21 @@ -MANIFEST for xterm, version xterm-196 +MANIFEST for xterm, version xterm-197 -------------------------------------------------------------------------------- MANIFEST this file 256colres.h resource-definitions for 256-color mode 256colres.pl script to generate 256colres.h 88colres.h resource definitions for 88-color mode 88colres.pl script to generate 88colres.h AAA_README_VMS.txt note for VMS port of 'xterm' INSTALL configure script: options and related install instructions Imakefile imake template for Makefile Makefile.in configure script template for Makefile README overview & caveats for 'xterm' README.i18n i18n readme: README.os390 overview for os390 (EBCDIC) port of 'xterm' TekPrsTbl.c Tek4014 parser state tables Tekparse.def template for generating Tekparse.h Tekparse.h Tek4014 parser-state definitions Tekproc.c Tek4014 parser-state functions Tests Useful tests for xterm-developers UXTerm.ad alternate resources for UTF-8 VTPrsTbl.c VT100 parser state tables Index: xc/programs/xterm/Makefile.in =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/Makefile.in,v retrieving revision 1.3 diff -u -2 -0 -r1.3 Makefile.in --- xc/programs/xterm/Makefile.in 13 Aug 2004 12:57:19 -0000 1.3 +++ xc/programs/xterm/Makefile.in 6 Jan 2005 00:30:28 -0000 @@ -1,23 +1,23 @@ -## $XTermId: Makefile.in,v 1.111 2004/07/13 00:41:24 tom Exp $ +## $XTermId: Makefile.in,v 1.113 2004/12/01 01:27:46 tom Exp $ ## -## $XFree86: xc/programs/xterm/Makefile.in,v 3.48 2004/07/13 00:41:24 dickey Exp $ ## +## $XFree86: xc/programs/xterm/Makefile.in,v 3.49 2004/12/01 01:27:46 dickey Exp $ ## ## ## Copyright 2002-2003,2004 by Thomas E. Dickey ## ## All Rights Reserved ## ## Permission to use, copy, modify, and distribute this software and its ## documentation for any purpose and without fee is hereby granted, ## provided that the above copyright notice appear in all copies and that ## both that copyright notice and this permission notice appear in ## supporting documentation, and that the name of the above listed ## copyright holder(s) not be used in advertising or publicity pertaining ## to distribution of the software without specific, written prior ## permission. ## ## THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD ## TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY ## AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE ## LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ## WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ## ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF @@ -51,41 +51,41 @@ EXTRA_CPPFLAGS = @EXTRA_CPPFLAGS@ EXTRA_LOADFLAGS = @IMAKE_LOADFLAGS@ CPPFLAGS = -I. -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@ $(EXTRA_CPPFLAGS) CFLAGS = @CFLAGS@ $(EXTRA_CFLAGS) LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ prefix = @prefix@ exec_prefix = @exec_prefix@ manext = 1 bindir = @bindir@ libdir = @libdir@ mandir = @mandir@/man$(manext) appsdir = $(libdir)/X11/app-defaults #### End of system configuration section. #### RM = rm -f -LINT = lint +LINT = @LINT@ DESTDIR = BINDIR = $(DESTDIR)$(bindir) LIBDIR = $(DESTDIR)$(libdir) MANDIR = $(DESTDIR)$(mandir) APPSDIR = $(DESTDIR)$(appsdir) INSTALL_DIRS = $(BINDIR) $(APPSDIR) $(MANDIR) CLASS = XTerm EXTRAHDR = @EXTRAHDRS@ EXTRASRC = @EXTRASRCS@ EXTRAOBJ = @EXTRAOBJS@ SRCS1 = button.c charproc.c charsets.c cursor.c \ data.c doublechr.c fontutils.c input.c \ $(MAINSRC) menu.c misc.c print.c ptydata.c \ screen.c scrollbar.c tabs.c util.c xstrings.c \ VTPrsTbl.c $(EXTRASRC) OBJS1 = button$o charproc$o charsets$o cursor$o \ Index: xc/programs/xterm/Tekproc.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/Tekproc.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 Tekproc.c --- xc/programs/xterm/Tekproc.c 13 Aug 2004 12:57:19 -0000 1.3 +++ xc/programs/xterm/Tekproc.c 6 Jan 2005 00:30:30 -0000 @@ -1,28 +1,28 @@ -/* $XTermId: Tekproc.c,v 1.105 2004/06/06 22:15:25 tom Exp $ */ +/* $XTermId: Tekproc.c,v 1.109 2004/12/01 01:27:46 tom Exp $ */ /* * $Xorg: Tekproc.c,v 1.5 2001/02/09 02:06:02 xorgcvs Exp $ * * Warning, there be crufty dragons here. */ -/* $XFree86: xc/programs/xterm/Tekproc.c,v 3.49 2004/06/06 22:15:25 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/Tekproc.c,v 3.50 2004/12/01 01:27:46 dickey Exp $ */ /* Copyright 2001-2003,2004 by Thomas E. Dickey All Rights Reserved Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF @@ -215,127 +215,128 @@ { "set-reverse-video", HandleReverseVideo }, { "set-autowrap", HandleAutoWrap }, { "set-reversewrap", HandleReverseWrap }, { "set-autolinefeed", HandleAutoLineFeed }, { "set-appcursor", HandleAppCursor }, { "set-appkeypad", HandleAppKeypad }, { "set-scroll-on-key", HandleScrollKey }, { "set-scroll-on-tty-output", HandleScrollTtyOutput }, { "set-allow132", HandleAllow132 }, { "set-cursesemul", HandleCursesEmul }, { "set-marginbell", HandleMarginBell }, { "set-altscreen", HandleAltScreen }, { "soft-reset", HandleSoftReset }, { "hard-reset", HandleHardReset }, { "set-terminal-type", HandleSetTerminalType }, { "set-visibility", HandleVisibility }, { "set-tek-text", HandleSetTekText }, { "tek-page", HandleTekPage }, { "tek-reset", HandleTekReset }, { "tek-copy", HandleTekCopy }, +#if OPT_TOOLBAR + { "set-toolbar", HandleToolbar }, +#endif }; /* *INDENT-ON* */ static Dimension defOne = 1; #define GIN_TERM_NONE_STR "none" #define GIN_TERM_CR_STR "CRonly" #define GIN_TERM_EOT_STR "CR&EOT" #define GIN_TERM_NONE 0 #define GIN_TERM_CR 1 #define GIN_TERM_EOT 2 #ifdef VMS #define DFT_FONT_SMALL "FIXED" #else #define DFT_FONT_SMALL "6x10" #endif static XtResource resources[] = { {XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension), XtOffsetOf(CoreRec, core.width), XtRDimension, (caddr_t) & defOne}, {XtNheight, XtCHeight, XtRDimension, sizeof(Dimension), XtOffsetOf(CoreRec, core.height), XtRDimension, (caddr_t) & defOne}, Fres("fontLarge", XtCFont, tek.Tfont[TEK_FONT_LARGE], "9x15"), Fres("font2", XtCFont, tek.Tfont[TEK_FONT_2], "6x13"), Fres("font3", XtCFont, tek.Tfont[TEK_FONT_3], "8x13"), Fres("fontSmall", XtCFont, tek.Tfont[TEK_FONT_SMALL], DFT_FONT_SMALL), Sres("initialFont", "InitialFont", tek.initial_font, "large"), Sres("ginTerminator", "GinTerminator", tek.gin_terminator_str, GIN_TERM_NONE_STR), #if OPT_TOOLBAR - {XtNmenuBar, XtCMenuBar, XtRWidget, sizeof(Widget), - XtOffsetOf(TekWidgetRec, tek.menu_bar), - XtRWidget, (XtPointer) 0}, - Ires(XtNmenuHeight, XtCMenuHeight, tek.menu_height, 25), + Wres(XtNmenuBar, XtCMenuBar, tek.tb_info.menu_bar, 0), + Ires(XtNmenuHeight, XtCMenuHeight, tek.tb_info.menu_height, 25), #endif }; static IChar Tinput(void); static int getpoint(void); static void TCursorBack(void); static void TCursorDown(void); static void TCursorForward(void); static void TCursorUp(void); static void TekBackground(TScreen * screen); static void TekConfigure(Widget w); static void TekDraw(int x, int y); static void TekEnq(int status, int x, int y); static void TekFlush(void); static void TekInitialize(Widget request, Widget wnew, ArgList args, - Cardinal * num_args); + Cardinal *num_args); static void TekPage(void); static void TekRealize(Widget gw, XtValueMask * valuemaskp, XSetWindowAttributes * values); static WidgetClassRec tekClassRec = { { /* core_class fields */ (WidgetClass) & widgetClassRec, /* superclass */ "Tek4014", /* class_name */ sizeof(TekWidgetRec), /* widget_size */ NULL, /* class_initialize */ NULL, /* class_part_initialize */ FALSE, /* class_inited */ TekInitialize, /* initialize */ NULL, /* initialize_hook */ TekRealize, /* realize */ actionsList, /* actions */ XtNumber(actionsList), /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ TRUE, /* compress_exposure */ TRUE, /* compress_enterleave */ FALSE, /* visible_interest */ NULL, /* destroy */ TekConfigure, /* resize */ TekExpose, /* expose */ NULL, /* set_values */ NULL, /* set_values_hook */ - NULL, /* set_values_almost */ + XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback_offsets */ defaultTranslations, /* tm_table */ XtInheritQueryGeometry, /* query_geometry */ XtInheritDisplayAccelerator, /* display_accelerator */ NULL /* extension */ } }; #define tekWidgetClass ((WidgetClass)&tekClassRec) static Boolean Tfailed = FALSE; int TekInit(void) { Widget form_top, menu_top; if (!Tfailed @@ -1263,41 +1264,41 @@ {4, 4}; static unsigned char long_dashed[LONG_DASHED_LENGTH] = {4, 7}; static unsigned char *dashes[TEKNUMLINES] = { dotted, dot_dashed, short_dashed, long_dashed, }; /* * The following is called to create the tekWidget */ static void TekInitialize(Widget request GCC_UNUSED, Widget wnew GCC_UNUSED, ArgList args GCC_UNUSED, - Cardinal * num_args GCC_UNUSED) + Cardinal *num_args GCC_UNUSED) { Widget tekparent = SHELL_OF(wnew); TRACE(("TekInitialize\n")); /* look for focus related events on the shell, because we need * to care about the shell's border being part of our focus. */ XtAddEventHandler(tekparent, EnterWindowMask, FALSE, HandleEnterWindow, (caddr_t) NULL); XtAddEventHandler(tekparent, LeaveWindowMask, FALSE, HandleLeaveWindow, (caddr_t) NULL); XtAddEventHandler(tekparent, FocusChangeMask, FALSE, HandleFocusChange, (caddr_t) NULL); XtAddEventHandler((Widget) wnew, PropertyChangeMask, FALSE, HandleBellPropertyChange, (Opaque) NULL); } static void TekRealize(Widget gw, @@ -1732,31 +1733,31 @@ TekLink *Tp; char buf[32]; char initbuf[5]; int tekcopyfd; timestamp_filename(buf, "COPY"); if (access(buf, F_OK) >= 0 && access(buf, W_OK) < 0) { Bell(XkbBI_MinorError, 0); return; } #ifndef VMS if (access(".", W_OK) < 0) { /* can't write in directory */ Bell(XkbBI_MinorError, 0); return; } #endif if ((tekcopyfd = open_userfile(screen->uid, screen->gid, buf, False)) >= 0) { sprintf(initbuf, "%c%c%c%c", - ESC, screen->page.fontsize + '8', - ESC, screen->page.linetype + '`'); + ESC, (char)(screen->page.fontsize + '8'), + ESC, (char)(screen->page.linetype + '`')); write(tekcopyfd, initbuf, 4); Tp = &Tek0; do { write(tekcopyfd, (char *) Tp->data, Tp->count); Tp = Tp->next; } while (Tp); close(tekcopyfd); } } Index: xc/programs/xterm/VTPrsTbl.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/VTPrsTbl.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 VTPrsTbl.c --- xc/programs/xterm/VTPrsTbl.c 13 Aug 2004 12:57:19 -0000 1.3 +++ xc/programs/xterm/VTPrsTbl.c 6 Jan 2005 00:30:30 -0000 @@ -1,27 +1,27 @@ -/* $XTermId: VTPrsTbl.c,v 1.36 2004/05/13 00:41:20 tom Exp $ */ +/* $XTermId: VTPrsTbl.c,v 1.39 2004/12/01 01:27:46 tom Exp $ */ /* * $Xorg: VTPrsTbl.c,v 1.3 2000/08/17 19:55:07 cpqbld Exp $ */ -/* $XFree86: xc/programs/xterm/VTPrsTbl.c,v 3.26 2004/05/13 00:41:20 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/VTPrsTbl.c,v 3.27 2004/12/01 01:27:46 dickey Exp $ */ /* * * Copyright 1999-2000,2004 by Thomas E. Dickey * * All Rights Reserved * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -754,48 +754,48 @@ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* CAN EM SUB ESC */ CASE_GROUND_STATE, CASE_IGNORE, CASE_GROUND_STATE, CASE_ESC, /* FS GS RS US */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* SP ! " # */ CASE_CSI_IGNORE, CASE_CSI_EX_STATE, CASE_CSI_QUOTE_STATE, CASE_CSI_IGNORE, /* $ % & ' */ -CASE_CSI_IGNORE, +CASE_CSI_DOLLAR_STATE, CASE_CSI_IGNORE, CASE_CSI_IGNORE, CASE_CSI_TICK_STATE, /* ( ) * + */ CASE_CSI_IGNORE, CASE_CSI_IGNORE, -CASE_CSI_IGNORE, +CASE_CSI_STAR_STATE, CASE_CSI_IGNORE, /* , - . / */ CASE_CSI_IGNORE, CASE_CSI_IGNORE, CASE_CSI_IGNORE, CASE_CSI_IGNORE, /* 0 1 2 3 */ CASE_ESC_DIGIT, CASE_ESC_DIGIT, CASE_ESC_DIGIT, CASE_ESC_DIGIT, /* 4 5 6 7 */ CASE_ESC_DIGIT, CASE_ESC_DIGIT, CASE_ESC_DIGIT, CASE_ESC_DIGIT, /* 8 9 : ; */ CASE_ESC_DIGIT, CASE_ESC_DIGIT, CASE_CSI_IGNORE, @@ -2004,40 +2004,690 @@ CASE_GROUND_STATE, CASE_GROUND_STATE, /* ocircumflex otilde odiaeresis division */ CASE_GROUND_STATE, CASE_GROUND_STATE, CASE_GROUND_STATE, CASE_DECEFR, /* oslash ugrave uacute ucircumflex */ CASE_GROUND_STATE, CASE_GROUND_STATE, CASE_DECELR, CASE_DECSLE, /* udiaeresis yacute thorn ydiaeresis */ CASE_DECRQLP, CASE_GROUND_STATE, CASE_GROUND_STATE, CASE_IGNORE, }; #endif /* OPT_DEC_LOCATOR */ +#if OPT_DEC_RECTOPS +Const PARSE_T csi_dollar_table[] = /* CSI ... $ */ +{ +/* NUL SOH STX ETX */ +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +/* EOT ENQ ACK BEL */ +CASE_IGNORE, +CASE_ENQ, +CASE_IGNORE, +CASE_BELL, +/* BS HT NL VT */ +CASE_BS, +CASE_TAB, +CASE_VMOT, +CASE_VMOT, +/* NP CR SO SI */ +CASE_VMOT, +CASE_CR, +CASE_SO, +CASE_SI, +/* DLE DC1 DC2 DC3 */ +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +/* DC4 NAK SYN ETB */ +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +/* CAN EM SUB ESC */ +CASE_GROUND_STATE, +CASE_IGNORE, +CASE_GROUND_STATE, +CASE_ESC, +/* FS GS RS US */ +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +/* SP ! " # */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* $ % & ' */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* ( ) * + */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* , - . / */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* 0 1 2 3 */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* 4 5 6 7 */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* 8 9 : ; */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* < = > ? */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* @ A B C */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* D E F G */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* H I J K */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* L M N O */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* P Q R S */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* T U V W */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* X Y Z [ */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* \ ] ^ _ */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* ` a b c */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* d e f g */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* h i j k */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* l m n o */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* p q r s */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_DECCARA, +CASE_GROUND_STATE, +/* t u v w */ +CASE_DECRARA, +CASE_GROUND_STATE, +CASE_DECCRA, +CASE_GROUND_STATE, +/* x y z { */ +CASE_DECFRA, +CASE_GROUND_STATE, +CASE_DECERA, +CASE_DECSERA, +/* | } ~ DEL */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_IGNORE, +/* 0x80 0x81 0x82 0x83 */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* 0x84 0x85 0x86 0x87 */ +CASE_IND, +CASE_NEL, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* 0x88 0x89 0x8a 0x8b */ +CASE_HTS, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* 0x8c 0x8d 0x8e 0x8f */ +CASE_GROUND_STATE, +CASE_RI, +CASE_SS2, +CASE_SS3, +/* 0x90 0x91 0x92 0x93 */ +CASE_DCS, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* 0x94 0x95 0x96 0x97 */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_SPA, +CASE_EPA, +/* 0x98 0x99 0x9a 0x9b */ +CASE_SOS, +CASE_GROUND_STATE, +CASE_DECID, +CASE_CSI_STATE, +/* 0x9c 0x9d 0x9e 0x9f */ +CASE_ST, +CASE_OSC, +CASE_PM, +CASE_APC, +/* nobreakspace exclamdown cent sterling */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* currency yen brokenbar section */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* diaeresis copyright ordfeminine guillemotleft */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* notsign hyphen registered macron */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* degree plusminus twosuperior threesuperior */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* acute mu paragraph periodcentered */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* cedilla onesuperior masculine guillemotright */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* onequarter onehalf threequarters questiondown */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* Agrave Aacute Acircumflex Atilde */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Adiaeresis Aring AE Ccedilla */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Egrave Eacute Ecircumflex Ediaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Igrave Iacute Icircumflex Idiaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Eth Ntilde Ograve Oacute */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Ocircumflex Otilde Odiaeresis multiply */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Ooblique Ugrave Uacute Ucircumflex */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Udiaeresis Yacute Thorn ssharp */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* agrave aacute acircumflex atilde */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* adiaeresis aring ae ccedilla */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* egrave eacute ecircumflex ediaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* igrave iacute icircumflex idiaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* eth ntilde ograve oacute */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_DECCARA, +CASE_GROUND_STATE, +/* ocircumflex otilde odiaeresis division */ +CASE_DECRARA, +CASE_GROUND_STATE, +CASE_DECCRA, +CASE_GROUND_STATE, +/* oslash ugrave uacute ucircumflex */ +CASE_DECFRA, +CASE_GROUND_STATE, +CASE_DECERA, +CASE_DECSERA, +/* udiaeresis yacute thorn ydiaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +}; + +Const PARSE_T csi_star_table[] = /* CSI ... * */ +{ +/* NUL SOH STX ETX */ +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +/* EOT ENQ ACK BEL */ +CASE_IGNORE, +CASE_ENQ, +CASE_IGNORE, +CASE_BELL, +/* BS HT NL VT */ +CASE_BS, +CASE_TAB, +CASE_VMOT, +CASE_VMOT, +/* NP CR SO SI */ +CASE_VMOT, +CASE_CR, +CASE_SO, +CASE_SI, +/* DLE DC1 DC2 DC3 */ +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +/* DC4 NAK SYN ETB */ +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +/* CAN EM SUB ESC */ +CASE_GROUND_STATE, +CASE_IGNORE, +CASE_GROUND_STATE, +CASE_ESC, +/* FS GS RS US */ +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +CASE_IGNORE, +/* SP ! " # */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* $ % & ' */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* ( ) * + */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* , - . / */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* 0 1 2 3 */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* 4 5 6 7 */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* 8 9 : ; */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* < = > ? */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* @ A B C */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* D E F G */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* H I J K */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* L M N O */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* P Q R S */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* T U V W */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* X Y Z [ */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* \ ] ^ _ */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* ` a b c */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* d e f g */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* h i j k */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* l m n o */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* p q r s */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* t u v w */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* x y z { */ +CASE_DECSACE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* | } ~ DEL */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_IGNORE, +/* 0x80 0x81 0x82 0x83 */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* 0x84 0x85 0x86 0x87 */ +CASE_IND, +CASE_NEL, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* 0x88 0x89 0x8a 0x8b */ +CASE_HTS, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* 0x8c 0x8d 0x8e 0x8f */ +CASE_GROUND_STATE, +CASE_RI, +CASE_SS2, +CASE_SS3, +/* 0x90 0x91 0x92 0x93 */ +CASE_DCS, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* 0x94 0x95 0x96 0x97 */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_SPA, +CASE_EPA, +/* 0x98 0x99 0x9a 0x9b */ +CASE_SOS, +CASE_GROUND_STATE, +CASE_DECID, +CASE_CSI_STATE, +/* 0x9c 0x9d 0x9e 0x9f */ +CASE_ST, +CASE_OSC, +CASE_PM, +CASE_APC, +/* nobreakspace exclamdown cent sterling */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* currency yen brokenbar section */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* diaeresis copyright ordfeminine guillemotleft */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* notsign hyphen registered macron */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* degree plusminus twosuperior threesuperior */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* acute mu paragraph periodcentered */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* cedilla onesuperior masculine guillemotright */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* onequarter onehalf threequarters questiondown */ +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +CASE_CSI_IGNORE, +/* Agrave Aacute Acircumflex Atilde */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Adiaeresis Aring AE Ccedilla */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Egrave Eacute Ecircumflex Ediaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Igrave Iacute Icircumflex Idiaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Eth Ntilde Ograve Oacute */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Ocircumflex Otilde Odiaeresis multiply */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Ooblique Ugrave Uacute Ucircumflex */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* Udiaeresis Yacute Thorn ssharp */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* agrave aacute acircumflex atilde */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* adiaeresis aring ae ccedilla */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* egrave eacute ecircumflex ediaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* igrave iacute icircumflex idiaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* eth ntilde ograve oacute */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* ocircumflex otilde odiaeresis division */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* oslash ugrave uacute ucircumflex */ +CASE_DECSACE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +/* udiaeresis yacute thorn ydiaeresis */ +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +CASE_GROUND_STATE, +}; +#endif /* OPT_DEC_RECTOPS */ + Const PARSE_T dec_table[] = /* CSI ? */ { /* NUL SOH STX ETX */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* EOT ENQ ACK BEL */ CASE_IGNORE, CASE_ENQ, CASE_IGNORE, CASE_BELL, /* BS HT NL VT */ CASE_BS, CASE_TAB, CASE_VMOT, CASE_VMOT, /* NP CR SO SI */ CASE_VMOT, CASE_CR, Index: xc/programs/xterm/VTparse.def =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/VTparse.def,v retrieving revision 1.3 diff -u -2 -0 -r1.3 VTparse.def --- xc/programs/xterm/VTparse.def 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/VTparse.def 6 Jan 2005 00:30:30 -0000 @@ -1,28 +1,29 @@ +# $XTermId: VTparse.def,v 1.22 2004/12/01 01:27:46 tom Exp $ # # $Xorg: VTparse.def,v 1.3 2000/08/17 19:55:08 cpqbld Exp $ # -# List of symbols that need to be defined for VTparse.h. If you need to +# List of symbols that need to be defined for VTparse.h. If you need to # change any of the CASE_ macros, make the change here and rerun the command # shown in VTparse.h. # -# $XFree86: xc/programs/xterm/VTparse.def,v 3.14 2003/12/31 17:12:26 dickey Exp $ +# $XFree86: xc/programs/xterm/VTparse.def,v 3.15 2004/12/01 01:27:46 dickey Exp $ # CASE_GROUND_STATE CASE_IGNORE CASE_BELL CASE_BS CASE_CR CASE_ESC CASE_VMOT CASE_TAB CASE_SI CASE_SO CASE_SCR_STATE CASE_SCS0_STATE CASE_SCS1_STATE CASE_SCS2_STATE CASE_SCS3_STATE CASE_ESC_IGNORE CASE_ESC_DIGIT CASE_ESC_SEMI @@ -113,20 +114,29 @@ CASE_DEC3_STATE CASE_DECRPTUI CASE_VT52_CUP CASE_REP CASE_CSI_EX_STATE CASE_DECSTR CASE_DECDHL CASE_DECSWL CASE_DECDWL CASE_DEC_MC CASE_ESC_PERCENT CASE_UTF8 CASE_CSI_TICK_STATE CASE_DECELR CASE_DECRQLP CASE_DECEFR CASE_DECSLE CASE_CSI_IGNORE CASE_VT52_IGNORE CASE_VT52_FINISH +CASE_CSI_DOLLAR_STATE +CASE_DECCRA +CASE_DECERA +CASE_DECFRA +CASE_DECSERA +CASE_DECSACE +CASE_DECCARA +CASE_DECRARA +CASE_CSI_STAR_STATE Index: xc/programs/xterm/VTparse.h =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/VTparse.h,v retrieving revision 1.3 diff -u -2 -0 -r1.3 VTparse.h --- xc/programs/xterm/VTparse.h 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/VTparse.h 6 Jan 2005 00:30:31 -0000 @@ -1,27 +1,29 @@ +/* $XTermId: VTparse.h,v 1.33 2004/12/01 01:27:46 tom Exp $ */ + /* * $Xorg: VTparse.h,v 1.3 2000/08/17 19:55:08 cpqbld Exp $ */ -/* $XFree86: xc/programs/xterm/VTparse.h,v 3.19 2003/12/31 17:12:26 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/VTparse.h,v 3.20 2004/12/01 01:27:46 dickey Exp $ */ /* - * Copyright 2002 by Thomas E. Dickey + * Copyright 2002-2003,2004 by Thomas E. Dickey * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appear in all copies and that * both that copyright notice and this permission notice appear in * supporting documentation, and that the name of the above listed * copyright holder(s) not be used in advertising or publicity pertaining * to distribution of the software without specific, written prior * permission. * * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * @@ -46,61 +48,67 @@ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ #ifndef included_VTparse_h #define included_VTparse_h 1 #include #ifndef Const # if defined(__STDC__) && !defined(__cplusplus) # define Const const # else # define Const /**/ # endif #endif /* * PARSE_T has to be large enough to handle the number of cases enumerated here. */ -typedef char PARSE_T; +typedef unsigned char PARSE_T; extern Const PARSE_T ansi_table[]; +extern Const PARSE_T cigtable[]; +extern Const PARSE_T csi2_table[]; extern Const PARSE_T csi_ex_table[]; extern Const PARSE_T csi_quo_table[]; -#if OPT_DEC_LOCATOR -extern Const PARSE_T csi_tick_table[]; -#endif /* OPT_DEC_LOCATOR */ extern Const PARSE_T csi_table[]; -extern Const PARSE_T csi2_table[]; extern Const PARSE_T dec2_table[]; extern Const PARSE_T dec3_table[]; extern Const PARSE_T dec_table[]; -extern Const PARSE_T cigtable[]; extern Const PARSE_T eigtable[]; extern Const PARSE_T esc_sp_table[]; extern Const PARSE_T esc_table[]; extern Const PARSE_T scrtable[]; extern Const PARSE_T scstable[]; extern Const PARSE_T sos_table[]; +#if OPT_DEC_LOCATOR +extern Const PARSE_T csi_tick_table[]; +#endif /* OPT_DEC_LOCATOR */ + +#if OPT_DEC_RECTOPS +extern Const PARSE_T csi_dollar_table[]; +extern Const PARSE_T csi_star_table[]; +#endif /* OPT_DEC_LOCATOR */ + #if OPT_VT52_MODE extern Const PARSE_T vt52_table[]; extern Const PARSE_T vt52_esc_table[]; extern Const PARSE_T vt52_ignore_table[]; #endif #if OPT_WIDE_CHARS extern Const PARSE_T esc_pct_table[]; #endif /* * The following list of definitions is generated from VTparse.def using the * following command line: * * grep '^CASE_' VTparse.def | awk '{printf "#define %s %d\n", $1, n++}' * * If you need to change something, change VTparse.def and regenerate the * definitions. This would have been automatic, but since this doesn't change * very often, it isn't worth the makefile hassle. */ @@ -210,22 +218,31 @@ #define CASE_DEC3_STATE 102 #define CASE_DECRPTUI 103 #define CASE_VT52_CUP 104 #define CASE_REP 105 #define CASE_CSI_EX_STATE 106 #define CASE_DECSTR 107 #define CASE_DECDHL 108 #define CASE_DECSWL 109 #define CASE_DECDWL 110 #define CASE_DEC_MC 111 #define CASE_ESC_PERCENT 112 #define CASE_UTF8 113 #define CASE_CSI_TICK_STATE 114 #define CASE_DECELR 115 #define CASE_DECRQLP 116 #define CASE_DECEFR 117 #define CASE_DECSLE 118 #define CASE_CSI_IGNORE 119 #define CASE_VT52_IGNORE 120 #define CASE_VT52_FINISH 121 +#define CASE_CSI_DOLLAR_STATE 122 +#define CASE_DECCRA 123 +#define CASE_DECERA 124 +#define CASE_DECFRA 125 +#define CASE_DECSERA 126 +#define CASE_DECSACE 127 +#define CASE_DECCARA 128 +#define CASE_DECRARA 129 +#define CASE_CSI_STAR_STATE 130 #endif /* included_VTparse_h */ Index: xc/programs/xterm/XTerm.ad =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/XTerm.ad,v retrieving revision 1.3 diff -u -2 -0 -r1.3 XTerm.ad --- xc/programs/xterm/XTerm.ad 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/XTerm.ad 6 Jan 2005 00:30:31 -0000 @@ -1,39 +1,40 @@ ! $Xorg: XTerm.ad,v 1.3 2000/08/17 19:55:08 cpqbld Exp $ ! ! ! ! -! $XTermId: XTerm.ad,v 1.61 2004/07/13 00:41:24 tom Exp $ -! $XFree86: xc/programs/xterm/XTerm.ad,v 3.28 2004/07/13 00:41:24 dickey Exp $ +! $XTermId: XTerm.ad,v 1.63 2004/12/01 01:27:46 tom Exp $ +! $XFree86: xc/programs/xterm/XTerm.ad,v 3.29 2004/12/01 01:27:46 dickey Exp $ *saveLines: 1024 *SimpleMenu*BackingStore: NotUseful *SimpleMenu*menuLabel.font: -adobe-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-* *SimpleMenu*menuLabel.vertSpace: 100 *SimpleMenu*HorizontalMargins: 16 *SimpleMenu*Sme.height: 16 *SimpleMenu*Cursor: left_ptr *mainMenu.Label: Main Options +*mainMenu*toolbar*Label: Toolbar *mainMenu*securekbd*Label: Secure Keyboard *mainMenu*allowsends*Label: Allow SendEvents *mainMenu*redraw*Label: Redraw Window *mainMenu*logging*Label: Log to File *mainMenu*print*Label: Print Window *mainMenu*print-redir*Label: Redirect to Printer *mainMenu*8-bit control*Label: 8-Bit Controls *mainMenu*backarrow key*Label: Backarrow Key (BS/DEL) *mainMenu*num-lock*Label: Alt/NumLock Modifiers *mainMenu*meta-esc*Label: Meta Sends Escape *mainMenu*delete-is-del*Label: Delete is DEL *mainMenu*oldFunctionKeys*Label: Old Function-Keys *mainMenu*sunFunctionKeys*Label: Sun Function-Keys *mainMenu*sunKeyboard*Label: VT220 Keyboard *mainMenu*hpFunctionKeys*Label: HP Function-Keys *mainMenu*scoFunctionKeys*Label: SCO Function-Keys *mainMenu*suspend*Label: Send STOP Signal *mainMenu*continue*Label: Send CONT Signal *mainMenu*interrupt*Label: Send INT Signal *mainMenu*hangup*Label: Send HUP Signal Index: xc/programs/xterm/aclocal.m4 =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/aclocal.m4,v retrieving revision 1.3 diff -u -2 -0 -r1.3 aclocal.m4 --- xc/programs/xterm/aclocal.m4 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/aclocal.m4 6 Jan 2005 00:30:32 -0000 @@ -1,23 +1,23 @@ -dnl $XTermId: aclocal.m4,v 1.173 2004/07/13 00:41:24 tom Exp $ +dnl $XTermId: aclocal.m4,v 1.177 2004/12/01 01:27:46 tom Exp $ dnl -dnl $XFree86: xc/programs/xterm/aclocal.m4,v 3.53 2004/07/13 00:41:24 dickey Exp $ +dnl $XFree86: xc/programs/xterm/aclocal.m4,v 3.54 2004/12/01 01:27:46 dickey Exp $ dnl dnl --------------------------------------------------------------------------- dnl dnl Copyright 1997-2003,2004 by Thomas E. Dickey dnl dnl All Rights Reserved dnl dnl Permission to use, copy, modify, and distribute this software and its dnl documentation for any purpose and without fee is hereby granted, dnl provided that the above copyright notice appear in all copies and that dnl both that copyright notice and this permission notice appear in dnl supporting documentation, and that the name of the above listed dnl copyright holder(s) not be used in advertising or publicity pertaining dnl to distribution of the software without specific, written prior dnl permission. dnl dnl THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD dnl TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY dnl AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE dnl LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES @@ -568,78 +568,85 @@ fgrep define conftest.i >>confdefs.h fi rm -rf conftest* fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_VERSION version: 3 updated: 2003/09/06 19:16:57 dnl -------------- dnl Find version of gcc AC_DEFUN([CF_GCC_VERSION],[ AC_REQUIRE([AC_PROG_CC]) GCC_VERSION=none if test "$GCC" = yes ; then AC_MSG_CHECKING(version of $CC) GCC_VERSION="`${CC} --version|sed -e '2,$d' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown AC_MSG_RESULT($GCC_VERSION) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_WARNINGS version: 15 updated: 2003/07/05 18:42:30 +dnl CF_GCC_WARNINGS version: 16 updated: 2004/07/23 14:40:34 dnl --------------- dnl Check if the compiler supports useful warning options. There's a few that dnl we don't use, simply because they're too noisy: dnl dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x) dnl -Wredundant-decls (system headers make this too noisy) dnl -Wtraditional (combines too many unrelated messages, only a few useful) dnl -Wwrite-strings (too noisy, but should review occasionally). This dnl is enabled for ncurses using "--enable-const". dnl -pedantic dnl +dnl Parameter: +dnl $1 is an optional list of gcc warning flags that a particular +dnl application might want to use, e.g., "no-unused" for +dnl -Wno-unused +dnl Special: +dnl If $with_ext_const is "yes", add a check for -Wwrite-strings +dnl AC_DEFUN([CF_GCC_WARNINGS], [ AC_REQUIRE([CF_GCC_VERSION]) if test "$GCC" = yes then cat > conftest.$ac_ext <],[ #ifdef _XOPEN_SOURCE make an error #endif], [cf_cv_gnu_source=no], [cf_cv_gnu_source=yes]) CPPFLAGS="$cf_save" ]) ]) test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" ])dnl dnl --------------------------------------------------------------------------- dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23 dnl --------------- dnl Insert text into the help-message, for readability, from AC_ARG_WITH. AC_DEFUN([CF_HELP_MESSAGE], [AC_DIVERT_HELP([$1])dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_IMAKE_CFLAGS version: 22 updated: 2004/04/25 20:55:33 +dnl CF_IMAKE_CFLAGS version: 23 updated: 2004/11/30 19:04:33 dnl --------------- dnl Use imake to obtain compiler flags. We could, in principle, write tests to dnl get these, but if imake is properly configured there is no point in doing dnl this. dnl dnl Parameters (used in constructing a sample Imakefile): dnl $1 = optional value to append to $IMAKE_CFLAGS dnl $2 = optional value to append to $IMAKE_LOADFLAGS AC_DEFUN([CF_IMAKE_CFLAGS], [ AC_PATH_PROGS(IMAKE,xmkmf imake) case $IMAKE in # (vi */imake) cf_imake_opts="-DUseInstalled=YES" # (vi ;; */util/xmkmf) # A single parameter tells xmkmf where the config-files are: cf_imake_opts="`echo $IMAKE|sed -e s,/config/util/xmkmf,,`" # (vi ;; *) @@ -798,40 +805,50 @@ cf_std_incl="$cf_opt" ;; *) #(vi cf_cpp_opts="$cf_cpp_opts $cf_opt" ;; esac done if test -z "$cf_nostdinc" ; then IMAKE_CFLAGS="$cf_cpp_opts $cf_std_incl" elif test -z "$cf_std_incl" ; then IMAKE_CFLAGS="$cf_cpp_opts $cf_nostdinc" else CF_VERBOSE(suppressed \"$cf_nostdinc\" and \"$cf_std_incl\") IMAKE_CFLAGS="$cf_cpp_opts" fi fi fi fi fi +# Some imake configurations define PROJECTROOT with an empty value. Remove +# the empty definition. +case $IMAKE_CFLAGS in +*-DPROJECTROOT=/*) + ;; +*) + IMAKE_CFLAGS=`echo "$IMAKE_CFLAGS" |sed -e "s,-DPROJECTROOT=[[ ]], ,"` + ;; +esac + CF_VERBOSE(IMAKE_CFLAGS $IMAKE_CFLAGS) CF_VERBOSE(IMAKE_LOADFLAGS $IMAKE_LOADFLAGS) AC_SUBST(IMAKE_CFLAGS) AC_SUBST(IMAKE_LOADFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_INPUT_METHOD version: 3 updated: 2000/04/11 23:46:57 dnl --------------- dnl Check if the X libraries support input-method AC_DEFUN([CF_INPUT_METHOD], [ AC_CACHE_CHECK([if X libraries support input-method],cf_cv_input_method,[ AC_TRY_LINK([ #include #include #include #include #include #include @@ -863,40 +880,98 @@ AC_CACHE_CHECK(for lastlog path,cf_cv_path_lastlog,[ AC_TRY_COMPILE([ #include #ifdef HAVE_LASTLOG_H #include #else #ifdef HAVE_PATHS_H #include #endif #endif],[char *path = _PATH_LASTLOG], [cf_cv_path_lastlog="_PATH_LASTLOG"], [if test -f /usr/adm/lastlog ; then cf_cv_path_lastlog=/usr/adm/lastlog else cf_cv_path_lastlog=no fi]) ]) test $cf_cv_path_lastlog != no && AC_DEFINE(USE_LASTLOG) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_MSG_LOG version: 3 updated: 1997/09/07 14:05:52 +dnl ---------- +dnl Write a debug message to config.log, along with the line number in the +dnl configure script. +AC_DEFUN([CF_MSG_LOG],[ +echo "(line __oline__) testing $* ..." 1>&AC_FD_CC +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_POSIX_C_SOURCE version: 1 updated: 2004/10/17 10:43:13 +dnl ----------------- +dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. +dnl +dnl POSIX.1-1990 _POSIX_SOURCE +dnl POSIX.1-1990 and _POSIX_SOURCE and +dnl POSIX.2-1992 C-Language _POSIX_C_SOURCE=2 +dnl Bindings Option +dnl POSIX.1b-1993 _POSIX_C_SOURCE=199309L +dnl POSIX.1c-1996 _POSIX_C_SOURCE=199506L +dnl X/Open 2000 _POSIX_C_SOURCE=200112L +dnl +dnl Parameters: +dnl $1 is the nominal value for _POSIX_C_SOURCE +AC_DEFUN([CF_POSIX_C_SOURCE], +[ +cf_POSIX_C_SOURCE=ifelse($1,,199506L,$1) +AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[ + CF_MSG_LOG(if the symbol is already defined go no further) + AC_TRY_COMPILE([#include ],[ +#ifndef _POSIX_C_SOURCE +make an error +#endif], + [cf_cv_posix_c_source=no], + [case .$cf_POSIX_C_SOURCE in + .[[12]]??*) + cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" + ;; + .2) + cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_POSIX_SOURCE" + ;; + .*) + cf_cv_posix_c_source="-D_POSIX_SOURCE" + ;; + esac + CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE) + cf_save="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source" + CF_MSG_LOG(if the second compile does not leave our definition intact error) + AC_TRY_COMPILE([#include ],[ +#ifndef _POSIX_C_SOURCE +make an error +#endif],, + [cf_cv_posix_c_source=no]) + CPPFLAGS="$cf_save" + ]) +]) +test "$cf_cv_posix_c_source" != no && CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source" +])dnl +dnl --------------------------------------------------------------------------- dnl CF_POSIX_WAIT version: 2 updated: 2000/05/29 16:16:04 dnl ------------- dnl Check for POSIX wait support AC_DEFUN([CF_POSIX_WAIT], [ AC_REQUIRE([AC_HEADER_SYS_WAIT]) AC_CACHE_CHECK(for POSIX wait functions,cf_cv_posix_wait,[ AC_TRY_LINK([ #include #include #include #ifdef HAVE_SYS_WAIT_H #include #endif ],[ int stat_loc; pid_t pid = waitpid(-1, &stat_loc, WNOHANG|WUNTRACED); pid_t pid2 = wait(&stat_loc); ], [cf_cv_posix_wait=yes], @@ -1491,115 +1566,109 @@ dnl CF_XKB_BELL_EXT version: 2 updated: 2003/05/18 17:28:57 dnl --------------- dnl Check for XKB bell extension AC_DEFUN([CF_XKB_BELL_EXT],[ AC_CACHE_CHECK(for XKB Bell extension, cf_cv_xkb_bell_ext,[ AC_TRY_LINK([ #include /* has the prototype */ #include /* has the XkbBI_xxx definitions */ ],[ int x = XkbBI_Info |XkbBI_MinorError |XkbBI_MajorError |XkbBI_TerminalBell |XkbBI_MarginBell; ],[cf_cv_xkb_bell_ext=yes],[cf_cv_xkb_bell_ext=no]) ]) test "$cf_cv_xkb_bell_ext" = yes && AC_DEFINE(HAVE_XKB_BELL_EXT) ]) dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 12 updated: 2004/06/26 18:29:41 +dnl CF_XOPEN_SOURCE version: 15 updated: 2004/11/23 15:41:32 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality. +dnl +dnl Parameters: +dnl $1 is the nominal value for _XOPEN_SOURCE +dnl $2 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_XOPEN_SOURCE],[ + +cf_XOPEN_SOURCE=ifelse($1,,500,$1) +cf_POSIX_C_SOURCE=ifelse($2,,199506L,$2) + case $host_os in #(vi freebsd*) #(vi - CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600" + # 5.x headers associate + # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L + # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L + cf_POSIX_C_SOURCE=200112L + cf_XOPEN_SOURCE=600 + CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" ;; hpux*) #(vi CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE" ;; -irix6.*) #(vi +irix[[56]].*) #(vi CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE" ;; linux*|gnu*) #(vi CF_GNU_SOURCE ;; mirbsd*) #(vi # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks ;; netbsd*) #(vi # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; openbsd*) #(vi # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; osf[[45]]*) #(vi CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE" ;; sco*) #(vi # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; solaris*) #(vi CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" ;; *) AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ AC_TRY_COMPILE([#include ],[ #ifndef _XOPEN_SOURCE make an error #endif], [cf_cv_xopen_source=no], [cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500" + CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" AC_TRY_COMPILE([#include ],[ #ifdef _XOPEN_SOURCE make an error #endif], [cf_cv_xopen_source=no], - [cf_cv_xopen_source=yes]) - CPPFLAGS="$cf_save" - ]) -]) -test "$cf_cv_xopen_source" = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500" - - # FreeBSD 5.x headers demand this... - AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_xopen_source,[ - AC_TRY_COMPILE([#include ],[ -#ifndef _POSIX_C_SOURCE -make an error -#endif], - [cf_cv_xopen_source=no], - [cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE" - AC_TRY_COMPILE([#include ],[ -#ifdef _POSIX_C_SOURCE -make an error -#endif], - [cf_cv_xopen_source=no], - [cf_cv_xopen_source=yes]) + [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) CPPFLAGS="$cf_save" ]) ]) -test "$cf_cv_xopen_source" = yes && CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE" +test "$cf_cv_xopen_source" != no && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source" + CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; esac ]) dnl --------------------------------------------------------------------------- dnl CF_X_ATHENA version: 12 updated: 2004/06/15 21:14:41 dnl ----------- dnl Check for Xaw (Athena) libraries dnl dnl Sets $cf_x_athena according to the flavor of Xaw which is used. AC_DEFUN([CF_X_ATHENA], [AC_REQUIRE([CF_X_TOOLKIT]) cf_x_athena=${cf_x_athena-Xaw} AC_MSG_CHECKING(if you want to link with Xaw 3d library) withval= AC_ARG_WITH(Xaw3d, [ --with-Xaw3d link with Xaw 3d library]) if test "$withval" = yes ; then cf_x_athena=Xaw3d AC_MSG_RESULT(yes) Index: xc/programs/xterm/button.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/button.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 button.c --- xc/programs/xterm/button.c 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/button.c 6 Jan 2005 00:30:33 -0000 @@ -1,21 +1,21 @@ -/* $XTermId: button.c,v 1.160 2004/07/20 01:14:41 tom Exp $ */ +/* $XTermId: button.c,v 1.171 2004/12/01 01:27:46 tom Exp $ */ /* $Xorg: button.c,v 1.3 2000/08/17 19:55:08 cpqbld Exp $ */ /* * Copyright 1999-2003,2004 by Thomas E. Dickey * * All Rights Reserved * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF @@ -35,41 +35,41 @@ * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appear in all copies and that * both that copyright notice and this permission notice appear in * supporting documentation, and that the name of Digital Equipment * Corporation not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior permission. * * * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ -/* $XFree86: xc/programs/xterm/button.c,v 3.75 2004/07/20 01:14:41 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/button.c,v 3.76 2004/12/01 01:27:46 dickey Exp $ */ /* button.c Handles button events in the terminal emulator. does cut/paste operations, change modes via menu, passes button events through to some applications. J. Gettys. */ #include #include #include #include #include #include #include #include @@ -160,41 +160,41 @@ static Char *SaveText(TScreen * screen, int row, int scol, int ecol, Char * lp, int *eol); static int Length(TScreen * screen, int row, int scol, int ecol); static void ComputeSelect(int startRow, int startCol, int endRow, int endCol, Bool extend); static void EditorButton(XButtonEvent * event); static void EndExtend(Widget w, XEvent * event, String * params, Cardinal num_params, Bool use_cursor_loc); static void ExtendExtend(int row, int col); static void PointToRowCol(int y, int x, int *r, int *c); static void ReHiliteText(int frow, int fcol, int trow, int tcol); static void SaltTextAway(int crow, int ccol, int row, int col, String * params, Cardinal num_params); static void SelectSet(Widget w, XEvent * event, String * params, Cardinal num_params); static void SelectionReceived PROTO_XT_SEL_CB_ARGS; static void StartSelect(int startrow, int startcol); static void TrackDown(XButtonEvent * event); static void _OwnSelection(XtermWidget termw, String * selections, Cardinal count); static void do_select_end(Widget w, XEvent * event, String * params, - Cardinal * num_params, Bool use_cursor_loc); + Cardinal *num_params, Bool use_cursor_loc); Boolean SendMousePosition(Widget w, XEvent * event) { TScreen *screen; if (!IsXtermWidget(w)) return False; screen = &((XtermWidget) w)->screen; /* If send_mouse_pos mode isn't on, we shouldn't be here */ if (screen->send_mouse_pos == MOUSE_OFF) return False; #if OPT_DEC_LOCATOR if (screen->send_mouse_pos == DEC_LOCATOR) { return (SendLocatorPosition(w, event)); } #endif /* OPT_DEC_LOCATOR */ @@ -808,64 +808,64 @@ static int ReadLineDelete(int r1, int c1, int r2, int c2) { TScreen *screen = &term->screen; int del; del = c2 - c1 + (r2 - r1) * (screen->max_col + 1); if (del <= 0) /* Just in case... */ return 0; while (del--) v_write(screen->respond, "\177", 1); /* XXX Sometimes "\08"? */ return 1; } #endif /* OPT_READLINE */ /* ^XM-G */ void DiredButton(Widget w GCC_UNUSED, XEvent * event, /* must be XButtonEvent */ String * params GCC_UNUSED, /* selections */ - Cardinal * num_params GCC_UNUSED) + Cardinal *num_params GCC_UNUSED) { TScreen *screen = &term->screen; Char Line[6]; unsigned line, col; if (event->type == ButtonPress || event->type == ButtonRelease) { line = (event->xbutton.y - screen->border) / FontHeight(screen); col = (event->xbutton.x - OriginX(screen)) / FontWidth(screen); Line[0] = CONTROL('X'); Line[1] = ESC; Line[2] = 'G'; Line[3] = ' ' + col; Line[4] = ' ' + line; v_write(screen->respond, Line, 5); } } #if OPT_READLINE void ReadLineButton(Widget w GCC_UNUSED, XEvent * event, /* must be XButtonEvent */ String * params GCC_UNUSED, /* selections */ - Cardinal * num_params GCC_UNUSED) + Cardinal *num_params GCC_UNUSED) { TScreen *screen = &term->screen; Char Line[6]; int line, col, ldelta = 0; if (!(event->type == ButtonPress || event->type == ButtonRelease) || (screen->send_mouse_pos != MOUSE_OFF) || ExtendingSelection) goto finish; if (event->type == ButtonRelease) { int delta; if (lastButtonDownTime == (Time) 0) /* first time and once in a blue moon */ delta = screen->multiClickTime + 1; else if (event->xbutton.time > lastButtonDownTime) /* most of the time */ delta = event->xbutton.time - lastButtonDownTime; else /* time has rolled over since lastButtonUpTime */ delta = (((Time) ~ 0) - lastButtonDownTime) + event->xbutton.time; if (delta > screen->multiClickTime) goto finish; /* All this work for this... */ } @@ -891,160 +891,162 @@ goto finish; Line[0] = ESC; /* XXX: sometimes it is better to send '['? */ Line[1] = 'O'; Line[2] = (col > 0 ? 'C' : 'D'); if (col < 0) col = -col; while (col--) v_write(screen->respond, Line, 3); finish: if (event->type == ButtonRelease) do_select_end(w, event, params, num_params, False); } #endif /* OPT_READLINE */ /* repeats n or p */ void ViButton(Widget w GCC_UNUSED, XEvent * event, /* must be XButtonEvent */ String * params GCC_UNUSED, /* selections */ - Cardinal * num_params GCC_UNUSED) + Cardinal *num_params GCC_UNUSED) { TScreen *screen = &term->screen; int pty = screen->respond; Char Line[6]; int line; if (event->type == ButtonPress || event->type == ButtonRelease) { line = screen->cur_row - ((event->xbutton.y - screen->border) / FontHeight(screen)); if (line != 0) { Line[0] = ESC; /* force an exit from insert-mode */ v_write(pty, Line, 1); if (line < 0) { line = -line; Line[0] = CONTROL('n'); } else { Line[0] = CONTROL('p'); } while (--line >= 0) v_write(pty, Line, 1); } } } /* * This function handles button-motion events */ /*ARGSUSED*/ void HandleSelectExtend(Widget w, XEvent * event, /* must be XMotionEvent */ String * params GCC_UNUSED, - Cardinal * num_params GCC_UNUSED) + Cardinal *num_params GCC_UNUSED) { TScreen *screen; int row, col; if (!IsXtermWidget(w)) return; screen = &((XtermWidget) w)->screen; screen->selection_time = event->xmotion.time; switch (eventMode) { /* If not in one of the DEC mouse-reporting modes */ case LEFTEXTENSION: case RIGHTEXTENSION: PointToRowCol(event->xmotion.y, event->xmotion.x, &row, &col); ExtendExtend(row, col); break; /* If in motion reporting mode, send mouse position to character process as a key sequence \E[M... */ case NORMAL: /* will get here if send_mouse_pos != MOUSE_OFF */ if (screen->send_mouse_pos == BTN_EVENT_MOUSE - || screen->send_mouse_pos == ANY_EVENT_MOUSE) - SendMousePosition(w, event); + || screen->send_mouse_pos == ANY_EVENT_MOUSE) { + (void) SendMousePosition(w, event); + } break; } } static void do_select_end(Widget w, XEvent * event, /* must be XButtonEvent */ String * params, /* selections */ - Cardinal * num_params, + Cardinal *num_params, Bool use_cursor_loc) { #if OPT_READLINE int ldelta1, ldelta2; TScreen *screen = &term->screen; #endif - if (!IsXtermWidget(w)) + if (!IsXtermWidget(w)) { return; + } ((XtermWidget) w)->screen.selection_time = event->xbutton.time; switch (eventMode) { case NORMAL: (void) SendMousePosition(w, event); break; case LEFTEXTENSION: case RIGHTEXTENSION: EndExtend(w, event, params, *num_params, use_cursor_loc); #if OPT_READLINE if (isClick1_clean(event) && SCREEN_FLAG(screen, click1_moves) && rowOnCurrentLine(eventRow(event), &ldelta1)) { ReadLineMovePoint(eventColBetween(event), ldelta1); } if (isDoubleClick3(event) && SCREEN_FLAG(screen, dclick3_deletes) && rowOnCurrentLine(startSRow, &ldelta1) && rowOnCurrentLine(endSRow, &ldelta2)) { ReadLineMovePoint(endSCol, ldelta2); ReadLineDelete(startSRow, startSCol, endSRow, endSCol); } #endif /* OPT_READLINE */ break; } } void HandleSelectEnd(Widget w, XEvent * event, /* must be XButtonEvent */ String * params, /* selections */ - Cardinal * num_params) + Cardinal *num_params) { do_select_end(w, event, params, num_params, False); } void HandleKeyboardSelectEnd(Widget w, XEvent * event, /* must be XButtonEvent */ String * params, /* selections */ - Cardinal * num_params) + Cardinal *num_params) { do_select_end(w, event, params, num_params, True); } struct _SelectionList { String *params; Cardinal count; Atom *targets; Time time; }; /* convert a UTF-8 string to Latin-1, replacing non Latin-1 characters * by `#'. */ #if OPT_WIDE_CHARS static Char * UTF8toLatin1(Char * s, int len, unsigned long *result) { static Char *buffer; static size_t used; @@ -1125,143 +1127,173 @@ if (eightBitSelectionTargets == NULL) { eightBitSelectionTargets = (Atom *) XtMalloc(5 * sizeof(Atom)); if (eightBitSelectionTargets == NULL) { TRACE(("Couldn't allocate eightBitSelectionTargets\n")); return NULL; } n = 0; #ifdef X_HAVE_UTF8_STRING eightBitSelectionTargets[n++] = XA_UTF8_STRING(XtDisplay(w)); #endif if (screen->i18nSelections) { eightBitSelectionTargets[n++] = XA_TEXT(XtDisplay(w)); eightBitSelectionTargets[n++] = XA_COMPOUND_TEXT(XtDisplay(w)); } eightBitSelectionTargets[n++] = XA_STRING; eightBitSelectionTargets[n] = None; } return eightBitSelectionTargets; } -static void -_GetSelection(Widget w, - Time ev_time, - String * params, /* selections in precedence order */ - Cardinal num_params, - Atom * targets) +/* + * Lookup the cut-buffer number, which will be in the range 0-7. + * If it is not a cut-buffer, it is the primary selection (-1). + */ +static int +CutBuffer(int code) { - Atom selection; int cutbuffer; - Atom target; - - if (!IsXtermWidget(w)) - return; - - XmuInternStrings(XtDisplay(w), params, (Cardinal) 1, &selection); - switch (selection) { + switch (code) { case XA_CUT_BUFFER0: cutbuffer = 0; break; case XA_CUT_BUFFER1: cutbuffer = 1; break; case XA_CUT_BUFFER2: cutbuffer = 2; break; case XA_CUT_BUFFER3: cutbuffer = 3; break; case XA_CUT_BUFFER4: cutbuffer = 4; break; case XA_CUT_BUFFER5: cutbuffer = 5; break; case XA_CUT_BUFFER6: cutbuffer = 6; break; case XA_CUT_BUFFER7: cutbuffer = 7; break; default: cutbuffer = -1; + break; } + return cutbuffer; +} + +static void +_GetSelection(Widget w, + Time ev_time, + String * params, /* selections in precedence order */ + Cardinal num_params, + Atom * targets) +{ + Atom selection; + int cutbuffer; + Atom target; + + if (!IsXtermWidget(w)) + return; + +#if OPT_TRACE + TRACE(("_GetSelection\n")); + if (num_params > 0) { + Cardinal n; + for (n = 0; n < num_params; ++n) { + TRACE(("param[%d]:%s\n", n, params[n])); + } + } +#endif + + XmuInternStrings(XtDisplay(w), params, (Cardinal) 1, &selection); + cutbuffer = CutBuffer(selection); TRACE(("Cutbuffer: %d, target: %lu\n", cutbuffer, targets ? (unsigned long) targets[0] : 0)); if (cutbuffer >= 0) { int inbytes; unsigned long nbytes; int fmt8 = 8; Atom type = XA_STRING; - char *line = XFetchBuffer(XtDisplay(w), &inbytes, cutbuffer); + char *line; + + /* 'line' is freed in SelectionReceived */ + line = XFetchBuffer(XtDisplay(w), &inbytes, cutbuffer); nbytes = (unsigned long) inbytes; if (nbytes > 0) SelectionReceived(w, NULL, &selection, &type, (XtPointer) line, &nbytes, &fmt8); else if (num_params > 1) _GetSelection(w, ev_time, params + 1, num_params - 1, NULL); return; } else { struct _SelectionList *list; if (targets == NULL || targets[0] == None) { targets = _SelectionTargets(w); } if (targets != 0) { target = targets[0]; if (targets[1] == None) { /* last target in list */ params++; num_params--; targets = _SelectionTargets(w); } else { targets = &(targets[1]); } if (num_params) { + /* 'list' is freed in SelectionReceived */ list = XtNew(struct _SelectionList); - list->params = params; - list->count = num_params; - list->targets = targets; - list->time = ev_time; - } else + if (list != 0) { + list->params = params; + list->count = num_params; + list->targets = targets; + list->time = ev_time; + } + } else { list = NULL; + } XtGetSelectionValue(w, selection, target, SelectionReceived, (XtPointer) list, ev_time); } } } #if OPT_TRACE && OPT_WIDE_CHARS static void GettingSelection(Display * dpy, Atom type, Char * line, int len) { Char *cp; char *name; name = XGetAtomName(dpy, type); - Trace("Getting %s (%ld)\n", XGetAtomName(dpy, type), (long int) type); + Trace("Getting %s (%ld)\n", name, (long int) type); for (cp = line; cp < line + len; cp++) Trace("%c\n", *cp); } #else #define GettingSelection(dpy,type,line,len) /* nothing */ #endif #ifdef VMS # define tty_vwrite(pty,lag,l) tt_write(lag,l) #else /* !( VMS ) */ # define tty_vwrite(pty,lag,l) v_write(pty,lag,l) #endif /* defined VMS */ static void _qWriteSelectionData(TScreen * screen, Char * lag, int length) { #if OPT_READLINE if (SCREEN_FLAG(screen, paste_quotes)) { while (length--) { tty_vwrite(screen->respond, "\026", 1); /* Control-V */ @@ -1429,41 +1461,41 @@ XtFree((char *) client_data); XtFree((char *) value); return; fail: if (client_data != 0) { struct _SelectionList *list = (struct _SelectionList *) client_data; _GetSelection(w, list->time, list->params, list->count, list->targets); XtFree((char *) client_data); } return; } void HandleInsertSelection(Widget w, XEvent * event, /* assumed to be XButtonEvent* */ String * params, /* selections in precedence order */ - Cardinal * num_params) + Cardinal *num_params) { #if OPT_READLINE int ldelta; TScreen *screen = &((XtermWidget) w)->screen; #endif if (SendMousePosition(w, event)) return; #if OPT_READLINE if ((event->type == ButtonPress || event->type == ButtonRelease) /* Disable on Shift-mouse, including the application-mouse modes */ && !(KeyModifiers & ShiftMask) && (screen->send_mouse_pos == MOUSE_OFF) && SCREEN_FLAG(screen, paste_moves) && rowOnCurrentLine(eventRow(event), &ldelta)) ReadLineMovePoint(eventColBetween(event), ldelta); #endif /* OPT_READLINE */ _GetSelection(w, event->xbutton.time, params, *num_params, NULL); @@ -1496,66 +1528,66 @@ int startrow, int startcol) { if (SendMousePosition(w, event)) return; selectUnit = EvalSelectUnit(event->xbutton.time, SELECTCHAR); replyToEmacs = FALSE; #if OPT_READLINE lastButtonDownTime = event->xbutton.time; #endif StartSelect(startrow, startcol); } /* ARGSUSED */ void HandleSelectStart(Widget w, XEvent * event, /* must be XButtonEvent* */ String * params GCC_UNUSED, - Cardinal * num_params GCC_UNUSED) + Cardinal *num_params GCC_UNUSED) { TScreen *screen; int startrow, startcol; if (!IsXtermWidget(w)) return; screen = &((XtermWidget) w)->screen; firstValidRow = 0; lastValidRow = screen->max_row; PointToRowCol(event->xbutton.y, event->xbutton.x, &startrow, &startcol); #if OPT_READLINE ExtendingSelection = 0; #endif do_select_start(w, event, startrow, startcol); } /* ARGSUSED */ void HandleKeyboardSelectStart(Widget w, XEvent * event, /* must be XButtonEvent* */ String * params GCC_UNUSED, - Cardinal * num_params GCC_UNUSED) + Cardinal *num_params GCC_UNUSED) { TScreen *screen; if (!IsXtermWidget(w)) return; screen = &((XtermWidget) w)->screen; do_select_start(w, event, screen->cursor_row, screen->cursor_col); } static void TrackDown(XButtonEvent * event) { int startrow, startcol; selectUnit = EvalSelectUnit(event->time, SELECTCHAR); if (numberOfClicks > 1) { PointToRowCol(event->y, event->x, &startrow, &startcol); replyToEmacs = TRUE; StartSelect(startrow, startcol); @@ -1602,41 +1634,40 @@ /* set start of selection */ rawRow = startrow; rawCol = startcol; } /* else use old values in rawRow, Col */ saveStartRRow = startERow = rawRow; saveStartRCol = startECol = rawCol; saveEndRRow = endERow = rawRow; saveEndRCol = endECol = rawCol; if (Coordinate(startrow, startcol) < Coordinate(rawRow, rawCol)) { eventMode = LEFTEXTENSION; startERow = startrow; startECol = startcol; } else { eventMode = RIGHTEXTENSION; endERow = startrow; endECol = startcol; } ComputeSelect(startERow, startECol, endERow, endECol, False); - } static void EndExtend(Widget w, XEvent * event, /* must be XButtonEvent */ String * params, /* selections */ Cardinal num_params, Bool use_cursor_loc) { int row, col, count; TScreen *screen = &term->screen; Char line[9]; if (use_cursor_loc) { row = screen->cursor_row; col = screen->cursor_col; } else { PointToRowCol(event->xbutton.y, event->xbutton.x, &row, &col); } ExtendExtend(row, col); @@ -1661,68 +1692,70 @@ line[count++] = 'T'; line[count++] = ' ' + startSCol + 1; line[count++] = ' ' + startSRow + 1; line[count++] = ' ' + endSCol + 1; line[count++] = ' ' + endSRow + 1; line[count++] = ' ' + col + 1; line[count++] = ' ' + row + 1; } v_write(screen->respond, line, count); TrackText(0, 0, 0, 0); } } SelectSet(w, event, params, num_params); eventMode = NORMAL; } void HandleSelectSet(Widget w, XEvent * event, String * params, - Cardinal * num_params) + Cardinal *num_params) { SelectSet(w, event, params, *num_params); } /* ARGSUSED */ static void SelectSet(Widget w GCC_UNUSED, XEvent * event GCC_UNUSED, String * params, Cardinal num_params) { + TRACE(("SelectSet\n")); /* Only do select stuff if non-null select */ if (startSRow != endSRow || startSCol != endSCol) { SaltTextAway(startSRow, startSCol, endSRow, endSCol, params, num_params); - } else + } else { DisownSelection(term); + } } #define Abs(x) ((x) < 0 ? -(x) : (x)) /* ARGSUSED */ static void do_start_extend(Widget w, XEvent * event, /* must be XButtonEvent* */ String * params GCC_UNUSED, - Cardinal * num_params GCC_UNUSED, + Cardinal *num_params GCC_UNUSED, Bool use_cursor_loc) { TScreen *screen; int row, col, coord; if (!IsXtermWidget(w)) return; screen = &((XtermWidget) w)->screen; if (SendMousePosition(w, event)) return; firstValidRow = 0; lastValidRow = screen->max_row; #if OPT_READLINE if ((KeyModifiers & ShiftMask) || event->xbutton.button != Button3 || !(SCREEN_FLAG(screen, dclick3_deletes))) #endif selectUnit = EvalSelectUnit(event->xbutton.time, selectUnit); replyToEmacs = FALSE; @@ -1798,81 +1831,102 @@ } if (eventMode == LEFTEXTENSION) { startERow = row; startECol = col; } else { endERow = row; endECol = col; } ComputeSelect(startERow, startECol, endERow, endECol, False); #if OPT_READLINE if (startSRow != endSRow || startSCol != endSCol) ExtendingSelection = 1; #endif } void HandleStartExtend(Widget w, XEvent * event, /* must be XButtonEvent* */ String * params, /* unused */ - Cardinal * num_params) /* unused */ + Cardinal *num_params) /* unused */ { do_start_extend(w, event, params, num_params, False); } void HandleKeyboardStartExtend(Widget w, XEvent * event, /* must be XButtonEvent* */ String * params, /* unused */ - Cardinal * num_params) /* unused */ + Cardinal *num_params) /* unused */ { do_start_extend(w, event, params, num_params, True); } void -ScrollSelection(TScreen * screen, int amount) +ScrollSelection(TScreen * screen, int amount, Bool always) { int minrow = -screen->savedlines - screen->topline; int maxrow = screen->max_row - screen->topline; int maxcol = screen->max_col; #define scroll_update_one(row, col) \ row += amount; \ if (row < minrow) { \ row = minrow; \ col = 0; \ } \ if (row > maxrow) { \ row = maxrow; \ col = maxcol; \ } scroll_update_one(startRRow, startRCol); scroll_update_one(endRRow, endRCol); scroll_update_one(startSRow, startSCol); scroll_update_one(endSRow, endSCol); scroll_update_one(rawRow, rawCol); - scroll_update_one(screen->startHRow, screen->startHCol); - scroll_update_one(screen->endHRow, screen->endHCol); + /* + * If we are told to scroll the selection but it lies outside the scrolling + * margins, then that could cause the selection to move (bad). It is not + * simple to fix, because this function is called both for the scrollbar + * actions as well as application scrolling. The 'always' flag is set in + * the former case. The rest of the logic handles the latter. + */ + if (ScrnHaveSelection(screen)) { + int adjust; + + adjust = screen->startHRow + screen->topline; + if (always + || !ScrnHaveLineMargins(screen) + || ScrnIsLineInMargins(screen, adjust)) { + scroll_update_one(screen->startHRow, screen->startHCol); + } + adjust = screen->endHRow + screen->topline; + if (always + || !ScrnHaveLineMargins(screen) + || ScrnIsLineInMargins(screen, adjust)) { + scroll_update_one(screen->endHRow, screen->endHCol); + } + } screen->startHCoord = Coordinate(screen->startHRow, screen->startHCol); screen->endHCoord = Coordinate(screen->endHRow, screen->endHCol); } /*ARGSUSED*/ void ResizeSelection(TScreen * screen GCC_UNUSED, int rows, int cols) { rows--; /* decr to get 0-max */ cols--; if (startRRow > rows) startRRow = rows; if (startSRow > rows) startSRow = rows; if (endRRow > rows) endRRow = rows; if (endSRow > rows) endSRow = rows; @@ -2213,41 +2267,41 @@ && startCol < saveStartWCol)) { startSCol = 0; while (ScrnTstWrapped(screen, startSRow - 1)) { --startSRow; } } else { startSRow = saveStartWRow; startSCol = saveStartWCol; } } if (term->screen.cutNewline) { endSCol = 0; ++endSRow; } else { endSCol = LastTextCol(endSRow) + 1; } break; } /* check boundaries */ - ScrollSelection(screen, 0); + ScrollSelection(screen, 0, False); TrackText(startSRow, startSCol, endSRow, endSCol); return; } void TrackText(int frow, int fcol, int trow, int tcol) /* Guaranteed (frow, fcol) <= (trow, tcol) */ { int from, to; TScreen *screen = &term->screen; int old_startrow, old_startcol, old_endrow, old_endcol; TRACE(("TrackText(frow=%d, fcol=%d, trow=%d, tcol=%d)\n", frow, fcol, trow, tcol)); old_startrow = screen->startHRow; @@ -2280,40 +2334,42 @@ ReHiliteText(old_endrow, old_endcol, trow, tcol); } else if (to < screen->endHCoord) { /* Shorten right end */ ReHiliteText(trow, tcol, old_endrow, old_endcol); } } screen->startHCoord = from; screen->endHCoord = to; } static void ReHiliteText(int frow, int fcol, int trow, int tcol) /* Guaranteed that (frow, fcol) <= (trow, tcol) */ { TScreen *screen = &term->screen; int i; + TRACE(("ReHiliteText from %d.%d to %d.%d\n", frow, fcol, trow, tcol)); + if (frow < 0) frow = fcol = 0; else if (frow > screen->max_row) return; /* nothing to do, since trow >= frow */ if (trow < 0) return; /* nothing to do, since frow <= trow */ else if (trow > screen->max_row) { trow = screen->max_row; tcol = screen->max_col + 1; } if (frow == trow && fcol == tcol) return; if (frow != trow) { /* do multiple rows */ if ((i = screen->max_col - fcol + 1) > 0) { /* first row */ ScrnRefresh(screen, frow, fcol, 1, i, True); } if ((i = trow - frow - 1) > 0) { /* middle rows */ ScrnRefresh(screen, frow + 1, 0, i, screen->max_col + 1, True); @@ -2380,81 +2436,81 @@ return; line[j] = '\0'; /* make sure it is null terminated */ lp = line; /* lp points to where to save the text */ if (row == crow) { lp = SaveText(screen, row, ccol, col, lp, &eol); } else { lp = SaveText(screen, crow, ccol, screen->max_col, lp, &eol); if (eol) *lp++ = '\n'; /* put in newline at end of line */ for (i = crow + 1; i < row; i++) { lp = SaveText(screen, i, 0, screen->max_col, lp, &eol); if (eol) *lp++ = '\n'; } if (col >= 0) lp = SaveText(screen, row, 0, col, lp, &eol); } *lp = '\0'; /* make sure we have end marked */ - TRACE(("Salted TEXT:%.*s\n", lp - line, line)); + TRACE(("Salted TEXT:%d:%.*s\n", lp - line, lp - line, line)); screen->selection_length = (lp - line); _OwnSelection(term, params, num_params); } static Boolean _ConvertSelectionHelper(Widget w, - Atom * type, XtPointer * value, + Atom * type, XtPointer *value, unsigned long *length, int *format, int (*conversion_function) (Display *, char **, int, XICCEncodingStyle, XTextProperty *), XICCEncodingStyle conversion_style) { Display *d = XtDisplay(w); TScreen *screen; XTextProperty textprop; if (!IsXtermWidget(w)) return False; screen = &((XtermWidget) w)->screen; if (conversion_function(d, (char **) &screen->selection_data, 1, conversion_style, &textprop) < Success) return False; *value = (XtPointer) textprop.value; *length = textprop.nitems; *type = textprop.encoding; *format = textprop.format; return True; } static Boolean ConvertSelection(Widget w, Atom * selection, Atom * target, Atom * type, - XtPointer * value, + XtPointer *value, unsigned long *length, int *format) { Display *d = XtDisplay(w); TScreen *screen; Boolean result = False; if (!IsXtermWidget(w)) return False; screen = &((XtermWidget) w)->screen; if (screen->selection_data == NULL) return False; /* can this happen? */ if (*target == XA_TARGETS(d)) { Atom *targetP; Atom *std_targets; XPointer std_return = 0; unsigned long std_length; @@ -2546,85 +2602,77 @@ type, value, length, format, XmbTextListToTextProperty, XUTF8StringStyle); } #endif else if (*target == XA_LIST_LENGTH(d)) { *value = XtMalloc(4); if (sizeof(long) == 4) *(long *) *value = 1; else { long temp = 1; memcpy((char *) *value, ((char *) &temp) + sizeof(long) - 4, 4); } *type = XA_INTEGER; *length = 1; *format = 32; result = True; } else if (*target == XA_LENGTH(d)) { /* This value is wrong if we have UTF-8 text */ *value = XtMalloc(4); - if (sizeof(long) == 4) - *(long *) *value = screen->selection_length; - else { + if (sizeof(long) == 4) { + *(long *) *value = screen->selection_length; + } else { long temp = screen->selection_length; memcpy((char *) *value, ((char *) &temp) + sizeof(long) - 4, 4); } *type = XA_INTEGER; *length = 1; *format = 32; result = True; } else if (XmuConvertStandardSelection(w, screen->selection_time, selection, target, type, (XPointer *) value, length, format)) { result = True; } /* else */ return result; } static void LoseSelection(Widget w, Atom * selection) { TScreen *screen; Atom *atomP; Cardinal i; if (!IsXtermWidget(w)) return; screen = &((XtermWidget) w)->screen; for (i = 0, atomP = screen->selection_atoms; i < screen->selection_count; i++, atomP++) { if (*selection == *atomP) *atomP = (Atom) 0; - switch (*atomP) { - case XA_CUT_BUFFER0: - case XA_CUT_BUFFER1: - case XA_CUT_BUFFER2: - case XA_CUT_BUFFER3: - case XA_CUT_BUFFER4: - case XA_CUT_BUFFER5: - case XA_CUT_BUFFER6: - case XA_CUT_BUFFER7: + if (CutBuffer(*atomP) >= 0) { *atomP = (Atom) 0; } } for (i = screen->selection_count; i; i--) { if (screen->selection_atoms[i - 1] != 0) break; } screen->selection_count = i; for (i = 0, atomP = screen->selection_atoms; i < screen->selection_count; i++, atomP++) { if (*atomP == (Atom) 0) { *atomP = screen->selection_atoms[--screen->selection_count]; } } if (screen->selection_count == 0) TrackText(0, 0, 0, 0); } @@ -2641,147 +2689,121 @@ static void _OwnSelection(XtermWidget termw, String * selections, Cardinal count) { Atom *atoms = termw->screen.selection_atoms; Cardinal i; Boolean have_selection = False; if (termw->screen.selection_length < 0) return; if (count > termw->screen.sel_atoms_size) { XtFree((char *) atoms); atoms = (Atom *) XtMalloc(count * sizeof(Atom)); termw->screen.selection_atoms = atoms; termw->screen.sel_atoms_size = count; } XmuInternStrings(XtDisplay((Widget) termw), selections, count, atoms); for (i = 0; i < count; i++) { - int cutbuffer; - switch (atoms[i]) { - case XA_CUT_BUFFER0: - cutbuffer = 0; - break; - case XA_CUT_BUFFER1: - cutbuffer = 1; - break; - case XA_CUT_BUFFER2: - cutbuffer = 2; - break; - case XA_CUT_BUFFER3: - cutbuffer = 3; - break; - case XA_CUT_BUFFER4: - cutbuffer = 4; - break; - case XA_CUT_BUFFER5: - cutbuffer = 5; - break; - case XA_CUT_BUFFER6: - cutbuffer = 6; - break; - case XA_CUT_BUFFER7: - cutbuffer = 7; - break; - default: - cutbuffer = -1; - } + int cutbuffer = CutBuffer(atoms[i]); if (cutbuffer >= 0) { if (termw->screen.selection_length > 4 * XMaxRequestSize(XtDisplay((Widget) termw)) - 32) { fprintf(stderr, "%s: selection too big (%d bytes), not storing in CUT_BUFFER%d\n", xterm_name, termw->screen.selection_length, cutbuffer); } else { /* This used to just use the UTF-8 data, which was totally * broken as not even the corresponding paste code in Xterm * understood this! So now it converts to Latin1 first. * Robert Brady, 2000-09-05 */ unsigned long length = termw->screen.selection_length; Char *data = termw->screen.selection_data; if_OPT_WIDE_CHARS((&(termw->screen)), { data = UTF8toLatin1(data, length, &length); }); TRACE(("XStoreBuffer(%d)\n", cutbuffer)); XStoreBuffer(XtDisplay((Widget) termw), (char *) data, length, cutbuffer); } } else if (!replyToEmacs) { have_selection |= XtOwnSelection((Widget) termw, atoms[i], termw->screen.selection_time, ConvertSelection, LoseSelection, SelectionDone); } } if (!replyToEmacs) termw->screen.selection_count = count; if (!have_selection) TrackText(0, 0, 0, 0); } +static void +ResetSelectionState(TScreen * screen) +{ + screen->selection_count = 0; + screen->startHRow = screen->startHCol = 0; + screen->endHRow = screen->endHCol = 0; +} + void DisownSelection(XtermWidget termw) { - Atom *atoms = termw->screen.selection_atoms; - Cardinal count = termw->screen.selection_count; + TScreen *screen = &(termw->screen); + Atom *atoms = screen->selection_atoms; + Cardinal count = screen->selection_count; Cardinal i; + TRACE(("DisownSelection count %d, start %d.%d, end %d.%d\n", + count, + screen->startHRow, + screen->startHCol, + screen->endHRow, + screen->endHCol)); + for (i = 0; i < count; i++) { - int cutbuffer; - switch (atoms[i]) { - case XA_CUT_BUFFER0: - cutbuffer = 0; - break; - case XA_CUT_BUFFER1: - cutbuffer = 1; - break; - case XA_CUT_BUFFER2: - cutbuffer = 2; - break; - case XA_CUT_BUFFER3: - cutbuffer = 3; - break; - case XA_CUT_BUFFER4: - cutbuffer = 4; - break; - case XA_CUT_BUFFER5: - cutbuffer = 5; - break; - case XA_CUT_BUFFER6: - cutbuffer = 6; - break; - case XA_CUT_BUFFER7: - cutbuffer = 7; - break; - default: - cutbuffer = -1; - } - if (cutbuffer < 0) + int cutbuffer = CutBuffer(atoms[i]); + if (cutbuffer < 0) { XtDisownSelection((Widget) termw, atoms[i], - termw->screen.selection_time); + screen->selection_time); + } + } + /* + * If none of the callbacks via XtDisownSelection() reset highlighting + * do it now. + */ + if (ScrnHaveSelection(screen)) { + /* save data which will be reset */ + int start_row = screen->startHRow; + int start_col = screen->startHCol; + int end_row = screen->endHRow; + int end_col = screen->endHCol; + + ResetSelectionState(screen); + ReHiliteText(start_row, start_col, end_row, end_col); + } else { + ResetSelectionState(screen); } - termw->screen.selection_count = 0; - termw->screen.startHRow = termw->screen.startHCol = 0; - termw->screen.endHRow = termw->screen.endHCol = 0; } /* returns number of chars in line from scol to ecol out */ /* ARGSUSED */ static int Length(TScreen * screen GCC_UNUSED, int row, int scol, int ecol) { int lastcol = LastTextCol(row); if (ecol > lastcol) ecol = lastcol; return (ecol - scol + 1); } /* copies text into line, preallocated */ static Char * SaveText(TScreen * screen, @@ -2815,41 +2837,41 @@ c_1 = E2A(XTERM_CELL_C1(row, i)); c_2 = E2A(XTERM_CELL_C2(row, i)); } /* We want to strip out every occurrence of HIDDEN_CHAR AFTER a * wide character. */ if (c == HIDDEN_CHAR && iswide(previous)) { previous = c; /* Combining characters attached to double-width characters are in memory attached to the HIDDEN_CHAR */ if (c_1) { lp = convertToUTF8(lp, c_1); if (c_2) lp = convertToUTF8(lp, c_2); } continue; } previous = c; if (screen->utf8_mode) { - lp = convertToUTF8(lp, c); + lp = convertToUTF8(lp, (c != 0) ? c : ' '); if (c_1) { lp = convertToUTF8(lp, c_1); if (c_2) lp = convertToUTF8(lp, c_2); } } else #endif { if (c == 0) { c = E2A(' '); } else if (c < E2A(' ')) { if (c == XPOUND) c = 0x23; /* char on screen is pound sterling */ else c += 0x5f; /* char is from DEC drawing set */ } else if (c == 0x7f) { c = 0x5f; } *lp++ = A2E(c); } @@ -2964,61 +2986,61 @@ screen->mouse_row = row; screen->mouse_col = col; /* Add pointer position to key sequence */ line[count++] = ' ' + col + 1; line[count++] = ' ' + row + 1; TRACE(("mouse at %d,%d button+mask = %#x\n", row, col, (screen->control_eight_bits) ? line[2] : line[3])); /* Transmit key sequence to process running under xterm */ v_write(pty, line, count); } /*ARGSUSED*/ #if OPT_TEK4014 void HandleGINInput(Widget w GCC_UNUSED, XEvent * event GCC_UNUSED, String * param_list, - Cardinal * nparamsp) + Cardinal *nparamsp) { if (term->screen.TekGIN && *nparamsp == 1) { int c = param_list[0][0]; switch (c) { case 'l': case 'm': case 'r': case 'L': case 'M': case 'R': break; default: Bell(XkbBI_MinorError, 0); /* let them know they goofed */ c = 'l'; /* provide a default */ } TekEnqMouse(c | 0x80); TekGINoff(); } else { Bell(XkbBI_MinorError, 0); } } #endif /* OPT_TEK4014 */ /* ARGSUSED */ void HandleSecure(Widget w GCC_UNUSED, XEvent * event, /* unused */ String * params GCC_UNUSED, /* [0] = volume */ - Cardinal * param_count GCC_UNUSED) /* 0 or 1 */ + Cardinal *param_count GCC_UNUSED) /* 0 or 1 */ { Time ev_time = CurrentTime; if ((event->xany.type == KeyPress) || (event->xany.type == KeyRelease)) ev_time = event->xkey.time; else if ((event->xany.type == ButtonPress) || (event->xany.type == ButtonRelease)) ev_time = event->xbutton.time; DoSecureKeyboard(ev_time); } Index: xc/programs/xterm/charclass.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/charclass.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 charclass.c --- xc/programs/xterm/charclass.c 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/charclass.c 6 Jan 2005 00:30:34 -0000 @@ -3,48 +3,48 @@ * xterm character class mechanism for large character sets * * Markus Kuhn -- mkuhn@acm.org -- 2000-07-03 * * Xterm allows users to select entire words with a double-click on * the left mouse button. Opinions might differ on what type of * characters are part of separate words, therefore xterm allows users * to configure a class code for each 8-bit character. Words are * maximum length sequences of neighboring characters with identical * class code. Extending this mechanism to Unicode naively would * create an at least 2^16 entries (128 kB) long class code table. * Instead, we transform the character class table into a list * of intervals, that will be accessed via a linear search. * Changes made to the table by the user will be appended. A special * class code -1 (default) marks characters who have their code number * as the class code. We could alternatively use a sorted table of * non-overlapping intervals that can be accessed via binary search, * but merging in new intervals is significantly more hassle and * not worth the effort here. */ -/* $XFree86: xc/programs/xterm/charclass.c,v 1.3 2002/04/28 19:04:19 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/charclass.c,v 1.4 2004/12/01 01:27:46 dickey Exp $ */ #include #include #if OPT_WIDE_CHARS -struct classentry { +static struct classentry { int class; int first; int last; } *classtab; /* * Special convention for classtab[0]: * - classtab[0].class is the allocated number of entries in classtab * - classtab[0].first = 1 (first used entry in classtab) * - classtab[0].last is the last used entry in classtab */ int SetCharacterClassRange(int low, int high, int value) { if (high < low) return -1; /* nothing to do */ /* make sure we have at least one free entry left at table end */ if (classtab[0].last > classtab[0].class - 2) { Index: xc/programs/xterm/charproc.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/charproc.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 charproc.c --- xc/programs/xterm/charproc.c 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/charproc.c 6 Jan 2005 00:30:37 -0000 @@ -1,27 +1,27 @@ -/* $XTermId: charproc.c,v 1.498 2004/08/08 22:36:13 tom Exp $ */ +/* $XTermId: charproc.c,v 1.533 2004/12/01 01:27:46 tom Exp $ */ /* * $Xorg: charproc.c,v 1.6 2001/02/09 02:06:02 xorgcvs Exp $ */ -/* $XFree86: xc/programs/xterm/charproc.c,v 3.165 2004/08/08 22:36:13 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/charproc.c,v 3.166 2004/12/01 01:27:46 dickey Exp $ */ /* Copyright 1999-2003,2004 by Thomas E. Dickey All Rights Reserved Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF @@ -129,80 +129,76 @@ #include #include #include #include #include #include #if OPT_ZICONBEEP || OPT_TOOLBAR #define HANDLE_STRUCT_NOTIFY 1 #else #define HANDLE_STRUCT_NOTIFY 0 #endif static IChar doinput(void); static int set_character_class(char *s); static void FromAlternate(TScreen * screen); static void RequestResize(XtermWidget termw, int rows, int cols, int text); static void SwitchBufs(TScreen * screen); static void ToAlternate(TScreen * screen); static void VTallocbuf(void); -static void WriteText(TScreen * screen, PAIRED_CHARS(Char * str, Char * - str2), Cardinal len); +static void WriteText(TScreen * screen, + PAIRED_CHARS(Char * str, Char * str2), + Cardinal len); static void ansi_modes(XtermWidget termw, void (*func) (unsigned *p, unsigned mask)); static void bitclr(unsigned *p, unsigned mask); static void bitcpy(unsigned *p, unsigned q, unsigned mask); static void bitset(unsigned *p, unsigned mask); static void dpmodes(XtermWidget termw, void (*func) (unsigned *p, unsigned mask)); static void restoremodes(XtermWidget termw); static void savemodes(XtermWidget termw); static void unparseputn(unsigned int n, int fd); static void window_ops(XtermWidget termw); #define DoStartBlinking(s) ((s)->cursor_blink ^ (s)->cursor_blink_esc) #if OPT_BLINK_CURS || OPT_BLINK_TEXT static void HandleBlinking(XtPointer closure, XtIntervalId * id); static void StartBlinking(TScreen * screen); static void StopBlinking(TScreen * screen); #else #define StartBlinking(screen) /* nothing */ #define StopBlinking(screen) /* nothing */ #endif #if OPT_INPUT_METHOD static void PreeditPosition(TScreen * screen); #endif #define DEFAULT -1 #define BELLSUPPRESSMSEC 200 static int nparam; static ANSI reply; static int param[NPARAM]; -#ifdef UNUSED -static unsigned long ctotal; -static unsigned long ntotal; -#endif - static jmp_buf vtjmpbuf; /* event handlers */ static void HandleBell PROTO_XT_ACTIONS_ARGS; static void HandleIgnore PROTO_XT_ACTIONS_ARGS; static void HandleKeymapChange PROTO_XT_ACTIONS_ARGS; static void HandleVisualBell PROTO_XT_ACTIONS_ARGS; #if HANDLE_STRUCT_NOTIFY static void HandleStructNotify PROTO_XT_EV_HANDLER_ARGS; #endif /* * NOTE: VTInitialize zeros out the entire ".screen" component of the * XtermWidget, so make sure to add an assignment statement in VTInitialize() * for each new ".screen" field added to this resource list. */ /* Defaults */ #if OPT_ISO_COLORS @@ -253,41 +249,41 @@ ~Ctrl ~Meta :ignore() \n\ Meta :clear-saved-lines() \n\ ~Ctrl ~Meta :insert-selection(PRIMARY, CUT_BUFFER0) \n\ !Ctrl :popup-menu(fontMenu) \n\ !Lock Ctrl :popup-menu(fontMenu) \n\ !Lock Ctrl @Num_Lock :popup-menu(fontMenu) \n\ ! @Num_Lock Ctrl :popup-menu(fontMenu) \n\ ~Ctrl ~Meta :start-extend() \n\ ~Meta :select-extend() \n\ Ctrl :scroll-back(1,halfpage,m) \n\ Lock Ctrl :scroll-back(1,halfpage,m) \n\ Lock @Num_Lock Ctrl :scroll-back(1,halfpage,m) \n\ @Num_Lock Ctrl :scroll-back(1,halfpage,m) \n\ :scroll-back(5,line,m) \n\ Ctrl :scroll-forw(1,halfpage,m) \n\ Lock Ctrl :scroll-forw(1,halfpage,m) \n\ Lock @Num_Lock Ctrl :scroll-forw(1,halfpage,m) \n\ @Num_Lock Ctrl :scroll-forw(1,halfpage,m) \n\ :scroll-forw(5,line,m) \n\ :select-end(PRIMARY, CUT_BUFFER0) \n\ - :bell(0) \ + :ignore() \ "; /* PROCURA added "Meta :clear-saved-lines()" */ /* *INDENT-OFF* */ static XtActionsRec actionsList[] = { { "allow-send-events", HandleAllowSends }, { "bell", HandleBell }, { "clear-saved-lines", HandleClearSavedLines }, { "create-menu", HandleCreateMenu }, { "dired-button", DiredButton }, { "hard-reset", HandleHardReset }, { "ignore", HandleIgnore }, { "insert", HandleKeyPressed }, /* alias for insert-seven-bit */ { "insert-eight-bit", HandleEightBitKeyPressed }, { "insert-selection", HandleInsertSelection }, { "insert-seven-bit", HandleKeyPressed }, { "interpret", HandleInterpret }, { "keymap", HandleKeymapChange }, { "popup-menu", HandlePopupMenu }, { "print", HandlePrintScreen }, { "print-redir", HandlePrintControlMode }, { "quit", HandleQuit }, @@ -370,40 +366,43 @@ { "readline-button", ReadLineButton }, #endif #if OPT_RENDERFONT { "set-render-font", HandleRenderFont }, #endif #if OPT_SCO_FUNC_KEYS { "set-sco-function-keys", HandleScoFunctionKeys }, #endif #if OPT_SHIFT_FONTS { "larger-vt-font", HandleLargerFont }, { "smaller-vt-font", HandleSmallerFont }, #endif #if OPT_TEK4014 { "set-terminal-type", HandleSetTerminalType }, { "set-visibility", HandleVisibility }, { "set-tek-text", HandleSetTekText }, { "tek-page", HandleTekPage }, { "tek-reset", HandleTekReset }, { "tek-copy", HandleTekCopy }, #endif +#if OPT_TOOLBAR + { "set-toolbar", HandleToolbar }, +#endif #if OPT_WIDE_CHARS { "set-utf8-mode", HandleUTF8Mode }, #endif }; /* *INDENT-ON* */ #ifdef VMS #define OS_DEPENDENT_PRINT_COMMAND "print/delete/noflag" #else /* VMS */ #define OS_DEPENDENT_PRINT_COMMAND "lpr" #endif /* VMS */ static XtResource resources[] = { Bres(XtNallowSendEvents, XtCAllowSendEvents, screen.allowSendEvents, FALSE), Bres(XtNallowWindowOps, XtCAllowWindowOps, screen.allowWindowOps, TRUE), Bres(XtNalwaysHighlight, XtCAlwaysHighlight, screen.always_highlight, FALSE), Bres(XtNappcursorDefault, XtCAppcursorDefault, misc.appcursorDefault, FALSE), Bres(XtNappkeypadDefault, XtCAppkeypadDefault, misc.appkeypadDefault, FALSE), Bres(XtNautoWrap, XtCAutoWrap, misc.autoWrap, TRUE), @@ -487,40 +486,43 @@ {XtNpointerShape, XtCCursor, XtRCursor, sizeof(Cursor), XtOffsetOf(XtermWidgetRec, screen.pointer_cursor), XtRString, (XtPointer) "xterm"}, #ifdef ALLOWLOGGING Bres(XtNlogInhibit, XtCLogInhibit, misc.logInhibit, FALSE), Bres(XtNlogging, XtCLogging, misc.log_on, FALSE), Sres(XtNlogFile, XtCLogfile, screen.logfile, NULL), #endif #ifndef NO_ACTIVE_ICON Bres("activeIcon", "ActiveIcon", misc.active_icon, FALSE), Ires("iconBorderWidth", XtCBorderWidth, misc.icon_border_width, 2), Fres("iconFont", "IconFont", screen.fnt_icon, XtDefaultFont), Cres("iconBorderColor", XtCBorderColor, misc.icon_border_pixel, XtDefaultBackground), #endif /* NO_ACTIVE_ICON */ #if OPT_BLINK_CURS Bres(XtNcursorBlink, XtCCursorBlink, screen.cursor_blink, FALSE), +#endif + +#if OPT_BLINK_TEXT Bres(XtNshowBlinkAsBold, XtCCursorBlink, screen.blink_as_bold, DEFBLINKASBOLD), #endif #if OPT_BLINK_CURS || OPT_BLINK_TEXT Ires(XtNcursorOnTime, XtCCursorOnTime, screen.blink_on, 600), Ires(XtNcursorOffTime, XtCCursorOffTime, screen.blink_off, 300), #endif #if OPT_BOX_CHARS Bres(XtNforceBoxChars, XtCForceBoxChars, screen.force_box_chars, FALSE), Bres(XtNshowMissingGlyphs, XtCShowMissingGlyphs, screen.force_all_chars, FALSE), #endif #if OPT_BROKEN_OSC Bres(XtNbrokenLinuxOSC, XtCBrokenLinuxOSC, screen.brokenLinuxOSC, TRUE), #endif #if OPT_BROKEN_ST Bres(XtNbrokenStringTerm, XtCBrokenStringTerm, screen.brokenStringTerm, TRUE), #endif @@ -599,90 +601,89 @@ #if OPT_PRINT_COLORS Ires(XtNprintAttributes, XtCPrintAttributes, screen.print_attributes, 1), #endif #if OPT_SHIFT_FONTS Bres(XtNshiftFonts, XtCShiftFonts, misc.shift_fonts, TRUE), #endif #if OPT_SUNPC_KBD Ires(XtNctrlFKeys, XtCCtrlFKeys, misc.ctrl_fkeys, 10), #endif #if OPT_TEK4014 Bres(XtNtekInhibit, XtCTekInhibit, misc.tekInhibit, FALSE), Bres(XtNtekSmall, XtCTekSmall, misc.tekSmall, FALSE), Bres(XtNtekStartup, XtCTekStartup, screen.TekEmu, FALSE), #endif #if OPT_TOOLBAR - {XtNmenuBar, XtCMenuBar, XtRWidget, sizeof(Widget), - XtOffsetOf(XtermWidgetRec, screen.fullVwin.menu_bar), - XtRWidget, (XtPointer) 0}, - Ires(XtNmenuHeight, XtCMenuHeight, screen.fullVwin.menu_height, 25), + Wres(XtNmenuBar, XtCMenuBar, VT100_TB_INFO(menu_bar), 0), + Ires(XtNmenuHeight, XtCMenuHeight, VT100_TB_INFO(menu_height), 25), + Bres(XtNtoolBar, XtCToolBar, screen.toolbars, TRUE), #endif #if OPT_WIDE_CHARS Ires(XtNutf8, XtCUtf8, screen.utf8_mode, 3), Bres(XtNwideChars, XtCWideChars, screen.wide_chars, FALSE), Bres(XtNcjkWidth, XtCCjkWidth, misc.cjk_width, FALSE), Bres(XtNvt100Graphics, XtCVT100Graphics, screen.vt100_graphics, TRUE), Sres(XtNwideBoldFont, XtCWideBoldFont, misc.default_font.f_wb, DEFWIDEBOLDFONT), Sres(XtNwideFont, XtCWideFont, misc.default_font.f_w, DEFWIDEFONT), #endif #if OPT_LUIT_PROG Sres(XtNlocale, XtCLocale, misc.locale_str, "medium"), Sres(XtNlocaleFilter, XtCLocaleFilter, misc.localefilter, DEFLOCALEFILTER), #endif #if OPT_INPUT_METHOD Sres(XtNximFont, XtCXimFont, misc.f_x, DEFXIMFONT), #endif #if OPT_XMC_GLITCH Bres(XtNxmcInline, XtCXmcInline, screen.xmc_inline, FALSE), Bres(XtNxmcMoveSGR, XtCXmcMoveSGR, screen.move_sgr_ok, TRUE), Ires(XtNxmcAttributes, XtCXmcAttributes, screen.xmc_attributes, 1), Ires(XtNxmcGlitch, XtCXmcGlitch, screen.xmc_glitch, 0), #endif #ifdef SCROLLBAR_RIGHT Bres(XtNrightScrollBar, XtCRightScrollBar, misc.useRight, FALSE), #endif #if OPT_RENDERFONT - Ires(XtNfaceSize, XtCFaceSize, misc.face_size, DEFFACESIZE), + Dres(XtNfaceSize, XtCFaceSize, misc.face_size, DEFFACESIZE), Sres(XtNfaceName, XtCFaceName, misc.face_name, DEFFACENAME), Sres(XtNfaceNameDoublesize, XtCFaceNameDoublesize, misc.face_wide_name, DEFFACENAME), Bres(XtNrenderFont, XtCRenderFont, misc.render_font, TRUE), #endif }; static Boolean VTSetValues(Widget cur, Widget request, Widget new_arg, - ArgList args, Cardinal * num_args); + ArgList args, Cardinal *num_args); static void VTClassInit(void); static void VTDestroy(Widget w); static void VTExpose(Widget w, XEvent * event, Region region); static void VTInitialize(Widget wrequest, Widget new_arg, ArgList args, - Cardinal * num_args); + Cardinal *num_args); static void VTRealize(Widget w, XtValueMask * valuemask, XSetWindowAttributes * values); static void VTResize(Widget w); #if OPT_I18N_SUPPORT && OPT_INPUT_METHOD static void VTInitI18N(void); #endif #ifdef VMS globaldef { "xtermclassrec" } noshare #else static #endif /* VMS */ WidgetClassRec xtermClassRec = { { /* core_class fields */ @@ -692,41 +693,41 @@ VTClassInit, /* class_initialize */ NULL, /* class_part_initialize */ FALSE, /* class_inited */ VTInitialize, /* initialize */ NULL, /* initialize_hook */ VTRealize, /* realize */ actionsList, /* actions */ XtNumber(actionsList), /* num_actions */ resources, /* resources */ XtNumber(resources), /* num_resources */ NULLQUARK, /* xrm_class */ TRUE, /* compress_motion */ FALSE, /* compress_exposure */ TRUE, /* compress_enterleave */ FALSE, /* visible_interest */ VTDestroy, /* destroy */ VTResize, /* resize */ VTExpose, /* expose */ VTSetValues, /* set_values */ NULL, /* set_values_hook */ - NULL, /* set_values_almost */ + XtInheritSetValuesAlmost, /* set_values_almost */ NULL, /* get_values_hook */ NULL, /* accept_focus */ XtVersion, /* version */ NULL, /* callback_offsets */ defaultTranslations, /* tm_table */ XtInheritQueryGeometry, /* query_geometry */ XtInheritDisplayAccelerator, /* display_accelerator */ NULL /* extension */ } }; #ifdef VMS globaldef { "xtermwidgetclass" } noshare #endif /* VMS */ WidgetClass xtermWidgetClass = (WidgetClass) & xtermClassRec; /* @@ -774,41 +775,40 @@ /* *INDENT-ON* */ XtAppAddActions(app_con, input_actions, XtNumber(input_actions)); #endif XtAugmentTranslations(w, XtParseTranslationTable(defaultTranslations)); } #if OPT_ISO_COLORS /* * The terminal's foreground and background colors are set via two mechanisms: * text (cur_foreground, cur_background values that are passed down to * XDrawImageString and XDrawString) * area (X11 graphics context used in XClearArea and XFillRectangle) */ void SGR_Foreground(int color) { register TScreen *screen = &term->screen; Pixel fg; - /* FIXME HideCursor(); */ if (color >= 0) { term->flags |= FG_COLOR; } else { term->flags &= ~FG_COLOR; } fg = getXtermForeground(term->flags, color); term->cur_foreground = color; XSetForeground(screen->display, NormalGC(screen), fg); XSetBackground(screen->display, ReverseGC(screen), fg); if (NormalGC(screen) != NormalBoldGC(screen)) { XSetForeground(screen->display, NormalBoldGC(screen), fg); XSetBackground(screen->display, ReverseBoldGC(screen), fg); } } void SGR_Background(int color) { @@ -991,678 +991,679 @@ #define WriteNow() { \ unsigned single = 0; \ \ if (screen->curss) { \ dotext(screen, \ screen->gsets[(int) (screen->curss)], \ print_area, 1); \ screen->curss = 0; \ single++; \ } \ if (print_used > single) { \ dotext(screen, \ screen->gsets[(int) (screen->curgl)], \ print_area + single, \ print_used - single); \ } \ print_used = 0; \ } \ -extern int last_written_col, last_written_row; +struct ParseState { +#if OPT_VT52_MODE + Bool vt52_cup; +#endif + Const PARSE_T *groundtable; + Const PARSE_T *parsestate; + int scstype; + Bool private_function; /* distinguish private-mode from standard */ + int string_mode; /* nonzero iff we're processing a string */ + int lastchar; /* positive iff we had a graphic character */ + int nextstate; +#if OPT_WIDE_CHARS + int last_was_wide; +#endif +}; + +static struct ParseState myState; static void -VTparse(void) +doparsing(unsigned c, struct ParseState *sp) { /* Buffer for processing printable text */ static IChar *print_area; static size_t print_size, print_used; /* Buffer for processing strings (e.g., OSC ... ST) */ static Char *string_area; static size_t string_size, string_used; -#if OPT_VT52_MODE - static Bool vt52_cup = FALSE; -#endif - - Const PARSE_T *groundtable = ansi_table; TScreen *screen = &term->screen; - Const PARSE_T *parsestate; - unsigned int c; - Char *cp; - int row, col, top, bot, scstype, count; - Bool private_function; /* distinguish private-mode from standard */ - int string_mode; /* nonzero iff we're processing a string */ - int lastchar; /* positive iff we had a graphic character */ - int nextstate; + int row; + int col; + int top; + int bot; + int count; int laststate; -#if OPT_WIDE_CHARS - int last_was_wide; -#endif - - /* We longjmp back to this point in VTReset() */ - (void) setjmp(vtjmpbuf); -#if OPT_VT52_MODE - groundtable = screen->vtXX_level ? ansi_table : vt52_table; -#else - groundtable = ansi_table; -#endif - parsestate = groundtable; - scstype = 0; - private_function = False; - string_mode = 0; - lastchar = -1; /* not a legal IChar */ - nextstate = -1; /* not a legal state */ -#if OPT_WIDE_CHARS - last_was_wide = 0; -#endif - - for (;;) { - int thischar = -1; - c = doinput(); + int thischar = -1; + XTermRect myRect; + do { #if OPT_WIDE_CHARS if (screen->wide_chars && my_wcwidth(c) == 0) { int prev, precomposed; WriteNow(); - prev = getXtermCell(screen, last_written_row, last_written_col); + prev = getXtermCell(screen, + screen->last_written_row, + screen->last_written_col); precomposed = do_precomposition(prev, c); if (precomposed != -1) { - putXtermCell(screen, last_written_row, last_written_col, precomposed); + putXtermCell(screen, + screen->last_written_row, + screen->last_written_col, precomposed); } else { addXtermCombining(screen, - last_written_row, - last_written_col, c); + screen->last_written_row, + screen->last_written_col, c); } if (!screen->scroll_amt) - ScrnRefresh(screen, - last_written_row, - last_written_col, 1, 1, 1); + ScrnUpdate(screen, + screen->last_written_row, + screen->last_written_col, 1, 1, 1); continue; } #endif /* Intercept characters for printer controller mode */ if (screen->printer_controlmode == 2) { if ((c = xtermPrinterControl(c)) == 0) continue; } /* * VT52 is a little ugly in the one place it has a parameterized * control sequence, since the parameter falls after the character * that denotes the type of sequence. */ #if OPT_VT52_MODE - if (vt52_cup) { - param[nparam++] = (c & 0x7f) - 32; + if (sp->vt52_cup) { + if (nparam < NPARAM) + param[nparam++] = (c & 0x7f) - 32; if (nparam < 2) continue; - vt52_cup = FALSE; + sp->vt52_cup = FALSE; if ((row = param[0]) < 0) row = 0; if ((col = param[1]) < 0) col = 0; CursorSet(screen, row, col, term->flags); - parsestate = vt52_table; + sp->parsestate = vt52_table; param[0] = 0; param[1] = 0; continue; } #endif /* * The parsing tables all have 256 entries. If we're supporting * wide characters, we handle them by treating them the same as * printing characters. */ - laststate = nextstate; + laststate = sp->nextstate; #if OPT_WIDE_CHARS if (c > 255) { - if (parsestate == groundtable) { - nextstate = CASE_PRINT; - } else if (parsestate == sos_table) { + if (sp->parsestate == sp->groundtable) { + sp->nextstate = CASE_PRINT; + } else if (sp->parsestate == sos_table) { c &= 0xffff; if (c > 255) { TRACE(("Found code > 255 while in SOS state: %04X\n", c)); c = '?'; } } else { - nextstate = CASE_GROUND_STATE; + sp->nextstate = CASE_GROUND_STATE; } } else #endif - nextstate = parsestate[E2A(c)]; + sp->nextstate = sp->parsestate[E2A(c)]; #if OPT_BROKEN_OSC /* * Linux console palette escape sequences start with an OSC, but do * not terminate correctly. Some scripts do not check before writing * them, making xterm appear to hang (it's awaiting a valid string * terminator). Just ignore these if we see them - there's no point * in emulating bad code. */ if (screen->brokenLinuxOSC - && parsestate == sos_table) { + && sp->parsestate == sos_table) { if (string_used) { switch (string_area[0]) { case 'P': if (string_used <= 7) break; /* FALLTHRU */ case 'R': - parsestate = groundtable; - nextstate = parsestate[E2A(c)]; + sp->parsestate = sp->groundtable; + sp->nextstate = sp->parsestate[E2A(c)]; TRACE(("Reset to ground state (brokenLinuxOSC)\n")); break; } } } #endif #if OPT_BROKEN_ST /* * Before patch #171, carriage control embedded within an OSC string * would terminate it. Some (buggy, of course) applications rely on * this behavior. Accommodate them by allowing one to compile xterm * and emulate the old behavior. */ if (screen->brokenStringTerm - && parsestate == sos_table + && sp->parsestate == sos_table && c < 32) { switch (c) { case 5: /* FALLTHRU */ case 8: /* FALLTHRU */ case 9: /* FALLTHRU */ case 10: /* FALLTHRU */ case 11: /* FALLTHRU */ case 12: /* FALLTHRU */ case 13: /* FALLTHRU */ case 14: /* FALLTHRU */ case 15: /* FALLTHRU */ case 24: - parsestate = groundtable; - nextstate = parsestate[E2A(c)]; + sp->parsestate = sp->groundtable; + sp->nextstate = sp->parsestate[E2A(c)]; TRACE(("Reset to ground state (brokenStringTerm)\n")); break; } } #endif #if OPT_C1_PRINT /* * This is not completely foolproof, but will allow an application * with values in the C1 range to use them as printable characters, * provided that they are not intermixed with an escape sequence. */ if (screen->c1_printable && (c >= 128 && c < 160)) { - nextstate = (parsestate == esc_table - ? CASE_ESC_IGNORE - : parsestate[E2A(160)]); + sp->nextstate = (sp->parsestate == esc_table + ? CASE_ESC_IGNORE + : sp->parsestate[E2A(160)]); } #endif #if OPT_WIDE_CHARS /* * If we have a C1 code and the c1_printable flag is not set, simply * ignore it when it was translated from UTF-8. That is because the * value could not have been present as-is in the UTF-8. * * To see that CASE_IGNORE is a consistent value, note that it is * always used for NUL and other uninteresting C0 controls. */ #if OPT_C1_PRINT if (!screen->c1_printable) #endif if (screen->wide_chars && (c >= 128 && c < 160)) { - nextstate = CASE_IGNORE; + sp->nextstate = CASE_IGNORE; } /* * If this character is a different width than the last one, put the * previous text into the buffer and draw it now. */ - if (iswide(c) != last_was_wide) { + if (iswide(c) != sp->last_was_wide) { WriteNow(); } #endif /* * Accumulate string for printable text. This may be 8/16-bit * characters. */ - if (nextstate == CASE_PRINT) { + if (sp->nextstate == CASE_PRINT) { SafeAlloc(IChar, print_area, print_used, print_size); if (new_string == 0) { fprintf(stderr, - "Cannot allocate %d bytes for printable text\n", + "Cannot allocate %u bytes for printable text\n", new_length); continue; } #if OPT_VT52_MODE /* * Strip output text to 7-bits for VT52. We should do this for * VT100 also (which is a 7-bit device), but xterm has been * doing this for so long we shouldn't change this behavior. */ if (screen->vtXX_level < 1) c &= 0x7f; #endif print_area = new_string; print_size = new_length; - print_area[print_used++] = lastchar = thischar = c; + print_area[print_used++] = sp->lastchar = thischar = c; #if OPT_WIDE_CHARS - last_was_wide = iswide(c); + sp->last_was_wide = iswide(c); #endif if (morePtyData(screen, &VTbuffer)) { continue; } } - if (nextstate == CASE_PRINT + if (sp->nextstate == CASE_PRINT || (laststate == CASE_PRINT && print_used)) { WriteNow(); } /* * Accumulate string for APC, DCS, PM, OSC, SOS controls * This should always be 8-bit characters. */ - if (parsestate == sos_table) { + if (sp->parsestate == sos_table) { SafeAlloc(Char, string_area, string_used, string_size); if (new_string == 0) { fprintf(stderr, - "Cannot allocate %d bytes for string mode %d\n", - new_length, string_mode); + "Cannot allocate %u bytes for string mode %d\n", + new_length, sp->string_mode); continue; } #if OPT_WIDE_CHARS /* * We cannot display codes above 255, but let's try to * accommodate the application a little by not aborting the * string. */ if ((c & 0xffff) > 255) { - nextstate = CASE_PRINT; + sp->nextstate = CASE_PRINT; c = '?'; } #endif string_area = new_string; string_size = new_length; string_area[string_used++] = c; - } else if (parsestate != esc_table) { + } else if (sp->parsestate != esc_table) { /* if we were accumulating, we're not any more */ - string_mode = 0; + sp->string_mode = 0; string_used = 0; } - TRACE(("parse %04X -> %d\n", c, nextstate)); + TRACE(("parse %04X -> %d\n", c, sp->nextstate)); - switch (nextstate) { + switch (sp->nextstate) { case CASE_PRINT: - /* printable characters (see above) */ + TRACE(("CASE_PRINT - printable characters\n")); break; case CASE_GROUND_STATE: - /* exit ignore mode */ - parsestate = groundtable; + TRACE(("CASE_GROUND_STATE - exit ignore mode\n")); + sp->parsestate = sp->groundtable; break; case CASE_IGNORE: - /* Ignore character */ + TRACE(("CASE_IGNORE - Ignore character\n")); break; case CASE_ENQ: + TRACE(("CASE_ENQ - answerback\n")); for (count = 0; screen->answer_back[count] != 0; count++) unparseputc(screen->answer_back[count], screen->respond); break; case CASE_BELL: - if (string_mode == OSC) { + TRACE(("CASE_BELL - bell\n")); + if (sp->string_mode == OSC) { if (string_used) string_area[--string_used] = '\0'; do_osc(string_area, string_used, c); - parsestate = groundtable; + sp->parsestate = sp->groundtable; } else { /* bell */ Bell(XkbBI_TerminalBell, 0); } break; case CASE_BS: - /* backspace */ + TRACE(("CASE_BS - backspace\n")); CursorBack(screen, 1); break; case CASE_CR: - /* carriage return */ + /* CR */ CarriageReturn(screen); break; case CASE_ESC: - /* escape */ if_OPT_VT52_MODE(screen, { - parsestate = vt52_esc_table; + sp->parsestate = vt52_esc_table; break; }); - parsestate = esc_table; + sp->parsestate = esc_table; break; #if OPT_VT52_MODE case CASE_VT52_CUP: - vt52_cup = TRUE; + TRACE(("CASE_VT52_CUP - VT52 cursor addressing\n")); + sp->vt52_cup = TRUE; nparam = 0; break; case CASE_VT52_IGNORE: - parsestate = vt52_ignore_table; + TRACE(("CASE_VT52_IGNORE - VT52 ignore-character\n")); + sp->parsestate = vt52_ignore_table; break; #endif case CASE_VMOT: /* * form feed, line feed, vertical tab */ xtermAutoPrint(c); xtermIndex(screen, 1); if (term->flags & LINEFEED) CarriageReturn(screen); do_xevents(); break; case CASE_CBT: /* cursor backward tabulation */ if ((count = param[0]) == DEFAULT) count = 1; while ((count-- > 0) && (TabToPrevStop())) ; - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_CHT: /* cursor forward tabulation */ if ((count = param[0]) == DEFAULT) count = 1; while ((count-- > 0) && (TabToNextStop())) ; - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_TAB: /* tab */ TabToNextStop(); break; case CASE_SI: screen->curgl = 0; if_OPT_VT52_MODE(screen, { - parsestate = groundtable; + sp->parsestate = sp->groundtable; }); break; case CASE_SO: screen->curgl = 1; if_OPT_VT52_MODE(screen, { - parsestate = groundtable; + sp->parsestate = sp->groundtable; }); break; case CASE_DECDHL: xterm_DECDHL(c == '3'); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECSWL: xterm_DECSWL(); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECDWL: xterm_DECDWL(); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_SCR_STATE: /* enter scr state */ - parsestate = scrtable; + sp->parsestate = scrtable; break; case CASE_SCS0_STATE: /* enter scs state 0 */ - scstype = 0; - parsestate = scstable; + sp->scstype = 0; + sp->parsestate = scstable; break; case CASE_SCS1_STATE: /* enter scs state 1 */ - scstype = 1; - parsestate = scstable; + sp->scstype = 1; + sp->parsestate = scstable; break; case CASE_SCS2_STATE: /* enter scs state 2 */ - scstype = 2; - parsestate = scstable; + sp->scstype = 2; + sp->parsestate = scstable; break; case CASE_SCS3_STATE: /* enter scs state 3 */ - scstype = 3; - parsestate = scstable; + sp->scstype = 3; + sp->parsestate = scstable; break; case CASE_ESC_IGNORE: /* unknown escape sequence */ - parsestate = eigtable; + sp->parsestate = eigtable; break; case CASE_ESC_DIGIT: /* digit in csi or dec mode */ if ((row = param[nparam - 1]) == DEFAULT) row = 0; param[nparam - 1] = 10 * row + (c - '0'); if (param[nparam - 1] > 65535) param[nparam - 1] = 65535; - if (parsestate == csi_table) - parsestate = csi2_table; + if (sp->parsestate == csi_table) + sp->parsestate = csi2_table; break; case CASE_ESC_SEMI: /* semicolon in csi or dec mode */ if (nparam < NPARAM) param[nparam++] = DEFAULT; - if (parsestate == csi_table) - parsestate = csi2_table; + if (sp->parsestate == csi_table) + sp->parsestate = csi2_table; break; case CASE_DEC_STATE: /* enter dec mode */ - parsestate = dec_table; + sp->parsestate = dec_table; break; case CASE_DEC2_STATE: /* enter dec2 mode */ - parsestate = dec2_table; + sp->parsestate = dec2_table; break; case CASE_DEC3_STATE: /* enter dec3 mode */ - parsestate = dec3_table; + sp->parsestate = dec3_table; break; case CASE_ICH: - /* ICH */ + TRACE(("CASE_ICH - insert char\n")); if ((row = param[0]) < 1) row = 1; InsertChar(screen, row); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_CUU: - /* CUU */ + TRACE(("CASE_CUU - cursor up\n")); if ((row = param[0]) < 1) row = 1; CursorUp(screen, row); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_CUD: - /* CUD */ + TRACE(("CASE_CUD - cursor down\n")); if ((row = param[0]) < 1) row = 1; CursorDown(screen, row); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_CUF: - /* CUF */ + TRACE(("CASE_CUF - cursor forward\n")); if ((col = param[0]) < 1) col = 1; CursorForward(screen, col); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_CUB: - /* CUB */ + TRACE(("CASE_CUB - cursor backward\n")); if ((col = param[0]) < 1) col = 1; CursorBack(screen, col); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_CUP: - /* CUP | HVP */ + TRACE(("CASE_CUP - cursor position\n")); if_OPT_XMC_GLITCH(screen, { Jump_XMC(screen); }); if ((row = param[0]) < 1) row = 1; if (nparam < 2 || (col = param[1]) < 1) col = 1; CursorSet(screen, row - 1, col - 1, term->flags); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_VPA: + TRACE(("CASE_VPA - vertical position\n")); if ((row = param[0]) < 1) row = 1; CursorSet(screen, row - 1, screen->cur_col, term->flags); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_HPA: - /* HPA | CHA */ + TRACE(("CASE_HPA - horizontal position\n")); if ((col = param[0]) < 1) col = 1; CursorSet(screen, screen->cur_row, col - 1, term->flags); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_HP_BUGGY_LL: + TRACE(("CASE_HP_BUGGY_LL\n")); /* Some HP-UX applications have the bug that they assume ESC F goes to the lower left corner of the screen, regardless of what terminfo says. */ if (screen->hp_ll_bc) CursorSet(screen, screen->max_row, 0, term->flags); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_ED: - /* ED */ + TRACE(("CASE_ED - erase display\n")); do_erase_display(screen, param[0], OFF_PROTECT); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_EL: - /* EL */ + TRACE(("CASE_EL - erase line\n")); do_erase_line(screen, param[0], OFF_PROTECT); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_ECH: + TRACE(("CASE_ECH - erase char\n")); /* ECH */ ClearRight(screen, param[0] < 1 ? 1 : param[0]); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_IL: - /* IL */ + TRACE(("CASE_IL - insert line\n")); if ((row = param[0]) < 1) row = 1; InsertLine(screen, row); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DL: - /* DL */ + TRACE(("CASE_DL - delete line\n")); if ((row = param[0]) < 1) row = 1; DeleteLine(screen, row); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DCH: - /* DCH */ + TRACE(("CASE_DCH - delete char\n")); if ((row = param[0]) < 1) row = 1; DeleteChar(screen, row); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_TRACK_MOUSE: if (screen->send_mouse_pos == VT200_HIGHLIGHT_MOUSE || nparam > 1) { + TRACE(("CASE_TRACK_MOUSE\n")); /* Track mouse as long as in window and between * specified rows */ TrackMouse(param[0], param[2] - 1, param[1] - 1, param[3] - 1, param[4] - 2); } else { + TRACE(("CASE_SD - scroll down\n")); /* SD */ if ((count = param[0]) < 1) count = 1; RevScroll(screen, count); do_xevents(); } - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECID: + TRACE(("CASE_DECID\n")); if_OPT_VT52_MODE(screen, { unparseputc(ESC, screen->respond); unparseputc('/', screen->respond); unparseputc('Z', screen->respond); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; }); - param[0] = -1; /* Default ID parameter */ + param[0] = DEFAULT; /* Default ID parameter */ /* FALLTHRU */ case CASE_DA1: - /* DA1 */ + TRACE(("CASE_DA1\n")); if (param[0] <= 1) { /* less than means DEFAULT */ count = 0; reply.a_type = CSI; reply.a_pintro = '?'; /* The first param corresponds to the highest * operating level (i.e., service level) of the * emulation. A DEC terminal can be setup to * respond with a different DA response, but * there's no control sequence that modifies this. * We set it via a resource. */ if (screen->terminal_id < 200) { switch (screen->terminal_id) { case 102: reply.a_param[count++] = 6; /* VT102 */ break; case 101: reply.a_param[count++] = 1; /* VT101 */ reply.a_param[count++] = 0; /* no options */ @@ -1678,100 +1679,99 @@ reply.a_param[count++] = 2; /* printer */ reply.a_param[count++] = 6; /* selective-erase */ #if OPT_SUNPC_KBD if (term->keyboard.type == keyboardIsVT220) #endif reply.a_param[count++] = 8; /* user-defined-keys */ reply.a_param[count++] = 9; /* national replacement charsets */ reply.a_param[count++] = 15; /* technical characters */ if_OPT_ISO_COLORS(screen, { reply.a_param[count++] = 22; /* ANSI color, VT525 */ }); #if OPT_DEC_LOCATOR reply.a_param[count++] = 29; /* ANSI text locator */ #endif } reply.a_nparam = count; reply.a_inters = 0; reply.a_final = 'c'; unparseseq(&reply, screen->respond); } - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DA2: - /* DA2 */ + TRACE(("CASE_DA2\n")); if (param[0] <= 0) { /* less than means DEFAULT */ count = 0; reply.a_type = CSI; reply.a_pintro = '>'; if (screen->terminal_id >= 200) reply.a_param[count++] = 1; /* VT220 */ else reply.a_param[count++] = 0; /* VT100 (nonstandard) */ reply.a_param[count++] = XTERM_PATCH; /* Version */ reply.a_param[count++] = 0; /* options (none) */ reply.a_nparam = count; reply.a_inters = 0; reply.a_final = 'c'; unparseseq(&reply, screen->respond); } - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECRPTUI: - /* DECRPTUI */ + TRACE(("CASE_DECRPTUI\n")); if ((screen->terminal_id >= 400) && (param[0] <= 0)) { /* less than means DEFAULT */ unparseputc1(DCS, screen->respond); unparseputc('!', screen->respond); unparseputc('|', screen->respond); unparseputc('0', screen->respond); unparseputc1(ST, screen->respond); } - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_TBC: - /* TBC */ + TRACE(("CASE_TBC - tab clear\n")); if ((row = param[0]) <= 0) /* less than means default */ TabClear(term->tabs, screen->cur_col); else if (row == 3) TabZonk(term->tabs); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_SET: - /* SET */ + TRACE(("CASE_SET - set mode\n")); ansi_modes(term, bitset); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_RST: - /* RST */ + TRACE(("CASE_RST - reset mode\n")); ansi_modes(term, bitclr); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_SGR: - /* SGR */ for (row = 0; row < nparam; ++row) { if_OPT_XMC_GLITCH(screen, { Mark_XMC(screen, param[row]); }); TRACE(("CASE_SGR %d\n", param[row])); switch (param[row]) { case DEFAULT: case 0: term->flags &= ~(INVERSE | BOLD | BLINK | UNDERLINE | INVISIBLE); if_OPT_ISO_COLORS(screen, { reset_SGR_Colors(); }); break; case 1: /* Bold */ term->flags |= BOLD; if_OPT_ISO_COLORS(screen, { setExtendedFG(); }); break; @@ -1925,52 +1925,53 @@ if_OPT_ISO_COLORS(screen, { reset_SGR_Foreground(); reset_SGR_Background(); }); break; #endif case 101: case 102: case 103: case 104: case 105: case 106: case 107: if_OPT_AIX_COLORS(screen, { term->sgr_background = (param[row] - 100 + 8); setExtendedBG(); }); break; } } - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; /* DSR (except for the '?') is a superset of CPR */ case CASE_DSR: - private_function = True; + sp->private_function = True; /* FALLTHRU */ case CASE_CPR: + TRACE(("CASE_CPR - cursor position\n")); count = 0; reply.a_type = CSI; - reply.a_pintro = private_function ? '?' : 0; + reply.a_pintro = sp->private_function ? '?' : 0; reply.a_inters = 0; reply.a_final = 'n'; switch (param[0]) { case 5: /* operating status */ reply.a_param[count++] = 0; /* (no malfunction ;-) */ break; case 6: /* CPR */ /* DECXCPR (with page=0) */ reply.a_param[count++] = screen->cur_row + 1; reply.a_param[count++] = screen->cur_col + 1; reply.a_final = 'R'; break; case 15: /* printer status */ reply.a_param[count++] = 13; /* implement printer */ break; case 25: @@ -1982,615 +1983,716 @@ reply.a_param[count++] = 27; reply.a_param[count++] = 1; /* North American */ if (screen->terminal_id >= 400) { reply.a_param[count++] = 0; /* ready */ reply.a_param[count++] = 0; /* LK201 */ } break; case 53: /* Locator status */ #if OPT_DEC_LOCATOR reply.a_param[count++] = 50; /* locator ready */ #else reply.a_param[count++] = 53; /* no locator */ #endif break; } if ((reply.a_nparam = count) != 0) unparseseq(&reply, screen->respond); - parsestate = groundtable; - private_function = False; + sp->parsestate = sp->groundtable; + sp->private_function = False; break; case CASE_MC: + TRACE(("CASE_MC - media control\n")); xtermMediaControl(param[0], FALSE); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DEC_MC: + TRACE(("CASE_DEC_MC - DEC media control\n")); xtermMediaControl(param[0], TRUE); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_HP_MEM_LOCK: case CASE_HP_MEM_UNLOCK: + TRACE(("%s\n", ((sp->parsestate[c] == CASE_HP_MEM_LOCK) + ? "CASE_HP_MEM_LOCK" + : "CASE_HP_MEM_UNLOCK"))); if (screen->scroll_amt) FlushScroll(screen); - if (parsestate[c] == CASE_HP_MEM_LOCK) + if (sp->parsestate[c] == CASE_HP_MEM_LOCK) screen->top_marg = screen->cur_row; else screen->top_marg = 0; - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECSTBM: - /* DECSTBM - set scrolling region */ + TRACE(("CASE_DECSTBM - set scrolling region\n")); if ((top = param[0]) < 1) top = 1; if (nparam < 2 || (bot = param[1]) == DEFAULT || bot > screen->max_row + 1 || bot == 0) bot = screen->max_row + 1; if (bot > top) { if (screen->scroll_amt) FlushScroll(screen); screen->top_marg = top - 1; screen->bot_marg = bot - 1; CursorSet(screen, 0, 0, term->flags); } - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECREQTPARM: - /* DECREQTPARM */ + TRACE(("CASE_DECREQTPARM\n")); if (screen->terminal_id < 200) { /* VT102 */ if ((row = param[0]) == DEFAULT) row = 0; if (row == 0 || row == 1) { reply.a_type = CSI; reply.a_pintro = 0; reply.a_nparam = 7; reply.a_param[0] = row + 2; reply.a_param[1] = 1; /* no parity */ reply.a_param[2] = 1; /* eight bits */ reply.a_param[3] = 128; /* transmit 38.4k baud */ reply.a_param[4] = 128; /* receive 38.4k baud */ reply.a_param[5] = 1; /* clock multiplier ? */ reply.a_param[6] = 0; /* STP flags ? */ reply.a_inters = 0; reply.a_final = 'x'; unparseseq(&reply, screen->respond); } } - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECSET: /* DECSET */ #if OPT_VT52_MODE if (screen->vtXX_level != 0) #endif dpmodes(term, bitset); - parsestate = groundtable; + sp->parsestate = sp->groundtable; #if OPT_TEK4014 if (screen->TekEmu) return; #endif break; case CASE_DECRST: /* DECRST */ dpmodes(term, bitclr); #if OPT_VT52_MODE if (screen->vtXX_level == 0) - groundtable = vt52_table; + sp->groundtable = vt52_table; else if (screen->terminal_id >= 100) - groundtable = ansi_table; + sp->groundtable = ansi_table; #endif - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECALN: - /* DECALN */ + TRACE(("CASE_DECALN - alignment test\n")); if (screen->cursor_state) HideCursor(); - for (row = screen->max_row; row >= 0; row--) { - bzero(SCRN_BUF_ATTRS(screen, row), - col = screen->max_col + 1); - for (cp = SCRN_BUF_CHARS(screen, row); col > 0; col--) - *cp++ = (Char) 'E'; - if_OPT_WIDE_CHARS(screen, { - bzero(SCRN_BUF_WIDEC(screen, row), - screen->max_col + 1); - }); - } - ScrnRefresh(screen, 0, 0, screen->max_row + 1, - screen->max_col + 1, False); - parsestate = groundtable; + screen->top_marg = 0; + screen->bot_marg = screen->max_row; + CursorSet(screen, 0, 0, term->flags); + xtermParseRect(screen, 0, 0, &myRect); + ScrnFillRectangle(screen, &myRect, 'E', 0); + sp->parsestate = sp->groundtable; break; case CASE_GSETS: - TRACE(("CASE_GSETS(%d) = '%c'\n", scstype, c)); + TRACE(("CASE_GSETS(%d) = '%c'\n", sp->scstype, c)); if (screen->vtXX_level != 0) - screen->gsets[scstype] = c; - parsestate = groundtable; + screen->gsets[sp->scstype] = c; + sp->parsestate = sp->groundtable; break; case CASE_DECSC: - /* DECSC */ + TRACE(("CASE_DECSC - save cursor\n")); CursorSave(term); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECRC: - /* DECRC */ + TRACE(("CASE_DECRC - restore cursor\n")); CursorRestore(term); if_OPT_ISO_COLORS(screen, { setExtendedFG(); }); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECKPAM: - /* DECKPAM */ + TRACE(("CASE_DECKPAM\n")); term->keyboard.flags |= MODE_DECKPAM; update_appkeypad(); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECKPNM: - /* DECKPNM */ + TRACE(("CASE_DECKPNM\n")); term->keyboard.flags &= ~MODE_DECKPAM; update_appkeypad(); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_CSI_QUOTE_STATE: - parsestate = csi_quo_table; + sp->parsestate = csi_quo_table; break; #if OPT_VT52_MODE case CASE_VT52_FINISH: TRACE(("CASE_VT52_FINISH terminal_id %d, vtXX_level %d\n", screen->terminal_id, screen->vtXX_level)); if (screen->terminal_id >= 100 && screen->vtXX_level == 0) { - groundtable = - parsestate = ansi_table; + sp->groundtable = + sp->parsestate = ansi_table; screen->vtXX_level = screen->vt52_save_level; screen->curgl = screen->vt52_save_curgl; screen->curgr = screen->vt52_save_curgr; screen->curss = screen->vt52_save_curss; memmove(screen->gsets, screen->vt52_save_gsets, sizeof(screen->gsets)); } break; #endif case CASE_ANSI_LEVEL_1: TRACE(("CASE_ANSI_LEVEL_1\n")); set_ansi_conformance(screen, 1); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_ANSI_LEVEL_2: TRACE(("CASE_ANSI_LEVEL_2\n")); set_ansi_conformance(screen, 2); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_ANSI_LEVEL_3: TRACE(("CASE_ANSI_LEVEL_3\n")); set_ansi_conformance(screen, 3); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECSCL: TRACE(("CASE_DECSCL(%d,%d)\n", param[0], param[1])); if (param[0] >= 61 && param[0] <= 65) { /* * VT300, VT420, VT520 manuals claim that DECSCL does a hard * reset (RIS). VT220 manual states that it is a soft reset. * Perhaps both are right (unlikely). Kermit says it's soft. */ VTReset(FALSE, FALSE); screen->vtXX_level = param[0] - 60; if (param[0] > 61) { if (param[1] == 1) show_8bit_control(False); else if (param[1] == 0 || param[1] == 2) show_8bit_control(True); } } - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECSCA: + TRACE(("CASE_DECSCA\n")); screen->protected_mode = DEC_PROTECT; if (param[0] <= 0 || param[0] == 2) term->flags &= ~PROTECTED; else if (param[0] == 1) term->flags |= PROTECTED; - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECSED: - /* DECSED */ + TRACE(("CASE_DECSED\n")); do_erase_display(screen, param[0], DEC_PROTECT); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECSEL: - /* DECSEL */ + TRACE(("CASE_DECSEL\n")); do_erase_line(screen, param[0], DEC_PROTECT); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_ST: + TRACE(("CASE_ST: End of String (%d bytes)\n", string_used)); if (!string_used) break; string_area[--string_used] = '\0'; - switch (string_mode) { + switch (sp->string_mode) { case APC: /* ignored */ break; case DCS: do_dcs(string_area, string_used); break; case OSC: do_osc(string_area, string_used, ST); break; case PM: /* ignored */ break; case SOS: /* ignored */ break; } - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_SOS: - TRACE(("begin SOS: Start of String\n")); - string_mode = SOS; - parsestate = sos_table; + TRACE(("CASE_SOS: Start of String\n")); + sp->string_mode = SOS; + sp->parsestate = sos_table; break; case CASE_PM: - TRACE(("begin PM: Privacy Message\n")); - string_mode = PM; - parsestate = sos_table; + TRACE(("CASE_PM: Privacy Message\n")); + sp->string_mode = PM; + sp->parsestate = sos_table; break; case CASE_DCS: - TRACE(("begin DCS: Device Control String\n")); - string_mode = DCS; - parsestate = sos_table; + TRACE(("CASE_DCS: Device Control String\n")); + sp->string_mode = DCS; + sp->parsestate = sos_table; break; case CASE_APC: - TRACE(("begin APC: Application Program Command\n")); - string_mode = APC; - parsestate = sos_table; + TRACE(("CASE_APC: Application Program Command\n")); + sp->string_mode = APC; + sp->parsestate = sos_table; break; case CASE_SPA: + TRACE(("CASE_SPA - start protected area\n")); screen->protected_mode = ISO_PROTECT; term->flags |= PROTECTED; - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_EPA: + TRACE(("CASE_EPA - end protected area\n")); term->flags &= ~PROTECTED; - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_SU: - /* SU */ + TRACE(("CASE_SU - scroll up\n")); if ((count = param[0]) < 1) count = 1; xtermScroll(screen, count); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_IND: - /* IND */ + TRACE(("CASE_IND - index\n")); xtermIndex(screen, 1); do_xevents(); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_CPL: - /* cursor prev line */ + TRACE(("CASE_CPL - cursor prev line\n")); CursorPrevLine(screen, param[0]); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_CNL: - /* cursor next line */ + TRACE(("CASE_NPL - cursor next line\n")); CursorNextLine(screen, param[0]); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_NEL: - /* NEL */ + TRACE(("CASE_NEL\n")); xtermIndex(screen, 1); CarriageReturn(screen); do_xevents(); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_HTS: - /* HTS */ + TRACE(("CASE_HTS - horizontal tab set\n")); TabSet(term->tabs, screen->cur_col); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_RI: - /* RI */ + TRACE(("CASE_RI - reverse index\n")); RevIndex(screen, 1); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_SS2: - /* SS2 */ + TRACE(("CASE_SS2\n")); screen->curss = 2; - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_SS3: - /* SS3 */ + TRACE(("CASE_SS3\n")); screen->curss = 3; - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_CSI_STATE: /* enter csi state */ nparam = 1; param[0] = DEFAULT; - parsestate = csi_table; + sp->parsestate = csi_table; break; case CASE_ESC_SP_STATE: /* esc space */ - parsestate = esc_sp_table; + sp->parsestate = esc_sp_table; break; case CASE_CSI_EX_STATE: /* csi exclamation */ - parsestate = csi_ex_table; + sp->parsestate = csi_ex_table; break; #if OPT_DEC_LOCATOR case CASE_CSI_TICK_STATE: /* csi tick (') */ - parsestate = csi_tick_table; + sp->parsestate = csi_tick_table; break; case CASE_DECEFR: - TRACE(("DECEFR - Enable Filter Rectangle\n")); + TRACE(("CASE_DECEFR - Enable Filter Rectangle\n")); if (screen->send_mouse_pos == DEC_LOCATOR) { MotionOff(screen, term); if ((screen->loc_filter_top = param[0]) < 1) screen->loc_filter_top = LOC_FILTER_POS; if (nparam < 2 || (screen->loc_filter_left = param[1]) < 1) screen->loc_filter_left = LOC_FILTER_POS; if (nparam < 3 || (screen->loc_filter_bottom = param[2]) < 1) screen->loc_filter_bottom = LOC_FILTER_POS; if (nparam < 4 || (screen->loc_filter_right = param[3]) < 1) screen->loc_filter_right = LOC_FILTER_POS; InitLocatorFilter(term); } - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECELR: MotionOff(screen, term); if (param[0] <= 0 || param[0] > 2) { screen->send_mouse_pos = MOUSE_OFF; TRACE(("DECELR - Disable Locator Reports\n")); } else { TRACE(("DECELR - Enable Locator Reports\n")); screen->send_mouse_pos = DEC_LOCATOR; if (param[0] == 2) { screen->locator_reset = TRUE; } else { screen->locator_reset = FALSE; } if (nparam < 2 || param[1] != 1) { screen->locator_pixels = FALSE; } else { screen->locator_pixels = TRUE; } screen->loc_filter = FALSE; } - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECSLE: TRACE(("DECSLE - Select Locator Events\n")); for (count = 0; count < nparam; ++count) { switch (param[count]) { case DEFAULT: case 0: MotionOff(screen, term); screen->loc_filter = FALSE; screen->locator_events = 0; break; case 1: screen->locator_events |= LOC_BTNS_DN; break; case 2: screen->locator_events &= ~LOC_BTNS_DN; break; case 3: screen->locator_events |= LOC_BTNS_UP; break; case 4: screen->locator_events &= ~LOC_BTNS_UP; break; } } - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECRQLP: TRACE(("DECRQLP - Request Locator Position\n")); if (param[0] < 2) { /* Issue DECLRP Locator Position Report */ GetLocatorPosition(term); } - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; #endif /* OPT_DEC_LOCATOR */ +#if OPT_DEC_RECTOPS + case CASE_CSI_DOLLAR_STATE: + /* csi dollar ($) */ + if (screen->vtXX_level >= 4) + sp->parsestate = csi_dollar_table; + else + sp->parsestate = eigtable; + break; + + case CASE_CSI_STAR_STATE: + /* csi dollar (*) */ + if (screen->vtXX_level >= 4) + sp->parsestate = csi_star_table; + else + sp->parsestate = eigtable; + break; + + case CASE_DECCRA: + TRACE(("CASE_DECCRA - Copy rectangular area\n")); + xtermParseRect(screen, nparam, param, &myRect); + ScrnCopyRectangle(screen, &myRect, nparam - 5, param + 5); + break; + + case CASE_DECERA: + TRACE(("CASE_DECERA - Erase rectangular area\n")); + xtermParseRect(screen, nparam, param, &myRect); + ScrnFillRectangle(screen, &myRect, ' ', 0); + break; + + case CASE_DECFRA: + TRACE(("CASE_DECFRA - Fill rectangular area\n")); + if (nparam > 0 + && ((param[0] >= 32 && param[0] <= 126) + || (param[0] >= 160 && param[0] <= 255))) { + xtermParseRect(screen, nparam - 1, param + 1, &myRect); + ScrnFillRectangle(screen, &myRect, param[0], term->flags); + } + break; + + case CASE_DECSERA: + TRACE(("CASE_DECSERA - Selective erase rectangular area\n")); + xtermParseRect(screen, nparam > 4 ? 4 : nparam, param, &myRect); + ScrnWipeRectangle(screen, &myRect); + break; + + case CASE_DECSACE: + TRACE(("CASE_DECSACE - Select attribute change extent\n")); + screen->cur_decsace = param[0]; + break; + + case CASE_DECCARA: + TRACE(("CASE_DECCARA - Change attributes in rectangular area\n")); + xtermParseRect(screen, nparam > 4 ? 4 : nparam, param, &myRect); + ScrnMarkRectangle(screen, &myRect, False, nparam - 4, param + 4); + break; + + case CASE_DECRARA: + TRACE(("CASE_DECRARA - Reverse attributes in rectangular area\n")); + xtermParseRect(screen, nparam > 4 ? 4 : nparam, param, &myRect); + ScrnMarkRectangle(screen, &myRect, True, nparam - 4, param + 4); + break; +#else + case CASE_CSI_DOLLAR_STATE: + /* csi dollar ($) */ + sp->parsestate = eigtable; + break; + + case CASE_CSI_STAR_STATE: + /* csi dollar (*) */ + sp->parsestate = eigtable; + break; +#endif /* OPT_DEC_RECTOPS */ + case CASE_S7C1T: + TRACE(("CASE_S7C1T\n")); show_8bit_control(False); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_S8C1T: + TRACE(("CASE_S8C1T\n")); #if OPT_VT52_MODE if (screen->vtXX_level <= 1) break; #endif show_8bit_control(True); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_OSC: - TRACE(("begin OSC: Operating System Command\n")); - parsestate = sos_table; - string_mode = OSC; + TRACE(("CASE_OSC: Operating System Command\n")); + sp->parsestate = sos_table; + sp->string_mode = OSC; break; case CASE_RIS: - /* RIS */ + TRACE(("CASE_RIS\n")); VTReset(TRUE, TRUE); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_DECSTR: - /* DECSTR */ + TRACE(("CASE_DECSTR\n")); VTReset(FALSE, FALSE); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_REP: - /* REP */ - if (lastchar >= 0 && - groundtable[E2A(lastchar)] == CASE_PRINT) { + TRACE(("CASE_REP\n")); + if (sp->lastchar >= 0 && + sp->groundtable[E2A(sp->lastchar)] == CASE_PRINT) { IChar repeated[2]; count = (param[0] < 1) ? 1 : param[0]; - repeated[0] = lastchar; + repeated[0] = sp->lastchar; while (count-- > 0) { dotext(screen, screen->gsets[(int) (screen->curgl)], repeated, 1); } } - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_LS2: - /* LS2 */ + TRACE(("CASE_LS2\n")); screen->curgl = 2; - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_LS3: - /* LS3 */ + TRACE(("CASE_LS3\n")); screen->curgl = 3; - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_LS3R: - /* LS3R */ + TRACE(("CASE_LS3R\n")); screen->curgr = 3; - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_LS2R: - /* LS2R */ + TRACE(("CASE_LS2R\n")); screen->curgr = 2; - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_LS1R: - /* LS1R */ + TRACE(("CASE_LS1R\n")); screen->curgr = 1; - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_XTERM_SAVE: savemodes(term); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_XTERM_RESTORE: restoremodes(term); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; case CASE_XTERM_WINOPS: + TRACE(("CASE_XTERM_WINOPS\n")); if (screen->allowWindowOps) window_ops(term); - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; #if OPT_WIDE_CHARS case CASE_ESC_PERCENT: - parsestate = esc_pct_table; + sp->parsestate = esc_pct_table; break; case CASE_UTF8: /* If we did not set UTF-8 mode from resource or the * command-line, allow it to be enabled/disabled by * control sequence. */ if (!screen->wide_chars) { WriteNow(); ChangeToWide(screen); } if (screen->wide_chars && screen->utf8_mode != 2) { switchPtyData(screen, c == 'G'); TRACE(("UTF8 mode %s\n", BtoS(screen->utf8_mode))); } else { TRACE(("UTF8 mode NOT turned %s (%s)\n", BtoS(c == 'G'), (screen->utf8_mode == 2) ? "UTF-8 mode set from command-line" : "wideChars resource was not set")); } - parsestate = groundtable; + sp->parsestate = sp->groundtable; break; #endif case CASE_CSI_IGNORE: - parsestate = cigtable; + sp->parsestate = cigtable; break; } - if (parsestate == groundtable) - lastchar = thischar; + if (sp->parsestate == sp->groundtable) + sp->lastchar = thischar; + } while (0); +} + +static void +VTparse(void) +{ + TScreen *screen; + + /* We longjmp back to this point in VTReset() */ + (void) setjmp(vtjmpbuf); + screen = &term->screen; + memset(&myState, 0, sizeof(myState)); +#if OPT_VT52_MODE + myState.groundtable = screen->vtXX_level ? ansi_table : vt52_table; +#else + myState.groundtable = ansi_table; +#endif + myState.parsestate = myState.groundtable; + myState.lastchar = -1; /* not a legal IChar */ + myState.nextstate = -1; /* not a legal state */ + + for (;;) { + doparsing(doinput(), &myState); } } static Char *v_buffer; /* pointer to physical buffer */ static Char *v_bufstr = NULL; /* beginning of area to write */ static Char *v_bufptr; /* end of area to write */ static Char *v_bufend; /* end of physical buffer */ /* Write data to the pty as typed by the user, pasted with the mouse, or generated by us in response to a query ESC sequence. */ int v_write(int f, Char * data, int len) { int riten; int c = len; if (v_bufstr == NULL && len > 0) { v_buffer = (Char *) XtMalloc(len); v_bufstr = v_buffer; @@ -3033,91 +3135,90 @@ * for line-drawing characters. */ if (!screen->utf8_mode || (screen->vt100_graphics && charset == '0')) #endif if (!xtermCharSetOut(buf, buf + len, charset)) return; if_OPT_XMC_GLITCH(screen, { Cardinal n; if (charset != '?') { for (n = 0; n < len; n++) { if (buf[n] == XMC_GLITCH) buf[n] = XMC_GLITCH + 1; } } }); #if OPT_WIDE_CHARS - for (offset = 0; offset < len && chars_chomped > 0; offset += chars_chomped) { + for (offset = 0; + offset < len && (chars_chomped > 0 || screen->do_wrap); + offset += chars_chomped) { int width_available = screen->max_col - screen->cur_col + 1; - int width_here = 0, need_wrap = 0; + int width_here = 0; + int need_wrap = 0; chars_chomped = 0; if (screen->do_wrap && (term->flags & WRAPAROUND)) { /* mark that we had to wrap this line */ ScrnSetWrapped(screen, screen->cur_row); xtermAutoPrint('\n'); xtermIndex(screen, 1); screen->cur_col = 0; screen->do_wrap = 0; width_available = screen->max_col - screen->cur_col + 1; } while (width_here <= width_available && chars_chomped < (len - offset)) { if (!screen->utf8_mode || (screen->vt100_graphics && charset == '0')) width_here++; else width_here += my_wcwidth(buf[chars_chomped + offset]); chars_chomped++; } if (width_here > width_available) { chars_chomped--; if (!screen->utf8_mode || (screen->vt100_graphics && charset == '0')) width_here--; else width_here -= my_wcwidth(buf[chars_chomped + offset]); need_wrap = 1; - } - - if (width_here == width_available) { + } else if (width_here == width_available) { need_wrap = 1; - } - - if (chars_chomped != (len - offset)) { + } else if (chars_chomped != (len - offset)) { need_wrap = 1; } /* * Split the wide characters back into separate arrays of 8-bit * characters so we can use the existing interface. * * FIXME: If we rewrote this interface, it would involve * rewriting all of the memory-management for the screen * buffers (perhaps this is simpler). */ - { + if (chars_chomped != 0) { static unsigned limit; static Char *hibyte, *lobyte; Boolean both = False; unsigned j, k; if (chars_chomped >= limit) { limit = (chars_chomped + 1) * 2; lobyte = (Char *) XtRealloc((char *) lobyte, limit); hibyte = (Char *) XtRealloc((char *) hibyte, limit); } for (j = offset; j < offset + chars_chomped; j++) { k = j - offset; lobyte[k] = buf[j]; if (buf[j] > 255) { hibyte[k] = (buf[j] >> 8); both = True; } else { hibyte[k] = 0; } } @@ -3204,89 +3305,84 @@ #endif /* * write a string str of length len onto the screen at * the current cursor position. update cursor position. */ static void WriteText(TScreen * screen, PAIRED_CHARS(Char * str, Char * str2), Cardinal len) { unsigned test; unsigned flags = term->flags; int fg_bg = makeColorPair(term->cur_foreground, term->cur_background); GC currentGC; TRACE(("WriteText (%2d,%2d) (%d) %3d:%s\n", screen->cur_row, screen->cur_col, curXtermChrSet(screen->cur_row), len, visibleChars(PAIRED_CHARS(str, str2), len))); + if (ScrnHaveSelection(screen) + && ScrnIsLineInSelection(screen, screen->cur_row - screen->topline)) { + ScrnDisownSelection(screen); + } + if (screen->cur_row - screen->topline <= screen->max_row) { if (screen->cursor_state) HideCursor(); if (flags & INSERT) { InsertChar(screen, visual_width(PAIRED_CHARS(str, str2), len)); } if (!AddToRefresh(screen)) { /* make sure that the correct GC is current */ currentGC = updatedXtermGC(screen, flags, fg_bg, False); if (screen->scroll_amt) FlushScroll(screen); if (flags & INVISIBLE) { memset(str, ' ', len); if_OPT_WIDE_CHARS(screen, { if (str2 != 0) - memset(str2, ' ', len); + memset(str2, 0, len); }); } TRACE(("WriteText calling drawXtermText (%d,%d)\n", screen->cur_col, screen->cur_row)); test = flags; checkVeryBoldColors(test, term->cur_foreground); drawXtermText(screen, test & DRAWX_MASK, currentGC, CurCursorX(screen, screen->cur_row, screen->cur_col), CursorY(screen, screen->cur_row), curXtermChrSet(screen->cur_row), PAIRED_CHARS(str, str2), len, 0); resetXtermGC(screen, flags, False); - - /* - * The following statements compile data to compute the - * average number of characters written on each call to - * XText. The data may be examined via the use of a - * "hidden" escape sequence. - */ -#ifdef UNUSED - ctotal += len; - ++ntotal; -#endif } } + ScreenWrite(screen, PAIRED_CHARS(str, str2), flags, fg_bg, len); CursorForward(screen, visual_width(PAIRED_CHARS(str, str2), len)); #if OPT_ZICONBEEP /* Flag icon name with "***" on window output when iconified. */ if (zIconBeep && mapstate == IsUnmapped && !zIconBeep_flagged) { static char *icon_name; static Arg args[] = { {XtNiconName, (XtArgVal) & icon_name} }; icon_name = NULL; XtGetValues(toplevel, args, XtNumber(args)); if (icon_name != NULL) { zIconBeep_flagged = True; Changename(icon_name); } if (zIconBeep > 0) { @@ -3330,50 +3426,46 @@ if (buf == NULL) { zIconBeep_flagged = True; return; } strcpy(buf, icon_name + 4); Changename(buf); free(buf); } } #endif /* OPT_ZICONBEEP */ mapstate = !IsUnmapped; break; case UnmapNotify: TRACE(("HandleStructNotify(UnmapNotify)\n")); mapstate = IsUnmapped; break; case ConfigureNotify: TRACE(("HandleStructNotify(ConfigureNotify)\n")); #if OPT_TOOLBAR if (term->screen.Vshow) { -#ifndef NO_ACTIVE_ICON - struct _vtwin *Vwin = term->screen.whichVwin; -#else - struct _vtwin *Vwin = &(term->screen.fullVwin); -#endif - if (Vwin->menu_bar) { - XtVaGetValues(Vwin->menu_bar, - XtNheight, &Vwin->menu_height, + struct _vtwin *Vwin = WhichVWin(&(term->screen)); + if (Vwin->tb_info.menu_bar) { + XtVaGetValues(Vwin->tb_info.menu_bar, + XtNheight, &Vwin->tb_info.menu_height, (XtPointer) 0); - TRACE(("...menu_height %d\n", Vwin->menu_height)); + TRACE(("...menu_height %d\n", Vwin->tb_info.menu_height)); } } #endif break; default: TRACE(("HandleStructNotify(event %d)\n", event->type)); break; } } #endif /* HANDLE_STRUCT_NOTIFY */ #if OPT_BLINK_CURS static void SetCursorBlink(register TScreen * screen, int enable) { screen->cursor_blink = enable; if (DoStartBlinking(screen)) { StartBlinking(screen); } else { #if !OPT_BLINK_TEXT @@ -3500,40 +3592,45 @@ case 6: /* DECOM */ (*func) (&termw->flags, ORIGIN); CursorSet(screen, 0, 0, termw->flags); break; case 7: /* DECAWM */ (*func) (&termw->flags, WRAPAROUND); update_autowrap(); break; case 8: /* DECARM */ /* ignore autorepeat * XAutoRepeatOn() and XAutoRepeatOff() can do this, but only * for the whole display - not limited to a given window. */ break; case SET_X10_MOUSE: /* MIT bogus sequence */ MotionOff(screen, termw); set_mousemode(X10_MOUSE); break; +#if OPT_TOOLBAR + case 10: /* rxvt */ + ShowToolbar(func == bitset); + break; +#endif #if OPT_BLINK_CURS case 12: /* att610: Start/stop blinking cursor */ if (screen->cursor_blink_res) { screen->cursor_blink_esc = (func == bitset) ? ON : OFF; SetCursorBlink(screen, screen->cursor_blink); } break; #endif case 18: /* DECPFF: print form feed */ screen->printer_formfeed = (func == bitset) ? ON : OFF; break; case 19: /* DECPEX: print extent */ screen->printer_extent = (func == bitset) ? ON : OFF; break; case 25: /* DECTCEM: Show/hide cursor (VT200) */ screen->cursor_set = (func == bitset) ? ON : OFF; break; case 30: /* rxvt */ if (screen->fullVwin.sb_info.width != ((func == bitset) ? ON : OFF)) ToggleScrollBar(termw); @@ -3721,67 +3818,73 @@ set_mouseflag(paste_quotes); break; case SET_PASTE_LITERAL_NL: set_mouseflag(paste_literal_nl); break; #endif /* OPT_READLINE */ } } } /* * process xterm private modes save */ static void savemodes(XtermWidget termw) { register TScreen *screen = &termw->screen; register int i; for (i = 0; i < nparam; i++) { + TRACE(("savemodes %d\n", param[i])); switch (param[i]) { case 1: /* DECCKM */ DoSM(DP_DECCKM, termw->keyboard.flags & MODE_DECCKM); break; case 3: /* DECCOLM */ if (screen->c132) DoSM(DP_DECCOLM, termw->flags & IN132COLUMNS); break; case 4: /* DECSCLM (slow scroll) */ DoSM(DP_DECSCLM, termw->flags & SMOOTHSCROLL); break; case 5: /* DECSCNM */ DoSM(DP_DECSCNM, termw->flags & REVERSE_VIDEO); break; case 6: /* DECOM */ DoSM(DP_DECOM, termw->flags & ORIGIN); break; case 7: /* DECAWM */ DoSM(DP_DECAWM, termw->flags & WRAPAROUND); break; case 8: /* DECARM */ /* ignore autorepeat */ break; case SET_X10_MOUSE: /* mouse bogus sequence */ DoSM(DP_X_X10MSE, screen->send_mouse_pos); break; +#if OPT_TOOLBAR + case 10: /* rxvt */ + DoSM(DP_TOOLBAR, screen->toolbars); + break; +#endif #if OPT_BLINK_CURS case 12: /* att610: Start/stop blinking cursor */ if (screen->cursor_blink_res) { DoSM(DP_CRS_BLINK, screen->cursor_blink_esc); } break; #endif case 18: /* DECPFF: print form feed */ DoSM(DP_PRN_FORMFEED, screen->printer_formfeed); break; case 19: /* DECPEX: print extent */ DoSM(DP_PRN_EXTENT, screen->printer_extent); break; case 25: /* DECTCEM: Show/hide cursor (VT200) */ DoSM(DP_CRS_VISIBLE, screen->cursor_set); break; case 40: /* 132 column mode */ DoSM(DP_X_DECCOLM, screen->c132); break; case 41: /* curses hack */ @@ -3831,40 +3934,41 @@ SCREEN_FLAG_save(screen, paste_quotes); break; case SET_PASTE_LITERAL_NL: SCREEN_FLAG_save(screen, paste_literal_nl); break; #endif /* OPT_READLINE */ } } } /* * process xterm private modes restore */ static void restoremodes(XtermWidget termw) { register TScreen *screen = &termw->screen; register int i, j; for (i = 0; i < nparam; i++) { + TRACE(("restoremodes %d\n", param[i])); switch (param[i]) { case 1: /* DECCKM */ bitcpy(&termw->keyboard.flags, screen->save_modes[DP_DECCKM], MODE_DECCKM); update_appcursor(); break; case 3: /* DECCOLM */ if (screen->c132) { ClearScreen(screen); CursorSet(screen, 0, 0, termw->flags); if ((j = (screen->save_modes[DP_DECCOLM] & IN132COLUMNS) ? 132 : 80) != ((termw->flags & IN132COLUMNS) ? 132 : 80) || j != screen->max_col + 1) RequestResize(termw, -1, j, TRUE); bitcpy(&termw->flags, screen->save_modes[DP_DECCOLM], IN132COLUMNS); } break; case 4: /* DECSCLM (slow scroll) */ @@ -3882,40 +3986,46 @@ bitcpy(&termw->flags, screen->save_modes[DP_DECSCNM], REVERSE_VIDEO); ReverseVideo(termw); /* update_reversevideo done in RevVid */ } break; case 6: /* DECOM */ bitcpy(&termw->flags, screen->save_modes[DP_DECOM], ORIGIN); CursorSet(screen, 0, 0, termw->flags); break; case 7: /* DECAWM */ bitcpy(&termw->flags, screen->save_modes[DP_DECAWM], WRAPAROUND); update_autowrap(); break; case 8: /* DECARM */ /* ignore autorepeat */ break; case SET_X10_MOUSE: /* MIT bogus sequence */ DoRM(DP_X_X10MSE, screen->send_mouse_pos); break; +#if OPT_TOOLBAR + case 10: /* rxvt */ + DoRM(DP_TOOLBAR, screen->toolbars); + ShowToolbar(screen->toolbars); + break; +#endif #if OPT_BLINK_CURS case 12: /* att610: Start/stop blinking cursor */ if (screen->cursor_blink_res) { DoRM(DP_CRS_BLINK, screen->cursor_blink_esc); SetCursorBlink(screen, screen->cursor_blink); } break; #endif case 18: /* DECPFF: print form feed */ DoRM(DP_PRN_FORMFEED, screen->printer_formfeed); break; case 19: /* DECPEX: print extent */ DoRM(DP_PRN_EXTENT, screen->printer_extent); break; case 25: /* DECTCEM: Show/hide cursor (VT200) */ DoRM(DP_CRS_VISIBLE, screen->cursor_set); break; case 40: /* 132 column mode */ DoRM(DP_X_DECCOLM, screen->c132); update_allow132(); @@ -4028,40 +4138,41 @@ unparseputc(ESC, screen->respond); unparseputc('\\', screen->respond); } /* * Window operations (from CDE dtterm description, as well as extensions). * See also "allowWindowOps" resource. */ static void window_ops(XtermWidget termw) { TScreen *screen = &termw->screen; XWindowChanges values; XWindowAttributes win_attrs; XTextProperty text; unsigned value_mask; unsigned root_width; unsigned root_height; + TRACE(("window_ops %d\n", param[0])); switch (param[0]) { case 1: /* Restore (de-iconify) window */ XMapWindow(screen->display, VShellWindow); break; case 2: /* Minimize (iconify) window */ XIconifyWindow(screen->display, VShellWindow, DefaultScreen(screen->display)); break; case 3: /* Move the window to the given position */ values.x = param[1]; values.y = param[2]; value_mask = (CWX | CWY); XReconfigureWMWindow(screen->display, VShellWindow, DefaultScreen(screen->display), value_mask, @@ -4227,102 +4338,102 @@ } unparseputc(c, fd); } void unparseseq(register ANSI * ap, int fd) { register int c; register int i; register int inters; unparseputc1(c = ap->a_type, fd); if (c == ESC || c == DCS || c == CSI || c == OSC || c == PM || c == APC || c == SS3) { if (ap->a_pintro != 0) - unparseputc((char) ap->a_pintro, fd); + unparseputc(ap->a_pintro, fd); for (i = 0; i < ap->a_nparam; ++i) { if (i != 0) unparseputc(';', fd); unparseputn((unsigned int) ap->a_param[i], fd); } - inters = ap->a_inters; - for (i = 3; i >= 0; --i) { - c = CharOf(inters >> (8 * i)); - if (c != 0) - unparseputc(c, fd); + if ((inters = ap->a_inters) != 0) { + for (i = 3; i >= 0; --i) { + c = CharOf(inters >> (8 * i)); + if (c != 0) + unparseputc(c, fd); + } } unparseputc((char) ap->a_final, fd); } } static void unparseputn(unsigned int n, int fd) { unsigned int q; q = n / 10; if (q != 0) unparseputn(q, fd); unparseputc((char) ('0' + (n % 10)), fd); } void unparseputc(int c, int fd) { - register TScreen *screen = &term->screen; IChar buf[2]; - register int i = 1; + int i = 1; #if OPT_TCAP_QUERY /* * If we're returning a termcap string, it has to be translated since * a DCS must not contain any characters except for the normal 7-bit * printable ASCII (counting tab, carriage return, etc). For now, * just use hexadecimal for the whole thing. */ - if (screen->tc_query >= 0) { + if (term->screen.tc_query >= 0) { char tmp[3]; sprintf(tmp, "%02X", c & 0xFF); buf[0] = tmp[0]; buf[1] = tmp[1]; i = 2; } else #endif if ((buf[0] = c) == '\r' && (term->flags & LINEFEED)) { buf[1] = '\n'; i++; } #ifdef VMS tt_write(&buf, i); #else /* VMS */ writePtyData(fd, buf, i); #endif /* VMS */ /* If send/receive mode is reset, we echo characters locally */ if ((term->keyboard.flags & MODE_SRM) == 0) { - dotext(screen, screen->gsets[(int) (screen->curgl)], buf, i); + doparsing(c, &myState); } } void unparseputs(char *s, int fd) { while (*s) unparseputc(*s++, fd); } void ToggleAlternate(register TScreen * screen) { if (screen->alternate) FromAlternate(screen); else ToAlternate(screen); } static void @@ -4345,57 +4456,56 @@ if (!screen->alternate) return; TRACE(("FromAlternate\n")); if (screen->scroll_amt) FlushScroll(screen); screen->alternate = FALSE; SwitchBufs(screen); update_altscreen(); } static void SwitchBufs(register TScreen * screen) { register int rows, top; if (screen->cursor_state) HideCursor(); rows = screen->max_row + 1; SwitchBufPtrs(screen); - TrackText(0, 0, 0, 0); /* remove any highlighting */ if ((top = -screen->topline) < rows) { if (screen->scroll_amt) FlushScroll(screen); if (top == 0) XClearWindow(screen->display, VWindow(screen)); else XClearArea(screen->display, VWindow(screen), (int) OriginX(screen), (int) top * FontHeight(screen) + screen->border, (unsigned) Width(screen), (unsigned) (rows - top) * FontHeight(screen), FALSE); } - ScrnRefresh(screen, 0, 0, rows, screen->max_col + 1, False); + ScrnUpdate(screen, 0, 0, rows, screen->max_col + 1, False); } /* swap buffer line pointers between alt and regular screens */ void SwitchBufPtrs(register TScreen * screen) { size_t len = ScrnPointers(screen, screen->max_row + 1); memcpy((char *) screen->save_ptr, (char *) screen->visbuf, len); memcpy((char *) screen->visbuf, (char *) screen->altbuf, len); memcpy((char *) screen->altbuf, (char *) screen->save_ptr, len); } void VTRun(void) { register TScreen *screen = &term->screen; if (!screen->Vshow) { set_vt_visibility(TRUE); @@ -4633,56 +4743,66 @@ /* allocate screen buffer now, if necessary. */ if (screen->scrollWidget) nrows += screen->savelines; screen->allbuf = Allocate(nrows, screen->max_col + 1, &screen->sbuf_address); if (screen->scrollWidget) screen->visbuf = &screen->allbuf[MAX_PTRS * screen->savelines]; else screen->visbuf = screen->allbuf; return; } static void VTClassInit(void) { XtAddConverter(XtRString, XtRGravity, XmuCvtStringToGravity, (XtConvertArgList) NULL, (Cardinal) 0); } +/* + * The whole wnew->screen struct is zeroed in VTInitialize. Use these macros + * where applicable for copying the pieces from the request widget into the + * new widget. We do not have to use them for wnew->misc, but the associated + * traces are very useful for debugging. + */ #if OPT_TRACE #define init_Bres(name) \ TRACE(("init " #name " = %s\n", \ BtoS(wnew->name = request->name))) +#define init_Dres(name) \ + TRACE(("init " #name " = %lf\n", \ + wnew->name = request->name)) #define init_Ires(name) \ TRACE(("init " #name " = %d\n", \ wnew->name = request->name)) #define init_Sres(name) \ TRACE(("init " #name " = \"%s\"\n", \ (wnew->name = x_strtrim(request->name)) != NULL \ ? wnew->name : "")) #define init_Tres(offset) \ TRACE(("init screen.Tcolors[" #offset "] = %#lx\n", \ fill_Tres(wnew, request, offset))) #else #define init_Bres(name) wnew->name = request->name +#define init_Dres(name) wnew->name = request->name #define init_Ires(name) wnew->name = request->name #define init_Sres(name) wnew->name = x_strtrim(request->name) #define init_Tres(offset) fill_Tres(wnew, request, offset) #endif #if OPT_COLOR_RES /* * Override the use of XtDefaultForeground/XtDefaultBackground to make some * colors, such as cursor color, use the actual foreground/background value * if there is no explicit resource value used. */ static Pixel fill_Tres(XtermWidget target, XtermWidget source, int offset) { char *name; ScrnColors temp; target->screen.Tcolors[offset] = source->screen.Tcolors[offset]; target->screen.Tcolors[offset].mode = False; @@ -4702,67 +4822,108 @@ ? target->dft_background : target->screen.Tcolors[TEXT_BG].value); } else { if (AllocateTermColor(target, &temp, offset, name)) { target->screen.Tcolors[offset].value = temp.colors[offset]; } } return target->screen.Tcolors[offset].value; } #else #define fill_Tres(target, source, offset) \ target->screen.Tcolors[offset] = source->screen.Tcolors[offset] #endif #if OPT_WIDE_CHARS static void VTInitialize_locale(XtermWidget request) { char *locale; Boolean is_utf8; +#ifdef HAVE_LANGINFO_CODESET + char *encoding; +#endif TRACE(("VTInitialize_locale\n")); TRACE(("... request screen.utf8_mode = %d\n", request->screen.utf8_mode)); if ((locale = getenv("LC_ALL")) == 0 || *locale == '\0') if ((locale = getenv("LC_CTYPE")) == 0 || *locale == '\0') if ((locale = getenv("LANG")) == 0 || *locale == '\0') locale = ""; #ifdef HAVE_LANGINFO_CODESET - is_utf8 = (strcmp(nl_langinfo(CODESET), "UTF-8") == 0); + encoding = nl_langinfo(CODESET); + is_utf8 = (strcmp(encoding, "UTF-8") == 0); #else is_utf8 = (strstr(locale, "UTF-8") != NULL); #endif TRACE(("... is_utf8 = %s\n", BtoS(is_utf8))); + request->screen.latin9_mode = 0; + request->screen.unicode_font = 0; #if OPT_LUIT_PROG request->misc.callfilter = 0; request->misc.use_encoding = 0; TRACE(("... setup for luit:\n")); TRACE(("... request misc.locale_str = \"%s\"\n", request->misc.locale_str)); - if (x_strcasecmp(request->misc.locale_str, "TRUE") == 0 || - x_strcasecmp(request->misc.locale_str, "ON") == 0 || - x_strcasecmp(request->misc.locale_str, "YES") == 0 || - x_strcasecmp(request->misc.locale_str, "AUTO") == 0 || - strcmp(request->misc.locale_str, "1") == 0) { +#if OPT_MINI_LUIT + if (x_strcasecmp(request->misc.locale_str, "CHECKFONT") == 0) { + int fl = (request->misc.default_font.f_n + ? strlen(request->misc.default_font.f_n) + : 0); + if (fl > 11 + && x_strcasecmp(request->misc.default_font.f_n + fl - 11, + "-ISO10646-1") == 0) { + request->screen.unicode_font = 1; + /* unicode font, use TRUE */ +#ifdef HAVE_LANGINFO_CODESET + if (!strcmp(encoding, "ANSI_X3.4-1968") + || !strcmp(encoding, "ISO-8859-1")) { + if (request->screen.utf8_mode == 3) + request->screen.utf8_mode = 0; + } else if (!strcmp(encoding, "ISO-8859-15")) { + if (request->screen.utf8_mode == 3) + request->screen.utf8_mode = 0; + request->screen.latin9_mode = 1; + } else { + request->misc.callfilter = is_utf8 ? 0 : 1; + request->screen.utf8_mode = 2; + } +#else + request->misc.callfilter = is_utf8 ? 0 : 1; + request->screen.utf8_mode = 2; +#endif + } else { + /* other encoding, use FALSE */ + if (request->screen.utf8_mode == 3) { + request->screen.utf8_mode = is_utf8 ? 2 : 0; + } + } + } else +#endif /* OPT_MINI_LUIT */ + if (x_strcasecmp(request->misc.locale_str, "TRUE") == 0 || + x_strcasecmp(request->misc.locale_str, "ON") == 0 || + x_strcasecmp(request->misc.locale_str, "YES") == 0 || + x_strcasecmp(request->misc.locale_str, "AUTO") == 0 || + strcmp(request->misc.locale_str, "1") == 0) { /* when true ... fully obeying LC_CTYPE locale */ request->misc.callfilter = is_utf8 ? 0 : 1; request->screen.utf8_mode = 2; } else if (x_strcasecmp(request->misc.locale_str, "FALSE") == 0 || x_strcasecmp(request->misc.locale_str, "OFF") == 0 || x_strcasecmp(request->misc.locale_str, "NO") == 0 || strcmp(request->misc.locale_str, "0") == 0) { /* when false ... original value of utf8_mode is effective */ if (request->screen.utf8_mode == 3) { request->screen.utf8_mode = is_utf8 ? 2 : 0; } } else if (x_strcasecmp(request->misc.locale_str, "MEDIUM") == 0 || x_strcasecmp(request->misc.locale_str, "SEMIAUTO") == 0) { /* when medium ... obeying locale only for UTF-8 and Asian */ if (is_utf8) { request->screen.utf8_mode = 2; } else if ( #ifdef MB_CUR_MAX MB_CUR_MAX > 1 || #else @@ -4788,41 +4949,41 @@ request->misc.use_encoding = 1; } TRACE(("... updated misc.callfilter = %s\n", BtoS(request->misc.callfilter))); TRACE(("... updated misc.use_encoding = %s\n", BtoS(request->misc.use_encoding))); #else if (request->screen.utf8_mode == 3) { request->screen.utf8_mode = is_utf8 ? 2 : 0; } #endif /* OPT_LUIT_PROG */ TRACE(("... updated screen.utf8_mode = %d\n", request->screen.utf8_mode)); TRACE(("...VTInitialize_locale done\n")); } #endif /* ARGSUSED */ static void VTInitialize(Widget wrequest, Widget new_arg, ArgList args GCC_UNUSED, - Cardinal * num_args GCC_UNUSED) + Cardinal *num_args GCC_UNUSED) { XtermWidget request = (XtermWidget) wrequest; XtermWidget wnew = (XtermWidget) new_arg; Widget my_parent = SHELL_OF(wnew); int i; char *s; #if OPT_ISO_COLORS Boolean color_ok; #endif #if OPT_COLOR_RES2 && (MAXCOLORS > MIN_ANSI_COLORS) static XtResource fake_resources[] = { #if OPT_256_COLORS # include <256colres.h> #elif OPT_88_COLORS # include <88colres.h> #endif }; @@ -4901,40 +5062,43 @@ #if OPT_BLINK_TEXT init_Ires(screen.blink_as_bold); #endif init_Ires(screen.border); init_Bres(screen.jumpscroll); init_Bres(screen.old_fkeys); init_Bres(screen.delete_is_del); wnew->keyboard.type = wnew->screen.old_fkeys ? keyboardIsLegacy : keyboardIsDefault; #ifdef ALLOWLOGGING init_Sres(screen.logfile); #endif init_Bres(screen.marginbell); init_Bres(screen.multiscroll); init_Ires(screen.nmarginbell); init_Ires(screen.savelines); init_Ires(screen.scrolllines); init_Bres(screen.scrollttyoutput); init_Bres(screen.scrollkey); +#if OPT_TOOLBAR + init_Bres(screen.toolbars); +#endif init_Sres(screen.term_id); for (s = request->screen.term_id; *s; s++) { if (!isalpha(CharOf(*s))) break; } wnew->screen.terminal_id = atoi(s); if (wnew->screen.terminal_id < MIN_DECID) wnew->screen.terminal_id = MIN_DECID; if (wnew->screen.terminal_id > MAX_DECID) wnew->screen.terminal_id = MAX_DECID; TRACE(("term_id '%s' -> terminal_id %d\n", wnew->screen.term_id, wnew->screen.terminal_id)); wnew->screen.vtXX_level = (wnew->screen.terminal_id / 100); init_Bres(screen.visualbell); init_Ires(screen.visualBellDelay); init_Bres(screen.poponbell); init_Ires(misc.limit_resize); @@ -4981,40 +5145,43 @@ init_Sres(screen.printer_command); init_Bres(screen.printer_autoclose); init_Bres(screen.printer_extent); init_Bres(screen.printer_formfeed); init_Ires(screen.printer_controlmode); #if OPT_PRINT_COLORS init_Ires(screen.print_attributes); #endif init_Sres(screen.keyboard_dialect); init_Bres(screen.input_eight_bits); init_Bres(screen.output_eight_bits); init_Bres(screen.control_eight_bits); init_Bres(screen.backarrow_key); init_Bres(screen.meta_sends_esc); init_Bres(screen.allowSendEvents); init_Bres(screen.allowWindowOps); #ifndef NO_ACTIVE_ICON wnew->screen.fnt_icon = request->screen.fnt_icon; + init_Bres(misc.active_icon); + init_Ires(misc.icon_border_width); + wnew->misc.icon_border_pixel = request->misc.icon_border_pixel; #endif /* NO_ACTIVE_ICON */ init_Bres(misc.titeInhibit); init_Bres(misc.tiXtraScroll); init_Bres(misc.dynamicColors); for (i = fontMenu_font1; i <= fontMenu_lastBuiltin; i++) { init_Sres(screen.menu_font_names[i]); } /* set default in realize proc */ wnew->screen.menu_font_names[fontMenu_fontdefault] = NULL; wnew->screen.menu_font_names[fontMenu_fontescape] = NULL; wnew->screen.menu_font_names[fontMenu_fontsel] = NULL; wnew->screen.menu_font_number = fontMenu_fontdefault; #if OPT_BROKEN_OSC init_Bres(screen.brokenLinuxOSC); #endif #if OPT_BROKEN_ST init_Bres(screen.brokenStringTerm); #endif @@ -5093,40 +5260,42 @@ /* * Check if we're trying to use color in a monochrome screen. Disable * color in that case, since that would make ANSI colors unusable. A 4-bit * or 8-bit display is usable, so we do not have to check for anything more * specific. */ if (color_ok) { Display *display = wnew->screen.display; XVisualInfo myTemplate, *visInfoPtr; int numFound; myTemplate.visualid = XVisualIDFromVisual(DefaultVisual(display, XDefaultScreen(display))); visInfoPtr = XGetVisualInfo(display, (long) VisualIDMask, &myTemplate, &numFound); if (visInfoPtr == 0 || numFound == 0 || visInfoPtr->depth <= 1) { TRACE(("disabling color since screen is monochrome\n")); color_ok = False; + } else { + XFree(visInfoPtr); } } /* If none of the colors are anything other than the foreground or * background, we'll assume this isn't color, no matter what the colorMode * resource says. (There doesn't seem to be any good way to determine if * the resource lookup failed versus the user having misconfigured this). */ if (!color_ok) { wnew->screen.colorMode = False; TRACE(("All colors are foreground or background: disable colorMode\n")); } #if OPT_EXT_COLORS wnew->num_ptrs = (OFF_BGRND + 1); #else wnew->num_ptrs = (OFF_COLOR + 1); #endif wnew->sgr_foreground = -1; wnew->sgr_background = -1; wnew->sgr_extended = 0; @@ -5150,102 +5319,113 @@ T_COLOR(&(wnew->screen), TEK_BG) = T_COLOR(&(wnew->screen), TEXT_BG); T_COLOR(&(wnew->screen), TEK_FG) = T_COLOR(&(wnew->screen), TEXT_FG); T_COLOR(&(wnew->screen), TEK_CURSOR) = T_COLOR(&(wnew->screen), TEXT_CURSOR); #endif #if OPT_DEC_CHRSET wnew->num_ptrs = (OFF_CSETS + 1); #endif #if OPT_WIDE_CHARS VTInitialize_locale(request); #if OPT_LUIT_PROG init_Bres(misc.callfilter); init_Bres(misc.use_encoding); init_Sres(misc.locale_str); init_Sres(misc.localefilter); #endif #if OPT_RENDERFONT - init_Ires(misc.face_size); + init_Dres(misc.face_size); init_Sres(misc.face_name); init_Sres(misc.face_wide_name); init_Bres(misc.render_font); /* minor tweak to make debug traces consistent: */ if (wnew->misc.render_font) { if (wnew->misc.face_name == 0) { wnew->misc.render_font = FALSE; TRACE(("reset render_font since there is no face_name\n")); } } #endif init_Bres(screen.vt100_graphics); init_Ires(screen.utf8_mode); init_Bres(screen.wide_chars); init_Bres(misc.cjk_width); if (request->screen.utf8_mode) { TRACE(("setting utf8_mode to 2, wide_chars on\n")); wnew->screen.wide_chars = True; wnew->screen.utf8_mode = 2; /* disable further change */ xtermLoadVTFonts(wnew, "utf8Fonts", "Utf8Fonts"); } else { TRACE(("setting utf8_mode to 0\n")); wnew->screen.utf8_mode = 0; } TRACE(("initialized UTF-8 mode to %d\n", wnew->screen.utf8_mode)); +#if OPT_MINI_LUIT + if (request->screen.latin9_mode) { + wnew->screen.latin9_mode = True; + } + if (request->screen.unicode_font) { + wnew->screen.unicode_font = True; + } + TRACE(("initialized Latin9 mode to %d\n", wnew->screen.latin9_mode)); + TRACE(("initialized unicode_font to %d\n", wnew->screen.unicode_font)); +#endif + if (wnew->screen.wide_chars != False) wnew->num_ptrs = (OFF_COM2H + 1); #endif /* OPT_WIDE_CHARS */ init_Bres(screen.bold_mode); init_Bres(screen.underline); wnew->cur_foreground = 0; wnew->cur_background = 0; wnew->keyboard.flags = MODE_SRM; if (wnew->screen.backarrow_key) wnew->keyboard.flags |= MODE_DECBKM; TRACE(("initialized DECBKM %s\n", BtoS(wnew->keyboard.flags & MODE_DECBKM))); /* look for focus related events on the shell, because we need * to care about the shell's border being part of our focus. */ XtAddEventHandler(my_parent, EnterWindowMask, FALSE, HandleEnterWindow, (Opaque) NULL); XtAddEventHandler(my_parent, LeaveWindowMask, FALSE, HandleLeaveWindow, (Opaque) NULL); XtAddEventHandler(my_parent, FocusChangeMask, FALSE, HandleFocusChange, (Opaque) NULL); XtAddEventHandler((Widget) wnew, 0L, TRUE, VTNonMaskableEvent, (Opaque) NULL); XtAddEventHandler((Widget) wnew, PropertyChangeMask, FALSE, HandleBellPropertyChange, (Opaque) NULL); #if HANDLE_STRUCT_NOTIFY #if OPT_TOOLBAR - wnew->screen.fullVwin.menu_bar = request->screen.fullVwin.menu_bar; - init_Ires(screen.fullVwin.menu_height); + wnew->VT100_TB_INFO(menu_bar) = request->VT100_TB_INFO(menu_bar); + init_Ires(VT100_TB_INFO(menu_height)); #else /* Flag icon name with "***" on window output when iconified. * Put in a handler that will tell us when we get Map/Unmap events. */ if (zIconBeep) #endif XtAddEventHandler(my_parent, StructureNotifyMask, FALSE, HandleStructNotify, (XtPointer) 0); #endif /* HANDLE_STRUCT_NOTIFY */ wnew->screen.bellInProgress = FALSE; set_character_class(wnew->screen.charClass); /* create it, but don't realize it */ ScrollBarOn(wnew, TRUE, FALSE); /* make sure that the resize gravity acceptable */ if (wnew->misc.resizeGravity != NorthWestGravity && wnew->misc.resizeGravity != SouthWestGravity) { @@ -5434,44 +5614,45 @@ &sizehints); XFlush(XtDisplay(term)); /* get it out to window manager */ /* use ForgetGravity instead of SouthWestGravity because translating the Expose events for ConfigureNotifys is too hard */ values->bit_gravity = ((term->misc.resizeGravity == NorthWestGravity) ? NorthWestGravity : ForgetGravity); term->screen.fullVwin.window = XtWindow(term) = XCreateWindow(XtDisplay(term), XtWindow(XtParent(term)), term->core.x, term->core.y, term->core.width, term->core.height, term->core.border_width, (int) term->core.depth, InputOutput, CopyFromParent, *valuemask | CWBitGravity, values); screen->event_mask = values->event_mask; #ifndef NO_ACTIVE_ICON if (term->misc.active_icon && screen->fnt_icon) { int iconX = 0, iconY = 0; - Widget shell = XtParent(term); + Widget shell = SHELL_OF(term); unsigned long mask; XGCValues xgcv; + TRACE(("Initializing active-icon\n")); XtVaGetValues(shell, XtNiconX, &iconX, XtNiconY, &iconY, (XtPointer) 0); xtermComputeFontInfo(screen, &(screen->iconVwin), screen->fnt_icon, 0); /* since only one client is permitted to select for Button * events, we have to let the window manager get 'em... */ values->event_mask &= ~(ButtonPressMask | ButtonReleaseMask); values->border_pixel = term->misc.icon_border_pixel; screen->iconVwin.window = XCreateWindow(XtDisplay(term), RootWindowOfScreen(XtScreen(shell)), iconX, iconY, screen->iconVwin.fullwidth, screen->iconVwin.fullheight, term->misc.icon_border_width, (int) term->core.depth, InputOutput, CopyFromParent, *valuemask | CWBitGravity | CWBorderPixel, values); @@ -5482,41 +5663,52 @@ mask = (GCFont | GCForeground | GCBackground | GCGraphicsExposures | GCFunction); xgcv.font = screen->fnt_icon->fid; xgcv.foreground = T_COLOR(screen, TEXT_FG); xgcv.background = T_COLOR(screen, TEXT_BG); xgcv.graphics_exposures = TRUE; /* default */ xgcv.function = GXcopy; screen->iconVwin.normalGC = screen->iconVwin.normalboldGC = XtGetGC(shell, mask, &xgcv); xgcv.foreground = T_COLOR(screen, TEXT_BG); xgcv.background = T_COLOR(screen, TEXT_FG); screen->iconVwin.reverseGC = screen->iconVwin.reverseboldGC = XtGetGC(shell, mask, &xgcv); +#if OPT_TOOLBAR + /* + * Toolbar is initialized before we get here. Enable the menu item + * and set it properly. + */ + set_sensitivity(mw, + vtMenuEntries[vtMenu_activeicon].widget, + TRUE); + update_activeicon(); +#endif } else { + TRACE(("Disabled active-icon\n")); term->misc.active_icon = False; } #endif /* NO_ACTIVE_ICON */ #if OPT_I18N_SUPPORT && OPT_INPUT_METHOD VTInitI18N(); #else term->screen.xic = NULL; #endif #if OPT_NUM_LOCK VTInitModifiers(); #endif set_cursor_gcs(screen); /* Reset variables used by ANSI emulation. */ resetCharsets(screen); XDefineCursor(screen->display, VShellWindow, screen->pointer_cursor); @@ -5569,113 +5761,118 @@ VTInitI18N(); } static void xim_destroy_cb(XIM im GCC_UNUSED, XPointer client_data GCC_UNUSED, XPointer call_data GCC_UNUSED) { term->screen.xic = NULL; XRegisterIMInstantiateCallback(XtDisplay(term), NULL, NULL, NULL, xim_instantiate_cb, NULL); } #endif /* X11R6+ */ static void xim_real_init(void) { unsigned i, j; char *p, *s, *t, *ns, *end, buf[32]; - XIM xim = (XIM) NULL; XIMStyles *xim_styles; XIMStyle input_style = 0; Boolean found; static struct { char *name; unsigned long code; } known_style[] = { { "OverTheSpot", (XIMPreeditPosition | XIMStatusNothing) }, { "OffTheSpot", (XIMPreeditArea | XIMStatusArea) }, { "Root", (XIMPreeditNothing | XIMStatusNothing) }, }; term->screen.xic = NULL; if (term->misc.cannot_im) { return; } if (!term->misc.input_method || !*term->misc.input_method) { if ((p = XSetLocaleModifiers("")) != NULL && *p) - xim = XOpenIM(XtDisplay(term), NULL, NULL, NULL); + term->screen.xim = XOpenIM(XtDisplay(term), NULL, NULL, NULL); } else { s = term->misc.input_method; i = 5 + strlen(s); t = (char *) MyStackAlloc(i, buf); if (t == NULL) SysError(ERROR_VINIT); for (ns = s; ns && *s;) { while (*s && isspace(CharOf(*s))) s++; if (!*s) break; if ((ns = end = strchr(s, ',')) == 0) end = s + strlen(s); while ((end != s) && isspace(CharOf(end[-1]))) end--; if (end != s) { strcpy(t, "@im="); strncat(t, s, end - s); if ((p = XSetLocaleModifiers(t)) != 0 && *p - && (xim = XOpenIM(XtDisplay(term), NULL, NULL, NULL)) != 0) + && (term->screen.xim = XOpenIM(XtDisplay(term), + NULL, + NULL, + NULL)) != 0) break; } s = ns + 1; } MyStackFree(t, buf); } - if (xim == NULL && (p = XSetLocaleModifiers("@im=none")) != NULL && *p) - xim = XOpenIM(XtDisplay(term), NULL, NULL, NULL); + if (term->screen.xim == NULL + && (p = XSetLocaleModifiers("@im=none")) != NULL + && *p) { + term->screen.xim = XOpenIM(XtDisplay(term), NULL, NULL, NULL); + } - if (!xim) { + if (!term->screen.xim) { fprintf(stderr, "Failed to open input method\n"); return; } TRACE(("VTInitI18N opened input method\n")); - if (XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL) + if (XGetIMValues(term->screen.xim, XNQueryInputStyle, &xim_styles, NULL) || !xim_styles || !xim_styles->count_styles) { fprintf(stderr, "input method doesn't support any style\n"); - XCloseIM(xim); + XCloseIM(term->screen.xim); term->misc.cannot_im = True; return; } found = False; for (s = term->misc.preedit_type; s && !found;) { while (*s && isspace(CharOf(*s))) s++; if (!*s) break; if ((ns = end = strchr(s, ',')) != 0) ns++; else end = s + strlen(s); while ((end != s) && isspace(CharOf(end[-1]))) end--; if (end != s) { /* just in case we have a spurious comma */ TRACE(("looking for style '%.*s'\n", end - s, s)); for (i = 0; i < XtNumber(known_style); i++) { @@ -5685,159 +5882,159 @@ for (j = 0; j < xim_styles->count_styles; j++) { if (input_style == xim_styles->supported_styles[j]) { found = True; break; } } if (found) break; } } } s = ns; } XFree(xim_styles); if (!found) { fprintf(stderr, "input method doesn't support my preedit type (%s)\n", term->misc.preedit_type); - XCloseIM(xim); + XCloseIM(term->screen.xim); term->misc.cannot_im = True; return; } /* * Check for styles we do not yet support. */ TRACE(("input_style %#lx\n", input_style)); if (input_style == (XIMPreeditArea | XIMStatusArea)) { fprintf(stderr, "This program doesn't support the 'OffTheSpot' preedit type\n"); - XCloseIM(xim); + XCloseIM(term->screen.xim); term->misc.cannot_im = True; return; } /* * For XIMPreeditPosition (or OverTheSpot), XIM client has to * prepare a font. * The font has to be locale-dependent XFontSet, whereas * XTerm use Unicode font. This leads a problem that the * same font cannot be used for XIM preedit. */ if (input_style != (XIMPreeditNothing | XIMStatusNothing)) { char **missing_charset_list; int missing_charset_count; char *def_string; XVaNestedList p_list; XPoint spot = {0, 0}; XFontStruct **fonts; char **font_name_list; term->screen.fs = XCreateFontSet(XtDisplay(term), term->misc.f_x, &missing_charset_list, &missing_charset_count, &def_string); if (term->screen.fs == NULL) { fprintf(stderr, "Preparation of font set " "\"%s\" for XIM failed.\n", term->misc.f_x); term->screen.fs = XCreateFontSet(XtDisplay(term), DEFXIMFONT, &missing_charset_list, &missing_charset_count, &def_string); } if (term->screen.fs == NULL) { fprintf(stderr, "Preparation of default font set " "\"%s\" for XIM failed.\n", DEFXIMFONT); - XCloseIM(xim); + XCloseIM(term->screen.xim); term->misc.cannot_im = True; return; } (void) XExtentsOfFontSet(term->screen.fs); j = XFontsOfFontSet(term->screen.fs, &fonts, &font_name_list); for (i = 0, term->screen.fs_ascent = 0; i < j; i++) { if (term->screen.fs_ascent < (*fonts)->ascent) term->screen.fs_ascent = (*fonts)->ascent; } p_list = XVaCreateNestedList(0, XNSpotLocation, &spot, XNFontSet, term->screen.fs, NULL); - term->screen.xic = XCreateIC(xim, + term->screen.xic = XCreateIC(term->screen.xim, XNInputStyle, input_style, XNClientWindow, XtWindow(term), XNFocusWindow, XtWindow(term), XNPreeditAttributes, p_list, NULL); } else { - term->screen.xic = XCreateIC(xim, XNInputStyle, input_style, + term->screen.xic = XCreateIC(term->screen.xim, XNInputStyle, input_style, XNClientWindow, XtWindow(term), XNFocusWindow, XtWindow(term), NULL); } if (!term->screen.xic) { fprintf(stderr, "Failed to create input context\n"); - XCloseIM(xim); + XCloseIM(term->screen.xim); } #if defined(USE_XIM_INSTANTIATE_CB) else { XIMCallback destroy_cb; destroy_cb.callback = xim_destroy_cb; destroy_cb.client_data = NULL; - if (XSetIMValues(xim, XNDestroyCallback, &destroy_cb, NULL)) + if (XSetIMValues(term->screen.xim, XNDestroyCallback, &destroy_cb, NULL)) fprintf(stderr, "Could not set destroy callback to IM\n"); } #endif return; } static void VTInitI18N(void) { if (term->misc.open_im) { xim_real_init(); #if defined(USE_XIM_INSTANTIATE_CB) if (term->screen.xic == NULL && !term->misc.cannot_im) { sleep(3); XRegisterIMInstantiateCallback(XtDisplay(term), NULL, NULL, NULL, xim_instantiate_cb, NULL); } #endif } } #endif /* OPT_I18N_SUPPORT && OPT_INPUT_METHOD */ static Boolean VTSetValues(Widget cur, Widget request GCC_UNUSED, Widget wnew, ArgList args GCC_UNUSED, - Cardinal * num_args GCC_UNUSED) + Cardinal *num_args GCC_UNUSED) { XtermWidget curvt = (XtermWidget) cur; XtermWidget newvt = (XtermWidget) wnew; Boolean refresh_needed = FALSE; Boolean fonts_redone = FALSE; if ((T_COLOR(&(curvt->screen), TEXT_BG) != T_COLOR(&(newvt->screen), TEXT_BG)) || (T_COLOR(&(curvt->screen), TEXT_FG) != T_COLOR(&(newvt->screen), TEXT_FG)) || (curvt->screen.menu_font_names[curvt->screen.menu_font_number] != newvt->screen.menu_font_names[newvt->screen.menu_font_number]) || (curvt->misc.default_font.f_n != newvt->misc.default_font.f_n)) { if (curvt->misc.default_font.f_n != newvt->misc.default_font.f_n) newvt->screen.menu_font_names[fontMenu_fontdefault] = newvt->misc.default_font.f_n; if (xtermLoadFont(&newvt->screen, xtermFontName(newvt->screen.menu_font_names[curvt->screen.menu_font_number]), TRUE, newvt->screen.menu_font_number)) { /* resizing does the redisplay, so don't ask for it here */ refresh_needed = TRUE; @@ -5858,40 +6055,48 @@ refresh_needed = TRUE; } if ((T_COLOR(&(curvt->screen), MOUSE_FG) != T_COLOR(&(newvt->screen), MOUSE_FG)) || (T_COLOR(&(curvt->screen), MOUSE_BG) != T_COLOR(&(newvt->screen), MOUSE_BG))) { recolor_cursor(newvt->screen.pointer_cursor, T_COLOR(&(newvt->screen), MOUSE_FG), T_COLOR(&(newvt->screen), MOUSE_BG)); refresh_needed = TRUE; } if (curvt->misc.scrollbar != newvt->misc.scrollbar) { ToggleScrollBar(newvt); } return refresh_needed; } #define setGC(value) set_at = __LINE__, currentGC = value +#define OutsideSelection(screen,row,col) \ + ((row) > (screen)->endHRow || \ + ((row) == (screen)->endHRow && \ + (col) >= (screen)->endHCol) || \ + (row) < (screen)->startHRow || \ + ((row) == (screen)->startHRow && \ + (col) < (screen)->startHCol)) + /* * Shows cursor at new cursor position in screen. */ void ShowCursor(void) { register TScreen *screen = &term->screen; register int x, y, flags; Char clo; int fg_bg = 0; GC currentGC; int set_at; Boolean in_selection; Boolean reversed; Pixel fg_pix; Pixel bg_pix; Pixel tmp; #if OPT_HIGHLIGHT_COLOR Pixel hi_pix = T_COLOR(screen, HIGHLIGHT_BG); #endif @@ -5945,59 +6150,68 @@ base = (chi << 8) | clo; if (iswide(base)) my_col += 1; c1l = SCRN_BUF_COM1L(screen, screen->cursor_row)[my_col]; c1h = SCRN_BUF_COM1H(screen, screen->cursor_row)[my_col]; c2l = SCRN_BUF_COM2L(screen, screen->cursor_row)[my_col]; c2h = SCRN_BUF_COM2H(screen, screen->cursor_row)[my_col]; }); flags = SCRN_BUF_ATTRS(screen, screen->cursor_row)[cursor_col]; if (clo == 0 #if OPT_WIDE_CHARS && chi == 0 #endif ) { clo = ' '; } /* + * If the cursor happens to be on blanks, and the foreground color is set + * but not the background, do not treat it as a colored cell. + */ +#if OPT_ISO_COLORS + if ((flags & TERM_COLOR_FLAGS) == BG_COLOR +#if OPT_WIDE_CHARS + && chi == 0 +#endif + && clo == ' ') { + flags &= ~TERM_COLOR_FLAGS; + } +#endif + + /* * Compare the current cell to the last set of colors used for the * cursor and update the GC's if needed. */ if_OPT_EXT_COLORS(screen, { fg_bg = (SCRN_BUF_FGRND(screen, screen->cursor_row)[cursor_col] << 8) | (SCRN_BUF_BGRND(screen, screen->cursor_row)[cursor_col]); }); if_OPT_ISO_TRADITIONAL_COLORS(screen, { fg_bg = SCRN_BUF_COLOR(screen, screen->cursor_row)[cursor_col]; }); fg_pix = getXtermForeground(flags, extract_fg(fg_bg, flags)); bg_pix = getXtermBackground(flags, extract_bg(fg_bg, flags)); - if (screen->cur_row > screen->endHRow || - (screen->cur_row == screen->endHRow && - screen->cur_col >= screen->endHCol) || - screen->cur_row < screen->startHRow || - (screen->cur_row == screen->startHRow && - screen->cur_col < screen->startHCol)) + if (OutsideSelection(screen, screen->cur_row, screen->cur_col)) in_selection = False; else in_selection = True; reversed = ReverseOrHilite(screen, flags, in_selection); /* This is like updatedXtermGC(), except that we have to worry about * whether the window has focus, since in that case we want just an * outline for the cursor. */ if (screen->select || screen->always_highlight) { if (reversed) { /* text is reverse video */ if (screen->cursorGC) { setGC(screen->cursorGC); } else { if (flags & BOLDATTR(screen)) { setGC(NormalBoldGC(screen)); } else { setGC(NormalGC(screen)); } @@ -6143,46 +6357,41 @@ chi = SCRN_BUF_WIDEC(screen, screen->cursor_row)[cursor_col]; } my_col = cursor_col; base = (chi << 8) | clo; if (iswide(base)) my_col += 1; c1l = SCRN_BUF_COM1L(screen, screen->cursor_row)[my_col]; c1h = SCRN_BUF_COM1H(screen, screen->cursor_row)[my_col]; c2l = SCRN_BUF_COM2L(screen, screen->cursor_row)[my_col]; c2h = SCRN_BUF_COM2H(screen, screen->cursor_row)[my_col]; }); if_OPT_EXT_COLORS(screen, { fg_bg = (SCRN_BUF_FGRND(screen, screen->cursor_row)[cursor_col] << 8) | (SCRN_BUF_BGRND(screen, screen->cursor_row)[cursor_col]); }); if_OPT_ISO_TRADITIONAL_COLORS(screen, { fg_bg = SCRN_BUF_COLOR(screen, screen->cursor_row)[cursor_col]; }); - if (screen->cursor_row > screen->endHRow || - (screen->cursor_row == screen->endHRow && - screen->cursor_col >= screen->endHCol) || - screen->cursor_row < screen->startHRow || - (screen->cursor_row == screen->startHRow && - screen->cursor_col < screen->startHCol)) + if (OutsideSelection(screen, screen->cursor_row, screen->cursor_col)) in_selection = False; else in_selection = True; currentGC = updatedXtermGC(screen, flags, fg_bg, in_selection); if (clo == 0 #if OPT_WIDE_CHARS && chi == 0 #endif ) { clo = ' '; } TRACE(("HideCursor calling drawXtermText cur(%d,%d)\n", screen->cursor_row, screen->cursor_col)); drawXtermText(screen, flags & DRAWX_MASK, currentGC, x = CurCursorX(screen, screen->cursor_row, cursor_col), y = CursorY(screen, screen->cursor_row), curXtermChrSet(screen->cursor_row), @@ -6537,114 +6746,114 @@ /* * now, process it */ if (high < 0) high = low; if (numbers < 1 || numbers > 2) { fprintf(stderr, errfmt, ProgramName, "bad value number", s, i); } else if (SetCharacterClassRange(low, high, acc) != 0) { fprintf(stderr, errfmt, ProgramName, "bad range", s, i); } return (0); } /* ARGSUSED */ static void HandleKeymapChange(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { static XtTranslations keymap, original; static XtResource key_resources[] = { {XtNtranslations, XtCTranslations, XtRTranslationTable, sizeof(XtTranslations), 0, XtRTranslationTable, (XtPointer) NULL} }; char mapName[1000]; char mapClass[1000]; char *pmapName; char *pmapClass; size_t len; if (*param_count != 1) return; if (original == NULL) original = w->core.tm.translations; if (strcmp(params[0], "None") == 0) { XtOverrideTranslations(w, original); return; } len = strlen(params[0]) + 7; pmapName = (char *) MyStackAlloc(len, mapName); pmapClass = (char *) MyStackAlloc(len, mapClass); if (pmapName == NULL || pmapClass == NULL) SysError(ERROR_KMMALLOC1); (void) sprintf(pmapName, "%sKeymap", params[0]); (void) strcpy(pmapClass, pmapName); if (islower(CharOf(pmapClass[0]))) pmapClass[0] = toupper(CharOf(pmapClass[0])); - XtGetSubresources(w, (XtPointer) & keymap, pmapName, pmapClass, + XtGetSubresources(w, (XtPointer) &keymap, pmapName, pmapClass, key_resources, (Cardinal) 1, NULL, (Cardinal) 0); if (keymap != NULL) XtOverrideTranslations(w, keymap); MyStackFree(pmapName, mapName); MyStackFree(pmapClass, mapClass); } /* ARGSUSED */ static void HandleBell(Widget w GCC_UNUSED, XEvent * event GCC_UNUSED, String * params, /* [0] = volume */ - Cardinal * param_count) /* 0 or 1 */ + Cardinal *param_count) /* 0 or 1 */ { int percent = (*param_count) ? atoi(params[0]) : 0; Bell(XkbBI_TerminalBell, percent); } /* ARGSUSED */ static void HandleVisualBell(Widget w GCC_UNUSED, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * param_count GCC_UNUSED) + Cardinal *param_count GCC_UNUSED) { VisualBell(); } /* ARGSUSED */ static void HandleIgnore(Widget w, XEvent * event, String * params GCC_UNUSED, - Cardinal * param_count GCC_UNUSED) + Cardinal *param_count GCC_UNUSED) { /* do nothing, but check for funny escape sequences */ (void) SendMousePosition(w, event); } /* ARGSUSED */ static void DoSetSelectedFont(Widget w GCC_UNUSED, XtPointer client_data GCC_UNUSED, Atom * selection GCC_UNUSED, Atom * type, XtPointer value, unsigned long *length GCC_UNUSED, int *format) { char *val = (char *) value; int len; if (*type != XA_STRING || *format != 8) { Bell(XkbBI_MinorError, 0); return; Index: xc/programs/xterm/configure =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/configure,v retrieving revision 1.3 diff -u -2 -0 -r1.3 configure --- xc/programs/xterm/configure 20 Aug 2004 18:46:39 -0000 1.3 +++ xc/programs/xterm/configure 6 Jan 2005 00:30:40 -0000 @@ -218,45 +218,46 @@ --enable-hp-fkeys enable support for HP-style function keys --enable-sco-fkeys enable support for SCO-style function keys --disable-i18n disable internationalization --disable-initial-erase disable setup for stty erase --disable-input-method disable input-method --enable-load-vt-fonts enable load-vt-fonts() action --enable-logging enable logging --enable-logfile-exec enable exec'd logfile filter --disable-maximize disable actions for iconify/deiconify/maximize/restore EOF cat <<\EOF --disable-num-lock disable NumLock keypad support --disable-pty-handshake disable pty-handshake support --disable-rightbar disable right-scrollbar support --disable-samename disable check for redundant name-change --disable-session-mgt disable support for session management --enable-tcap-query compile-in termcap-query support --disable-tek4014 disable tek4014 emulation --enable-toolbar compile-in toolbar for pulldown menus --disable-vt52 disable VT52 emulation + --enable-mini-luit enable mini-luit (built-in Latin9 support) --enable-luit enable luit filter (Unicode translation) --enable-wide-chars enable wide-character support - --enable-dabbrev enable dynamic-abbreviation support EOF cat <<\EOF + --enable-dabbrev enable dynamic-abbreviation support --enable-dec-locator enable DECterm Locator support --disable-ziconbeep disable -ziconbeep option Testing/development Options: --enable-trace test: set to enable debugging traces --disable-echo display "compiling" commands --enable-xmc-glitch test: enable xmc magic-cookie emulation --enable-warnings test: turn on GCC compiler warnings EOF exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) @@ -597,41 +598,41 @@ ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then # Make sure we can run config.sub. if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:618: checking host system type" >&5 +echo "configure:619: checking host system type" >&5 host_alias=$host case "$host_alias" in NONE) case $nonopt in NONE) if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } fi ;; *) host_alias=$nonopt ;; esac ;; esac host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 system_name="$host_os" @@ -658,71 +659,71 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then echo "$ac_t""Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" 1>&6 { echo "configure: error: "Please remove config.cache and try again."" 1>&2; exit 1; } fi ### checks for alternative programs case "$host_os" in openedition) : ${CFLAGS="-O2 -Wc,dll -Wl,EDIT=NO"} : ${CPPFLAGS="-D_ALL_SOURCE"} : ${LIBS="/usr/lib/Xaw.x /usr/lib/SM.x /usr/lib/ICE.x /usr/lib/X11.x"} : ${CC=c89};; darwin*) : ${LDFLAGS}="${LDFLAGS} -Wl,-bind_at_load";; esac # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:679: checking for $ac_word" >&5 +echo "configure:680: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:709: checking for $ac_word" >&5 +echo "configure:710: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" break fi done @@ -739,352 +740,352 @@ set dummy "$ac_dir/$ac_word" "$@" shift ac_cv_prog_CC="$@" fi fi fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then case "`uname -s`" in *win32* | *WIN32*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:760: checking for $ac_word" >&5 +echo "configure:761: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="cl" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ;; esac fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:792: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:793: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 803 "configure" +#line 804 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:834: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:835: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:839: checking whether we are using GNU C" >&5 +echo "configure:840: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:849: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:867: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:868: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 if test "$ac_test_CFLAGS" = set; then CFLAGS="$ac_save_CFLAGS" elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:899: checking how to run the C preprocessor" >&5 +echo "configure:900: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:937: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:938: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:980: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:981: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then rm -rf conftest* ac_cv_prog_gcc_traditional=yes else rm -rf conftest* ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then rm -rf conftest* ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi for ac_prog in mawk gawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1030: checking for $ac_word" >&5 +echo "configure:1031: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_AWK="$ac_prog" break fi done IFS="$ac_save_ifs" fi fi AWK="$ac_cv_prog_AWK" if test -n "$AWK"; then echo "$ac_t""$AWK" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$AWK" && break done # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1071: checking for a BSD compatible install" >&5 +echo "configure:1072: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else @@ -1121,2453 +1122,2665 @@ if test "$program_transform_name" = s,x,x,; then program_transform_name= else # Double any \ or $. echo might interpret backslashes. cat <<\EOF_SED > conftestsed s,\\,\\\\,g; s,\$,$$,g EOF_SED program_transform_name="`echo $program_transform_name|sed -f conftestsed`" rm -f conftestsed fi test "$program_prefix" != NONE && program_transform_name="s,^,${program_prefix},; $program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" # sed with no file args requires a program. test "$program_transform_name" = "" && program_transform_name="s,x,x," +for ac_prog in tdlint lint alint +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1148: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LINT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$LINT"; then + ac_cv_prog_LINT="$LINT" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_LINT="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +LINT="$ac_cv_prog_LINT" +if test -n "$LINT"; then + echo "$ac_t""$LINT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$LINT" && break +done + ### checks for UNIX variants that set C preprocessor variables echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:1145: checking for AIX" >&5 +echo "configure:1180: checking for AIX" >&5 cat > conftest.$ac_ext <&5 | egrep "yes" >/dev/null 2>&1; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define _ALL_SOURCE 1 EOF else rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -f conftest* echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:1169: checking for POSIXized ISC" >&5 +echo "configure:1204: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then echo "$ac_t""yes" 1>&6 ISC=yes # If later tests want to check for ISC. cat >> confdefs.h <<\EOF #define _POSIX_SOURCE 1 EOF if test "$GCC" = yes; then CC="$CC -posix" else CC="$CC -Xp" fi else echo "$ac_t""no" 1>&6 ISC= fi -### checks for header files -for ac_hdr in \ -ncurses/term.h \ -stdlib.h \ -termios.h \ -unistd.h \ +### checks for compiler characteristics -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1200: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 +echo "configure:1228: checking for ${CC-cc} option to accept ANSI C" >&5 +if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1210: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done + +cf_cv_ansi_cc=no +cf_save_CFLAGS="$CFLAGS" +cf_save_CPPFLAGS="$CPPFLAGS" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX -Aa -D_HPUX_SOURCE +# SVR4 -Xc +# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) +for cf_arg in "-DCC_HAS_PROTOS" \ + "" \ + -qlanglvl=ansi \ + -std1 \ + -Ae \ + "-Aa -D_HPUX_SOURCE" \ + -Xc +do + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= -echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1237: checking whether time.h and sys/time.h may both be included" >&5 -if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#include -int main() { -struct tm *tp; -; return 0; } -EOF -if { (eval echo configure:1251: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_header_time=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_time=no -fi -rm -f conftest* -fi +for cf_add_cflags in $cf_arg +do +case $cf_fix_cppflags in +no) + case $cf_add_cflags in #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` -echo "$ac_t""$ac_cv_header_time" 1>&6 -if test $ac_cv_header_time = yes; then - cat >> confdefs.h <<\EOF -#define TIME_WITH_SYS_TIME 1 -EOF + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes -fi + if test $cf_fix_cppflags = yes ; then + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + continue + elif test "${cf_tst_cflags}" = "\"'" ; then + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6 -echo "configure:1273: checking for nl_langinfo and CODESET" >&5 -if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -int main() { -char* cs = nl_langinfo(CODESET); -; return 0; } -EOF -if { (eval echo configure:1285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - am_cv_langinfo_codeset=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - am_cv_langinfo_codeset=no + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" fi -rm -f conftest* - + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$cf_new_cppflags $CPPFLAGS" fi -echo "$ac_t""$am_cv_langinfo_codeset" 1>&6 - if test $am_cv_langinfo_codeset = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_LANGINFO_CODESET 1 -EOF +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi - fi -### checks for typedefs -echo $ac_n "checking for size_t in or ""... $ac_c" 1>&6 -echo "configure:1310: checking for size_t in or " >&5 -if eval "test \"`echo '$''{'cf_cv_type_size_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#ifdef STDC_HEADERS -#include -#include +#ifndef CC_HAS_PROTOS +#if !defined(__STDC__) || (__STDC__ != 1) +choke me #endif -#include +#endif + int main() { -size_t x + + int test (int i, double x); + struct s1 {int (*f) (int a);}; + struct s2 {int (*f) (double a);}; ; return 0; } EOF -if { (eval echo configure:1329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - cf_cv_type_size_t=yes + cf_cv_ansi_cc="$cf_arg"; break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cv_type_size_t=no fi rm -f conftest* - +done +CFLAGS="$cf_save_CFLAGS" +CPPFLAGS="$cf_save_CPPFLAGS" + fi -echo "$ac_t""$cf_cv_type_size_t" 1>&6 -test $cf_cv_type_size_t = no && cat >> confdefs.h <<\EOF -#define size_t unsigned -EOF +echo "$ac_t""$cf_cv_ansi_cc" 1>&6 +if test "$cf_cv_ansi_cc" != "no"; then +if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1349: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#include -#include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1362: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - ac_cv_header_stdc=yes -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no +for cf_add_cflags in $cf_cv_ansi_cc +do +case $cf_fix_cppflags in +no) + case $cf_add_cflags in #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + continue + elif test "${cf_tst_cflags}" = "\"'" ; then + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" fi -rm -f conftest* -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$cf_new_cppflags $CPPFLAGS" fi -rm -f conftest* +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : + + + else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* + cat >> confdefs.h <<\EOF +#define CC_HAS_PROTOS 1 +EOF fi +fi -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then - : +echo $ac_n "checking for working const""... $ac_c" 1>&6 +echo "configure:1439: checking for working const" >&5 +if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } +int main() { + +/* Ultrix mips cc rejects this. */ +typedef int charset[2]; const charset x; +/* SunOS 4.1.1 cc rejects this. */ +char const *const *ccp; +char **p; +/* NEC SVR4.0.2 mips cc rejects this. */ +struct point {int x, y;}; +static struct point const zero = {0,0}; +/* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in an arm + of an if-expression whose if-part is not a constant expression */ +const char *g = "string"; +ccp = &g + (g ? g-g : 0); +/* HPUX 7.0 cc rejects these. */ +++ccp; +p = (char**) ccp; +ccp = (char const *const *) p; +{ /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; +} +{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; +} +{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; +} +{ /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; +} +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; +} + +; return 0; } EOF -if { (eval echo configure:1429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - : +if { (eval echo configure:1493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_const=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no -fi -rm -fr conftest* -fi - + rm -rf conftest* + ac_cv_c_const=no fi +rm -f conftest* fi -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then +echo "$ac_t""$ac_cv_c_const" 1>&6 +if test $ac_cv_c_const = no; then cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 +#define const EOF fi -echo $ac_n "checking for time_t""... $ac_c" 1>&6 -echo "configure:1453: checking for time_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_time_t'+set}'`\" = set"; then +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:1514: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include + +int main() { + +#ifndef __CYGWIN__ +#define __CYGWIN__ __CYGWIN32__ #endif +return __CYGWIN__; +; return 0; } EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])time_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then +if { (eval echo configure:1530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - ac_cv_type_time_t=yes + ac_cv_cygwin=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* - ac_cv_type_time_t=no + ac_cv_cygwin=no fi rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_time_t" 1>&6 -if test $ac_cv_type_time_t = no; then - cat >> confdefs.h <<\EOF -#define time_t long -EOF - +rm -f conftest* fi - -### checks for library functions -for ac_func in \ - bcopy \ - gethostname \ - getlogin \ - memmove \ - strerror \ - strftime \ - tcgetattr \ - waitpid \ - -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1499: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:1547: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - +return __MINGW32__; ; return 0; } EOF -if { (eval echo configure:1527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1559: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" + ac_cv_mingw32=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + ac_cv_mingw32=no fi rm -f conftest* +rm -f conftest* fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + + +case $cf_cv_system_name in +os2*) + CFLAGS="$CFLAGS -Zmt" + CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__" + CXXFLAGS="$CXXFLAGS -Zmt" + # autoconf's macro sets -Zexe and suffix both, which conflict:w + LDFLAGS="$LDFLAGS -Zmt -Zcrtdll" + ac_cv_exeext=.exe + ;; +esac + + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1591: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - echo "$ac_t""no" 1>&6 + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi fi -done +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT -echo $ac_n "checking for memmove""... $ac_c" 1>&6 -echo "configure:1553: checking for memmove" >&5 -if eval "test \"`echo '$''{'ac_cv_func_memmove'+set}'`\" = set"; then +echo $ac_n "checking for object suffix""... $ac_c" 1>&6 +echo "configure:1622: checking for object suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char memmove(); + rm -f conftest* +echo 'int i = 1;' > conftest.$ac_ext +if { (eval echo configure:1628: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + for ac_file in conftest.*; do + case $ac_file in + *.c) ;; + *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; + esac + done +else + { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_objext" 1>&6 +OBJEXT=$ac_cv_objext +ac_objext=$ac_cv_objext + +PROG_EXT="$EXEEXT" + +test -n "$PROG_EXT" && cat >> confdefs.h <&6 +echo "configure:1676: checking if we must define _GNU_SOURCE" >&5 +if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < int main() { -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_memmove) || defined (__stub___memmove) -choke me -#else -memmove(); +#ifndef _XOPEN_SOURCE +make an error #endif +; return 0; } +EOF +if { (eval echo configure:1692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_gnu_source=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_save="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + cat > conftest.$ac_ext < +int main() { +#ifdef _XOPEN_SOURCE +make an error +#endif ; return 0; } EOF -if { (eval echo configure:1581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_func_memmove=yes" + cf_cv_gnu_source=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_memmove=no" + cf_cv_gnu_source=yes fi rm -f conftest* + CPPFLAGS="$cf_save" + fi +rm -f conftest* -if eval "test \"`echo '$ac_cv_func_'memmove`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 +fi -echo $ac_n "checking for bcopy""... $ac_c" 1>&6 -echo "configure:1600: checking for bcopy" >&5 -if eval "test \"`echo '$''{'ac_cv_func_bcopy'+set}'`\" = set"; then +echo "$ac_t""$cf_cv_gnu_source" 1>&6 +test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + + ;; +mirbsd*) #(vi + # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks + ;; +netbsd*) #(vi + # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw + ;; +openbsd*) #(vi + # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw + ;; +osf[45]*) #(vi + CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE" + ;; +sco*) #(vi + # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer + ;; +solaris*) #(vi + CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" + ;; +*) + echo $ac_n "checking if we should define _XOPEN_SOURCE""... $ac_c" 1>&6 +echo "configure:1753: checking if we should define _XOPEN_SOURCE" >&5 +if eval "test \"`echo '$''{'cf_cv_xopen_source'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char bcopy(); - +#include int main() { -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_bcopy) || defined (__stub___bcopy) -choke me -#else -bcopy(); +#ifndef _XOPEN_SOURCE +make an error #endif +; return 0; } +EOF +if { (eval echo configure:1769: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_xopen_source=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_save="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + cat > conftest.$ac_ext < +int main() { +#ifdef _XOPEN_SOURCE +make an error +#endif ; return 0; } EOF -if { (eval echo configure:1628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_func_bcopy=yes" + cf_cv_xopen_source=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_bcopy=no" + cf_cv_xopen_source=$cf_XOPEN_SOURCE fi rm -f conftest* + CPPFLAGS="$cf_save" + fi +rm -f conftest* -if eval "test \"`echo '$ac_cv_func_'bcopy`\" = yes"; then - echo "$ac_t""yes" 1>&6 - - echo $ac_n "checking if bcopy does overlapping moves""... $ac_c" 1>&6 -echo "configure:1644: checking if bcopy does overlapping moves" >&5 -if eval "test \"`echo '$''{'cf_cv_good_bcopy'+set}'`\" = set"; then +fi + +echo "$ac_t""$cf_cv_xopen_source" 1>&6 +test "$cf_cv_xopen_source" != no && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source" + +cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE +echo $ac_n "checking if we should define _POSIX_C_SOURCE""... $ac_c" 1>&6 +echo "configure:1811: checking if we should define _POSIX_C_SOURCE" >&5 +if eval "test \"`echo '$''{'cf_cv_posix_c_source'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test "$cross_compiling" = yes; then - cf_cv_good_bcopy=unknown -else - cat > conftest.$ac_ext <&5 + + cat > conftest.$ac_ext < +int main() { + +#ifndef _POSIX_C_SOURCE +make an error +#endif +; return 0; } +EOF +if { (eval echo configure:1830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_posix_c_source=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + case .$cf_POSIX_C_SOURCE in + .[12]??*) + cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" + ;; + .2) + cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_POSIX_SOURCE" + ;; + .*) + cf_cv_posix_c_source="-D_POSIX_SOURCE" + ;; + esac + +echo "(line 1849) testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 + + cf_save="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source" + +echo "(line 1854) testing if the second compile does not leave our definition intact error ..." 1>&5 + cat > conftest.$ac_ext < int main() { - static char data[] = "abcdefghijklmnopqrstuwwxyz"; - char temp[40]; - bcopy(data, temp, sizeof(data)); - bcopy(temp+10, temp, 15); - bcopy(temp+5, temp+15, 10); - exit (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz")); -} - + +#ifndef _POSIX_C_SOURCE +make an error +#endif +; return 0; } EOF -if { (eval echo configure:1666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - cf_cv_good_bcopy=yes +if { (eval echo configure:1867: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -fr conftest* - cf_cv_good_bcopy=no + rm -rf conftest* + cf_cv_posix_c_source=no fi -rm -fr conftest* +rm -f conftest* + CPPFLAGS="$cf_save" + fi +rm -f conftest* - fi -echo "$ac_t""$cf_cv_good_bcopy" 1>&6 - -else - echo "$ac_t""no" 1>&6 -cf_cv_good_bcopy=no -fi - - if test "$cf_cv_good_bcopy" = yes ; then - cat >> confdefs.h <<\EOF -#define USE_OK_BCOPY 1 -EOF - - else - cat >> confdefs.h <<\EOF -#define USE_MY_MEMMOVE 1 -EOF - - fi - -fi - - -# compute a reasonable value for $TERM to give tgetent(), since we may be -# running in 'screen', which sets $TERMCAP to a specific entry that is not -# necessarily in /etc/termcap - unsetenv is not portable, so we cannot simply -# discard $TERMCAP. -cf_TERMVAR=vt100 -test -n "$TERMCAP" && cf_TERMVAR="$TERM" -test -z "$cf_TERMVAR" && cf_TERMVAR=vt100 - -echo $ac_n "checking for full tgetent function""... $ac_c" 1>&6 -echo "configure:1712: checking for full tgetent function" >&5 -if eval "test \"`echo '$''{'cf_cv_lib_tgetent'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -cf_save_LIBS="$LIBS" -cf_cv_lib_tgetent=no -cf_TERMLIB="termcap termlib ncurses curses" -for cf_termlib in '' $cf_TERMLIB ; do - LIBS="$cf_save_LIBS" - test -n "$cf_termlib" && LIBS="$LIBS -l$cf_termlib" - if test "$cross_compiling" = yes; then - echo "cross-compiling, cannot verify if a termcap/tgetent is present in $cf_termlib" 1>&5 -else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - echo "yes, there is a termcap/tgetent in $cf_termlib" 1>&5 - if test -n "$cf_termlib" ; then - cf_cv_lib_tgetent="-l$cf_termlib" - else - cf_cv_lib_tgetent=yes - fi - break -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - echo "no, there is no termcap/tgetent in $cf_termlib" 1>&5 -fi -rm -fr conftest* -fi - -done -LIBS="$cf_save_LIBS" - -fi - -echo "$ac_t""$cf_cv_lib_tgetent" 1>&6 - -# If we found a working tgetent(), set LIBS and check for termcap.h. -# (LIBS cannot be set inside AC_CACHE_CHECK; the commands there should -# not have side effects other than setting the cache variable, because -# they are not executed when a cached value exists.) -if test "$cf_cv_lib_tgetent" != no ; then - test "$cf_cv_lib_tgetent" != yes && LIBS="$LIBS $cf_cv_lib_tgetent" - cat >> confdefs.h <<\EOF -#define USE_TERMCAP 1 -EOF - - cat > conftest.$ac_ext < -int main() { - -#ifdef NCURSES_VERSION -make an error -#endif -; return 0; } -EOF -if { (eval echo configure:1788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - cat >> confdefs.h <<\EOF -#define HAVE_TERMCAP_H 1 -EOF +echo "$ac_t""$cf_cv_posix_c_source" 1>&6 +test "$cf_cv_posix_c_source" != no && CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* -else - # If we didn't find a tgetent() that supports the buffer - # argument, look again to see whether we can find even - # a crippled one. A crippled tgetent() is still useful to - # validate values for the TERM environment variable given to - # child processes. - echo $ac_n "checking for partial tgetent function""... $ac_c" 1>&6 -echo "configure:1806: checking for partial tgetent function" >&5 -if eval "test \"`echo '$''{'cf_cv_lib_part_tgetent'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - cf_cv_lib_part_tgetent=no - for cf_termlib in $cf_TERMLIB ; do - LIBS="$cf_save_LIBS -l$cf_termlib" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - echo "there is a terminfo/tgetent in $cf_termlib" 1>&5 - cf_cv_lib_part_tgetent="-l$cf_termlib" - break -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* - done - LIBS="$cf_save_LIBS" - -fi -echo "$ac_t""$cf_cv_lib_part_tgetent" 1>&6 +### checks for header files +for ac_hdr in \ +ncurses/term.h \ +stdlib.h \ +termios.h \ +unistd.h \ - if test "$cf_cv_lib_part_tgetent" != no ; then - LIBS="$LIBS $cf_cv_lib_part_tgetent" - for ac_hdr in termcap.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1845: checking for $ac_hdr" >&5 +echo "configure:1900: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done - - # If this is linking against ncurses, we'll trigger the - # ifdef in resize.c that turns the termcap stuff back off. - cat >> confdefs.h <<\EOF -#define USE_TERMINFO 1 -EOF - - fi -fi - - -for ac_hdr in lastlog.h paths.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1896: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 +echo "configure:1937: checking whether time.h and sys/time.h may both be included" >&5 +if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +#include +#include +#include +int main() { +struct tm *tp; +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +if { (eval echo configure:1951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + ac_cv_header_time=yes else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + ac_cv_header_time=no fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 +if test $ac_cv_header_time = yes; then + cat >> confdefs.h <<\EOF +#define TIME_WITH_SYS_TIME 1 EOF - -else - echo "$ac_t""no" 1>&6 + fi -done -echo $ac_n "checking for lastlog path""... $ac_c" 1>&6 -echo "configure:1933: checking for lastlog path" >&5 -if eval "test \"`echo '$''{'cf_cv_path_lastlog'+set}'`\" = set"; then + + echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6 +echo "configure:1973: checking for nl_langinfo and CODESET" >&5 +if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - -cat > conftest.$ac_ext < conftest.$ac_ext < -#ifdef HAVE_LASTLOG_H -#include -#else -#ifdef HAVE_PATHS_H -#include -#endif -#endif +#include int main() { -char *path = _PATH_LASTLOG +char* cs = nl_langinfo(CODESET); ; return 0; } EOF -if { (eval echo configure:1954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - cf_cv_path_lastlog="_PATH_LASTLOG" + am_cv_langinfo_codeset=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - if test -f /usr/adm/lastlog ; then - cf_cv_path_lastlog=/usr/adm/lastlog - else - cf_cv_path_lastlog=no - fi + am_cv_langinfo_codeset=no fi rm -f conftest* - + fi -echo "$ac_t""$cf_cv_path_lastlog" 1>&6 -test $cf_cv_path_lastlog != no && cat >> confdefs.h <<\EOF -#define USE_LASTLOG 1 +echo "$ac_t""$am_cv_langinfo_codeset" 1>&6 + if test $am_cv_langinfo_codeset = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_LANGINFO_CODESET 1 EOF + fi +### checks for typedefs - -echo $ac_n "checking for utmp implementation""... $ac_c" 1>&6 -echo "configure:1981: checking for utmp implementation" >&5 -if eval "test \"`echo '$''{'cf_cv_have_utmp'+set}'`\" = set"; then +echo $ac_n "checking for size_t in or ""... $ac_c" 1>&6 +echo "configure:2010: checking for size_t in or " >&5 +if eval "test \"`echo '$''{'cf_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cf_cv_have_utmp=no -for cf_header in utmpx utmp ; do -cf_utmp_includes=" + cat > conftest.$ac_ext < -#include <${cf_header}.h> -#define getutent getutxent -#ifdef USE_LASTLOG -#include /* may conflict with utmpx.h on Linux */ +#ifdef STDC_HEADERS +#include +#include #endif -" - cat > conftest.$ac_ext < int main() { -struct $cf_header x; - char *name = x.ut_name; /* utmp.h and compatible definitions */ - +size_t x ; return 0; } EOF -if { (eval echo configure:2006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2029: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - cf_cv_have_utmp=$cf_header - break + cf_cv_type_size_t=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - - cat > conftest.$ac_ext <&6 +test $cf_cv_type_size_t = no && cat >> confdefs.h <<\EOF +#define size_t unsigned +EOF + + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:2049: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include EOF -if { (eval echo configure:2025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then rm -rf conftest* - cf_cv_have_utmp=$cf_header - break - + ac_cv_header_stdc=yes else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no fi rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no fi rm -f conftest* -done fi -echo "$ac_t""$cf_cv_have_utmp" 1>&6 - -if test $cf_cv_have_utmp != no ; then - cat >> confdefs.h <<\EOF -#define HAVE_UTMP 1 +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext < EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* - test $cf_cv_have_utmp = utmpx && cat >> confdefs.h <<\EOF -#define UTMPX_FOR_UTMP 1 -EOF +fi - -if test $cf_cv_have_utmp != no ; then -echo $ac_n "checking if utmp.ut_host is declared""... $ac_c" 1>&6 -echo "configure:2055: checking if utmp.ut_host is declared" >&5 -if eval "test \"`echo '$''{'cf_cv_have_utmp_ut_host'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : else - - cat > conftest.$ac_ext < conftest.$ac_ext < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } -#include -#include <${cf_cv_have_utmp}.h> -int main() { -struct $cf_cv_have_utmp x; char *y = &x.ut_host[0] -; return 0; } EOF -if { (eval echo configure:2070: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - cf_cv_have_utmp_ut_host=yes +if { (eval echo configure:2129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cv_have_utmp_ut_host=no + rm -fr conftest* + ac_cv_header_stdc=no fi -rm -f conftest* - +rm -fr conftest* fi -echo "$ac_t""$cf_cv_have_utmp_ut_host" 1>&6 -test $cf_cv_have_utmp_ut_host != no && cat >> confdefs.h <<\EOF -#define HAVE_UTMP_UT_HOST 1 +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 EOF fi - -if test $cf_cv_have_utmp != no ; then -echo $ac_n "checking if utmp.ut_name is declared""... $ac_c" 1>&6 -echo "configure:2093: checking if utmp.ut_name is declared" >&5 -if eval "test \"`echo '$''{'cf_cv_have_utmp_ut_name'+set}'`\" = set"; then +echo $ac_n "checking for time_t""... $ac_c" 1>&6 +echo "configure:2153: checking for time_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_time_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - - cf_cv_have_utmp_ut_name=no -cf_utmp_includes=" + cat > conftest.$ac_ext < -#include <${cf_cv_have_utmp}.h> -#define getutent getutxent -#ifdef USE_LASTLOG -#include /* may conflict with utmpx.h on Linux */ +#if STDC_HEADERS +#include +#include #endif -" -for cf_header in ut_name ut_user ; do - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])time_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* - cf_cv_have_utmp_ut_name=$cf_header - break + ac_cv_type_time_t=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_type_time_t=no fi rm -f conftest* -done fi - -echo "$ac_t""$cf_cv_have_utmp_ut_name" 1>&6 - -case $cf_cv_have_utmp_ut_name in #(vi -no) #(vi - { echo "configure: error: Cannot find declaration for ut.ut_name" 1>&2; exit 1; } - ;; -ut_user) - cat >> confdefs.h <<\EOF -#define ut_name ut_user +echo "$ac_t""$ac_cv_type_time_t" 1>&6 +if test $ac_cv_type_time_t = no; then + cat >> confdefs.h <<\EOF +#define time_t long EOF - ;; -esac fi + +### checks for library functions +for ac_func in \ + bcopy \ + gethostname \ + getlogin \ + memmove \ + strerror \ + strftime \ + tcgetattr \ + waitpid \ -if test $cf_cv_have_utmp != no ; then -echo $ac_n "checking for exit-status in $cf_cv_have_utmp""... $ac_c" 1>&6 -echo "configure:2149: checking for exit-status in $cf_cv_have_utmp" >&5 -if eval "test \"`echo '$''{'cf_cv_have_utmp_ut_xstatus'+set}'`\" = set"; then +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2199: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - -for cf_result in \ - ut_exit.__e_exit \ - ut_exit.e_exit \ - ut_exit.ut_e_exit \ - ut_exit.ut_exit -do -cat > conftest.$ac_ext < conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); -#include -#include <${cf_cv_have_utmp}.h> int main() { -struct $cf_cv_have_utmp x; long y = x.$cf_result = 0 + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + ; return 0; } EOF -if { (eval echo configure:2170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - cf_cv_have_utmp_ut_xstatus=$cf_result - break + eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - cf_cv_have_utmp_ut_xstatus=no + eval "ac_cv_func_$ac_func=no" fi rm -f conftest* -done - fi -echo "$ac_t""$cf_cv_have_utmp_ut_xstatus" 1>&6 -if test $cf_cv_have_utmp_ut_xstatus != no ; then - cat >> confdefs.h <<\EOF -#define HAVE_UTMP_UT_XSTATUS 1 +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <> confdefs.h <&6 fi +done - -if test $cf_cv_have_utmp != no ; then -echo $ac_n "checking if utmp.ut_xtime is declared""... $ac_c" 1>&6 -echo "configure:2201: checking if utmp.ut_xtime is declared" >&5 -if eval "test \"`echo '$''{'cf_cv_have_utmp_ut_xtime'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - cat > conftest.$ac_ext < -#include <${cf_cv_have_utmp}.h> -int main() { -struct $cf_cv_have_utmp x; long y = x.ut_xtime = 0 -; return 0; } -EOF -if { (eval echo configure:2216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - cf_cv_have_utmp_ut_xtime=yes +echo $ac_n "checking for memmove""... $ac_c" 1>&6 +echo "configure:2253: checking for memmove" >&5 +if eval "test \"`echo '$''{'ac_cv_func_memmove'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char memmove(); -#include -#include <${cf_cv_have_utmp}.h> int main() { -struct $cf_cv_have_utmp x; long y = x.ut_tv.tv_sec + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_memmove) || defined (__stub___memmove) +choke me +#else +memmove(); +#endif + ; return 0; } EOF -if { (eval echo configure:2233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - cf_cv_have_utmp_ut_xtime=define + eval "ac_cv_func_memmove=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - cf_cv_have_utmp_ut_xtime=no -fi -rm -f conftest* - + eval "ac_cv_func_memmove=no" fi rm -f conftest* - fi -echo "$ac_t""$cf_cv_have_utmp_ut_xtime" 1>&6 -if test $cf_cv_have_utmp_ut_xtime != no ; then - cat >> confdefs.h <<\EOF -#define HAVE_UTMP_UT_XTIME 1 -EOF - - if test $cf_cv_have_utmp_ut_xtime = define ; then - cat >> confdefs.h <<\EOF -#define ut_xtime ut_tv.tv_sec -EOF - - fi -fi -fi +if eval "test \"`echo '$ac_cv_func_'memmove`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 - -if test $cf_cv_have_utmp != no ; then -echo $ac_n "checking if utmp.ut_session is declared""... $ac_c" 1>&6 -echo "configure:2267: checking if utmp.ut_session is declared" >&5 -if eval "test \"`echo '$''{'cf_cv_have_utmp_ut_session'+set}'`\" = set"; then +echo $ac_n "checking for bcopy""... $ac_c" 1>&6 +echo "configure:2300: checking for bcopy" >&5 +if eval "test \"`echo '$''{'ac_cv_func_bcopy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - - cat > conftest.$ac_ext < conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char bcopy(); -#include -#include <${cf_cv_have_utmp}.h> int main() { -struct $cf_cv_have_utmp x; long y = x.ut_session + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_bcopy) || defined (__stub___bcopy) +choke me +#else +bcopy(); +#endif + ; return 0; } EOF -if { (eval echo configure:2282: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - cf_cv_have_utmp_ut_session=yes + eval "ac_cv_func_bcopy=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - cf_cv_have_utmp_ut_session=no + eval "ac_cv_func_bcopy=no" fi rm -f conftest* - fi -echo "$ac_t""$cf_cv_have_utmp_ut_session" 1>&6 -if test $cf_cv_have_utmp_ut_session != no ; then - cat >> confdefs.h <<\EOF -#define HAVE_UTMP_UT_SESSION 1 -EOF - -fi -fi - - -echo $ac_n "checking if $cf_cv_have_utmp is SYSV flavor""... $ac_c" 1>&6 -echo "configure:2306: checking if $cf_cv_have_utmp is SYSV flavor" >&5 -if eval "test \"`echo '$''{'cf_cv_sysv_utmp'+set}'`\" = set"; then +if eval "test \"`echo '$ac_cv_func_'bcopy`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + echo $ac_n "checking if bcopy does overlapping moves""... $ac_c" 1>&6 +echo "configure:2344: checking if bcopy does overlapping moves" >&5 +if eval "test \"`echo '$''{'cf_cv_good_bcopy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -test "$cf_cv_have_utmp" = "utmp" && cf_prefix="ut" || cf_prefix="utx" -cat > conftest.$ac_ext < conftest.$ac_ext < -#include <${cf_cv_have_utmp}.h> int main() { - -struct $cf_cv_have_utmp x; - set${cf_prefix}ent (); - get${cf_prefix}id(&x); - put${cf_prefix}line(&x); - end${cf_prefix}ent(); -; return 0; } + static char data[] = "abcdefghijklmnopqrstuwwxyz"; + char temp[40]; + bcopy(data, temp, sizeof(data)); + bcopy(temp+10, temp, 15); + bcopy(temp+5, temp+15, 10); + exit (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz")); +} + EOF -if { (eval echo configure:2327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - cf_cv_sysv_utmp=yes +if { (eval echo configure:2366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + cf_cv_good_bcopy=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cv_sysv_utmp=no + rm -fr conftest* + cf_cv_good_bcopy=no fi -rm -f conftest* - +rm -fr conftest* fi -echo "$ac_t""$cf_cv_sysv_utmp" 1>&6 -test $cf_cv_sysv_utmp = yes && cat >> confdefs.h <<\EOF -#define USE_SYSV_UTMP 1 -EOF - + +fi +echo "$ac_t""$cf_cv_good_bcopy" 1>&6 + +else + echo "$ac_t""no" 1>&6 +cf_cv_good_bcopy=no fi + if test "$cf_cv_good_bcopy" = yes ; then + cat >> confdefs.h <<\EOF +#define USE_OK_BCOPY 1 +EOF + + else + cat >> confdefs.h <<\EOF +#define USE_MY_MEMMOVE 1 +EOF -echo $ac_n "checking if you want to link with utempter""... $ac_c" 1>&6 -echo "configure:2350: checking if you want to link with utempter" >&5 + fi -# Check whether --with-utempter or --without-utempter was given. -if test "${with_utempter+set}" = set; then - withval="$with_utempter" - use_utempter=$withval -else - use_utempter=no fi -echo "$ac_t""$use_utempter" 1>&6 -if test "$use_utempter" = yes ; then - -echo $ac_n "checking if we can link with utempter library""... $ac_c" 1>&6 -echo "configure:2365: checking if we can link with utempter library" >&5 -if eval "test \"`echo '$''{'cf_cv_have_utempter'+set}'`\" = set"; then +# compute a reasonable value for $TERM to give tgetent(), since we may be +# running in 'screen', which sets $TERMCAP to a specific entry that is not +# necessarily in /etc/termcap - unsetenv is not portable, so we cannot simply +# discard $TERMCAP. +cf_TERMVAR=vt100 +test -n "$TERMCAP" && cf_TERMVAR="$TERM" +test -z "$cf_TERMVAR" && cf_TERMVAR=vt100 + +echo $ac_n "checking for full tgetent function""... $ac_c" 1>&6 +echo "configure:2412: checking for full tgetent function" >&5 +if eval "test \"`echo '$''{'cf_cv_lib_tgetent'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cf_save_LIBS="$LIBS" -LIBS="-lutempter $LIBS" -cat > conftest.$ac_ext <&5 +else + cat > conftest.$ac_ext < - -int main() { - - addToUtmp("/dev/tty", 0, 1); - removeFromUtmp(); - -; return 0; } +/* terminfo implementations ignore the buffer argument, making it useless for + * the xterm application, which uses this information to make a new TERMCAP + * environment variable. + */ +int main() +{ + char buffer[1024]; + buffer[0] = 0; + tgetent(buffer, "$cf_TERMVAR"); + exit(buffer[0] == 0); } EOF -if { (eval echo configure:2385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - - cf_cv_have_utempter=yes +if { (eval echo configure:2441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + echo "yes, there is a termcap/tgetent in $cf_termlib" 1>&5 + if test -n "$cf_termlib" ; then + cf_cv_lib_tgetent="-l$cf_termlib" + else + cf_cv_lib_tgetent=yes + fi + break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - - cf_cv_have_utempter=no + rm -fr conftest* + echo "no, there is no termcap/tgetent in $cf_termlib" 1>&5 fi -rm -f conftest* -LIBS="$cf_save_LIBS" - +rm -fr conftest* fi -echo "$ac_t""$cf_cv_have_utempter" 1>&6 -if test "$cf_cv_have_utempter" = yes ; then - cat >> confdefs.h <<\EOF -#define USE_UTEMPTER 1 -EOF +done +LIBS="$cf_save_LIBS" - LIBS="-lutempter $LIBS" fi -fi +echo "$ac_t""$cf_cv_lib_tgetent" 1>&6 -### checks for external data +# If we found a working tgetent(), set LIBS and check for termcap.h. +# (LIBS cannot be set inside AC_CACHE_CHECK; the commands there should +# not have side effects other than setting the cache variable, because +# they are not executed when a cached value exists.) +if test "$cf_cv_lib_tgetent" != no ; then + test "$cf_cv_lib_tgetent" != yes && LIBS="$LIBS $cf_cv_lib_tgetent" + cat >> confdefs.h <<\EOF +#define USE_TERMCAP 1 +EOF + cat > conftest.$ac_ext <&6 -echo "configure:2416: checking if external errno is declared" >&5 -if eval "test \"`echo '$''{'cf_cv_dcl_errno'+set}'`\" = set"; then +#include +int main() { + +#ifdef NCURSES_VERSION +make an error +#endif +; return 0; } +EOF +if { (eval echo configure:2488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cat >> confdefs.h <<\EOF +#define HAVE_TERMCAP_H 1 +EOF + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +else + # If we didn't find a tgetent() that supports the buffer + # argument, look again to see whether we can find even + # a crippled one. A crippled tgetent() is still useful to + # validate values for the TERM environment variable given to + # child processes. + echo $ac_n "checking for partial tgetent function""... $ac_c" 1>&6 +echo "configure:2506: checking for partial tgetent function" >&5 +if eval "test \"`echo '$''{'cf_cv_lib_part_tgetent'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < -#endif -#include -#include -#include int main() { -long x = (long) errno +tgetent(0, "$cf_TERMVAR") ; return 0; } EOF -if { (eval echo configure:2435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - cf_cv_dcl_errno=yes + echo "there is a terminfo/tgetent in $cf_termlib" 1>&5 + cf_cv_lib_part_tgetent="-l$cf_termlib" + break else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cv_dcl_errno=no fi rm -f conftest* - + done + LIBS="$cf_save_LIBS" + fi -echo "$ac_t""$cf_cv_dcl_errno" 1>&6 +echo "$ac_t""$cf_cv_lib_part_tgetent" 1>&6 -if test "$cf_cv_dcl_errno" = no ; then - -cf_result=`echo "decl_errno" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + if test "$cf_cv_lib_part_tgetent" != no ; then + LIBS="$LIBS $cf_cv_lib_part_tgetent" + for ac_hdr in termcap.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2545: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2555: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done - cat >> confdefs.h <> confdefs.h <<\EOF +#define USE_TERMINFO 1 EOF + fi fi -# It's possible (for near-UNIX clones) that the data doesn't exist -echo $ac_n "checking if external errno exists""... $ac_c" 1>&6 -echo "configure:2463: checking if external errno exists" >&5 -if eval "test \"`echo '$''{'cf_cv_have_errno'+set}'`\" = set"; then +for ac_hdr in lastlog.h paths.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2596: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - - cat > conftest.$ac_ext < conftest.$ac_ext < EOF -if { (eval echo configure:2479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2606: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then rm -rf conftest* - cf_cv_have_errno=yes + eval "ac_cv_header_$ac_safe=yes" else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - cf_cv_have_errno=no + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* - fi - -echo "$ac_t""$cf_cv_have_errno" 1>&6 - -if test "$cf_cv_have_errno" = yes ; then - -cf_result=`echo "have_errno" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >> confdefs.h <&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 fi +done - - - - -echo $ac_n "checking for tty group name""... $ac_c" 1>&6 -echo "configure:2509: checking for tty group name" >&5 -if eval "test \"`echo '$''{'cf_cv_tty_group_name'+set}'`\" = set"; then +echo $ac_n "checking for lastlog path""... $ac_c" 1>&6 +echo "configure:2633: checking for lastlog path" >&5 +if eval "test \"`echo '$''{'cf_cv_path_lastlog'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else +cat > conftest.$ac_ext <conftest.out - read cf_mode cf_links cf_usr cf_grp cf_size cf_date1 cf_date2 cf_date3 cf_rest conftest.out - read cf_mode cf_links cf_usr cf_grp cf_size cf_date1 cf_date2 cf_date3 cf_rest +#ifdef HAVE_LASTLOG_H +#include +#else +#ifdef HAVE_PATHS_H +#include +#endif +#endif +int main() { +char *path = _PATH_LASTLOG +; return 0; } +EOF +if { (eval echo configure:2654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_path_lastlog="_PATH_LASTLOG" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + if test -f /usr/adm/lastlog ; then + cf_cv_path_lastlog=/usr/adm/lastlog + else + cf_cv_path_lastlog=no fi - rm -f conftest.out - cf_cv_tty_group_name=$cf_grp -fi fi +rm -f conftest* -# If we cannot deduce the tty group, fall back on hardcoded cases - -if test -z "$cf_cv_tty_group_name" -then -case $host_os in #(vi -osf*) #(vi - cf_cv_tty_group_name="terminal" - ;; -*) - cf_cv_tty_group_name="unknown" - if ( egrep '^tty:' /etc/group 2>/dev/null 1>/dev/null ) then - cf_cv_tty_group_name="tty" - fi - ;; -esac fi -fi +echo "$ac_t""$cf_cv_path_lastlog" 1>&6 +test $cf_cv_path_lastlog != no && cat >> confdefs.h <<\EOF +#define USE_LASTLOG 1 +EOF -echo "$ac_t""$cf_cv_tty_group_name" 1>&6 -cat >> confdefs.h <&6 -echo "configure:2574: checking if we may use $cf_cv_tty_group_name group" >&5 -if eval "test \"`echo '$''{'cf_cv_tty_group'+set}'`\" = set"; then +echo $ac_n "checking for utmp implementation""... $ac_c" 1>&6 +echo "configure:2681: checking for utmp implementation" >&5 +if eval "test \"`echo '$''{'cf_cv_have_utmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -cf_tty_name=`tty` -if test "$cf_tty_name" != "not a tty" -then -if test "$cross_compiling" = yes; then - cf_cv_tty_group=unknown + cf_cv_have_utmp=no +for cf_header in utmpx utmp ; do +cf_utmp_includes=" +#include +#include <${cf_header}.h> +#define getutent getutxent +#ifdef USE_LASTLOG +#include /* may conflict with utmpx.h on Linux */ +#endif +" + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_have_utmp=$cf_header + break else - cat > conftest.$ac_ext <&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + cat > conftest.$ac_ext < -#include -#include -#include -int main() -{ - struct stat sb; - struct group *ttygrp = getgrnam(TTY_GROUP_NAME); - char *name = ttyname(0); - - endgrent(); - if (ttygrp != 0 - && name != 0 - && stat(name, &sb) == 0 - && sb.st_gid != getgid() - && sb.st_gid == ttygrp->gr_gid) { - exit(0); - } - exit(1); -} +$cf_utmp_includes +int main() { +struct $cf_header x; + char *name = x.ut_user; /* utmpx.h must declare this */ +; return 0; } EOF -if { (eval echo configure:2611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - cf_cv_tty_group=yes +if { (eval echo configure:2725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_have_utmp=$cf_header + break + else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -fr conftest* - cf_cv_tty_group=no fi -rm -fr conftest* +rm -f conftest* fi +rm -f conftest* +done -elif test "$cross_compiling" = yes; then - cf_cv_tty_group=unknown -else - cf_cv_tty_group=yes fi -fi +echo "$ac_t""$cf_cv_have_utmp" 1>&6 -echo "$ac_t""$cf_cv_tty_group" 1>&6 -test $cf_cv_tty_group = yes && cat >> confdefs.h <<\EOF -#define USE_TTY_GROUP 1 +if test $cf_cv_have_utmp != no ; then + cat >> confdefs.h <<\EOF +#define HAVE_UTMP 1 EOF + test $cf_cv_have_utmp = utmpx && cat >> confdefs.h <<\EOF +#define UTMPX_FOR_UTMP 1 +EOF + +if test $cf_cv_have_utmp != no ; then +echo $ac_n "checking if utmp.ut_host is declared""... $ac_c" 1>&6 +echo "configure:2755: checking if utmp.ut_host is declared" >&5 +if eval "test \"`echo '$''{'cf_cv_have_utmp_ut_host'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +#include <${cf_cv_have_utmp}.h> +int main() { +struct $cf_cv_have_utmp x; char *y = &x.ut_host[0] +; return 0; } +EOF +if { (eval echo configure:2770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_have_utmp_ut_host=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_cv_have_utmp_ut_host=no +fi +rm -f conftest* + +fi -echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 -echo "configure:2641: checking for ${CC-cc} option to accept ANSI C" >&5 -if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then +echo "$ac_t""$cf_cv_have_utmp_ut_host" 1>&6 +test $cf_cv_have_utmp_ut_host != no && cat >> confdefs.h <<\EOF +#define HAVE_UTMP_UT_HOST 1 +EOF + +fi + + +if test $cf_cv_have_utmp != no ; then +echo $ac_n "checking if utmp.ut_name is declared""... $ac_c" 1>&6 +echo "configure:2793: checking if utmp.ut_name is declared" >&5 +if eval "test \"`echo '$''{'cf_cv_have_utmp_ut_name'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else -cf_cv_ansi_cc=no -cf_save_CFLAGS="$CFLAGS" -cf_save_CPPFLAGS="$CPPFLAGS" -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX -Aa -D_HPUX_SOURCE -# SVR4 -Xc -# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) -for cf_arg in "-DCC_HAS_PROTOS" \ - "" \ - -qlanglvl=ansi \ - -std1 \ - -Ae \ - "-Aa -D_HPUX_SOURCE" \ - -Xc -do + cf_cv_have_utmp_ut_name=no +cf_utmp_includes=" +#include +#include <${cf_cv_have_utmp}.h> +#define getutent getutxent +#ifdef USE_LASTLOG +#include /* may conflict with utmpx.h on Linux */ +#endif +" +for cf_header in ut_name ut_user ; do + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_have_utmp_ut_name=$cf_header + break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +done -for cf_add_cflags in $cf_arg -do -case $cf_fix_cppflags in -no) - case $cf_add_cflags in #(vi - -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` +fi - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes +echo "$ac_t""$cf_cv_have_utmp_ut_name" 1>&6 - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - continue - elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac +case $cf_cv_have_utmp_ut_name in #(vi +no) #(vi + { echo "configure: error: Cannot find declaration for ut.ut_name" 1>&2; exit 1; } ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` +ut_user) + cat >> confdefs.h <<\EOF +#define ut_name ut_user +EOF - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no ;; esac +fi + + +if test $cf_cv_have_utmp != no ; then +echo $ac_n "checking for exit-status in $cf_cv_have_utmp""... $ac_c" 1>&6 +echo "configure:2849: checking for exit-status in $cf_cv_have_utmp" >&5 +if eval "test \"`echo '$''{'cf_cv_have_utmp_ut_xstatus'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +for cf_result in \ + ut_exit.__e_exit \ + ut_exit.e_exit \ + ut_exit.ut_e_exit \ + ut_exit.ut_exit +do +cat > conftest.$ac_ext < +#include <${cf_cv_have_utmp}.h> +int main() { +struct $cf_cv_have_utmp x; long y = x.$cf_result = 0 +; return 0; } +EOF +if { (eval echo configure:2870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_have_utmp_ut_xstatus=$cf_result + break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_cv_have_utmp_ut_xstatus=no +fi +rm -f conftest* done -if test -n "$cf_new_cflags" ; then +fi + +echo "$ac_t""$cf_cv_have_utmp_ut_xstatus" 1>&6 +if test $cf_cv_have_utmp_ut_xstatus != no ; then + cat >> confdefs.h <<\EOF +#define HAVE_UTMP_UT_XSTATUS 1 +EOF + + cat >> confdefs.h <&6 +echo "configure:2901: checking if utmp.ut_xtime is declared" >&5 +if eval "test \"`echo '$''{'cf_cv_have_utmp_ut_xtime'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +#include <${cf_cv_have_utmp}.h> +int main() { +struct $cf_cv_have_utmp x; long y = x.ut_xtime = 0 +; return 0; } +EOF +if { (eval echo configure:2916: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_have_utmp_ut_xtime=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cat > conftest.$ac_ext < +#include <${cf_cv_have_utmp}.h> +int main() { +struct $cf_cv_have_utmp x; long y = x.ut_tv.tv_sec +; return 0; } +EOF +if { (eval echo configure:2933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_have_utmp_ut_xtime=define +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_cv_have_utmp_ut_xtime=no +fi +rm -f conftest* + +fi +rm -f conftest* + +fi + +echo "$ac_t""$cf_cv_have_utmp_ut_xtime" 1>&6 +if test $cf_cv_have_utmp_ut_xtime != no ; then + cat >> confdefs.h <<\EOF +#define HAVE_UTMP_UT_XTIME 1 +EOF + + if test $cf_cv_have_utmp_ut_xtime = define ; then + cat >> confdefs.h <<\EOF +#define ut_xtime ut_tv.tv_sec +EOF + + fi +fi fi -if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" +if test $cf_cv_have_utmp != no ; then +echo $ac_n "checking if utmp.ut_session is declared""... $ac_c" 1>&6 +echo "configure:2967: checking if utmp.ut_session is declared" >&5 +if eval "test \"`echo '$''{'cf_cv_have_utmp_ut_session'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +#include <${cf_cv_have_utmp}.h> +int main() { +struct $cf_cv_have_utmp x; long y = x.ut_session +; return 0; } +EOF +if { (eval echo configure:2982: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cf_cv_have_utmp_ut_session=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_cv_have_utmp_ut_session=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$cf_cv_have_utmp_ut_session" 1>&6 +if test $cf_cv_have_utmp_ut_session != no ; then + cat >> confdefs.h <<\EOF +#define HAVE_UTMP_UT_SESSION 1 +EOF + +fi fi -if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - - - - - cat > conftest.$ac_ext <&6 +echo "configure:3006: checking if $cf_cv_have_utmp is SYSV flavor" >&5 +if eval "test \"`echo '$''{'cf_cv_sysv_utmp'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +test "$cf_cv_have_utmp" = "utmp" && cf_prefix="ut" || cf_prefix="utx" +cat > conftest.$ac_ext < +#include <${cf_cv_have_utmp}.h> int main() { - int test (int i, double x); - struct s1 {int (*f) (int a);}; - struct s2 {int (*f) (double a);}; +struct $cf_cv_have_utmp x; + set${cf_prefix}ent (); + get${cf_prefix}id(&x); + put${cf_prefix}line(&x); + end${cf_prefix}ent(); ; return 0; } EOF -if { (eval echo configure:2753: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - cf_cv_ansi_cc="$cf_arg"; break + cf_cv_sysv_utmp=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 + rm -rf conftest* + cf_cv_sysv_utmp=no fi rm -f conftest* -done -CFLAGS="$cf_save_CFLAGS" -CPPFLAGS="$cf_save_CPPFLAGS" fi -echo "$ac_t""$cf_cv_ansi_cc" 1>&6 - -if test "$cf_cv_ansi_cc" != "no"; then -if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -cf_new_extra_cppflags= - -for cf_add_cflags in $cf_cv_ansi_cc -do -case $cf_fix_cppflags in -no) - case $cf_add_cflags in #(vi - -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - continue - elif test "${cf_tst_cflags}" = "\"'" ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi +echo "$ac_t""$cf_cv_sysv_utmp" 1>&6 +test $cf_cv_sysv_utmp = yes && cat >> confdefs.h <<\EOF +#define USE_SYSV_UTMP 1 +EOF -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" -fi -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi +echo $ac_n "checking if you want to link with utempter""... $ac_c" 1>&6 +echo "configure:3050: checking if you want to link with utempter" >&5 - +# Check whether --with-utempter or --without-utempter was given. +if test "${with_utempter+set}" = set; then + withval="$with_utempter" + use_utempter=$withval else - cat >> confdefs.h <<\EOF -#define CC_HAS_PROTOS 1 -EOF - -fi + use_utempter=no fi -echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2852: checking for working const" >&5 -if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then +echo "$ac_t""$use_utempter" 1>&6 + +if test "$use_utempter" = yes ; then + +echo $ac_n "checking if we can link with utempter library""... $ac_c" 1>&6 +echo "configure:3065: checking if we can link with utempter library" >&5 +if eval "test \"`echo '$''{'cf_cv_have_utempter'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < -/* Ultrix mips cc rejects this. */ -typedef int charset[2]; const charset x; -/* SunOS 4.1.1 cc rejects this. */ -char const *const *ccp; -char **p; -/* NEC SVR4.0.2 mips cc rejects this. */ -struct point {int x, y;}; -static struct point const zero = {0,0}; -/* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in an arm - of an if-expression whose if-part is not a constant expression */ -const char *g = "string"; -ccp = &g + (g ? g-g : 0); -/* HPUX 7.0 cc rejects these. */ -++ccp; -p = (char**) ccp; -ccp = (char const *const *) p; -{ /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; +int main() { - *t++ = 0; -} -{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; -} -{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; -} -{ /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -} + addToUtmp("/dev/tty", 0, 1); + removeFromUtmp(); ; return 0; } EOF -if { (eval echo configure:2906: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - ac_cv_c_const=yes + + cf_cv_have_utempter=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - ac_cv_c_const=no + + cf_cv_have_utempter=no fi rm -f conftest* +LIBS="$cf_save_LIBS" + fi -echo "$ac_t""$ac_cv_c_const" 1>&6 -if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const +echo "$ac_t""$cf_cv_have_utempter" 1>&6 +if test "$cf_cv_have_utempter" = yes ; then + cat >> confdefs.h <<\EOF +#define USE_UTEMPTER 1 EOF + LIBS="-lutempter $LIBS" fi -echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:2927: checking for Cygwin environment" >&5 -if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then +fi + +### checks for external data + + +echo $ac_n "checking if external errno is declared""... $ac_c" 1>&6 +echo "configure:3116: checking if external errno is declared" >&5 +if eval "test \"`echo '$''{'cf_cv_dcl_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < #endif -return __CYGWIN__; +#include +#include +#include +int main() { +long x = (long) errno ; return 0; } EOF -if { (eval echo configure:2943: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - ac_cv_cygwin=yes + cf_cv_dcl_errno=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - ac_cv_cygwin=no + cf_cv_dcl_errno=no fi rm -f conftest* -rm -f conftest* + fi -echo "$ac_t""$ac_cv_cygwin" 1>&6 -CYGWIN= -test "$ac_cv_cygwin" = yes && CYGWIN=yes -echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:2960: checking for mingw32 environment" >&5 -if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then +echo "$ac_t""$cf_cv_dcl_errno" 1>&6 + +if test "$cf_cv_dcl_errno" = no ; then + +cf_result=`echo "decl_errno" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >> confdefs.h <&6 +echo "configure:3163: checking if external errno exists" >&5 +if eval "test \"`echo '$''{'cf_cv_have_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - ac_cv_mingw32=yes + cf_cv_have_errno=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - ac_cv_mingw32=no + cf_cv_have_errno=no fi rm -f conftest* -rm -f conftest* + fi -echo "$ac_t""$ac_cv_mingw32" 1>&6 -MINGW32= -test "$ac_cv_mingw32" = yes && MINGW32=yes +echo "$ac_t""$cf_cv_have_errno" 1>&6 +if test "$cf_cv_have_errno" = yes ; then + +cf_result=`echo "have_errno" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` -case $cf_cv_system_name in -os2*) - CFLAGS="$CFLAGS -Zmt" - CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__" - CXXFLAGS="$CXXFLAGS -Zmt" - # autoconf's macro sets -Zexe and suffix both, which conflict:w - LDFLAGS="$LDFLAGS -Zmt -Zcrtdll" - ac_cv_exeext=.exe - ;; -esac + cat >> confdefs.h <&6 -echo "configure:3004: checking for executable suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + + +echo $ac_n "checking for tty group name""... $ac_c" 1>&6 +echo "configure:3209: checking for tty group name" >&5 +if eval "test \"`echo '$''{'cf_cv_tty_group_name'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test "$CYGWIN" = yes || test "$MINGW32" = yes; then - ac_cv_exeext=.exe -else - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= - if { (eval echo configure:3014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.c | *.o | *.obj) ;; - *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; - esac - done - else - { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } - fi - rm -f conftest* - test x"${ac_cv_exeext}" = x && ac_cv_exeext=no + + +# If we are configuring as root, it is hard to get a clue about the tty group. +# But we'll guess based on how our connection is set up - assuming it is done +# properly. + +cf_uid=`id | sed -e 's/^^=*=//' -e 's/(.*$//'` +if test "$cf_uid" != 0 ; then +cf_cv_tty_group_name= +cf_tty_name=`tty` +test "$cf_tty_name" = "not a tty" && cf_tty_name=/dev/tty +test -z "$cf_tty_name" && cf_tty_name=/dev/tty +if test -c "$cf_tty_name" +then + cf_option="-l -L" + + # Expect listing to have fields like this: + #-rwxrwxrwx 1 user group 34293 Jul 18 16:29 pathname + ls $cf_option $cf_tty_name >conftest.out + read cf_mode cf_links cf_usr cf_grp cf_size cf_date1 cf_date2 cf_date3 cf_rest conftest.out + read cf_mode cf_links cf_usr cf_grp cf_size cf_date1 cf_date2 cf_date3 cf_rest &6 -ac_exeext=$EXEEXT +# If we cannot deduce the tty group, fall back on hardcoded cases -echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:3035: checking for object suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then +if test -z "$cf_cv_tty_group_name" +then +case $host_os in #(vi +osf*) #(vi + cf_cv_tty_group_name="terminal" + ;; +*) + cf_cv_tty_group_name="unknown" + if ( egrep '^tty:' /etc/group 2>/dev/null 1>/dev/null ) then + cf_cv_tty_group_name="tty" + fi + ;; +esac +fi + +fi + +echo "$ac_t""$cf_cv_tty_group_name" 1>&6 + +cat >> confdefs.h <&6 +echo "configure:3274: checking if we may use $cf_cv_tty_group_name group" >&5 +if eval "test \"`echo '$''{'cf_cv_tty_group'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - rm -f conftest* -echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:3041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - for ac_file in conftest.*; do - case $ac_file in - *.c) ;; - *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; - esac - done + +cf_tty_name=`tty` +if test "$cf_tty_name" != "not a tty" +then +if test "$cross_compiling" = yes; then + cf_cv_tty_group=unknown else - { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } + cat > conftest.$ac_ext < +#include +#include +#include +int main() +{ + struct stat sb; + struct group *ttygrp = getgrnam(TTY_GROUP_NAME); + char *name = ttyname(0); + + endgrent(); + if (ttygrp != 0 + && name != 0 + && stat(name, &sb) == 0 + && sb.st_gid != getgid() + && sb.st_gid == ttygrp->gr_gid) { + exit(0); + } + exit(1); +} + +EOF +if { (eval echo configure:3311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + cf_cv_tty_group=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + cf_cv_tty_group=no fi -rm -f conftest* +rm -fr conftest* fi -echo "$ac_t""$ac_cv_objext" 1>&6 -OBJEXT=$ac_cv_objext -ac_objext=$ac_cv_objext - +elif test "$cross_compiling" = yes; then + cf_cv_tty_group=unknown +else + cf_cv_tty_group=yes +fi -PROG_EXT="$EXEEXT" +fi -test -n "$PROG_EXT" && cat >> confdefs.h <&6 +test $cf_cv_tty_group = yes && cat >> confdefs.h <<\EOF +#define USE_TTY_GROUP 1 EOF ### checks for system services and user specified options echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:3070: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:3341: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #ifndef WEXITSTATUS #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main() { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:3091: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_sys_wait_h=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 if test $ac_cv_header_sys_wait_h = yes; then cat >> confdefs.h <<\EOF #define HAVE_SYS_WAIT_H 1 EOF fi echo $ac_n "checking for POSIX wait functions""... $ac_c" 1>&6 -echo "configure:3114: checking for POSIX wait functions" >&5 +echo "configure:3385: checking for POSIX wait functions" >&5 if eval "test \"`echo '$''{'cf_cv_posix_wait'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #ifdef HAVE_SYS_WAIT_H #include #endif int main() { int stat_loc; pid_t pid = waitpid(-1, &stat_loc, WNOHANG|WUNTRACED); pid_t pid2 = wait(&stat_loc); ; return 0; } EOF -if { (eval echo configure:3138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_posix_wait=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cf_cv_posix_wait=no fi rm -f conftest* fi echo "$ac_t""$cf_cv_posix_wait" 1>&6 test "$cf_cv_posix_wait" = yes && cat >> confdefs.h <<\EOF #define USE_POSIX_WAIT 1 EOF echo $ac_n "checking if external sys_nerr is declared""... $ac_c" 1>&6 -echo "configure:3160: checking if external sys_nerr is declared" >&5 +echo "configure:3431: checking if external sys_nerr is declared" >&5 if eval "test \"`echo '$''{'cf_cv_dcl_sys_nerr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #endif #include #include #include int main() { long x = (long) sys_nerr ; return 0; } EOF -if { (eval echo configure:3179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_dcl_sys_nerr=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cf_cv_dcl_sys_nerr=no fi rm -f conftest* fi echo "$ac_t""$cf_cv_dcl_sys_nerr" 1>&6 if test "$cf_cv_dcl_sys_nerr" = no ; then cf_result=`echo "decl_sys_nerr" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >> confdefs.h <&6 -echo "configure:3207: checking if external sys_nerr exists" >&5 +echo "configure:3478: checking if external sys_nerr exists" >&5 if eval "test \"`echo '$''{'cf_cv_have_sys_nerr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_have_sys_nerr=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cf_cv_have_sys_nerr=no fi rm -f conftest* fi echo "$ac_t""$cf_cv_have_sys_nerr" 1>&6 if test "$cf_cv_have_sys_nerr" = yes ; then cf_result=`echo "have_sys_nerr" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >> confdefs.h <&6 -echo "configure:3252: checking if external sys_errlist is declared" >&5 +echo "configure:3523: checking if external sys_errlist is declared" >&5 if eval "test \"`echo '$''{'cf_cv_dcl_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #endif #include #include #include int main() { long x = (long) sys_errlist ; return 0; } EOF -if { (eval echo configure:3271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_dcl_sys_errlist=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cf_cv_dcl_sys_errlist=no fi rm -f conftest* fi echo "$ac_t""$cf_cv_dcl_sys_errlist" 1>&6 if test "$cf_cv_dcl_sys_errlist" = no ; then cf_result=`echo "decl_sys_errlist" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >> confdefs.h <&6 -echo "configure:3299: checking if external sys_errlist exists" >&5 +echo "configure:3570: checking if external sys_errlist exists" >&5 if eval "test \"`echo '$''{'cf_cv_have_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_have_sys_errlist=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cf_cv_have_sys_errlist=no fi rm -f conftest* fi echo "$ac_t""$cf_cv_have_sys_errlist" 1>&6 if test "$cf_cv_have_sys_errlist" = yes ; then cf_result=`echo "have_sys_errlist" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >> confdefs.h <&6 -echo "configure:3345: checking if we should define SYSV" >&5 +echo "configure:3616: checking if we should define SYSV" >&5 if eval "test \"`echo '$''{'cf_cv_sysv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* look for wchar_t */ #endif #include /* Intrinsic.h has other traps... */ #include #include /* eliminate most BSD hacks */ #include /* declare sys_errlist on older systems */ #include /* eliminate most of the remaining ones */ int main() { static struct termio d_tio; d_tio.c_cc[VINTR] = 0; d_tio.c_cc[VQUIT] = 0; d_tio.c_cc[VERASE] = 0; d_tio.c_cc[VKILL] = 0; d_tio.c_cc[VEOF] = 0; d_tio.c_cc[VEOL] = 0; d_tio.c_cc[VMIN] = 0; d_tio.c_cc[VTIME] = 0; #if defined(HAVE_SYS_ERRLIST) && !defined(DECL_SYS_ERRLIST) sys_errlist[0] = ""; /* Cygwin mis-declares this */ #endif ; return 0; } EOF -if { (eval echo configure:3383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_sysv=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cf_cv_sysv=no fi rm -f conftest* fi echo "$ac_t""$cf_cv_sysv" 1>&6 test "$cf_cv_sysv" = yes && cat >> confdefs.h <<\EOF #define SYSV 1 EOF echo $ac_n "checking for elf_begin in -lelf""... $ac_c" 1>&6 -echo "configure:3404: checking for elf_begin in -lelf" >&5 +echo "configure:3675: checking for elf_begin in -lelf" >&5 ac_lib_var=`echo elf'_'elf_begin | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lelf $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking if this is an SVR4 system""... $ac_c" 1>&6 -echo "configure:3440: checking if this is an SVR4 system" >&5 +echo "configure:3711: checking if this is an SVR4 system" >&5 if eval "test \"`echo '$''{'cf_cv_svr4'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include int main() { static struct termio d_tio; d_tio.c_cc[VINTR] = 0; d_tio.c_cc[VQUIT] = 0; d_tio.c_cc[VERASE] = 0; d_tio.c_cc[VKILL] = 0; d_tio.c_cc[VEOF] = 0; d_tio.c_cc[VEOL] = 0; d_tio.c_cc[VMIN] = 0; d_tio.c_cc[VTIME] = 0; d_tio.c_cc[VLNEXT] = 0; ; return 0; } EOF -if { (eval echo configure:3467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_svr4=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cf_cv_svr4=no fi rm -f conftest* fi echo "$ac_t""$cf_cv_svr4" 1>&6 else echo "$ac_t""no" 1>&6 fi test "$cf_cv_svr4" = yes && cat >> confdefs.h <<\EOF #define SVR4 1 EOF - -echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6 -echo "configure:3493: checking if we must define _GNU_SOURCE" >&5 -if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -cat > conftest.$ac_ext < -int main() { - -#ifndef _XOPEN_SOURCE -make an error -#endif -; return 0; } -EOF -if { (eval echo configure:3509: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - cf_cv_gnu_source=no -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" - cat > conftest.$ac_ext < -int main() { - -#ifdef _XOPEN_SOURCE -make an error -#endif -; return 0; } -EOF -if { (eval echo configure:3529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - cf_cv_gnu_source=no -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cf_cv_gnu_source=yes -fi -rm -f conftest* - CPPFLAGS="$cf_save" - -fi -rm -f conftest* - -fi - -echo "$ac_t""$cf_cv_gnu_source" 1>&6 -test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" - # If we find X, set shell vars x_includes and x_libraries to the # paths, otherwise set no_x=yes. # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:3554: checking for X" >&5 +echo "configure:3767: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then withval="$with_x" : fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then # Both variables are already set. have_x=yes else if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3596,46 +3809,46 @@ # using them would break gcc on systems where it needs fixed includes. case "$ac_im_incroot" in /usr/include) ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; esac case "$ac_im_usrlibdir" in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;; esac fi cd .. rm -fr conftestdir fi if test "$ac_x_includes" = NO; then # Guess where to find include files, by looking for this one X11 .h file. test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3835: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* # We can compile using X headers with no special include directory. ac_x_includes= else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* # Look for the header file in a standard set of common directories. # Check X11 before X11Rn because it is often a symlink to the current release. for ac_dir in \ /usr/X11/include \ /usr/X11R6/include \ /usr/X11R5/include \ /usr/X11R4/include \ \ /usr/include/X11 \ /usr/include/X11R6 \ @@ -3670,48 +3883,48 @@ if test -r "$ac_dir/$x_direct_test_include"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest* fi # $ac_x_includes = NO if test "$ac_x_libraries" = NO; then # Check for the libraries. test -z "$x_direct_test_library" && x_direct_test_library=Xt test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. ac_x_libraries= else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* LIBS="$ac_save_LIBS" # First see if replacing the include by lib works. # Check X11 before X11Rn because it is often a symlink to the current release. for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ /usr/X11/lib \ /usr/X11R6/lib \ /usr/X11R5/lib \ /usr/X11R4/lib \ \ /usr/lib/X11 \ /usr/lib/X11R6 \ /usr/lib/X11R5 \ @@ -3783,597 +3996,597 @@ if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. cat >> confdefs.h <<\EOF #define X_DISPLAY_MISSING 1 EOF X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:3804: checking whether -R must be followed by a space" >&5 +echo "configure:4017: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_R_nospace=no fi rm -f conftest* if test $ac_R_nospace = yes; then echo "$ac_t""no" 1>&6 X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_R_space=no fi rm -f conftest* if test $ac_R_space = yes; then echo "$ac_t""yes" 1>&6 X_LIBS="$X_LIBS -R $x_libraries" else echo "$ac_t""neither works" 1>&6 fi fi LIBS="$ac_xsave_LIBS" esac fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:3869: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:4082: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" else echo "$ac_t""no" 1>&6 fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:3910: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:4123: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" else echo "$ac_t""no" 1>&6 fi fi # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:3958: checking for gethostbyname" >&5 +echo "configure:4171: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) choke me #else gethostbyname(); #endif ; return 0; } EOF -if { (eval echo configure:3986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_gethostbyname=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 fi if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:4007: checking for gethostbyname in -lnsl" >&5 +echo "configure:4220: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" else echo "$ac_t""no" 1>&6 fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says simon@lia.di.epfl.ch: it contains # gethostby* variants that don't use the nameserver (or something). # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:4056: checking for connect" >&5 +echo "configure:4269: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_connect) || defined (__stub___connect) choke me #else connect(); #endif ; return 0; } EOF -if { (eval echo configure:4084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_connect=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 fi if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:4105: checking for connect in -lsocket" >&5 +echo "configure:4318: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" else echo "$ac_t""no" 1>&6 fi fi # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:4148: checking for remove" >&5 +echo "configure:4361: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char remove(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_remove) || defined (__stub___remove) choke me #else remove(); #endif ; return 0; } EOF -if { (eval echo configure:4176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_remove=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 fi if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:4197: checking for remove in -lposix" >&5 +echo "configure:4410: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" else echo "$ac_t""no" 1>&6 fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:4240: checking for shmat" >&5 +echo "configure:4453: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shmat(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shmat) || defined (__stub___shmat) choke me #else shmat(); #endif ; return 0; } EOF -if { (eval echo configure:4268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_shmat=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 fi if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:4289: checking for shmat in -lipc" >&5 +echo "configure:4502: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" else echo "$ac_t""no" 1>&6 fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS="$LDFLAGS" test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:4341: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:4554: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" else echo "$ac_t""no" 1>&6 fi LDFLAGS="$ac_save_LDFLAGS" @@ -4454,223 +4667,223 @@ CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6 CPPFLAGS="$cf_new_cppflags $CPPFLAGS" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6 EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi if test "$cf_check_cflags" != "$CFLAGS" ; then cat > conftest.$ac_ext < int main() { printf("Hello world"); ; return 0; } EOF -if { (eval echo configure:4482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* test -n "$verbose" && echo " test-compile failed. Undoing change to \$CFLAGS" 1>&6 if test "$cf_check_cppflags" != "$CPPFLAGS" ; then test -n "$verbose" && echo " but keeping change to \$CPPFLAGS" 1>&6 fi CFLAGS="$cf_check_flags" fi rm -f conftest* fi echo $ac_n "checking for XOpenDisplay""... $ac_c" 1>&6 -echo "configure:4501: checking for XOpenDisplay" >&5 +echo "configure:4714: checking for XOpenDisplay" >&5 if eval "test \"`echo '$''{'ac_cv_func_XOpenDisplay'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char XOpenDisplay(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay) choke me #else XOpenDisplay(); #endif ; return 0; } EOF -if { (eval echo configure:4529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_XOpenDisplay=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_XOpenDisplay=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'XOpenDisplay`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:4548: checking for XOpenDisplay in -lX11" >&5 +echo "configure:4761: checking for XOpenDisplay in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 LIBS="-lX11 $LIBS" else echo "$ac_t""no" 1>&6 fi fi echo $ac_n "checking for XtAppInitialize""... $ac_c" 1>&6 -echo "configure:4591: checking for XtAppInitialize" >&5 +echo "configure:4804: checking for XtAppInitialize" >&5 if eval "test \"`echo '$''{'ac_cv_func_XtAppInitialize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char XtAppInitialize(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize) choke me #else XtAppInitialize(); #endif ; return 0; } EOF -if { (eval echo configure:4619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_XtAppInitialize=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_XtAppInitialize=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'XtAppInitialize`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 echo $ac_n "checking for XtAppInitialize in -lXt""... $ac_c" 1>&6 -echo "configure:4638: checking for XtAppInitialize in -lXt" >&5 +echo "configure:4851: checking for XtAppInitialize in -lXt" >&5 ac_lib_var=`echo Xt'_'XtAppInitialize | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF #define HAVE_LIBXT 1 EOF cf_have_X_LIBS=Xt LIBS="-lXt $X_PRE_LIBS $LIBS" @@ -4679,206 +4892,206 @@ fi fi if test $cf_have_X_LIBS = no ; then echo "configure: warning: Unable to successfully link X Toolkit library (-lXt) with test program. You will have to check and add the proper libraries by hand to makefile." 1>&2 fi for ac_hdr in \ X11/DECkeysym.h \ X11/Sunkeysym.h \ X11/Xpoll.h \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4700: checking for $ac_hdr" >&5 +echo "configure:4913: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4710: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done cf_x_athena=${cf_x_athena-Xaw} echo $ac_n "checking if you want to link with Xaw 3d library""... $ac_c" 1>&6 -echo "configure:4741: checking if you want to link with Xaw 3d library" >&5 +echo "configure:4954: checking if you want to link with Xaw 3d library" >&5 withval= # Check whether --with-Xaw3d or --without-Xaw3d was given. if test "${with_Xaw3d+set}" = set; then withval="$with_Xaw3d" : fi if test "$withval" = yes ; then cf_x_athena=Xaw3d echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking if you want to link with neXT Athena library""... $ac_c" 1>&6 -echo "configure:4758: checking if you want to link with neXT Athena library" >&5 +echo "configure:4971: checking if you want to link with neXT Athena library" >&5 withval= # Check whether --with-neXtaw or --without-neXtaw was given. if test "${with_neXtaw+set}" = set; then withval="$with_neXtaw" : fi if test "$withval" = yes ; then cf_x_athena=neXtaw echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking if you want to link with Athena-Plus library""... $ac_c" 1>&6 -echo "configure:4775: checking if you want to link with Athena-Plus library" >&5 +echo "configure:4988: checking if you want to link with Athena-Plus library" >&5 withval= # Check whether --with-XawPlus or --without-XawPlus was given. if test "${with_XawPlus+set}" = set; then withval="$with_XawPlus" : fi if test "$withval" = yes ; then cf_x_athena=XawPlus echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>&6 -echo "configure:4792: checking for XextCreateExtension in -lXext" >&5 +echo "configure:5005: checking for XextCreateExtension in -lXext" >&5 ac_lib_var=`echo Xext'_'XextCreateExtension | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lXext $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 LIBS="-lXext $LIBS" else echo "$ac_t""no" 1>&6 fi cf_x_athena_lib="" cf_x_athena_root=$cf_x_athena cf_x_athena_include="" for cf_path in default \ /usr/contrib/X11R6 \ /usr/contrib/X11R5 \ /usr/lib/X11R5 \ /usr/local do if test -z "$cf_x_athena_include" ; then cf_save="$CPPFLAGS" cf_test=X11/$cf_x_athena_root/SimpleMenu.h if test $cf_path != default ; then CPPFLAGS="-I$cf_path/include $cf_save" echo $ac_n "checking for $cf_test in $cf_path""... $ac_c" 1>&6 -echo "configure:4850: checking for $cf_test in $cf_path" >&5 +echo "configure:5063: checking for $cf_test in $cf_path" >&5 else echo $ac_n "checking for $cf_test""... $ac_c" 1>&6 -echo "configure:4853: checking for $cf_test" >&5 +echo "configure:5066: checking for $cf_test" >&5 fi cat > conftest.$ac_ext < #include <$cf_test> int main() { ; return 0; } EOF -if { (eval echo configure:4865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5078: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_result=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cf_result=no fi rm -f conftest* echo "$ac_t""$cf_result" 1>&6 if test "$cf_result" = yes ; then cf_x_athena_include=$cf_path break else CPPFLAGS="$cf_save" fi fi done if test -z "$cf_x_athena_include" ; then @@ -4891,538 +5104,538 @@ cf_x_athena_root=$cf_x_athena cf_x_athena_lib="" for cf_path in default \ /usr/contrib/X11R6 \ /usr/contrib/X11R5 \ /usr/lib/X11R5 \ /usr/local do for cf_lib in \ "-l$cf_x_athena_root -lXmu" \ "-l$cf_x_athena_root -lXpm -lXmu" \ "-l${cf_x_athena_root}_s -lXmu_s" do if test -z "$cf_x_athena_lib" ; then cf_save="$LIBS" cf_test=XawSimpleMenuAddGlobalActions if test $cf_path != default ; then LIBS="-L$cf_path/lib $cf_lib $LIBS" echo $ac_n "checking for $cf_lib in $cf_path""... $ac_c" 1>&6 -echo "configure:4912: checking for $cf_lib in $cf_path" >&5 +echo "configure:5125: checking for $cf_lib in $cf_path" >&5 else LIBS="$cf_lib $LIBS" echo $ac_n "checking for $cf_test in $cf_lib""... $ac_c" 1>&6 -echo "configure:4916: checking for $cf_test in $cf_lib" >&5 +echo "configure:5129: checking for $cf_test in $cf_lib" >&5 fi cf_SAVE="$LIBS" LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_result=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cf_result=no fi rm -f conftest* echo "$ac_t""$cf_result" 1>&6 if test "$cf_result" = yes ; then cf_x_athena_lib="$cf_lib" LIBS="$cf_SAVE" break else LIBS="$cf_save" fi fi done done if test -z "$cf_x_athena_lib" ; then { echo "configure: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" 1>&2; exit 1; } fi cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >> confdefs.h <&6 -echo "configure:4965: checking for declaration of fd_set" >&5 +echo "configure:5178: checking for declaration of fd_set" >&5 if eval "test \"`echo '$''{'cf_cv_type_fd_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo "trying sys/types alone" 1>&5 cat > conftest.$ac_ext < int main() { fd_set x ; return 0; } EOF -if { (eval echo configure:4979: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5192: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_type_fd_set=sys/types.h else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "trying X11/Xpoll.h" 1>&5 cat > conftest.$ac_ext < #endif int main() { fd_set x ; return 0; } EOF -if { (eval echo configure:4998: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_type_fd_set=X11/Xpoll.h else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "trying sys/select.h" 1>&5 cat > conftest.$ac_ext < #include int main() { fd_set x ; return 0; } EOF -if { (eval echo configure:5016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_type_fd_set=sys/select.h else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cf_cv_type_fd_set=unknown fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* fi echo "$ac_t""$cf_cv_type_fd_set" 1>&6 if test $cf_cv_type_fd_set = sys/select.h ; then cat >> confdefs.h <<\EOF #define USE_SYS_SELECT_H 1 EOF fi echo $ac_n "checking for IRIX 6.5 baud-rate redefinitions""... $ac_c" 1>&6 -echo "configure:5042: checking for IRIX 6.5 baud-rate redefinitions" >&5 +echo "configure:5255: checking for IRIX 6.5 baud-rate redefinitions" >&5 if eval "test \"`echo '$''{'cf_cv_termio_c_ispeed'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include int main() { struct termio foo; foo.c_ispeed = B38400; foo.c_ospeed = B9600; ; return 0; } EOF -if { (eval echo configure:5061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_termio_c_ispeed=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cf_cv_termio_c_ispeed=no fi rm -f conftest* fi echo "$ac_t""$cf_cv_termio_c_ispeed" 1>&6 test "$cf_cv_termio_c_ispeed" = yes && cat >> confdefs.h <<\EOF #define HAVE_TERMIO_C_ISPEED 1 EOF LIBS="$LIBS $X_EXTRA_LIBS" # Check for openpty() in -lutil if the UNIX98-style pty functions are not # available. E.g. for GNU libc 2.0. case $host_os in #(vi netbsd*) # 2004/8/15 - revisit this if/when grantpt is known to work. echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6 -echo "configure:5089: checking for openpty in -lutil" >&5 +echo "configure:5302: checking for openpty in -lutil" >&5 ac_lib_var=`echo util'_'openpty | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lutil $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo util | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi ;; *) for ac_func in grantpt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5140: checking for $ac_func" >&5 +echo "configure:5353: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF -if { (eval echo configure:5168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6 -echo "configure:5190: checking for openpty in -lutil" >&5 +echo "configure:5403: checking for openpty in -lutil" >&5 ac_lib_var=`echo util'_'openpty | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lutil $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_lib=HAVE_LIB`echo util | sed -e 's/^a-zA-Z0-9_/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi fi done ;; esac # Extract the first word of "xterm", so it can be a program name with args. set dummy xterm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5245: checking for $ac_word" >&5 +echo "configure:5458: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XTERM_PATH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$XTERM_PATH" in /*) ac_cv_path_XTERM_PATH="$XTERM_PATH" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_XTERM_PATH="$XTERM_PATH" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_XTERM_PATH="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi XTERM_PATH="$ac_cv_path_XTERM_PATH" if test -n "$XTERM_PATH"; then echo "$ac_t""$XTERM_PATH" 1>&6 else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking for XKB Bell extension""... $ac_c" 1>&6 -echo "configure:5280: checking for XKB Bell extension" >&5 +echo "configure:5493: checking for XKB Bell extension" >&5 if eval "test \"`echo '$''{'cf_cv_xkb_bell_ext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* has the prototype */ #include /* has the XkbBI_xxx definitions */ int main() { int x = XkbBI_Info |XkbBI_MinorError |XkbBI_MajorError |XkbBI_TerminalBell |XkbBI_MarginBell; ; return 0; } EOF -if { (eval echo configure:5302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_xkb_bell_ext=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cf_cv_xkb_bell_ext=no fi rm -f conftest* fi echo "$ac_t""$cf_cv_xkb_bell_ext" 1>&6 test "$cf_cv_xkb_bell_ext" = yes && cat >> confdefs.h <<\EOF #define HAVE_XKB_BELL_EXT 1 EOF for ac_func in Xutf8LookupString do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5325: checking for $ac_func" >&5 +echo "configure:5538: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF -if { (eval echo configure:5353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 EXTRAHDRS="$EXTRAHDRS xutf8.h" EXTRASRCS="$EXTRASRCS xutf8.c" EXTRAOBJS="$EXTRAOBJS xutf8.o" fi done echo $ac_n "checking if we should use imake to help""... $ac_c" 1>&6 -echo "configure:5384: checking if we should use imake to help" >&5 +echo "configure:5597: checking if we should use imake to help" >&5 # Check whether --enable-imake or --disable-imake was given. if test "${enable_imake+set}" = set; then enableval="$enable_imake" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_imake=no else enable_imake=yes fi else enableval=yes enable_imake=yes fi echo "$ac_t""$enable_imake" 1>&6 if test "$enable_imake" = yes ; then for ac_prog in xmkmf imake do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5409: checking for $ac_word" >&5 +echo "configure:5622: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_IMAKE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$IMAKE" in /*) ac_cv_path_IMAKE="$IMAKE" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_IMAKE="$IMAKE" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_IMAKE="$ac_dir/$ac_word" break fi done @@ -5544,40 +5757,50 @@ ;; *) #(vi cf_cpp_opts="$cf_cpp_opts $cf_opt" ;; esac done if test -z "$cf_nostdinc" ; then IMAKE_CFLAGS="$cf_cpp_opts $cf_std_incl" elif test -z "$cf_std_incl" ; then IMAKE_CFLAGS="$cf_cpp_opts $cf_nostdinc" else test -n "$verbose" && echo " suppressed \"$cf_nostdinc\" and \"$cf_std_incl\"" 1>&6 IMAKE_CFLAGS="$cf_cpp_opts" fi fi fi fi fi +# Some imake configurations define PROJECTROOT with an empty value. Remove +# the empty definition. +case $IMAKE_CFLAGS in +*-DPROJECTROOT=/*) + ;; +*) + IMAKE_CFLAGS=`echo "$IMAKE_CFLAGS" |sed -e "s,-DPROJECTROOT=[ ], ,"` + ;; +esac + test -n "$verbose" && echo " IMAKE_CFLAGS $IMAKE_CFLAGS" 1>&6 test -n "$verbose" && echo " IMAKE_LOADFLAGS $IMAKE_LOADFLAGS" 1>&6 cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $IMAKE_CFLAGS do case $cf_fix_cppflags in no) case $cf_add_cflags in #(vi -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi @@ -5728,575 +5951,575 @@ if test -n "$cf_new_cppflags" ; then CPPFLAGS="$cf_new_cppflags $CPPFLAGS" fi if test -n "$cf_new_extra_cppflags" ; then EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi fi echo $ac_n "checking for default terminal-id""... $ac_c" 1>&6 -echo "configure:5749: checking for default terminal-id" >&5 +echo "configure:5972: checking for default terminal-id" >&5 # Check whether --with-terminal-id or --without-terminal-id was given. if test "${with_terminal_id+set}" = set; then withval="$with_terminal_id" default_termid=$withval else default_termid=vt100 fi echo "$ac_t""$default_termid" 1>&6 case $default_termid in vt*) default_termid=`echo $default_termid | sed -e 's/^..//'` ;; esac cat >> confdefs.h <&6 -echo "configure:5770: checking for default terminal-type" >&5 +echo "configure:5993: checking for default terminal-type" >&5 # Check whether --with-terminal-type or --without-terminal-type was given. if test "${with_terminal_type+set}" = set; then withval="$with_terminal_type" default_TERM=$withval else default_TERM=xterm fi echo "$ac_t""$default_TERM" 1>&6 cat >> confdefs.h <&6 -echo "configure:5787: checking for private terminfo-directory" >&5 +echo "configure:6010: checking for private terminfo-directory" >&5 # Check whether --with-own-terminfo or --without-own-terminfo was given. if test "${with_own_terminfo+set}" = set; then withval="$with_own_terminfo" TERMINFO_DIR=$withval else TERMINFO_DIR=${TERMINFO-none} fi echo "$ac_t""$TERMINFO_DIR" 1>&6 if test "$TERMINFO_DIR" = yes ; then echo "configure: warning: no value given" 1>&2 elif test "$TERMINFO_DIR" != none ; then if test -d $TERMINFO_DIR ; then cat >> confdefs.h <&2 fi elif test "$prefix" != NONE ; then TERMINFO_DIR='${prefix}/lib/terminfo' elif test -d /usr/lib/terminfo ; then TERMINFO_DIR=/usr/lib/terminfo else TERMINFO_DIR= fi SET_TERMINFO= if test -n "$TERMINFO_DIR" ; then TERMINFO_DIR='$(DESTDIR)'$TERMINFO_DIR SET_TERMINFO='TERMINFO=$(TERMINFO_DIR)' fi ############################################################################### echo $ac_n "checking if you want active-icons""... $ac_c" 1>&6 -echo "configure:5828: checking if you want active-icons" >&5 +echo "configure:6051: checking if you want active-icons" >&5 # Check whether --enable-active-icon or --disable-active-icon was given. if test "${enable_active_icon+set}" = set; then enableval="$enable_active_icon" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_active_icon=no else enable_active_icon=yes fi else enableval=yes enable_active_icon=yes fi echo "$ac_t""$enable_active_icon" 1>&6 if test "$enable_active_icon" = no ; then cat >> confdefs.h <<\EOF #define NO_ACTIVE_ICON 1 EOF fi echo $ac_n "checking if you want ANSI color""... $ac_c" 1>&6 -echo "configure:5854: checking if you want ANSI color" >&5 +echo "configure:6077: checking if you want ANSI color" >&5 # Check whether --enable-ansi-color or --disable-ansi-color was given. if test "${enable_ansi_color+set}" = set; then enableval="$enable_ansi_color" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_ansi_color=no else enable_ansi_color=yes fi else enableval=yes enable_ansi_color=yes fi echo "$ac_t""$enable_ansi_color" 1>&6 test "$enable_ansi_color" = no && cat >> confdefs.h <<\EOF #define OPT_ISO_COLORS 0 EOF if test "$enable_ansi_color" = yes ; then echo $ac_n "checking if you want 16 colors like aixterm""... $ac_c" 1>&6 -echo "configure:5880: checking if you want 16 colors like aixterm" >&5 +echo "configure:6103: checking if you want 16 colors like aixterm" >&5 # Check whether --enable-16-color or --disable-16-color was given. if test "${enable_16_color+set}" = set; then enableval="$enable_16_color" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_16_color=no else enable_16_color=yes fi else enableval=yes enable_16_color=yes fi echo "$ac_t""$enable_16_color" 1>&6 test "$enable_16_color" = no && cat >> confdefs.h <<\EOF #define OPT_AIX_COLORS 0 EOF echo $ac_n "checking if you want 256 colors""... $ac_c" 1>&6 -echo "configure:5904: checking if you want 256 colors" >&5 +echo "configure:6127: checking if you want 256 colors" >&5 # Check whether --enable-256-color or --disable-256-color was given. if test "${enable_256_color+set}" = set; then enableval="$enable_256_color" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_256_color=yes else enable_256_color=no fi else enableval=no enable_256_color=no fi echo "$ac_t""$enable_256_color" 1>&6 if test "$enable_256_color" = yes ; then CHARPROC_DEPS="$CHARPROC_DEPS 256colres.h" EXTRAHDRS="$EXTRAHDRS 256colres.h" cat >> confdefs.h <<\EOF #define OPT_256_COLORS 1 EOF else echo $ac_n "checking if you want 88 colors""... $ac_c" 1>&6 -echo "configure:5931: checking if you want 88 colors" >&5 +echo "configure:6154: checking if you want 88 colors" >&5 # Check whether --enable-88-color or --disable-88-color was given. if test "${enable_88_color+set}" = set; then enableval="$enable_88_color" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_88_color=yes else enable_88_color=no fi else enableval=no enable_88_color=no fi echo "$ac_t""$enable_88_color" 1>&6 if test "$enable_88_color" = yes ; then CHARPROC_DEPS="$CHARPROC_DEPS 88colres.h" EXTRAHDRS="$EXTRAHDRS 88colres.h" cat >> confdefs.h <<\EOF #define OPT_88_COLORS 1 EOF fi fi fi echo $ac_n "checking if you want blinking cursor""... $ac_c" 1>&6 -echo "configure:5962: checking if you want blinking cursor" >&5 +echo "configure:6185: checking if you want blinking cursor" >&5 # Check whether --enable-blink-cursor or --disable-blink-cursor was given. if test "${enable_blink_cursor+set}" = set; then enableval="$enable_blink_cursor" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_blink_curs=no else enable_blink_curs=yes fi else enableval=yes enable_blink_curs=yes fi echo "$ac_t""$enable_blink_curs" 1>&6 test "$enable_blink_curs" = no && cat >> confdefs.h <<\EOF #define OPT_BLINK_CURS 0 EOF echo $ac_n "checking if you want to ignore Linux's broken palette-strings""... $ac_c" 1>&6 -echo "configure:5986: checking if you want to ignore Linux's broken palette-strings" >&5 +echo "configure:6209: checking if you want to ignore Linux's broken palette-strings" >&5 case $host_os in #(vi linux*) assume_broken_osc=yes ;; #(vi *) assume_broken_osc=no ;; esac # Check whether --enable-broken-osc or --disable-broken-osc was given. if test "${enable_broken_osc+set}" = set; then enableval="$enable_broken_osc" test "$enableval" != no && enableval=yes if test "$enableval" != "$assume_broken_osc" ; then enable_broken_osc=$enableval else enable_broken_osc=$enableval fi else enableval=$assume_broken_osc enable_broken_osc=$enableval fi echo "$ac_t""$enable_broken_osc" 1>&6 if test "$enable_broken_osc" = yes ; then cat >> confdefs.h <<\EOF #define OPT_BROKEN_OSC 1 EOF else cat >> confdefs.h <<\EOF #define OPT_BROKEN_OSC 0 EOF fi echo $ac_n "checking if you want to allow broken string-terminators""... $ac_c" 1>&6 -echo "configure:6025: checking if you want to allow broken string-terminators" >&5 +echo "configure:6248: checking if you want to allow broken string-terminators" >&5 # Check whether --enable-broken-st or --disable-broken-st was given. if test "${enable_broken_st+set}" = set; then enableval="$enable_broken_st" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_broken_st=yes else enable_broken_st=no fi else enableval=no enable_broken_st=no fi echo "$ac_t""$enable_broken_st" 1>&6 test "$enable_broken_st" = no && cat >> confdefs.h <<\EOF #define OPT_BROKEN_ST 0 EOF echo $ac_n "checking if you want printable 128-159""... $ac_c" 1>&6 -echo "configure:6049: checking if you want printable 128-159" >&5 +echo "configure:6272: checking if you want printable 128-159" >&5 # Check whether --enable-c1-print or --disable-c1-print was given. if test "${enable_c1_print+set}" = set; then enableval="$enable_c1_print" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_c1_print=no else enable_c1_print=yes fi else enableval=yes enable_c1_print=yes fi echo "$ac_t""$enable_c1_print" 1>&6 test "$enable_c1_print" = no && cat >> confdefs.h <<\EOF #define OPT_C1_PRINT 0 EOF if test "$enable_ansi_color" = yes ; then echo $ac_n "checking if you want bold colors mapped like IBM PC""... $ac_c" 1>&6 -echo "configure:6075: checking if you want bold colors mapped like IBM PC" >&5 +echo "configure:6298: checking if you want bold colors mapped like IBM PC" >&5 # Check whether --enable-bold-color or --disable-bold-color was given. if test "${enable_bold_color+set}" = set; then enableval="$enable_bold_color" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_pc_color=no else enable_pc_color=yes fi else enableval=yes enable_pc_color=yes fi echo "$ac_t""$enable_pc_color" 1>&6 test "$enable_pc_color" = no && cat >> confdefs.h <<\EOF #define OPT_PC_COLORS 0 EOF echo $ac_n "checking if you want separate color-classes""... $ac_c" 1>&6 -echo "configure:6099: checking if you want separate color-classes" >&5 +echo "configure:6322: checking if you want separate color-classes" >&5 # Check whether --enable-color-class or --disable-color-class was given. if test "${enable_color_class+set}" = set; then enableval="$enable_color_class" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_color_class=no else enable_color_class=yes fi else enableval=yes enable_color_class=yes fi echo "$ac_t""$enable_color_class" 1>&6 test "$enable_color_class" = no && cat >> confdefs.h <<\EOF #define OPT_COLOR_CLASS FALSE EOF echo $ac_n "checking if you want color-mode enabled by default""... $ac_c" 1>&6 -echo "configure:6123: checking if you want color-mode enabled by default" >&5 +echo "configure:6346: checking if you want color-mode enabled by default" >&5 # Check whether --enable-color-mode or --disable-color-mode was given. if test "${enable_color_mode+set}" = set; then enableval="$enable_color_mode" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then default_colormode=no else default_colormode=yes fi else enableval=yes default_colormode=yes fi echo "$ac_t""$default_colormode" 1>&6 test "$default_colormode" = no && cat >> confdefs.h <<\EOF #define DFT_COLORMODE FALSE EOF fi echo $ac_n "checking if you want support for color highlighting""... $ac_c" 1>&6 -echo "configure:6149: checking if you want support for color highlighting" >&5 +echo "configure:6372: checking if you want support for color highlighting" >&5 # Check whether --enable-highlighting or --disable-highlighting was given. if test "${enable_highlighting+set}" = set; then enableval="$enable_highlighting" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then default_highlight=no else default_highlight=yes fi else enableval=yes default_highlight=yes fi echo "$ac_t""$default_highlight" 1>&6 test "$default_highlight" = no && cat >> confdefs.h <<\EOF #define OPT_HIGHLIGHT_COLOR 0 EOF echo $ac_n "checking if you want support for doublesize characters""... $ac_c" 1>&6 -echo "configure:6173: checking if you want support for doublesize characters" >&5 +echo "configure:6396: checking if you want support for doublesize characters" >&5 # Check whether --enable-doublechars or --disable-doublechars was given. if test "${enable_doublechars+set}" = set; then enableval="$enable_doublechars" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_doublechars=no else enable_doublechars=yes fi else enableval=yes enable_doublechars=yes fi echo "$ac_t""$enable_doublechars" 1>&6 test "$enable_doublechars" = no && cat >> confdefs.h <<\EOF #define OPT_DEC_CHRSET 0 EOF echo $ac_n "checking if you want fallback-support for box characters""... $ac_c" 1>&6 -echo "configure:6197: checking if you want fallback-support for box characters" >&5 +echo "configure:6420: checking if you want fallback-support for box characters" >&5 # Check whether --enable-boxchars or --disable-boxchars was given. if test "${enable_boxchars+set}" = set; then enableval="$enable_boxchars" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_boxchars=no else enable_boxchars=yes fi else enableval=yes enable_boxchars=yes fi echo "$ac_t""$enable_boxchars" 1>&6 test "$enable_boxchars" = no && cat >> confdefs.h <<\EOF #define OPT_BOX_CHARS 0 EOF echo $ac_n "checking if you want to use FreeType library""... $ac_c" 1>&6 -echo "configure:6221: checking if you want to use FreeType library" >&5 +echo "configure:6444: checking if you want to use FreeType library" >&5 # Check whether --enable-freetype or --disable-freetype was given. if test "${enable_freetype+set}" = set; then enableval="$enable_freetype" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_freetype=no else enable_freetype=yes fi else enableval=yes enable_freetype=yes fi echo "$ac_t""$enable_freetype" 1>&6 if test "$enable_freetype" = yes ; then cf_extra_freetype_libs= # Extract the first word of "xft-config", so it can be a program name with args. set dummy xft-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6245: checking for $ac_word" >&5 +echo "configure:6468: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_FREETYPE_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$FREETYPE_CONFIG" in /*) ac_cv_path_FREETYPE_CONFIG="$FREETYPE_CONFIG" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_FREETYPE_CONFIG="$FREETYPE_CONFIG" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_FREETYPE_CONFIG="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_FREETYPE_CONFIG" && ac_cv_path_FREETYPE_CONFIG="none" ;; esac fi FREETYPE_CONFIG="$ac_cv_path_FREETYPE_CONFIG" if test -n "$FREETYPE_CONFIG"; then echo "$ac_t""$FREETYPE_CONFIG" 1>&6 else echo "$ac_t""no" 1>&6 fi if test "$FREETYPE_CONFIG" = none; then cf_extra_freetype_libs="-lXft" # Extract the first word of "freetype-config", so it can be a program name with args. set dummy freetype-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6283: checking for $ac_word" >&5 +echo "configure:6506: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_FREETYPE_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$FREETYPE_CONFIG" in /*) ac_cv_path_FREETYPE_CONFIG="$FREETYPE_CONFIG" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_FREETYPE_CONFIG="$FREETYPE_CONFIG" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_FREETYPE_CONFIG="$ac_dir/$ac_word" break fi done @@ -6310,92 +6533,92 @@ echo "$ac_t""$FREETYPE_CONFIG" 1>&6 else echo "$ac_t""no" 1>&6 fi fi if test "$FREETYPE_CONFIG" != none ; then # Check whether --with-freetype-cflags or --without-freetype-cflags was given. if test "${with_freetype_cflags+set}" = set; then withval="$with_freetype_cflags" cf_cv_x_freetype_incs="$withval" test -n "$verbose" && echo " freetype-cflags $cf_cv_x_freetype_incs" 1>&6 else echo $ac_n "checking for X FreeType headers""... $ac_c" 1>&6 -echo "configure:6331: checking for X FreeType headers" >&5 +echo "configure:6554: checking for X FreeType headers" >&5 if eval "test \"`echo '$''{'cf_cv_x_freetype_incs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cf_cv_x_freetype_incs="`$FREETYPE_CONFIG --cflags 2>/dev/null`" fi echo "$ac_t""$cf_cv_x_freetype_incs" 1>&6 fi # Check whether --with-freetype-libs or --without-freetype-libs was given. if test "${with_freetype_libs+set}" = set; then withval="$with_freetype_libs" cf_cv_x_freetype_libs="$withval" test -n "$verbose" && echo " freetype-libs $cf_cv_x_freetype_libs" 1>&6 else echo $ac_n "checking for X FreeType libraries""... $ac_c" 1>&6 -echo "configure:6355: checking for X FreeType libraries" >&5 +echo "configure:6578: checking for X FreeType libraries" >&5 if eval "test \"`echo '$''{'cf_cv_x_freetype_libs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cf_save_LIBS="$LIBS" cf_save_INCS="$CPPFLAGS" cf_cv_x_freetype_libs="$cf_extra_freetype_libs `$FREETYPE_CONFIG --libs 2>/dev/null`" LIBS="$cf_cv_x_freetype_libs $LIBS" CPPFLAGS="$cf_cv_x_freetype_incs $CPPFLAGS" cat > conftest.$ac_ext < #include #include int main() { XftPattern *pat = XftNameParse ("name"); ; return 0; } EOF -if { (eval echo configure:6382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cf_cv_x_freetype_libs= fi rm -f conftest* LIBS="$cf_save_LIBS" CPPFLAGS="$cf_save_INCS" fi echo "$ac_t""$cf_cv_x_freetype_libs" 1>&6 fi if test -n "$cf_cv_x_freetype_libs" ; then LIBS="$cf_cv_x_freetype_libs $LIBS" @@ -6474,719 +6697,745 @@ #define XRENDERFONT 1 EOF else CPPFLAGS=`echo "$CPPFLAGS" | sed -e s/-DXRENDERFONT//` fi else CPPFLAGS=`echo "$CPPFLAGS" | sed -e s/-DXRENDERFONT//` fi # FIXME: revisit this if needed else CPPFLAGS=`echo "$CPPFLAGS" | sed -e s/-DXRENDERFONT//` fi echo $ac_n "checking if you want support for HP-style function keys""... $ac_c" 1>&6 -echo "configure:6495: checking if you want support for HP-style function keys" >&5 +echo "configure:6718: checking if you want support for HP-style function keys" >&5 # Check whether --enable-hp-fkeys or --disable-hp-fkeys was given. if test "${enable_hp_fkeys+set}" = set; then enableval="$enable_hp_fkeys" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_hp_fkeys=yes else enable_hp_fkeys=no fi else enableval=no enable_hp_fkeys=no fi echo "$ac_t""$enable_hp_fkeys" 1>&6 if test "$enable_hp_fkeys" = yes ; then cat >> confdefs.h <<\EOF #define OPT_HP_FUNC_KEYS 1 EOF fi echo $ac_n "checking if you want support for SCO-style function keys""... $ac_c" 1>&6 -echo "configure:6521: checking if you want support for SCO-style function keys" >&5 +echo "configure:6744: checking if you want support for SCO-style function keys" >&5 # Check whether --enable-sco-fkeys or --disable-sco-fkeys was given. if test "${enable_sco_fkeys+set}" = set; then enableval="$enable_sco_fkeys" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_sco_fkeys=yes else enable_sco_fkeys=no fi else enableval=no enable_sco_fkeys=no fi echo "$ac_t""$enable_sco_fkeys" 1>&6 if test "$enable_sco_fkeys" = yes ; then cat >> confdefs.h <<\EOF #define OPT_SCO_FUNC_KEYS 1 EOF fi echo $ac_n "checking if you want support for internationalization""... $ac_c" 1>&6 -echo "configure:6547: checking if you want support for internationalization" >&5 +echo "configure:6770: checking if you want support for internationalization" >&5 # Check whether --enable-i18n or --disable-i18n was given. if test "${enable_i18n+set}" = set; then enableval="$enable_i18n" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_i18n=no else enable_i18n=yes fi else enableval=yes enable_i18n=yes fi echo "$ac_t""$enable_i18n" 1>&6 if test "$enable_i18n" = no ; then cat >> confdefs.h <<\EOF #define OPT_I18N_SUPPORT 0 EOF fi echo $ac_n "checking if you want support for initial-erase setup""... $ac_c" 1>&6 -echo "configure:6573: checking if you want support for initial-erase setup" >&5 +echo "configure:6796: checking if you want support for initial-erase setup" >&5 # Check whether --enable-initial-erase or --disable-initial-erase was given. if test "${enable_initial_erase+set}" = set; then enableval="$enable_initial_erase" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_ie=no else enable_ie=yes fi else enableval=yes enable_ie=yes fi echo "$ac_t""$enable_ie" 1>&6 if test "$enable_ie" = no ; then cat >> confdefs.h <<\EOF #define OPT_INITIAL_ERASE 0 EOF fi echo $ac_n "checking if you want support for input-method""... $ac_c" 1>&6 -echo "configure:6599: checking if you want support for input-method" >&5 +echo "configure:6822: checking if you want support for input-method" >&5 # Check whether --enable-input-method or --disable-input-method was given. if test "${enable_input_method+set}" = set; then enableval="$enable_input_method" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_ximp=no else enable_ximp=yes fi else enableval=yes enable_ximp=yes fi echo "$ac_t""$enable_ximp" 1>&6 echo $ac_n "checking if X libraries support input-method""... $ac_c" 1>&6 -echo "configure:6619: checking if X libraries support input-method" >&5 +echo "configure:6842: checking if X libraries support input-method" >&5 if eval "test \"`echo '$''{'cf_cv_input_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include #include #include int main() { { XIM xim; XIMStyles *xim_styles = 0; XIMStyle input_style; Widget w = 0; XSetLocaleModifiers("@im=none"); xim = XOpenIM(XtDisplay(w), NULL, NULL, NULL); XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL); XCloseIM(xim); input_style = (XIMPreeditNothing | XIMStatusNothing); } ; return 0; } EOF -if { (eval echo configure:6652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cf_cv_input_method=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* cf_cv_input_method=no fi rm -f conftest* fi echo "$ac_t""$cf_cv_input_method" 1>&6 test "$cf_cv_input_method" = no && enable_ximp=no if test "$enable_ximp" = no ; then cat >> confdefs.h <<\EOF #define OPT_INPUT_METHOD 0 EOF fi echo $ac_n "checking if you want support for load-vt-fonts""... $ac_c" 1>&6 -echo "configure:6675: checking if you want support for load-vt-fonts" >&5 +echo "configure:6898: checking if you want support for load-vt-fonts" >&5 # Check whether --enable-load-vt-fonts or --disable-load-vt-fonts was given. if test "${enable_load_vt_fonts+set}" = set; then enableval="$enable_load_vt_fonts" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_load_vt_fonts=yes else enable_load_vt_fonts=no fi else enableval=no enable_load_vt_fonts=no fi echo "$ac_t""$enable_load_vt_fonts" 1>&6 if test "$enable_load_vt_fonts" = yes ; then cat >> confdefs.h <<\EOF #define OPT_LOAD_VTFONTS 1 EOF fi echo $ac_n "checking if you want support for logging""... $ac_c" 1>&6 -echo "configure:6701: checking if you want support for logging" >&5 +echo "configure:6924: checking if you want support for logging" >&5 # Check whether --enable-logging or --disable-logging was given. if test "${enable_logging+set}" = set; then enableval="$enable_logging" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_logging=yes else enable_logging=no fi else enableval=no enable_logging=no fi echo "$ac_t""$enable_logging" 1>&6 if test "$enable_logging" = yes ; then cat >> confdefs.h <<\EOF #define ALLOWLOGGING 1 EOF echo $ac_n "checking if you want to allow logging via a pipe""... $ac_c" 1>&6 -echo "configure:6725: checking if you want to allow logging via a pipe" >&5 +echo "configure:6948: checking if you want to allow logging via a pipe" >&5 # Check whether --enable-logfile-exec or --disable-logfile-exec was given. if test "${enable_logfile_exec+set}" = set; then enableval="$enable_logfile_exec" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_log_exec=yes else enable_log_exec=no fi else enableval=no enable_log_exec=no fi echo "$ac_t""$enable_log_exec" 1>&6 if test "$enable_log_exec" = yes ; then cat >> confdefs.h <<\EOF #define ALLOWLOGFILEEXEC 1 EOF fi fi echo $ac_n "checking if you want support for iconify/maximize translations""... $ac_c" 1>&6 -echo "configure:6752: checking if you want support for iconify/maximize translations" >&5 +echo "configure:6975: checking if you want support for iconify/maximize translations" >&5 # Check whether --enable-maximize or --disable-maximize was given. if test "${enable_maximize+set}" = set; then enableval="$enable_maximize" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_maximize=no else enable_maximize=yes fi else enableval=yes enable_maximize=yes fi echo "$ac_t""$enable_maximize" 1>&6 test "$enable_maximize" = no && cat >> confdefs.h <<\EOF #define OPT_MAXIMIZE 0 EOF echo $ac_n "checking if you want NumLock to override keyboard tables""... $ac_c" 1>&6 -echo "configure:6776: checking if you want NumLock to override keyboard tables" >&5 +echo "configure:6999: checking if you want NumLock to override keyboard tables" >&5 # Check whether --enable-num-lock or --disable-num-lock was given. if test "${enable_num_lock+set}" = set; then enableval="$enable_num_lock" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_numlock=no else enable_numlock=yes fi else enableval=yes enable_numlock=yes fi echo "$ac_t""$enable_numlock" 1>&6 test "$enable_numlock" = no && cat >> confdefs.h <<\EOF #define OPT_NUM_LOCK 0 EOF echo $ac_n "checking if you want support for pty-handshaking""... $ac_c" 1>&6 -echo "configure:6800: checking if you want support for pty-handshaking" >&5 +echo "configure:7023: checking if you want support for pty-handshaking" >&5 # Check whether --enable-pty-handshake or --disable-pty-handshake was given. if test "${enable_pty_handshake+set}" = set; then enableval="$enable_pty_handshake" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_pty_handshake=no else enable_pty_handshake=yes fi else enableval=yes enable_pty_handshake=yes fi echo "$ac_t""$enable_pty_handshake" 1>&6 if test "$enable_pty_handshake" = yes ; then cat >> confdefs.h <<\EOF #define OPT_PTY_HANDSHAKE 1 EOF else cat >> confdefs.h <<\EOF #define OPT_PTY_HANDSHAKE 0 EOF fi echo $ac_n "checking if you want support for right-scrollbar""... $ac_c" 1>&6 -echo "configure:6832: checking if you want support for right-scrollbar" >&5 +echo "configure:7055: checking if you want support for right-scrollbar" >&5 # Check whether --enable-rightbar or --disable-rightbar was given. if test "${enable_rightbar+set}" = set; then enableval="$enable_rightbar" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_rightbar=no else enable_rightbar=yes fi else enableval=yes enable_rightbar=yes fi echo "$ac_t""$enable_rightbar" 1>&6 if test "$enable_rightbar" = yes ; then cat >> confdefs.h <<\EOF #define SCROLLBAR_RIGHT 1 EOF fi echo $ac_n "checking if you want check for redundant name-change""... $ac_c" 1>&6 -echo "configure:6858: checking if you want check for redundant name-change" >&5 +echo "configure:7081: checking if you want check for redundant name-change" >&5 # Check whether --enable-samename or --disable-samename was given. if test "${enable_samename+set}" = set; then enableval="$enable_samename" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_samename=no else enable_samename=yes fi else enableval=yes enable_samename=yes fi echo "$ac_t""$enable_samename" 1>&6 test "$enable_samename" = no && cat >> confdefs.h <<\EOF #define OPT_SAME_NAME 0 EOF echo $ac_n "checking if you want support for session management""... $ac_c" 1>&6 -echo "configure:6882: checking if you want support for session management" >&5 +echo "configure:7105: checking if you want support for session management" >&5 # Check whether --enable-session-mgt or --disable-session-mgt was given. if test "${enable_session_mgt+set}" = set; then enableval="$enable_session_mgt" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_session_mgt=no else enable_session_mgt=yes fi else enableval=yes enable_session_mgt=yes fi echo "$ac_t""$enable_session_mgt" 1>&6 test "$enable_session_mgt" = no && cat >> confdefs.h <<\EOF #define OPT_SESSION_MGT 0 EOF echo $ac_n "checking if you want to use termcap-query/report""... $ac_c" 1>&6 -echo "configure:6906: checking if you want to use termcap-query/report" >&5 +echo "configure:7129: checking if you want to use termcap-query/report" >&5 # Check whether --enable-tcap-query or --disable-tcap-query was given. if test "${enable_tcap_query+set}" = set; then enableval="$enable_tcap_query" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_tcap_query=yes else enable_tcap_query=no fi else enableval=no enable_tcap_query=no fi echo "$ac_t""$enable_tcap_query" 1>&6 test "$enable_tcap_query" = yes && cat >> confdefs.h <<\EOF #define OPT_TCAP_QUERY 1 EOF echo $ac_n "checking if you want support for tek4014""... $ac_c" 1>&6 -echo "configure:6930: checking if you want support for tek4014" >&5 +echo "configure:7153: checking if you want support for tek4014" >&5 # Check whether --enable-tek4014 or --disable-tek4014 was given. if test "${enable_tek4014+set}" = set; then enableval="$enable_tek4014" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_tek4014=no else enable_tek4014=yes fi else enableval=yes enable_tek4014=yes fi echo "$ac_t""$enable_tek4014" 1>&6 if test "$enable_tek4014" = no ; then cat >> confdefs.h <<\EOF #define OPT_TEK4014 0 EOF else EXTRAHDRS="$EXTRAHDRS Tekparse.h" EXTRASRCS="$EXTRASRCS TekPrsTbl.c Tekproc.c" EXTRAOBJS="$EXTRAOBJS TekPrsTbl.o Tekproc.o" fi echo $ac_n "checking if you want pulldown menus with a toolbar""... $ac_c" 1>&6 -echo "configure:6960: checking if you want pulldown menus with a toolbar" >&5 +echo "configure:7183: checking if you want pulldown menus with a toolbar" >&5 # Check whether --enable-toolbar or --disable-toolbar was given. if test "${enable_toolbar+set}" = set; then enableval="$enable_toolbar" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_toolbar=yes else enable_toolbar=no fi else enableval=no enable_toolbar=no fi echo "$ac_t""$enable_toolbar" 1>&6 if test "$enable_toolbar" = yes ; then cat >> confdefs.h <<\EOF #define OPT_TOOLBAR 1 EOF fi echo $ac_n "checking if you want VT52 emulation""... $ac_c" 1>&6 -echo "configure:6986: checking if you want VT52 emulation" >&5 +echo "configure:7209: checking if you want VT52 emulation" >&5 # Check whether --enable-vt52 or --disable-vt52 was given. if test "${enable_vt52+set}" = set; then enableval="$enable_vt52" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_vt52=no else enable_vt52=yes fi else enableval=yes enable_vt52=yes fi echo "$ac_t""$enable_vt52" 1>&6 test "$enable_vt52" = no && cat >> confdefs.h <<\EOF #define OPT_VT52_MODE 0 EOF +echo $ac_n "checking if you want to use mini-luit/Latin9 built-in support""... $ac_c" 1>&6 +echo "configure:7233: checking if you want to use mini-luit/Latin9 built-in support" >&5 + +# Check whether --enable-mini-luit or --disable-mini-luit was given. +if test "${enable_mini_luit+set}" = set; then + enableval="$enable_mini_luit" + test "$enableval" != yes && enableval=no + if test "$enableval" != "no" ; then + enable_mini_luit=yes + else + enable_mini_luit=no + fi +else + enableval=no + enable_mini_luit=no + +fi + +echo "$ac_t""$enable_mini_luit" 1>&6 +if test "$enable_mini_luit" = yes ; then + cat >> confdefs.h <<\EOF +#define OPT_MINI_LUIT 1 +EOF + +fi + echo $ac_n "checking if you want to use luit""... $ac_c" 1>&6 -echo "configure:7010: checking if you want to use luit" >&5 +echo "configure:7259: checking if you want to use luit" >&5 # Check whether --enable-luit or --disable-luit was given. if test "${enable_luit+set}" = set; then enableval="$enable_luit" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_luit=yes else - enable_luit=no + enable_luit=$enable_mini_luit fi else enableval=no - enable_luit=no + enable_luit=$enable_mini_luit fi echo "$ac_t""$enable_luit" 1>&6 if test "$enable_luit" = yes ; then cat >> confdefs.h <<\EOF #define OPT_LUIT_PROG 1 EOF fi echo $ac_n "checking if you want wide-character support""... $ac_c" 1>&6 -echo "configure:7036: checking if you want wide-character support" >&5 +echo "configure:7285: checking if you want wide-character support" >&5 # Check whether --enable-wide-chars or --disable-wide-chars was given. if test "${enable_wide_chars+set}" = set; then enableval="$enable_wide_chars" test "$enableval" != no && enableval=yes if test "$enableval" != "$enable_luit" ; then enable_wchar=yes else enable_wchar=$enable_luit fi else enableval=$enable_luit enable_wchar=$enable_luit fi echo "$ac_t""$enable_wchar" 1>&6 if test "$enable_wchar" = yes ; then cat >> confdefs.h <<\EOF #define OPT_WIDE_CHARS 1 EOF EXTRAHDRS="$EXTRAHDRS charclass.h precompose.h wcwidth.h" EXTRASRCS="$EXTRASRCS charclass.c precompose.c wcwidth.c" EXTRAOBJS="$EXTRAOBJS charclass.o precompose.o wcwidth.o" fi echo $ac_n "checking if you want dynamic-abbreviation support""... $ac_c" 1>&6 -echo "configure:7065: checking if you want dynamic-abbreviation support" >&5 +echo "configure:7314: checking if you want dynamic-abbreviation support" >&5 # Check whether --enable-dec-locator or --disable-dec-locator was given. if test "${enable_dec_locator+set}" = set; then enableval="$enable_dec_locator" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_dabbrev=yes else enable_dabbrev=no fi else enableval=no enable_dabbrev=no fi echo "$ac_t""$enable_dabbrev" 1>&6 if test "$enable_dabbrev" = yes ; then cat >> confdefs.h <<\EOF #define OPT_DABBREV 1 EOF fi echo $ac_n "checking if you want DECterm Locator support""... $ac_c" 1>&6 -echo "configure:7091: checking if you want DECterm Locator support" >&5 +echo "configure:7340: checking if you want DECterm Locator support" >&5 # Check whether --enable-dec-locator or --disable-dec-locator was given. if test "${enable_dec_locator+set}" = set; then enableval="$enable_dec_locator" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_dec_locator=yes else enable_dec_locator=no fi else enableval=no enable_dec_locator=no fi echo "$ac_t""$enable_dec_locator" 1>&6 if test "$enable_dec_locator" = yes ; then cat >> confdefs.h <<\EOF #define OPT_DEC_LOCATOR 1 EOF fi echo $ac_n "checking if you want -ziconbeep option""... $ac_c" 1>&6 -echo "configure:7117: checking if you want -ziconbeep option" >&5 +echo "configure:7366: checking if you want -ziconbeep option" >&5 # Check whether --enable-ziconbeep or --disable-ziconbeep was given. if test "${enable_ziconbeep+set}" = set; then enableval="$enable_ziconbeep" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_ziconbeep=no else enable_ziconbeep=yes fi else enableval=yes enable_ziconbeep=yes fi echo "$ac_t""$enable_ziconbeep" 1>&6 test "$enable_ziconbeep" = no && cat >> confdefs.h <<\EOF #define OPT_ZICONBEEP 0 EOF ############################################################################### echo $ac_n "checking if you want debugging traces""... $ac_c" 1>&6 -echo "configure:7144: checking if you want debugging traces" >&5 +echo "configure:7393: checking if you want debugging traces" >&5 # Check whether --enable-trace or --disable-trace was given. if test "${enable_trace+set}" = set; then enableval="$enable_trace" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_trace=yes else enable_trace=no fi else enableval=no enable_trace=no fi echo "$ac_t""$enable_trace" 1>&6 if test "$enable_trace" = yes ; then cat >> confdefs.h <<\EOF #define OPT_TRACE 1 EOF EXTRASRCS="$EXTRASRCS trace.c" EXTRAOBJS="$EXTRAOBJS trace.o" fi echo $ac_n "checking if you want to see long compiling messages""... $ac_c" 1>&6 -echo "configure:7173: checking if you want to see long compiling messages" >&5 +echo "configure:7422: checking if you want to see long compiling messages" >&5 # Check whether --enable-echo or --disable-echo was given. if test "${enable_echo+set}" = set; then enableval="$enable_echo" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then ECHO_LT='--silent' ECHO_LD='@echo linking $@;' RULE_CC=' @echo compiling $<' SHOW_CC=' @echo compiling $@' ECHO_CC='@' else ECHO_LT='' ECHO_LD='' RULE_CC='# compiling' SHOW_CC='# compiling' ECHO_CC='' @@ -7196,200 +7445,200 @@ enableval=yes ECHO_LT='' ECHO_LD='' RULE_CC='# compiling' SHOW_CC='# compiling' ECHO_CC='' fi echo "$ac_t""$enableval" 1>&6 echo $ac_n "checking if you want magic cookie emulation""... $ac_c" 1>&6 -echo "configure:7217: checking if you want magic cookie emulation" >&5 +echo "configure:7466: checking if you want magic cookie emulation" >&5 # Check whether --enable-xmc-glitch or --disable-xmc-glitch was given. if test "${enable_xmc_glitch+set}" = set; then enableval="$enable_xmc_glitch" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_xmc=yes else enable_xmc=no fi else enableval=no enable_xmc=no fi echo "$ac_t""$enable_xmc" 1>&6 if test "$enable_xmc" = yes ; then cat >> confdefs.h <<\EOF #define OPT_XMC_GLITCH 1 EOF EXTRASRCS="$EXTRASRCS testxmc.c" EXTRAOBJS="$EXTRAOBJS testxmc.o" fi if test -n "$GCC" ; then echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6 -echo "configure:7246: checking if you want to turn on gcc warnings" >&5 +echo "configure:7495: checking if you want to turn on gcc warnings" >&5 # Check whether --enable-warnings or --disable-warnings was given. if test "${enable_warnings+set}" = set; then enableval="$enable_warnings" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then with_warnings=yes else with_warnings=no fi else enableval=no with_warnings=no fi echo "$ac_t""$with_warnings" 1>&6 if test "$with_warnings" = yes then if test "$GCC" = yes then cat > conftest.i <&6 -echo "configure:7286: checking for $CC __attribute__ directives" >&5 +echo "configure:7535: checking for $CC __attribute__ directives" >&5 cat > conftest.$ac_ext <&5 case $cf_attribute in scanf|printf) cat >conftest.h <conftest.h <&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:7575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6 cat conftest.h >>confdefs.h fi done else fgrep define conftest.i >>confdefs.h fi rm -rf conftest* fi GCC_VERSION=none if test "$GCC" = yes ; then echo $ac_n "checking version of $CC""... $ac_c" 1>&6 -echo "configure:7342: checking version of $CC" >&5 +echo "configure:7591: checking version of $CC" >&5 GCC_VERSION="`${CC} --version|sed -e '2,$d' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown echo "$ac_t""$GCC_VERSION" 1>&6 fi if test "$GCC" = yes then cat > conftest.$ac_ext <&6 -echo "configure:7357: checking for $CC warning options" >&5 +echo "configure:7606: checking for $CC warning options" >&5 cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-W -Wall" cf_warn_CONST="" test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" for cf_opt in \ Wbad-function-cast \ Wcast-align \ Wcast-qual \ Winline \ Wmissing-declarations \ Wmissing-prototypes \ Wnested-externs \ Wpointer-arith \ Wshadow \ Wstrict-prototypes \ - Wundef $cf_warn_CONST + Wundef $cf_warn_CONST do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo configure:7376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:7625: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6 case $cf_opt in #(vi Wcast-qual) #(vi CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES" ;; Winline) #(vi case $GCC_VERSION in 3.3*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 continue;; esac ;; esac EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi done rm -f conftest* CFLAGS="$cf_save_CFLAGS" fi @@ -7548,40 +7797,41 @@ s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@host@%$host%g s%@host_alias@%$host_alias%g s%@host_cpu@%$host_cpu%g s%@host_vendor@%$host_vendor%g s%@host_os@%$host_os%g s%@CC@%$CC%g s%@CPP@%$CPP%g s%@AWK@%$AWK%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@LINT@%$LINT%g s%@EXTRA_CPPFLAGS@%$EXTRA_CPPFLAGS%g s%@EXEEXT@%$EXEEXT%g s%@OBJEXT@%$OBJEXT%g s%@PROG_EXT@%$PROG_EXT%g s%@X_CFLAGS@%$X_CFLAGS%g s%@X_PRE_LIBS@%$X_PRE_LIBS%g s%@X_LIBS@%$X_LIBS%g s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g s%@XTERM_PATH@%$XTERM_PATH%g s%@IMAKE@%$IMAKE%g s%@IMAKE_CFLAGS@%$IMAKE_CFLAGS%g s%@IMAKE_LOADFLAGS@%$IMAKE_LOADFLAGS%g s%@TERMINFO_DIR@%$TERMINFO_DIR%g s%@SET_TERMINFO@%$SET_TERMINFO%g s%@FREETYPE_CONFIG@%$FREETYPE_CONFIG%g s%@XRENDERFONT@%$XRENDERFONT%g s%@HAVE_TYPE_FCCHAR32@%$HAVE_TYPE_FCCHAR32%g s%@HAVE_TYPE_XFTCHARSPEC@%$HAVE_TYPE_XFTCHARSPEC%g s%@ECHO_LT@%$ECHO_LT%g s%@ECHO_LD@%$ECHO_LD%g Index: xc/programs/xterm/configure.in =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/configure.in,v retrieving revision 1.4 diff -u -2 -0 -r1.4 configure.in --- xc/programs/xterm/configure.in 20 Aug 2004 18:46:39 -0000 1.4 +++ xc/programs/xterm/configure.in 6 Jan 2005 00:30:41 -0000 @@ -1,23 +1,23 @@ -dnl $XTermId: configure.in,v 1.170 2004/08/15 21:07:59 tom Exp $ +dnl $XTermId: configure.in,v 1.175 2004/12/01 01:27:46 tom Exp $ dnl -dnl $XFree86: xc/programs/xterm/configure.in,v 3.66 2004/08/15 21:07:59 dickey Exp $ +dnl $XFree86: xc/programs/xterm/configure.in,v 3.67 2004/12/01 01:27:46 dickey Exp $ dnl dnl --------------------------------------------------------------------------- dnl dnl Copyright 1997-2003,2004 by Thomas E. Dickey dnl dnl All Rights Reserved dnl dnl Permission to use, copy, modify, and distribute this software and its dnl documentation for any purpose and without fee is hereby granted, dnl provided that the above copyright notice appear in all copies and that dnl both that copyright notice and this permission notice appear in dnl supporting documentation, and that the name of the above listed dnl copyright holder(s) not be used in advertising or publicity pertaining dnl to distribution of the software without specific, written prior dnl permission. dnl dnl THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD dnl TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY dnl AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE dnl LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES @@ -35,45 +35,52 @@ ### checks for alternative programs dnl Only add to this case statement when a system has a compiler that is not dnl detected by AC_PROG_CC. case "$host_os" in openedition) : ${CFLAGS="-O2 -Wc,dll -Wl,EDIT=NO"} : ${CPPFLAGS="-D_ALL_SOURCE"} : ${LIBS="/usr/lib/Xaw.x /usr/lib/SM.x /usr/lib/ICE.x /usr/lib/X11.x"} : ${CC=c89};; darwin*) : ${LDFLAGS}="${LDFLAGS} -Wl,-bind_at_load";; esac AC_PROG_CC AC_PROG_CPP AC_GCC_TRADITIONAL AC_PROG_AWK AC_PROG_INSTALL AC_ARG_PROGRAM +AC_CHECK_PROGS(LINT, tdlint lint alint) ### checks for UNIX variants that set C preprocessor variables AC_AIX AC_ISC_POSIX +### checks for compiler characteristics +CF_ANSI_CC_CHECK +AC_CONST +CF_PROG_EXT +CF_XOPEN_SOURCE + ### checks for header files AC_CHECK_HEADERS( \ ncurses/term.h \ stdlib.h \ termios.h \ unistd.h \ ) AC_HEADER_TIME AM_LANGINFO_CODESET ### checks for typedefs CF_SIZE_T AC_CHECK_TYPE(time_t, long) ### checks for library functions AC_CHECK_FUNCS( \ bcopy \ gethostname \ getlogin \ memmove \ @@ -84,51 +91,45 @@ ) CF_FUNC_MEMMOVE CF_FUNC_TGETENT CF_UTMP AC_MSG_CHECKING(if you want to link with utempter) AC_ARG_WITH(utempter, [ --with-utempter use utempter library for access to utmp], [use_utempter=$withval], [use_utempter=no]) AC_MSG_RESULT($use_utempter) if test "$use_utempter" = yes ; then CF_UTEMPTER fi ### checks for external data CF_ERRNO CF_TTY_GROUP -### checks for compiler characteristics -CF_ANSI_CC_CHECK -AC_CONST -CF_PROG_EXT - ### checks for system services and user specified options CF_POSIX_WAIT CF_SYSV CF_SVR4 -CF_GNU_SOURCE CF_X_TOOLKIT AC_CHECK_HEADERS( \ X11/DECkeysym.h \ X11/Sunkeysym.h \ X11/Xpoll.h \ ) CF_X_ATHENA CF_TYPE_FD_SET CF_TERMIO_C_ISPEED LIBS="$LIBS $X_EXTRA_LIBS" # Check for openpty() in -lutil if the UNIX98-style pty functions are not # available. E.g. for GNU libc 2.0. case $host_os in #(vi netbsd*) # 2004/8/15 - revisit this if/when grantpt is known to work. AC_CHECK_LIB(util,openpty) ;; @@ -522,45 +523,55 @@ fi AC_MSG_CHECKING(if you want pulldown menus with a toolbar) CF_ARG_ENABLE(toolbar, [ --enable-toolbar compile-in toolbar for pulldown menus], [enable_toolbar=yes], [enable_toolbar=no]) AC_MSG_RESULT($enable_toolbar) if test "$enable_toolbar" = yes ; then AC_DEFINE(OPT_TOOLBAR,1) fi AC_MSG_CHECKING(if you want VT52 emulation) CF_ARG_DISABLE(vt52, [ --disable-vt52 disable VT52 emulation], [enable_vt52=no], [enable_vt52=yes]) AC_MSG_RESULT($enable_vt52) test "$enable_vt52" = no && AC_DEFINE(OPT_VT52_MODE,0) +AC_MSG_CHECKING(if you want to use mini-luit/Latin9 built-in support) +CF_ARG_ENABLE(mini-luit, + [ --enable-mini-luit enable mini-luit (built-in Latin9 support)], + [enable_mini_luit=yes], + [enable_mini_luit=no]) +AC_MSG_RESULT($enable_mini_luit) +if test "$enable_mini_luit" = yes ; then + AC_DEFINE(OPT_MINI_LUIT,1) +fi + AC_MSG_CHECKING(if you want to use luit) CF_ARG_ENABLE(luit, [ --enable-luit enable luit filter (Unicode translation)], [enable_luit=yes], - [enable_luit=no]) + [enable_luit=$enable_mini_luit]) AC_MSG_RESULT($enable_luit) if test "$enable_luit" = yes ; then AC_DEFINE(OPT_LUIT_PROG,1) fi AC_MSG_CHECKING(if you want wide-character support) CF_ARG_OPTION(wide-chars, [ --enable-wide-chars enable wide-character support], [enable_wchar=yes], [enable_wchar=$enable_luit], [$enable_luit]) AC_MSG_RESULT($enable_wchar) if test "$enable_wchar" = yes ; then AC_DEFINE(OPT_WIDE_CHARS,1) EXTRAHDRS="$EXTRAHDRS charclass.h precompose.h wcwidth.h" EXTRASRCS="$EXTRASRCS charclass.c precompose.c wcwidth.c" EXTRAOBJS="$EXTRAOBJS charclass.o precompose.o wcwidth.o" fi AC_MSG_CHECKING(if you want dynamic-abbreviation support) Index: xc/programs/xterm/ctlseqs.ms =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/ctlseqs.ms,v retrieving revision 1.1 diff -u -2 -0 -r1.1 ctlseqs.ms --- xc/programs/xterm/ctlseqs.ms 13 Aug 2004 12:57:20 -0000 1.1 +++ xc/programs/xterm/ctlseqs.ms 6 Jan 2005 00:30:42 -0000 @@ -1,30 +1,30 @@ .\"#! troff -ms $1 -*- Nroff -*- .\" "Xterm Control Sequences" document -.\" $XTermId: ctlseqs.ms,v 1.143 2004/07/20 01:16:47 tom Exp $ +.\" $XTermId: ctlseqs.ms,v 1.147 2004/12/01 01:27:44 tom Exp $ .\" .\" .\" $Xorg: ctlseqs.ms,v 1.3 2000/08/17 19:42:51 cpqbld Exp $ .\" .\" .\" -.\" $XFree86: xc/doc/specs/xterm/ctlseqs.ms,v 3.53 2004/07/20 01:16:47 dickey Exp $ +.\" $XFree86: xc/doc/specs/xterm/ctlseqs.ms,v 3.54 2004/12/01 01:27:44 dickey Exp $ .\" .\" .\" Copyright 1996-2003,2004 by Thomas E. Dickey .\" .\" All Rights Reserved .\" .\" Permission is hereby granted, free of charge, to any person obtaining a .\" copy of this software and associated documentation files (the .\" "Software"), to deal in the Software without restriction, including .\" without limitation the rights to use, copy, modify, merge, publish, .\" distribute, sublicense, and/or sell copies of the Software, and to .\" permit persons to whom the Software is furnished to do so, subject to .\" the following conditions: .\" .\" The above copyright notice and this permission notice shall be included .\" in all copies or substantial portions of the Software. .\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -144,41 +144,40 @@ .[] PM \v'-1p'\s\nsPM\s0\v'1p' .[] ST \v'-1p'\s\nsST\s0\v'1p' .[] Ta \v'-1p'\*T\v'1p' .[] Lf \v'-1p'\s\nsLF\s0\v'1p' .[] Vt \v'-1p'\s\nsVT\s0\v'1p' .[] Ff \v'-1p'\s\nsFF\s0\v'1p' .[] Cr \v'-1p'\s\nsCR\s0\v'1p' .[] So \v'-1p'\s\nsSO\s0\v'1p' .[] Sp \v'-1p'\s\nsSP\s0\v'1p' .[] Si \v'-1p'\s\nsSI\s0\v'1p' .[] Eb \v'-1p'\*e\v'1p' .[] Ca \v'-1p'\*C\v'1p' .[] Su \v'-1p'\*S\v'1p' .[] Es \v'-1p'\*E\v'1p' .[] Fs \v'-1p'\s\nsFS\s0\v'1p' .[] Gs \v'-1p'\s\nsGS\s0\v'1p' .[] Rs \v'-1p'\s\nsRS\s0\v'1p' .[] Us \v'-1p'\s\nsUS\s0\v'1p' .[] XX \v'-1p'\s\nsXX\s0\v'1p' .[] $ $ -.[] ! ! .[] # # .[] % % .[] (( ( .[] ) ) .[] * * .[] + + .[] , , .[] - - .[] . . .[] 0 0 .[] 1 1 .[] 2 2 .[] 3 3 .[] 4 4 .[] 5 5 .[] 6 6 .[] 7 7 .[] 8 8 .[] 9 9 .[] : : @@ -348,41 +347,41 @@ .IP \\*(Es\\*([[ Control Sequence Introducer (\*(Cs is 0x9b) .IP \\*(Es\\*(bS String Terminator (\*(ST is 0x9c) .IP \\*(Es\\*(]] Operating System Command (\*(Os is 0x9d) .IP \\*(Es\\*^ Privacy Message (\*(PM is 0x9e) .IP \\*(Es\\*_ Application Program Command (\*(AP is 0x9f) .Ed .sp .LP These control characters are used in the vtXXX emulation. . .SH VT100 Mode .ds RH VT100 Mode .LP Most of these control sequences are standard VT102 control sequences, -but there is support for later DEC VT terminals (i.e., VT220 and VT320), +but there is support for later DEC VT terminals (i.e., VT220, VT320, VT420), as well as ISO 6429 and \fIaixterm\fP color controls. The only VT102 features not supported is auto-repeat, since the only way X provides for this will affect all windows. There are additional control sequences to provide \fIxterm-\fPdependent functions, such as the scrollbar or window size. Where the function is specified by DEC or ISO 6429, the code assigned to it is given in parentheses. The escape codes to designate and invoke character sets are specified by ISO 2022; see that document for a discussion of character sets. . .St .\" .LP .B Single-character functions .\" .IP \\*(Be Bell (Ctrl-G) . .IP \\*(Bs @@ -732,40 +731,41 @@ .IP \\*(Cs\\*(Pm\\*s\\*h Set Mode (SM) \*(Ps = \*2 \(-> Keyboard Action Mode (AM) \*(Ps = \*4 \(-> Insert Mode (IRM) \*(Ps = \*1\*2 \(-> Send/receive (SRM) \*(Ps = \*2\*0 \(-> Automatic Newline (LNM) . .IP \\*(Cs\\*?\\*(Pm\\*s\\*h DEC Private Mode Set (DECSET) \*(Ps = \*1 \(-> Application Cursor Keys (DECCKM) \*(Ps = \*2 \(-> Designate USASCII for character sets G0-G3 (DECANM), and set VT100 mode. \*(Ps = \*3 \(-> 132 Column Mode (DECCOLM) \*(Ps = \*4 \(-> Smooth (Slow) Scroll (DECSCLM) \*(Ps = \*5 \(-> Reverse Video (DECSCNM) \*(Ps = \*6 \(-> Origin Mode (DECOM) \*(Ps = \*7 \(-> Wraparound Mode (DECAWM) \*(Ps = \*8 \(-> Auto-repeat Keys (DECARM) \*(Ps = \*9 \(-> Send Mouse X & Y on button press. See the section \fBMouse Tracking\fP. + \*(Ps = \*1\*0 \(-> Show toolbar (rxvt) \*(Ps = \*1\*2 \(-> Start Blinking Cursor (att610) \*(Ps = \*1\*8 \(-> Print form feed (DECPFF) \*(Ps = \*1\*9 \(-> Set print extent to full screen (DECPEX) \*(Ps = \*2\*5 \(-> Show Cursor (DECTCEM) \*(Ps = \*3\*0 \(-> Show scrollbar (rxvt). \*(Ps = \*3\*5 \(-> Enable font-shifting functions (rxvt). \*(Ps = \*3\*8 \(-> Enter Tektronix Mode (DECTEK) \*(Ps = \*4\*0 \(-> Allow 80 \z\(<-\(-> 132 Mode \*(Ps = \*4\*1 \(-> \fImore\fP(1) fix (see \fBcurses\fP resource) \*(Ps = \*4\*2 \(-> Enable Nation Replacement Character sets (DECNRCM) \*(Ps = \*4\*4 \(-> Turn On Margin Bell \*(Ps = \*4\*5 \(-> Reverse-wraparound Mode \*(Ps = \*4\*6 \(-> Start Logging (normally disabled by a compile-time option) \*(Ps = \*4\*7 \(-> Use Alternate Screen Buffer (unless disabled by the \fBtiteInhibit\fP resource) \*(Ps = \*6\*6 \(-> Application keypad (DECNKM) \*(Ps = \*6\*7 \(-> Backarrow key sends delete (DECBKM) \*(Ps = \*1\*0\*0\*0 \(-> Send Mouse X & Y on button press and release. See the section \fBMouse Tracking\fP. @@ -808,40 +808,41 @@ \*(Ps = \*1 \*1 \(-> Print all pages . .IP \\*(Cs\\*(Pm\\*s\\*l Reset Mode (RM) \*(Ps = \*2 \(-> Keyboard Action Mode (AM) \*(Ps = \*4 \(-> Replace Mode (IRM) \*(Ps = \*1\*2 \(-> Send/receive (SRM) \*(Ps = \*2\*0 \(-> Normal Linefeed (LNM) . .IP \\*(Cs\\*?\\*(Pm\\*s\\*l DEC Private Mode Reset (DECRST) \*(Ps = \*1 \(-> Normal Cursor Keys (DECCKM) \*(Ps = \*2 \(-> Designate VT52 mode (DECANM). \*(Ps = \*3 \(-> 80 Column Mode (DECCOLM) \*(Ps = \*4 \(-> Jump (Fast) Scroll (DECSCLM) \*(Ps = \*5 \(-> Normal Video (DECSCNM) \*(Ps = \*6 \(-> Normal Cursor Mode (DECOM) \*(Ps = \*7 \(-> No Wraparound Mode (DECAWM) \*(Ps = \*8 \(-> No Auto-repeat Keys (DECARM) \*(Ps = \*9 \(-> Don't Send Mouse X & Y on button press + \*(Ps = \*1\*0 \(-> Hide toolbar (rxvt) \*(Ps = \*1\*2 \(-> Stop Blinking Cursor (att610) \*(Ps = \*1\*8 \(-> Don't print form feed (DECPFF) \*(Ps = \*1\*9 \(-> Limit print to scrolling region (DECPEX) \*(Ps = \*2\*5 \(-> Hide Cursor (DECTCEM) \*(Ps = \*3\*0 \(-> Don't show scrollbar (rxvt). \*(Ps = \*3\*5 \(-> Disable font-shifting functions (rxvt). \*(Ps = \*4\*0 \(-> Disallow 80 \z\(<-\(-> 132 Mode \*(Ps = \*4\*1 \(-> No \fImore\fP(1) fix (see \fBcurses\fP resource) \*(Ps = \*4\*2 \(-> Disable Nation Replacement Character sets (DECNRCM) \*(Ps = \*4\*4 \(-> Turn Off Margin Bell \*(Ps = \*4\*5 \(-> No Reverse-wraparound Mode \*(Ps = \*4\*6 \(-> Stop Logging (normally disabled by a compile-time option) \*(Ps = \*4\*7 \(-> Use Normal Screen Buffer \*(Ps = \*6\*6 \(-> Numeric keypad (DECNKM) \*(Ps = \*6\*7 \(-> Backarrow key sends backspace (DECBKM) \*(Ps = \*1\*0\*0\*0 \(-> Don't Send Mouse X & Y on button press and release. See the section \fBMouse Tracking\fP. \*(Ps = \*1\*0\*0\*1 \(-> Don't Use Hilite Mouse Tracking @@ -945,161 +946,197 @@ (assumes page is zero). \*(Ps = \*1\*5 \(-> Report Printer status as \*(Cs\*?\*1\*0\*s\*n (ready) or \*(Cs\*?\*1\*1\*s\*n (not ready) \*(Ps = \*2\*5 \(-> Report UDK status as \*(Cs\*?\*2\*0\*s\*n (unlocked) or \*(Cs\*?\*2\*1\*s\*n (locked) \*(Ps = \*2\*6 \(-> Report Keyboard status as .br \*(Cs\*?\*2\*7\*s\*;\*s\*1\*s\*;\*s\*0\*s\*;\*s\*0\*s\*n (North American) .br The last two parameters apply to VT400 & up, and denote keyboard ready and LK01 respectively. \*(Ps = \*5\*3 \(-> Report Locator status as .br \*(Cs\*?\*5\*3\*s\*n Locator available, if compiled-in, or .br \*(Cs\*?\*5\*0\*s\*n No Locator, if not. . -.IP \\*(Cs\\*s\\*!\\*p +.IP \\*(Cs\\*!\\*p Soft terminal reset (DECSTR) . .IP \\*(Cs\\*(Ps\\*s\\*;\\*(Ps\\*s\\*(c"\\*p Set conformance level (DECSCL) Valid values for the first parameter: \*(Ps = \*6\*1 \(-> VT100 \*(Ps = \*6\*2 \(-> VT200 \*(Ps = \*6\*3 \(-> VT300 .br Valid values for the second parameter: \*(Ps = \*0 \(-> 8-bit controls \*(Ps = \*1 \(-> 7-bit controls (always set for VT100) \*(Ps = \*2 \(-> 8-bit controls . .IP \\*(Cs\\*(Ps\\*s\\*(c"\\*q Select character protection attribute (DECSCA). Valid values for the parameter: \*(Ps = \*0 \(-> DECSED and DECSEL can erase (default) \*(Ps = \*1 \(-> DECSED and DECSEL cannot erase \*(Ps = \*2 \(-> DECSED and DECSEL can erase . .IP \\*(Cs\\*(Ps\\*s\\*;\\*(Ps\\*s\\*r Set Scrolling Region [top;bottom] (default = full size of window) (DECSTBM) . .IP \\*(Cs\\*?\\*(Pm\\*s\\*r Restore DEC Private Mode Values. The value of \*(Ps previously saved is restored. \*(Ps values are the same as for DECSET. . +.IP \\*(Cs\\*(Pt\\*;\\*(Pl\\*;\\*(Pb\\*;\\*(Pr\\*;\\*(Ps\\*$\\*r +Change Attributes in Rectangular Area (DECCARA). + \*(Pt\*;\*(Pl\*;\*(Pb\*;\*(Pr denotes the rectangle. + \*(Ps denotes the SGR attributes to change: 0, 1, 4, 5, 7 +. .IP \\*(Cs\\*(cs Save cursor (ANSI.SYS) . .IP \\*(Cs\\*?\\*(Pm\\*s\\*(cs Save DEC Private Mode Values. \*(Ps values are the same as for DECSET. . .IP \\*(Cs\\*(Ps\\*s\\*;\\*(Ps\\*s\\*;\\*(Ps\\*s\\*t Window manipulation (from \fIdtterm\fP, as well as extensions). Valid values for the first (and any additional parameters) are: \*(Ps = \*1 \(-> De-iconify window. \*(Ps = \*2 \(-> Iconify window. \*(Ps = \*3 ; \fIx ; y\fP \(-> Move window to [x, y]. \*(Ps = \*4 ; \fIheight ; width\fP \(-> Resize the \fIxterm\fP window to height and width in pixels. \*(Ps = \*5 \(-> Raise the \fIxterm\fP window to the front of the stacking order. \*(Ps = \*6 \(-> Lower the \fIxterm\fP window to the bottom of the stacking order. \*(Ps = \*7 \(-> Refresh the \fIxterm\fP window. \*(Ps = \*8 ; \fIheight ; width\fP \(-> Resize the text area to [height;width] in characters. \*(Ps = \*9 ; \*0 \(-> Restore maximized window. \*(Ps = \*9 ; \*1 \(-> Maximize window (i.e., resize to screen size). \*(Ps = \*1\*1 \(-> Report \fIxterm\fP window state. If the \fIxterm\fP window is open (non-iconified), it returns \*(Cs\*1\*t. If the \fIxterm\fP window is iconified, it returns \*(Cs\*2\*t. \*(Ps = \*1\*3 \(-> Report \fIxterm\fP window position as \*(Cs\*3\*;\*(Ix\*;\*(Iy\*t \*(Ps = \*1\*4 \(-> Report \fIxterm\fP window in pixels as \*(Cs\*s\*4\*s\*;\*s\fIheight\fP\*s\*;\*s\fIwidth\fP\*s\*t \*(Ps = \*1\*8 \(-> Report the size of the text area in characters as \*(Cs\*s\*8\*s\*;\*s\fIheight\fP\*s\*;\*s\fIwidth\fP\*s\*t \*(Ps = \*1\*9 \(-> Report the size of the screen in characters as \*(Cs\*s\*9\*s\*;\*s\fIheight\fP\*s\*;\*s\fIwidth\fP\*s\*t \*(Ps = \*2\*0 \(-> Report \fIxterm\fP window's icon label as \*(Os\*s\*L\*s\fIlabel\fP\*s\*(ST \*(Ps = \*2\*1 \(-> Report \fIxterm\fP window's title as \*(Os\*s\*l\*s\fItitle\fP\*s\*(ST \*(Ps >= \*2\*4 \(-> Resize to \*(Ps lines (DECSLPP) . +.IP \\*(Cs\\*(Pt\\*;\\*(Pl\\*;\\*(Pb\\*;\\*(Pr\\*;\\*(Ps\\*$\\*t +Reverse Attributes in Rectangular Area (DECRARA). + \*(Pt\*;\*(Pl\*;\*(Pb\*;\*(Pr denotes the rectangle. + \*(Ps denotes the attributes to reverse. 1, 4, 5, 7 +. .IP \\*(Cs\\*u Save cursor (ANSI.SYS) . +.IP \\*(Cs\\*(Pt\\*;\\*(Pl\\*;\\*(Pb\\*;\\*(Pr\\*;\\*(Pp\\*;\\*(Pt\\*;\\*(Pl\\*;\\*(Pp\\*$\\*v +Copy Rectangular Area (DECCRA) + \*(Pt\*;\*(Pl\*;\*(Pb\*;\*(Pr denotes the rectangle. + \*(Pp denotes the source page. + \*(Pt\*;\*(Pl denotes the target location. + \*(Pp denotes the target page. +. .IP \\*(Cs\\*(Pt\\*s\\*;\\*(Pl\\*s\\*;\\*(Pb\\*s\\*;\\*(Pr\\*s\\*(qu\\*w Enable Filter Rectangle (DECEFR) .br Parameters are [top;left;bottom;right]. .br Defines the coordinates of a filter rectangle and activates it. Anytime the locator is detected outside of the filter rectangle, an outside rectangle event is generated and the rectangle is disabled. Filter rectangles are always treated as "one-shot" events. Any parameters that are omitted default to the current locator position. If all parameters are omitted, any locator motion will be reported. DECELR always cancels any prevous rectangle definition. . .IP \\*(Cs\\*(Ps\\*s\\*x Request Terminal Parameters (DECREQTPARM) .br if \*(Ps is a "0" (default) or "1", and \fBxterm\fR is emulating VT100, the control sequence elicits a response of the same form whose parameters describe the terminal: \*(Ps \(-> the given \*(Ps incremented by 2. \*1 \(-> no parity \*1 \(-> eight bits \*1 \*2 \*8 \(-> transmit 38.4k baud \*1 \*2 \*8 \(-> receive 38.4k baud \*1 \(-> clock multiplier \*0 \(-> STP flags . +.IP \\*(Cs\\*(Ps\\*s\\*x +Select Attribute Change Extent (DECSACE). + \*(Ps = \*0 \(-> from start to end position, wrapped + \*(Ps = \*1 \(-> from start to end position, wrapped + \*(Ps = \*2 \(-> rectangle (exact). +. +.IP \\*(Cs\\*(Pc\\*;\\*(Pt\\*;\\*(Pl\\*;\\*(Pb\\*;\\*(Pr\\*$\\*x +Fill Rectangular Area (DECFRA). + \*(Pc is the character to use. + \*(Pt\*;\*(Pl\*;\*(Pb\*;\*(Pr denotes the rectangle. +. .IP \\*(Cs\\*(Ps\\*s\\*;\\*(Pu\\*s\\*(qu\\*z Enable Locator Reporting (DECELR) .br Valid values for the first parameter: \*(Ps = \*0 \(-> Locator disabled (default) \*(Ps = \*1 \(-> Locator enabled \*(Ps = \*2 \(-> Locator enabled for one report, then disabled .br The second parameter specifies the coordinate unit for locator reports. .br Valid values for the second parameter: \*(Pu = \*0 or omitted \(-> default to character cells \*(Pu = \*1 \(-> device physical pixels \*(Pu = \*2 \(-> character cells . +.IP \\*(Cs\\*(Pt\\*;\\*(Pl\\*;\\*(Pb\\*;\\*(Pr\\*$\\*z +Erase Rectangular Area (DECERA). + \*(Pt\*;\*(Pl\*;\*(Pb\*;\*(Pr denotes the rectangle. +. .IP \\*(Cs\\*(Pm\\*s\\*(qu\\*{ Select Locator Events (DECSLE) .br Valid values for the first (and any additional parameters) are: \*(Ps = \*0 \(-> only respond to explicit host requests (DECRQLP) (default) also cancels any filter rectangle \*(Ps = \*1 \(-> report button down transitions \*(Ps = \*2 \(-> do not report button down transitions \*(Ps = \*3 \(-> report button up transitions \*(Ps = \*4 \(-> do not report button up transitions . +.IP \\*(Cs\\*(Pt\\*;\\*(Pl\\*;\\*(Pb\\*;\\*(Pr\\*$\\*{ +Selective Erase Rectangular Area (DECSERA). + \*(Pt\*;\*(Pl\*;\*(Pb\*;\*(Pr denotes the rectangle. +. .IP \\*(Cs\\*(Ps\\*s\\*(qu\\*| Request Locator Position (DECRQLP) .br Valid values for the parameter are: \*(Ps = \*0, 1 or omitted \(-> transmit a single DECLRP locator report .sp If Locator Reporting has been enabled by a DECELR, xterm will respond with a DECLRP Locator Report. This report is also generated on button up and down events if they have been enabled with a DECSLE, or when the locator is detected outside of a filter rectangle, if filter rectangles have been enabled with a DECEFR. .sp \(-> \*(Cs\*(Pe\*s\*;\*(Pb\*s\*;\*(Pr\*s\*;\*(Pc\*s\*;\*(Pp\*s\*&\*s\*w .sp Parameters are [event;button;row;column;page]. .br Valid values for the event: \*(Pe = \*0 \(-> locator unavailable - no other parameters sent \*(Pe = \*1 \(-> request - xterm received a DECRQLP \*(Pe = \*2 \(-> left button down Index: xc/programs/xterm/cursor.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/cursor.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 cursor.c --- xc/programs/xterm/cursor.c 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/cursor.c 6 Jan 2005 00:30:42 -0000 @@ -1,28 +1,30 @@ +/* $XTermId: cursor.c,v 1.32 2004/12/01 01:27:46 tom Exp $ */ + /* * $Xorg: cursor.c,v 1.3 2000/08/17 19:55:08 cpqbld Exp $ */ -/* $XFree86: xc/programs/xterm/cursor.c,v 3.15 2002/04/28 19:04:20 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/cursor.c,v 3.16 2004/12/01 01:27:46 dickey Exp $ */ /* - * Copyright 2002 by Thomas E. Dickey + * Copyright 2002,2004 by Thomas E. Dickey * * All Rights Reserved * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE @@ -44,254 +46,238 @@ * supporting documentation, and that the name of Digital Equipment * Corporation not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior permission. * * * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* cursor.c */ #include #include /* - * Clear the selection if the cursor moves "before" the current position. - * Moving "after" is ok. - * - * That sounds fine - if the cursor really had anything direct relationship to - * the selection. For instance, if the cursor moved due to command line - * editing, it would be nice to deselect. However, what that means in practice - * is that a fullscreen program which scrolls back a line will (because it must - * temporarily reposition the cursor) clear the selection. - * - * However, it has an indirect relationship to the selection - we want to - * prevent the application from changing the screen contents under the - * highlighted region. - */ -#define _CheckSelection(screen) \ - if ((screen->cur_row < screen->endHRow) || \ - (screen->cur_row == screen->endHRow && \ - screen->cur_col < screen->endHCol)) \ - DisownSelection(term); - -/* * Moves the cursor to the specified position, checking for bounds. * (this includes scrolling regions) * The origin is considered to be 0, 0 for this procedure. */ void -CursorSet(register TScreen * screen, register int row, register int col, unsigned flags) +CursorSet(TScreen * screen, int row, int col, unsigned flags) { - register int maxr; + int use_row = row; + int max_row; col = (col < 0 ? 0 : col); screen->cur_col = (col <= screen->max_col ? col : screen->max_col); - maxr = screen->max_row; + max_row = screen->max_row; if (flags & ORIGIN) { - row += screen->top_marg; - maxr = screen->bot_marg; + use_row += screen->top_marg; + max_row = screen->bot_marg; } - row = (row < 0 ? 0 : row); - screen->cur_row = (row <= maxr ? row : maxr); + use_row = (use_row < 0 ? 0 : use_row); + screen->cur_row = (use_row <= max_row ? use_row : max_row); screen->do_wrap = 0; - _CheckSelection(screen); + + TRACE(("CursorSet(%d,%d) margins [%d..%d] -> %d,%d %s\n", + row, col, + screen->top_marg, + screen->bot_marg, + screen->cur_row, + screen->cur_col, + (flags & ORIGIN ? "origin" : "normal"))); } /* * moves the cursor left n, no wrap around */ void -CursorBack(register TScreen * screen, int n) +CursorBack(TScreen * screen, int n) { - register int i, j, k, rev; + int i, j, k, rev; if ((rev = (term->flags & (REVERSEWRAP | WRAPAROUND)) == (REVERSEWRAP | WRAPAROUND)) != 0 && screen->do_wrap) n--; if ((screen->cur_col -= n) < 0) { if (rev) { if ((i = ((j = screen->max_col + 1) * screen->cur_row) + screen->cur_col) < 0) { k = j * (screen->max_row + 1); i += ((-i) / k + 1) * k; } screen->cur_row = i / j; screen->cur_col = i % j; } else screen->cur_col = 0; } screen->do_wrap = 0; - _CheckSelection(screen); } /* * moves the cursor forward n, no wraparound */ void -CursorForward(register TScreen * screen, int n) +CursorForward(TScreen * screen, int n) { screen->cur_col += n; if (screen->cur_col > CurMaxCol(screen, screen->cur_row)) screen->cur_col = CurMaxCol(screen, screen->cur_row); screen->do_wrap = 0; - _CheckSelection(screen); } /* * moves the cursor down n, no scrolling. * Won't pass bottom margin or bottom of screen. */ void -CursorDown(register TScreen * screen, int n) +CursorDown(TScreen * screen, int n) { - register int max; + int max; max = (screen->cur_row > screen->bot_marg ? screen->max_row : screen->bot_marg); screen->cur_row += n; if (screen->cur_row > max) screen->cur_row = max; screen->do_wrap = 0; - _CheckSelection(screen); } /* * moves the cursor up n, no linestarving. * Won't pass top margin or top of screen. */ void -CursorUp(register TScreen * screen, int n) +CursorUp(TScreen * screen, int n) { - register int min; + int min; - min = (screen->cur_row < screen->top_marg ? - 0 : screen->top_marg); + min = ((screen->cur_row < screen->top_marg) + ? 0 + : screen->top_marg); screen->cur_row -= n; if (screen->cur_row < min) screen->cur_row = min; screen->do_wrap = 0; - _CheckSelection(screen); } /* * Moves cursor down amount lines, scrolls if necessary. * Won't leave scrolling region. No carriage return. */ void -xtermIndex(register TScreen * screen, register int amount) +xtermIndex(TScreen * screen, int amount) { - register int j; + int j; /* * indexing when below scrolling region is cursor down. * if cursor high enough, no scrolling necessary. */ if (screen->cur_row > screen->bot_marg || screen->cur_row + amount <= screen->bot_marg) { CursorDown(screen, amount); return; } CursorDown(screen, j = screen->bot_marg - screen->cur_row); xtermScroll(screen, amount - j); } /* * Moves cursor up amount lines, reverse scrolls if necessary. * Won't leave scrolling region. No carriage return. */ void -RevIndex(register TScreen * screen, register int amount) +RevIndex(TScreen * screen, int amount) { /* * reverse indexing when above scrolling region is cursor up. * if cursor low enough, no reverse indexing needed */ if (screen->cur_row < screen->top_marg || screen->cur_row - amount >= screen->top_marg) { CursorUp(screen, amount); return; } RevScroll(screen, amount - (screen->cur_row - screen->top_marg)); CursorUp(screen, screen->cur_row - screen->top_marg); } /* * Moves Cursor To First Column In Line * (Note: xterm doesn't implement SLH, SLL which would affect use of this) */ void -CarriageReturn(register TScreen * screen) +CarriageReturn(TScreen * screen) { screen->cur_col = 0; screen->do_wrap = 0; - _CheckSelection(screen); } /* * Save Cursor and Attributes */ void -CursorSave(register XtermWidget tw) +CursorSave(XtermWidget tw) { - register TScreen *screen = &tw->screen; - register SavedCursor *sc = &screen->sc[screen->alternate != False]; + TScreen *screen = &tw->screen; + SavedCursor *sc = &screen->sc[screen->alternate != False]; sc->saved = True; sc->row = screen->cur_row; sc->col = screen->cur_col; sc->flags = tw->flags; sc->curgl = screen->curgl; sc->curgr = screen->curgr; #if OPT_ISO_COLORS sc->cur_foreground = tw->cur_foreground; sc->cur_background = tw->cur_background; sc->sgr_foreground = tw->sgr_foreground; #endif memmove(sc->gsets, screen->gsets, sizeof(screen->gsets)); } /* * We save/restore all visible attributes, plus wrapping, origin mode, and the * selective erase attribute. */ #define DECSC_FLAGS (ATTRIBUTES|ORIGIN|WRAPAROUND|PROTECTED) /* * Restore Cursor and Attributes */ void -CursorRestore(register XtermWidget tw) +CursorRestore(XtermWidget tw) { - register TScreen *screen = &tw->screen; - register SavedCursor *sc = &screen->sc[screen->alternate != False]; + TScreen *screen = &tw->screen; + SavedCursor *sc = &screen->sc[screen->alternate != False]; /* Restore the character sets, unless we never did a save-cursor op. * In that case, we'll reset the character sets. */ if (sc->saved) { memmove(screen->gsets, sc->gsets, sizeof(screen->gsets)); screen->curgl = sc->curgl; screen->curgr = sc->curgr; } else { resetCharsets(screen); } tw->flags &= ~DECSC_FLAGS; tw->flags |= sc->flags & DECSC_FLAGS; CursorSet(screen, ((tw->flags & ORIGIN) ? sc->row - screen->top_marg : sc->row), sc->col, tw->flags); Index: xc/programs/xterm/doublechr.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/doublechr.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 doublechr.c --- xc/programs/xterm/doublechr.c 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/doublechr.c 6 Jan 2005 00:30:42 -0000 @@ -1,29 +1,29 @@ -/* $XTermId: doublechr.c,v 1.33 2004/04/18 20:49:43 tom Exp $ */ +/* $XTermId: doublechr.c,v 1.35 2004/12/01 01:27:46 tom Exp $ */ /* - * $XFree86: xc/programs/xterm/doublechr.c,v 3.13 2004/04/18 20:49:43 dickey Exp $ + * $XFree86: xc/programs/xterm/doublechr.c,v 3.14 2004/12/01 01:27:46 dickey Exp $ */ /************************************************************ -Copyright 1997-2002,2003 by Thomas E. Dickey +Copyright 1997-2003,2004 by Thomas E. Dickey All Rights Reserved Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE @@ -61,56 +61,55 @@ /* * Ignore repetition. */ if (oldChrSet == newChrSet) return; TRACE(("repaint_line(%2d,%2d) (%d)\n", currow, screen->cur_col, newChrSet)); HideCursor(); /* If switching from single-width, keep the cursor in the visible part * of the line. */ if (CSET_DOUBLE(newChrSet)) { width /= 2; if (curcol > width) curcol = width; } /* * ScrnRefresh won't paint blanks for us if we're switching between a - * single-size and double-size font. + * single-size and double-size font. So we paint our own. */ if (CSET_DOUBLE(oldChrSet) != CSET_DOUBLE(newChrSet)) { - ClearCurBackground( - screen, - CursorY(screen, currow), - CurCursorX(screen, currow, 0), - FontHeight(screen), - len * CurFontWidth(screen, currow)); + ClearCurBackground(screen, + CursorY(screen, currow), + CurCursorX(screen, currow, 0), + FontHeight(screen), + len * CurFontWidth(screen, currow)); } /* FIXME: do VT220 softchars allow double-sizes? */ memset(SCRN_BUF_CSETS(screen, currow), newChrSet, len); screen->cur_col = 0; - ScrnRefresh(screen, currow, 0, 1, len, True); + ScrnUpdate(screen, currow, 0, 1, len, True); screen->cur_col = curcol; } #endif /* * Set the line to double-height characters. The 'top' flag denotes whether * we'll be using it for the top (true) or bottom (false) of the line. */ void xterm_DECDHL(Bool top) { #if OPT_DEC_CHRSET repaint_line(top ? CSET_DHL_TOP : CSET_DHL_BOT); #endif } /* * Set the line to single-width characters (the normal state). */ void Index: xc/programs/xterm/fontutils.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/fontutils.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 fontutils.c --- xc/programs/xterm/fontutils.c 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/fontutils.c 6 Jan 2005 00:30:43 -0000 @@ -1,24 +1,24 @@ -/* $XTermId: fontutils.c,v 1.124 2004/07/13 00:41:28 tom Exp $ */ +/* $XTermId: fontutils.c,v 1.131 2004/12/01 01:27:46 tom Exp $ */ /* - * $XFree86: xc/programs/xterm/fontutils.c,v 1.47 2004/07/13 00:41:28 dickey Exp $ + * $XFree86: xc/programs/xterm/fontutils.c,v 1.48 2004/12/01 01:27:46 dickey Exp $ */ /************************************************************ Copyright 1998-2003,2004 by Thomas E. Dickey All Rights Reserved Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS @@ -427,41 +427,43 @@ * Case-independent comparison for font-names, including wildcards. * XLFD allows '?' as a wildcard, but we do not handle that (no one seems * to use it). */ static Boolean same_font_name(char *pattern, char *match) { while (*pattern && *match) { if (*pattern == *match) { pattern++; match++; } else if (*pattern == '*' || *match == '*') { if (same_font_name(pattern + 1, match)) { return True; } else if (same_font_name(pattern, match + 1)) { return True; } else { return False; } } else { - if (char2lower(*pattern++) != char2lower(*match++)) + int p = char2lower(*pattern++); + int m = char2lower(*match++); + if (p != m) return False; } } return (*pattern == *match); /* both should be NUL */ } /* * Double-check the fontname that we asked for versus what the font server * actually gave us. The larger fixed fonts do not always have a matching bold * font, and the font server may try to scale another font or otherwise * substitute a mismatched font. * * If we cannot get what we requested, we will fallback to the original * behavior, which simulates bold by overstriking each character at one pixel * offset. */ static int got_bold_font(Display * dpy, XFontStruct * fs, char *requested) { char actual[MAX_FONTNAME]; @@ -866,41 +868,41 @@ #if OPT_BOX_CHARS /* * Xterm uses character positions 1-31 of a font for the line-drawing * characters. Check that they are all present. The null character * (0) is special, and is not used. */ #if OPT_RENDERFONT if (term->misc.render_font) { /* * FIXME: we shouldn't even be here if we're using Xft. */ screen->fnt_boxes = False; TRACE(("assume Xft missing line-drawing chars\n")); } else #endif { for (ch = 1; ch < 32; ch++) { int n = ch; #if OPT_WIDE_CHARS - if (screen->utf8_mode) { + if (screen->utf8_mode || screen->unicode_font) { n = dec2ucs(ch); if (n == UCS_REPL) continue; } #endif if (xtermMissingChar(n, nfs)) { TRACE(("missing normal char #%d\n", n)); screen->fnt_boxes = False; break; } if (xtermMissingChar(n, bfs)) { TRACE(("missing bold char #%d\n", n)); screen->fnt_boxes = False; break; } } } TRACE(("Will %suse internal line-drawing characters\n", screen->fnt_boxes ? "not " : "")); #endif @@ -1002,80 +1004,80 @@ Boolean status = True; if (!initialized) { initialized = True; TRACE(("xtermLoadVTFonts saving original\n")); original.default_font = w->misc.default_font; COPY_MENU_FONTS(w->screen, original); } if (myName == 0 || *myName == 0) { TRACE(("xtermLoadVTFonts restoring original\n")); w->misc.default_font = original.default_font; COPY_MENU_FONTS(original, w->screen); for (n = 0; n < XtNumber(original.menu_font_names); ++n) w->screen.menu_font_names[n] = original.menu_font_names[n]; } else { TRACE(("xtermLoadVTFonts(%s, %s)\n", myName, myClass)); memset(&subresourceRec, 0, sizeof(subresourceRec)); - XtGetSubresources((Widget) w, (XtPointer) & subresourceRec, + XtGetSubresources((Widget) w, (XtPointer) &subresourceRec, myName, myClass, font_resources, (Cardinal) XtNumber(font_resources), NULL, (Cardinal) 0); if (memcmp(&referenceRec, &subresourceRec, sizeof(referenceRec))) { /* * If a particular resource value was not found, use the original. */ MERGE_SUBFONT(w->misc, subresourceRec, default_font.f_n); MERGE_SUBFONT(w->misc, subresourceRec, default_font.f_b); #if OPT_WIDE_CHARS MERGE_SUBFONT(w->misc, subresourceRec, default_font.f_w); MERGE_SUBFONT(w->misc, subresourceRec, default_font.f_wb); #endif for (n = fontMenu_font1; n <= fontMenu_lastBuiltin; ++n) MERGE_SUBFONT(w->screen, subresourceRec, menu_font_names[n]); /* * Finally, copy the subresource data to the widget. */ w->misc.default_font = subresourceRec.default_font; COPY_MENU_FONTS(subresourceRec, w->screen); w->screen.menu_font_names[fontMenu_fontdefault] = w->misc.default_font.f_n; } else { TRACE(("...no resources found\n")); status = False; } } return status; } #endif /* OPT_LOAD_VTFONTS || OPT_WIDE_CHARS */ #if OPT_LOAD_VTFONTS void HandleLoadVTFonts(Widget w GCC_UNUSED, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * param_count GCC_UNUSED) + Cardinal *param_count GCC_UNUSED) { char buf[80]; char *myName = (*param_count > 0) ? params[0] : ""; char *convert = (*param_count > 1) ? params[1] : myName; char *myClass = (char *) MyStackAlloc(strlen(convert), buf); int n; TRACE(("HandleLoadVTFonts(%d)\n", *param_count)); strcpy(myClass, convert); if (*param_count == 1 && islower(CharOf(myClass[0]))) myClass[0] = toupper(CharOf(myClass[0])); if (xtermLoadVTFonts(term, myName, myClass)) { /* * When switching fonts, try to preserve the font-menu selection, since * it is less surprising to do that (if the font-switching can be * undone) than to switch to "Default". */ int font_number = term->screen.menu_font_number; @@ -1136,68 +1138,68 @@ /* * xterm contains a lot of references to fonts, assuming they are fixed * size. This chunk of code overrides the actual font-selection (see * drawXtermText()), if the user has selected render-font. All of the * font-loading for fixed-fonts still goes on whether or not this chunk * overrides it. */ if (term->misc.render_font) { Display *dpy = screen->display; int fontnum = screen->menu_font_number; XftFont *norm = screen->renderFontNorm[fontnum]; XftFont *bold = screen->renderFontBold[fontnum]; #if OPT_RENDERWIDE XftFont *wnorm = screen->renderWideNorm[fontnum]; XftFont *wbold = screen->renderWideBold[fontnum]; #endif if (norm == 0 && term->misc.face_name) { XftPattern *pat, *match; XftResult result; - int face_size = term->misc.face_size; + double face_size = term->misc.face_size; - TRACE(("xtermComputeFontInfo norm(face %s, size %d)\n", + TRACE(("xtermComputeFontInfo norm(face %s, size %f)\n", term->misc.face_name, term->misc.face_size)); #if OPT_SHIFT_FONTS /* * If the user is switching font-sizes, make it follow the same * ratios to the default as the fixed fonts would, for easy * comparison. There will be some differences since the fixed * fonts have a variety of height/width ratios, but this is simpler * than adding another resource value - and as noted above, the * data for the fixed fonts are available. */ lookupOneFontSize(screen, fontnum); if (fontnum != fontMenu_fontdefault) { int num = screen->menu_font_sizes[fontnum]; int den = screen->menu_font_sizes[0]; face_size = (1.0 * face_size * num) / den; - TRACE(("scaled using %d/%d -> %d\n", num, den, face_size)); + TRACE(("scaled using %d/%d -> %f\n", num, den, face_size)); } #endif pat = XftNameParse(term->misc.face_name); XftPatternBuild(pat, XFT_FAMILY, XftTypeString, "mono", - XFT_SIZE, XftTypeInteger, face_size, + XFT_SIZE, XftTypeDouble, face_size, XFT_SPACING, XftTypeInteger, XFT_MONO, (void *) 0); match = XftFontMatch(dpy, DefaultScreen(dpy), pat, &result); norm = XftFontOpenPattern(dpy, match); if ((norm == 0) && match) XftPatternDestroy(match); if (norm != 0) { XftPatternBuild(pat, XFT_WEIGHT, XftTypeInteger, XFT_WEIGHT_BOLD, XFT_CHAR_WIDTH, XftTypeInteger, norm->max_advance_width, (void *) 0); match = XftFontMatch(dpy, DefaultScreen(dpy), pat, &result); bold = XftFontOpenPattern(dpy, match); if ((bold == 0) && match) XftPatternDestroy(match); /* * FIXME: just assume that the corresponding font has no * graphics characters. */ @@ -1213,48 +1215,48 @@ CACHE_XFT(screen->renderFontNorm, norm); CACHE_XFT(screen->renderFontBold, bold); /* * See xtermXftDrawString(). */ #if OPT_RENDERWIDE if (norm != 0 && wnorm == 0) { char *face_name = (term->misc.face_wide_name ? term->misc.face_wide_name : term->misc.face_name); int char_width = norm->max_advance_width * 2; TRACE(("xtermComputeFontInfo wide(face %s, char_width %d)\n", face_name, char_width)); wnorm = XftFontOpen(dpy, DefaultScreen(dpy), XFT_FAMILY, XftTypeString, face_name, - XFT_SIZE, XftTypeInteger, face_size, + XFT_SIZE, XftTypeDouble, face_size, XFT_SPACING, XftTypeInteger, XFT_MONO, XFT_CHAR_WIDTH, XftTypeInteger, char_width, (void *) 0); wbold = XftFontOpen(dpy, DefaultScreen(dpy), XFT_FAMILY, XftTypeString, face_name, - XFT_SIZE, XftTypeInteger, face_size, + XFT_SIZE, XftTypeDouble, face_size, XFT_SPACING, XftTypeInteger, XFT_MONO, XFT_CHAR_WIDTH, XftTypeInteger, char_width, XFT_WEIGHT, XftTypeInteger, XFT_WEIGHT_BOLD, (void *) 0); CACHE_XFT(screen->renderWideNorm, wnorm); CACHE_XFT(screen->renderWideBold, wbold); } #endif } if (norm == 0) { term->misc.render_font = False; update_font_renderfont(); } else { win->f_width = norm->max_advance_width; win->f_height = norm->height; win->f_ascent = norm->ascent; win->f_descent = norm->descent; if (win->f_height < win->f_ascent + win->f_descent) win->f_height = win->f_ascent + win->f_descent; @@ -1266,45 +1268,49 @@ #endif { 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; } i = 2 * screen->border + sbwidth; j = 2 * screen->border; width = (screen->max_col + 1) * win->f_width + i; height = (screen->max_row + 1) * win->f_height + j; win->fullwidth = width; win->fullheight = height; win->width = width - i; win->height = height - j; - TRACE(("xtermComputeFontInfo fontsize %dx%d, screensize %dx%d\n", - FontHeight(screen), - FontWidth(screen), - Height(screen), - Width(screen))); + TRACE(("xtermComputeFontInfo window %dx%d (full %dx%d), fontsize %dx%d (asc %d, dsc %d)\n", + win->height, + win->width, + win->fullheight, + win->fullwidth, + win->f_height, + win->f_width, + win->f_ascent, + win->f_descent)); } /* save this information as a side-effect for double-sized characters */ void xtermSaveFontInfo(TScreen * screen, XFontStruct * font) { screen->fnt_wide = (font->max_bounds.width); screen->fnt_high = (font->ascent + font->descent); } /* * After loading a new font, update the structures that use its size. */ void xtermUpdateFontInfo(TScreen * screen, Bool doresize) { int scrollbar_width; struct _vtwin *win = &(screen->fullVwin); scrollbar_width = (term->misc.scrollbar @@ -1658,40 +1664,99 @@ SCALE_X(coord[0]); SCALE_Y(coord[1]); SCALE_X(coord[2]); SCALE_Y(coord[3]); XDrawLine(screen->display, VWindow(screen), gc2, x + coord[0], y + coord[1], x + coord[2], y + coord[3]); n = 0; } } } else if (screen->force_all_chars) { /* bounding rectangle, for debugging */ XDrawRectangle(screen->display, VWindow(screen), gc2, x, y, font_width - 1, font_height - 1); } XFreeGC(screen->display, gc2); } + +#if OPT_RENDERFONT && OPT_WIDE_CHARS + +/* + * Check if the given character has a glyph known to Xft. + * + * see xc/lib/Xft/xftglyphs.c + */ +Bool +xtermXftMissing(XftFont * font, int wc) +{ + unsigned check = XftCharIndex(term->screen.display, font, wc); + Bool result = False; + + if (check == 0) { + TRACE(("missingXft %d (%d)\n", wc, ucs2dec(wc))); + result = True; + } + return result; +} + +/* + * Check if the character corresponds to one of xterm's internal codes for + * line-drawing characters. That is only a subset of the 1-31 codes used for + * graphic characters. We want to know specifically about the line-drawing + * characters because the fonts used by Xft do not always give useful glyphs + * for line-drawing, and there is no reliable way to detect this. + */ +Bool +xtermIsLineDrawing(int wc) +{ + Bool result; + switch (wc) { + case 0x0B: /* lower_right_corner */ + case 0x0C: /* upper_right_corner */ + case 0x0D: /* upper_left_corner */ + case 0x0E: /* lower_left_corner */ + case 0x0F: /* cross */ + case 0x10: /* scan_line_1 */ + case 0x11: /* scan_line_3 */ + case 0x12: /* scan_line_7 */ + case 0x13: /* scan_line_9 */ + case 0x14: /* horizontal_line */ + case 0x15: /* left_tee */ + case 0x16: /* right_tee */ + case 0x17: /* bottom_tee */ + case 0x18: /* top_tee */ + case 0x19: /* vertical_line */ + result = True; + TRACE(("xtermIsLineDrawing %d\n", wc)); + break; + default: + result = False; + break; + } + return result; +} +#endif /* OPT_RENDERFONT && OPT_WIDE_CHARS */ + #endif /* OPT_BOX_CHARS */ #if OPT_WIDE_CHARS #define MY_UCS(ucs,dec) case ucs: result = dec; break int ucs2dec(int ch) { int result = ch; if ((ch > 127) && (ch != UCS_REPL)) { switch (ch) { MY_UCS(0x25ae, 0); /* black vertical rectangle */ MY_UCS(0x25c6, 1); /* black diamond */ MY_UCS(0x2592, 2); /* medium shade */ MY_UCS(0x2409, 3); /* symbol for horizontal tabulation */ MY_UCS(0x240c, 4); /* symbol for form feed */ MY_UCS(0x240d, 5); /* symbol for carriage return */ MY_UCS(0x240a, 6); /* symbol for line feed */ MY_UCS(0x00b0, 7); /* degree sign */ MY_UCS(0x00b1, 8); /* plus-minus sign */ @@ -1843,82 +1908,82 @@ if (cmp_0 > 0 && cmp_m > 0) { m = n; } } } if (m >= 0) { if (relative > 1) m = lookupRelativeFontSize(screen, m, relative - 1); else if (relative < -1) m = lookupRelativeFontSize(screen, m, relative + 1); } } return m; } /* ARGSUSED */ void HandleLargerFont(Widget w GCC_UNUSED, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * param_count GCC_UNUSED) + Cardinal *param_count GCC_UNUSED) { if (term->misc.shift_fonts) { TScreen *screen = &term->screen; int m; m = lookupRelativeFontSize(screen, screen->menu_font_number, 1); if (m >= 0) { SetVTFont(m, TRUE, NULL); } else { Bell(XkbBI_MinorError, 0); } } } /* ARGSUSED */ void HandleSmallerFont(Widget w GCC_UNUSED, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * param_count GCC_UNUSED) + Cardinal *param_count GCC_UNUSED) { if (term->misc.shift_fonts) { TScreen *screen = &term->screen; int m; m = lookupRelativeFontSize(screen, screen->menu_font_number, -1); if (m >= 0) { SetVTFont(m, TRUE, NULL); } else { Bell(XkbBI_MinorError, 0); } } } #endif /* ARGSUSED */ void HandleSetFont(Widget w GCC_UNUSED, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { int fontnum; VTFontNames fonts; memset(&fonts, 0, sizeof(fonts)); if (*param_count == 0) { fontnum = fontMenu_fontdefault; } else { Cardinal maxparams = 1; /* total number of params allowed */ switch (params[0][0]) { case 'd': case 'D': case '0': fontnum = fontMenu_fontdefault; break; case '1': fontnum = fontMenu_font1; break; Index: xc/programs/xterm/fontutils.h =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/fontutils.h,v retrieving revision 1.3 diff -u -2 -0 -r1.3 fontutils.h --- xc/programs/xterm/fontutils.h 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/fontutils.h 6 Jan 2005 00:30:44 -0000 @@ -1,27 +1,27 @@ /* - * $XFree86: xc/programs/xterm/fontutils.h,v 1.12 2003/10/27 01:07:57 dickey Exp $ + * $XFree86: xc/programs/xterm/fontutils.h,v 1.13 2004/12/01 01:27:46 dickey Exp $ */ /************************************************************ -Copyright 1998-2000,2003 by Thomas E. Dickey +Copyright 1998-2003,2004 by Thomas E. Dickey All Rights Reserved Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE @@ -51,31 +51,38 @@ extern void xtermSetCursorBox (TScreen *screen); extern void xtermUpdateFontInfo (TScreen *screen, Bool doresize); #if OPT_DEC_CHRSET extern char *xtermSpecialFont(unsigned atts, unsigned chrset); #endif #if OPT_BOX_CHARS extern Bool xtermMissingChar(unsigned ch, XFontStruct *font); extern void xtermDrawBoxChar(TScreen *screen, int ch, unsigned flags, GC gc, int x, int y); #endif #if OPT_LOAD_VTFONTS extern void HandleLoadVTFonts PROTO_XT_ACTIONS_ARGS; #endif #if OPT_LOAD_VTFONTS || OPT_WIDE_CHARS extern Bool xtermLoadVTFonts(XtermWidget w, char *aName, char *cName); #endif +#define xtermIsDecGraphic(ch) ((ch) > 0 && (ch) < 32) + +#if OPT_RENDERFONT && OPT_WIDE_CHARS +extern Bool xtermIsLineDrawing(int /* wc */); +extern Bool xtermXftMissing(XftFont * /* font */, int /* wc */); +#endif + #if OPT_SHIFT_FONTS extern void HandleSmallerFont PROTO_XT_ACTIONS_ARGS; extern void HandleLargerFont PROTO_XT_ACTIONS_ARGS; #endif #if OPT_WIDE_CHARS extern int ucs2dec(int); extern int dec2ucs(int); #endif #endif /* included_fontutils_h */ Index: xc/programs/xterm/input.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/input.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 input.c --- xc/programs/xterm/input.c 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/input.c 6 Jan 2005 00:30:44 -0000 @@ -1,25 +1,25 @@ /* * $Xorg: input.c,v 1.3 2000/08/17 19:55:08 cpqbld Exp $ */ -/* $XFree86: xc/programs/xterm/input.c,v 3.70 2004/03/04 02:21:55 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/input.c,v 3.71 2004/12/01 01:27:46 dickey Exp $ */ /* * Copyright 1999-2003,2004 by Thomas E. Dickey * * All Rights Reserved * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -238,81 +238,40 @@ reply.a_type = ESC; \ reply.a_pintro = '?'; \ }) #define VT52_CURSOR_KEYS \ if_OPT_VT52_MODE(screen,{ \ reply.a_type = ESC; \ }) #define APPEND_PARM(number) \ reply.a_param[(int) reply.a_nparam] = number, \ reply.a_nparam += 1 #if OPT_MOD_FKEYS #define MODIFIER_PARM \ if (modify_parm > 1) APPEND_PARM(modify_parm) #else #define MODIFIER_PARM /*nothing */ #endif -#if OPT_WIDE_CHARS -/* Convert a Unicode value c into a UTF-8 sequence in strbuf */ -int -convertFromUTF8(unsigned long c, Char * strbuf) -{ - int nbytes = 0; - - if (c < 0x80) { - strbuf[nbytes++] = c; - } else if (c < 0x800) { - strbuf[nbytes++] = 0xc0 | (c >> 6); - strbuf[nbytes++] = 0x80 | (c & 0x3f); - } else if (c < 0x10000) { - strbuf[nbytes++] = 0xe0 | (c >> 12); - strbuf[nbytes++] = 0x80 | ((c >> 6) & 0x3f); - strbuf[nbytes++] = 0x80 | (c & 0x3f); - } else if (c < 0x200000) { - strbuf[nbytes++] = 0xf0 | (c >> 18); - strbuf[nbytes++] = 0x80 | ((c >> 12) & 0x3f); - strbuf[nbytes++] = 0x80 | ((c >> 6) & 0x3f); - strbuf[nbytes++] = 0x80 | (c & 0x3f); - } else if (c < 0x4000000) { - strbuf[nbytes++] = 0xf8 | (c >> 24); - strbuf[nbytes++] = 0x80 | ((c >> 18) & 0x3f); - strbuf[nbytes++] = 0x80 | ((c >> 12) & 0x3f); - strbuf[nbytes++] = 0x80 | ((c >> 6) & 0x3f); - strbuf[nbytes++] = 0x80 | (c & 0x3f); - } else if (c < UCS_LIMIT) { - strbuf[nbytes++] = 0xfe | (c >> 30); - strbuf[nbytes++] = 0x80 | ((c >> 24) & 0x3f); - strbuf[nbytes++] = 0x80 | ((c >> 18) & 0x3f); - strbuf[nbytes++] = 0x80 | ((c >> 12) & 0x3f); - strbuf[nbytes++] = 0x80 | ((c >> 6) & 0x3f); - strbuf[nbytes++] = 0x80 | (c & 0x3f); - } else - return convertFromUTF8(UCS_REPL, strbuf); - - return nbytes; -} -#endif /* OPT_WIDE_CHARS */ - /* * Determine if we use the \E[3~ sequence for Delete, or the legacy ^?. We * maintain the delete_is_del value as 3 states: unspecified(2), true and * false. If unspecified, it is handled differently according to whether the * legacy keyboard support is enabled, or if xterm emulates a VT220. * * Once the user (or application) has specified delete_is_del via resource * setting, popup menu or escape sequence, it overrides the keyboard type * rather than the reverse. */ Boolean xtermDeleteIsDEL(void) { TScreen *screen = &term->screen; Boolean result = True; if (term->keyboard.type == keyboardIsDefault || term->keyboard.type == keyboardIsVT220) result = (screen->delete_is_del == True); @@ -1011,41 +970,41 @@ * Note that this can only retrieve translations that are given as resource * values; the default translations in charproc.c for example are not * retrievable by any interface to X. * * Also: We can retrieve only the most-specified translation resource. For * example, if the resource file specifies both "*translations" and * "XTerm*translations", we see only the latter. */ static Bool TranslationsUseKeyword(Widget w, const char *keyword) { static String data; static XtResource key_resources[] = { {XtNtranslations, XtCTranslations, XtRString, sizeof(data), 0, XtRString, (XtPointer) NULL} }; Bool result = False; XtGetSubresources(w, - (XtPointer) & data, + (XtPointer) &data, "vt100", "VT100", key_resources, XtNumber(key_resources), NULL, (Cardinal) 0); if (data != 0) { char *p = data; int state = 0; int now = ' ', prv; TRACE(("TranslationsUseKeyword(%p):%s\n", w, p)); while (*p != 0) { prv = now; now = char2lower(*p++); if (now == ':' || now == '!') { state = -1; } else if (now == '\n') { state = 0; @@ -1075,71 +1034,76 @@ term->misc.name, \ ModifierName(term->misc.name))); /* * Determine which modifier mask (if any) applies to the Num_Lock keysym. * * Also, determine which modifiers are associated with the ALT keys, so we can * send that information as a parameter for special keys in Sun/PC keyboard * mode. However, if the ALT modifier is used in translations, we do not want * to confuse things by sending the parameter. */ void VTInitModifiers(void) { int i, j, k; Display *dpy = XtDisplay(term); XModifierKeymap *keymap = XGetModifierMapping(dpy); unsigned long mask; int min_keycode, max_keycode, keysyms_per_keycode = 0; if (keymap != 0) { + KeySym *theMap; TRACE(("VTInitModifiers\n")); XDisplayKeycodes(dpy, &min_keycode, &max_keycode); - XGetKeyboardMapping(dpy, min_keycode, (max_keycode - min_keycode + 1), - &keysyms_per_keycode); - - for (i = k = 0, mask = 1; i < 8; i++, mask <<= 1) { - for (j = 0; j < keymap->max_keypermod; j++) { - KeyCode code = keymap->modifiermap[k]; - if (code != 0) { - KeySym keysym; - int l = 0; - do { - keysym = XKeycodeToKeysym(dpy, code, l); - l++; - } while (!keysym && l < keysyms_per_keycode); - if (keysym == XK_Num_Lock) { - SaveMask(num_lock); - } else if (keysym == XK_Alt_L) { - SaveMask(alt_left); - } else if (keysym == XK_Alt_R) { - SaveMask(alt_right); - } else if (keysym == XK_Meta_L) { - SaveMask(meta_left); - } else if (keysym == XK_Meta_R) { - SaveMask(meta_right); + theMap = XGetKeyboardMapping(dpy, min_keycode, (max_keycode - + min_keycode + 1), + &keysyms_per_keycode); + + if (theMap != 0) { + for (i = k = 0, mask = 1; i < 8; i++, mask <<= 1) { + for (j = 0; j < keymap->max_keypermod; j++) { + KeyCode code = keymap->modifiermap[k]; + if (code != 0) { + KeySym keysym; + int l = 0; + do { + keysym = XKeycodeToKeysym(dpy, code, l); + l++; + } while (!keysym && l < keysyms_per_keycode); + if (keysym == XK_Num_Lock) { + SaveMask(num_lock); + } else if (keysym == XK_Alt_L) { + SaveMask(alt_left); + } else if (keysym == XK_Alt_R) { + SaveMask(alt_right); + } else if (keysym == XK_Meta_L) { + SaveMask(meta_left); + } else if (keysym == XK_Meta_R) { + SaveMask(meta_right); + } } + k++; } - k++; } + XFree(theMap); } /* Don't disable any mods if "alwaysUseMods" is true. */ if (!term->misc.alwaysUseMods) { /* * If the Alt modifier is used in translations, we would rather not * use it to modify function-keys when NumLock is active. */ if ((term->misc.alt_left != 0 || term->misc.alt_right != 0) && (TranslationsUseKeyword(toplevel, "alt") || TranslationsUseKeyword((Widget) term, "alt"))) { TRACE(("ALT is used as a modifier in translations (ignore mask)\n")); term->misc.alt_left = 0; term->misc.alt_right = 0; } /* * If the Meta modifier is used in translations, we would rather not * use it to modify function-keys. Index: xc/programs/xterm/main.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/main.c,v retrieving revision 1.4 diff -u -2 -0 -r1.4 main.c --- xc/programs/xterm/main.c 20 Aug 2004 18:46:39 -0000 1.4 +++ xc/programs/xterm/main.c 6 Jan 2005 00:30:47 -0000 @@ -1,21 +1,21 @@ -/* $XTermId: main.c,v 1.396 2004/08/15 21:07:59 tom Exp $ */ +/* $XTermId: main.c,v 1.404 2004/12/01 01:27:47 tom Exp $ */ #if !defined(lint) && 0 static char *rid = "$Xorg: main.c,v 1.7 2001/02/09 02:06:02 xorgcvs Exp $"; #endif /* lint */ /* * W A R N I N G * * If you think you know what all of this code is doing, you are * probably very mistaken. There be serious and nasty dragons here. * * This client is *not* to be taken as an example of how to write X * Toolkit applications. It is in need of a substantial rewrite, * ideally to create a generic tty widget with several different parsing * widgets so that you can plug 'em together any way you want. Don't * hold your breath, though.... */ /*********************************************************** @@ -74,41 +74,41 @@ All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/xterm/main.c,v 3.185 2004/08/15 21:07:59 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/main.c,v 3.186 2004/12/01 01:27:47 dickey Exp $ */ /* main.c */ #define RES_OFFSET(field) XtOffsetOf(XTERM_RESOURCE, field) #include #include #include #if OPT_TOOLBAR #if defined(HAVE_LIB_XAW) #include #elif defined(HAVE_LIB_XAW3D) #include #elif defined(HAVE_LIB_NEXTAW) #include #elif defined(HAVE_LIB_XAWPLUS) #include @@ -266,53 +266,59 @@ #include #endif #else /* } !SYSV { */ /* BSD systems */ #ifdef __QNX__ #ifndef __QNXNTO__ #define ttyslot() 1 #else #define USE_SYSV_PGRP extern __inline__ ttyslot() { return 1; /* yuk */ } #endif #else +#ifdef __INTERIX +#define setpgrp setpgid +#endif + #ifndef linux #ifndef VMS #ifndef USE_POSIX_TERMIOS #ifndef USE_ANY_SYSV_TERMIO #include #endif #endif /* USE_POSIX_TERMIOS */ #ifdef Lynx #include #else #include #endif +#ifndef __INTERIX #define HAS_BSD_GROUPS +#endif #endif /* !VMS */ #endif /* !linux */ #endif /* __QNX__ */ #endif /* } !SYSV */ #if defined(SVR4) && !defined(__CYGWIN__) #define HAS_SAVED_IDS_AND_SETEUID #endif #ifdef linux #define HAS_SAVED_IDS_AND_SETEUID #endif /* Xpoll.h and on glibc 2.1 systems have colliding NBBY's */ #if defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1))) #ifndef NOFILE #define NOFILE OPEN_MAX #endif @@ -462,41 +468,44 @@ static Bool xterm_exiting = False; #endif /* ** Ordinarily it should be okay to omit the assignment in the following ** statement. Apparently the c89 compiler on AIX 4.1.3 has a bug, or does ** it? Without the assignment though the compiler will init command_to_exec ** to 0xffffffff instead of NULL; and subsequent usage, e.g. in spawn() to ** SEGV. */ static char **command_to_exec = NULL; #if OPT_LUIT_PROG static char **command_to_exec_with_luit = NULL; #endif #define TERMCAP_ERASE "kb" #define VAL_INITIAL_ERASE A2E(8) /* choose a nice default value for speed - if we make it too low, users who - * mistakenly use $TERM set to vt100 will get padding delays + * mistakenly use $TERM set to vt100 will get padding delays. Setting it to a + * higher value is not useful since legacy applications (termcap) that care + * about padding generally store the code in a short, which does not have + * enough bits for the extended values. */ #ifdef B38400 /* everyone should define this */ #define VAL_LINE_SPEED B38400 #else /* ...but xterm's used this for a long time */ #define VAL_LINE_SPEED B9600 #endif /* allow use of system default characters if defined and reasonable */ #ifndef CBRK #define CBRK 0 #endif #ifndef CDSUSP #define CDSUSP CONTROL('Y') #endif #ifndef CEOF #define CEOF CONTROL('D') #endif #ifndef CEOL #define CEOL 0 #endif @@ -572,41 +581,41 @@ static int d_disipline = NTTYDISC; static long int d_lmode = LCRTBS | LCRTERA | LCRTKIL | LCTLECH; #ifdef sony static long int d_jmode = KM_SYSSJIS | KM_ASCII; static struct jtchars d_jtc = { 'J', 'B' }; #endif /* sony */ #endif /* USE_ANY_SYSV_TERMIO */ #endif /* ! VMS */ /* * SYSV has the termio.c_cc[V] and ltchars; BSD has tchars and ltchars; * SVR4 has only termio.c_cc, but it includes everything from ltchars. * POSIX termios has termios.c_cc, which is similar to SVR4. */ #define TTYMODE(name) { name, sizeof(name)-1, 0, 0 } static int override_tty_modes = 0; /* *INDENT-OFF* */ -struct _xttymodes { +static struct _xttymodes { char *name; size_t len; int set; Char value; } ttymodelist[] = { TTYMODE("intr"), /* tchars.t_intrc ; VINTR */ #define XTTYMODE_intr 0 TTYMODE("quit"), /* tchars.t_quitc ; VQUIT */ #define XTTYMODE_quit 1 TTYMODE("erase"), /* sgttyb.sg_erase ; VERASE */ #define XTTYMODE_erase 2 TTYMODE("kill"), /* sgttyb.sg_kill ; VKILL */ #define XTTYMODE_kill 3 TTYMODE("eof"), /* tchars.t_eofc ; VEOF */ #define XTTYMODE_eof 4 TTYMODE("eol"), /* VEOL */ #define XTTYMODE_eol 5 TTYMODE("swtch"), /* VSWTCH */ #define XTTYMODE_swtch 6 TTYMODE("start"), /* tchars.t_startc ; VSTART */ @@ -843,42 +852,44 @@ {"+s", "*multiScroll", XrmoptionNoArg, (caddr_t) "off"}, {"-sb", "*scrollBar", XrmoptionNoArg, (caddr_t) "on"}, {"+sb", "*scrollBar", XrmoptionNoArg, (caddr_t) "off"}, #ifdef SCROLLBAR_RIGHT {"-leftbar", "*rightScrollBar", XrmoptionNoArg, (caddr_t) "off"}, {"-rightbar", "*rightScrollBar", XrmoptionNoArg, (caddr_t) "on"}, #endif {"-rvc", "*colorRVMode", XrmoptionNoArg, (caddr_t) "off"}, {"+rvc", "*colorRVMode", XrmoptionNoArg, (caddr_t) "on"}, {"-sf", "*sunFunctionKeys", XrmoptionNoArg, (caddr_t) "on"}, {"+sf", "*sunFunctionKeys", XrmoptionNoArg, (caddr_t) "off"}, {"-si", "*scrollTtyOutput", XrmoptionNoArg, (caddr_t) "off"}, {"+si", "*scrollTtyOutput", XrmoptionNoArg, (caddr_t) "on"}, {"-sk", "*scrollKey", XrmoptionNoArg, (caddr_t) "on"}, {"+sk", "*scrollKey", XrmoptionNoArg, (caddr_t) "off"}, {"-sl", "*saveLines", XrmoptionSepArg, (caddr_t) NULL}, #if OPT_SUNPC_KBD {"-sp", "*sunKeyboard", XrmoptionNoArg, (caddr_t) "on"}, {"+sp", "*sunKeyboard", XrmoptionNoArg, (caddr_t) "off"}, #endif +#if OPT_TEK4014 {"-t", "*tekStartup", XrmoptionNoArg, (caddr_t) "on"}, {"+t", "*tekStartup", XrmoptionNoArg, (caddr_t) "off"}, +#endif {"-ti", "*decTerminalID",XrmoptionSepArg, (caddr_t) NULL}, {"-tm", "*ttyModes", XrmoptionSepArg, (caddr_t) NULL}, {"-tn", "*termName", XrmoptionSepArg, (caddr_t) NULL}, #if OPT_WIDE_CHARS {"-u8", "*utf8", XrmoptionNoArg, (caddr_t) "2"}, {"+u8", "*utf8", XrmoptionNoArg, (caddr_t) "0"}, #endif #if OPT_LUIT_PROG {"-lc", "*locale", XrmoptionNoArg, (caddr_t) "on"}, {"+lc", "*locale", XrmoptionNoArg, (caddr_t) "off"}, {"-lcc", "*localeFilter",XrmoptionSepArg, (caddr_t) NULL}, {"-en", "*locale", XrmoptionSepArg, (caddr_t) NULL}, #endif {"-ulc", "*colorULMode", XrmoptionNoArg, (caddr_t) "off"}, {"+ulc", "*colorULMode", XrmoptionNoArg, (caddr_t) "on"}, {"-ut", "*utmpInhibit", XrmoptionNoArg, (caddr_t) "on"}, {"+ut", "*utmpInhibit", XrmoptionNoArg, (caddr_t) "off"}, {"-im", "*useInsertMode", XrmoptionNoArg, (caddr_t) "on"}, {"+im", "*useInsertMode", XrmoptionNoArg, (caddr_t) "off"}, {"-vb", "*visualBell", XrmoptionNoArg, (caddr_t) "on"}, @@ -1220,111 +1231,111 @@ xtermVersion(), ProgramName); printf("where options include:\n"); for (opt = list; opt->opt; opt++) { printf(" %-28s %s\n", opt->opt, opt->desc); } putchar('\n'); for (cpp = message; *cpp; cpp++) puts(*cpp); putchar('\n'); fflush(stdout); } #if defined(TIOCCONS) || defined(SRIOCSREDIR) /* ARGSUSED */ static Boolean ConvertConsoleSelection(Widget w GCC_UNUSED, Atom * selection GCC_UNUSED, Atom * target GCC_UNUSED, Atom * type GCC_UNUSED, - XtPointer * value GCC_UNUSED, + XtPointer *value GCC_UNUSED, unsigned long *length GCC_UNUSED, int *format GCC_UNUSED) { /* we don't save console output, so can't offer it */ return False; } #endif /* TIOCCONS */ #if OPT_SESSION_MGT static void die_callback(Widget w GCC_UNUSED, XtPointer client_data GCC_UNUSED, XtPointer call_data GCC_UNUSED) { Cleanup(0); } static void save_callback(Widget w GCC_UNUSED, XtPointer client_data GCC_UNUSED, XtPointer call_data) { XtCheckpointToken token = (XtCheckpointToken) call_data; /* we have nothing to save */ token->save_success = True; } #endif /* OPT_SESSION_MGT */ #if OPT_WIDE_CHARS int (*my_wcwidth) (wchar_t); #endif /* * DeleteWindow(): Action proc to implement ICCCM delete_window. */ /* ARGSUSED */ static void DeleteWindow(Widget w, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * num_params GCC_UNUSED) + Cardinal *num_params GCC_UNUSED) { #if OPT_TEK4014 if (w == toplevel) { if (term->screen.Tshow) hide_vt_window(); else do_hangup(w, (XtPointer) 0, (XtPointer) 0); } else if (term->screen.Vshow) hide_tek_window(); else #endif do_hangup(w, (XtPointer) 0, (XtPointer) 0); } /* ARGSUSED */ static void KeyboardMapping(Widget w GCC_UNUSED, XEvent * event, String * params GCC_UNUSED, - Cardinal * num_params GCC_UNUSED) + Cardinal *num_params GCC_UNUSED) { switch (event->type) { case MappingNotify: XRefreshKeyboardMapping(&event->xmapping); break; } } -XtActionsRec actionProcs[] = +static XtActionsRec actionProcs[] = { {"DeleteWindow", DeleteWindow}, {"KeyboardMapping", KeyboardMapping}, }; /* * Some platforms use names such as /dev/tty01, others /dev/pts/1. Parse off * the "tty01" or "pts/1" portion, and return that for use as an identifier for * utmp. */ static char * my_pty_name(char *device) { size_t len = strlen(device); Boolean name = False; while (len != 0) { int ch = device[len - 1]; if (isdigit(ch)) { len--; @@ -1805,41 +1816,41 @@ } #endif XtSetErrorHandler(xt_error); #if OPT_SESSION_MGT toplevel = XtOpenApplication(&app_con, my_class, optionDescList, XtNumber(optionDescList), &argc, argv, fallback_resources, sessionShellWidgetClass, NULL, 0); #else toplevel = XtAppInitialize(&app_con, my_class, optionDescList, XtNumber(optionDescList), &argc, argv, fallback_resources, NULL, 0); #endif /* OPT_SESSION_MGT */ XtSetErrorHandler((XtErrorHandler) 0); - XtGetApplicationResources(toplevel, (XtPointer) & resource, + XtGetApplicationResources(toplevel, (XtPointer) &resource, application_resources, XtNumber(application_resources), NULL, 0); TRACE_XRES(); #ifdef HAS_SAVED_IDS_AND_SETEUID if (seteuid(euid) == -1) { #ifdef __MVS__ if (!(errno == EMVSERR)) #endif (void) fprintf(stderr, "seteuid(%d): %s\n", (int) euid, strerror(errno)); } if (setegid(egid) == -1) { #ifdef __MVS__ if (!(errno == EMVSERR)) #endif (void) fprintf(stderr, "setegid(%d): %s\n", (int) egid, strerror(errno)); } @@ -3295,40 +3306,47 @@ /* * set up the tty modes */ { #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 will have bad values. Let's just get termio from the new tty and tailor it. */ if (ioctl(tty, TCGETA, &tio) == -1) SysError(ERROR_TIOCGETP); tio.c_lflag |= ECHOE; #endif /* umips */ /* Now is also the time to change the modes of the * child pty. */ /* input: nl->nl, don't ignore cr, cr->nl */ tio.c_iflag &= ~(INLCR | IGNCR); tio.c_iflag |= ICRNL; +#if OPT_WIDE_CHARS && defined(linux) && defined(IUTF8) +#if OPT_LUIT_PROG + if (command_to_exec_with_luit == 0) +#endif + if (screen->utf8_mode) + tio.c_iflag |= IUTF8; +#endif /* ouput: cr->cr, nl is not return, no delays, ln->cr/nl */ #ifndef USE_POSIX_TERMIOS tio.c_oflag &= ~(OCRNL | ONLRET | NLDLY | CRDLY | TABDLY | BSDLY | VTDLY | FFDLY); #endif /* USE_POSIX_TERMIOS */ #ifdef ONLCR tio.c_oflag |= ONLCR; #endif /* ONLCR */ #ifdef OPOST tio.c_oflag |= OPOST; #endif /* OPOST */ #ifndef USE_POSIX_TERMIOS # if defined(Lynx) && !defined(CBAUD) @@ -4195,41 +4213,42 @@ case PTY_FATALERROR: errno = handshake.error; close(cp_pipe[0]); close(pc_pipe[1]); SysError(handshake.fatal_error); /*NOTREACHED */ case UTMP_ADDED: /* The utmp entry was set by our slave. Remember * this so that we can reset it later. */ added_utmp_entry = True; #ifndef USE_SYSV_UTMP tslot = handshake.tty_slot; #endif /* USE_SYSV_UTMP */ free(ttydev); ttydev = x_strdup(handshake.buffer); break; default: fprintf(stderr, "%s: unexpected handshake status %d\n", - xterm_name, handshake.status); + xterm_name, + (int) handshake.status); } } /* close our sides of the pipes */ if (!waiting_for_initial_map) { close(cp_pipe[0]); close(pc_pipe[1]); } } #endif /* OPT_PTY_HANDSHAKE */ } /* end if no slave */ /* * still in parent (xterm process) */ #ifdef USE_SYSV_SIGHUP /* hung sh problem? */ signal(SIGHUP, SIG_DFL); #else signal(SIGHUP, SIG_IGN); @@ -4376,40 +4395,66 @@ write(wfd, (char *) &utmp, sizeof(utmp)); close(wfd); } #endif /* WTMP */ } #endif /* USE_SYSV_UTMP */ #endif /* HAVE_UTMP */ close(screen->respond); /* close explicitly to avoid race with slave side */ #ifdef ALLOWLOGGING if (screen->logging) CloseLog(screen); #endif if (am_slave < 0) { /* restore ownership of tty and pty */ set_owner(ttydev, 0, 0, 0666); #if (defined(USE_PTY_DEVICE) && !defined(__sgi) && !defined(__hpux)) set_owner(ptydev, 0, 0, 0666); #endif } +#if OPT_TRACE || defined(NO_LEAKS) + if (n == 0) { + TRACE(("Freeing memory leaks\n")); + if (term != 0) { + Display *dpy = term->screen.display; + + if (term->screen.sbuf_address) { + free(term->screen.sbuf_address); + TRACE(("freed screen.sbuf_address\n")); + } + if (term->screen.allbuf) { + free(term->screen.allbuf); + TRACE(("freed screen.allbuf\n")); + } + if (term->screen.xim) { + XCloseIM(term->screen.xim); + TRACE(("freed screen.xim\n")); + } + if (toplevel) + XtDestroyWidget(toplevel); + XtCloseDisplay(dpy); + } + TRACE((0)); + } +#endif + exit(n); SIGNAL_RETURN; } /* ARGSUSED */ static void resize(TScreen * screen, register char *oldtc, char *newtc) { #ifndef USE_SYSV_ENVVARS register char *ptr1, *ptr2; register size_t i; register int li_first = 0; register char *temp; TRACE(("resize %s\n", oldtc)); if ((ptr1 = x_strindex(oldtc, "co#")) == NULL) { strcat(oldtc, "co#80:"); ptr1 = x_strindex(oldtc, "co#"); } if ((ptr2 = x_strindex(oldtc, "li#")) == NULL) { Index: xc/programs/xterm/main.h =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/main.h,v retrieving revision 1.3 diff -u -2 -0 -r1.3 main.h --- xc/programs/xterm/main.h 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/main.h 6 Jan 2005 00:30:47 -0000 @@ -1,64 +1,64 @@ -/* $XTermId: main.h,v 1.25 2004/07/13 00:41:29 tom Exp $ */ +/* $XTermId: main.h,v 1.27 2004/12/01 01:27:47 tom Exp $ */ /* * $Xorg: main.h,v 1.3 2000/08/17 19:55:09 cpqbld Exp $ */ -/* $XFree86: xc/programs/xterm/main.h,v 3.11 2004/07/13 00:41:29 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/main.h,v 3.12 2004/12/01 01:27:47 dickey Exp $ */ /* * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appear in all copies and that * both that copyright notice and this permission notice appear in * supporting documentation, and that the name of Digital Equipment * Corporation not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior permission. * * * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ #ifndef included_main_h #define included_main_h #include #define DEFCLASS "XTerm" #define DEFFONT "fixed" #define DEFWIDEFONT NULL /* grab one which is 2x as wide */ #define DEFWIDEBOLDFONT NULL #define DEFXIMFONT "*" #define DEFBOLDFONT NULL /* no bold font uses overstriking */ #define DEFBORDER 2 #define DEFFACENAME NULL -#define DEFFACESIZE 14 +#define DEFFACESIZE "14.0" #if OPT_BLINK_TEXT #define DEFBLINKASBOLD FALSE #else #define DEFBLINKASBOLD TRUE #endif #ifndef DEFDELETE_DEL #define DEFDELETE_DEL 2 #endif #ifndef DEF_BACKARO_ERASE #define DEF_BACKARO_ERASE FALSE #endif #ifndef DEF_COLOR4 #define DEF_COLOR4 "blue2" /* see XTerm-col.ad */ #endif #ifndef DEF_COLOR12 Index: xc/programs/xterm/menu.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/menu.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 menu.c --- xc/programs/xterm/menu.c 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/menu.c 6 Jan 2005 00:30:48 -0000 @@ -1,21 +1,21 @@ -/* $XTermId: menu.c,v 1.145 2004/05/30 23:59:41 tom Exp $ */ +/* $XTermId: menu.c,v 1.150 2004/12/01 01:27:47 tom Exp $ */ /* $Xorg: menu.c,v 1.4 2001/02/09 02:06:03 xorgcvs Exp $ */ /* Copyright 1999-2003,2004 by Thomas E. Dickey All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE @@ -30,41 +30,41 @@ documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/xterm/menu.c,v 3.56 2004/06/06 22:15:25 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/menu.c,v 3.57 2004/12/01 01:27:47 dickey Exp $ */ #include #include #include #include #include #define app_con Xaw_app_con /* quiet a warning from SimpleMenu.h */ #if defined(HAVE_LIB_XAW) #include #include #include #include #if OPT_TOOLBAR #include #include @@ -199,48 +199,55 @@ #if OPT_TEK4014 static void do_tekcopy PROTO_XT_CALLBACK_ARGS; static void do_tekhide PROTO_XT_CALLBACK_ARGS; static void do_tekmode PROTO_XT_CALLBACK_ARGS; static void do_tekonoff PROTO_XT_CALLBACK_ARGS; static void do_tekpage PROTO_XT_CALLBACK_ARGS; static void do_tekreset PROTO_XT_CALLBACK_ARGS; static void do_tekshow PROTO_XT_CALLBACK_ARGS; static void do_tektext2 PROTO_XT_CALLBACK_ARGS; static void do_tektext3 PROTO_XT_CALLBACK_ARGS; static void do_tektextlarge PROTO_XT_CALLBACK_ARGS; static void do_tektextsmall PROTO_XT_CALLBACK_ARGS; static void do_vthide PROTO_XT_CALLBACK_ARGS; static void do_vtmode PROTO_XT_CALLBACK_ARGS; static void do_vtonoff PROTO_XT_CALLBACK_ARGS; static void do_vtshow PROTO_XT_CALLBACK_ARGS; static void handle_tekshow (Widget gw, Bool allowswitch); static void handle_vtshow (Widget gw, Bool allowswitch); #endif +#if OPT_TOOLBAR +static void do_toolbar PROTO_XT_CALLBACK_ARGS; +#endif + #if OPT_WIDE_CHARS static void do_font_utf8_mode PROTO_XT_CALLBACK_ARGS; #endif /* * The order of entries MUST match the values given in menu.h */ MenuEntry mainMenuEntries[] = { +#if OPT_TOOLBAR + { "toolbar", do_toolbar, NULL }, +#endif { "securekbd", do_securekbd, NULL }, { "allowsends", do_allowsends, NULL }, { "redraw", do_redraw, NULL }, { "line1", NULL, NULL }, #ifdef ALLOWLOGGING { "logging", do_logging, NULL }, #endif { "print", do_print, NULL }, { "print-redirect", do_print_redir, NULL }, { "line2", NULL, NULL }, { "8-bit control", do_8bit_control,NULL }, { "backarrow key", do_backarrow, NULL }, #if OPT_NUM_LOCK { "num-lock", do_num_lock, NULL }, { "meta-esc", do_meta_esc, NULL }, #endif { "delete-is-del", do_delete_del, NULL }, { "oldFunctionKeys",do_old_fkeys, NULL }, #if OPT_HP_FUNC_KEYS { "hpFunctionKeys", do_hp_fkeys, NULL }, @@ -503,68 +510,69 @@ #if OPT_TEK4014 case 't': me = tekMenu; break; #endif default: me = noMenu; } return (me); } /* * public interfaces */ /* ARGSUSED */ static Bool domenu(Widget w GCC_UNUSED, XEvent * event GCC_UNUSED, String * params, /* mainMenu, vtMenu, or tekMenu */ - Cardinal * param_count) /* 0 or 1 */ + Cardinal *param_count) /* 0 or 1 */ { TScreen *screen = &term->screen; MenuIndex me; Boolean created = False; Widget mw; if (*param_count != 1) { Bell(XkbBI_MinorError, 0); return False; } if ((me = indexOfMenu(params[0])) == noMenu) { Bell(XkbBI_MinorError, 0); return False; } if ((mw = obtain_menu(w, me)) == 0 || sizeof_menu(w, me) == 0) { mw = create_menu(w, term, me); created = (mw != 0); } if (mw == 0) return False; switch (me) { case mainMenu: if (created) { + update_toolbar(); update_securekbd(); update_allowsends(); update_logging(); update_print_redir(); update_8bit_control(); update_decbkm(); update_num_lock(); update_meta_esc(); update_delete_del(); update_keyboard_type(); if (screen->terminal_id < 200) { set_sensitivity(mw, mainMenuEntries[mainMenu_8bit_ctrl].widget, FALSE); } #if !defined(SIGTSTP) set_sensitivity(mw, mainMenuEntries[mainMenu_suspend].widget, FALSE); #endif #if !defined(SIGCONT) @@ -676,50 +684,50 @@ #if OPT_TEK4014 case tekMenu: if (created) { set_tekfont_menu_item(screen->cur.fontsize, TRUE); update_vtshow(); } break; #endif default: break; } return True; } void HandleCreateMenu(Widget w, XEvent * event, String * params, /* mainMenu, vtMenu, or tekMenu */ - Cardinal * param_count) /* 0 or 1 */ + Cardinal *param_count) /* 0 or 1 */ { (void) domenu(w, event, params, param_count); } void HandlePopupMenu(Widget w, XEvent * event, String * params, /* mainMenu, vtMenu, or tekMenu */ - Cardinal * param_count) /* 0 or 1 */ + Cardinal *param_count) /* 0 or 1 */ { if (domenu(w, event, params, param_count)) { #if OPT_TOOLBAR w = select_menu(w, mainMenu)->w; #endif XtCallActionProc(w, "XawPositionSimpleMenu", event, params, 1); XtCallActionProc(w, "MenuPopup", event, params, 1); } } /* * private interfaces - keep out! */ /* ARGSUSED */ static void handle_send_signal(Widget gw GCC_UNUSED, int sig) { #ifndef VMS register TScreen *screen = &term->screen; @@ -1539,114 +1547,114 @@ if (var) (*proc) (w, closure, data); else Bell(XkbBI_MinorError, 0); break; case 1: if (!var) (*proc) (w, closure, data); else Bell(XkbBI_MinorError, 0); break; } return; } void HandleAllowSends(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_allowsends, (int) term->screen.allowSendEvents, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleSetVisualBell(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_visualbell, (int) term->screen.visualbell, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleSetPopOnBell(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_poponbell, (int) term->screen.poponbell, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } #ifdef ALLOWLOGGING void HandleLogging(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_logging, (int) term->screen.logging, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } #endif /* ARGSUSED */ void HandlePrintScreen(Widget w, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * param_count GCC_UNUSED) + Cardinal *param_count GCC_UNUSED) { do_print(w, (XtPointer) 0, (XtPointer) 0); } /* ARGSUSED */ void HandlePrintControlMode(Widget w, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * param_count GCC_UNUSED) + Cardinal *param_count GCC_UNUSED) { do_print_redir(w, (XtPointer) 0, (XtPointer) 0); } /* ARGSUSED */ void HandleRedraw(Widget w, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * param_count GCC_UNUSED) + Cardinal *param_count GCC_UNUSED) { do_redraw(w, (XtPointer) 0, (XtPointer) 0); } /* ARGSUSED */ void HandleSendSignal(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { /* *INDENT-OFF* */ static struct sigtab { char *name; int sig; } signals[] = { #ifdef SIGTSTP { "suspend", SIGTSTP }, { "tstp", SIGTSTP }, #endif #ifdef SIGCONT { "cont", SIGCONT }, #endif { "int", SIGINT }, { "hup", SIGHUP }, { "quit", SIGQUIT }, { "alrm", SIGALRM }, { "alarm", SIGALRM }, { "term", SIGTERM }, { "kill", SIGKILL }, @@ -1657,527 +1665,527 @@ if (*param_count == 1) { struct sigtab *st; for (st = signals; st->name; st++) { if (XmuCompareISOLatin1(st->name, params[0]) == 0) { handle_send_signal(w, st->sig); return; } } /* one could allow numeric values, but that would be a security hole */ } Bell(XkbBI_MinorError, 0); } /* ARGSUSED */ void HandleQuit(Widget w, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * param_count GCC_UNUSED) + Cardinal *param_count GCC_UNUSED) { do_quit(w, (XtPointer) 0, (XtPointer) 0); } void Handle8BitControl(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_8bit_control, (int) term->screen.control_eight_bits, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleBackarrow(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_backarrow, (int) term->keyboard.flags & MODE_DECBKM, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleSunFunctionKeys(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_sun_fkeys, term->keyboard.type == keyboardIsSun, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } #if OPT_NUM_LOCK void HandleNumLock(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_num_lock, (int) term->misc.real_NumLock, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleMetaEsc(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_meta_esc, (int) term->screen.meta_sends_esc, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } #endif void HandleDeleteIsDEL(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_delete_del, term->screen.delete_is_del, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleOldFunctionKeys(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_old_fkeys, term->keyboard.type == keyboardIsLegacy, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } #if OPT_SUNPC_KBD void HandleSunKeyboard(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_sun_kbd, term->keyboard.type == keyboardIsVT220, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } #endif #if OPT_HP_FUNC_KEYS void HandleHpFunctionKeys(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_hp_fkeys, term->keyboard.type == keyboardIsHP, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } #endif #if OPT_SCO_FUNC_KEYS void HandleScoFunctionKeys(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_sco_fkeys, term->keyboard.type == keyboardIsSCO, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } #endif void HandleScrollbar(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_scrollbar, (int) term->screen.fullVwin.sb_info.width, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleJumpscroll(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_jumpscroll, (int) term->screen.jumpscroll, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleReverseVideo(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_reversevideo, (int) (term->misc.re_verse0), params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleAutoWrap(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_autowrap, (int) (term->flags & WRAPAROUND), params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleReverseWrap(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_reversewrap, (int) (term->flags & REVERSEWRAP), params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleAutoLineFeed(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_autolinefeed, (int) (term->flags & LINEFEED), params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleAppCursor(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_appcursor, (int) (term->keyboard.flags & MODE_DECCKM), params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleAppKeypad(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_appkeypad, (int) (term->keyboard.flags & MODE_DECKPAM), params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleScrollKey(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_scrollkey, (int) term->screen.scrollkey, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleScrollTtyOutput(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_scrollttyoutput, (int) term->screen.scrollttyoutput, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleAllow132(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_allow132, (int) term->screen.c132, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleCursesEmul(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_cursesemul, (int) term->screen.curses, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleMarginBell(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_marginbell, (int) term->screen.marginbell, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } #if OPT_BLINK_CURS void HandleCursorBlink(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { /* eventually want to see if sensitive or not */ handle_toggle(do_cursorblink, (int) term->screen.cursor_blink, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } #endif void HandleAltScreen(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { /* eventually want to see if sensitive or not */ handle_toggle(do_altscreen, (int) term->screen.alternate, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } void HandleTiteInhibit(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { /* eventually want to see if sensitive or not */ handle_toggle(do_titeInhibit, !((int) term->misc.titeInhibit), params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } /* ARGSUSED */ void HandleSoftReset(Widget w, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * param_count GCC_UNUSED) + Cardinal *param_count GCC_UNUSED) { do_softreset(w, (XtPointer) 0, (XtPointer) 0); } /* ARGSUSED */ void HandleHardReset(Widget w, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * param_count GCC_UNUSED) + Cardinal *param_count GCC_UNUSED) { do_hardreset(w, (XtPointer) 0, (XtPointer) 0); } /* ARGSUSED */ void HandleClearSavedLines(Widget w, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * param_count GCC_UNUSED) + Cardinal *param_count GCC_UNUSED) { do_clearsavedlines(w, (XtPointer) 0, (XtPointer) 0); } #if OPT_DEC_CHRSET void HandleFontDoublesize(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_font_doublesize, (int) term->screen.font_doublesize, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } #endif #if OPT_BOX_CHARS void HandleFontBoxChars(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_font_boxchars, (int) term->screen.force_box_chars, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } #endif #if OPT_DEC_SOFTFONT void HandleFontLoading(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_font_loadable, (int) term->misc.font_loadable, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } #endif #if OPT_RENDERFONT void HandleRenderFont(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_font_renderfont, term->misc.render_font, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } #endif #if OPT_WIDE_CHARS void HandleUTF8Mode(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { handle_toggle(do_font_utf8_mode, term->screen.utf8_mode, params, *param_count, w, (XtPointer) 0, (XtPointer) 0); } #endif #if OPT_TEK4014 void HandleSetTerminalType(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { if (*param_count == 1) { switch (params[0][0]) { case 'v': case 'V': if (term->screen.TekEmu) do_vtmode(w, (XtPointer) 0, (XtPointer) 0); break; case 't': case 'T': if (!term->screen.TekEmu) do_tekmode(w, (XtPointer) 0, (XtPointer) 0); break; default: Bell(XkbBI_MinorError, 0); } } else { Bell(XkbBI_MinorError, 0); } } void HandleVisibility(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { if (*param_count == 2) { switch (params[0][0]) { case 'v': case 'V': handle_toggle(do_vtonoff, (int) term->screen.Vshow, params + 1, (*param_count) - 1, w, (XtPointer) 0, (XtPointer) 0); break; case 't': case 'T': handle_toggle(do_tekonoff, (int) term->screen.Tshow, params + 1, (*param_count) - 1, w, (XtPointer) 0, (XtPointer) 0); break; default: Bell(XkbBI_MinorError, 0); } } else { Bell(XkbBI_MinorError, 0); } } /* ARGSUSED */ void HandleSetTekText(Widget w, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { void (*proc) PROTO_XT_CALLBACK_ARGS = 0; switch (*param_count) { case 0: proc = do_tektextlarge; break; case 1: switch (params[0][0]) { case 'l': case 'L': proc = do_tektextlarge; break; case '2': proc = do_tektext2; break; case '3': proc = do_tektext3; break; case 's': case 'S': proc = do_tektextsmall; break; } break; } if (proc) (*proc) (w, (XtPointer) 0, (XtPointer) 0); else Bell(XkbBI_MinorError, 0); } /* ARGSUSED */ void HandleTekPage(Widget w, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * param_count GCC_UNUSED) + Cardinal *param_count GCC_UNUSED) { do_tekpage(w, (XtPointer) 0, (XtPointer) 0); } /* ARGSUSED */ void HandleTekReset(Widget w, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * param_count GCC_UNUSED) + Cardinal *param_count GCC_UNUSED) { do_tekreset(w, (XtPointer) 0, (XtPointer) 0); } /* ARGSUSED */ void HandleTekCopy(Widget w, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * param_count GCC_UNUSED) + Cardinal *param_count GCC_UNUSED) { do_tekcopy(w, (XtPointer) 0, (XtPointer) 0); } #endif /* OPT_TEK4014 */ void UpdateMenuItem(Widget mi, XtArgVal val) { static Arg menuArgs = {XtNleftBitmap, (XtArgVal) 0}; if (mi) { menuArgs.value = (XtArgVal) ((val) ? term->screen.menu_item_bitmap : None); XtSetValues(mi, &menuArgs, (Cardinal) 1); } } void @@ -2200,77 +2208,77 @@ * since the menu is already managed when this callback is invoked. */ static void InitPopup(Widget gw, XtPointer closure, XtPointer data GCC_UNUSED) { String params[2]; Cardinal count = 1; params[0] = closure; params[1] = 0; TRACE(("InitPopup(%s)\n", params[0])); domenu(gw, (XEvent *) 0, params, &count); XtRemoveCallback(gw, XtNpopupCallback, InitPopup, closure); } static void -SetupShell(Widget * menus, MenuList * shell, Widget * menu_tops, int n, int m) +SetupShell(Widget *menus, MenuList * shell, Widget *menu_tops, int n, int m) { char temp[80]; char *external_name = 0; shell[n].w = XtVaCreatePopupShell(menu_names[n].internal_name, simpleMenuWidgetClass, *menus, XtNgeometry, NULL, (XtPointer) 0); XtAddCallback(shell[n].w, XtNpopupCallback, InitPopup, menu_names[n].internal_name); XtVaGetValues(shell[n].w, XtNlabel, &external_name, (XtPointer) 0); TRACE(("...SetupShell(%s) -> %s -> %#lx\n", menu_names[n].internal_name, external_name, (long) shell[n].w)); sprintf(temp, "%sButton", menu_names[n].internal_name); menu_tops[n] = XtVaCreateManagedWidget(temp, menuButtonWidgetClass, *menus, XtNfromHoriz, ((m >= 0) ? menu_tops[m] : 0), XtNmenuName, menu_names[n].internal_name, XtNlabel, external_name, (XtPointer) 0); } #endif void -SetupMenus(Widget shell, Widget * forms, Widget * menus) +SetupMenus(Widget shell, Widget *forms, Widget *menus) { #if OPT_TOOLBAR int n; Widget menu_tops[NUM_POPUP_MENUS]; #endif TRACE(("SetupMenus(%s)\n", shell == toplevel ? "vt100" : "tek4014")); if (shell == toplevel) { XawSimpleMenuAddGlobalActions(app_con); XtRegisterGrabAction(HandlePopupMenu, True, (ButtonPressMask | ButtonReleaseMask), GrabModeAsync, GrabModeAsync); } #if OPT_TOOLBAR *forms = XtVaCreateManagedWidget("form", formWidgetClass, shell, (XtPointer) 0); xtermAddInput(*forms); @@ -2310,42 +2318,134 @@ TRACE(("...forms=%#lx\n", (long) *forms)); TRACE(("...menus=%#lx\n", (long) *menus)); } #if OPT_TOOLBAR void SetupToolbar(Widget shell) { int n; if (shell == toplevel) { /* vt100 */ for (n = mainMenu; n <= fontMenu; n++) { InitPopup(vt_shell[n].w, menu_names[n].internal_name, 0); } } #if OPT_TEK4014 else { /* tek4014 */ InitPopup(tek_shell[mainMenu].w, menu_names[mainMenu].internal_name, 0); InitPopup(tek_shell[tekMenu].w, menu_names[tekMenu].internal_name, 0); } #endif + term->screen.toolbars = True; + update_toolbar(); } -#endif + +static TbInfo * +toolbar_info(Widget w) +{ + return ((w == (Widget) term) + ? &(WhichVWin(&(term->screen))->tb_info) + : &(tekWidget->tek.tb_info)); +} + +static void +hide_toolbar(Widget w) +{ + if (w != 0) { + TbInfo *info = toolbar_info(w); + + if (info->menu_bar != 0) { + if (XtIsRealized(info->menu_bar)) + XtUnmapWidget(info->menu_bar); + } + XtVaSetValues(w, + XtNfromVert, (Widget) 0, + (XtPointer) 0); + } +} + +static void +show_toolbar(Widget w) +{ + if (w != 0) { + TbInfo *info = toolbar_info(w); + + if (info->menu_bar != 0) { + if (XtIsRealized(info->menu_bar)) + XtMapWidget(info->menu_bar); + } + XtVaSetValues(w, + XtNfromVert, info->menu_bar, + (XtPointer) 0); + /* + * This is needed to make the terminal widget move down below the + * toolbar. + */ + XawFormDoLayout(XtParent(w), True); + } +} + +void +ShowToolbar(Boolean enable) +{ + if (enable) { + show_toolbar((Widget) term); + show_toolbar((Widget) tekWidget); + } else { + hide_toolbar((Widget) term); + hide_toolbar((Widget) tekWidget); + } +} + +void +HandleToolbar(Widget w, + XEvent * event GCC_UNUSED, + String * params GCC_UNUSED, + Cardinal *param_count GCC_UNUSED) +{ + handle_toggle(do_toolbar, (int) term->screen.toolbars, + params, *param_count, w, (XtPointer) 0, (XtPointer) 0); +} + +/* ARGSUSED */ +static void +do_toolbar(Widget gw GCC_UNUSED, + XtPointer closure GCC_UNUSED, + XtPointer data GCC_UNUSED) +{ + /* + * Toggle toolbars for both vt100 and tek windows, since they share the + * menu which contains the checkbox indicating whether the toolbar is + * active. + */ + ShowToolbar(term->screen.toolbars = !term->screen.toolbars); + update_toolbar(); +} + +void +update_toolbar(void) +{ + update_menu_item(term->screen.mainMenu, + mainMenuEntries[mainMenu_toolbar].widget, + term->screen.toolbars); +} +#endif /* OPT_TOOLBAR */ void update_securekbd(void) { update_menu_item(term->screen.mainMenu, mainMenuEntries[mainMenu_securekbd].widget, term->screen.grabbedKbd); } void update_allowsends(void) { update_menu_item(term->screen.mainMenu, mainMenuEntries[mainMenu_allowsends].widget, term->screen.allowSendEvents); } #ifdef ALLOWLOGGING void update_logging(void) Index: xc/programs/xterm/menu.h =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/menu.h,v retrieving revision 1.3 diff -u -2 -0 -r1.3 menu.h --- xc/programs/xterm/menu.h 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/menu.h 6 Jan 2005 00:30:48 -0000 @@ -1,21 +1,21 @@ -/* $XTermId: menu.h,v 1.82 2004/05/13 00:41:21 tom Exp $ */ +/* $XTermId: menu.h,v 1.86 2004/12/01 01:27:47 tom Exp $ */ /* $Xorg: menu.h,v 1.4 2001/02/09 02:06:03 xorgcvs Exp $ */ /* Copyright 1999-2001,2004 by Thomas E. Dickey All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE @@ -33,41 +33,41 @@ copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/xterm/menu.h,v 3.33 2004/05/13 00:41:21 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/menu.h,v 3.34 2004/12/01 01:27:47 dickey Exp $ */ #ifndef included_menu_h #define included_menu_h #include #include typedef struct _MenuEntry { char *name; void (*function) PROTO_XT_CALLBACK_ARGS; Widget widget; } MenuEntry; extern MenuEntry mainMenuEntries[], vtMenuEntries[]; extern MenuEntry fontMenuEntries[]; #if OPT_TEK4014 extern MenuEntry tekMenuEntries[]; #endif @@ -103,59 +103,64 @@ extern void HandleRedraw PROTO_XT_ACTIONS_ARGS; extern void HandleRenderFont PROTO_XT_ACTIONS_ARGS; extern void HandleReverseVideo PROTO_XT_ACTIONS_ARGS; extern void HandleReverseWrap PROTO_XT_ACTIONS_ARGS; extern void HandleScoFunctionKeys PROTO_XT_ACTIONS_ARGS; extern void HandleScrollKey PROTO_XT_ACTIONS_ARGS; extern void HandleScrollTtyOutput PROTO_XT_ACTIONS_ARGS; extern void HandleScrollbar PROTO_XT_ACTIONS_ARGS; extern void HandleSendSignal PROTO_XT_ACTIONS_ARGS; extern void HandleSetPopOnBell PROTO_XT_ACTIONS_ARGS; extern void HandleSetTekText PROTO_XT_ACTIONS_ARGS; extern void HandleSetTerminalType PROTO_XT_ACTIONS_ARGS; extern void HandleSetVisualBell PROTO_XT_ACTIONS_ARGS; extern void HandleSoftReset PROTO_XT_ACTIONS_ARGS; extern void HandleSunFunctionKeys PROTO_XT_ACTIONS_ARGS; extern void HandleSunKeyboard PROTO_XT_ACTIONS_ARGS; extern void HandleTekCopy PROTO_XT_ACTIONS_ARGS; extern void HandleTekPage PROTO_XT_ACTIONS_ARGS; extern void HandleTekReset PROTO_XT_ACTIONS_ARGS; extern void HandleTiteInhibit PROTO_XT_ACTIONS_ARGS; +extern void HandleToolbar PROTO_XT_ACTIONS_ARGS; extern void HandleUTF8Mode PROTO_XT_ACTIONS_ARGS; extern void HandleVisibility PROTO_XT_ACTIONS_ARGS; extern void DoSecureKeyboard (Time tp); extern void SetupMenus (Widget shell, Widget *forms, Widget *menus); #if OPT_TOOLBAR -extern void SetupToolbar(Widget shell); +extern void SetupToolbar(Widget); +extern void ShowToolbar(Boolean); #endif /* * The following definitions MUST match the order of entries given in * the mainMenuEntries, vtMenuEntries, and tekMenuEntries arrays in menu.c. */ /* * items in primary menu */ typedef enum { +#if OPT_TOOLBAR + mainMenu_toolbar, +#endif mainMenu_securekbd, mainMenu_allowsends, mainMenu_redraw, mainMenu_line1, #ifdef ALLOWLOGGING mainMenu_logging, #endif mainMenu_print, mainMenu_print_redir, mainMenu_line2, mainMenu_8bit_ctrl, mainMenu_backarrow, #if OPT_NUM_LOCK mainMenu_num_lock, mainMenu_meta_esc, #endif mainMenu_delete_del, mainMenu_old_fkeys, #if OPT_HP_FUNC_KEYS mainMenu_hp_fkeys, @@ -281,40 +286,46 @@ tekMenu_vtmode, tekMenu_tekhide, tekMenu_LAST } tekMenuIndices; #endif /* * macros for updating menus */ #define update_menu_item(w,mi,val) UpdateMenuItem(mi,val) extern void UpdateMenuItem(Widget mi, XtArgVal val); #define set_sensitivity(w,mi,val) SetItemSensitivity(mi,val) extern void SetItemSensitivity(Widget mi, XtArgVal val); /* * there should be one of each of the following for each checkable item */ +#if OPT_TOOLBAR +extern void update_toolbar(void); +#else +#define update_toolbar() /* nothing */ +#endif + extern void update_securekbd(void); extern void update_allowsends(void); #ifdef ALLOWLOGGING extern void update_logging(void); #else #define update_logging() /*nothing*/ #endif extern void update_print_redir(void); extern void update_8bit_control(void); extern void update_decbkm(void); #if OPT_NUM_LOCK extern void update_num_lock(void); extern void update_meta_esc(void); #else #define update_num_lock() /*nothing*/ #define update_meta_esc() /*nothing*/ #endif Index: xc/programs/xterm/misc.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/misc.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 misc.c --- xc/programs/xterm/misc.c 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/misc.c 6 Jan 2005 00:30:50 -0000 @@ -1,31 +1,31 @@ -/* $XTermId: misc.c,v 1.231 2004/07/28 00:53:26 tom Exp $ */ +/* $XTermId: misc.c,v 1.235 2004/12/01 01:27:47 tom Exp $ */ /* * $Xorg: misc.c,v 1.3 2000/08/17 19:55:09 cpqbld Exp $ */ -/* $XFree86: xc/programs/xterm/misc.c,v 3.92 2004/07/28 00:53:26 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/misc.c,v 3.93 2004/12/01 01:27:47 dickey Exp $ */ /* * - * Copyright 1999-2002,2003 by Thomas E. Dickey + * Copyright 1999-2003,2004 by Thomas E. Dickey * * All Rights Reserved * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE @@ -220,73 +220,73 @@ unsigned long fg, /* pixel value */ unsigned long bg) /* pixel value */ { register TScreen *screen = &term->screen; Cursor c; register Display *dpy = screen->display; c = XCreateFontCursor(dpy, cursorindex); if (c == (Cursor) 0) return (c); recolor_cursor(c, fg, bg); return (c); } /* ARGSUSED */ void HandleKeyPressed(Widget w GCC_UNUSED, XEvent * event, String * params GCC_UNUSED, - Cardinal * nparams GCC_UNUSED) + Cardinal *nparams GCC_UNUSED) { register TScreen *screen = &term->screen; TRACE(("Handle 7bit-key\n")); #ifdef ACTIVEWINDOWINPUTONLY if (w == CURRENT_EMU(screen)) #endif Input(&term->keyboard, screen, &event->xkey, False); } /* ARGSUSED */ void HandleEightBitKeyPressed(Widget w GCC_UNUSED, XEvent * event, String * params GCC_UNUSED, - Cardinal * nparams GCC_UNUSED) + Cardinal *nparams GCC_UNUSED) { register TScreen *screen = &term->screen; TRACE(("Handle 8bit-key\n")); #ifdef ACTIVEWINDOWINPUTONLY if (w == CURRENT_EMU(screen)) #endif Input(&term->keyboard, screen, &event->xkey, True); } /* ARGSUSED */ void HandleStringEvent(Widget w GCC_UNUSED, XEvent * event GCC_UNUSED, String * params, - Cardinal * nparams) + Cardinal *nparams) { register TScreen *screen = &term->screen; #ifdef ACTIVEWINDOWINPUTONLY if (w != CURRENT_EMU(screen)) return; #endif if (*nparams != 1) return; if ((*params)[0] == '0' && (*params)[1] == 'x' && (*params)[2] != '\0') { Char c, *p; Char hexval[2]; hexval[0] = hexval[1] = 0; for (p = (Char *) (*params + 2); (c = *p); p++) { hexval[0] *= 16; if (isupper(c)) c = tolower(c); if (c >= '0' && c <= '9') @@ -303,41 +303,41 @@ } } /* * Rather than sending characters to the host, put them directly into our * input queue. That lets a user have access to any of the control sequences * for a key binding. This is the equivalent of local function key support. * * NOTE: This code does not support the hexadecimal kludge used in * HandleStringEvent because it prevents us from sending an arbitrary string * (but it appears in a lot of examples - so we are stuck with it). The * standard string converter does recognize "\" for newline ("\n") and for * octal constants (e.g., "\007" for BEL). So we assume the user can make do * without a specialized converter. (Don't try to use \000, though). */ /* ARGSUSED */ void HandleInterpret(Widget w GCC_UNUSED, XEvent * event GCC_UNUSED, String * params, - Cardinal * param_count) + Cardinal *param_count) { if (*param_count == 1) { char *value = params[0]; int need = strlen(value); int used = VTbuffer.next - VTbuffer.buffer; int have = VTbuffer.last - VTbuffer.buffer; if (have - used + need < (int) sizeof(VTbuffer.buffer)) { fillPtyData(&term->screen, &VTbuffer, value, (int) strlen(value)); TRACE(("Interpret %s\n", value)); VTbuffer.update++; } } } static void DoSpecialEnterNotify(register XEnterWindowEvent * ev) { @@ -712,69 +712,69 @@ } memmove(copybuffer + del_cnt, expansion + hint_len, strlen(expansion) - hint_len); v_write(pty, copybuffer, buf_cnt); screen->dabbrev_working = 1; /* v_write() just set it to 1 */ free(copybuffer); free(lastexpansion); lastexpansion = strdup(expansion); if (!lastexpansion) return 0; return 1; } /*ARGSUSED*/ void HandleDabbrevExpand(Widget gw, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * nparams GCC_UNUSED) + Cardinal *nparams GCC_UNUSED) { XtermWidget w = (XtermWidget) gw; TScreen *screen = &w->screen; if (!dabbrev_expand(screen)) Bell(XkbBI_TerminalBell, 0); } #endif /* OPT_DABBREV */ #if OPT_MAXIMIZE /*ARGSUSED*/ void HandleDeIconify(Widget gw, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * nparams GCC_UNUSED) + Cardinal *nparams GCC_UNUSED) { if (IsXtermWidget(gw)) { register TScreen *screen = &((XtermWidget) gw)->screen; XMapWindow(screen->display, VShellWindow); } } /*ARGSUSED*/ void HandleIconify(Widget gw, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * nparams GCC_UNUSED) + Cardinal *nparams GCC_UNUSED) { if (IsXtermWidget(gw)) { register TScreen *screen = &((XtermWidget) gw)->screen; XIconifyWindow(screen->display, VShellWindow, DefaultScreen(screen->display)); } } int QueryMaximize(TScreen * screen, unsigned *width, unsigned *height) { XSizeHints hints; long supp = 0; Window root_win; int root_x = -1; /* saved co-ordinates */ int root_y = -1; unsigned root_border; unsigned root_depth; @@ -873,53 +873,53 @@ screen->restore_y, screen->restore_width, screen->restore_height)); screen->restore_data = False; XMoveResizeWindow(screen->display, VShellWindow, screen->restore_x, screen->restore_y, screen->restore_width, screen->restore_height); } } } /*ARGSUSED*/ void HandleMaximize(Widget gw, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * nparams GCC_UNUSED) + Cardinal *nparams GCC_UNUSED) { if (IsXtermWidget(gw)) { RequestMaximize((XtermWidget) gw, 1); } } /*ARGSUSED*/ void HandleRestoreSize(Widget gw, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * nparams GCC_UNUSED) + Cardinal *nparams GCC_UNUSED) { if (IsXtermWidget(gw)) { RequestMaximize((XtermWidget) gw, 0); } } #endif /* OPT_MAXIMIZE */ void Redraw(void) { register TScreen *screen = &term->screen; XExposeEvent event; event.type = Expose; event.display = screen->display; event.x = 0; event.y = 0; event.count = 0; if (VWindow(screen)) { @@ -959,57 +959,59 @@ time(&tstamp); tstruct = localtime(&tstamp); sprintf(dst, TIMESTAMP_FMT, src, tstruct->tm_year + 1900, tstruct->tm_mon + 1, tstruct->tm_mday, tstruct->tm_hour, tstruct->tm_min, tstruct->tm_sec); } int open_userfile(int uid, int gid, char *path, Boolean append) { int fd; struct stat sb; #ifdef VMS if ((fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0) { + int the_error = errno; fprintf(stderr, "%s: cannot open %s: %d:%s\n", xterm_name, path, - errno, - SysErrorMsg(errno)); + the_error, + SysErrorMsg(the_error)); return -1; } chown(path, uid, gid); #else if ((access(path, F_OK) != 0 && (errno != ENOENT)) || (!(creat_as(uid, gid, append, path, 0644))) || ((fd = open(path, O_WRONLY | O_APPEND)) < 0)) { + int the_error = errno; fprintf(stderr, "%s: cannot open %s: %d:%s\n", xterm_name, path, - errno, - SysErrorMsg(errno)); + the_error, + SysErrorMsg(the_error)); return -1; } #endif /* * Doublecheck that the user really owns the file that we've opened before * we do any damage, and that it is not world-writable. */ if (fstat(fd, &sb) < 0 || (int) sb.st_uid != uid || (sb.st_mode & 022) != 0) { fprintf(stderr, "%s: you do not own %s\n", xterm_name, path); close(fd); return -1; } return fd; } #ifndef VMS /* @@ -1690,48 +1692,232 @@ if (c >= 'A' && c <= 'F') return c - 'A' + 10; if (c >= 'a' && c <= 'f') return c - 'a' + 10; } } void reset_decudk(void) { int n; for (n = 0; n < MAX_UDK; n++) { if (user_keys[n].str != 0) { free(user_keys[n].str); user_keys[n].str = 0; user_keys[n].len = 0; } } } +/* + * Parse the data for DECUDK (user-defined keys). + */ +static void +parse_decudk(char *cp) +{ + while (*cp) { + char *base = cp; + char *str = (char *) malloc(strlen(cp) + 2); + unsigned key = 0; + int lo, hi; + int len = 0; + + while (isdigit(CharOf(*cp))) + key = (key * 10) + (*cp++ - '0'); + if (*cp == '/') { + cp++; + while ((hi = udk_value(&cp)) >= 0 + && (lo = udk_value(&cp)) >= 0) { + str[len++] = (hi << 4) | lo; + } + } + if (len > 0 && key < MAX_UDK) { + if (user_keys[key].str != 0) + free(user_keys[key].str); + user_keys[key].str = str; + user_keys[key].len = len; + } else { + free(str); + } + if (*cp == ';') + cp++; + if (cp == base) /* badly-formed sequence - bail out */ + break; + } +} + +#if OPT_TRACE +#define SOFT_WIDE 10 +#define SOFT_HIGH 20 + +static void +parse_decdld(ANSI * params, char *string) +{ + char DscsName[8]; + int len; + int Pfn = params->a_param[0]; + int Pcn = params->a_param[1]; + int Pe = params->a_param[2]; + int Pcmw = params->a_param[3]; + int Pw = params->a_param[4]; + int Pt = params->a_param[5]; + int Pcmh = params->a_param[6]; + int Pcss = params->a_param[7]; + + int start_char = Pcn + 0x20; + int char_wide = ((Pcmw == 0) + ? (Pcss ? 6 : 10) + : (Pcmw > 4 + ? Pcmw + : (Pcmw + 3))); + int char_high = ((Pcmh == 0) + ? ((Pcmw >= 2 || Pcmw <= 4) + ? 10 + : 20) + : Pcmh); + Char ch; + Char bits[SOFT_HIGH][SOFT_WIDE]; + Boolean first = True; + Boolean prior = False; + int row = 0, col = 0; + + TRACE(("Parsing DECDLD\n")); + TRACE((" font number %d\n", Pfn)); + TRACE((" starting char %d\n", Pcn)); + TRACE((" erase control %d\n", Pe)); + TRACE((" char-width %d\n", Pcmw)); + TRACE((" font-width %d\n", Pw)); + TRACE((" text/full %d\n", Pt)); + TRACE((" char-height %d\n", Pcmh)); + TRACE((" charset-size %d\n", Pcss)); + + if (Pfn > 1 + || Pcn > 95 + || Pe > 2 + || Pcmw > 10 + || Pcmw == 1 + || Pt > 2 + || Pcmh > 20 + || Pcss > 1 + || char_wide > SOFT_WIDE + || char_high > SOFT_HIGH) { + TRACE(("DECDLD illegal parameter\n")); + return; + } + + len = 0; + while (*string != '\0') { + ch = CharOf(*string++); + if (ch >= 0x20 && ch <= 0x2f) { + if (len < 2) + DscsName[len++] = ch; + } else if (ch >= 0x30 && ch <= 0x7e) { + DscsName[len++] = ch; + break; + } + } + DscsName[len] = 0; + TRACE((" Dscs name '%s'\n", DscsName)); + + TRACE((" character matrix %dx%d\n", char_high, char_wide)); + while (*string != '\0') { + if (first) { + TRACE(("Char %d:\n", start_char)); + if (prior) { + for (row = 0; row < char_high; ++row) { + TRACE(("%.*s\n", char_wide, bits[row])); + } + } + prior = False; + first = False; + for (row = 0; row < char_high; ++row) { + for (col = 0; col < char_wide; ++col) { + bits[row][col] = '.'; + } + } + row = col = 0; + } + ch = CharOf(*string++); + if (ch >= 0x3f && ch <= 0x7e) { + int n; + + ch -= 0x3f; + for (n = 0; n < 6; ++n) { + bits[row + n][col] = (ch & (1 << n)) ? '*' : '.'; + } + col += 1; + prior = True; + } else if (ch == '/') { + row += 6; + col = 0; + } else if (ch == ';') { + first = True; + ++start_char; + } + } +} +#else +#define parse_decdld(p,q) /* nothing */ +#endif + +/* + * Parse numeric parameters. Normally we use a state machine to simplify + * interspersing with control characters, but have the string already. + */ +static void +parse_ansi_params(ANSI * params, char **string) +{ + char *cp = *string; + short nparam = 0; + + memset(params, 0, sizeof(*params)); + while (*cp != '\0') { + Char ch = CharOf(*cp++); + + if (isdigit(ch)) { + if (nparam < NPARAM) { + params->a_param[nparam] *= 10; + params->a_param[nparam] += (ch - '0'); + } + } else if (ch == ';') { + if (++nparam < NPARAM) + params->a_nparam = nparam; + } else if (ch < 32) { + ; + } else { + /* should be 0x30 to 0x7e */ + params->a_final = ch; + break; + } + } + *string = cp; +} + void do_dcs(Char * dcsbuf, size_t dcslen) { TScreen *screen = &term->screen; char reply[BUFSIZ]; char *cp = (char *) dcsbuf; Bool okay; - Bool clear_all; + ANSI params; TRACE(("do_dcs(%s:%d)\n", (char *) dcsbuf, dcslen)); if (dcslen != strlen(cp)) /* shouldn't have nulls in the string */ return; switch (*cp) { /* intermediate character, or parameter */ case '$': /* DECRQSS */ okay = True; cp++; if (*cp++ == 'q') { if (!strcmp(cp, "\"q")) { /* DECSCA */ sprintf(reply, "%d%s", (screen->protected_mode == DEC_PROTECT) && (term->flags & PROTECTED) ? 1 : 0, cp); } else if (!strcmp(cp, "\"p")) { /* DECSCL */ sprintf(reply, "%d%s%s", @@ -1844,96 +2030,50 @@ unparseputc('6', screen->respond); # elif OPT_88_COLORS unparseputc('8', screen->respond); unparseputc('8', screen->respond); # else unparseputc('1', screen->respond); unparseputc('6', screen->respond); # endif } else { XKeyEvent event; event.state = state; Input(&(term->keyboard), screen, &event, False); } screen->tc_query = -1; } unparseputc1(ST, screen->respond); } break; #endif default: - if (isdigit(CharOf(*cp))) { /* digits are DECUDK, otherwise ignore */ - clear_all = True; - - if (*cp == '0') { - cp++; - } else if (*cp == '1') { - cp++; - clear_all = False; - } - - if (*cp == ';') - cp++; - else if (*cp != '|') - return; - - if (*cp == '0') { - cp++; - } else if (*cp == '1') { - cp++; - } - - if (*cp++ != '|') - return; - - if (clear_all) + parse_ansi_params(¶ms, &cp); + switch (params.a_final) { + case '|': /* DECUDK */ + if (params.a_param[0] == 0) reset_decudk(); - - while (*cp) { - char *base = cp; - char *str = (char *) malloc(strlen(cp) + 2); - unsigned key = 0; - int lo, hi; - int len = 0; - - while (isdigit(CharOf(*cp))) - key = (key * 10) + (*cp++ - '0'); - if (*cp == '/') { - cp++; - while ((hi = udk_value(&cp)) >= 0 - && (lo = udk_value(&cp)) >= 0) { - str[len++] = (hi << 4) | lo; - } - } - if (len > 0 && key < MAX_UDK) { - if (user_keys[key].str != 0) - free(user_keys[key].str); - user_keys[key].str = str; - user_keys[key].len = len; - } else { - free(str); - } - if (*cp == ';') - cp++; - if (cp == base) /* badly-formed sequence - bail out */ - break; - } + parse_decudk(cp); + break; + case '{': /* DECDLD */ + parse_decdld(¶ms, cp); + break; } break; } } char * udk_lookup(int keycode, int *len) { if (keycode >= 0 && keycode < MAX_UDK) { *len = user_keys[keycode].len; return user_keys[keycode].str; } return 0; } static void ChangeGroup(String attribute, char *value) { Arg args[1]; const char *name = (value != 0) ? (char *) value : ""; @@ -1993,41 +2133,41 @@ Atom aprop; Char *pchEndPropName = (Char *) strchr(buf, '='); if (pchEndPropName) *pchEndPropName = '\0'; aprop = XInternAtom(dpy, buf, False); if (pchEndPropName == NULL) { /* no "=value" given, so delete the property */ XDeleteProperty(dpy, w, aprop); } else { text_prop.value = pchEndPropName + 1; text_prop.encoding = XA_STRING; text_prop.format = 8; text_prop.nitems = Strlen(text_prop.value); XSetTextProperty(dpy, w, &text_prop, aprop); } } /***====================================================================***/ -ScrnColors *pOldColors = NULL; +static ScrnColors *pOldColors = NULL; static Boolean GetOldColors(XtermWidget pTerm) { int i; if (pOldColors == NULL) { pOldColors = (ScrnColors *) XtMalloc(sizeof(ScrnColors)); if (pOldColors == NULL) { fprintf(stderr, "allocation failure in GetOldColors\n"); return (FALSE); } pOldColors->which = 0; for (i = 0; i < NCOLORS; i++) { pOldColors->colors[i] = 0; pOldColors->names[i] = NULL; } GetColors(pTerm, pOldColors); } return (TRUE); } @@ -2418,43 +2558,45 @@ environ[envindex] = (char *) malloc((unsigned) len + strlen(value) + 1); (void) strcpy(environ[envindex], var); strcat(environ[envindex], value); environ[++envindex] = NULL; } /*ARGSUSED*/ int xerror(Display * d, register XErrorEvent * ev) { fprintf(stderr, "%s: warning, error event received:\n", xterm_name); (void) XmuPrintDefaultErrorMessage(d, ev, stderr); Exit(ERROR_XERROR); return 0; /* appease the compiler */ } /*ARGSUSED*/ int xioerror(Display * dpy) { + int the_error = errno; + (void) fprintf(stderr, "%s: fatal IO error %d (%s) or KillClient on X server \"%s\"\r\n", - xterm_name, errno, SysErrorMsg(errno), + xterm_name, the_error, SysErrorMsg(the_error), DisplayString(dpy)); Exit(ERROR_XIOERROR); return 0; /* appease the compiler */ } void xt_error(String message) { (void) fprintf(stderr, "%s Xt error: %s\n", ProgramName, message); exit(1); } int XStrCmp(char *s1, char *s2) { if (s1 && s2) return (strcmp(s1, s2)); if (s1 && *s1) return (1); @@ -2604,42 +2746,43 @@ set_tek_visibility(FALSE); TekRefresh = (TekLink *) 0; if (screen->TekEmu) switch_modes(True); /* does longjmp to vt mode */ } #endif /* OPT_TEK4014 */ static const char * skip_punct(const char *s) { while (*s == '-' || *s == '/' || *s == '+' || *s == '#' || *s == '%') { ++s; } return s; } static int cmp_options(const void *a, const void *b) { - return strcmp(skip_punct(((const OptionHelp *) a)->opt), - skip_punct(((const OptionHelp *) b)->opt)); + const char *s1 = skip_punct(((const OptionHelp *) a)->opt); + const char *s2 = skip_punct(((const OptionHelp *) b)->opt); + return strcmp(s1, s2); } static int cmp_resources(const void *a, const void *b) { return strcmp(((const XrmOptionDescRec *) a)->option, ((const XrmOptionDescRec *) b)->option); } XrmOptionDescRec * sortedOptDescs(XrmOptionDescRec * descs, Cardinal res_count) { static XrmOptionDescRec *res_array = 0; if (res_array == 0) { Cardinal j; /* make a sorted index to 'resources' */ res_array = (XrmOptionDescRec *) calloc(res_count, sizeof(*res_array)); for (j = 0; j < res_count; j++) Index: xc/programs/xterm/os2main.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/os2main.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 os2main.c --- xc/programs/xterm/os2main.c 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/os2main.c 6 Jan 2005 00:30:51 -0000 @@ -1,30 +1,30 @@ -/* $XTermId: os2main.c,v 1.170 2004/07/20 01:14:41 tom Exp $ */ +/* $XTermId: os2main.c,v 1.173 2004/12/01 01:27:47 tom Exp $ */ /* removed all foreign stuff to get the code more clear (hv) * and did some rewrite for the obscure OS/2 environment */ #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.70 2004/07/20 01:14:41 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/os2main.c,v 3.71 2004/12/01 01:27:47 dickey Exp $ */ /*********************************************************** Copyright (c) 1987, 1988 X Consortium Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN @@ -179,41 +179,41 @@ #endif #ifndef CSTOP #define CSTOP CONTROL('S') #endif #ifndef CSUSP #define CSUSP CONTROL('Z') #endif #ifndef CSWTCH #define CSWTCH 0 #endif #ifndef CWERASE #define CWERASE CONTROL('W') #endif /* * SYSV has the termio.c_cc[V] and ltchars; BSD has tchars and ltchars; * SVR4 has only termio.c_cc, but it includes everything from ltchars. */ static int override_tty_modes = 0; /* *INDENT-OFF* */ -struct _xttymodes { +static struct _xttymodes { char *name; size_t len; int set; char value; } ttymodelist[] = { { "intr", 4, 0, '\0' }, /* tchars.t_intrc ; VINTR */ #define XTTYMODE_intr 0 { "quit", 4, 0, '\0' }, /* tchars.t_quitc ; VQUIT */ #define XTTYMODE_quit 1 { "erase", 5, 0, '\0' }, /* sgttyb.sg_erase ; VERASE */ #define XTTYMODE_erase 2 { "kill", 4, 0, '\0' }, /* sgttyb.sg_kill ; VKILL */ #define XTTYMODE_kill 3 { "eof", 3, 0, '\0' }, /* tchars.t_eofc ; VEOF */ #define XTTYMODE_eof 4 { "eol", 3, 0, '\0' }, /* VEOL */ #define XTTYMODE_eol 5 { "swtch", 5, 0, '\0' }, /* VSWTCH */ #define XTTYMODE_swtch 6 { "start", 5, 0, '\0' }, /* tchars.t_startc */ @@ -393,42 +393,44 @@ {"+s", "*multiScroll", XrmoptionNoArg, (caddr_t) "off"}, {"-sb", "*scrollBar", XrmoptionNoArg, (caddr_t) "on"}, {"+sb", "*scrollBar", XrmoptionNoArg, (caddr_t) "off"}, #ifdef SCROLLBAR_RIGHT {"-leftbar", "*rightScrollBar", XrmoptionNoArg, (caddr_t) "off"}, {"-rightbar", "*rightScrollBar", XrmoptionNoArg, (caddr_t) "on"}, #endif {"-rvc", "*colorRVMode", XrmoptionNoArg, (caddr_t) "off"}, {"+rvc", "*colorRVMode", XrmoptionNoArg, (caddr_t) "on"}, {"-sf", "*sunFunctionKeys", XrmoptionNoArg, (caddr_t) "on"}, {"+sf", "*sunFunctionKeys", XrmoptionNoArg, (caddr_t) "off"}, {"-si", "*scrollTtyOutput", XrmoptionNoArg, (caddr_t) "off"}, {"+si", "*scrollTtyOutput", XrmoptionNoArg, (caddr_t) "on"}, {"-sk", "*scrollKey", XrmoptionNoArg, (caddr_t) "on"}, {"+sk", "*scrollKey", XrmoptionNoArg, (caddr_t) "off"}, {"-sl", "*saveLines", XrmoptionSepArg, (caddr_t) NULL}, #if OPT_SUNPC_KBD {"-sp", "*sunKeyboard", XrmoptionNoArg, (caddr_t) "on"}, {"+sp", "*sunKeyboard", XrmoptionNoArg, (caddr_t) "off"}, #endif +#if OPT_TEK4014 {"-t", "*tekStartup", XrmoptionNoArg, (caddr_t) "on"}, {"+t", "*tekStartup", XrmoptionNoArg, (caddr_t) "off"}, +#endif {"-ti", "*decTerminalID",XrmoptionSepArg, (caddr_t) NULL}, {"-tm", "*ttyModes", XrmoptionSepArg, (caddr_t) NULL}, {"-tn", "*termName", XrmoptionSepArg, (caddr_t) NULL}, #if OPT_WIDE_CHARS {"-u8", "*utf8", XrmoptionNoArg, (caddr_t) "2"}, {"+u8", "*utf8", XrmoptionNoArg, (caddr_t) "0"}, #endif #if OPT_LUIT_PROG {"-lc", "*locale", XrmoptionNoArg, (caddr_t) "True"}, {"+lc", "*locale", XrmoptionNoArg, (caddr_t) "False"}, {"-lcc", "*localeFilter",XrmoptionSepArg, (caddr_t) NULL}, {"-en", "*locale", XrmoptionSepArg, (caddr_t) NULL}, #endif {"-ulc", "*colorULMode", XrmoptionNoArg, (caddr_t) "off"}, {"+ulc", "*colorULMode", XrmoptionNoArg, (caddr_t) "on"}, {"-ut", "*utmpInhibit", XrmoptionNoArg, (caddr_t) "on"}, {"+ut", "*utmpInhibit", XrmoptionNoArg, (caddr_t) "off"}, {"-im", "*useInsertMode", XrmoptionNoArg, (caddr_t) "on"}, {"+im", "*useInsertMode", XrmoptionNoArg, (caddr_t) "off"}, {"-vb", "*visualBell", XrmoptionNoArg, (caddr_t) "on"}, @@ -770,110 +772,110 @@ printf("%s usage:\n %s [-options ...] [-e command args]\n\n", xtermVersion(), ProgramName); printf("where options include:\n"); for (opt = list; opt->opt; opt++) { printf(" %-28s %s\n", opt->opt, opt->desc); } putchar('\n'); for (cpp = message; *cpp; cpp++) puts(*cpp); putchar('\n'); fflush(stdout); } /* ARGSUSED */ static Boolean ConvertConsoleSelection(Widget w GCC_UNUSED, Atom * selection GCC_UNUSED, Atom * target GCC_UNUSED, Atom * type GCC_UNUSED, - XtPointer * value GCC_UNUSED, + XtPointer *value GCC_UNUSED, unsigned long *length GCC_UNUSED, int *format GCC_UNUSED) { /* we don't save console output, so can't offer it */ return False; } #if OPT_SESSION_MGT static void die_callback(Widget w GCC_UNUSED, XtPointer client_data GCC_UNUSED, XtPointer call_data GCC_UNUSED) { Cleanup(0); } static void save_callback(Widget w GCC_UNUSED, XtPointer client_data GCC_UNUSED, XtPointer call_data) { XtCheckpointToken token = (XtCheckpointToken) call_data; /* we have nothing to save */ token->save_success = True; } #endif /* OPT_SESSION_MGT */ #if OPT_WIDE_CHARS int (*my_wcwidth) (wchar_t); #endif /* * DeleteWindow(): Action proc to implement ICCCM delete_window. */ /* ARGSUSED */ static void DeleteWindow(Widget w, XEvent * event GCC_UNUSED, String * params GCC_UNUSED, - Cardinal * num_params GCC_UNUSED) + Cardinal *num_params GCC_UNUSED) { #if OPT_TEK4014 if (w == toplevel) { if (term->screen.Tshow) hide_vt_window(); else do_hangup(w, (XtPointer) 0, (XtPointer) 0); } else if (term->screen.Vshow) hide_tek_window(); else #endif do_hangup(w, (XtPointer) 0, (XtPointer) 0); } /* ARGSUSED */ static void KeyboardMapping(Widget w GCC_UNUSED, XEvent * event, String * params GCC_UNUSED, - Cardinal * num_params GCC_UNUSED) + Cardinal *num_params GCC_UNUSED) { switch (event->type) { case MappingNotify: XRefreshKeyboardMapping(&event->xmapping); break; } } -XtActionsRec actionProcs[] = +static XtActionsRec actionProcs[] = { {"DeleteWindow", DeleteWindow}, {"KeyboardMapping", KeyboardMapping}, }; char **gblenvp; extern char **environ; int main(int argc, char **argv ENVP_ARG) { Widget form_top, menu_top; register TScreen *screen; int mode; char *my_class = DEFCLASS; Window winToEmbedInto = None; /* Do these first, since we may not be able to open the display */ ProgramName = argv[0]; TRACE_OPTS(xtermOptions, optionDescList, XtNumber(optionDescList)); @@ -945,41 +947,41 @@ d_tio.c_cc[VEOL] = CEOL; /* '^@' */ /* Init the Toolkit. */ XtSetErrorHandler(xt_error); #if OPT_SESSION_MGT toplevel = XtOpenApplication(&app_con, my_class, optionDescList, XtNumber(optionDescList), &argc, argv, fallback_resources, sessionShellWidgetClass, NULL, 0); #else toplevel = XtAppInitialize(&app_con, my_class, optionDescList, XtNumber(optionDescList), &argc, argv, fallback_resources, NULL, 0); #endif /* OPT_SESSION_MGT */ XtSetErrorHandler((XtErrorHandler) 0); - XtGetApplicationResources(toplevel, (XtPointer) & resource, + XtGetApplicationResources(toplevel, (XtPointer) &resource, application_resources, XtNumber(application_resources), NULL, 0); TRACE_XRES(); waiting_for_initial_map = resource.wait_for_map; /* * ICCCM delete_window. */ XtAppAddActions(app_con, actionProcs, XtNumber(actionProcs)); /* * fill in terminal modes */ if (resource.tty_modes) { int n = parse_tty_modes(resource.tty_modes, ttymodelist); if (n < 0) { fprintf(stderr, "%s: bad tty modes \"%s\"\n", ProgramName, resource.tty_modes); } else if (n > 0) { Index: xc/programs/xterm/plink.sh =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/plink.sh,v retrieving revision 1.2 diff -u -2 -0 -r1.2 plink.sh --- xc/programs/xterm/plink.sh 23 Apr 2004 19:55:07 -0000 1.2 +++ xc/programs/xterm/plink.sh 6 Jan 2005 00:30:51 -0000 @@ -1,22 +1,22 @@ #!/bin/sh -# $XFree86$ +# $XFree86: xc/programs/xterm/plink.sh,v 3.1 2001/03/13 09:48:43 dickey Exp $ # # Reduce the number of dynamic libraries used to link an executable. CMD= while test $# != 0 do OPT="$1" shift case $OPT in -l*) echo "testing if $OPT is needed" if ( eval $CMD $* >/dev/null 2>/dev/null ) then : echo ...no else echo ...yes CMD="$CMD $OPT" fi ;; *) CMD="$CMD $OPT" Index: xc/programs/xterm/precompose.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/precompose.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 precompose.c --- xc/programs/xterm/precompose.c 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/precompose.c 6 Jan 2005 00:30:51 -0000 @@ -1,31 +1,32 @@ /* * Canonical Compositions * * DO NOT EDIT BY HAND! This is generated by the script * unicode/make-precompose.sh */ -/* $XFree86: xc/programs/xterm/precompose.c,v 1.2 2000/11/01 01:12:41 dawes Exp $ */ +/* $XTermId: precompose.c,v 1.7 2004/12/01 01:27:47 tom Exp $ */ +/* $XFree86: xc/programs/xterm/precompose.c,v 1.3 2004/12/01 01:27:47 dickey Exp $ */ #include -struct { +static struct { int replacement; int base; int comb; } precompositions[] = { { 0x226E, 0x003C, 0x0338}, { 0x2260, 0x003D, 0x0338}, { 0x226F, 0x003E, 0x0338}, { 0x00C0, 0x0041, 0x0300}, { 0x00C1, 0x0041, 0x0301}, { 0x00C2, 0x0041, 0x0302}, { 0x00C3, 0x0041, 0x0303}, { 0x0100, 0x0041, 0x0304}, { 0x0102, 0x0041, 0x0306}, { 0x0226, 0x0041, 0x0307}, { 0x00C4, 0x0041, 0x0308}, { 0x1EA2, 0x0041, 0x0309}, { 0x00C5, 0x0041, 0x030A}, { 0x01CD, 0x0041, 0x030C}, { 0x0200, 0x0041, 0x030F}, { 0x0202, 0x0041, 0x0311}, @@ -736,40 +737,53 @@ { 0x0DDE, 0x0DD9, 0x0DDF}, { 0x0DDD, 0x0DDC, 0x0DCA}, { 0x0F69, 0x0F40, 0x0FB5}, { 0x0F43, 0x0F42, 0x0FB7}, { 0x0F4D, 0x0F4C, 0x0FB7}, { 0x0F52, 0x0F51, 0x0FB7}, { 0x0F57, 0x0F56, 0x0FB7}, { 0x0F5C, 0x0F5B, 0x0FB7}, { 0x0F73, 0x0F71, 0x0F72}, { 0x0F75, 0x0F71, 0x0F74}, { 0x0F81, 0x0F71, 0x0F80}, { 0x0FB9, 0x0F90, 0x0FB5}, { 0x0F93, 0x0F92, 0x0FB7}, { 0x0F9D, 0x0F9C, 0x0FB7}, { 0x0FA2, 0x0FA1, 0x0FB7}, { 0x0FA7, 0x0FA6, 0x0FB7}, { 0x0FAC, 0x0FAB, 0x0FB7}, { 0x0F76, 0x0FB2, 0x0F80}, { 0x0F78, 0x0FB3, 0x0F80}, { 0x1026, 0x1025, 0x102E}, +{ 0x1D15E, 0x1D157, 0x1D165}, +{ 0x1D15F, 0x1D158, 0x1D165}, +{ 0x1D160, 0x1D15F, 0x1D16E}, +{ 0x1D161, 0x1D15F, 0x1D16F}, +{ 0x1D162, 0x1D15F, 0x1D170}, +{ 0x1D163, 0x1D15F, 0x1D171}, +{ 0x1D164, 0x1D15F, 0x1D172}, +{ 0x1D1BB, 0x1D1B9, 0x1D165}, +{ 0x1D1BC, 0x1D1BA, 0x1D165}, +{ 0x1D1BD, 0x1D1BB, 0x1D16E}, +{ 0x1D1BF, 0x1D1BB, 0x1D16F}, +{ 0x1D1BE, 0x1D1BC, 0x1D16E}, +{ 0x1D1C0, 0x1D1BC, 0x1D16F}, { 0x1E38, 0x1E36, 0x0304}, { 0x1E39, 0x1E37, 0x0304}, { 0x1E5C, 0x1E5A, 0x0304}, { 0x1E5D, 0x1E5B, 0x0304}, { 0x1E68, 0x1E62, 0x0307}, { 0x1E69, 0x1E63, 0x0307}, { 0x1EAC, 0x1EA0, 0x0302}, { 0x1EB6, 0x1EA0, 0x0306}, { 0x1EAD, 0x1EA1, 0x0302}, { 0x1EB7, 0x1EA1, 0x0306}, { 0x1EC6, 0x1EB8, 0x0302}, { 0x1EC7, 0x1EB9, 0x0302}, { 0x1ED8, 0x1ECC, 0x0302}, { 0x1ED9, 0x1ECD, 0x0302}, { 0x1F02, 0x1F00, 0x0300}, { 0x1F04, 0x1F00, 0x0301}, { 0x1F06, 0x1F00, 0x0342}, { 0x1F80, 0x1F00, 0x0345}, { 0x1F03, 0x1F01, 0x0300}, { 0x1F05, 0x1F01, 0x0301}, @@ -924,40 +938,41 @@ { 0x2278, 0x2276, 0x0338}, { 0x2279, 0x2277, 0x0338}, { 0x2280, 0x227A, 0x0338}, { 0x2281, 0x227B, 0x0338}, { 0x22E0, 0x227C, 0x0338}, { 0x22E1, 0x227D, 0x0338}, { 0x2284, 0x2282, 0x0338}, { 0x2285, 0x2283, 0x0338}, { 0x2288, 0x2286, 0x0338}, { 0x2289, 0x2287, 0x0338}, { 0x22E2, 0x2291, 0x0338}, { 0x22E3, 0x2292, 0x0338}, { 0x22AC, 0x22A2, 0x0338}, { 0x22AD, 0x22A8, 0x0338}, { 0x22AE, 0x22A9, 0x0338}, { 0x22AF, 0x22AB, 0x0338}, { 0x22EA, 0x22B2, 0x0338}, { 0x22EB, 0x22B3, 0x0338}, { 0x22EC, 0x22B4, 0x0338}, { 0x22ED, 0x22B5, 0x0338}, +{ 0x2ADC, 0x2ADD, 0x0338}, { 0x3094, 0x3046, 0x3099}, { 0x304C, 0x304B, 0x3099}, { 0x304E, 0x304D, 0x3099}, { 0x3050, 0x304F, 0x3099}, { 0x3052, 0x3051, 0x3099}, { 0x3054, 0x3053, 0x3099}, { 0x3056, 0x3055, 0x3099}, { 0x3058, 0x3057, 0x3099}, { 0x305A, 0x3059, 0x3099}, { 0x305C, 0x305B, 0x3099}, { 0x305E, 0x305D, 0x3099}, { 0x3060, 0x305F, 0x3099}, { 0x3062, 0x3061, 0x3099}, { 0x3065, 0x3064, 0x3099}, { 0x3067, 0x3066, 0x3099}, { 0x3069, 0x3068, 0x3099}, { 0x3070, 0x306F, 0x3099}, { 0x3071, 0x306F, 0x309A}, { 0x3073, 0x3072, 0x3099}, { 0x3074, 0x3072, 0x309A}, Index: xc/programs/xterm/print.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/print.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 print.c --- xc/programs/xterm/print.c 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/print.c 6 Jan 2005 00:30:52 -0000 @@ -1,27 +1,29 @@ +/* $XTermId: print.c,v 1.54 2004/12/01 01:27:47 tom Exp $ */ + /* - * $XFree86: xc/programs/xterm/print.c,v 1.19 2002/08/12 00:36:33 dickey Exp $ + * $XFree86: xc/programs/xterm/print.c,v 1.20 2004/12/01 01:27:47 dickey Exp $ */ /************************************************************ -Copyright 1997-2000,2002 by Thomas E. Dickey +Copyright 1997-2002,2004 by Thomas E. Dickey All Rights Reserved Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE @@ -38,41 +40,40 @@ #include #include #include #include #undef CTRL #define CTRL(c) ((c) & 0x1f) #define SHIFT_IN '\017' #define SHIFT_OUT '\016' #define CSET_IN 'A' #define CSET_OUT '0' #define isForm(c) ((c) == '\r' || (c) == '\n' || (c) == '\f') #define Strlen(a) strlen((char *)a) #define Strcmp(a,b) strcmp((char *)a,(char *)b) #define Strncmp(a,b,c) strncmp((char *)a,(char *)b,c) -#define SGR_MASK (BOLD|BLINK|UNDERLINE|INVERSE) #ifdef VMS #define VMS_TEMP_PRINT_FILE "sys$scratch:xterm_print.txt" #endif static void charToPrinter(int chr); static void printLine(int row, int chr); static void send_CharSet(int row); static void send_SGR(unsigned attr, int fg, int bg); static void stringToPrinter(char *str); static FILE *Printer; static int Printer_pid; static int initialized; static void closePrinter(void) { if (xtermHasPrinter() != 0) { #ifdef VMS TScreen *screen = &term->screen; Index: xc/programs/xterm/ptyx.h =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/ptyx.h,v retrieving revision 1.3 diff -u -2 -0 -r1.3 ptyx.h --- xc/programs/xterm/ptyx.h 13 Aug 2004 12:57:20 -0000 1.3 +++ xc/programs/xterm/ptyx.h 6 Jan 2005 00:30:53 -0000 @@ -1,27 +1,27 @@ -/* $XTermId: ptyx.h,v 1.328 2004/07/28 00:53:26 tom Exp $ */ +/* $XTermId: ptyx.h,v 1.346 2004/12/01 01:27:47 tom Exp $ */ /* * $Xorg: ptyx.h,v 1.3 2000/08/17 19:55:09 cpqbld Exp $ */ -/* $XFree86: xc/programs/xterm/ptyx.h,v 3.119 2004/07/28 00:53:26 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/ptyx.h,v 3.120 2004/12/01 01:27:47 dickey Exp $ */ /* * Copyright 1999-2003,2004 by Thomas E. Dickey * * All Rights Reserved * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -302,45 +302,45 @@ #define DFT_KBD_DIALECT "B" /* default USASCII */ #endif /* constants used for utf8 mode */ #define UCS_REPL 0xfffd #define UCS_LIMIT 0x80000000U /* both limit and flag for non-UCS */ #define TERMCAP_SIZE 1500 /* 1023 is standard; 'screen' exceeds */ #define NMENUFONTS 9 /* font entries in fontMenu */ #define NBOX 5 /* Number of Points in box */ #define NPARAM 30 /* Max. parameters */ typedef struct { char *opt; char *desc; } OptionHelp; typedef struct { - unsigned char a_type; - unsigned char a_pintro; - unsigned char a_final; - unsigned char a_inters; - char a_nparam; /* # of parameters */ + unsigned char a_type; /* CSI, etc., see unparseq() */ + unsigned char a_pintro; /* private-mode char, if any */ + unsigned char a_inters; /* special (before final-char) */ + unsigned char a_final; /* final-char */ + short a_nparam; /* # of parameters */ short a_param[NPARAM]; /* Parameters */ } ANSI; #define TEK_FONT_LARGE 0 #define TEK_FONT_2 1 #define TEK_FONT_3 2 #define TEK_FONT_SMALL 3 #define TEKNUMFONTS 4 /* Actually there are 5 types of lines, but four are non-solid lines */ #define TEKNUMLINES 4 typedef struct { int x; int y; int fontsize; unsigned linetype; } Tmodes; typedef struct { @@ -413,40 +413,44 @@ #define OPT_COLOR_RES 1 /* true if xterm delays color-resource evaluation */ #undef OPT_COLOR_RES2 #endif #ifndef OPT_COLOR_RES2 #define OPT_COLOR_RES2 OPT_COLOR_RES /* true to avoid using extra resources */ #endif #ifndef OPT_DABBREV #define OPT_DABBREV 0 /* dynamic abbreviations */ #endif #ifndef OPT_DEC_CHRSET #define OPT_DEC_CHRSET 1 /* true if xterm is configured for DEC charset */ #endif #ifndef OPT_DEC_LOCATOR #define OPT_DEC_LOCATOR 0 /* true if xterm supports VT220-style mouse events */ #endif +#ifndef OPT_DEC_RECTOPS +#define OPT_DEC_RECTOPS 0 /* true if xterm is configured for VT420 rectangles */ +#endif + #ifndef OPT_DEC_SOFTFONT #define OPT_DEC_SOFTFONT 0 /* true if xterm is configured for VT220 softfonts */ #endif #ifndef OPT_EBCDIC #ifdef __MVS__ #define OPT_EBCDIC 1 #else #define OPT_EBCDIC 0 #endif #endif #ifndef OPT_HP_FUNC_KEYS #define OPT_HP_FUNC_KEYS 0 /* true if xterm supports HP-style function keys */ #endif #ifndef OPT_I18N_SUPPORT #if (XtSpecificationRelease >= 5) #define OPT_I18N_SUPPORT 1 /* true if xterm uses internationalization support */ #else @@ -477,40 +481,44 @@ #ifndef OPT_88_COLORS #define OPT_88_COLORS 0 /* true if xterm is configured with 88 colors */ #endif #ifndef OPT_HIGHLIGHT_COLOR #define OPT_HIGHLIGHT_COLOR 1 /* true if xterm supports color highlighting */ #endif #ifndef OPT_LOAD_VTFONTS #define OPT_LOAD_VTFONTS 0 /* true if xterm has load-vt-fonts() action */ #endif #ifndef OPT_LUIT_PROG #define OPT_LUIT_PROG 0 /* true if xterm supports luit */ #endif #ifndef OPT_MAXIMIZE #define OPT_MAXIMIZE 1 /* add actions for iconify ... maximize */ #endif +#ifndef OPT_MINI_LUIT +#define OPT_MINI_LUIT 0 /* true if xterm supports built-in mini-luit */ +#endif + #ifndef OPT_MOD_FKEYS #define OPT_MOD_FKEYS 1 /* modify cursor- and function-keys in normal mode */ #endif #ifndef OPT_NUM_LOCK #define OPT_NUM_LOCK 1 /* use NumLock key only for numeric-keypad */ #endif #ifndef OPT_PC_COLORS #define OPT_PC_COLORS 1 /* true if xterm supports PC-style (bold) colors */ #endif #ifndef OPT_PTY_HANDSHAKE #define OPT_PTY_HANDSHAKE USE_HANDSHAKE /* avoid pty races on older systems */ #endif #ifndef OPT_PRINT_COLORS #define OPT_PRINT_COLORS 1 /* true if we print color information */ #endif @@ -658,41 +666,41 @@ #endif #if OPT_TEK4014 , TEK_CURSOR = 8 /* tektronix cursor */ #endif , NCOLORS /* total number of colors */ } TermColors; #define COLOR_DEFINED(s,w) ((s)->which & (1<<(w))) #define COLOR_VALUE(s,w) ((s)->colors[w]) #define SET_COLOR_VALUE(s,w,v) (((s)->colors[w] = (v)), ((s)->which |= (1<<(w)))) #define COLOR_NAME(s,w) ((s)->names[w]) #define SET_COLOR_NAME(s,w,v) (((s)->names[w] = (v)), ((s)->which |= (1<<(w)))) #define UNDEFINE_COLOR(s,w) ((s)->which &= (~((w)<<1))) /***====================================================================***/ #if OPT_ISO_COLORS #define if_OPT_ISO_COLORS(screen, code) if(screen->colorMode) code -#define TERM_COLOR_FLAGS (term->flags & (BG_COLOR)) +#define TERM_COLOR_FLAGS (term->flags & (FG_COLOR|BG_COLOR)) #define COLOR_0 0 #define COLOR_1 1 #define COLOR_2 2 #define COLOR_3 3 #define COLOR_4 4 #define COLOR_5 5 #define COLOR_6 6 #define COLOR_7 7 #define COLOR_8 8 #define COLOR_9 9 #define COLOR_10 10 #define COLOR_11 11 #define COLOR_12 12 #define COLOR_13 13 #define COLOR_14 14 #define COLOR_15 15 #define MIN_ANSI_COLORS 16 #if OPT_256_COLORS # define NUM_ANSI_COLORS 256 @@ -896,44 +904,52 @@ #define Bres(name, class, offset, dftvalue) \ {RES_NAME(name), RES_CLASS(class), XtRBoolean, sizeof(Boolean), \ RES_OFFSET(offset), XtRImmediate, (XtPointer) dftvalue} #define Cres(name, class, offset, dftvalue) \ {RES_NAME(name), RES_CLASS(class), XtRPixel, sizeof(Pixel), \ RES_OFFSET(offset), XtRString, (XtPointer) dftvalue} #define Tres(name, class, offset, dftvalue) \ COLOR_RES2(name, class, screen.Tcolors[offset], dftvalue) \ #define Fres(name, class, offset, dftvalue) \ {RES_NAME(name), RES_CLASS(class), XtRFontStruct, sizeof(XFontStruct *), \ RES_OFFSET(offset), XtRString, (XtPointer) dftvalue} #define Ires(name, class, offset, dftvalue) \ {RES_NAME(name), RES_CLASS(class), XtRInt, sizeof(int), \ RES_OFFSET(offset), XtRImmediate, (XtPointer) dftvalue} +#define Dres(name, class, offset, dftvalue) \ + {RES_NAME(name), RES_CLASS(class), XtRFloat, sizeof(float), \ + RES_OFFSET(offset), XtRString, (XtPointer) dftvalue} + #define Sres(name, class, offset, dftvalue) \ {RES_NAME(name), RES_CLASS(class), XtRString, sizeof(char *), \ RES_OFFSET(offset), XtRString, (XtPointer) dftvalue} +#define Wres(name, class, offset, dftvalue) \ + {RES_NAME(name), RES_CLASS(class), XtRWidget, sizeof(Widget), \ + RES_OFFSET(offset), XtRWidget, (XtPointer) dftvalue} + /***====================================================================***/ #define BUF_SIZE 4096 #define FRG_SIZE 128 typedef struct { Char buffer[BUF_SIZE + FRG_SIZE]; Char * next; Char * last; int update; /* HandleInterpret */ #if OPT_WIDE_CHARS IChar utf_data; /* resulting character */ int utf_size; /* ...number of bytes decoded */ #endif } PtyData; /***====================================================================***/ #if OPT_TRACE #include @@ -1017,69 +1033,79 @@ #define SCRN_BUF_CHARS(screen, row) BUF_CHARS(screen->visbuf, row) #define SCRN_BUF_ATTRS(screen, row) BUF_ATTRS(screen->visbuf, row) #define SCRN_BUF_COLOR(screen, row) BUF_COLOR(screen->visbuf, row) #define SCRN_BUF_FGRND(screen, row) BUF_FGRND(screen->visbuf, row) #define SCRN_BUF_BGRND(screen, row) BUF_BGRND(screen->visbuf, row) #define SCRN_BUF_CSETS(screen, row) BUF_CSETS(screen->visbuf, row) #define SCRN_BUF_WIDEC(screen, row) BUF_WIDEC(screen->visbuf, row) #define SCRN_BUF_COM1L(screen, row) BUF_COM1L(screen->visbuf, row) #define SCRN_BUF_COM2L(screen, row) BUF_COM2L(screen->visbuf, row) #define SCRN_BUF_COM1H(screen, row) BUF_COM1H(screen->visbuf, row) #define SCRN_BUF_COM2H(screen, row) BUF_COM2H(screen->visbuf, row) typedef struct { unsigned chrset; unsigned flags; XFontStruct * fs; GC gc; char * fn; } XTermFonts; +typedef struct { + int top; + int left; + int bottom; + int right; +} XTermRect; + /* indices into save_modes[] */ typedef enum { DP_CRS_VISIBLE, DP_DECANM, DP_DECARM, DP_DECAWM, DP_DECBKM, DP_DECCKM, DP_DECCOLM, /* IN132COLUMNS */ DP_DECOM, DP_DECPEX, DP_DECPFF, DP_DECSCLM, DP_DECSCNM, DP_DECTCEM, DP_DECTEK, DP_PRN_EXTENT, DP_PRN_FORMFEED, DP_X_ALTSCRN, DP_X_DECCOLM, DP_X_LOGGING, DP_X_MARGIN, DP_X_MORE, DP_X_MOUSE, DP_X_REVWRAP, DP_X_X10MSE, #if OPT_BLINK_CURS DP_CRS_BLINK, #endif +#if OPT_TOOLBAR + DP_TOOLBAR, +#endif DP_LAST } SaveModes; #define DoSM(code,value) screen->save_modes[code] = value #define DoRM(code,value) value = screen->save_modes[code] /* index into vt_shell[] or tek_shell[] */ typedef enum { noMenu = -1, mainMenu, vtMenu, fontMenu, tekMenu } MenuIndex; #define NUM_POPUP_MENUS 4 #if OPT_COLOR_RES typedef struct { String resource; @@ -1107,58 +1133,66 @@ #if OPT_ISO_COLORS int cur_foreground; /* current foreground color */ int cur_background; /* current background color */ int sgr_foreground; /* current SGR foreground color */ int sgr_background; /* current SGR background color */ Boolean sgr_extended; /* SGR set with extended codes? */ #endif } SavedCursor; typedef struct { int width; /* if > 0, width of scrollbar, */ /* and scrollbar is showing */ Boolean rv_cached; /* see ScrollBarReverseVideo */ int rv_active; /* ...current reverse-video */ Pixel bg; /* ...cached background color */ Pixel fg; /* ...cached foreground color */ Pixel bdr; /* ...cached border color */ Pixmap bdpix; /* ...cached border pixmap */ } SbInfo; +#if OPT_TOOLBAR +typedef struct { + Widget menu_bar; /* toolbar, if initialized */ + Dimension menu_height; /* ...and its height */ +} TbInfo; +#define VT100_TB_INFO(name) screen.fullVwin.tb_info.name +#endif + struct _vtwin { Window window; /* X window id */ int width; /* width of columns */ int height; /* height of rows */ int fullwidth; /* full width of window */ int fullheight; /* full height of window */ int f_width; /* width of fonts in pixels */ int f_height; /* height of fonts in pixels */ int f_ascent; /* ascent of font in pixels */ int f_descent; /* descent of font in pixels */ SbInfo sb_info; GC normalGC; /* normal painting */ GC reverseGC; /* reverse painting */ GC normalboldGC; /* normal painting, bold font */ GC reverseboldGC; /* reverse painting, bold font */ #if OPT_TOOLBAR - Widget menu_bar; /* toolbar, if initialized */ - Dimension menu_height; /* ...and its height */ + Boolean active; /* true if toolbars are used */ + TbInfo tb_info; /* toolbar information */ #endif }; struct _tekwin { Window window; /* X window id */ int width; /* width of columns */ int height; /* height of rows */ int fullwidth; /* full width of window */ int fullheight; /* full height of window */ double tekscale; /* scale factor Tek -> vs100 */ }; typedef struct { /* These parameters apply to both windows */ Display *display; /* X display for screen */ int respond; /* socket for responses (position report, etc.) */ #if OPT_TCAP_QUERY int tc_query; #endif @@ -1171,46 +1205,53 @@ GC cursoroutlineGC;/* for painting lines around */ ColorRes Tcolors[NCOLORS]; /* terminal colors */ #if OPT_ISO_COLORS ColorRes Acolors[MAXCOLORS]; /* ANSI color emulation */ int veryBoldColors; /* modifier for boldColors */ Boolean boldColors; /* can we make bold colors? */ Boolean colorMode; /* are we using color mode? */ Boolean colorULMode; /* use color for underline? */ Boolean colorBDMode; /* use color for bold? */ Boolean colorBLMode; /* use color for blink? */ Boolean colorRVMode; /* use color for reverse? */ Boolean colorAttrMode; /* prefer colorUL/BD to SGR */ #endif #if OPT_DEC_CHRSET Boolean font_doublesize;/* enable font-scaling */ int cache_doublesize;/* limit of our cache */ Char cur_chrset; /* character-set index & code */ int fonts_used; /* count items in double_fonts */ XTermFonts double_fonts[NUM_CHRSET]; #endif +#if OPT_DEC_RECTOPS + int cur_decsace; /* parameter for DECSACE */ +#endif #if OPT_WIDE_CHARS Boolean wide_chars; /* true when 16-bit chars */ Boolean vt100_graphics; /* true to allow vt100-graphics */ int utf8_mode; /* use UTF-8 decode/encode: 0-2 */ - int utf_count; /* state of utf_char */ - IChar utf_char; /* in-progress character */ + int latin9_mode; /* poor man's luit, latin9 */ + int unicode_font; /* font uses unicode encoding */ + int utf_count; /* state of utf_char */ + IChar utf_char; /* in-progress character */ + int last_written_col; + int last_written_row; #endif #if OPT_BROKEN_OSC Boolean brokenLinuxOSC; /* true to ignore Linux palette ctls */ #endif #if OPT_BROKEN_ST Boolean brokenStringTerm; /* true to match old OSC parse */ #endif #if OPT_C1_PRINT Boolean c1_printable; /* true if we treat C1 as print */ #endif int border; /* inner border */ Cursor arrow; /* arrow cursor */ unsigned long event_mask; unsigned short send_mouse_pos; /* user wants mouse transition */ /* and position information */ #if OPT_READLINE unsigned click1_moves; unsigned paste_moves; unsigned dclick3_deletes; unsigned paste_brackets; @@ -1236,40 +1277,43 @@ Boolean poponbell; /* pop on bell mode */ Boolean allowSendEvents;/* SendEvent mode */ Boolean allowWindowOps; /* WindowOps mode */ Boolean awaitInput; /* select-timeout mode */ Boolean grabbedKbd; /* keyboard is grabbed */ #ifdef ALLOWLOGGING int logging; /* logging mode */ int logfd; /* file descriptor of log */ char *logfile; /* log file name */ Char *logstart; /* current start of log buffer */ #endif int inhibit; /* flags for inhibiting changes */ /* VT window parameters */ Boolean Vshow; /* VT window showing */ struct _vtwin fullVwin; #ifndef NO_ACTIVE_ICON struct _vtwin iconVwin; struct _vtwin * whichVwin; #endif /* NO_ACTIVE_ICON */ +#if OPT_TOOLBAR + Boolean toolbars; /* true if toolbars are used */ +#endif Cursor pointer_cursor; /* pointer cursor in window */ String answer_back; /* response to ENQ */ String printer_command; /* pipe/shell command string */ Boolean printer_autoclose; /* close printer when offline */ Boolean printer_extent; /* print complete page */ Boolean printer_formfeed; /* print formfeed per function */ int printer_controlmode; /* 0=off, 1=auto, 2=controller */ int print_attributes; /* 0=off, 1=normal, 2=color */ Boolean fnt_prop; /* true if proportional fonts */ Boolean fnt_boxes; /* true if font has box-chars */ #if OPT_BOX_CHARS Boolean force_box_chars;/* true if we assume that */ Boolean force_all_chars;/* true to outline missing chars*/ #endif Dimension fnt_wide; Dimension fnt_high; XFontStruct *fnt_norm; /* normal font of terminal */ @@ -1434,66 +1478,66 @@ Char *selection_data; /* the current selection */ int selection_size; /* size of allocated buffer */ int selection_length; /* number of significant bytes */ Time selection_time; /* latest event timestamp */ int startHRow, startHCol, /* highlighted text */ endHRow, endHCol, startHCoord, endHCoord; Atom* selection_atoms; /* which selections we own */ Cardinal sel_atoms_size; /* how many atoms allocated */ Cardinal selection_count; /* how many atoms in use */ Boolean input_eight_bits;/* use 8th bit instead of ESC prefix */ Boolean output_eight_bits; /* honor all bits or strip */ Boolean control_eight_bits; /* send CSI as 8-bits */ Boolean backarrow_key; /* backspace/delete */ Boolean meta_sends_esc; /* Meta-key sends ESC prefix */ Pixmap menu_item_bitmap; /* mask for checking items */ String bold_font_names[NMENUFONTS]; String menu_font_names[NMENUFONTS]; long menu_font_sizes[NMENUFONTS]; int menu_font_number; - XIC xic; #if OPT_RENDERFONT XftFont * renderFontNorm[NMENUFONTS]; XftFont * renderFontBold[NMENUFONTS]; XftFont * renderWideNorm[NMENUFONTS]; XftFont * renderWideBold[NMENUFONTS]; XftDraw * renderDraw; #endif #if OPT_INPUT_METHOD + XIM xim; XFontSet fs; /* fontset for XIM preedit */ int fs_ascent; /* ascent of fs */ #endif + XIC xic; /* this is used even without XIM */ #if OPT_DABBREV int dabbrev_working; /* nonzero during dabbrev process */ unsigned char dabbrev_erase_char; /* used for deleting inserted completion */ #endif } TScreen; typedef struct _TekPart { XFontStruct * Tfont[TEKNUMFONTS]; int tobaseline[TEKNUMFONTS]; /* top-baseline, each font */ char * initial_font; /* large, 2, 3, small */ char * gin_terminator_str; /* ginTerminator resource */ #if OPT_TOOLBAR - Widget menu_bar; /* toolbar, if initialized */ - Dimension menu_height; /* ...and its height */ + TbInfo tb_info; /* toolbar information */ #endif } TekPart; #if OPT_READLINE #define SCREEN_FLAG(screenp,f) (1&(screenp)->f) #define SCREEN_FLAG_set(screenp,f) ((screenp)->f |= 1) #define SCREEN_FLAG_unset(screenp,f) ((screenp)->f &= ~1L) #define SCREEN_FLAG_save(screenp,f) \ ((screenp)->f = (((screenp)->f)<<1) | SCREEN_FLAG(screenp,f)) #define SCREEN_FLAG_restore(screenp,f) ((screenp)->f = (((screenp)->f)>>1)) #else #define SCREEN_FLAG(screenp,f) (0) #endif /* meaning of bits in screen.select flag */ #define INWINDOW 01 /* the mouse is in one of the windows */ #define FOCUS 02 /* one of the windows is the focus window */ #define MULTICLICKTIME 250 /* milliseconds */ @@ -1587,41 +1631,41 @@ #endif #if OPT_SHIFT_FONTS Boolean shift_fonts; /* true if we interpret fontsize-shifting */ #endif #if OPT_SUNPC_KBD int ctrl_fkeys; /* amount to add to XK_F1 for ctrl modifier */ #endif #if OPT_NUM_LOCK Boolean real_NumLock; /* true if we treat NumLock key specially */ Boolean alwaysUseMods; /* true if we always want f-key modifiers */ unsigned long num_lock; /* modifier for Num_Lock */ unsigned long alt_left; /* modifier for Alt_L */ unsigned long alt_right; /* modifier for Alt_R */ Boolean meta_trans; /* true if Meta is used in translations */ unsigned long meta_left; /* modifier for Meta_L */ unsigned long meta_right; /* modifier for Meta_R */ #endif #if OPT_RENDERFONT char *face_name; char *face_wide_name; - int face_size; + float face_size; Boolean render_font; #endif } Misc; typedef struct {int foo;} XtermClassPart, TekClassPart; typedef struct _XtermClassRec { CoreClassPart core_class; XtermClassPart xterm_class; } XtermClassRec; extern WidgetClass xtermWidgetClass; #define IsXtermWidget(w) (XtClass(w) == xtermWidgetClass) #if OPT_TEK4014 typedef struct _TekClassRec { CoreClassPart core_class; TekClassPart tek_class; } TekClassRec; @@ -1680,63 +1724,66 @@ * and which must fit in a char. * The other is the global setting stored in * term->flags and screen->save_modes. This need only fit in an unsigned. */ /* global flags and character flags (visible character attributes) */ #define INVERSE 0x01 /* invert the characters to be output */ #define UNDERLINE 0x02 /* true if underlining */ #define BOLD 0x04 #define BLINK 0x08 /* global flags (also character attributes) */ #define BG_COLOR 0x10 /* true if background set */ #define FG_COLOR 0x20 /* true if foreground set */ /* character flags (internal attributes) */ #define PROTECTED 0x40 /* a character is drawn that cannot be erased */ #define CHARDRAWN 0x80 /* a character has been drawn here on the screen. Used to distinguish blanks from empty parts of the screen when selecting */ -#if OPT_BLINK_CURS +#if OPT_BLINK_TEXT #define BOLDATTR(screen) (BOLD | ((screen)->blink_as_bold ? BLINK : 0)) #else #define BOLDATTR(screen) (BOLD | BLINK) #endif /* The following attributes make sense in the argument of drawXtermText() */ #define NOBACKGROUND 0x100 /* Used for overstrike */ #define NOTRANSLATION 0x200 /* No scan for chars missing in font */ #define NATIVEENCODING 0x400 /* strings are in the font encoding */ #define DOUBLEWFONT 0x800 /* The actual X-font is double-width */ #define DOUBLEHFONT 0x1000 /* The actual X-font is double-height */ #define CHARBYCHAR 0x2000 /* Draw chars one-by-one */ /* The toplevel-call to drawXtermText() should have text-attributes guarded: */ #define DRAWX_MASK 0xff /* text flags should be bitand'ed */ /* The following attribute makes sense in the argument of xtermSpecialFont etc */ #define NORESOLUTION 0x800000 /* find the font without resolution */ /* mask: user-visible attributes */ #define ATTRIBUTES (INVERSE|UNDERLINE|BOLD|BLINK|BG_COLOR|FG_COLOR|INVISIBLE|PROTECTED) + /* mask for video-attributes only */ +#define SGR_MASK (BOLD|BLINK|UNDERLINE|INVERSE) + #define WRAPAROUND 0x400 /* true if auto wraparound mode */ #define REVERSEWRAP 0x800 /* true if reverse wraparound mode */ #define REVERSE_VIDEO 0x1000 /* true if screen white on black */ #define LINEFEED 0x2000 /* true if in auto linefeed mode */ #define ORIGIN 0x4000 /* true if in origin mode */ #define INSERT 0x8000 /* true if in insert mode */ #define SMOOTHSCROLL 0x10000 /* true if in smooth scroll mode */ #define IN132COLUMNS 0x20000 /* true if in 132 column mode */ #define INVISIBLE 0x40000 /* true if writing invisible text */ #define NATIONAL 0x100000 /* true if writing national charset */ /* * Per-line flags */ #define LINEWRAPPED 0x01 /* used once per line to indicate that it wraps * onto the next line so we can tell the * difference between lines that have wrapped * around and lines that have ended naturally * with a CR at column max_col. */ @@ -1750,94 +1797,95 @@ */ #define OFF_PROTECT 0 #define DEC_PROTECT 1 #define ISO_PROTECT 2 #ifdef SCROLLBAR_RIGHT #define OriginX(screen) (((term->misc.useRight)?0:ScrollbarWidth(screen)) + screen->border) #else #define OriginX(screen) (ScrollbarWidth(screen) + screen->border) #endif #define CursorMoved(screen) \ ((screen)->cursor_moved || \ ((screen)->cursor_col != (screen)->cur_col || \ (screen)->cursor_row != (screen)->cur_row)) #define CursorX(screen,col) ((col) * FontWidth(screen) + OriginX(screen)) #define CursorY(screen,row) ((((row) - screen->topline) * FontHeight(screen)) \ + screen->border) +/* + * These definitions depend on whether xterm supports active-icon. + */ #ifndef NO_ACTIVE_ICON #define IsIcon(screen) ((screen)->whichVwin == &(screen)->iconVwin) -#define VWindow(screen) ((screen)->whichVwin->window) -#define VShellWindow XtWindow(SHELL_OF(term)) -#define TWindow(screen) ((screen)->whichTwin->window) -#define TShellWindow XtWindow(SHELL_OF(tekWidget)) -#define Width(screen) ((screen)->whichVwin->width) -#define Height(screen) ((screen)->whichVwin->height) -#define FullWidth(screen) ((screen)->whichVwin->fullwidth) -#define FullHeight(screen) ((screen)->whichVwin->fullheight) -#define FontWidth(screen) ((screen)->whichVwin->f_width) -#define FontHeight(screen) ((screen)->whichVwin->f_height) +#define WhichVWin(screen) ((screen)->whichVwin) +#define WhichTWin(screen) ((screen)->whichTwin) + +#define WhichVFont(screen,name) (IsIcon(screen) ? (screen)->fnt_icon \ + : (screen)->name) #define FontAscent(screen) (IsIcon(screen) ? (screen)->fnt_icon->ascent \ - : (screen)->whichVwin->f_ascent) + : WhichVWin(screen)->f_ascent) #define FontDescent(screen) (IsIcon(screen) ? (screen)->fnt_icon->descent \ - : (screen)->whichVwin->f_descent) -#define ScrollbarWidth(screen) ((screen)->whichVwin->sb_info.width) -#define NormalGC(screen) ((screen)->whichVwin->normalGC) -#define ReverseGC(screen) ((screen)->whichVwin->reverseGC) -#define NormalBoldGC(screen) ((screen)->whichVwin->normalboldGC) -#define ReverseBoldGC(screen) ((screen)->whichVwin->reverseboldGC) -#define TWidth(screen) ((screen)->whichTwin->width) -#define THeight(screen) ((screen)->whichTwin->height) -#define TFullWidth(screen) ((screen)->whichTwin->fullwidth) -#define TFullHeight(screen) ((screen)->whichTwin->fullheight) -#define TekScale(screen) ((screen)->whichTwin->tekscale) - + : WhichVWin(screen)->f_descent) #else /* NO_ACTIVE_ICON */ #define IsIcon(screen) (False) -#define VWindow(screen) ((screen)->fullVwin.window) +#define WhichVWin(screen) (&((screen)->fullVwin)) +#define WhichTWin(screen) (&((screen)->fullTwin)) + +#define WhichVFont(screen,name) (&(screen)->name) +#define FontAscent(screen) WhichVWin(screen)->f_ascent +#define FontDescent(screen) WhichVWin(screen)->f_descent + +#endif /* NO_ACTIVE_ICON */ + +/* + * These definitions do not depend on whether xterm supports active-icon. + */ +#define VWindow(screen) WhichVWin(screen)->window #define VShellWindow XtWindow(SHELL_OF(term)) -#define TWindow(screen) ((screen)->fullTwin.window) +#define TWindow(screen) WhichTWin(screen)->window #define TShellWindow XtWindow(SHELL_OF(tekWidget)) -#define Width(screen) ((screen)->fullVwin.width) -#define Height(screen) ((screen)->fullVwin.height) -#define FullWidth(screen) ((screen)->fullVwin.fullwidth) -#define FullHeight(screen) ((screen)->fullVwin.fullheight) -#define FontWidth(screen) ((screen)->fullVwin.f_width) -#define FontHeight(screen) ((screen)->fullVwin.f_height) -#define FontAscent(screen) ((screen)->fullVwin.f_ascent) -#define FontDescent(screen) ((screen)->fullVwin.f_descent) -#define ScrollbarWidth(screen) ((screen)->fullVwin.sb_info.width) -#define NormalGC(screen) ((screen)->fullVwin.normalGC) -#define ReverseGC(screen) ((screen)->fullVwin.reverseGC) -#define NormalBoldGC(screen) ((screen)->fullVwin.normalboldGC) -#define ReverseBoldGC(screen) ((screen)->fullVwin.reverseboldGC) -#define TWidth(screen) ((screen)->fullTwin.width) -#define THeight(screen) ((screen)->fullTwin.height) -#define TFullWidth(screen) ((screen)->fullTwin.fullwidth) -#define TFullHeight(screen) ((screen)->fullTwin.fullheight) -#define TekScale(screen) ((screen)->fullTwin.tekscale) -#endif /* NO_ACTIVE_ICON */ +#define Width(screen) WhichVWin(screen)->width +#define Height(screen) WhichVWin(screen)->height +#define FullWidth(screen) WhichVWin(screen)->fullwidth +#define FullHeight(screen) WhichVWin(screen)->fullheight +#define FontWidth(screen) WhichVWin(screen)->f_width +#define FontHeight(screen) WhichVWin(screen)->f_height + +#define NormalFont(screen) WhichVFont(screen, fnt_norm) +#define BoldFont(screen) WhichVFont(screen, fnt_bold) + +#define ScrollbarWidth(screen) WhichVWin(screen)->sb_info.width +#define NormalGC(screen) WhichVWin(screen)->normalGC +#define ReverseGC(screen) WhichVWin(screen)->reverseGC +#define NormalBoldGC(screen) WhichVWin(screen)->normalboldGC +#define ReverseBoldGC(screen) WhichVWin(screen)->reverseboldGC + +#define TWidth(screen) WhichTWin(screen)->width +#define THeight(screen) WhichTWin(screen)->height +#define TFullWidth(screen) WhichTWin(screen)->fullwidth +#define TFullHeight(screen) WhichTWin(screen)->fullheight +#define TekScale(screen) WhichTWin(screen)->tekscale #if OPT_TEK4014 #define TEK_LINK_BLOCK_SIZE 1024 typedef struct Tek_Link { struct Tek_Link *next; /* pointer to next TekLink in list NULL <=> this is last TekLink */ short fontsize; /* character size, 0-3 */ short count; /* number of chars in data */ char *ptr; /* current pointer into data */ char data [TEK_LINK_BLOCK_SIZE]; } TekLink; #endif /* OPT_TEK4014 */ /* flags for cursors */ #define OFF 0 #define ON 1 #define BLINKED_OFF 2 #define CLEAR 0 Index: xc/programs/xterm/resize.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/resize.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 resize.c --- xc/programs/xterm/resize.c 13 Aug 2004 12:57:21 -0000 1.3 +++ xc/programs/xterm/resize.c 6 Jan 2005 00:30:53 -0000 @@ -1,28 +1,30 @@ +/* $XTermId: resize.c,v 1.92 2004/12/01 01:27:47 tom Exp $ */ + /* * $Xorg: resize.c,v 1.3 2000/08/17 19:55:09 cpqbld Exp $ */ -/* $XFree86: xc/programs/xterm/resize.c,v 3.57 2004/04/03 22:26:26 dawes Exp $ */ +/* $XFree86: xc/programs/xterm/resize.c,v 3.58 2004/12/01 01:27:47 dickey Exp $ */ /* - * Copyright 2003 by Thomas E. Dickey + * Copyright 2003,2004 by Thomas E. Dickey * * All Rights Reserved * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE @@ -98,119 +100,119 @@ #ifndef bzero #define bzero(s, n) memset(s, 0, n) #endif #ifdef __MVS__ #define ESCAPE(string) "\047" string #else #define ESCAPE(string) "\033" string #endif #define EMULATIONS 2 #define SUN 1 #define VT100 0 #define TIMEOUT 10 #define SHELL_UNKNOWN 0 #define SHELL_C 1 #define SHELL_BOURNE 2 /* *INDENT-OFF* */ -struct { +static struct { char *name; int type; } shell_list[] = { { "csh", SHELL_C }, /* vanilla cshell */ { "tcsh", SHELL_C }, { "jcsh", SHELL_C }, { "sh", SHELL_BOURNE }, /* vanilla Bourne shell */ { "ksh", SHELL_BOURNE }, /* Korn shell (from AT&T toolchest) */ { "ksh-i", SHELL_BOURNE }, /* other name for latest Korn shell */ { "bash", SHELL_BOURNE }, /* GNU Bourne again shell */ { "jsh", SHELL_BOURNE }, { NULL, SHELL_BOURNE } /* default (same as xterm's) */ }; /* *INDENT-ON* */ -char *emuname[EMULATIONS] = +static char *emuname[EMULATIONS] = { "VT100", "Sun", }; -char *myname; -int shell_type = SHELL_UNKNOWN; -char *getsize[EMULATIONS] = +static char *myname; +static int shell_type = SHELL_UNKNOWN; +static char *getsize[EMULATIONS] = { ESCAPE("7") ESCAPE("[r") ESCAPE("[999;999H") ESCAPE("[6n"), ESCAPE("[18t"), }; #if defined(USE_STRUCT_TTYSIZE) #elif defined(USE_STRUCT_WINSIZE) -char *getwsize[EMULATIONS] = +static char *getwsize[EMULATIONS] = { /* size in pixels */ 0, ESCAPE("[14t"), }; #endif /* USE_STRUCT_{TTYSIZE|WINSIZE} */ -char *restore[EMULATIONS] = +static char *restore[EMULATIONS] = { ESCAPE("8"), 0, }; -char *setname = ""; -char *setsize[EMULATIONS] = +static char *setname = ""; +static char *setsize[EMULATIONS] = { 0, ESCAPE("[8;%s;%st"), }; #ifdef USE_ANY_SYSV_TERMIO -struct termio tioorig; +static struct termio tioorig; #elif defined(USE_TERMIOS) -struct termios tioorig; +static struct termios tioorig; #else -struct sgttyb sgorig; +static struct sgttyb sgorig; #endif /* USE_ANY_SYSV_TERMIO/USE_TERMIOS */ -char *size[EMULATIONS] = +static char *size[EMULATIONS] = { ESCAPE("[%d;%dR"), ESCAPE("[8;%d;%dt"), }; -char sunname[] = "sunsize"; -int tty; -FILE *ttyfp; +static char sunname[] = "sunsize"; +static int tty; +static FILE *ttyfp; #if defined(USE_STRUCT_TTYSIZE) #elif defined(USE_STRUCT_WINSIZE) -char *wsize[EMULATIONS] = +static char *wsize[EMULATIONS] = { 0, ESCAPE("[4;%hd;%hdt"), }; #endif /* USE_STRUCT_{TTYSIZE|WINSIZE} */ static SIGNAL_T onintr(int sig); static SIGNAL_T resize_timeout(int sig); static int checkdigits(char *str); static void Usage(void); -static void readstring(FILE * fp, char *buf, char *str); +static void readstring(FILE *fp, char *buf, char *str); #undef US /* may conflict with curses.h */ #ifdef USE_TERMCAP #ifdef HAVE_TERMCAP_H #include #if defined(NCURSES_VERSION) /* The tgetent emulation function in SVr4-style curses implementations * (e.g., ncurses) ignores the buffer, so TERMCAP can't be set from it. * Instead, just use terminfo. */ #undef USE_TERMCAP #include #endif #else #undef ERR /* workaround for glibc 2.1.3 */ #include #ifdef NCURSES_VERSION #ifdef HAVE_NCURSES_TERM_H #include @@ -513,41 +515,41 @@ #ifdef USE_TERMINFO printf("set noglob;\n%ssetenv COLUMNS '%d';\nsetenv LINES '%d';\nunset noglob;\n", setname, cols, rows); #endif /* USE_TERMINFO */ } exit(0); } static int checkdigits(register char *str) { while (*str) { if (!isdigit(CharOf(*str))) return (0); str++; } return (1); } static void -readstring(register FILE * fp, register char *buf, char *str) +readstring(register FILE *fp, register char *buf, char *str) { register int last, c; #if !defined(USG) && !defined(__UNIXOS2__) /* What is the advantage of setitimer() over alarm()? */ struct itimerval it; #endif signal(SIGALRM, resize_timeout); #if defined(USG) || defined(__UNIXOS2__) alarm(TIMEOUT); #else bzero((char *) &it, sizeof(struct itimerval)); it.it_value.tv_sec = TIMEOUT; setitimer(ITIMER_REAL, &it, (struct itimerval *) NULL); #endif if ((c = getc(fp)) == 0233) { /* meta-escape, CSI */ *buf++ = c = ESCAPE("")[0]; *buf++ = '['; } else { *buf++ = c; Index: xc/programs/xterm/screen.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/screen.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 screen.c --- xc/programs/xterm/screen.c 13 Aug 2004 12:57:21 -0000 1.3 +++ xc/programs/xterm/screen.c 6 Jan 2005 00:30:54 -0000 @@ -1,20 +1,22 @@ +/* $XTermId: screen.c,v 1.149 2004/12/01 01:27:47 tom Exp $ */ + /* * $Xorg: screen.c,v 1.3 2000/08/17 19:55:09 cpqbld Exp $ */ /* * Copyright 1999-2003,2004 by Thomas E. Dickey * * All Rights Reserved * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * @@ -37,57 +39,62 @@ * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appear in all copies and that * both that copyright notice and this permission notice appear in * supporting documentation, and that the name of Digital Equipment * Corporation not be used in advertising or publicity pertaining to * distribution of the software without specific, written prior permission. * * * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ -/* $XFree86: xc/programs/xterm/screen.c,v 3.66 2004/03/04 02:21:56 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/screen.c,v 3.67 2004/12/01 01:27:47 dickey Exp $ */ /* screen.c */ #include #include #include #include #include #include #if OPT_WIDE_CHARS #include #endif #include +#define getMinRow(screen) ((term->flags & ORIGIN) ? (screen)->top_marg : 0) +#define getMaxRow(screen) ((term->flags & ORIGIN) ? (screen)->bot_marg : (screen)->max_row) +#define getMinCol(screen) 0 +#define getMaxCol(screen) ((screen)->max_col) + /* * 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 * (i.e., the ScrnBuf type). The first pointer in the index is reserved for * per-line flags, and does not point to data. * * After the per-line flags, we have a series of pointers to char arrays: The * first one is the actual character array, the second one is the attributes, * the third is the foreground and background colors, and the fourth denotes * the character set. * * We store it all as pointers, because of alignment considerations, together * with the intention of being able to change the total number of pointers per * row according to whether the user wants color or not. */ ScrnBuf Allocate(int nrow, int ncol, Char ** addr) { ScrnBuf base; Char *tmp; @@ -287,251 +294,264 @@ if (screen->wide_chars) return; if (xtermLoadVTFonts(term, "utf8Fonts", "Utf8Fonts")) { ReallocateBufOffsets(&screen->allbuf, &screen->sbuf_address, screen->max_row + 1 + savelines, screen->max_col + 1, new_bufoffset); if (screen->altbuf) ReallocateBufOffsets(&screen->altbuf, &screen->abuf_address, screen->max_row + 1, screen->max_col + 1, new_bufoffset); screen->wide_chars = True; term->num_ptrs = new_bufoffset; screen->visbuf = &screen->allbuf[MAX_PTRS * savelines]; } } #endif -int last_written_row = -1; -int last_written_col = -1; +/* + * Disown the selection and repaint the area that is highlighted so it is no + * longer highlighted. + */ +void +ScrnDisownSelection(TScreen * screen) +{ + if (ScrnHaveSelection(screen)) { + DisownSelection(term); + } +} /* * Writes str into buf at screen's current row and column. Characters are set * to match flags. */ void ScreenWrite(TScreen * screen, PAIRED_CHARS(Char * str, Char * str2), unsigned flags, unsigned cur_fg_bg, int len) /* length of string */ { #if OPT_ISO_COLORS #if OPT_EXT_COLORS Char *fbf = 0; Char *fbb = 0; #else Char *fb = 0; #endif #endif #if OPT_DEC_CHRSET Char *cb = 0; #endif int length = len; /* workaround for compiler bug? */ Char *attrs; int avail = screen->max_col - screen->cur_col + 1; - Char *col; + Char *chars; int wrappedbit; #if OPT_WIDE_CHARS - Char starcol, starcol2; + Char starcol1, starcol2; Char *comb1l = 0, *comb1h = 0, *comb2l = 0, *comb2h = 0; #endif #if OPT_WIDE_CHARS int real_width = visual_width(PAIRED_CHARS(str, str2), length); #else int real_width = length; #endif if (length > avail) length = avail; if (length <= 0) return; - col = SCRN_BUF_CHARS(screen, screen->cur_row) + screen->cur_col; + chars = SCRN_BUF_CHARS(screen, screen->cur_row) + screen->cur_col; attrs = SCRN_BUF_ATTRS(screen, screen->cur_row) + screen->cur_col; if_OPT_WIDE_CHARS(screen, { comb1l = SCRN_BUF_COM1L(screen, screen->cur_row) + screen->cur_col; comb1h = SCRN_BUF_COM1H(screen, screen->cur_row) + screen->cur_col; comb2l = SCRN_BUF_COM2L(screen, screen->cur_row) + screen->cur_col; comb2h = SCRN_BUF_COM2H(screen, screen->cur_row) + screen->cur_col; }); if_OPT_EXT_COLORS(screen, { fbf = SCRN_BUF_FGRND(screen, screen->cur_row) + screen->cur_col; fbb = SCRN_BUF_BGRND(screen, screen->cur_row) + screen->cur_col; }); if_OPT_ISO_TRADITIONAL_COLORS(screen, { fb = SCRN_BUF_COLOR(screen, screen->cur_row) + screen->cur_col; }); if_OPT_DEC_CHRSET({ cb = SCRN_BUF_CSETS(screen, screen->cur_row) + screen->cur_col; }); wrappedbit = ScrnTstWrapped(screen, screen->cur_row); #if OPT_WIDE_CHARS - starcol = *col; - starcol2 = col[length - 1]; + starcol1 = *chars; + starcol2 = chars[length - 1]; #endif /* write blanks if we're writing invisible text */ if (flags & INVISIBLE) { - memset(col, ' ', length); + memset(chars, ' ', length); } else { - memcpy(col, str, length); /* This can stand for the present. If it + memcpy(chars, str, length); /* This can stand for the present. If it is wrong, we will scribble over it */ } #if OPT_BLINK_TEXT if ((flags & BLINK) && !(screen->blink_as_bold)) { ScrnSetBlinked(screen, screen->cur_row); } #endif #define ERROR_1 0x20 #define ERROR_2 0x00 if_OPT_WIDE_CHARS(screen, { - Char *wc; + Char *char2; if (real_width != length) { - Char *c = col; - wc = SCRN_BUF_WIDEC(screen, screen->cur_row); - wc += screen->cur_col; - if (screen->cur_col && starcol == HIDDEN_LO && *wc == HIDDEN_HI - && iswide(c[-1] | (wc[-1] << 8))) { - c[-1] = ERROR_1; - wc[-1] = ERROR_2; + Char *char1 = chars; + char2 = SCRN_BUF_WIDEC(screen, screen->cur_row); + char2 += screen->cur_col; + if (screen->cur_col && starcol1 == HIDDEN_LO && *char2 == HIDDEN_HI + && iswide(char1[-1] | (char2[-1] << 8))) { + char1[-1] = ERROR_1; + char2[-1] = ERROR_2; } /* if we are overwriting the right hand half of a wide character, make the other half vanish */ while (length) { int ch = *str; if (str2) ch |= *str2 << 8; - *c = *str; - c++; + *char1 = *str; + char1++; str++; if (str2) { - *wc = *str2; + *char2 = *str2; str2++; } else - *wc = 0; - wc++; + *char2 = 0; + char2++; length--; if (iswide(ch)) { - *c = HIDDEN_LO; - *wc = HIDDEN_HI; - c++; - wc++; + *char1 = HIDDEN_LO; + *char2 = HIDDEN_HI; + char1++; + char2++; } } - if (*c == HIDDEN_LO - && *wc == HIDDEN_HI - && c[-1] == HIDDEN_LO - && wc[-1] == HIDDEN_HI) { - *c = ERROR_1; - *wc = ERROR_2; + if (*char1 == HIDDEN_LO + && *char2 == HIDDEN_HI + && char1[-1] == HIDDEN_LO + && char2[-1] == HIDDEN_HI) { + *char1 = ERROR_1; + *char2 = ERROR_2; } /* if we are overwriting the left hand half of a wide character, make the other half vanish */ } else { - if ((wc = SCRN_BUF_WIDEC(screen, screen->cur_row)) != 0) { - wc += screen->cur_col; - if (screen->cur_col && starcol == HIDDEN_LO && *wc == HIDDEN_HI - && iswide(col[-1] | (wc[-1] << 8))) { - col[-1] = ERROR_1; - wc[-1] = ERROR_2; + if ((char2 = SCRN_BUF_WIDEC(screen, screen->cur_row)) != 0) { + char2 += screen->cur_col; + if (screen->cur_col && starcol1 == HIDDEN_LO && *char2 == HIDDEN_HI + && iswide(chars[-1] | (char2[-1] << 8))) { + chars[-1] = ERROR_1; + char2[-1] = ERROR_2; } /* if we are overwriting the right hand half of a wide character, make the other half vanish */ - if (col[length] == HIDDEN_LO && wc[length] == HIDDEN_HI && - iswide(starcol2 | (wc[length - 1] << 8))) { - col[length] = ERROR_1; - wc[length] = ERROR_2; + if (chars[length] == HIDDEN_LO && char2[length] == HIDDEN_HI && + iswide(starcol2 | (char2[length - 1] << 8))) { + chars[length] = ERROR_1; + char2[length] = ERROR_2; } /* if we are overwriting the left hand half of a wide character, make the other half vanish */ if ((flags & INVISIBLE) || (str2 == 0)) - memset(wc, 0, length); + memset(char2, 0, length); else - memcpy(wc, str2, length); + memcpy(char2, str2, length); } } }); flags &= ATTRIBUTES; flags |= CHARDRAWN; memset(attrs, flags, real_width); if_OPT_WIDE_CHARS(screen, { memset(comb1l, 0, real_width); memset(comb2l, 0, real_width); memset(comb1h, 0, real_width); memset(comb2h, 0, real_width); }); if_OPT_EXT_COLORS(screen, { memset(fbf, cur_fg_bg >> 8, real_width); memset(fbb, cur_fg_bg & 0xff, real_width); }); if_OPT_ISO_TRADITIONAL_COLORS(screen, { memset(fb, cur_fg_bg, real_width); }); if_OPT_DEC_CHRSET({ memset(cb, curXtermChrSet(screen->cur_row), real_width); }); if (wrappedbit) ScrnSetWrapped(screen, screen->cur_row); else ScrnClrWrapped(screen, screen->cur_row); - last_written_col = screen->cur_col + real_width - 1; - last_written_row = screen->cur_row; + if_OPT_WIDE_CHARS(screen, { + screen->last_written_col = screen->cur_col + real_width - 1; + screen->last_written_row = screen->cur_row; + }); if_OPT_XMC_GLITCH(screen, { Resolve_XMC(screen); }); } /* * Saves pointers to the n lines beginning at sb + where, and clears the lines */ static void ScrnClearLines(TScreen * screen, ScrnBuf sb, int where, int n, int size) { int i, j; size_t len = ScrnPointers(screen, n); int last = (n * MAX_PTRS); + TRACE(("ScrnClearLines(where %d, n %d, size %d)\n", where, n, size)); + /* save n lines at where */ memcpy((char *) screen->save_ptr, (char *) &sb[MAX_PTRS * where], len); /* clear contents of old rows */ if (TERM_COLOR_FLAGS) { int flags = TERM_COLOR_FLAGS; for (i = 0; i < last; i += MAX_PTRS) { for (j = 0; j < MAX_PTRS; j++) { if (j < BUF_HEAD) screen->save_ptr[i + j] = 0; else if (j == OFF_ATTRS) memset(screen->save_ptr[i + j], flags, size); #if OPT_ISO_COLORS #if OPT_EXT_COLORS else if (j == OFF_FGRND) memset(screen->save_ptr[i + j], term->sgr_foreground, size); else if (j == OFF_BGRND) memset(screen->save_ptr[i + j], term->cur_background, size); @@ -812,40 +832,43 @@ screen->cursor_state = OFF; for (row = toprow; row <= maxrow; y += FontHeight(screen), row++) { #if OPT_ISO_COLORS #if OPT_EXT_COLORS Char *fbf = 0; Char *fbb = 0; #define ColorOf(col) ((fbf[col] << 8) | fbb[col]) #else Char *fb = 0; #define ColorOf(col) (fb[col]) #endif #endif #if OPT_DEC_CHRSET Char *cb = 0; #endif #if OPT_WIDE_CHARS int wideness = 0; Char *widec = 0; #define WIDEC_PTR(cell) widec ? &widec[cell] : 0 +#define BLANK_CEL(cell) ((chars[cell] == ' ') && (widec == 0 || widec[cell] == 0)) +#else +#define BLANK_CEL(cell) (chars[cell] == ' ') #endif Char cs = 0; Char *chars; Char *attrs; int col = leftcol; int maxcol = leftcol + ncols - 1; int hi_col = maxcol; int lastind; int flags; int test; int fg_bg = 0, fg = 0, bg = 0; int x; GC gc; Boolean hilite; if (row < screen->top_marg || row > screen->bot_marg) lastind = row; else lastind = row - scrollamt; @@ -879,48 +902,50 @@ col = leftcol; } } else { fprintf(stderr, "This should not happen. Why is it so?\n"); } }); if (row < screen->startHRow || row > screen->endHRow || (row == screen->startHRow && maxcol < screen->startHCol) || (row == screen->endHRow && col >= screen->endHCol)) { #if OPT_DEC_CHRSET /* * Temporarily change dimensions to double-sized characters so * we can reuse the recursion on this function. */ if (CSET_DOUBLE(*cb)) { col /= 2; maxcol /= 2; } #endif - /* row does not intersect selection; don't hilite */ + /* + * If row does not intersect selection; don't hilite blanks. + */ if (!force) { while (col <= maxcol && (attrs[col] & ~BOLD) == 0 && - (chars[col] & ~040) == 0) + BLANK_CEL(col)) col++; while (col <= maxcol && (attrs[maxcol] & ~BOLD) == 0 && - (chars[maxcol] & ~040) == 0) + BLANK_CEL(maxcol)) maxcol--; } #if OPT_DEC_CHRSET if (CSET_DOUBLE(*cb)) { col *= 2; maxcol *= 2; } #endif hilite = False; } else { /* row intersects selection; split into pieces of single type */ if (row == screen->startHRow && col < screen->startHCol) { recurse++; ScrnRefresh(screen, row, col, 1, screen->startHCol - col, force); col = screen->startHCol; } if (row == screen->endHRow && maxcol >= screen->endHCol) { recurse++; ScrnRefresh(screen, row, screen->endHCol, 1, @@ -1158,40 +1183,60 @@ if (gc_changes & BG_COLOR) SGR_Background(term->cur_background); }); #if defined(__CYGWIN__) && defined(TIOCSWINSZ) if (first_time == 1) { TTYSIZE_STRUCT ts; first_time = 0; TTYSIZE_ROWS(ts) = nrows; TTYSIZE_COLS(ts) = ncols; ts.ws_xpixel = term->core.width; ts.ws_ypixel = term->core.height; SET_TTYSIZE(screen->respond, ts); } #endif recurse--; } /* + * Call this wrapper to ScrnRefresh() when the data has changed. If the + * refresh region overlaps the selection, we will release the primary selection. + */ +void +ScrnUpdate(TScreen * screen, + int toprow, + int leftcol, + int nrows, + int ncols, + Bool force) /* ... leading/trailing spaces */ +{ + if (ScrnHaveSelection(screen) + && (toprow <= screen->endHRow) + && (toprow + nrows - 1 >= screen->startHRow)) { + ScrnDisownSelection(screen); + } + ScrnRefresh(screen, toprow, leftcol, nrows, ncols, force); +} + +/* * Sets the rows first though last of the buffer of screen to spaces. * Requires first <= last; first, last are rows of screen->buf. */ void ClearBufRows(TScreen * screen, int first, int last) { ScrnBuf buf = screen->visbuf; int len = screen->max_col + 1; int row; int flags = TERM_COLOR_FLAGS; TRACE(("ClearBufRows %d..%d\n", first, last)); for (row = first; row <= last; row++) { ScrnClrWrapped(screen, row); bzero(BUF_CHARS(buf, row), len); memset(BUF_ATTRS(buf, row), flags, len); if_OPT_EXT_COLORS(screen, { memset(BUF_FGRND(buf, row), term->sgr_foreground, len); @@ -1295,41 +1340,41 @@ move_down_by = Reallocate(&screen->allbuf, &screen->sbuf_address, rows + savelines, cols, screen->max_row + 1 + savelines, screen->max_col + 1); screen->visbuf = &screen->allbuf[MAX_PTRS * savelines]; screen->max_row += delta_rows; screen->max_col = cols - 1; if (term->misc.resizeGravity == SouthWestGravity) { screen->savedlines -= move_down_by; if (screen->savedlines < 0) screen->savedlines = 0; if (screen->savedlines > screen->savelines) screen->savedlines = screen->savelines; if (screen->topline < -screen->savedlines) screen->topline = -screen->savedlines; screen->cur_row += move_down_by; screen->cursor_row += move_down_by; - ScrollSelection(screen, move_down_by); + ScrollSelection(screen, move_down_by, True); if (screen->alternate) SwitchBufPtrs(screen); /* put the pointers back */ } /* adjust scrolling region */ screen->top_marg = 0; screen->bot_marg = screen->max_row; *flags &= ~ORIGIN; if (screen->cur_row > screen->max_row) screen->cur_row = screen->max_row; if (screen->cur_col > screen->max_col) screen->cur_col = screen->max_col; screen->fullVwin.height = height - border; screen->fullVwin.width = width - border - screen->fullVwin.sb_info.width; } else if (FullHeight(screen) == height && FullWidth(screen) == width) return (0); /* nothing has changed at all */ @@ -1401,20 +1446,318 @@ { int i; Char *ptr = BUF_CHARS(sb, row); for (i = col; i < len; i++) { if (ptr[i]) return True; } if_OPT_WIDE_CHARS((&(term->screen)), { if ((ptr = BUF_WIDEC(sb, row)) != 0) { for (i = col; i < len; i++) { if (ptr[i]) return True; } } }); return False; } + +/* + * Copy the rectangle boundaries into a struct, providing default values as + * needed. + */ +void +xtermParseRect(TScreen * screen, int nparams, int *params, XTermRect * target) +{ + memset(target, 0, sizeof(*target)); + target->top = (nparams > 0) ? params[0] : getMinRow(screen) + 1; + target->left = (nparams > 1) ? params[1] : getMinCol(screen) + 1; + target->bottom = (nparams > 2) ? params[2] : getMaxRow(screen) + 1; + target->right = (nparams > 3) ? params[3] : getMaxCol(screen) + 1; + TRACE(("parsed rectangle %d,%d %d,%d\n", + target->top, + target->left, + target->bottom, + target->right)); +} + +static Bool +validRect(TScreen * screen, XTermRect * target) +{ + TRACE(("comparing against screensize %dx%d\n", + getMaxRow(screen) + 1, + getMaxCol(screen) + 1)); + return (target != 0 + && target->top > getMinRow(screen) + && target->left > getMinCol(screen) + && target->top <= target->bottom + && target->left <= target->right + && target->top <= getMaxRow(screen) + 1 + && target->right <= getMaxCol(screen) + 1); +} + +/* + * Fills a rectangle with the given character and video-attributes. + */ +void +ScrnFillRectangle(TScreen * screen, XTermRect * target, Char value, unsigned flags) +{ + TRACE(("filling rectangle with '%c'\n", value)); + if (validRect(screen, target)) { + int left = target->left - 1; + int size = target->right - left; + int row; + + flags &= ATTRIBUTES; + flags |= CHARDRAWN; + for (row = target->bottom - 1; row >= (target->top - 1); row--) { + TRACE(("filling %d [%d..%d]\n", row, left + 1, left + size)); + memset(SCRN_BUF_ATTRS(screen, row) + left, flags, size); + memset(SCRN_BUF_CHARS(screen, row) + left, value, size); + if_OPT_WIDE_CHARS(screen, { + bzero(SCRN_BUF_WIDEC(screen, row) + left, size); + }); + } + ScrnUpdate(screen, + target->top - 1, + target->left - 1, + (target->bottom - target->top) + 1, + (target->right - target->left) + 1, + False); + } +} + +#if OPT_DEC_RECTOPS +/* + * Copies the source rectangle to the target location, including video + * attributes. + * + * This implementation ignores page numbers. + * + * The reference manual does not indicate if it handles overlapping copy + * properly - so we make a local copy of the source rectangle first, then apply + * the target from that. + */ +void +ScrnCopyRectangle(TScreen * screen, XTermRect * source, int nparam, int *params) +{ + TRACE(("copying rectangle\n")); + + if (validRect(screen, source)) { + XTermRect target; + xtermParseRect(screen, + ((nparam > 3) ? 2 : (nparam - 1)), + params + 1, + &target); + if (validRect(screen, &target)) { + int high = (source->bottom - source->top) + 1; + int wide = (source->right - source->left) + 1; + int size = (high * wide); + int row, col, n; + + Char *attrs = malloc(size); + Char *chars = malloc(size); + +#if OPT_WIDE_CHARS + Char *widec = malloc(size); + if (widec == 0) + return; +#endif + if (attrs == 0 + || chars == 0) + return; + + TRACE(("OK - make copy %dx%d\n", high, wide)); + target.bottom = target.top + (high - 1); + target.right = target.left + (wide - 1); + + for (row = source->top - 1; row < source->bottom; ++row) { + for (col = source->left - 1; col < source->right; ++col) { + n = ((1 + row - source->top) * wide) + (1 + col - source->left); + attrs[n] = SCRN_BUF_ATTRS(screen, row)[col] | CHARDRAWN; + chars[n] = SCRN_BUF_CHARS(screen, row)[col]; + if_OPT_WIDE_CHARS(screen, { + widec[n] = SCRN_BUF_WIDEC(screen, row)[col]; + }) + } + } + for (row = target.top - 1; row < target.bottom; ++row) { + for (col = target.left - 1; col < target.right; ++col) { + if (row >= getMinRow(screen) + && row <= getMaxRow(screen) + && col >= getMinCol(screen) + && col <= getMaxCol(screen)) { + n = ((1 + row - target.top) * wide) + (1 + col - target.left); + SCRN_BUF_ATTRS(screen, row)[col] = attrs[n]; + SCRN_BUF_CHARS(screen, row)[col] = chars[n]; + if_OPT_WIDE_CHARS(screen, { + SCRN_BUF_WIDEC(screen, row)[col] = widec[n]; + }) + } + } + } + free(attrs); + free(chars); +#if OPT_WIDE_CHARS + free(widec); +#endif + + ScrnUpdate(screen, + (target.top - 1), + (target.left - 1), + (target.bottom - target.top) + 1, + ((target.right - target.left) + 1), + False); + } + } +} + +/* + * Modifies the video-attributes only - so selection is unaffected. + */ +void +ScrnMarkRectangle(TScreen * screen, + XTermRect * target, + Bool reverse, + int nparam, + int *params) +{ + Bool exact = (screen->cur_decsace == 2); + + TRACE(("%s %s\n", + reverse ? "reversing" : "marking", + (exact + ? "rectangle" + : "region"))); + + if (validRect(screen, target)) { + int top = target->top - 1; + int bottom = target->bottom - 1; + int row, col; + int n; + + for (row = top; row <= bottom; ++row) { + int left = ((exact || (row == top)) + ? (target->left - 1) + : getMinCol(screen)); + int right = ((exact || (row == bottom)) + ? (target->right - 1) + : getMaxCol(screen)); + + TRACE(("marking %d [%d..%d]\n", row, left + 1, right + 1)); + for (col = left; col <= right; ++col) { + unsigned flags = SCRN_BUF_ATTRS(screen, row)[col]; + + for (n = 0; n < nparam; ++n) { +#if OPT_TRACE + if (row == top && col == left) + TRACE(("attr param[%d] %d\n", n + 1, params[n])); +#endif + if (reverse) { + switch (params[n]) { + case 1: + flags ^= BOLD; + break; + case 4: + flags ^= UNDERLINE; + break; + case 5: + flags ^= BLINK; + break; + case 7: + flags ^= INVERSE; + break; + } + } else { + switch (params[n]) { + case 0: + flags &= ~SGR_MASK; + break; + case 1: + flags |= BOLD; + break; + case 4: + flags |= UNDERLINE; + break; + case 5: + flags |= BLINK; + break; + case 7: + flags |= INVERSE; + break; + case 22: + flags &= ~BOLD; + break; + case 24: + flags &= ~UNDERLINE; + break; + case 25: + flags &= ~BLINK; + break; + case 27: + flags &= ~INVERSE; + break; + } + } + } +#if OPT_TRACE + if (row == top && col == left) + TRACE(("first mask-change is %#x\n", + SCRN_BUF_ATTRS(screen, row)[col] ^ flags)); +#endif + SCRN_BUF_ATTRS(screen, row)[col] = flags; + } + } + ScrnRefresh(screen, + (target->top - 1), + (exact ? (target->left - 1) : getMinCol(screen)), + (target->bottom - target->top) + 1, + (exact + ? ((target->right - target->left) + 1) + : (getMaxCol(screen) - getMinCol(screen) + 1)), + False); + } +} + +/* + * Resets characters to space, except where prohibited by DECSCA. Video + * attributes are untouched. + */ +void +ScrnWipeRectangle(TScreen * screen, + XTermRect * target) +{ + TRACE(("wiping rectangle\n")); + + if (validRect(screen, target)) { + int top = target->top - 1; + int bottom = target->bottom - 1; + int row, col; + + for (row = top; row <= bottom; ++row) { + int left = (target->left - 1); + int right = (target->right - 1); + + TRACE(("wiping %d [%d..%d]\n", row, left + 1, right + 1)); + for (col = left; col <= right; ++col) { + if (!((screen->protected_mode == DEC_PROTECT) + && (SCRN_BUF_ATTRS(screen, row)[col] & PROTECTED))) { + SCRN_BUF_ATTRS(screen, row)[col] |= CHARDRAWN; + SCRN_BUF_CHARS(screen, row)[col] = ' '; + if_OPT_WIDE_CHARS(screen, { + SCRN_BUF_WIDEC(screen, row)[col] = '\0'; + }) + } + } + } + ScrnUpdate(screen, + (target->top - 1), + (target->left - 1), + (target->bottom - target->top) + 1, + ((target->right - target->left) + 1), + False); + } +} +#endif /* OPT_DEC_RECTOPS */ Index: xc/programs/xterm/scrollbar.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/scrollbar.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 scrollbar.c --- xc/programs/xterm/scrollbar.c 13 Aug 2004 12:57:21 -0000 1.3 +++ xc/programs/xterm/scrollbar.c 6 Jan 2005 00:30:55 -0000 @@ -1,28 +1,28 @@ /* * $Xorg: scrollbar.c,v 1.4 2000/08/17 19:55:09 cpqbld Exp $ */ -/* $XFree86: xc/programs/xterm/scrollbar.c,v 3.39 2003/10/20 00:58:55 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/scrollbar.c,v 3.40 2004/12/01 01:27:47 dickey Exp $ */ /* - * Copyright 2000-2002,2003 by Thomas E. Dickey + * Copyright 2000-2003,2004 by Thomas E. Dickey * * All Rights Reserved * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE @@ -78,44 +78,44 @@ /* Event handlers */ static void ScrollTextTo PROTO_XT_CALLBACK_ARGS; static void ScrollTextUpDownBy PROTO_XT_CALLBACK_ARGS; /* resize the text window for a terminal screen, modifying the * appropriate WM_SIZE_HINTS and taking advantage of bit gravity. */ static void ResizeScreen(XtermWidget xw, int min_width, int min_height) { TScreen *screen = &xw->screen; #ifndef nothack XSizeHints sizehints; long supp; #endif XtGeometryResult geomreqresult; Dimension reqWidth, reqHeight, repWidth, repHeight; #ifndef NO_ACTIVE_ICON - struct _vtwin *saveWin = screen->whichVwin; + struct _vtwin *saveWin = WhichVWin(screen); /* all units here want to be in the normal font units */ - screen->whichVwin = &screen->fullVwin; + WhichVWin(screen) = &screen->fullVwin; #endif /* NO_ACTIVE_ICON */ /* * I'm going to try to explain, as I understand it, why we * have to do XGetWMNormalHints and XSetWMNormalHints here, * although I can't guarantee that I've got it right. * * In a correctly written toolkit program, the Shell widget * parses the user supplied geometry argument. However, * because of the way xterm does things, the VT100 widget does * the parsing of the geometry option, not the Shell widget. * The result of this is that the Shell widget doesn't set the * correct window manager hints, and doesn't know that the * user has specified a geometry. * * The XtVaSetValues call below tells the Shell widget to * change its hints. However, since it's confused about the * hints to begin with, it doesn't get them all right when it * does the SetValues -- it undoes some of what the VT100 * widget did when it originally set the hints. @@ -192,41 +192,41 @@ (screen->max_row + 1), (screen->max_col + 1), reqHeight, reqWidth)); geomreqresult = XtMakeResizeRequest((Widget) xw, reqWidth, reqHeight, &repWidth, &repHeight); if (geomreqresult == XtGeometryAlmost) { TRACE(("...almost, retry screensize %dx%d\n", repHeight, repWidth)); geomreqresult = XtMakeResizeRequest((Widget) xw, repWidth, repHeight, NULL, NULL); } XSync(screen->display, FALSE); /* synchronize */ if (XtAppPending(app_con)) xevents(); #ifndef nothack XSetWMNormalHints(screen->display, XtWindow(XtParent(xw)), &sizehints); #endif #ifndef NO_ACTIVE_ICON - screen->whichVwin = saveWin; + WhichVWin(screen) = saveWin; #endif /* NO_ACTIVE_ICON */ } void DoResizeScreen(XtermWidget xw) { int border = 2 * xw->screen.border; ResizeScreen(xw, border + xw->screen.fullVwin.sb_info.width, border); } static Widget CreateScrollBar(XtermWidget xw, int x, int y, int height) { Widget scrollWidget; Arg args[6]; XtSetArg(args[0], XtNx, x); XtSetArg(args[1], XtNy, y); XtSetArg(args[2], XtNheight, height); XtSetArg(args[3], XtNreverseVideo, xw->misc.re_verse); @@ -326,41 +326,41 @@ ScrollBarDrawThumb(screen->scrollWidget); return; } if (screen->cursor_state) HideCursor(); lines = i > 0 ? i : -i; if (lines > screen->max_row + 1) lines = screen->max_row + 1; scrollheight = screen->max_row - lines + 1; if (i > 0) refreshtop = scrolltop = 0; else { scrolltop = lines; refreshtop = scrollheight; } x = OriginX(screen); scrolling_copy_area(screen, scrolltop, scrollheight, -i); screen->topline = top; - ScrollSelection(screen, i); + ScrollSelection(screen, i, True); XClearArea( screen->display, VWindow(screen), (int) x, (int) refreshtop * FontHeight(screen) + screen->border, (unsigned) Width(screen), (unsigned) lines * FontHeight(screen), FALSE); ScrnRefresh(screen, refreshtop, 0, lines, screen->max_col + 1, False); ScrollBarDrawThumb(screen->scrollWidget); } void ScrollBarOn(XtermWidget xw, int init, int doalloc) { TScreen *screen = &xw->screen; int i, j, k; @@ -604,43 +604,43 @@ && screen->send_mouse_pos != MOUSE_OFF) return 0; return params_to_pixels(screen, params, nparams); } else { /* * This may have been the scrollbar widget. Try its parent, which * would be the VT100 widget. */ return AmountToScroll(XtParent(gw), params, nparams); } } return 0; } /*ARGSUSED*/ void HandleScrollForward( Widget gw, XEvent * event GCC_UNUSED, String * params, - Cardinal * nparams) + Cardinal *nparams) { long amount; if ((amount = AmountToScroll(gw, params, *nparams)) != 0) { ScrollTextUpDownBy(gw, (XtPointer) 0, (XtPointer) amount); } } /*ARGSUSED*/ void HandleScrollBack( Widget gw, XEvent * event GCC_UNUSED, String * params, - Cardinal * nparams) + Cardinal *nparams) { long amount; if ((amount = -AmountToScroll(gw, params, *nparams)) != 0) { ScrollTextUpDownBy(gw, (XtPointer) 0, (XtPointer) amount); } } Index: xc/programs/xterm/testxmc.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/testxmc.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 testxmc.c --- xc/programs/xterm/testxmc.c 13 Aug 2004 12:57:21 -0000 1.3 +++ xc/programs/xterm/testxmc.c 6 Jan 2005 00:30:55 -0000 @@ -1,24 +1,24 @@ -/* $XTermId: testxmc.c,v 1.23 2004/04/18 20:49:43 tom Exp $ */ +/* $XTermId: testxmc.c,v 1.25 2004/12/01 01:27:47 tom Exp $ */ /* - * $XFree86: xc/programs/xterm/testxmc.c,v 3.10 2004/04/18 20:49:43 dickey Exp $ + * $XFree86: xc/programs/xterm/testxmc.c,v 3.11 2004/12/01 01:27:47 dickey Exp $ */ /************************************************************ Copyright 1997-2002,2004 by Thomas E. Dickey All Rights Reserved Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS @@ -203,24 +203,24 @@ col = 0; } else break; if (getXtermCell(screen, row, col) == XMC_GLITCH) break; if ((SCRN_BUF_ATTRS(screen, row)[col] & my_attrs) != start) { SCRN_BUF_ATTRS(screen, row)[col] = start | (SCRN_BUF_ATTRS(screen, row)[col] & ~my_attrs); changed = True; } } TRACE(("XMC %s (%s:%d/%d) from %d,%d to %d,%d\n", changed ? "Ripple" : "Nochange", BtoS(term->flags & my_attrs), my_attrs, start, screen->cur_row, screen->cur_col, row, col)); if (changed) { - ScrnRefresh(screen, screen->cur_row, 0, row + 1 - screen->cur_row, + ScrnUpdate(screen, screen->cur_row, 0, row + 1 - screen->cur_row, screen->max_col + 1, True); } } Index: xc/programs/xterm/trace.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/trace.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 trace.c --- xc/programs/xterm/trace.c 13 Aug 2004 12:57:21 -0000 1.3 +++ xc/programs/xterm/trace.c 6 Jan 2005 00:30:55 -0000 @@ -1,24 +1,24 @@ -/* $XTermId: trace.c,v 1.53 2004/07/20 01:14:41 tom Exp $ */ +/* $XTermId: trace.c,v 1.56 2004/12/01 01:27:47 tom Exp $ */ /* - * $XFree86: xc/programs/xterm/trace.c,v 3.20 2004/07/20 01:14:41 dickey Exp $ + * $XFree86: xc/programs/xterm/trace.c,v 3.21 2004/12/01 01:27:47 dickey Exp $ */ /************************************************************ Copyright 1997-2003,2004 by Thomas E. Dickey All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE @@ -232,40 +232,42 @@ } void TraceTranslations(const char *name, Widget w) { String result; XErrorHandler save = XSetErrorHandler(no_error); XtTranslations xlations; Widget xcelerat; TRACE(("TraceTranslations for %s (widget %#lx)\n", name, (long) w)); if (w) { XtVaGetValues(w, XtNtranslations, &xlations, XtNaccelerators, &xcelerat, (XtPointer) 0); TRACE(("... xlations %#08lx\n", (long) xlations)); TRACE(("... xcelerat %#08lx\n", (long) xcelerat)); result = _XtPrintXlations(w, xlations, xcelerat, True); TRACE(("%s\n", result != 0 ? result : "(null)")); + if (result) + XFree(result); } else { TRACE(("none (widget is null)\n")); } XSetErrorHandler(save); } #define XRES_S(name) Trace(#name " = %s\n", NonNull(resp->name)) #define XRES_B(name) Trace(#name " = %s\n", BtoS(resp->name)) #define XRES_I(name) Trace(#name " = %d\n", resp->name) void TraceXtermResources(void) { XTERM_RESOURCE *resp = &resource; Trace("XTERM_RESOURCE settings:\n"); XRES_S(xterm_name); XRES_S(icon_geometry); XRES_S(title); XRES_S(icon_name); @@ -330,41 +332,41 @@ if (*s == '#' || *s == '%' || *s == 'S') { s[1] = '\0'; } else if (*s == ' ') { *s = '\0'; break; } } return dst; } static Boolean same_option(OptionHelp * opt, XrmOptionDescRec * res) { char temp[BUFSIZ]; return !strcmp(parse_option(temp, opt->opt, res->option[0]), res->option); } static Boolean standard_option(char *opt) { - static char *table[] = + static const char *table[] = { "+rv", "+synchronous", "-background", "-bd", "-bg", "-bordercolor", "-borderwidth", "-bw", "-display", "-fg", "-fn", "-font", "-foreground", "-geometry", "-iconic", "-name", "-reverse", "-rv", "-selectionTimeout", Index: xc/programs/xterm/util.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/util.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 util.c --- xc/programs/xterm/util.c 13 Aug 2004 12:57:21 -0000 1.3 +++ xc/programs/xterm/util.c 6 Jan 2005 00:30:56 -0000 @@ -1,27 +1,27 @@ -/* $XTermId: util.c,v 1.196 2004/08/08 22:36:13 tom Exp $ */ +/* $XTermId: util.c,v 1.210 2004/12/01 01:27:47 tom Exp $ */ /* * $Xorg: util.c,v 1.3 2000/08/17 19:55:10 cpqbld Exp $ */ -/* $XFree86: xc/programs/xterm/util.c,v 3.85 2004/08/08 22:36:13 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/util.c,v 3.86 2004/12/01 01:27:47 dickey Exp $ */ /* * Copyright 1999-2003,2004 by Thomas E. Dickey * * All Rights Reserved * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -141,124 +141,129 @@ if ((i = screen->top_marg + screen->scroll_amt - 1 - bot) > 0) { refreshtop += i; refreshheight -= i; } } } } else { refreshheight = -screen->refresh_amt; scrollheight = screen->bot_marg - screen->top_marg - refreshheight + 1; refreshtop = screen->top_marg + shift; scrolltop = refreshtop + refreshheight; if ((i = screen->bot_marg - bot) > 0) scrollheight -= i; if ((i = screen->top_marg + refreshheight - 1 - bot) > 0) refreshheight -= i; } scrolling_copy_area(screen, scrolltop + screen->scroll_amt, scrollheight, screen->scroll_amt); - ScrollSelection(screen, -(screen->scroll_amt)); + ScrollSelection(screen, -(screen->scroll_amt), False); screen->scroll_amt = 0; screen->refresh_amt = 0; if (refreshheight > 0) { ClearCurBackground(screen, (int) refreshtop * FontHeight(screen) + screen->border, (int) OriginX(screen), (unsigned) refreshheight * FontHeight(screen), (unsigned) Width(screen)); ScrnRefresh(screen, refreshtop, 0, refreshheight, screen->max_col + 1, False); } return; } int AddToRefresh(TScreen * screen) { int amount = screen->refresh_amt; int row = screen->cur_row; - if (amount == 0) + if (amount == 0) { return (0); - if (amount > 0) { + } else if (amount > 0) { int bottom; if (row == (bottom = screen->bot_marg) - amount) { screen->refresh_amt++; return (1); } return (row >= bottom - amount + 1 && row <= bottom); } else { int top; amount = -amount; if (row == (top = screen->top_marg) + amount) { screen->refresh_amt--; return (1); } return (row <= top + amount - 1 && row >= top); } } /* * scrolls the screen by amount lines, erases bottom, doesn't alter * cursor position (i.e. cursor moves down amount relative to text). * All done within the scrolling region, of course. * requires: amount > 0 */ void xtermScroll(TScreen * screen, int amount) { int i = screen->bot_marg - screen->top_marg + 1; int shift; int bot; int refreshtop = 0; int refreshheight; int scrolltop; int scrollheight; + TRACE(("xtermScroll count=%d\n", amount)); + screen->cursor_busy += 1; screen->cursor_moved = TRUE; if (screen->cursor_state) HideCursor(); + if (ScrnAreLinesInSelection(screen, screen->top_marg, screen->bot_marg)) + ScrnDisownSelection(screen); + if (amount > i) amount = i; if (screen->jumpscroll) { if (screen->scroll_amt > 0) { if (screen->refresh_amt + amount > i) FlushScroll(screen); screen->scroll_amt += amount; screen->refresh_amt += amount; } else { if (screen->scroll_amt < 0) FlushScroll(screen); screen->scroll_amt = amount; screen->refresh_amt = amount; } refreshheight = 0; } else { - ScrollSelection(screen, -(amount)); + ScrollSelection(screen, -(amount), False); if (amount == i) { ClearScreen(screen); screen->cursor_busy -= 1; return; } shift = -screen->topline; bot = screen->max_row - shift; scrollheight = i - amount; refreshheight = amount; if ((refreshtop = screen->bot_marg - refreshheight + 1 + shift) > (i = screen->max_row - refreshheight + 1)) refreshtop = i; if (screen->scrollWidget && !screen->alternate && screen->top_marg == 0) { scrolltop = 0; if ((scrollheight += shift) > i) scrollheight = i; if ((i = screen->savedlines) < screen->savelines) { if ((i += amount) > screen->savelines) i = screen->savelines; @@ -311,46 +316,51 @@ return; } /* * Reverse scrolls the screen by amount lines, erases top, doesn't alter * cursor position (i.e. cursor moves up amount relative to text). * All done within the scrolling region, of course. * Requires: amount > 0 */ void RevScroll(TScreen * screen, int amount) { int i = screen->bot_marg - screen->top_marg + 1; int shift; int bot; int refreshtop; int refreshheight; int scrolltop; int scrollheight; + TRACE(("RevScroll count=%d\n", amount)); + screen->cursor_busy += 1; screen->cursor_moved = TRUE; if (screen->cursor_state) HideCursor(); + if (ScrnAreLinesInSelection(screen, screen->top_marg, screen->bot_marg)) + ScrnDisownSelection(screen); + if (amount > i) amount = i; if (screen->jumpscroll) { if (screen->scroll_amt < 0) { if (-screen->refresh_amt + amount > i) FlushScroll(screen); screen->scroll_amt -= amount; screen->refresh_amt -= amount; } else { if (screen->scroll_amt > 0) FlushScroll(screen); screen->scroll_amt = -amount; screen->refresh_amt = -amount; } } else { shift = -screen->topline; bot = screen->max_row - shift; refreshheight = amount; scrollheight = screen->bot_marg - screen->top_marg - @@ -383,45 +393,51 @@ screen->cursor_busy -= 1; return; } /* * If cursor not in scrolling region, returns. Else, * inserts n blank lines at the cursor's position. Lines above the * bottom margin are lost. */ void InsertLine(TScreen * screen, int n) { int i; int shift; int bot; int refreshtop; int refreshheight; int scrolltop; int scrollheight; - if (screen->cur_row < screen->top_marg || - screen->cur_row > screen->bot_marg) + if (!ScrnIsLineInMargins(screen, screen->cur_row - screen->topline)) return; + + TRACE(("InsertLine count=%d\n", n)); + if (screen->cursor_state) HideCursor(); + + if (ScrnAreLinesInSelection(screen, screen->top_marg, screen->bot_marg)) + ScrnDisownSelection(screen); + screen->do_wrap = 0; if (n > (i = screen->bot_marg - screen->cur_row + 1)) n = i; if (screen->jumpscroll) { if (screen->scroll_amt <= 0 && screen->cur_row <= -screen->refresh_amt) { if (-screen->refresh_amt + n > screen->max_row + 1) FlushScroll(screen); screen->scroll_amt -= n; screen->refresh_amt -= n; } else if (screen->scroll_amt) FlushScroll(screen); } if (!screen->scroll_amt) { shift = -screen->topline; bot = screen->max_row - shift; refreshheight = n; scrollheight = screen->bot_marg - screen->cur_row - refreshheight + 1; refreshtop = screen->cur_row + shift; scrolltop = refreshtop + refreshheight; @@ -440,45 +456,51 @@ } ScrnInsertLine(screen, screen->visbuf, screen->bot_marg, screen->cur_row, n, screen->max_col + 1); } /* * If cursor not in scrolling region, returns. Else, deletes n lines * at the cursor's position, lines added at bottom margin are blank. */ void DeleteLine(TScreen * screen, int n) { int i; int shift; int bot; int refreshtop; int refreshheight; int scrolltop; int scrollheight; - if (screen->cur_row < screen->top_marg || - screen->cur_row > screen->bot_marg) + if (!ScrnIsLineInMargins(screen, screen->cur_row - screen->topline)) return; + + TRACE(("DeleteLine count=%d\n", n)); + if (screen->cursor_state) HideCursor(); + + if (ScrnAreLinesInSelection(screen, screen->top_marg, screen->bot_marg)) + ScrnDisownSelection(screen); + screen->do_wrap = 0; if (n > (i = screen->bot_marg - screen->cur_row + 1)) n = i; if (screen->jumpscroll) { if (screen->scroll_amt >= 0 && screen->cur_row == screen->top_marg) { if (screen->refresh_amt + n > screen->max_row + 1) FlushScroll(screen); screen->scroll_amt += n; screen->refresh_amt += n; } else if (screen->scroll_amt) FlushScroll(screen); } if (!screen->scroll_amt) { shift = -screen->topline; bot = screen->max_row - shift; scrollheight = i - n; refreshheight = n; if ((refreshtop = screen->bot_marg - refreshheight + 1 + shift) > (i = screen->max_row - refreshheight + 1)) @@ -511,116 +533,130 @@ (unsigned) Width(screen)); } } /* adjust screen->buf */ if (screen->scrollWidget && !screen->alternate && screen->cur_row == 0) ScrnDeleteLine(screen, screen->allbuf, screen->bot_marg + screen->savelines, 0, n, screen->max_col + 1); else ScrnDeleteLine(screen, screen->visbuf, screen->bot_marg, screen->cur_row, n, screen->max_col + 1); } /* * Insert n blanks at the cursor's position, no wraparound */ void InsertChar(TScreen * screen, int n) { - register int width; + int width; + int row = screen->cur_row - screen->topline; if (screen->cursor_state) HideCursor(); + + TRACE(("InsertChar count=%d\n", n)); + + if (ScrnHaveSelection(screen) + && ScrnIsLineInSelection(screen, row)) { + ScrnDisownSelection(screen); + } screen->do_wrap = 0; if (n > (width = screen->max_col + 1 - screen->cur_col)) n = width; - if (screen->cur_row - screen->topline <= screen->max_row) { + if (row <= screen->max_row) { if (!AddToRefresh(screen)) { int col = screen->max_col + 1 - n; if (screen->scroll_amt) FlushScroll(screen); #if OPT_DEC_CHRSET if (CSET_DOUBLE(SCRN_BUF_CSETS(screen, screen->cur_row)[0])) { col = (screen->max_col + 1) / 2 - n; } #endif /* * prevent InsertChar from shifting the end of a line over * if it is being appended to */ if (non_blank_line(screen->visbuf, screen->cur_row, screen->cur_col, screen->max_col + 1)) horizontal_copy_area(screen, screen->cur_col, col - screen->cur_col, n); - ClearCurBackground( - screen, - CursorY(screen, screen->cur_row), - CurCursorX(screen, screen->cur_row, screen->cur_col), - FontHeight(screen), - n * CurFontWidth(screen, screen->cur_row)); + ClearCurBackground(screen, + CursorY(screen, screen->cur_row), + CurCursorX(screen, screen->cur_row, screen->cur_col), + FontHeight(screen), + n * CurFontWidth(screen, screen->cur_row)); } } /* adjust screen->buf */ ScrnInsertChar(screen, n); } /* * Deletes n chars at the cursor's position, no wraparound. */ void DeleteChar(TScreen * screen, int n) { int width; + int row = screen->cur_row - screen->topline; if (screen->cursor_state) HideCursor(); screen->do_wrap = 0; if (n > (width = screen->max_col + 1 - screen->cur_col)) n = width; - if (screen->cur_row - screen->topline <= screen->max_row) { + TRACE(("DeleteChar count=%d\n", n)); + + if (ScrnHaveSelection(screen) + && ScrnIsLineInSelection(screen, row)) { + ScrnDisownSelection(screen); + } + + if (row <= screen->max_row) { if (!AddToRefresh(screen)) { int col = screen->max_col + 1 - n; if (screen->scroll_amt) FlushScroll(screen); #if OPT_DEC_CHRSET if (CSET_DOUBLE(SCRN_BUF_CSETS(screen, screen->cur_row)[0])) { col = (screen->max_col + 1) / 2 - n; } #endif horizontal_copy_area(screen, screen->cur_col + n, col - screen->cur_col, -n); - ClearCurBackground( - screen, - CursorY(screen, screen->cur_row), - CurCursorX(screen, screen->cur_row, col), - FontHeight(screen), - n * CurFontWidth(screen, screen->cur_row)); + ClearCurBackground(screen, + CursorY(screen, screen->cur_row), + CurCursorX(screen, screen->cur_row, col), + FontHeight(screen), + n * CurFontWidth(screen, screen->cur_row)); } } /* adjust screen->buf */ ScrnDeleteChar(screen, n); } /* * Clear from cursor position to beginning of display, inclusive. */ static void ClearAbove(TScreen * screen) { if (screen->protected_mode != OFF_PROTECT) { int row; for (row = 0; row <= screen->max_row; row++) ClearInLine(screen, row, 0, screen->max_col + 1); } else { int top, height; if (screen->cursor_state) @@ -668,40 +704,50 @@ top * FontHeight(screen) + screen->border, OriginX(screen), (screen->max_row - top + 1) * FontHeight(screen), Width(screen)); } } ClearBufRows(screen, screen->cur_row + 1, screen->max_row); } } /* * Clear the given row, for the given range of columns, returning 1 if no * protected characters were found, 0 otherwise. */ static int ClearInLine(TScreen * screen, int row, int col, int len) { int rc = 1; int flags = TERM_COLOR_FLAGS; + TRACE(("ClearInLine(row=%d, col=%d, len=%d) vs %d..%d\n", + row, col, len, + screen->startHRow, + screen->startHCol)); + + if (ScrnHaveSelection(screen) + && ScrnIsLineInSelection(screen, row)) { + ScrnDisownSelection(screen); + } + /* * If we're clearing to the end of the line, we won't count this as * "drawn" characters. We'll only do cut/paste on "drawn" characters, * so this has the effect of suppressing trailing blanks from a * selection. */ if (col + len < screen->max_col + 1) { flags |= CHARDRAWN; } else { len = screen->max_col + 1 - col; } /* If we've marked protected text on the screen, we'll have to * check each time we do an erase. */ if (screen->protected_mode != OFF_PROTECT) { int n; Char *attrs = SCRN_BUF_ATTRS(screen, row) + col; int saved_mode = screen->protected_mode; Bool done; @@ -728,46 +774,45 @@ attrs += n; col += n; len -= n; } } while (!done); screen->protected_mode = saved_mode; if (len <= 0) return 0; } /* fall through to the final non-protected segment */ if (screen->cursor_state) HideCursor(); screen->do_wrap = 0; if (row - screen->topline <= screen->max_row) { if (!AddToRefresh(screen)) { if (screen->scroll_amt) FlushScroll(screen); - ClearCurBackground( - screen, - CursorY(screen, row), - CurCursorX(screen, row, col), - FontHeight(screen), - len * CurFontWidth(screen, row)); + ClearCurBackground(screen, + CursorY(screen, row), + CurCursorX(screen, row, col), + FontHeight(screen), + len * CurFontWidth(screen, row)); } } memset(SCRN_BUF_CHARS(screen, row) + col, ' ', len); memset(SCRN_BUF_ATTRS(screen, row) + col, flags, len); if_OPT_EXT_COLORS(screen, { memset(SCRN_BUF_FGRND(screen, row) + col, term->sgr_foreground, len); memset(SCRN_BUF_BGRND(screen, row) + col, term->cur_background, len); }); if_OPT_ISO_TRADITIONAL_COLORS(screen, { memset(SCRN_BUF_COLOR(screen, row) + col, xtermColorPair(), len); }); if_OPT_DEC_CHRSET({ memset(SCRN_BUF_CSETS(screen, row) + col, curXtermChrSet(screen->cur_row), len); }); if_OPT_WIDE_CHARS(screen, { memset(SCRN_BUF_WIDEC(screen, row) + col, 0, len); memset(SCRN_BUF_COM1L(screen, row) + col, 0, len); @@ -810,40 +855,42 @@ { (void) ClearInLine(screen, screen->cur_row, 0, screen->cur_col + 1); } /* * Erase the cursor's line. */ static void ClearLine(TScreen * screen) { (void) ClearInLine(screen, screen->cur_row, 0, screen->max_col + 1); } void ClearScreen(TScreen * screen) { int top; if (screen->cursor_state) HideCursor(); + + ScrnDisownSelection(screen); screen->do_wrap = 0; if ((top = -screen->topline) <= screen->max_row) { if (screen->scroll_amt) FlushScroll(screen); ClearCurBackground(screen, top * FontHeight(screen) + screen->border, OriginX(screen), (screen->max_row - top + 1) * FontHeight(screen), Width(screen)); } ClearBufRows(screen, 0, screen->max_row); } /* * If we've written protected text DEC-style, and are issuing a non-DEC * erase, temporarily reset the protected_mode flag so that the erase will * ignore the protected flags. */ void do_erase_line(TScreen * screen, int param, int mode) @@ -1051,44 +1098,47 @@ int firstline, /* line on screen to start copying at */ int nlines, int amount) /* number of lines to move up (neg=down) */ { if (nlines > 0) { vertical_copy_area(screen, firstline, nlines, amount); } } /* * Handler for Expose events on the VT widget. * Returns 1 iff the area where the cursor was got refreshed. */ int HandleExposure(TScreen * screen, XEvent * event) { XExposeEvent *reply = (XExposeEvent *) event; #ifndef NO_ACTIVE_ICON - if (reply->window == screen->iconVwin.window) - screen->whichVwin = &screen->iconVwin; - else - screen->whichVwin = &screen->fullVwin; + if (reply->window == screen->iconVwin.window) { + WhichVWin(screen) = &screen->iconVwin; + TRACE(("HandleExposure - icon\n")); + } else { + WhichVWin(screen) = &screen->fullVwin; + TRACE(("HandleExposure - normal\n")); + } #endif /* NO_ACTIVE_ICON */ /* if not doing CopyArea or if this is a GraphicsExpose, don't translate */ if (!screen->incopy || event->type != Expose) return handle_translated_exposure(screen, reply->x, reply->y, reply->width, reply->height); else { /* compute intersection of area being copied with area being exposed. */ int both_x1 = Max(screen->copy_src_x, reply->x); int both_y1 = Max(screen->copy_src_y, reply->y); int both_x2 = Min(screen->copy_src_x + screen->copy_width, (unsigned) (reply->x + reply->width)); int both_y2 = Min(screen->copy_src_y + screen->copy_height, (unsigned) (reply->y + reply->height)); int value = 0; /* was anything copied affected? */ if (both_x2 > both_x1 && both_y2 > both_y1) { /* do the copied area */ @@ -1801,49 +1851,59 @@ if (!(flags & NOBACKGROUND)) XftDrawRect(screen->renderDraw, getColor(values.background), x, y, len * FontWidth(screen), FontHeight(screen)); y += font->ascent; #if OPT_BOX_CHARS if (!screen->force_box_chars) { /* adding code to substitute simulated line-drawing characters */ Cardinal last, first = 0; Dimension old_wide, old_high = 0; int curX = x; for (last = 0; last < len; last++) { unsigned ch = text[last]; int deltax = 0; /* * If we're reading UTF-8 from the client, we may have a - * line-drawing character. Translate it back to our box-code. + * line-drawing character. Translate it back to our box-code + * if it is really a line-drawing character (since the + * fonts used by Xft generally do not have correct glyphs), + * or if Xft can tell us that the glyph is really missing. */ if_OPT_WIDE_CHARS(screen, { - ch = ucs2dec(ch | (text2[last] << 8)); + int full = (ch | (text2[last] << 8)); + int part = ucs2dec(full); + if (xtermIsDecGraphic(part) && + (xtermIsLineDrawing(part) + || xtermXftMissing(font, full))) + ch = part; + else + ch = full; }); /* - * A value less than 32 has to be one of our box-codes. + * If we have one of our box-codes, draw it directly. */ - if (ch > 0 && ch < 32) { + if (xtermIsDecGraphic(ch)) { /* line drawing character time */ if (last > first) { xtermXftDrawString(screen, flags, getColor(values.foreground), font, curX, y, PAIRED_CHARS(text + first, text2 + first), last - first, FontWidth(screen), &deltax); curX += deltax; } old_wide = screen->fnt_wide; old_high = screen->fnt_high; screen->fnt_wide = FontWidth(screen); screen->fnt_high = FontHeight(screen); xtermDrawBoxChar(screen, ch, flags, gc, curX, y - FontAscent(screen)); curX += FontWidth(screen); screen->fnt_wide = old_wide; screen->fnt_high = old_high; @@ -1862,94 +1922,96 @@ { xtermXftDrawString(screen, flags, getColor(values.foreground), font, x, y, PAIRED_CHARS(text, text2), len, FontWidth(screen), NULL); } if ((flags & UNDERLINE) && screen->underline) { if (FontDescent(screen) > 1) y++; XDrawLine(screen->display, VWindow(screen), gc, x, y, x + len * FontWidth(screen) - 1, y); } return x + len * FontWidth(screen); } #endif /* OPT_RENDERFONT */ /* * If we're asked to display a proportional font, do this with a fixed * pitch. Yes, it's ugly. But we cannot distinguish the use of xterm * as a dumb terminal vs its use as in fullscreen programs such as vi. + * Hint: do not try to use a proportional font in the icon. */ - if (!(flags & CHARBYCHAR) && screen->fnt_prop) { + if (!IsIcon(screen) && !(flags & CHARBYCHAR) && screen->fnt_prop) { int adj, width; GC fillGC = gc; /* might be cursorGC */ XFontStruct *fs = ((flags & BOLDATTR(screen)) - ? screen->fnt_bold - : screen->fnt_norm); + ? BoldFont(screen) + : NormalFont(screen)); #define GC_PAIRS(a,b) \ if (gc == a) fillGC = b; \ if (gc == b) fillGC = a /* * Fill the area where we'll write the characters, otherwise * we'll get gaps between them. The cursor is a special case, * because the XFillRectangle call only uses the foreground, * while we've set the cursor color in the background. So we * need a special GC for that. */ if (gc == screen->cursorGC || gc == screen->reversecursorGC) fillGC = screen->fillCursorGC; GC_PAIRS(NormalGC(screen), ReverseGC(screen)); GC_PAIRS(NormalBoldGC(screen), ReverseBoldGC(screen)); if (!(flags & NOBACKGROUND)) XFillRectangle(screen->display, VWindow(screen), fillGC, x, y, len * FontWidth(screen), FontHeight(screen)); while (len--) { width = XTextWidth(fs, (char *) text, 1); adj = (FontWidth(screen) - width) / 2; (void) drawXtermText(screen, flags | NOBACKGROUND | CHARBYCHAR, gc, x + adj, y, chrset, PAIRED_CHARS(text++, text2++), 1, on_wide); x += FontWidth(screen); } return x; } #if OPT_BOX_CHARS /* If the font is incomplete, draw some substitutions */ - if (!(flags & NOTRANSLATION) + if (!IsIcon(screen) + && !(flags & NOTRANSLATION) && (!screen->fnt_boxes || screen->force_box_chars)) { /* Fill in missing box-characters. Find regions without missing characters, and draw them calling ourselves recursively. Draw missing characters via xtermDrawBoxChar(). */ XFontStruct *font = ((flags & BOLD) - ? screen->fnt_bold - : screen->fnt_norm); + ? BoldFont(screen) + : NormalFont(screen)); Cardinal last, first = 0; for (last = 0; last < len; last++) { unsigned ch = text[last]; - Boolean isMissing; + Bool isMissing; #if OPT_WIDE_CHARS if (text2 != 0) ch |= (text2[last] << 8); isMissing = (ch != HIDDEN_CHAR) && (xtermMissingChar(ch, ((on_wide || iswide(ch)) && screen->fnt_dwd) ? screen->fnt_dwd : font)); #else isMissing = xtermMissingChar(ch, font); #endif if (isMissing) { if (last > first) DrawSegment(first, last); #if OPT_WIDE_CHARS if (!ucs_workaround(screen, ch, flags, gc, DrawX(last), y, chrset, on_wide)) #endif xtermDrawBoxChar(screen, ch, flags, gc, DrawX(last), y); first = last + 1; @@ -1973,92 +2035,121 @@ chrset, PAIRED_CHARS(text, text2), len, on_wide); } } #endif /* OPT_BOX_CHARS */ /* * Behave as if the font has (maybe Unicode-replacements for) drawing * characters in the range 1-31 (either we were not asked to ignore them, * or the caller made sure that there is none). The only translation we do * in this branch is the removal of HIDDEN_CHAR (for the wide-char case). */ TRACE(("drawtext%c[%4d,%4d] (%d) %d:%s\n", screen->cursor_state == OFF ? ' ' : '*', y, x, chrset, len, visibleChars(PAIRED_CHARS(text, text2), len))); y += FontAscent(screen); #if OPT_WIDE_CHARS - if (screen->wide_chars) { + if (screen->wide_chars || screen->unicode_font) { int ascent_adjust = 0; static XChar2b *sbuf; static Cardinal slen; Cardinal n; int ch = text[0] | (text2[0] << 8); - int wideness = ((on_wide || iswide(ch) != 0) - && (screen->fnt_dwd != NULL)); + int wideness = (!IsIcon(screen) + && ((on_wide || iswide(ch) != 0) + && (screen->fnt_dwd != NULL))); unsigned char *endtext = text + len; if (slen < len) { slen = (len + 1) * 2; sbuf = (XChar2b *) XtRealloc((char *) sbuf, slen * sizeof(*sbuf)); } for (n = 0; n < len; n++) { sbuf[n].byte2 = *text; sbuf[n].byte1 = *text2; +#if OPT_MINI_LUIT +#define UCS2SBUF(n,value) sbuf[n].byte2 = (value & 0xff);\ + sbuf[n].byte1 = (value >> 8) +#define Map2Sbuf(n,from,to) (*text == from) { UCS2SBUF(n,to); } + if (screen->latin9_mode && !screen->utf8_mode && *text2 == 0) { + + /* see http://www.cs.tut.fi/~jkorpela/latin9.html */ + /* *INDENT-OFF* */ + if Map2Sbuf(n, 0xa4, 0x20ac) + else if Map2Sbuf(n, 0xa6, 0x0160) + else if Map2Sbuf(n, 0xa8, 0x0161) + else if Map2Sbuf(n, 0xb4, 0x017d) + else if Map2Sbuf(n, 0xb8, 0x017e) + else if Map2Sbuf(n, 0xbc, 0x0152) + else if Map2Sbuf(n, 0xbd, 0x0153) + else if Map2Sbuf(n, 0xbe, 0x0178) + /* *INDENT-ON* */ + + } + if (screen->unicode_font + && *text2 == 0 + && (*text == 0x7f || *text < 0x20)) { + int ni = dec2ucs(*text == 0x7f ? 0 : *text); + UCS2SBUF(n, ni); + } +#endif /* OPT_MINI_LUIT */ text++; text2++; if (wideness) { /* filter out those pesky fake characters. */ while (text < endtext && *text == HIDDEN_HI && *text2 == HIDDEN_LO) { text++; text2++; len--; } } } /* This is probably wrong. But it works. */ underline_len = len; /* Set the drawing font */ if (flags & (DOUBLEHFONT | DOUBLEWFONT)) { ; /* Do nothing: font is already set */ } else if (wideness && (screen->fnt_dwd->fid || screen->fnt_dwdb->fid)) { underline_len = real_length = len * 2; if ((flags & BOLDATTR(screen)) != 0 && screen->fnt_dwdb->fid) { XSetFont(screen->display, gc, screen->fnt_dwdb->fid); - ascent_adjust = screen->fnt_dwdb->ascent - screen->fnt_norm->ascent; + ascent_adjust = (screen->fnt_dwdb->ascent + - NormalFont(screen)->ascent); } else { XSetFont(screen->display, gc, screen->fnt_dwd->fid); - ascent_adjust = screen->fnt_dwd->ascent - screen->fnt_norm->ascent; + ascent_adjust = (screen->fnt_dwd->ascent + - NormalFont(screen)->ascent); } /* fix ascent */ } else if ((flags & BOLDATTR(screen)) != 0 - && screen->fnt_bold->fid) { - XSetFont(screen->display, gc, screen->fnt_bold->fid); + && BoldFont(screen)->fid) { + XSetFont(screen->display, gc, BoldFont(screen)->fid); } else { - XSetFont(screen->display, gc, screen->fnt_norm->fid); + XSetFont(screen->display, gc, NormalFont(screen)->fid); } if (flags & NOBACKGROUND) XDrawString16(screen->display, VWindow(screen), gc, x, y + ascent_adjust, sbuf, n); else XDrawImageString16(screen->display, VWindow(screen), gc, x, y + ascent_adjust, sbuf, n); if ((flags & BOLDATTR(screen)) && screen->enbolden) { beginClipping(screen, gc, font_width, len); XDrawString16(screen->display, VWindow(screen), gc, x + 1, y + ascent_adjust, sbuf, n); endClipping(screen, gc); } @@ -2228,108 +2319,105 @@ * * This assumes that fg/bg are equal when we override with one of the special * attribute colors. */ unsigned makeColorPair(int fg, int bg) { unsigned my_bg = (bg >= 0) && (bg < NUM_ANSI_COLORS) ? (unsigned) bg : 0; unsigned my_fg = (fg >= 0) && (fg < NUM_ANSI_COLORS) ? (unsigned) fg : my_bg; #if OPT_EXT_COLORS return (my_fg << 8) | my_bg; #else return (my_fg << 4) | my_bg; #endif } /* * Using the "current" SGR background, clear a rectangle. */ void -ClearCurBackground( - TScreen * screen, - int top, - int left, - unsigned height, - unsigned width) -{ - XSetWindowBackground( - screen->display, - VWindow(screen), - getXtermBackground(term->flags, term->cur_background)); +ClearCurBackground(TScreen * screen, + int top, + int left, + unsigned height, + unsigned width) +{ + XSetWindowBackground(screen->display, + VWindow(screen), + getXtermBackground(term->flags, term->cur_background)); XClearArea(screen->display, VWindow(screen), left, top, width, height, FALSE); - XSetWindowBackground( - screen->display, - VWindow(screen), - getXtermBackground(term->flags, MAXCOLORS)); + XSetWindowBackground(screen->display, + VWindow(screen), + getXtermBackground(term->flags, MAXCOLORS)); } #endif /* OPT_ISO_COLORS */ -#if OPT_WIDE_CHARS /* * Returns a single 8/16-bit number for the given cell */ unsigned getXtermCell(TScreen * screen, int row, int col) { unsigned ch = SCRN_BUF_CHARS(screen, row)[col]; if_OPT_WIDE_CHARS(screen, { ch |= (SCRN_BUF_WIDEC(screen, row)[col] << 8); }); return ch; } -unsigned -getXtermCellComb1(TScreen * screen, int row, int col) -{ - unsigned ch = SCRN_BUF_COM1L(screen, row)[col]; - ch |= (SCRN_BUF_COM1H(screen, row)[col] << 8); - return ch; -} - -unsigned -getXtermCellComb2(TScreen * screen, int row, int col) -{ - unsigned ch = SCRN_BUF_COM2L(screen, row)[col]; - ch |= (SCRN_BUF_COM2H(screen, row)[col] << 8); - return ch; -} - /* * Sets a single 8/16-bit number for the given cell */ void putXtermCell(TScreen * screen, int row, int col, int ch) { SCRN_BUF_CHARS(screen, row)[col] = ch; if_OPT_WIDE_CHARS(screen, { SCRN_BUF_WIDEC(screen, row)[col] = (ch >> 8); SCRN_BUF_COM1L(screen, row)[col] = 0; SCRN_BUF_COM1H(screen, row)[col] = 0; SCRN_BUF_COM2L(screen, row)[col] = 0; SCRN_BUF_COM2H(screen, row)[col] = 0; }); } +#if OPT_WIDE_CHARS +unsigned +getXtermCellComb1(TScreen * screen, int row, int col) +{ + unsigned ch = SCRN_BUF_COM1L(screen, row)[col]; + ch |= (SCRN_BUF_COM1H(screen, row)[col] << 8); + return ch; +} + +unsigned +getXtermCellComb2(TScreen * screen, int row, int col) +{ + unsigned ch = SCRN_BUF_COM2L(screen, row)[col]; + ch |= (SCRN_BUF_COM2H(screen, row)[col] << 8); + return ch; +} + /* * Add a combining character for the given cell */ void addXtermCombining(TScreen * screen, int row, int col, unsigned ch) { if (!SCRN_BUF_COM1L(screen, row)[col] && !SCRN_BUF_COM1H(screen, row)[col]) { SCRN_BUF_COM1L(screen, row)[col] = ch & 0xff; SCRN_BUF_COM1H(screen, row)[col] = ch >> 8; } else if (!SCRN_BUF_COM2H(screen, row)[col]) { SCRN_BUF_COM2L(screen, row)[col] = ch & 0xff; SCRN_BUF_COM2H(screen, row)[col] = ch >> 8; } } #endif #ifdef HAVE_CONFIG_H #ifdef USE_MY_MEMMOVE char * @@ -2429,28 +2517,28 @@ } else { term->keyboard.type = type; } if (save != term->keyboard.type) { update_keyboard_type(); } } void init_keyboard_type(xtermKeyboardType type, Bool set) { static Bool wasSet = False; TRACE(("init_keyboard_type(%s, %s) currently %s\n", visibleKeyboardType(type), BtoS(set), visibleKeyboardType(term->keyboard.type))); if (set) { if (wasSet) { - fprintf(stderr, "Conflicting keyboard type option (%d/%d)\n", + fprintf(stderr, "Conflicting keyboard type option (%u/%u)\n", term->keyboard.type, type); } term->keyboard.type = type; wasSet = True; update_keyboard_type(); } } Index: xc/programs/xterm/uxterm =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/uxterm,v retrieving revision 1.3 diff -u -2 -0 -r1.3 uxterm --- xc/programs/xterm/uxterm 13 Aug 2004 12:57:21 -0000 1.3 +++ xc/programs/xterm/uxterm 6 Jan 2005 00:30:56 -0000 @@ -1,26 +1,27 @@ #!/bin/sh -# $XTermId: uxterm,v 1.15 2004/07/13 00:41:30 tom Exp $ -# $XFree86: xc/programs/xterm/uxterm,v 1.9 2004/07/13 00:41:30 dickey Exp $ +# $XTermId: uxterm,v 1.18 2004/12/01 01:27:47 tom Exp $ +# $XFree86: xc/programs/xterm/uxterm,v 1.10 2004/12/01 01:27:47 dickey Exp $ # wrapper script to setup xterm with UTF-8 locale program=xterm +locale=`(LC_ALL=C LC_CTYPE=C LANG=C locale >/dev/null) 2>&1` found=no # Check for -version and -help options, to provide a simple return without # requiring the program to create a window: if test $# = 1 then case $1 in -v|-ver*|-h|-he*) $program "$@" exit $? ;; esac fi # Check environment variables that xterm does, in the same order: for name in LC_ALL LC_CTYPE LANG do eval 'value=$'$name if test -n "$value" ; then case $value in @@ -29,32 +30,42 @@ ;; *.utf8@*|*.UTF8@*|*.utf-8@*|*.UTF-8@*) found=yes ;; C|POSIX) # Yes, I know this is not the same - but why are you # here then? value=en_US ;; esac break fi done # If we didn't find one that used UTF-8, modify the safest one. Not everyone # has a UTF-8 locale installed (and there appears to be no trivial/portable way # to determine whether it is, from a shell script). We could check if the # user's shell does not reset unknown locale specifiers, but not all shells do. if test $found != yes ; then if test -n "$value" ; then - eval ${name}=`echo ${value} |sed -e 's/[.@].*//'`.UTF-8 - eval export ${name} + value=`echo ${value} |sed -e 's/[.@].*//'`.UTF-8 else - LC_CTYPE=en_US.UTF-8 - export LC_CTYPE + name="LC_CTYPE" + value="en_US.UTF-8" + fi + eval ${name}=${value} + eval export ${name} + if test -z "$locale" ; then + # The 'locale' program tries to do a sanity check. + check=`(locale >/dev/null) 2>&1` + if test -n "$check" ; then + echo "uxterm tried to use locale $value" >&2 + echo "$check" >&2 + exit 1 + fi fi fi # for testing: #test -f ./xterm && program=./xterm exec $program -class UXTerm -title 'uxterm' -u8 "$@" Index: xc/programs/xterm/version.h =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/version.h,v retrieving revision 1.4 diff -u -2 -0 -r1.4 version.h --- xc/programs/xterm/version.h 20 Aug 2004 18:46:39 -0000 1.4 +++ xc/programs/xterm/version.h 6 Jan 2005 00:30:56 -0000 @@ -1,14 +1,14 @@ -/* $XTermId: version.h,v 1.233 2004/08/15 21:07:59 tom Exp $ */ -/* $XFree86: xc/programs/xterm/version.h,v 3.107 2004/08/15 21:07:59 dickey Exp $ */ +/* $XTermId: version.h,v 1.235 2004/12/01 01:27:47 tom Exp $ */ +/* $XFree86: xc/programs/xterm/version.h,v 3.108 2004/12/01 01:27:47 dickey Exp $ */ /* * These definitions are used to build the string that's printed in response to * "xterm -version", or embedded in "xterm -help". It usually indicates the * version of X to which this version of xterm has been built. The number in * parentheses is my patch number (T.Dickey). */ -#define XTERM_PATCH 196 +#define XTERM_PATCH 197 #ifndef __vendorversion__ #define __vendorversion__ "XTerm" #endif Index: xc/programs/xterm/xstrings.c =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/xstrings.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 xstrings.c --- xc/programs/xterm/xstrings.c 13 Aug 2004 12:57:21 -0000 1.3 +++ xc/programs/xterm/xstrings.c 6 Jan 2005 00:30:56 -0000 @@ -1,25 +1,27 @@ -/* $XFree86: xc/programs/xterm/xstrings.c,v 1.7 2003/11/13 01:16:38 dickey Exp $ */ +/* $XTermId: xstrings.c,v 1.20 2004/12/01 01:27:47 tom Exp $ */ + +/* $XFree86: xc/programs/xterm/xstrings.c,v 1.8 2004/12/01 01:27:47 dickey Exp $ */ /************************************************************ -Copyright 2000-2002,2003 by Thomas E. Dickey +Copyright 2000-2003,2004 by Thomas E. Dickey All Rights Reserved Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE @@ -45,41 +47,43 @@ { char *cp; cp = strrchr(name, '/'); #ifdef __UNIXOS2__ if (cp == 0) cp = strrchr(name, '\\'); #endif return (cp ? cp + 1 : name); } int x_strcasecmp(const char *s1, const char *s2) { unsigned len = strlen(s1); if (len != strlen(s2)) return 1; while (len-- != 0) { - if (toupper(CharOf(*s1)) != toupper(CharOf(*s2))) + int c1 = toupper(CharOf(*s1)); + int c2 = toupper(CharOf(*s2)); + if (c1 != c2) return 1; s1++, s2++; } return 0; } /* * Allocates a copy of a string */ char * x_strdup(const char *s) { char *result = 0; if (s != 0) { char *t = (char *) malloc(strlen(s) + 1); if (t != 0) { strcpy(t, s); } Index: xc/programs/xterm/xterm.h =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/xterm.h,v retrieving revision 1.3 diff -u -2 -0 -r1.3 xterm.h --- xc/programs/xterm/xterm.h 13 Aug 2004 12:57:21 -0000 1.3 +++ xc/programs/xterm/xterm.h 6 Jan 2005 00:30:57 -0000 @@ -1,23 +1,23 @@ -/* $XTermId: xterm.h,v 1.291 2004/07/13 00:41:30 tom Exp $ */ +/* $XTermId: xterm.h,v 1.306 2004/12/01 01:27:47 tom Exp $ */ -/* $XFree86: xc/programs/xterm/xterm.h,v 3.102 2004/07/13 00:41:30 dickey Exp $ */ +/* $XFree86: xc/programs/xterm/xterm.h,v 3.103 2004/12/01 01:27:47 dickey Exp $ */ /************************************************************ Copyright 1999-2003,2004 by Thomas E. Dickey All Rights Reserved Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF @@ -243,41 +243,41 @@ */ #ifdef linux #undef HAVE_WAITPID #endif #ifndef OPT_WIDE_CHARS #define OPT_WIDE_CHARS 0 #endif #if OPT_WIDE_CHARS #define HIDDEN_HI 0xff #define HIDDEN_LO 0xff #define HIDDEN_CHAR 0xffff #endif /***====================================================================***/ #include #include -#if (XtSpecificationRelease >= 6) && !defined(NO_XPOLL_H) +#if (XtSpecificationRelease >= 6) && !defined(NO_XPOLL_H) && !defined(sun) #include #define USE_XPOLL_H 1 #else #define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval *)t) #define XFD_COPYSET(src,dst) memcpy((dst)->fds_bits, (src)->fds_bits, sizeof(fd_set)) #if defined(__MVS__) && !defined(TIME_WITH_SYS_TIME) #define TIME_WITH_SYS_TIME #endif #endif #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif @@ -388,40 +388,41 @@ #define XtNprinterExtent "printerExtent" #define XtNprinterFormFeed "printerFormFeed" #define XtNrenderFont "renderFont" #define XtNresizeGravity "resizeGravity" #define XtNreverseWrap "reverseWrap" #define XtNrightScrollBar "rightScrollBar" #define XtNsaveLines "saveLines" #define XtNscrollBar "scrollBar" #define XtNscrollKey "scrollKey" #define XtNscrollLines "scrollLines" #define XtNscrollPos "scrollPos" #define XtNscrollTtyOutput "scrollTtyOutput" #define XtNshiftFonts "shiftFonts" #define XtNshowBlinkAsBold "showBlinkAsBold" #define XtNshowMissingGlyphs "showMissingGlyphs" #define XtNsignalInhibit "signalInhibit" #define XtNtekGeometry "tekGeometry" #define XtNtekInhibit "tekInhibit" #define XtNtekSmall "tekSmall" #define XtNtekStartup "tekStartup" +#define XtNtoolBar "toolBar" #define XtNtiXtraScroll "tiXtraScroll" #define XtNtiteInhibit "titeInhibit" #define XtNtrimSelection "trimSelection" #define XtNunderLine "underLine" #define XtNutf8 "utf8" #define XtNveryBoldColors "veryBoldColors" #define XtNvisualBell "visualBell" #define XtNvisualBellDelay "visualBellDelay" #define XtNvt100Graphics "vt100Graphics" #define XtNwideBoldFont "wideBoldFont" #define XtNwideChars "wideChars" #define XtNwideFont "wideFont" #define XtNximFont "ximFont" #define XtNxmcAttributes "xmcAttributes" #define XtNxmcGlitch "xmcGlitch" #define XtNxmcInline "xmcInline" #define XtNxmcMoveSGR "xmcMoveSGR" #define XtCAllowC1Printable "AllowC1Printable" #define XtCAllowSendEvents "AllowSendEvents" @@ -503,40 +504,41 @@ #define XtCPrinterFormFeed "PrinterFormFeed" #define XtCRenderFont "RenderFont" #define XtCResizeGravity "ResizeGravity" #define XtCReverseWrap "ReverseWrap" #define XtCRightScrollBar "RightScrollBar" #define XtCSaveLines "SaveLines" #define XtCScrollBar "ScrollBar" #define XtCScrollCond "ScrollCond" #define XtCScrollLines "ScrollLines" #define XtCScrollPos "ScrollPos" #define XtCShiftFonts "ShiftFonts" #define XtCShowBlinkAsBold "ShowBlinkAsBold" #define XtCShowMissingGlyphs "ShowMissingGlyphs" #define XtCSignalInhibit "SignalInhibit" #define XtCTekInhibit "TekInhibit" #define XtCTekSmall "TekSmall" #define XtCTekStartup "TekStartup" #define XtCTiXtraScroll "TiXtraScroll" #define XtCTiteInhibit "TiteInhibit" #define XtCTrimSelection "TrimSelection" +#define XtCToolBar "ToolBar" #define XtCUnderLine "UnderLine" #define XtCUtf8 "Utf8" #define XtCVT100Graphics "VT100Graphics" #define XtCVeryBoldColors "VeryBoldColors" #define XtCVisualBell "VisualBell" #define XtCVisualBellDelay "VisualBellDelay" #define XtCWideBoldFont "WideBoldFont" #define XtCWideChars "WideChars" #define XtCWideFont "WideFont" #define XtCXimFont "XimFont" #define XtCXmcAttributes "XmcAttributes" #define XtCXmcGlitch "XmcGlitch" #define XtCXmcInline "XmcInline" #define XtCXmcMoveSGR "XmcMoveSGR" #if defined(NO_ACTIVE_ICON) && !defined(XtNgeometry) #define XtNgeometry "geometry" #define XtCGeometry "Geometry" #endif @@ -571,41 +573,41 @@ extern void TekSimulatePageButton (Bool reset); extern void dorefresh (void); /* button.c */ extern Boolean SendMousePosition (Widget w, XEvent* event); extern void DiredButton PROTO_XT_ACTIONS_ARGS; extern void DisownSelection (XtermWidget termw); extern void HandleGINInput PROTO_XT_ACTIONS_ARGS; extern void HandleInsertSelection PROTO_XT_ACTIONS_ARGS; extern void HandleKeyboardSelectEnd PROTO_XT_ACTIONS_ARGS; extern void HandleKeyboardSelectStart PROTO_XT_ACTIONS_ARGS; extern void HandleKeyboardStartExtend PROTO_XT_ACTIONS_ARGS; extern void HandleSecure PROTO_XT_ACTIONS_ARGS; extern void HandleSelectEnd PROTO_XT_ACTIONS_ARGS; extern void HandleSelectExtend PROTO_XT_ACTIONS_ARGS; extern void HandleSelectSet PROTO_XT_ACTIONS_ARGS; extern void HandleSelectStart PROTO_XT_ACTIONS_ARGS; extern void HandleStartExtend PROTO_XT_ACTIONS_ARGS; extern void ReadLineButton PROTO_XT_ACTIONS_ARGS; extern void ResizeSelection (TScreen *screen, int rows, int cols); -extern void ScrollSelection (TScreen* screen, int amount); +extern void ScrollSelection (TScreen* screen, int amount, Bool); extern void TrackMouse (int func, int startrow, int startcol, int firstrow, int lastrow); extern void TrackText (int frow, int fcol, int trow, int tcol); extern void ViButton PROTO_XT_ACTIONS_ARGS; #if OPT_DEC_LOCATOR extern Boolean SendLocatorPosition (Widget w, XEvent* event); extern void CheckLocatorPosition (Widget w, XEvent *event); extern void GetLocatorPosition (XtermWidget w); extern void InitLocatorFilter (XtermWidget w); #endif /* OPT_DEC_LOCATOR */ #if OPT_WIDE_CHARS extern int iswide(int i); #endif /* charproc.c */ extern int VTInit (void); extern int v_write (int f, Char *d, int len); extern void FindFontSelection (char *atom_name, Bool justprobe); extern void HideCursor (void); @@ -655,44 +657,40 @@ extern void xterm_DECSWL (void); extern void xterm_DECDWL (void); #if OPT_DEC_CHRSET extern int xterm_Double_index(unsigned chrset, unsigned flags); extern GC xterm_DoubleGC(unsigned chrset, unsigned flags, GC old_gc); #endif /* input.c */ extern Boolean xtermDeleteIsDEL (void); extern void Input (TKeyboard *keyboard, TScreen *screen, XKeyEvent *event, Bool eightbit); extern void StringInput (TScreen *screen, Char *string, size_t nbytes); #if OPT_NUM_LOCK extern void VTInitModifiers(void); #endif #if OPT_TCAP_QUERY extern int xtermcapKeycode(char *params, unsigned *state); #endif -#if OPT_WIDE_CHARS -extern int convertFromUTF8(unsigned long c, Char *strbuf); -#endif - /* main.c */ #ifndef __UNIXOS2__ #define ENVP_ARG /**/ #else #define ENVP_ARG , char **envp #endif extern int main (int argc, char **argv ENVP_ARG); extern int GetBytesAvailable (int fd); extern int kill_process_group (int pid, int sig); extern int nonblocking_wait (void); extern void first_map_occurred (void); #ifdef SIGNAL_T extern SIGNAL_T Exit (int n); #endif #if OPT_WIDE_CHARS extern int (*my_wcwidth)(wchar_t); #endif @@ -797,63 +795,90 @@ extern void switchPtyData (TScreen *screen, int f); extern void writePtyData (int f, IChar *d, unsigned len); #else #define morePtyData(screen, data) ((data)->last > (data)->next) #define nextPtyData(screen, data) (*((data)->next++) & \ (screen->output_eight_bits \ ? 0xff \ : 0x7f)) #define writePtyData(f,d,len) v_write(f,d,len) #endif /* screen.c */ extern Bool non_blank_line (ScrnBuf sb, int row, int col, int len); extern ScrnBuf Allocate (int nrow, int ncol, Char **addr); extern int ScreenResize (TScreen *screen, int width, int height, unsigned *flags); extern size_t ScrnPointers (TScreen *screen, size_t len); extern void ClearBufRows (TScreen *screen, int first, int last); extern void ScreenWrite (TScreen *screen, PAIRED_CHARS(Char *str, Char *str2), unsigned flags, unsigned cur_fg_bg, int length); extern void ScrnDeleteChar (TScreen *screen, int n); extern void ScrnDeleteLine (TScreen *screen, ScrnBuf sb, int n, int last, int size, int where); +extern void ScrnFillRectangle (TScreen *, XTermRect *, Char, unsigned); extern void ScrnInsertChar (TScreen *screen, int n); extern void ScrnInsertLine (TScreen *screen, ScrnBuf sb, int last, int where, int n, int size); extern void ScrnRefresh (TScreen *screen, int toprow, int leftcol, int nrows, int ncols, Bool force); +extern void ScrnUpdate (TScreen *screen, int toprow, int leftcol, int nrows, int ncols, Bool force); +extern void ScrnDisownSelection (TScreen *screen); +extern void xtermParseRect (TScreen *, int, int *, XTermRect *); #define ScrnClrFlag(screen, row, flag) \ SCRN_BUF_FLAGS(screen, row + screen->topline) = \ (Char *)((long)SCRN_BUF_FLAGS(screen, row + screen->topline) & ~ (flag)) #define ScrnSetFlag(screen, row, flag) \ SCRN_BUF_FLAGS(screen, row + screen->topline) = \ (Char *)(((long)SCRN_BUF_FLAGS(screen, row + screen->topline) | (flag))) #define ScrnTstFlag(screen, row, flag) \ ((row + screen->savelines + screen->topline) >= 0 && ((long)SCRN_BUF_FLAGS(screen, row + screen->topline) & (flag)) != 0) #define ScrnClrBlinked(screen, row) ScrnClrFlag(screen, row, BLINK) #define ScrnSetBlinked(screen, row) ScrnSetFlag(screen, row, BLINK) #define ScrnTstBlinked(screen, row) ScrnTstFlag(screen, row, BLINK) #define ScrnClrWrapped(screen, row) ScrnClrFlag(screen, row, LINEWRAPPED) #define ScrnSetWrapped(screen, row) ScrnSetFlag(screen, row, LINEWRAPPED) #define ScrnTstWrapped(screen, row) ScrnTstFlag(screen, row, LINEWRAPPED) +#define ScrnHaveSelection(screen) \ + ((screen)->startHRow != (screen)->endHRow \ + || (screen)->startHCol != (screen)->endHCol) + +#define ScrnAreLinesInSelection(screen, first, last) \ + ((last) >= (screen)->startHRow && (first) <= (screen)->endHRow) + +#define ScrnIsLineInSelection(screen, line) \ + ((line) >= (screen)->startHRow && (line) <= (screen)->endHRow) + +#define ScrnHaveLineMargins(screen) \ + ((screen)->top_marg != 0 \ + || ((screen)->bot_marg != screen->max_row)) + +#define ScrnIsLineInMargins(screen, line) \ + ((line) >= (screen)->top_marg && (line) <= (screen)->bot_marg) + +#if OPT_DEC_RECTOPS +extern void ScrnCopyRectangle (TScreen *, XTermRect *, int, int *); +extern void ScrnMarkRectangle (TScreen *, XTermRect *, Bool, int, int *); +extern void ScrnWipeRectangle (TScreen *, XTermRect *); +#endif + #if OPT_WIDE_CHARS extern void ChangeToWide(TScreen * screen); #endif /* scrollbar.c */ extern void DoResizeScreen (XtermWidget xw); extern void HandleScrollBack PROTO_XT_ACTIONS_ARGS; extern void HandleScrollForward PROTO_XT_ACTIONS_ARGS; extern void ResizeScrollBar (TScreen *screen); extern void ScrollBarDrawThumb (Widget scrollWidget); extern void ScrollBarOff (TScreen *screen); extern void ScrollBarOn (XtermWidget xw, int init, int doalloc); extern void ScrollBarReverseVideo (Widget scrollWidget); extern void ToggleScrollBar (XtermWidget w); extern void WindowScroll (TScreen *screen, int top); /* tabs.c */ extern Boolean TabToNextStop (void); extern Boolean TabToPrevStop (void); extern int TabNext (Tabs tabs, int col); @@ -957,49 +982,47 @@ /* FIXME: Reverse-Video? */ #define T_COLOR(v,n) (v)->Tcolors[n] #define getXtermBackground(flags, color) T_COLOR(&(term->screen), TEXT_BG) #define getXtermForeground(flags, color) T_COLOR(&(term->screen), TEXT_FG) #define makeColorPair(fg, bg) 0 #define xtermColorPair() 0 #define checkVeryBoldColors(flags, fg) /* nothing */ #endif /* OPT_ISO_COLORS */ #if OPT_DEC_CHRSET #define curXtermChrSet(row) \ ((CSET_DOUBLE(SCRN_ROW_CSET((&term->screen), row))) \ ? SCRN_ROW_CSET((&term->screen), row) \ : (term->screen).cur_chrset) #else #define curXtermChrSet(row) 0 #endif -#if OPT_WIDE_CHARS extern unsigned getXtermCell (TScreen *screen, int row, int col); +extern void putXtermCell (TScreen *screen, int row, int col, int ch); + +#if OPT_WIDE_CHARS extern unsigned getXtermCellComb1 (TScreen *screen, int row, int col); extern unsigned getXtermCellComb2 (TScreen *screen, int row, int col); extern void addXtermCombining (TScreen *screen, int row, int col, unsigned ch); -extern void putXtermCell (TScreen *screen, int row, int col, int ch); -#else -#define getXtermCell(screen,row,col) SCRN_BUF_CHARS(screen, row)[col] -#define putXtermCell(screen,row,col,ch) SCRN_BUF_CHARS(screen, row)[col] = ch #endif #if OPT_XMC_GLITCH extern void Mark_XMC (TScreen *screen, int param); extern void Jump_XMC (TScreen *screen); extern void Resolve_XMC (TScreen *screen); #endif #if OPT_WIDE_CHARS int visual_width(PAIRED_CHARS(Char *str, Char *str2), Cardinal len); #else #define visual_width(a, b) (b) #endif #define BtoS(b) ((b) ? "on" : "off") #define NonNull(s) ((s) ? (s) : "") #ifdef __cplusplus } #endif Index: xc/programs/xterm/xterm.log.html =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/xterm.log.html,v retrieving revision 1.4 diff -u -2 -0 -r1.4 xterm.log.html --- xc/programs/xterm/xterm.log.html 20 Aug 2004 18:46:39 -0000 1.4 +++ xc/programs/xterm/xterm.log.html 6 Jan 2005 00:31:03 -0000 @@ -3,66 +3,67 @@ ***************************************************************************** * Copyright 1996-2003,2004 by Thomas E. Dickey * * All Rights Reserved. * * * * Permission to use, copy, modify, and distribute this software and its * * documentation for any purpose and without fee is hereby granted, provided * * that the above copyright notice appear in all copies and that both that * * copyright notice and this permission notice appear in supporting * * documentation, and that the name of the above listed copyright holder(s) * * not be used in advertising or publicity pertaining to distribution of the * * software without specific, written prior permission. * * * * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD * * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * * FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE * * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ***************************************************************************** - $XTermId: xterm.log.html,v 1.173 2004/08/15 21:07:59 tom Exp $ - $XFree86: xc/programs/xterm/xterm.log.html,v 1.130 2004/08/15 21:07:59 dickey Exp $ + $XTermId: xterm.log.html,v 1.191 2004/12/01 01:27:47 tom Exp $ + $XFree86: xc/programs/xterm/xterm.log.html,v 1.131 2004/12/01 01:27:47 dickey Exp $ --> XTERM - Change Log
Copyright 1997-2003,2004 by Thomas E. Dickey

Contents

This file contains a list of the changes that I have made for xterm, from the notes that I add when submitting a patch.

You should note that other changes have been made as well, by other people, to fix bugs and correct ifdef's for portability. Most of these are summarized in the XFree86 CHANGELOG (found in the unbundled tree, xc/programs/Xserver/hw/xfree86). Here is the latest version of this file.

+

Patch #197 - 2004/11/30 - XFree86 4.4.99.19

+
    +
  • modify configure script to remove empty "-DPROJECTROOT=" definition + which resulted unusable values for luit's default path. + +
  • update precompose.c based on Unicode 4.0.1 + +
  • several minor fixes based on Intel compiler warnings. + +
  • change default translations so a BtnDown which is + not recognized is simply ignored rather than emitting a bell. + That makes it less obtrusive when the user tries to use a mouse + which provides more capabilities than the X mouse driver supports, + e.g., one with a horizontal scroll wheel (Debian #265133). + +
  • note in xterm's manpage that translations is not + specific to xterm (Debian #278897). + +
  • modify uxterm script to use locale program to verify if the + derived locale is installed (Debian #246398). + +
  • correct font handling for active icon when in UTF-8 mode (report + by Paolo Liberatore). + +
  • make active-icon and toolbar configurations work together. + +
  • modify the criteria for disowning primary selection. Previously, + this happened anytime the cursor was moved before the end of the + selection. That would ensure that any insert/delete of char or + line, as well as scrolling, would disown the selection. The + new criteria change this to checking if the operations would + modify the data which is highlighted (Debian #277832). + +
  • reimplement DECALN with functions for vt420 rectangles, + fixes selection for this case. + +
  • implement vt420 rectangle operations. + +
  • add parsing, for debug/test of vt220 soft-fonts. + +
  • add menu entry, actions and escape sequence to allow + enabling/disabling toolbars at runtime. + +
  • improve rendering for Xft, allow it to draw non-linedrawing + characters such as "pi", which were drawn from internal tables + with patch #180 + (Freedesktop.org Bugzilla #1260). + +
  • add configure option --enable-mini-luit, ifdef'd the + mini-luit feature with OPT_MINI_LUIT. + +
  • add mini-luit feature, which supports Latin9 directly rather than + via luit, provided that Unicode fonts are used (Freedesktop.org + Bugzilla #1571, request by Stefan Dirsch, patch by Michael + Schroeder). + +
  • for Linux, if IUTF8 is defined, e.g., on recent 2.6.x kernels, + set the corresponding flag for the slave pty, to enable UTF-8 + interpretation of backspace in cooked mode (Freedesktop.org + Bugzilla #1578, request by Stefan Dirsch). + +
  • modify faceSize resource to use a floating-point + internal value (adapted from patch by Sam Stephenson). + +
  • correct handling selection of tabs over cleared space in UTF-8 + mode. In this special case, xterm represents the whitespace with + a null rather than a space character (Debian #276477). + +
  • amend fix for infinite loop from patch + #192 to check if there is wrapped text to output in a following + iteration (Debian #273202). + +
  • fixes ifdef'd with __INTERIX to allow building with + Interix (Windows Services for UNIX) 3.5 using the xlibs libraries + from freedesktop.org (patch by Min Sik Kim). + +
  • amend solution for Debian #252873, #260471 from patch #192 by making the cursor not + explicitly colored if only the foreground color is set, and the + cursor is on a blank space (Debian #275473). + +
  • correct logic for send/receive mode (SRM) with regard to control + characters. + +
  • fix masking of invisible text in wide-character mode, which did + not work for line-drawing characters. + +
  • incorporate CF_XOPEN_SOURCE into configure script, replacing + CF_GNU_SOURCE. +
+

Patch #196 - 2004/8/15 - XFree86 4.4.99.12

  • add a special case to configure script to ignore NetBSD's grantpt() which was recently added (but not part of a release), until someone is able to ensure that xterm can use it (report by Min Sik Kim).
  • clear the buffer returned by getutid(). This fixes an infinite loop on some platforms introduced in patch #193 by Debian #256468 fix (report by David Ellement).

Patch #195 - 2004/8/8 - XFree86 4.4.99.11

  • correct length used for blinking text, make the last column blink (patch by Alexander V Lukyanov).
  • start changes to make doublesize characters work with TrueType fonts (see patch #44). @@ -620,41 +712,41 @@
  • change a couple of resource classes from "Boolean" to specific values: freeBoldBox, forceBoxChars.
  • add resource showMissingGlyphs to outline places on the screen where a font lacks the corresponding glyph.
  • add resource showBlinkAsBold to control whether blinking text should be shown as bold or actual blinking text.
  • improve logic in ShowCursor() to avoid repainting the cursor when it is already visible, e.g., in response to the DECTCEM escape sequence. This also addresses XFree86 Bugzilla #1158.
  • implement blinking text, using the timer for blinking cursor.
  • modify FreeType support to allow resizing the font, in the same ways the window can be resized if fixed fonts are used. The relative font sizes are derived from the fixed font sizes. -
  • add menu items and corresponding actions for switching on/off +
  • add menu items and corresponding actions for switching on/off the UTF-8 mode and Xft (TrueType) support.
  • add logic to handle switching UTF-8 mode on/off. It worked if the escape sequences were flushed, but if data was mixed in with the same write, some were not handled properly (report by Nicolas George).
  • modify to allow turning UTF-8 mode via escape sequence even if -wc option was not given at startup (patch by Peter Berg Larsen).
  • amend fix for XFree86 Bugzilla #981, adjusting for savedlines value (report by Tim Adye).
  • fix a typo in computing relative font size (Jess Thrysoee).

Patch #184 - 2003/12/31 - XFree86 4.3.99.903

  • improve configure-script checks for FreeType and related libraries, @@ -806,41 +898,41 @@
  • pass 16-bit values rather than 8-bit values to xtermXftDrawString() to allow for wide-characters.
  • remove spurious check for colorBDMode resource in logic that does bold fonts.
  • implement underlining.
  • patches by Ilya Zakharevich:
    • improve drawXtermText() by making the recursive calls communicate through arguments, and not through saving/restoring global variables.
    • make double-width characters work with -u8 option.
    • modify lookup of double-sized fonts by checking for a match ignoring x/y resolution if the first check fails.
  • make height of TrueType fonts match ascent+descent (patch by - Keith Packard). + Keith Packard).
  • correct configure-script check for imake $CFLAGS, which did not check properly if imake was not available.
  • correct install rule in Makefile.in for uxterm, which was attempting to strip the script (newsgroup posting by Fernan Aguero).
  • correct AF/AB strings in termcap for xterm-256color and xterm-88color entries (report by Josh Howard).
  • update wcwidth.c to incorporate changes from Markus Kuhn's 2003-05-20 (Unicode 4.0) version of that file.
  • modify scroll-back and scroll-forw actions to accept an adjustment value, e.g.,
     	      scroll-back(1, page-2)
    to scroll back by 2 lines less than a page (patch by Greg Klanderman). @@ -913,44 +1005,44 @@
    • modify default for configure --enable-pty-handshake option to enable it for Solaris (report by Nelson Beebe).
    • modify in_put() function to call PreeditPosition() only when the cursor's position has changed. This addresses report by Stefan Baums of high CPU usage while xterm with chinput are running in the background (patch by Yong Li).
    • improved explanation of -ls conflict with -e option in xterm manpage (adapted from comments by Henning Makholm).
    • correct comment in terminfo file regarding modifier used for kDC (Debian #189764, report by Henning Makholm).
    • correct/extend some of the keypad description in ctlseqs.ms (report by Henning Makholm). -
    • correct keypad-mapping table in input.c so XK_KP_Equal +
    • correct keypad-mapping table in input.c so XK_KP_Equal works (report by Henning Makholm). -
    • modified to work with CJK double-width (bi-width/monospace) fonts. +
    • modified to work with CJK double-width (bi-width/monospace) fonts. They're similar to Roman Czbora and David Starner's gnuunifonts in that Latin letters and numbers have all the same width which is exactly the half of the width of East Asian characters. (patch by Jungshik Shin <jshin@mailaps.org>).
    • add configure option --enable-broken-osc and resource brokenLinuxOSC to accommodate scripts which do not distinguish between running in the Linux console and running in X. Linux console recognizes malformed control strings which start with an OSC, but are fixed-length, with no terminator.
    • add configure option --enable-broken-st and resource brokenStringTerm to allow user to revert one part of the parsing table corrections from patch #171. (reports by Matthias Scheler and Kirill Ponomarew indicate that someone's network firmware sends an <escape>X).
    • modify configure --disable-imake to provide values @@ -1023,118 +1115,118 @@

      Patch #175 - 2003/3/9 - XFree86 4.3.0

      • fix a SIGSEGV which could occur if xterm is connecting to XIM server, and the XIM server is destroyed (patch by Nam SungHyun).
      • modify to use built-in line-drawing characters for Xft fonts (patch by Andrew Tipton).
      • make menu reflect the state of the tekInhibit resource.
      • make signalInhibit resource work, i.e., disable the menu entries that would send signals to, or exit xterm. This was probably broken in X11R5 when logging was disabled (report by Sven Mascheck).
      • changed classes of colorBDMode and similar resources that override colors when a video attribute is set to ColorAttrMode, to make them distinct from ColorMode. This avoids an unexpected - rendering of reverse video, for example (report by Paul Fox). + rendering of reverse video, for example (report by Paul Fox).
      • changed class of veryBoldColors to - VeryBoldColors, since + VeryBoldColors, since ColorMode is associated with boolean resources.
      • add option -k8 and resource allowC1Printable to allow users of non-VTxxx character sets such as KOI-8 to treat the C1 control area (character codes 128-159) as printable rather than control characters.
      • add a null-pointer check for return-value of ptsname() in HPUX-specific code (report by David Ellement).
      • revise the ifdef's used for XKB bell support. The code was using a nonstandard call XkbStdBell(). Changed to use XkbBell() (based on patch by <derek@signalmarketing.com>).
      • add a null-pointer check in xtermLoadFont() in case there is no wide-bold font (Nam SungHyun).
      • change Makefile.in to use autoconf's bindir, libdir and mandir variables (report by Nam SungHyun).
      • add le to termcap xterm-basic entry. Though missing from older termcaps for xterm, some applications check for it (report by Matthias Buelow).
      • modify uxterm script to strip modifiers such as "@euro" from the locale setting before adding ".UTF-8" (Debian #179929). -
      • modify the remaining places where tek4014 emulation uses +
      • modify the remaining places where tek4014 emulation uses XDefineCursor(), to make it work as originally implemented, e.g., when switching back to alpha mode. Added test-screen in vttest to test this feature properly.

      Patch #174 - 2003/2/25 - XFree86 4.2.99.903

      • work-around for XFree86 bug which made XDefineCursor() - on a shell-window no longer work. The tek4014 emulation used this. + on a shell-window no longer work. The tek4014 emulation used this. Use the next lower window (report by Karl Rudolf Bauchspiess).
      • add a resource setting to control whether the extended window operations should be allowed, e.g., resize, iconify, report window attributes. This is to accommodate people who are not capable of using a pager to view log-files.

      Patch #173 - 2003/2/6 - XFree86 4.2.99.902

      • reset mouse mode to normal on a full reset. This does not apply to mouse hilite tracking mode, of course (see ctlseqs.ms).
      • add a time-delay at the point where mouse hilite tracking mode choses to not handle X events, to avoid runaway CPU usage (report by D Hugh Redelmeier).
      • check for illegal character in DECUDK string, quit if detected.

      Patch #172 - 2002/12/27 - XFree86 4.2.99.3

      • fixes to make repainting of 256-color example work properly (reports by Abigail Brady and Scott A Crosby).
        • set flag in AllocateAnsiColor() to ensure the color is allocated once only.
        • fix check in ScrnRefresh, which was comparing background colors only if the ANSI foreground colors also were set.
      • merge Error() calls and some exit() calls into SysError(), and change that to add the brief - explanation for each error code which is provided in the manpage. + explanation for each error code which is provided in the manpage. Change a few SysError(), calls to avoid using code 1, to avoid confusion with exit status from places that do not use SysError().
      • simplify logic used to open a debug logfile as the standard error.
      • modify the -e option so that if it fails, xterm will check if only one argument follows, e.g., it was quoted, and then retry using sh -c.
      • modify parsing of DECUDK string parameter to allow a comma between pairs of hexadecimal digits (Ray Neuman <raymond@one.com.au> reports that "real" terminals accept this; perhaps they simply ignore unexpected characters).
      • fix a few problems with the $TERMCAP string generated by resize:
        • for Bourne shell, add an export command. This was missing as far back as X11R5. @@ -1236,41 +1328,41 @@
        • fix an option-parsing conflict between -class and -cjk_width (Nam SungHyun)
        • add a missing null in XtVaSetValues() call used in Cleanup() (Nam SungHyun)

        Patch #168 - 2002/9/29 - XFree86 4.2.1

        • improve data reported for control sequence that requests window position by taking into account the window decorations, e.g., border and title (patch by Jess Thrysoee <jess@thrysoee.dk>).
        • add -cjk_width and corresponding resource cjkWidth (patch by Jungshik Shin <jshin@mailaps.org>).
        • add -into option, for embedding xterm in a Tcl/Tk application (patch by George Peter Staplin <georgeps@xmission.com>). -
        • add simple session management (XSM) client capabilities to xterm. +
        • add simple session management (XSM) client capabilities to xterm. So a session manager such as, e.g., xsm, should be able to respawn or kill xterms without the help of an SM proxy (like smproxy), which is a hack and almost always buggy (patch by David Madore).
        • fix conflict between ifdef's for OPT_DEC_LOCATOR and OPT_READLINE in button.c (reported by Ilya Zakharevich).
        • fix for inconsistent use of struct utmp versus struct utmpx introduced in patch #167 (patches by Paul Gilmartin, Marc La France).
        • modify logic for metaSendsEscape to allow it to work in a setup where the Meta-key is not recognized as a modifier by the key-translations logic (from a discussion of eightBitInput with H.J.Lu, however Vincent Lefevre reported this in January).
        • use null pointer values consistently, rather than literal "0", for ending variable-length argument lists, e.g., for execlp() (based on patch by Matthieu Herrb). @@ -1503,41 +1595,41 @@ reset xterm to that state, making the erase character revert to ^H (Debian #117184)

        Patch #163 - 2001/11/04 - XFree86 4.1.0

        • correct ifdef's for __QNX__ and USE_SYSV_PGRP in main.c call to tcsetpgrp, which broke bash behavior around patch #140 (report/patch by Frank Liu <fliu@mail.vipstage.com>).
        • modify trace.c to fix missing definition of GCC_UNUSED for compilers other than gcc when configured for trace code (report/patch by Paul Gilmartin).
        • change format in TraceOptions() to use long rather than int, since the latter could lose precision on 64-bit machines (report/patch by Nelson Beebe).
        • modify xterm manual page and minstall.sh to allow imake rules - to define location of app-defaults directory (Debian #87611). + to define location of app-defaults directory (Debian #87611).
        • review/update list of conflicting preprocesor symbols to remove from $CPPFLAGS at the end of the configure script. In particular, this allows one to configure xterm without the utempter library on Redhat 7.1 (report/patch by Adam Sulmicki).

        Patch #162 - 2001/10/23 - XFree86 4.1.0

        • correct logic that processes -class option, so that a following -e option is handled (Debian #116297).
        • improve options-decoding to allow -version and -help options to be combined (Debian #110226).
        • add a 10 millisecond delay in event loop when processing -hold option, to avoid using too much CPU time (Debian #116213).
        • prefix final program execution in uxterm with "exec" Index: xc/programs/xterm/xterm.man =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/xterm.man,v retrieving revision 1.3 diff -u -2 -0 -r1.3 xterm.man --- xc/programs/xterm/xterm.man 13 Aug 2004 12:57:21 -0000 1.3 +++ xc/programs/xterm/xterm.man 6 Jan 2005 00:31:06 -0000 @@ -1,21 +1,21 @@ -.\" $XTermId: xterm.man,v 1.279 2004/07/28 00:53:26 tom Exp $ +.\" $XTermId: xterm.man,v 1.288 2004/12/01 01:27:47 tom Exp $ .\" $Xorg: xterm.man,v 1.4 2001/02/09 02:06:03 xorgcvs Exp $ .\" .\" .\" Copyright 1996-2003,2004 by Thomas E. Dickey .\" .\" All Rights Reserved .\" .\" Permission is hereby granted, free of charge, to any person obtaining a .\" copy of this software and associated documentation files (the .\" "Software"), to deal in the Software without restriction, including .\" without limitation the rights to use, copy, modify, merge, publish, .\" distribute, sublicense, and/or sell copies of the Software, and to .\" permit persons to whom the Software is furnished to do so, subject to .\" the following conditions: .\" .\" The above copyright notice and this permission notice shall be included .\" in all copies or substantial portions of the Software. .\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF @@ -38,41 +38,41 @@ .\" the above copyright notice appear in all copies and that both that .\" copyright notice and this permission notice appear in supporting .\" documentation. .\" .\" The above copyright notice and this permission notice shall be included .\" in all copies or substantial portions of the Software. .\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. .\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR .\" OTHER DEALINGS IN THE SOFTWARE. .\" .\" Except as contained in this notice, the name of The Open Group shall .\" not be used in advertising or otherwise to promote the sale, use or .\" other dealings in this Software without prior written authorization .\" from The Open Group. .\" -.\" $XFree86: xc/programs/xterm/xterm.man,v 3.109 2004/07/28 00:53:26 dickey Exp $ +.\" $XFree86: xc/programs/xterm/xterm.man,v 3.110 2004/12/01 01:27:47 dickey Exp $ .\" .\" updated by Thomas E. Dickey for XFree86, July 1996 - July 2004. .TH XTERM 1 __vendorversion__ .SH NAME xterm \- terminal emulator for X .SH SYNOPSIS .B xterm [-\fItoolkitoption\fP ...] [-option ...] .SH DESCRIPTION The \fIxterm\fP program is a terminal emulator for the X Window System. It provides DEC VT102/VT220 (VTxxx) and Tektronix 4014 compatible terminals for programs that cannot use the window system directly. If the underlying operating system supports terminal resizing capabilities (for example, the SIGWINCH signal in systems derived from 4.3bsd), \fIxterm\fP will use the facilities to notify programs running in the window whenever it is resized. . .PP The VTxxx and Tektronix 4014 terminals each have their own window so that you @@ -184,45 +184,46 @@ . .PP In either VT102 or Tektronix mode, there are escape sequences to change the name of the windows. Additionally, in VT102 mode, \fIxterm\fP implements the window-manipulation control sequences from \fIdtterm\fP, such as resizing the window, setting its location on the screen. . .PP .I Xterm allows character-based applications to receive mouse events (currently button-press and release events, and button-motion events) as keyboard control sequences. See \fIXterm Control Sequences\fP for details. . . .SH OPTIONS The \fIxterm\fP terminal emulator accepts all of the standard X Toolkit command line options as well as -the following (if the option begins with a +the following. +If the option begins with a .RB ` + ' instead of a .RB ` - ', -the option is restored to its default value). +the option is restored to its default value. The \fB-version\fP and \fB-help\fP options are interpreted even if \fIxterm\fP cannot open the display, and are useful for testing and configuration scripts: .TP 8 .B -version This causes \fIxterm\fP to print a version number to the standard output. .TP 8 .B -help This causes \fIxterm\fP to print out a verbose message describing its options. The message is written to the standard error. . .PP The other options are used to control the appearance and behavior. Not all options are necessarily configured into your copy of \fIxterm\fP. .TP 8 .B -132 Normally, the VT102 DECCOLM escape sequence that switches between 80 and 132 column mode is ignored. This option causes the DECCOLM escape sequence to be recognized, and the .I xterm window will resize appropriately. @@ -780,42 +781,47 @@ .BI -ti " term_id" Specify the name used by \fIxterm\fP to select the correct response to terminal ID queries. It also specifies the emulation level, used to determine the type of response to a DA control sequence. Valid values include vt52, vt100, vt101, vt102, and vt220 (the "vt" is optional). The default is vt100. The term_id argument specifies the terminal ID to use. (This is the same as the \fBdecTerminalID\fP resource). .TP 8 .BI -tm " string" This option specifies a series of terminal setting keywords followed by the characters that should be bound to those functions, similar to the \fIstty\fP program. The keywords and their values are described in detail in the \fBttyModes\fP resource. .TP 8 .BI -tn " name" This option specifies the name of the terminal type to be set in the TERM environment variable. -This terminal type must exist in the \fItermcap(5)\fP -database and should have \fIli#\fP and \fIco#\fP entries. +It corresponds to the \fBtermName\fP resource. +This terminal type must exist in the terminal +database +(termcap or terminfo, depending on how \fIxterm\fP is built) +and should have \fIli#\fP and \fIco#\fP entries. +If the terminal type is not found, \fIxterm\fP uses the built-in list +``xterm'', ``vt102'', etc. .TP 8 .B -u8 This option sets the \fButf8\fP resource. When \fButf8\fP is set, \fIxterm\fP interprets incoming data as UTF-8. This sets the \fBwideChars\fP resource as a side-effect, but the UTF-8 mode set by this option prevents it from being turned off. If you must turn it on and off, use the \fBwideChars\fP resource. .IP This option and the \fButf8\fR resource are overridden by the \fB-lc\fP and \fB-en\fP options and \fBlocale\fR resource. That is, if \fIxterm\fP has been compiled to support \fIluit\fR, and the \fBlocale\fP resource is not ``false'' this option is ignored. We recommend using the \fB-lc\fR option or the ``\fBlocale:\ true\fR'' resource in UTF-8 locales when your operating system supports locale, or \fB-en\ UTF-8\fP option or the ``\fBlocale:\ UTF-8\fR'' resource when your operating system does not support locale. .TP 8 .B +u8 @@ -1105,41 +1111,41 @@ and keypad (see the document \fIXterm Control Sequences\fP for details). The PC-style bindings are analogous to PCTerm, but not the same thing. Normally these bindings do not conflict with the use of the Meta key as described for the \fBeightBitInput\fP resource. If they do, note that the PC-style bindings are evaluated first. .TP 8 .B "termName (\fPclass\fB TermName)" Specifies the terminal type name to be set in the TERM environment variable. .TP 8 .B "title (\fPclass\fB Title)" Specifies a string that may be used by the window manager when displaying this application. .TP 8 .B "ttyModes (\fPclass\fB TtyModes)" Specifies a string containing terminal setting keywords and the characters to which they may be bound. Allowable keywords include: brk, dsusp, -eof, +eof, eol, eol2, erase, erase2, flush, intr, kill, lnext, quit, rprnt, start, status, stop, susp, swtch and weras. Control characters may be specified as ^char (e.g., ^c or ^u) and \fB^?\fP may be used to indicate delete (127). Use \fB^-\fP to denote \fIundef\fP. Use \fB\\034\fP to represent \fB^\\\fP, since a literal backslash in @@ -1534,40 +1540,41 @@ Specifies the duration of the "on" part of the cursor blink cycle-time, in milliseconds. The same timer is used for text blinking. The default is 600. .TP 8 .B "cutNewline (\fPclass\fB CutNewline)" If ``false'', triple clicking to select a line does not include the Newline at the end of the line. If ``true'', the Newline is selected. The default is ``true.'' .TP 8 .B "cutToBeginningOfLine (\fPclass\fB CutToBeginningOfLine)" If ``false'', triple clicking to select a line selects only from the current word forward. If ``true'', the entire line is selected. The default is ``true.'' .TP 8 .B "decTerminalID (\fPclass\fB DecTerminalID)" Specifies the emulation level (100=VT100, 220=VT220, etc.), used to determine the type of response to a DA control sequence. +Leading non-digit characters are ignored, e.g., "vt100" and "100" are the same. The default is 100. .TP 8 .B "deleteIsDEL (\fPclass\fB DeleteIsDEL)" Specifies whether the Delete key on the editing keypad should send DEL (127) or the VT220-style Remove escape sequence. The default is ``false,'' for the latter. .TP 8 .B "dynamicColors (\fPclass\fB DynamicColors)" Specifies whether or not escape sequences to change colors assigned to different attributes are recognized. .TP 8 .B "eightBitControl (\fPclass\fB EightBitControl\fP)" Specifies whether or not control sequences sent by the terminal should be eight-bit characters or escape sequences. The default is ``false.'' .TP 8 .B "eightBitInput (\fPclass\fB EightBitInput\fP)" If ``true'', Meta characters (a character combined with the \fIkeys\fP modifier key) input from the keyboard are presented as a @@ -1662,42 +1669,46 @@ Specifies the name of the fourth alternative font. .TP 8 .B "font5 (\fPclass\fB Font5)" Specifies the name of the fifth alternative font. .TP 8 .B "font6 (\fPclass\fB Font6)" Specifies the name of the sixth alternative font. .TP 8 .B "fontDoublesize (\fPclass\fB FontDoublesize)" Specifies whether \fIxterm\fP should attempt to use font scaling to draw doublesize characters. Some older font servers cannot do this properly, will return misleading font metrics. The default is ``true''. If disabled, \fIxterm\fP will simulate doublesize characters by drawing normal characters with spaces between them. .TP 8 .B "forceBoxChars (\fPclass\fB ForceBoxChars)" Specifies whether \fIxterm\fP should assume the normal and bold fonts have VT100 line-drawing characters. -If ``false'', \fIxterm\fP will check for missing characters in the 1-31 -cells and make line-drawing characters directly. +The fixed-pitch fonts used by \fIxterm\fP +normally have the VT100 line-drawing glyphs in cells 1-31. +Other fixed-pitch fonts may be more attractive, but lack these glyphs. +If ``false'', \fIxterm\fP will check for missing glyphs in cells 1-31 +and make line-drawing characters directly. +If ``true'', \fIxterm\fP uses whatever is in cells 1-31 without checking. The default is ``false.'' .TP 8 .B "foreground (\fPclass\fB Foreground)" Specifies the color to use for displaying text in the window. Setting the class name instead of the instance name is an easy way to have everything that would normally appear in the text color change color. The default is ``black.'' .TP 8 .B "freeBoldBox (\fPclass\fB freeBoldBox)" Specifies whether \fIxterm\fP should assume the bounding boxes for normal and bold fonts are compatible. If ``false'', \fIxterm\fP compares them and will reject choices of bold fonts that do not match the size of the normal font. The default is ``false'', which means that the comparison is performed. .TP 8 .B "geometry (\fPclass\fB Geometry)" Specifies the preferred size and position of the VT102 window. There is no default for this resource. @@ -1778,49 +1789,56 @@ See the discussion of the \fBkeymap()\fP action. .TP 8 .B "limitResize (\fPclass\fB LimitResize)" Limits resizing of the screen via control sequence to a given multiple of the display dimensions. The default is ``1''. .TP 8 .B "locale (\fPclass\fB Locale)" Specifies how to use \fIluit\fR, an encoding converter between UTF-8 and locale encodings. The resource value (ignoring case) may be: .RS .TP 4 .I true \fIxterm\fR will use the encoding specified by the users' LC_CTYPE locale (i.e., LC_ALL, LC_CTYPE, or LANG variables) as far as possible. This is realized by always enabling UTF-8 mode and invoking \fIluit\fR in non-UTF-8 locales. -.TP 4 +.TP .I medium \fIxterm\fR will follow users' LC_CTYPE locale only for UTF-8, east Asian, and Thai locales, where the encodings were not supported by conventional 8bit mode with changing fonts. For other locales, \fIxterm\fR will use conventional 8bit mode. -.TP 4 -.I no +.TP +.I checkfont +If mini-luit is compiled-in, \fIxterm\fR will check if a Unicode font has +been specified. If so, it checks if the character encoding for the +current locale is POSIX, Latin-1 or Latin-9, uses the appropriate +mapping to support those with the Unicode font. +For other encodings, \fIxterm\fR assumes that UTF-8 encoding is required. +.TP +.I false \fIxterm\fR will use conventional 8bit mode or UTF-8 mode according to \fButf8\fR resource or \fB-u8\fP option. .RE .IP Any other value, e.g., ``UTF-8'' or ``ISO8859-2'', is assumed to be an encoding name; \fIluit\fR will be invoked to support the encoding. The actual list of supported encodings depends on \fIluit\fR. The default is ``medium''. .IP Regardless of your locale and encoding, you need an ISO-10646-1 font to display the result. Your configuration may not include this font, or locale-support by \fIxterm\fP may not be needed. At startup, \fIxterm\fP uses a mechanism equivalent to the \fBload-vt-fonts(utf8Fonts,\ Utf8Fonts)\fP action to load font name subresources of the VT100 widget. That is, resource patterns such as "\fB*vt100.utf8Fonts.font\fP" will be loaded, and (if this resource is enabled), override the normal fonts. @@ -2071,44 +2089,53 @@ .B "tiXtraScroll (\fPclass\fB TiXtraScroll)" Specifies whether \fIxterm\fP should scroll to a new page when processing the \fIti\fP termcap entry, i.e., the private modes 47, 1047 or 1049. This is only in effect if \fBtiteInhibit\fP is ``true'', because the intent of this option is to provide a picture of the full-screen application's display on the scrollback without wiping out the text that would be shown before the application was initialized. The default for this resource is ``false.'' .TP 8 .B "titeInhibit (\fPclass\fB TiteInhibit)" Specifies whether or not \fIxterm\fP should remove \fIti\fP and \fIte\fP termcap entries (used to switch between alternate screens on startup of many screen-oriented programs) from the TERMCAP string. If set, \fIxterm\fP also ignores the escape sequence to switch to the alternate screen. \fIXterm\fP supports terminfo in a different way, supporting composite control sequences (also known as private modes) 1047, 1048 and 1049 which have the same effect as the original 47 control sequence. The default for this resource is ``false.'' +.\" -- resource does not work properly (forms/layout issues) +.\".TP 8 +.\".B "toolBar (\fPclass\fB ToolBar)" +.\"Specifies whether or not the toolbar should be displayed. +.\"The default is +.\"``false.'' .TP 8 .B "translations (\fPclass\fB Translations)" Specifies the key and button bindings for menus, selections, ``programmed strings,'' etc. +The \fBtranslations\fP resource, +which provides much of \fIxterm\fP's configurability, +is a feature of the X Toolkit Intrinsics library (Xt). See the \fBACTIONS\fP section. .TP 8 .B "trimSelection (\fPclass\fB TrimSelection)" If you set \fBhighlightSelection\fP, you can see the text which is selected, including any trailing spaces. Clearing the screen (or a line) resets it to a state containing no spaces. Some lines may contain trailing spaces when an application writes them to the screen. However, you may not wish to paste lines with trailing spaces. If this resource is true, \fIxterm\fP will trim trailing spaces from text which is selected. It does not affect spaces which result in a wrapped line, nor will it trim the trailing newline from your selection. The default is ``false.'' .TP 8 .B "underLine (\fPclass\fB UnderLine)" This specifies whether or not text with the underline attribute should be underlined. It may be desirable to disable underlining when color is being used for the underline attribute. @@ -2236,40 +2263,43 @@ .TP 8 .B "initialFont (\fPclass\fB InitialFont)" Specifies which of the four Tektronix fonts to use initially. Values are the same as for the \fIset-tek-text\fP action. The default is ``large.'' .TP 8 .B "width (\fPclass\fB Width)" Specifies the width of the Tektronix window in pixels. . .PP The resources that may be specified for the various menus are described in the documentation for the Athena \fBSimpleMenu\fP widget. The name and classes of the entries in each of the menus are listed below. Resources named "\fBline\fR\fIN\fR" where \fIN\fR is a number are separators with class \fBSmeLine\fR. . .PP The \fImainMenu\fP has the following entries: .TP 8 +.B "toolbar (\fPclass\fB SmeBSB)" +This entry invokes the \fBset-toolbar(toggle)\fP action. +.TP 8 .B "securekbd (\fPclass\fB SmeBSB)" This entry invokes the \fBsecure()\fP action. .TP 8 .B "allowsends (\fPclass\fB SmeBSB)" This entry invokes the \fBallow-send-events(toggle)\fP action. .TP 8 .B "redraw (\fPclass\fB SmeBSB)" This entry invokes the \fBredraw()\fP action. .TP 8 .B "logging (\fPclass\fB SmeBSB)" This entry invokes the \fBlogging(toggle)\fP action. .TP 8 .B "print (\fPclass\fB SmeBSB)" This entry invokes the \fBprint()\fP action. .TP 8 .B "print-redir (\fPclass\fB SmeBSB)" This entry invokes the \fBprint-redir()\fP action. .TP 8 .B "8-bit-control (\fPclass\fB SmeBSB)" This entry invokes the \fBset-8-bit-control(toggle)\fP action. @@ -2500,42 +2530,41 @@ . .SH "POINTER USAGE" . .PP Once the VT102 window is created, .I xterm allows you to select text and copy it within the same or other windows. . .PP The selection functions are invoked when the pointer buttons are used with no modifiers, and when they are used with the ``shift'' key. The assignment of the functions described below to keys and buttons may be changed through the resource database; see \fBACTIONS\fP below. . .PP Pointer button one (usually left) is used to save text into the cut buffer. Move the cursor to beginning of the text, and then hold the button down while moving the cursor to the end of the region and releasing the button. The selected text is highlighted and is saved in the global cut buffer -and made the PRIMARY selection when -the button is released. +and made the PRIMARY selection when the button is released. Double-clicking selects by words. Triple-clicking selects by lines. Quadruple-clicking goes back to characters, etc. Multiple-click is determined by the time from button up to button down, so you can change the selection unit in the middle of a selection. Logical words and lines selected by double- or triple-clicking may wrap across more than one screen line if lines were wrapped by \fIxterm\fP itself rather than by the application running in the window. If the key/button bindings specify that an X selection is to be made, \fIxterm\fP will leave the selected text highlighted for as long as it is the selection owner. . .PP Pointer button two (usually middle) `types' (pastes) the text from the PRIMARY selection, if any, otherwise from the cut buffer, inserting it as keyboard input. . .PP @@ -2543,42 +2572,42 @@ (Without loss of generality, you can swap ``right'' and ``left'' everywhere in the rest of this paragraph.) If pressed while closer to the right edge of the selection than the left, it extends/contracts the right edge of the selection. If you contract the selection past the left edge of the selection, .I xterm assumes you really meant the left edge, restores the original selection, then extends/contracts the left edge of the selection. Extension starts in the selection unit mode that the last selection or extension was performed in; you can multiple-click to cycle through them. . .PP By cutting and pasting pieces of text without trailing new lines, you can take text from several places in different windows and form a command to the shell, for example, or take output from a program and insert it into your favorite editor. -Since the cut buffer is globally shared among different applications, -you should regard it as a `file' whose contents you know. +Since cut buffers are globally shared among different applications, +you may regard each as a `file' whose contents you know. The terminal emulator and other text programs should be treating it as if it were a text file, i.e., the text is delimited by new lines. . .PP The scroll region displays the position and amount of text currently showing in the window (highlighted) relative to the amount of text actually saved. As more text is saved (up to the maximum), the size of the highlighted area decreases. . .PP Clicking button one with the pointer in the scroll region moves the adjacent line to the top of the display window. . .PP Clicking button three moves the top line of the display window down to the pointer position. . .PP Clicking button two moves the display to a position in the saved text that corresponds to the pointer's position in the scrollbar. @@ -2726,214 +2755,214 @@ Send CONT Signal (continue) .TP Send INT Signal (interrupt) .TP Send HUP Signal (hangup) .TP Send TERM Signal (terminate) .TP Send KILL Signal (kill) These send the SIGTSTP, SIGCONT, SIGINT, SIGHUP, SIGTERM and SIGKILL signals respectively, to the process group of the process running under .I xterm (usually the shell). The .B SIGCONT function is especially useful if the user has accidentally typed CTRL-Z, suspending the process. .TP Quit (quit) Stop processing X events except to support the \fB-hold\fP option, -and then send a SIGHUP signal to the +and then send a SIGHUP signal to the the process group of the process running under .I xterm (usually the shell). .RE .PP . .\" ************************************************************************ .PP The .I vtMenu sets various modes in the VT102 emulation, and is popped up when the ``control'' key and pointer button two are pressed in the VT102 window. .TP VT102/VT220 Modes: .RS . .TP Enable Scrollbar (scrollbar) Enable (or disable) the scrollbar. -This corresponds to the +This corresponds to the .B -sb option and the .B scrollBar resource. . .TP Enable Jump Scroll (jumpscroll) Enable (or disable) jump scrolling. -This corresponds to the +This corresponds to the .B -j option and the .B jumpScroll resource. . .TP Enable Reverse Video (reversevideo) Enable (or disable) reverse-video. -This corresponds to the +This corresponds to the .B -rv option and the .B reverseVideo resource. . .TP Enable Auto Wraparound (autowrap) Enable (or disable) auto-wraparound. -This corresponds to the +This corresponds to the .B -aw option and the .B autoWrap resource. . .TP Enable Reverse Wraparound (reversewrap) Enable (or disable) reverse wraparound. -This corresponds to the +This corresponds to the .B -rw option and the .B reverseWrap resource. . .TP Enable Auto Linefeed (autolinefeed) Enable (or disable) auto-linefeed. This is the VT102 NEL function, which causes the emulator to emit a linefeed after each carriage return. There is no corresponding command-line option or resource setting. . .TP Enable Application Cursor Keys (appcursor) Enable (or disable) application cursor keys. This corresponds to the .B appcursorDefault resource. There is no corresponding command-line option. . .TP Enable Application Keypad (appkeypad) Enable (or disable) application keypad keys. This corresponds to the .B appkeypadDefault resource. There is no corresponding command-line option. . .TP Scroll to Bottom on Key Press (scrollkey) Enable (or disable) scrolling to the bottom of the scrolling region on a keypress. -This corresponds to the +This corresponds to the .B -sk option and the .B scrollKey resource. . .TP Scroll to Bottom on Tty Output (scrollttyoutput) Enable (or disable) scrolling to the bottom of the scrolling region on output to the terminal.. -This corresponds to the +This corresponds to the .B -si option and the .B scrollTtyOutput resource. . .TP Allow 80/132 Column Switching (allow132) Enable (or disable) switching between 80 and 132 columns. -This corresponds to the +This corresponds to the .B -132 option and the .B c132 resource. . .TP Enable Curses Emulation (cursesemul) Enable (or disable) a workaround for the so-called "curses bug". -This corresponds to the +This corresponds to the .B -cu option and the .B curses resource. . .TP Enable Visual Bell (visualbell) Enable (or disable) visible bell (i.e., flashing) instead of an audible bell. -This corresponds to the +This corresponds to the .B -vb option and the .B visualBell resource. . .TP Enable Pop on Bell (poponbell) Enable (or disable) raising of the window when Control-G is received. -This corresponds to the +This corresponds to the .B -pop option and the .B popOnBell resource. . .TP Enable Margin Bell (marginbell) Enable (or disable) a bell when the user types near the right margin. -This corresponds to the +This corresponds to the .B -mb option and the .B marginBell resource. . .TP Enable Blinking Cursor (cursorblink) Enable (or disable) the blinking-cursor feature. -This corresponds to the +This corresponds to the .B -bc option and the .B cursorBlink resource. There is also an escape sequence (see the document \fIXterm Control Sequences\fP). The menu entry and the escape sequence states are XOR'd: if both are enabled, the cursor will not blink, if only one is enabled, the cursor will blink. . .TP Enable Alternate Screen Switching (titeInhibit) Enable (or disable) switching between the normal and alternate screens. -This corresponds to the +This corresponds to the .B titeInhibit resource. There is no corresponding command-line option. . .TP Enable Active Icon (activeicon) Enable (or disable) the active-icon feature. -This corresponds to the +This corresponds to the .B -ai option and the .B activeIcon resource. .RE . .TP VT102/VT220 Commands: .RS .TP Do Soft Reset (softreset) Reset scroll regions. This can be convenient when some program has left the scroll regions set incorrectly (often a problem when using VMS or TOPS-20). This corresponds to the VT220 DECSTR control sequence. . .TP Do Full Reset (hardreset) The full reset entry will clear the screen, reset tabs to every eight columns, and reset the terminal modes (such as wrap and smooth scroll) @@ -3023,41 +3052,41 @@ Medium (font4) Set the font to that given by the .B *VT100.font4 resource. .TP Large (font5) Set the font to that given by the .B *VT100.font5 resource. .TP Huge (font6) Set the font to that given by the .B *VT100.font6 resource. .TP Escape Sequence This allows you to set the font last specified by the Set Font escape sequence (see the document \fIXterm Control Sequences\fP). .TP Selection (fontsel) -This allows you to set the font specified +This allows you to set the font specified the current selection as a font name (if the PRIMARY selection is owned). .RE .PP The second section allows you to modify the way it is displayed: .RS .TP Line-Drawing Characters (font-linedrawing) When set, tells \fIxterm\fP to draw its own line-drawing characters. Otherwise it relies on the font containing these. .TP Doublesized Characters (font-doublesize) When set, \fIxterm\fP may ask the font server to produce scaled versions of the normal font, for VT102 double-size characters. .RE .PP The third section allows you to modify the way it is specified: .RS .TP TrueType Fonts (render-font) If the @@ -3276,45 +3305,47 @@ 48, 48, 48, 48, 48, 48, 48, 48, /\(** e` e' e^ e: i` i' i^ i: */ 48, 48, 48, 48, 48, 48, 48, 48, /\(** d n~ o` o' o^ o~ o: -: */ 48, 48, 48, 48, 48, 48, 48, 247, /\(** o/ u` u' u^ u: y' P y: */ 48, 48, 48, 48, 48, 48, 48, 48}; .fi .ft P .in -8 .sp For example, the string ``33:48,37:48,45-47:48,38:48'' indicates that the exclamation mark, percent sign, dash, period, slash, and ampersand characters should be treated the same way as characters and numbers. This is useful for cutting and pasting electronic mailing addresses and filenames. . . .SH ACTIONS It is possible to rebind keys (or sequences of keys) to arbitrary strings -for input, by changing the translations for the vt100 or tek4014 widgets. -Changing the translations for events other than key and button events -is not expected, and will cause unpredictable behavior. +for input, by changing the \fBtranslations\fP resources +for the vt100 or tek4014 widgets. +Changing the \fBtranslations\fP resource +for events other than key and button events is not expected, +and will cause unpredictable behavior. The following -actions are provided for using within the \fIvt100\fP or \fItek4014\fP +actions are provided for use within the \fIvt100\fP or \fItek4014\fP \fBtranslations\fP resources: .TP 8 .B "allow-send-events(\fIon/off/toggle\fP)" This action set or toggles the \fBallowSendEvents\fP resource and is also invoked by the \fBallowsends\fP entry in \fImainMenu\fP. .TP 8 .B "bell([\fIpercent\fP])" This action rings the keyboard bell at the specified percentage above or below the base volume. .TP 8 .B "clear-saved-lines()" This action does \fBhard-reset()\fP (see below) and also clears the history of lines saved off the top of the screen. It is also invoked from the \fBclearsavedlines\fP entry in \fIvtMenu\fP. The effect is identical to a hardware reset (RIS) control sequence. .TP 8 .B "create-menu(\fIm/v/f/t\fP)" This action creates one of the menus used by \fIxterm\fP, if it has not been previously created. The parameter values are the menu names: @@ -3448,64 +3479,63 @@ .TP 8 .B "restore()" Restores the window to the size before it was last maximized. .TP 8 .B "scroll-back(\fIcount\fP [,\fIunits\fP [,\fImouse\fP] ])" This action scrolls the text window backward so that text that had previously scrolled off the top of the screen is now visible. .IP The \fIcount\fP argument indicates the number of \fIunits\fP (which may be \fIpage\fP, \fIhalfpage\fP, \fIpixel\fP, or \fIline\fP) by which to scroll. .IP An adjustment can be specified for these values by appending a "+" or "-" sign followed by a number, e.g., \fIpage-2\fP to specify 2 lines less than a page. .IP If the third parameter \fImouse\fP is given, the action is ignored when mouse reporting is enabled. .TP 8 .B "scroll-forw(\fIcount\fP [,\fIunits\fP [,\fImouse\fP] ])" -This action scrolls is similar to \fBscroll-back\fP except that it scrolls -the other direction. +This action is similar to \fBscroll-back\fP except that it scrolls +in the other direction. .TP 8 .B "secure()" This action toggles the \fISecure Keyboard\fP mode described in the section named \fBSECURITY\fP, and is invoked from the \fBsecurekbd\fP entry in \fImainMenu\fP. .TP 8 .B "select-cursor-end(\fIdestname\fP [, ...])" This action is similar to \fBselect-end\fP except that it should be used with \fBselect-cursor-start\fP. .TP 8 .B "select-cursor-start()" This action is similar to \fBselect-start\fP except that it begins the selection at the current text cursor position. .TP 8 .B "select-end(\fIdestname\fP [, ...])" This action puts the currently selected text into all of the selections or cutbuffers specified by \fIdestname\fP. .TP 8 .B "select-extend()" This action tracks the pointer and extends the selection. -It -should only be bound to Motion events. +It should only be bound to Motion events. .TP 8 .B "select-set()" This action stores text that corresponds to the current selection, without affecting the selection mode. .TP 8 .B "select-start()" This action begins text selection at the current pointer location. See the section on \fBPOINTER USAGE\fP for information on making selections. .TP 8 .B "send-signal(\fIsigname\fP)" This action sends the signal named by \fIsigname\fP to the \fIxterm\fP subprocess (the shell or program specified with the \fI-e\fP command line option) and is also invoked by the .BR suspend , .BR continue , .BR interrupt , .BR hangup , .BR terminate , and @@ -3626,40 +3656,45 @@ the \fBsunKeyboard\fP entry in \fImainMenu\fP. .TP 8 .B "set-tek-text(\fIlarge/2/3/small\fP)" This action sets font used in the Tektronix window to the value of the resources \fBtektextlarge\fP, \fBtektext2\fP, \fBtektext3\fP, and \fBtektextsmall\fP according to the argument. It is also by the entries of the same names as the resources in \fItekMenu\fP. .TP 8 .B "set-terminal-type(\fItype\fP)" This action directs output to either the \fIvt\fP or \fItek\fP windows, according to the \fItype\fP string. It is also invoked by the \fBtekmode\fP entry in \fIvtMenu\fP and the \fBvtmode\fP entry in \fItekMenu\fP. .TP 8 .B "set-titeInhibit(\fIon/off/toggle\fP)" This action toggles the \fBtiteInhibit\fP resource, which controls switching between the alternate and current screens. .TP 8 +.\" should toggle "toolBar" resource (see note). +.B "set-toolbar(\fIon/off/toggle\fP)" +This action toggles the toolbar feature and is also invoked by +the \fBtoolbar\fP entry in \fImainMenu\fP. +.TP 8 .B "set-utf8-mode(\fIon/off/toggle\fP)" This action toggles the \fButf8\fP resource and is also invoked by the \fButf8-mode\fP entry in \fIfontMenu\fP. .TP 8 .B "set-visibility(\fIvt/tek\fP,\fIon/off/toggle\fP)" This action controls whether or not the \fIvt\fP or \fItek\fP windows are visible. It is also invoked from the \fBtekshow\fP and \fBvthide\fP entries in \fIvtMenu\fP and the \fBvtshow\fP and \fBtekhide\fP entries in \fItekMenu\fP. .TP 8 .B "set-visual-bell(\fIon/off/toggle\fP)" This action toggles the \fBvisualBell\fP resource and is also invoked by the \fBvisualbell\fP entry in \fIvtMenu\fP. .TP 8 .B "set-vt-font(\fId/1/2/3/4/5/6/e/s\fP [,\fInormalfont\fP [, \fIboldfont\fP]])" This action sets the font or fonts currently being used in the VT102 window. The first argument is a single character that specifies the font to be used: .RS 8 @@ -3780,73 +3815,99 @@ ~Ctrl ~Meta :ignore() \\n\\ Meta :clear-saved-lines() \\n\\ ~Ctrl ~Meta :insert-selection(PRIMARY, CUT_BUFFER0) \\n\\ !Ctrl :popup-menu(fontMenu) \\n\\ !Lock Ctrl :popup-menu(fontMenu) \\n\\ !Lock Ctrl @Num_Lock :popup-menu(fontMenu) \\n\\ ! @Num_Lock Ctrl :popup-menu(fontMenu) \\n\\ ~Ctrl ~Meta :start-extend() \\n\\ ~Meta :select-extend() \\n\\ Ctrl :scroll-back(1,halfpage,m) \\n\\ Lock Ctrl :scroll-back(1,halfpage,m) \\n\\ Lock @Num_Lock Ctrl :scroll-back(1,halfpage,m) \\n\\ @Num_Lock Ctrl :scroll-back(1,halfpage,m) \\n\\ :scroll-back(5,line,m) \\n\\ Ctrl :scroll-forw(1,halfpage,m) \\n\\ Lock Ctrl :scroll-forw(1,halfpage,m) \\n\\ Lock @Num_Lock Ctrl :scroll-forw(1,halfpage,m) \\n\\ @Num_Lock Ctrl :scroll-forw(1,halfpage,m) \\n\\ :scroll-forw(5,line,m) \\n\\ :select-end(PRIMARY, CUT_BUFFER0) \\n\\ - :bell(0) + :ignore() .fi .ft P .sp .in -4 .PP The default bindings in the Tektronix window are: .sp .in +4 .ta 2.5i .nf .ft C \" Courier ~Meta: insert-seven-bit() \\n\\ Meta: insert-eight-bit() \\n\\ !Ctrl : popup-menu(mainMenu) \\n\\ !Lock Ctrl : popup-menu(mainMenu) \\n\\ !Lock Ctrl @Num_Lock : popup-menu(mainMenu) \\n\\ !Ctrl @Num_Lock : popup-menu(mainMenu) \\n\\ !Ctrl : popup-menu(tekMenu) \\n\\ !Lock Ctrl : popup-menu(tekMenu) \\n\\ !Lock Ctrl @Num_Lock : popup-menu(tekMenu) \\n\\ !Ctrl @Num_Lock : popup-menu(tekMenu) \\n\\ Shift ~Meta: gin-press(L) \\n\\ ~Meta: gin-press(l) \\n\\ Shift ~Meta: gin-press(M) \\n\\ ~Meta: gin-press(m) \\n\\ Shift ~Meta: gin-press(R) \\n\\ ~Meta: gin-press(r) .fi .ft P .sp .in -4 .PP +Here is an example which uses shifted select/paste to copy to the clipboard, +and unshifted select/paste for the primary selection. +In each case, a (different) cut buffer is +also a target or source of the select/paste operation. +It is important to remember however, +that cut buffers store data in ISO-8859-1 encoding, +while selections can store data in a variety of formats and encodings. +While \fIxterm\fP owns the selection, it highlights it. +When it loses the selection, it removes the corresponding highlight. +But you can still paste from the corresponding cut buffer. +.sp +.in +4 +.nf +.ta .5i 1.5i +.nf +.ft C \" Courier +*VT100*translations: #override \\n\\ + ~Shift~Ctrl: insert-selection(PRIMARY, CUT_BUFFER0) \\n\\ + Shift~Ctrl: insert-selection(CLIPBOARD, CUT_BUFFER1) \\n\\ + ~Shift: select-end(PRIMARY, CUT_BUFFER0) \\n\\ + Shift: select-end(CLIPBOARD, CUT_BUFFER1) +.fi +.ft P +.sp +.in -4 +.PP Below is a sample how of the \fBkeymap()\fP action is used to add special keys for entering commonly-typed works: .sp .in +4 .nf .ta .5i 1.5i .nf .ft C \" Courier *VT100.Translations: #override F13: keymap(dbx) *VT100.dbxKeymap.translations: \\ F14: keymap(None) \\n\\ F17: string("next") string(0x0d) \\n\\ F18: string("step") string(0x0d) \\n\\ F19: string("continue") string(0x0d) \\n\\ F20: string("print ") insert-selection(PRIMARY, CUT_BUFFER0) .fi .ft P .sp .in -4 .SH "CONTROL SEQUENCES AND KEYBOARD" Index: xc/programs/xterm/xterm_io.h =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/xterm_io.h,v retrieving revision 1.3 diff -u -2 -0 -r1.3 xterm_io.h --- xc/programs/xterm/xterm_io.h 13 Aug 2004 12:57:21 -0000 1.3 +++ xc/programs/xterm/xterm_io.h 6 Jan 2005 00:31:06 -0000 @@ -1,22 +1,22 @@ /* - * $XFree86: xc/programs/xterm/xterm_io.h,v 1.15 2004/04/03 22:26:26 dawes Exp $ + * $XFree86: xc/programs/xterm/xterm_io.h,v 1.16 2004/12/01 01:27:47 dickey Exp $ */ /* * Copyright 2000-2003,2004 by Thomas E. Dickey * * All Rights Reserved * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF @@ -41,41 +41,41 @@ * System-specific definitions (keep these chunks one-per-system!). * * FIXME: some, such as those defining USE_TERMIOS should be moved to xterm.h * as they are integrated with the configure script. */ #ifdef CSRG_BASED #define USE_TERMIOS #endif #ifdef __CYGWIN__ #define ATT #define SVR4 #define SYSV #define USE_SYSV_TERMIO #endif #ifdef __UNIXOS2__ #define USE_SYSV_TERMIO #endif -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__INTERIX) #ifndef USE_POSIX_TERMIOS #define USE_POSIX_TERMIOS #endif #endif #ifdef linux #define USE_TERMIOS #endif #ifdef __SCO__ #define USE_TERMIOS #define _SVID3 #endif #ifdef Lynx #define USE_SYSV_TERMIO #endif #ifdef macII #undef SYSV /* pretend to be bsd (sgtty.h) */ Index: xc/programs/xterm/xtermcfg.hin =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/xtermcfg.hin,v retrieving revision 1.3 diff -u -2 -0 -r1.3 xtermcfg.hin --- xc/programs/xterm/xtermcfg.hin 13 Aug 2004 12:57:21 -0000 1.3 +++ xc/programs/xterm/xtermcfg.hin 6 Jan 2005 00:31:06 -0000 @@ -1,24 +1,24 @@ -/* $XTermId: xtermcfg.hin,v 1.126 2004/05/26 01:19:55 tom Exp $ */ +/* $XTermId: xtermcfg.hin,v 1.128 2004/12/01 01:27:47 tom Exp $ */ /* - * $XFree86: xc/programs/xterm/xtermcfg.hin,v 3.51 2004/05/26 01:19:55 dickey Exp $ + * $XFree86: xc/programs/xterm/xtermcfg.hin,v 3.52 2004/12/01 01:27:47 dickey Exp $ */ /************************************************************ Copyright 1997-2003,2004 by Thomas E. Dickey All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE @@ -77,40 +77,41 @@ #undef OPT_AIX_COLORS /* CF_ARG_DISABLE(16-color) */ #undef OPT_BLINK_CURS /* CF_ARG_DISABLE(blink-cursor) */ #undef OPT_BLINK_TEXT /* CF_ARG_DISABLE(blink-text) */ #undef OPT_BOX_CHARS /* CF_ARG_DISABLE(boxchars) */ #undef OPT_BROKEN_OSC /* CF_ARG_ENABLE(broken-osc) */ #undef OPT_BROKEN_ST /* CF_ARG_DISABLE(broken-st) */ #undef OPT_C1_PRINT /* CF_ARG_DISABLE(c1-print) */ #undef OPT_COLOR_CLASS /* CF_ARG_DISABLE(color-class) */ #undef OPT_DABBREV /* CF_ARG_ENABLE(dabbrev) */ #undef OPT_DEC_CHRSET /* CF_ARG_DISABLE(doublechars) */ #undef OPT_DEC_LOCATOR /* CF_ARG_ENABLE(dec-locator) */ #undef OPT_HIGHLIGHT_COLOR /* CF_ARG_DISABLE(highlighting) */ #undef OPT_HP_FUNC_KEYS /* CF_ARG_ENABLE(hp-fkeys) */ #undef OPT_I18N_SUPPORT /* CF_ARG_DISABLE(i18n) */ #undef OPT_INITIAL_ERASE /* CF_ARG_DISABLE(initial-erase) */ #undef OPT_INPUT_METHOD /* CF_ARG_DISABLE(input-method) */ #undef OPT_ISO_COLORS /* CF_ARG_DISABLE(ansi-color) */ #undef OPT_LOAD_VTFONTS /* CF_ARG_ENABLE(load-vt-fonts) */ #undef OPT_LUIT_PROG /* CF_ARG_ENABLE(luit) */ #undef OPT_MAXIMIZE /* CF_ARG_DISABLE(maximize) */ +#undef OPT_MINI_LUIT /* CF_ARG_ENABLE(mini-luit) */ #undef OPT_NUM_LOCK /* CF_ARG_DISABLE(num-lock) */ #undef OPT_PC_COLORS /* CF_ARG_DISABLE(pc-color) */ #undef OPT_PTY_HANDSHAKE /* CF_ARG_ENABLE(pty-handshake) */ #undef OPT_SAME_NAME #undef OPT_SCO_FUNC_KEYS /* CF_ARG_ENABLE(sco-fkeys) */ #undef OPT_SESSION_MGT /* CF_ARG_DISABLE(session-mgt) */ #undef OPT_TCAP_QUERY #undef OPT_TEK4014 /* CF_ARG_DISABLE(tek4014) */ #undef OPT_TOOLBAR /* CF_ARG_ENABLE(toolbar) */ #undef OPT_TRACE /* CF_ARG_ENABLE(trace) */ #undef OPT_VT52_MODE /* CF_ARG_DISABLE(vt52) */ #undef OPT_WIDE_CHARS /* CF_ARG_OPTION(wide-chars) */ #undef OPT_XMC_GLITCH /* CF_ARG_ENABLE(xmc-glitch) */ #undef OPT_ZICONBEEP /* CF_ARG_DISABLE(ziconbeep) */ #undef OWN_TERMINFO_DIR /* AC_ARG_WITH(own-terminfo) */ #undef SCROLLBAR_RIGHT /* CF_ARG_ENABLE(rightbar) */ #undef SVR4 /* CF_SVR4, imake */ #undef SYSV /* CF_SYSV, imake */ #undef TIME_WITH_SYS_TIME /* AC_HEADER_TIME */ #undef TTY_GROUP_NAME /* CF_TTY_GROUP */ Index: xc/programs/xterm/unicode/README =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/unicode/README,v retrieving revision 1.3 diff -u -2 -0 -r1.3 README --- xc/programs/xterm/unicode/README 13 Aug 2004 12:57:26 -0000 1.3 +++ xc/programs/xterm/unicode/README 6 Jan 2005 00:31:06 -0000 @@ -1,23 +1,24 @@ --- $XFree86: xc/programs/xterm/unicode/README,v 1.4 2000/11/01 01:12:47 dawes Exp $ +-- $XTermId: README,v 1.10 2004/12/01 01:27:49 tom Exp $ +-- $XFree86: xc/programs/xterm/unicode/README,v 1.5 2004/12/01 01:27:49 dickey Exp $ -- Thomas E. Dickey These are some scripts and datafiles used for generating tables used in the experimental UTF-8 implementation in xterm. To run the convmap.pl script, you will need a copy of UnicodeData-Latest.txt which is currently available as - ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData-Latest.txt + ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt -It is a large file (~460kb), so it is not included in this distribution. +It is a large file (~877kb), so it is not included in this distribution. convmap.pl is used to generate ../keysym2ucs.c, e.g., ./convmap.pl >../keysym2ucs.c keysym.map is input data for convmap.pl The make-precompose.sh script makes the precompose.c file, which is used to handle canonical composition. This also needs UnicodeData-Latest.txt. It uses precompose.c.head and precompose.c.tail as templates. Index: xc/programs/xterm/unicode/make-precompose.sh =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/unicode/make-precompose.sh,v retrieving revision 1.1.1.2 diff -u -2 -0 -r1.1.1.2 make-precompose.sh --- xc/programs/xterm/unicode/make-precompose.sh 25 Nov 2003 19:29:23 -0000 1.1.1.2 +++ xc/programs/xterm/unicode/make-precompose.sh 6 Jan 2005 00:31:06 -0000 @@ -1,6 +1,7 @@ #!/bin/sh -cat precompose.c.head -cut UnicodeData-Latest.txt -d ";" -f 1,6 | \ +# $XTermId: make-precompose.sh,v 1.4 2004/11/30 21:16:54 tom Exp $ +cat precompose.c.head | sed -e's/@/$/g' +cut UnicodeData.txt -d ";" -f 1,6 | \ grep ";[0-9,A-F]" | grep " " | \ sed -e "s/ /, 0x/;s/^/{ 0x/;s/;/, 0x/;s/$/},/" | (sort -k 3 || sort +2) cat precompose.c.tail Index: xc/programs/xterm/unicode/precompose.c.head =================================================================== RCS file: /cvs/xorg/xc/programs/xterm/unicode/precompose.c.head,v retrieving revision 1.1.1.1 diff -u -2 -0 -r1.1.1.1 precompose.c.head --- xc/programs/xterm/unicode/precompose.c.head 14 Nov 2003 16:49:24 -0000 1.1.1.1 +++ xc/programs/xterm/unicode/precompose.c.head 6 Jan 2005 00:31:06 -0000 @@ -1,14 +1,16 @@ /* * Canonical Compositions * * DO NOT EDIT BY HAND! This is generated by the script * unicode/make-precompose.sh */ +/* @XTermId@ */ +/* @XFree86@ */ #include -struct { +static struct { int replacement; int base; int comb; } precompositions[] = {