xterm - 1996/1/6 - patch #1 - T.Dickey
This is my first cleanup patch for xterm. It addresses all of the gcc warnings
for -Wall, -Wmissing-prototypes and -Wstrict-prototypes that I can change
without modifying the object code. (I'm compiling this with gcc 2.7.0 for an
aout target, which makes it simple to compare objects. When I do ELF-only,
I've got a tool that compares that sort of thing as well).
Briefly, this patch adds (and uses) two header files in the xterm directory:
proto.h
xterm.h
I expect this to be the biggest patch by far. However (barring a misplaced
prototype), it shouldn't break anything, since the intent of the patch is to
provide missing declarations.
--------------------------------------------------------------------------------
Tekproc.c | 62 +++++++++++--------
button.c | 71 ++++++++++++---------
charproc.c | 148 +++++++++++++++++++++++++--------------------
cursor.c | 14 ++++
input.c | 9 ++
main.c | 68 +++++++++++++-------
menu.c | 183 ++++++++++++++++++++++++++++++++++++--------------------
menu.h | 72 ++++++++++++----------
misc.c | 57 ++++++++++++-----
proto.h | 29 ++++++++
ptyx.h | 5 -
resize.c | 34 ++++++----
screen.c | 26 +++++--
scrollbar.c | 30 +++++++--
tabs.c | 7 ++
util.c | 44 ++++++++-----
xterm.h | 189 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
17 files changed, 748 insertions, 300 deletions
--------------------------------------------------------------------------------
Index: Tekproc.c
--- xterm-original/Tekproc.c Sat Sep 23 03:09:22 1995
+++ xterm-patched/Tekproc.c Sat Jan 6 18:10:07 1996
@@ -114,6 +114,8 @@
extern long time(); /* included in <time.h> by Xos.h */
#endif
+#include "xterm.h"
+
#define TekColormap DefaultColormap( screen->display, \
DefaultScreen(screen->display) )
#define DefaultGCID XGContextFromGC(DefaultGC(screen->display, DefaultScreen(screen->display)))
@@ -190,19 +192,6 @@
static int *curstate = Talptable;
static int *Tparsestate = Talptable;
-static void TekEnq();
-
-/* event handlers */
-extern void HandleKeyPressed(), HandleEightBitKeyPressed();
-extern void HandleStringEvent();
-extern void HandleEnterWindow();
-extern void HandleLeaveWindow();
-extern void HandleFocusChange();
-extern void HandleBellPropertyChange();
-extern void HandleSecure();
-extern void HandleGINInput();
-extern void HandleCreateMenu(), HandlePopupMenu();
-
static char defaultTranslations[] = "\
~Meta<KeyPress>: insert-seven-bit() \n\
Meta<KeyPress>: insert-eight-bit()\n\
@@ -299,12 +288,24 @@
XtRString, GIN_TERM_NONE_STR},
};
-static void TekInitialize(), TekRealize(), TekConfigure();
-static int getpoint();
-static int Tinput();
-
-void TekExpose();
-void TekSetFontSize();
+extern void TCursorBack PROTO((void));
+extern void TCursorDown PROTO((void));
+extern void TCursorForward PROTO((void));
+extern void TCursorUp PROTO((void));
+extern void TekBackground PROTO((TScreen *screen));
+extern void TekDraw PROTO((int x, int y));
+extern void TekExpose PROTO((Widget w, XEvent *event, Region region));
+extern void TekFlush PROTO((void));
+extern void TekPage PROTO((void));
+static TekWidget CreateTekWidget PROTO((void));
+static int Tinput PROTO((void));
+static int getpoint PROTO((void));
+static void AddToDraw PROTO((int x1, int y1, int x2, int y2));
+static void TekConfigure PROTO((Widget w));
+static void TekEnq PROTO((int status, int x, int y));
+static void TekInitialize PROTO((Widget request, Widget new, ArgList args, Cardinal *num_args));
+static void TekRealize PROTO((Widget gw, XtValueMask *valuemaskp, XSetWindowAttributes *values));
+static void Tekparse PROTO((void));
static WidgetClassRec tekClassRec = {
{
@@ -424,9 +425,9 @@
/* Do Tek GIN mode */
screen->TekGIN = &TekRecord->ptr[-1];
/* Set cross-hair cursor raster array */
- if (GINcursor =
+ if ((GINcursor =
make_colored_cursor (XC_tcross, screen->mousecolor,
- screen->mousecolorback))
+ screen->mousecolorback)) != 0)
XDefineCursor (screen->display, TShellWindow,
GINcursor);
Tparsestate = Tbyptable; /* Bypass mode */
@@ -695,7 +696,7 @@
if(TekRefresh) {
if(rcnt-- > 0)
return(*rptr++);
- if(tek = TekRefresh->next) {
+ if ((tek = TekRefresh->next) != 0) {
TekRefresh = tek;
rptr = tek->data;
rcnt = tek->count - 1;
@@ -881,6 +882,7 @@
dorefresh();
}
+void
dorefresh()
{
register TScreen *screen = &term->screen;
@@ -897,6 +899,7 @@
(screen->TekGIN && GINcursor) ? GINcursor : screen->arrow);
}
+void
TekPage()
{
register TScreen *screen = &term->screen;
@@ -980,6 +983,7 @@
}
}
+void
TCursorBack()
{
register TScreen *screen = &term->screen;
@@ -1002,6 +1006,7 @@
}
}
+void
TCursorForward()
{
register TScreen *screen = &term->screen;
@@ -1021,6 +1026,7 @@
}
}
+void
TCursorUp()
{
register TScreen *screen = &term->screen;
@@ -1040,6 +1046,7 @@
screen->cur_Y = l * t->vsize;
}
+void
TCursorDown()
{
register TScreen *screen = &term->screen;
@@ -1079,6 +1086,7 @@
nplot++;
}
+void
TekDraw (x, y)
int x, y;
{
@@ -1098,6 +1106,7 @@
T_lasty = screen->cur_Y = y;
}
+void
TekFlush ()
{
register TScreen *screen = &term->screen;
@@ -1110,6 +1119,7 @@
line_pt = Tline;
}
+void
TekGINoff()
{
register TScreen *screen = &term->screen;
@@ -1123,6 +1133,7 @@
}
}
+void
TekEnqMouse(c)
int c; /* character pressed */
{
@@ -1176,6 +1187,7 @@
v_write(pty, cplot+1, len-1);
}
+void
TekRun()
{
register TScreen *screen = &term->screen;
@@ -1578,6 +1590,7 @@
return;
}
+void
TekReverseVideo(screen)
register TScreen *screen;
{
@@ -1619,6 +1632,7 @@
TekBackground(screen);
}
+void
TekBackground(screen)
register TScreen *screen;
{
@@ -1630,6 +1644,7 @@
/*
* Toggles cursor on or off at cursor position in screen.
*/
+void
TCursorToggle(toggle)
int toggle; /* TOGGLE or CLEAR */
{
@@ -1695,15 +1710,16 @@
/* write copy of screen to a file */
+void
TekCopy()
{
register TScreen *screen = &term->screen;
register struct tm *tp;
Time_t l;
char buf[32];
- int waited;
int pid;
#ifndef HAS_WAITPID
+ int waited;
int (*chldfunc)();
chldfunc = signal(SIGCHLD, SIG_DFL);
Index: button.c
--- xterm-original/button.c Sun Sep 17 02:33:13 1995
+++ xterm-patched/button.c Sat Jan 6 19:50:22 1996
@@ -31,7 +31,15 @@
*/
#include "ptyx.h" /* Xlib headers included here. */
+
#include <X11/Xatom.h>
+
+#ifndef X_NOT_STDC_ENV
+#include <stdlib.h>
+#else
+extern char *malloc();
+#endif
+
#include <stdio.h>
#ifdef MINIX
@@ -45,9 +53,7 @@
#include "error.h"
#include "menu.h"
-extern char *malloc();
-
-extern void DoSecureKeyboard();
+#include "xterm.h"
#define KeyState(x) (((x) & (ShiftMask|ControlMask)) + (((x) & Mod1Mask) ? 2 : 0))
/* adds together the bits:
@@ -65,17 +71,6 @@
extern char *xterm_name;
-static void PointToRowCol();
-static void SelectionReceived();
-static void TrackDown();
-static void ComputeSelect();
-static void EditorButton();
-static void ExtendExtend();
-static void ReHiliteText();
-static void SelectSet();
-static void StartSelect();
-static int Length();
-static char *SaveText();
extern XtermWidget term;
@@ -112,6 +107,29 @@
/* Send emacs escape code when done selecting or extending? */
static int replyToEmacs;
+static Boolean ConvertSelection PROTO_XT_CVT_SELECT_ARGS;
+static char *SaveText PROTO((TScreen *screen, int row, int scol, int ecol, char *lp, int *eol));
+static int LastTextCol PROTO((int row));
+static int Length PROTO((TScreen *screen, int row, int scol, int ecol));
+static void ComputeSelect PROTO((int startRow, int startCol, int endRow, int endCol, Bool extend));
+static void EditorButton PROTO((XButtonEvent *event));
+static void EndExtend PROTO((Widget w, XEvent *event, String *params, Cardinal num_params, Bool use_cursor_loc));
+static void ExtendExtend PROTO((int row, int col));
+static void LoseSelection PROTO((Widget w, Atom *selection));
+static void PointToRowCol PROTO((int y, int x, int *r, int *c));
+static void ReHiliteText PROTO((int frow, int fcol, int trow, int tcol));
+static void SaltTextAway PROTO((int crow, int ccol, int row, int col, String *params, Cardinal num_params));
+static void SelectSet PROTO((Widget w, XEvent *event, String *params, Cardinal num_params));
+static void SelectionDone PROTO((Widget w, Atom *selection, Atom *target));
+static void SelectionReceived PROTO_XT_SEL_CB_ARGS;
+static void SetSelectUnit PROTO((Time buttonDownTime, SelectUnit defaultUnit));
+static void StartSelect PROTO((int startrow, int startcol));
+static void TrackDown PROTO((XButtonEvent *event));
+static void _GetSelection PROTO((Widget w, Time time, String *params, Cardinal num_params));
+static void _OwnSelection PROTO((XtermWidget termw, String *selections, Cardinal count));
+static void do_select_end PROTO((Widget w, XEvent *event, String *params, Cardinal *num_params, Bool use_cursor_loc));
+static void do_select_start PROTO((Widget w, XEvent *event, int startrow, int startcol));
+static void do_start_extend PROTO((Widget w, XEvent *event, String *params, Cardinal *num_params, Bool use_cursor_loc));
Boolean SendMousePosition(w, event)
Widget w;
@@ -137,7 +155,7 @@
if (KeyModifiers == 0) {
if (event->type == ButtonPress)
- EditorButton(event);
+ EditorButton((XButtonEvent *)event);
return True;
}
return False;
@@ -145,7 +163,7 @@
case 2: /* DEC vt200 compatible */
if (KeyModifiers == 0 || KeyModifiers == ControlMask) {
- EditorButton(event);
+ EditorButton((XButtonEvent *)event);
return True;
}
return False;
@@ -154,11 +172,11 @@
if ( event->type == ButtonPress &&
KeyModifiers == 0 &&
event->xbutton.button == Button1 ) {
- TrackDown(event);
+ TrackDown((XButtonEvent *)event);
return True;
}
if (KeyModifiers == 0 || KeyModifiers == ControlMask) {
- EditorButton(event);
+ EditorButton((XButtonEvent *)event);
return True;
}
/* fall through */
@@ -203,7 +221,7 @@
register TScreen *screen = &term->screen;
int pty = screen->respond;
char Line[ 6 ];
- register int line, col;
+ register int line;
if (event->type != ButtonPress && event->type != ButtonRelease)
return;
@@ -250,8 +268,6 @@
}
}
-static void EndExtend();
-
static void do_select_end (w, event, params, num_params, use_cursor_loc)
Widget w;
XEvent *event; /* must be XButtonEvent */
@@ -479,7 +495,7 @@
StartSelect(startrow, startcol);
} else {
waitingForTrackInfo = 1;
- EditorButton(event);
+ EditorButton((XButtonEvent *)event);
}
}
@@ -598,8 +614,6 @@
SelectSet (w, event, params, *num_params);
}
-static void SaltTextAway();
-
/* ARGSUSED */
static void
SelectSet (w, event, params, num_params)
@@ -722,7 +736,7 @@
do_start_extend (w, event, params, num_params, True);
}
-
+void
ScrollSelection(screen, amount)
register TScreen* screen;
register int amount;
@@ -758,6 +772,7 @@
/*ARGSUSED*/
+void
ResizeSelection (screen, rows, cols)
TScreen *screen;
int rows, cols;
@@ -1005,7 +1020,7 @@
return;
}
-
+void
TrackText(frow, fcol, trow, tcol)
register int frow, fcol, trow, tcol;
/* Guaranteed (frow, fcol) <= (trow, tcol) */
@@ -1087,8 +1102,6 @@
}
}
-static void _OwnSelection();
-
static void
SaltTextAway(crow, ccol, row, col, params, num_params)
/*register*/ int crow, ccol, row, col;
@@ -1340,7 +1353,7 @@
TrackText(0, 0, 0, 0);
}
-/* void */
+void
DisownSelection(termw)
register XtermWidget termw;
{
Index: charproc.c
--- xterm-original/charproc.c Sun Nov 12 04:55:49 1995
+++ xterm-patched/charproc.c Sat Jan 6 19:52:54 1996
@@ -60,6 +60,7 @@
#include "error.h"
#include "menu.h"
#include "main.h"
+
#include <X11/Xos.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
@@ -71,6 +72,15 @@
#ifdef I18N
#include <X11/Xaw/XawImP.h>
#endif
+
+#ifndef X_NOT_STDC_ENV
+#include <stdlib.h>
+#else
+extern char *malloc();
+extern char *realloc();
+extern void exit();
+#endif
+
#include <stdio.h>
#include <errno.h>
#include <setjmp.h>
@@ -99,23 +109,38 @@
#endif
#endif
+#include "xterm.h"
+
extern jmp_buf VTend;
extern XtAppContext app_con;
extern Widget toplevel;
-extern void exit();
-extern char *malloc();
-extern char *realloc();
-
-static void VTallocbuf();
-static int finput();
-static void dotext();
-static void WriteText();
-static void ToAlternate();
-static void FromAlternate();
-static void update_font_info();
-static void bitset(), bitclr();
+extern int LoadNewFont PROTO((TScreen *screen, char *nfontname, char *bfontname, Bool doresize, int fontnum));
+extern int in_put PROTO((void));
+extern int set_character_class PROTO((char *s));
+extern void ansi_modes PROTO((XtermWidget termw, void (*func)(unsigned *p, int mask)));
+extern void dpmodes PROTO((XtermWidget termw, void (*func)(unsigned *p, int mask)));
+extern void restoremodes PROTO((XtermWidget termw));
+extern void savemodes PROTO((XtermWidget termw));
+extern void set_vt_box PROTO((TScreen *screen));
+extern void unparsefputs PROTO((char *s, int fd));
+extern void unparseputn PROTO((unsigned int n, int fd));
+
+static int finput PROTO((void));
+static void DoSetSelectedFont PROTO_XT_SEL_CB_ARGS;
+static void FromAlternate PROTO((TScreen *screen));
+static void SwitchBufs PROTO((TScreen *screen));
+static void ToAlternate PROTO((TScreen *screen));
+static void VTGraphicsOrNoExpose PROTO((XEvent *event));
+static void VTNonMaskableEvent PROTO_XT_EV_HANDLER_ARGS;
+static void VTallocbuf PROTO((void));
+static void VTparse PROTO((void));
+static void WriteText PROTO(( TScreen *screen, char *str, int len, unsigned flags, unsigned fg, unsigned bg));
+static void bitclr PROTO((unsigned *p, int mask));
+static void bitset PROTO((unsigned *p, int mask));
+static void dotext PROTO((TScreen *screen, unsigned flags, int charset, char *buf, char *ptr, unsigned fg, unsigned bg));
+static void update_font_info PROTO((TScreen *screen, Bool doresize));
#define DEFAULT -1
#define TEXT_BUF_SIZE 256
@@ -258,33 +283,12 @@
extern int scrtable[];
extern int scstable[];
-
/* event handlers */
-extern void HandleKeyPressed(), HandleEightBitKeyPressed();
-extern void HandleStringEvent();
-extern void HandleEnterWindow();
-extern void HandleLeaveWindow();
-extern void HandleBellPropertyChange();
-extern void HandleFocusChange();
-static void HandleKeymapChange();
-extern void HandleInsertSelection();
-extern void HandleSelectStart(), HandleKeyboardSelectStart();
-extern void HandleSelectExtend(), HandleSelectSet();
-extern void HandleSelectEnd(), HandleKeyboardSelectEnd();
-extern void HandleStartExtend(), HandleKeyboardStartExtend();
-static void HandleBell();
-static void HandleVisualBell();
-static void HandleIgnore();
-extern void HandleSecure();
-extern void HandleScrollForward();
-extern void HandleScrollBack();
-extern void HandleCreateMenu(), HandlePopupMenu();
-extern void HandleSetFont();
-extern void SetVTFont();
-extern void ViButton(), DiredButton();
-
-extern Boolean SendMousePosition();
-extern void ScrnSetAttributes();
+extern void HandleSetFont PROTO((Widget w, XEvent *event, String *params, Cardinal *param_count));
+static void HandleBell PROTO((Widget w, XEvent *event, String *params, Cardinal *param_count));
+static void HandleIgnore PROTO((Widget w, XEvent *event, String *params, Cardinal *param_count));
+static void HandleKeymapChange PROTO((Widget w, XEvent *event, String *params, Cardinal *param_count));
+static void HandleVisualBell PROTO((Widget w, XEvent *event, String *params, Cardinal *param_count));
/*
* NOTE: VTInitialize zeros out the entire ".screen" component of the
@@ -647,15 +651,15 @@
XtRBoolean, (XtPointer) &defaultTRUE},
};
-static void VTClassInit();
-static void VTInitialize();
-static void VTRealize();
-static void VTExpose();
-static void VTResize();
-static void VTDestroy();
-static Boolean VTSetValues();
+static void VTClassInit PROTO((void));
+static void VTInitialize PROTO((Widget wrequest, Widget wnew, ArgList args, Cardinal *num_args));
+static void VTRealize PROTO((Widget w, XtValueMask *valuemask, XSetWindowAttributes *values));
+static void VTExpose PROTO((Widget w, XEvent *event, Region region));
+static void VTResize PROTO((Widget w));
+static void VTDestroy PROTO((Widget w));
+static Boolean VTSetValues PROTO((Widget cur, Widget request, Widget new, ArgList args, Cardinal *num_args));
#ifdef I18N
-static void VTInitI18N();
+static void VTInitI18N PROTO((void));
#endif
static WidgetClassRec xtermClassRec = {
@@ -705,7 +709,6 @@
register unsigned int c;
register unsigned char *cp;
register int row, col, top, bot, scstype;
- extern int TrackMouse();
if(setjmp(vtjmpbuf))
parsestate = groundtable;
@@ -723,7 +726,8 @@
}
if(screen->curss) {
dotext(screen, term->flags,
- screen->gsets[screen->curss], bptr, bptr + 1,
+ screen->gsets[(int)(screen->curss)],
+ bptr, bptr + 1,
term->cur_foreground,
term->cur_background );
screen->curss = 0;
@@ -731,7 +735,8 @@
}
if(bptr < cp)
dotext(screen, term->flags,
- screen->gsets[screen->curgl], bptr, cp,
+ screen->gsets[(int)(screen->curgl)],
+ bptr, cp,
term->cur_foreground,
term->cur_background );
bptr = cp;
@@ -1338,7 +1343,7 @@
}
}
-static finput()
+static int finput()
{
return(doinput());
}
@@ -1353,6 +1358,7 @@
/* 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(f, d, len)
int f;
char *d;
@@ -1458,12 +1464,13 @@
#ifndef AMOEBA
riten = write(f, v_bufstr, v_bufptr - v_bufstr <= MAX_PTY_WRITE ?
v_bufptr - v_bufstr : MAX_PTY_WRITE);
- if (riten < 0) {
+ if (riten < 0)
#else
riten = v_bufptr - v_bufstr <= MAX_PTY_WRITE ?
v_bufptr - v_bufstr : MAX_PTY_WRITE;
- if (cb_puts(term->screen.tty_inq, v_bufstr, riten) != 0) {
+ if (cb_puts(term->screen.tty_inq, v_bufstr, riten) != 0)
#endif /* AMOEBA */
+ {
#ifdef DEBUG
if (debug) perror("write");
#endif
@@ -1511,6 +1518,7 @@
static int write_mask;
static int pty_read_bytes;
+int
in_put()
{
register TScreen *screen = &term->screen;
@@ -1519,10 +1527,11 @@
for( ; ; ) {
#ifndef AMOEBA
- if (select_mask & pty_mask && eventMode == NORMAL) {
+ if (select_mask & pty_mask && eventMode == NORMAL)
#else
- if ((bcnt = cb_full(screen->tty_outq)) > 0 && eventMode == NORMAL) {
+ if ((bcnt = cb_full(screen->tty_outq)) > 0 && eventMode == NORMAL)
#endif
+ {
#ifdef ALLOWLOGGING
if (screen->logging)
FlushLog(screen);
@@ -1799,9 +1808,10 @@
/*
* process ANSI modes set, reset
*/
+void
ansi_modes(termw, func)
XtermWidget termw;
- void (*func)();
+ void (*func) PROTO((unsigned *p, int mask));
{
register int i;
@@ -1822,9 +1832,10 @@
/*
* process DEC private modes set, reset
*/
+void
dpmodes(termw, func)
XtermWidget termw;
- void (*func)();
+ void (*func) PROTO((unsigned *p, int mask));
{
register TScreen *screen = &termw->screen;
register int i, j;
@@ -1985,6 +1996,7 @@
/*
* process xterm private modes save
*/
+void
savemodes(termw)
XtermWidget termw;
{
@@ -2051,6 +2063,7 @@
/*
* process xterm private modes restore
*/
+void
restoremodes(termw)
XtermWidget termw;
{
@@ -2199,6 +2212,7 @@
*p &= ~mask;
}
+void
unparseseq(ap, fd)
register ANSI *ap;
int fd;
@@ -2232,6 +2246,7 @@
}
}
+void
unparseputn(n, fd)
unsigned int n;
int fd;
@@ -2244,6 +2259,7 @@
unparseputc((char) ('0' + (n%10)), fd);
}
+void
unparseputc(c, fd)
char c;
int fd;
@@ -2262,6 +2278,7 @@
v_write(fd, buf, i);
}
+void
unparsefputs (s, fd)
register char *s;
int fd;
@@ -2271,14 +2288,10 @@
}
}
-static void SwitchBufs();
-
static void
ToAlternate(screen)
register TScreen *screen;
{
- extern ScrnBuf Allocate();
-
if(screen->alternate)
return;
if(!screen->altbuf)
@@ -2331,7 +2344,7 @@
}
/* swap buffer line pointers between alt and regular screens */
-
+void
SwitchBufPtrs(screen)
register TScreen *screen;
{
@@ -2344,6 +2357,7 @@
memmove( (char *)screen->altbuf, (char *)save, 4 * sizeof(char *) * rows);
}
+void
VTRun()
{
register TScreen *screen = &term->screen;
@@ -2467,7 +2481,6 @@
{
register TScreen *screen = &term->screen;
int nrows = screen->max_row + 1;
- extern ScrnBuf Allocate();
/* allocate screen buffer now, if necessary. */
if (screen->scrollWidget)
@@ -2789,8 +2802,7 @@
static void VTInitI18N()
{
- int i,
- ic_cnt = 0;
+ int i;
char *p,
*s,
*ns,
@@ -2849,7 +2861,7 @@
for(s = tmp; s && !found;) {
while (*s && isspace(*s)) s++;
if (!*s) break;
- if (ns = end = index(s, ','))
+ if ((ns = end = index(s, ',')) != 0)
ns++;
else
end = s + strlen(s);
@@ -2969,6 +2981,7 @@
/*
* Shows cursor at new cursor position in screen.
*/
+void
ShowCursor()
{
register TScreen *screen = &term->screen;
@@ -3087,6 +3100,7 @@
/*
* hide cursor at previous cursor position in screen.
*/
+void
HideCursor()
{
register TScreen *screen = &term->screen;
@@ -3158,6 +3172,7 @@
screen->cursor_state = OFF;
}
+void
VTReset(full)
Boolean full;
{
@@ -3676,6 +3691,7 @@
set_vt_box (screen);
}
+void
set_vt_box (screen)
TScreen *screen;
{
@@ -3689,7 +3705,7 @@
screen->box = VTbox;
}
-
+void
set_cursor_gcs (screen)
TScreen *screen;
{
Index: cursor.c
--- xterm-original/cursor.c Wed Apr 27 03:12:34 1994
+++ xterm-patched/cursor.c Sat Jan 6 18:01:03 1996
@@ -29,6 +29,10 @@
#include "ptyx.h" /* also gets Xlib.h */
+#include "xterm.h"
+
+static void _CheckSelection PROTO((TScreen *screen));
+
static void _CheckSelection(screen)
register TScreen *screen;
{
@@ -48,6 +52,7 @@
* (this includes scrolling regions)
* The origin is considered to be 0, 0 for this procedure.
*/
+void
CursorSet(screen, row, col, flags)
register TScreen *screen;
register int row, col;
@@ -71,6 +76,7 @@
/*
* moves the cursor left n, no wrap around
*/
+void
CursorBack(screen, n)
register TScreen *screen;
int n;
@@ -100,6 +106,7 @@
/*
* moves the cursor forward n, no wraparound
*/
+void
CursorForward(screen, n)
register TScreen *screen;
int n;
@@ -115,6 +122,7 @@
* moves the cursor down n, no scrolling.
* Won't pass bottom margin or bottom of screen.
*/
+void
CursorDown(screen, n)
register TScreen *screen;
int n;
@@ -135,6 +143,7 @@
* moves the cursor up n, no linestarving.
* Won't pass top margin or top of screen.
*/
+void
CursorUp(screen, n)
register TScreen *screen;
int n;
@@ -155,6 +164,7 @@
* Moves cursor down amount lines, scrolls if necessary.
* Won't leave scrolling region. No carriage return.
*/
+void
Index(screen, amount)
register TScreen *screen;
register int amount;
@@ -179,6 +189,7 @@
* Moves cursor up amount lines, reverse scrolls if necessary.
* Won't leave scrolling region. No carriage return.
*/
+void
RevIndex(screen, amount)
register TScreen *screen;
register int amount;
@@ -200,6 +211,7 @@
/*
* Moves Cursor To First Column In Line
*/
+void
CarriageReturn(screen)
register TScreen *screen;
{
@@ -211,6 +223,7 @@
/*
* Save Cursor and Attributes
*/
+void
CursorSave(term, sc)
register XtermWidget term;
register SavedCursor *sc;
@@ -228,6 +241,7 @@
/*
* Restore Cursor and Attributes
*/
+void
CursorRestore(term, sc)
register XtermWidget term;
register SavedCursor *sc;
Index: input.c
--- xterm-original/input.c Sat Jan 21 08:19:18 1995
+++ xterm-patched/input.c Sat Jan 6 18:24:21 1996
@@ -34,12 +34,17 @@
#include <X11/Xutil.h>
#include <stdio.h>
+#include "xterm.h"
+
static XComposeStatus compose_status = {NULL, 0};
static char *kypd_num = " XXXXXXXX\tXXX\rXXXxxxxXXXXXXXXXXXXXXXXXXXXX*+,-./0123456789XXX=";
static char *kypd_apl = " ABCDEFGHIJKLMNOPQRSTUVWXYZ??????abcdefghijklmnopqrstuvwxyzXXX";
static char *cur = "DACB";
-static int funcvalue(), sunfuncvalue();
+static int funcvalue PROTO((int keycode));
+static int sunfuncvalue PROTO((int keycode));
+static void AdjustAfterInput PROTO((TScreen *screen));
+
extern Boolean sunFunctionKeys;
static void
@@ -64,6 +69,7 @@
}
}
+void
Input (keyboard, screen, event, eightbit)
register TKeyboard *keyboard;
register TScreen *screen;
@@ -175,6 +181,7 @@
return;
}
+void
StringInput (screen, string, nbytes)
register TScreen *screen;
register char *string;
Index: main.c
--- xterm-original/main.c Sat Dec 16 03:24:07 1995
+++ xterm-patched/main.c Sat Jan 6 19:50:50 1996
@@ -72,6 +72,7 @@
#include "data.h"
#include "error.h"
#include "menu.h"
+
#include <X11/StringDefs.h>
#include <X11/Shell.h>
#ifdef I18N
@@ -463,12 +464,33 @@
extern char *ptsname();
#endif
-extern char *strindex ();
-extern void HandlePopupMenu();
+#include "xterm.h"
int switchfb[] = {0, 2, 1, 3};
-static SIGNAL_T reapchild ();
+extern char *base_name PROTO((char *name));
+extern int TekInit PROTO((void));
+extern int VTInit PROTO((void));
+extern int pty_search PROTO((int *pty));
+extern int remove_termcap_entry PROTO((char *buf, char *str));
+extern int spawn PROTO((void));
+extern int tgetent PROTO((char *ptr, char *name));
+extern void Cleanup PROTO((int code));
+extern void DeleteWindow PROTO_XT_ACTIONS_ARGS;
+extern void HsSysError PROTO((int pf, int error));
+extern void KeyboardMapping PROTO_XT_ACTIONS_ARGS;
+extern void Setenv PROTO((char *var, char *value));
+extern void SysError PROTO((int i));
+extern void TekRun PROTO((void));
+extern void VTRun PROTO((void));
+extern void get_terminal PROTO((void));
+extern void hide_tek_window PROTO((void));
+extern void hide_vt_window PROTO((void));
+extern void resize PROTO((TScreen *s, char *n, char *oldtc, char *newtc));
+static void Help PROTO((void));
+static void Syntax PROTO((char *badOption));
+
+static SIGNAL_T reapchild PROTO((int n));
static Bool added_utmp_entry = False;
@@ -548,7 +570,6 @@
#define CSTART ('Q'&037)
#endif
-static int parse_tty_modes ();
/*
* 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.
@@ -595,6 +616,8 @@
{ NULL, 0, 0, '\0' }, /* end of data */
};
+static int parse_tty_modes PROTO((char *s, struct _xttymodes *modelist));
+
#ifdef USE_SYSV_UTMP
#if defined(X_NOT_STDC_ENV) || (defined(AIXV3) && OSMAJORVERSION < 4)
extern struct utmp *getutent();
@@ -616,7 +639,6 @@
extern void endpwent();
#endif
-extern struct passwd *fgetpwent();
#else /* not USE_SYSV_UTMP */
static char etc_utmp[] = UTMP_FILENAME;
#endif /* USE_SYSV_UTMP */
@@ -644,6 +666,11 @@
static int inhibit;
static char passedPty[2]; /* name if pty if slave */
+#ifndef AMOEBA
+extern int get_pty PROTO((int *pty));
+extern SIGNAL_T hungtty PROTO((int i));
+#endif
+
#if defined(TIOCCONS) || defined(SRIOCSREDIR)
static int Console;
#include <X11/Xmu/SysUtil.h> /* XmuGetHostname */
@@ -651,6 +678,7 @@
#define MIT_CONSOLE "MIT_CONSOLE_"
static char mit_console_name[255 + MIT_CONSOLE_LEN + 1] = MIT_CONSOLE;
static Atom mit_console;
+static Boolean ConvertConsoleSelection PROTO_XT_CVT_SELECT_ARGS;
#endif /* TIOCCONS */
#ifndef USE_SYSV_UTMP
@@ -1014,12 +1042,13 @@
}
XtActionsRec actionProcs[] = {
- "DeleteWindow", DeleteWindow,
- "KeyboardMapping", KeyboardMapping,
+ { "DeleteWindow", DeleteWindow },
+ { "KeyboardMapping", KeyboardMapping },
};
Atom wm_delete_window;
+int
main (argc, argv)
int argc;
char **argv;
@@ -1027,7 +1056,6 @@
register TScreen *screen;
register int pty;
int Xsocket, mode;
- char *base_name();
int xerror(), xioerror();
#ifdef I18N
@@ -1627,6 +1655,7 @@
* has problems, we can re-enter this function and get another one.
*/
+int
get_pty (pty)
int *pty;
{
@@ -1792,6 +1821,7 @@
}
#endif /* AMOEBA */
+void
get_terminal ()
/*
* sets up X and initializes the terminal structure except for term.buf.fildes.
@@ -1939,6 +1969,7 @@
#ifndef AMOEBA
+int
spawn ()
/*
* Inits pty and tty and forks a login process.
@@ -1946,7 +1977,6 @@
* If slave, the pty named in passedPty is already open for use
*/
{
- extern char *SysErrorMsg();
register TScreen *screen = &term->screen;
int Xsocket = ConnectionNumber(screen->display);
#ifdef USE_HANDSHAKE
@@ -1966,10 +1996,8 @@
#ifdef TIOCSLTC
struct ltchars ltc;
#endif /* TIOCSLTC */
- int one = 1;
- int zero = 0;
- int status;
#else /* else not USE_SYSV_TERMIO */
+ int ldisc = 0;
unsigned lmode;
struct tchars tc;
struct ltchars ltc;
@@ -1984,15 +2012,10 @@
char newtc [1024];
char *ptr, *shname, *shname_minus;
int i, no_dev_tty = FALSE;
-#ifdef USE_SYSV_TERMIO
- char *dev_tty_name = (char *) 0;
- int fd; /* for /etc/wtmp */
-#endif /* USE_SYSV_TERMIO */
char **envnew; /* new environment */
int envsize; /* elements in new environment */
char buf[64];
char *TermName = NULL;
- int ldisc = 0;
#if defined(sun) && !defined(SVR4)
#ifdef TIOCSSIZE
struct ttysize ts;
@@ -2413,7 +2436,7 @@
/* use the same tty name that everyone else will use
** (from ttyname)
*/
- if (ptr = ttyname(tty))
+ if ((ptr = ttyname(tty)) != 0)
{
/* it may be bigger */
ttydev = realloc (ttydev, (unsigned) (strlen(ptr) + 1));
@@ -3085,7 +3108,7 @@
*(ptr = pw->pw_shell) == 0))
#endif /* UTMP */
ptr = "/bin/sh";
- if(shname = strrchr(ptr, '/'))
+ if ((shname = strrchr(ptr, '/')) != 0)
shname++;
else
shname = ptr;
@@ -3566,8 +3589,6 @@
signal(SIGPIPE, Exit);
}
-extern char *SysErrorMsg();
-
/*
* X watch-dog thread. This thread unblocks the main
* thread when there's an X event.
@@ -3722,6 +3743,7 @@
}
/* ARGSUSED */
+void
resize(screen, TermName, oldtc, newtc)
TScreen *screen;
char *TermName;
@@ -3818,10 +3840,10 @@
}
/* VARARGS1 */
+void
consolepr(fmt,x0,x1,x2,x3,x4,x5,x6,x7,x8,x9)
char *fmt;
{
- extern char *SysErrorMsg();
int oerrno;
int f;
char buf[ BUFSIZ ];
@@ -3847,7 +3869,7 @@
#endif /* TIOCNOTTY */
}
-
+int
remove_termcap_entry (buf, str)
char *buf;
char *str;
Index: menu.c
--- xterm-original/menu.c Sun May 8 01:27:06 1994
+++ xterm-patched/menu.c Sat Jan 6 20:14:35 1996
@@ -43,28 +43,57 @@
#include <X11/Xos.h>
#endif
-extern void FindFontSelection();
+#include "xterm.h"
Arg menuArgs[2] = {{ XtNleftBitmap, (XtArgVal) 0 },
{ XtNsensitive, (XtArgVal) 0 }};
-void do_hangup();
-
-static void do_securekbd(), do_allowsends(), do_visualbell(),
#ifdef ALLOWLOGGING
- do_logging(),
+static void do_logging PROTO_XT_CALLBACK_ARGS;
#endif
- do_redraw(), do_suspend(), do_continue(), do_interrupt(),
- do_terminate(), do_kill(), do_quit(), do_scrollbar(), do_jumpscroll(),
- do_reversevideo(), do_autowrap(), do_reversewrap(), do_autolinefeed(),
- do_appcursor(), do_appkeypad(), do_scrollkey(), do_scrollttyoutput(),
- do_allow132(), do_cursesemul(), do_marginbell(), do_tekshow(),
- do_altscreen(), do_softreset(), do_hardreset(), do_clearsavedlines(),
- do_tekmode(), do_vthide(),
- do_tektextlarge(), do_tektext2(), do_tektext3(), do_tektextsmall(),
- do_tekpage(), do_tekreset(), do_tekcopy(), do_vtshow(), do_vtmode(),
- do_tekhide(), do_vtfont();
+extern void do_hangup PROTO_XT_CALLBACK_ARGS;
+static void do_allow132 PROTO_XT_CALLBACK_ARGS;
+static void do_allowsends PROTO_XT_CALLBACK_ARGS;
+static void do_altscreen PROTO_XT_CALLBACK_ARGS;
+static void do_appcursor PROTO_XT_CALLBACK_ARGS;
+static void do_appkeypad PROTO_XT_CALLBACK_ARGS;
+static void do_autolinefeed PROTO_XT_CALLBACK_ARGS;
+static void do_autowrap PROTO_XT_CALLBACK_ARGS;
+static void do_clearsavedlines PROTO_XT_CALLBACK_ARGS;
+static void do_continue PROTO_XT_CALLBACK_ARGS;
+static void do_cursesemul PROTO_XT_CALLBACK_ARGS;
+static void do_hardreset PROTO_XT_CALLBACK_ARGS;
+static void do_interrupt PROTO_XT_CALLBACK_ARGS;
+static void do_jumpscroll PROTO_XT_CALLBACK_ARGS;
+static void do_kill PROTO_XT_CALLBACK_ARGS;
+static void do_marginbell PROTO_XT_CALLBACK_ARGS;
+static void do_quit PROTO_XT_CALLBACK_ARGS;
+static void do_redraw PROTO_XT_CALLBACK_ARGS;
+static void do_reversevideo PROTO_XT_CALLBACK_ARGS;
+static void do_reversewrap PROTO_XT_CALLBACK_ARGS;
+static void do_scrollbar PROTO_XT_CALLBACK_ARGS;
+static void do_scrollkey PROTO_XT_CALLBACK_ARGS;
+static void do_scrollttyoutput PROTO_XT_CALLBACK_ARGS;
+static void do_securekbd PROTO_XT_CALLBACK_ARGS;
+static void do_softreset PROTO_XT_CALLBACK_ARGS;
+static void do_suspend PROTO_XT_CALLBACK_ARGS;
+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_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_terminate PROTO_XT_CALLBACK_ARGS;
+static void do_visualbell PROTO_XT_CALLBACK_ARGS;
+static void do_vtfont PROTO_XT_CALLBACK_ARGS;
+static void do_vthide PROTO_XT_CALLBACK_ARGS;
+static void do_vtmode PROTO_XT_CALLBACK_ARGS;
+static void do_vtshow PROTO_XT_CALLBACK_ARGS;
/*
* The order entries MUST match the values given in menu.h
@@ -137,7 +166,33 @@
{ "vtmode", do_vtmode, NULL }, /* 10 */
{ "tekhide", do_tekhide, NULL }}; /* 11 */
-static Widget create_menu();
+static Bool domenu
+ PROTO((Widget w,
+ XEvent *event,
+ String *params,
+ Cardinal *param_count));
+
+static Widget create_menu
+ PROTO((XtermWidget xtw,
+ Widget toplevelw,
+ char *name,
+ struct _MenuEntry *entries,
+ int nentries));
+
+static void do_tekonoff PROTO_XT_CALLBACK_ARGS;
+static void do_vtonoff PROTO_XT_CALLBACK_ARGS;
+static void handle_send_signal PROTO(( Widget gw, int sig));
+static void handle_tekshow PROTO(( Widget gw, Bool allowswitch));
+static void handle_vtshow PROTO((Widget gw, Bool allowswitch));
+
+static void handle_toggle
+ PROTO((void (*proc)PROTO_XT_CALLBACK_ARGS,
+ int var,
+ String *params,
+ Cardinal nparams,
+ Widget w,
+ XtPointer closure, XtPointer data));
+
extern Widget toplevel;
@@ -340,7 +395,7 @@
static void do_securekbd (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
register TScreen *screen = &term->screen;
Time time = CurrentTime; /* XXX - wrong */
@@ -365,7 +420,7 @@
static void do_allowsends (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
register TScreen *screen = &term->screen;
@@ -375,7 +430,7 @@
static void do_visualbell (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
register TScreen *screen = &term->screen;
@@ -386,7 +441,7 @@
#ifdef ALLOWLOGGING
static void do_logging (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
register TScreen *screen = &term->screen;
@@ -401,7 +456,7 @@
static void do_redraw (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
Redraw ();
}
@@ -416,7 +471,7 @@
/* ARGSUSED */
static void do_suspend (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
#if defined(SIGTSTP) && !defined(AMOEBA)
handle_send_signal (gw, SIGTSTP);
@@ -426,7 +481,7 @@
/* ARGSUSED */
static void do_continue (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
#if defined(SIGCONT) && !defined(AMOEBA)
handle_send_signal (gw, SIGCONT);
@@ -436,7 +491,7 @@
/* ARGSUSED */
static void do_interrupt (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
handle_send_signal (gw, SIGINT);
}
@@ -444,7 +499,7 @@
/* ARGSUSED */
void do_hangup (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
handle_send_signal (gw, SIGHUP);
}
@@ -452,7 +507,7 @@
/* ARGSUSED */
static void do_terminate (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
handle_send_signal (gw, SIGTERM);
}
@@ -460,14 +515,14 @@
/* ARGSUSED */
static void do_kill (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
handle_send_signal (gw, SIGKILL);
}
static void do_quit (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
Cleanup (0);
}
@@ -480,7 +535,7 @@
static void do_scrollbar (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
register TScreen *screen = &term->screen;
@@ -495,7 +550,7 @@
static void do_jumpscroll (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
register TScreen *screen = &term->screen;
@@ -512,7 +567,7 @@
static void do_reversevideo (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
term->flags ^= REVERSE_VIDEO;
ReverseVideo (term);
@@ -522,7 +577,7 @@
static void do_autowrap (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
term->flags ^= WRAPAROUND;
update_autowrap();
@@ -531,7 +586,7 @@
static void do_reversewrap (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
term->flags ^= REVERSEWRAP;
update_reversewrap();
@@ -540,7 +595,7 @@
static void do_autolinefeed (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
term->flags ^= LINEFEED;
update_autolinefeed();
@@ -549,7 +604,7 @@
static void do_appcursor (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
term->keyboard.flags ^= CURSOR_APL;
update_appcursor();
@@ -558,7 +613,7 @@
static void do_appkeypad (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
term->keyboard.flags ^= KYPD_APL;
update_appkeypad();
@@ -567,7 +622,7 @@
static void do_scrollkey (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
register TScreen *screen = &term->screen;
@@ -578,7 +633,7 @@
static void do_scrollttyoutput (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
register TScreen *screen = &term->screen;
@@ -589,7 +644,7 @@
static void do_allow132 (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
register TScreen *screen = &term->screen;
@@ -600,7 +655,7 @@
static void do_cursesemul (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
register TScreen *screen = &term->screen;
@@ -611,7 +666,7 @@
static void do_marginbell (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
register TScreen *screen = &term->screen;
@@ -638,7 +693,7 @@
/* ARGSUSED */
static void do_tekshow (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
handle_tekshow (gw, True);
}
@@ -646,7 +701,7 @@
/* ARGSUSED */
static void do_tekonoff (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
handle_tekshow (gw, False);
}
@@ -654,7 +709,7 @@
/* ARGSUSED */
static void do_altscreen (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
/* do nothing for now; eventually, will want to flip screen */
}
@@ -662,7 +717,7 @@
static void do_softreset (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
VTReset (FALSE);
}
@@ -670,7 +725,7 @@
static void do_hardreset (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
VTReset (TRUE);
}
@@ -678,7 +733,7 @@
static void do_clearsavedlines (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
register TScreen *screen = &term->screen;
@@ -690,7 +745,7 @@
static void do_tekmode (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
register TScreen *screen = &term->screen;
@@ -700,7 +755,7 @@
/* ARGSUSED */
static void do_vthide (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
hide_vt_window();
}
@@ -712,7 +767,7 @@
static void do_vtfont (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
char *entryname = (char *) closure;
int i;
@@ -733,7 +788,7 @@
static void do_tektextlarge (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
TekSetFontSize (tekMenu_tektextlarge);
}
@@ -741,7 +796,7 @@
static void do_tektext2 (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
TekSetFontSize (tekMenu_tektext2);
}
@@ -749,7 +804,7 @@
static void do_tektext3 (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
TekSetFontSize (tekMenu_tektext3);
}
@@ -757,7 +812,7 @@
static void do_tektextsmall (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
TekSetFontSize (tekMenu_tektextsmall);
@@ -766,7 +821,7 @@
static void do_tekpage (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
TekSimulatePageButton (False);
}
@@ -774,7 +829,7 @@
static void do_tekreset (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
TekSimulatePageButton (True);
}
@@ -782,7 +837,7 @@
static void do_tekcopy (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
TekCopy ();
}
@@ -806,21 +861,21 @@
static void do_vtshow (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
handle_vtshow (gw, True);
}
static void do_vtonoff (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
handle_vtshow (gw, False);
}
static void do_vtmode (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
register TScreen *screen = &term->screen;
@@ -831,7 +886,7 @@
/* ARGSUSED */
static void do_tekhide (gw, closure, data)
Widget gw;
- caddr_t closure, data;
+ XtPointer closure, data;
{
hide_tek_window();
}
@@ -843,12 +898,12 @@
*/
static void handle_toggle (proc, var, params, nparams, w, closure, data)
- void (*proc)();
+ void (*proc)PROTO_XT_CALLBACK_ARGS;
int var;
String *params;
Cardinal nparams;
Widget w;
- caddr_t closure, data;
+ XtPointer closure, data;
{
int dir = -2;
@@ -1204,7 +1259,7 @@
String *params;
Cardinal *param_count;
{
- void (*proc)() = NULL;
+ void (*proc)PROTO_XT_CALLBACK_ARGS = 0;
switch (*param_count) {
case 0:
Index: menu.h
--- xterm-original/menu.h Wed Apr 27 03:12:26 1994
+++ xterm-patched/menu.h Sat Jan 6 20:08:57 1996
@@ -29,9 +29,14 @@
*/
+#ifndef included_menu_h
+#define included_menu_h
+
+#include "proto.h"
+
typedef struct _MenuEntry {
char *name;
- void (*function)();
+ void (*function) PROTO_XT_CALLBACK_ARGS;
Widget widget;
} MenuEntry;
@@ -39,38 +44,42 @@
extern MenuEntry fontMenuEntries[];
extern Arg menuArgs[];
-extern void HandleAllowSends();
-extern void HandleSetVisualBell();
+extern void HandleAllow132 PROTO_XT_ACTIONS_ARGS;
+extern void HandleAllowSends PROTO_XT_ACTIONS_ARGS;
+extern void HandleAltScreen PROTO_XT_ACTIONS_ARGS;
+extern void HandleAppCursor PROTO_XT_ACTIONS_ARGS;
+extern void HandleAppKeypad PROTO_XT_ACTIONS_ARGS;
+extern void HandleAutoLineFeed PROTO_XT_ACTIONS_ARGS;
+extern void HandleAutoWrap PROTO_XT_ACTIONS_ARGS;
+extern void HandleClearSavedLines PROTO_XT_ACTIONS_ARGS;
+extern void HandleCreateMenu PROTO_XT_ACTIONS_ARGS;
+extern void HandleCursesEmul PROTO_XT_ACTIONS_ARGS;
+extern void HandleHardReset PROTO_XT_ACTIONS_ARGS;
+extern void HandleJumpscroll PROTO_XT_ACTIONS_ARGS;
+extern void HandleMarginBell PROTO_XT_ACTIONS_ARGS;
+extern void HandlePopupMenu PROTO_XT_ACTIONS_ARGS;
+extern void HandleQuit PROTO_XT_ACTIONS_ARGS;
+extern void HandleRedraw PROTO_XT_ACTIONS_ARGS;
+extern void HandleReverseVideo PROTO_XT_ACTIONS_ARGS;
+extern void HandleReverseWrap 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 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 HandleTekCopy PROTO_XT_ACTIONS_ARGS;
+extern void HandleTekPage PROTO_XT_ACTIONS_ARGS;
+extern void HandleTekReset PROTO_XT_ACTIONS_ARGS;
+extern void HandleVisibility PROTO_XT_ACTIONS_ARGS;
+
#ifdef ALLOWLOGGING
-extern void HandleLogging();
+extern void HandleLogging PROTO_XT_ACTIONS_ARGS;
#endif
-extern void HandleRedraw();
-extern void HandleSendSignal();
-extern void HandleQuit();
-extern void HandleScrollbar();
-extern void HandleJumpscroll();
-extern void HandleReverseVideo();
-extern void HandleAutoWrap();
-extern void HandleReverseWrap();
-extern void HandleAutoLineFeed();
-extern void HandleAppCursor();
-extern void HandleAppKeypad();
-extern void HandleScrollKey();
-extern void HandleScrollTtyOutput();
-extern void HandleAllow132();
-extern void HandleCursesEmul();
-extern void HandleMarginBell();
-extern void HandleAltScreen();
-extern void HandleSoftReset();
-extern void HandleHardReset();
-extern void HandleClearSavedLines();
-extern void HandleSetTerminalType();
-extern void HandleVisibility();
-extern void HandleSetTekText();
-extern void HandleTekPage();
-extern void HandleTekReset();
-extern void HandleTekCopy();
-extern void DoSecureKeyboard();
+
+extern void DoSecureKeyboard PROTO((Time time));
/*
* The following definitions MUST match the order of entries given in
@@ -319,3 +328,4 @@
update_menu_item (term->screen.fontMenu, \
fontMenuEntries[term->screen.menu_font_number].widget, \
(val))
+#endif/*included_menu_h*/
Index: misc.c
--- xterm-original/misc.c Sun Sep 17 02:33:18 1995
+++ xterm-patched/misc.c Sat Jan 6 18:06:21 1996
@@ -48,6 +48,8 @@
#include "error.h"
#include "menu.h"
+#include "xterm.h"
+
#ifdef AMOEBA
#include "amoeba.h"
#include "module/proc.h"
@@ -63,14 +65,21 @@
extern char *getenv();
#endif
-static void DoSpecialEnterNotify();
-static void DoSpecialLeaveNotify();
-
+extern Boolean AllocateColor PROTO((XtermWidget pTerm, ScrnColors *pNew, int ndx, char *name));
+extern Boolean ChangeColorsRequest PROTO((XtermWidget pTerm, int start, char *names));
+extern Boolean GetOldColors PROTO(( XtermWidget pTerm));
+extern Boolean UpdateOldColors PROTO((XtermWidget pTerm, ScrnColors *pNew));
+extern void selectwindow PROTO((TScreen *screen, int flag));
+extern void unselectwindow PROTO((TScreen *screen, int flag));
+static void ChangeGroup PROTO((String attribute, XtArgVal value));
+static void DoSpecialEnterNotify PROTO((XEnterWindowEvent *ev));
+static void DoSpecialLeaveNotify PROTO((XEnterWindowEvent *ev));
+static void withdraw_window PROTO((Display *dpy, Window w, int scr));
+void
xevents()
{
XEvent event;
- XtInputMask input_mask;
register TScreen *screen = &term->screen;
if(screen->scroll_amt)
@@ -206,10 +215,11 @@
}
/*ARGSUSED*/
-void HandleEnterWindow(w, eventdata, event)
+void HandleEnterWindow(w, eventdata, event, cont)
Widget w;
-register XEnterWindowEvent *event;
-caddr_t eventdata;
+XtPointer eventdata;
+XEvent *event;
+Boolean *cont;
{
/* NOP since we handled it above */
}
@@ -232,10 +242,11 @@
/*ARGSUSED*/
-void HandleLeaveWindow(w, eventdata, event)
+void HandleLeaveWindow(w, eventdata, event, cont)
Widget w;
-register XEnterWindowEvent *event;
-caddr_t eventdata;
+XtPointer eventdata;
+XEvent *event;
+Boolean *cont;
{
/* NOP since we handled it above */
}
@@ -267,7 +278,7 @@
}
-
+void
selectwindow(screen, flag)
register TScreen *screen;
register int flag;
@@ -295,6 +306,7 @@
}
}
+void
unselectwindow(screen, flag)
register TScreen *screen;
register int flag;
@@ -322,6 +334,7 @@
static long lastBellTime; /* in milliseconds */
+void
Bell()
{
extern XtermWidget term;
@@ -366,7 +379,7 @@
}
}
-
+void
VisualBell()
{
extern XtermWidget term;
@@ -427,6 +440,7 @@
}
}
+void
Redraw()
{
extern XtermWidget term;
@@ -668,9 +682,9 @@
#endif /* ALLOWLOGFILEEXEC */
#endif /* ALLOWLOGGING */
-
+void
do_osc(func)
-int (*func)();
+int (*func) PROTO((void));
{
register int mode, c;
register char *cp;
@@ -709,7 +723,6 @@
case 13: case 14: case 15:
case 16:
{
- extern Boolean ChangeColorsRequest();
if (term->misc.dynamicColors)
ChangeColorsRequest(term,mode-10,buf);
}
@@ -746,7 +759,8 @@
}
}
-static ChangeGroup(attribute, value)
+static void
+ChangeGroup(attribute, value)
String attribute;
XtArgVal value;
{
@@ -757,12 +771,14 @@
XtSetValues( toplevel, args, 1 );
}
+void
Changename(name)
register char *name;
{
ChangeGroup( XtNiconName, (XtArgVal)name );
}
+void
Changetitle(name)
register char *name;
{
@@ -951,6 +967,7 @@
#ifndef DEBUG
/* ARGSUSED */
#endif
+void
Panic(s, a)
char *s;
int a;
@@ -978,7 +995,7 @@
#endif /* __STDC__ */
}
-
+void
SysError (i)
int i;
{
@@ -991,6 +1008,7 @@
Cleanup(i);
}
+void
Error (i)
int i;
{
@@ -1002,6 +1020,7 @@
/*
* cleanup by sending SIGHUP to client processes
*/
+void
Cleanup (code)
int code;
{
@@ -1028,6 +1047,7 @@
* was allocated using calloc, with enough extra room at the end so not
* to have to do a realloc().
*/
+void
Setenv (var, value)
register char *var, *value;
{
@@ -1075,6 +1095,7 @@
}
/*ARGSUSED*/
+int
xerror(d, ev)
Display *d;
register XErrorEvent *ev;
@@ -1085,6 +1106,7 @@
}
/*ARGSUSED*/
+int
xioerror(dpy)
Display *dpy;
{
@@ -1105,6 +1127,7 @@
exit(1);
}
+int
XStrCmp(s1, s2)
char *s1, *s2;
{
Index: proto.h
--- /dev/null Sun Jul 17 19:46:18 1994
+++ xterm-patched/proto.h Sat Jan 6 20:06:29 1996
@@ -0,0 +1,29 @@
+#ifndef included_proto_h
+#define included_proto_h
+
+#include <X11/Xfuncproto.h>
+
+#if NeedFunctionPrototypes
+#define PROTO(p) p
+#else
+#define PROTO(p) ()
+#endif
+
+#define NOPROTO(p) (/*nothing*/)
+
+#define PROTO_XT_ACTIONS_ARGS \
+ PROTO((Widget w, XEvent *event, String *params, Cardinal *num_params))
+
+#define PROTO_XT_CALLBACK_ARGS \
+ PROTO((Widget gw, XtPointer closure, XtPointer data))
+
+#define PROTO_XT_CVT_SELECT_ARGS \
+ PROTO((Widget w, Atom *selection, Atom *target, Atom *type, XtPointer *value, unsigned long *length, int *format))
+
+#define PROTO_XT_EV_HANDLER_ARGS \
+ PROTO((Widget w, XtPointer closure, XEvent *event, Boolean *cont))
+
+#define PROTO_XT_SEL_CB_ARGS \
+ PROTO((Widget w, XtPointer client_data, Atom *selection, Atom *type, XtPointer value, unsigned long *length, int *format))
+
+#endif/*included_proto_h*/
Index: ptyx.h
--- xterm-original/ptyx.h Sun Sep 17 02:33:19 1995
+++ xterm-patched/ptyx.h Sat Jan 6 17:01:24 1996
@@ -629,8 +629,3 @@
#endif
#define I_SIGNAL 0x02
#define I_TEK 0x04
-
-extern Cursor make_colored_cursor();
-extern int GetBytesAvailable();
-extern void first_map_occurred();
-extern int kill_process_group();
Index: resize.c
--- xterm-original/resize.c Sat Mar 11 09:21:37 1995
+++ xterm-patched/resize.c Sat Jan 6 18:37:40 1996
@@ -146,15 +146,15 @@
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) */
+ { "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) */
};
char *emuname[EMULATIONS] = {
@@ -205,13 +205,21 @@
#endif /* TIOCSWINSZ */
#endif /* sun */
-char *strindex ();
+#include "proto.h"
-SIGNAL_T onintr();
+extern int main PROTO((int argc, char **argv));
+
+extern SIGNAL_T onintr PROTO((int sig));
+extern SIGNAL_T timeout PROTO((int sig));
+extern char *strindex PROTO((char *s1, char *s2));
+extern int checkdigits PROTO((char *str));
+extern void Usage PROTO((void));
+extern void readstring PROTO((FILE *fp, char *buf, char *str));
/*
resets termcap string to reflect current screen size
*/
+int
main (argc, argv)
int argc;
char **argv;
@@ -495,6 +503,7 @@
return (NULL);
}
+int
checkdigits(str)
register char *str;
{
@@ -506,13 +515,13 @@
return(1);
}
+void
readstring(fp, buf, str)
register FILE *fp;
register char *buf;
char *str;
{
register int last, c;
- SIGNAL_T timeout();
#if !defined(USG) && !defined(AMOEBA) && !defined(MINIX) && !defined(SCO) && !(__EMX__)
/* What is the advantage of setitimer() over alarm()? */
struct itimerval it;
@@ -547,6 +556,7 @@
*buf = 0;
}
+void
Usage()
{
fprintf(stderr, strcmp(myname, sunname) == 0 ?
Index: screen.c
--- xterm-original/screen.c Sat Dec 16 03:24:08 1995
+++ xterm-patched/screen.c Sat Jan 6 17:51:36 1996
@@ -32,6 +32,15 @@
#include "error.h"
#include "data.h"
+#include "xterm.h"
+
+#ifndef X_NOT_STDC_ENV
+#include <stdlib.h>
+#else
+extern Char *calloc(), *malloc(), *realloc();
+extern void free();
+#endif
+
#include <stdio.h>
#include <signal.h>
#ifdef SVR4
@@ -56,8 +65,7 @@
#define TIOCSPGRP TCSETPGRP
#endif
-extern Char *calloc(), *malloc(), *realloc();
-extern void free();
+static int Reallocate PROTO((ScrnBuf *sbuf, Char **sbufaddr, int nrow, int ncol, int oldrow, int oldcol));
ScrnBuf Allocate (nrow, ncol, addr)
/*
@@ -94,7 +102,7 @@
* Returns the number of lines the text was moved down (neg for up).
* (Return value only necessary with SouthWestGravity.)
*/
-static
+static int
Reallocate(sbuf, sbufaddr, nrow, ncol, oldrow, oldcol)
ScrnBuf *sbuf;
Char **sbufaddr;
@@ -170,6 +178,7 @@
return move_down ? move_down/4 : -move_up/4; /* convert to rows */
}
+void
ScreenWrite (screen, str, flags, cur_fg, cur_bg, length)
/*
Writes str into buf at row row and column col. Characters are set to match
@@ -210,6 +219,7 @@
*attrs0 |= LINEWRAPPED;
}
+void
ScrnInsertLine (sb, last, where, n, size)
/*
Inserts n blank lines at sb + where, treating last as a bottom margin.
@@ -249,7 +259,7 @@
memmove( (char *) &sb[4 * where], (char *)save, 4 * sizeof(char *) * n);
}
-
+void
ScrnDeleteLine (sb, last, where, n, size)
/*
Deletes n lines at sb + where, treating last as a bottom margin.
@@ -280,7 +290,7 @@
4 * sizeof(char *) * n);
}
-
+void
ScrnInsertChar (sb, row, col, n, size)
/*
Inserts n blanks in sb at row, col. Size is the size of each row.
@@ -309,7 +319,7 @@
attrs[0] |= LINEWRAPPED;
}
-
+void
ScrnDeleteChar (sb, row, col, n, size)
/*
Deletes n characters in sb at row, col. Size is the size of each row.
@@ -331,7 +341,7 @@
attrs[0] |= LINEWRAPPED;
}
-
+void
ScrnRefresh (screen, toprow, leftcol, nrows, ncols, force)
/*
Repaints the area enclosed by the parameters.
@@ -523,6 +533,7 @@
}
}
+void
ClearBufRows (screen, first, last)
/*
Sets the rows first though last of the buffer of screen to spaces.
@@ -553,6 +564,7 @@
7. Clears origin mode and sets scrolling region to be entire screen.
8. Returns 0
*/
+int
ScreenResize (screen, width, height, flags)
register TScreen *screen;
int width, height;
Index: scrollbar.c
--- xterm-original/scrollbar.c Sat Sep 23 03:09:28 1995
+++ xterm-patched/scrollbar.c Sat Jan 6 20:05:37 1996
@@ -28,6 +28,13 @@
#include "ptyx.h" /* gets Xt headers, too */
+#ifndef X_NOT_STDC_ENV
+#include <stdlib.h>
+#else
+extern Char *realloc();
+extern Char *calloc();
+#endif
+
#include <stdio.h>
#include <ctype.h>
#include <X11/Xatom.h>
@@ -41,10 +48,18 @@
#include "error.h"
#include "menu.h"
+#include "xterm.h"
+
+static Widget CreateScrollBar PROTO((XtermWidget xw, int x, int y, int height));
+static int params_to_pixels PROTO((TScreen *screen, String *params, int n));
+static int specialcmplowerwiths PROTO((char *a, char *b));
+static void RealizeScrollBar PROTO((Widget sbw, TScreen *screen));
+static void ResizeScreen PROTO((XtermWidget xw, int min_width, int min_height));
+
/* Event handlers */
-static void ScrollTextTo();
-static void ScrollTextUpDownBy();
+static void ScrollTextTo PROTO_XT_CALLBACK_ARGS;
+static void ScrollTextUpDownBy PROTO_XT_CALLBACK_ARGS;
/* resize the text window for a terminal screen, modifying the
@@ -201,7 +216,7 @@
XtRealizeWidget (sbw);
}
-
+void
ScrollBarReverseVideo(scrollWidget)
register Widget scrollWidget;
{
@@ -227,7 +242,7 @@
}
-
+void
ScrollBarDrawThumb(scrollWidget)
register Widget scrollWidget;
{
@@ -241,9 +256,9 @@
XawScrollbarSetThumb(scrollWidget,
((float)thumbTop) / totalHeight,
((float)thumbHeight) / totalHeight);
-
}
+void
ResizeScrollBar(scrollWidget, x, y, height)
register Widget scrollWidget;
int x, y;
@@ -254,6 +269,7 @@
ScrollBarDrawThumb(scrollWidget);
}
+void
WindowScroll(screen, top)
register TScreen *screen;
int top;
@@ -302,7 +318,7 @@
ScrollBarDrawThumb(screen->scrollWidget);
}
-
+void
ScrollBarOn (xw, init, doalloc)
XtermWidget xw;
int init, doalloc;
@@ -310,7 +326,6 @@
register TScreen *screen = &xw->screen;
register int border = 2 * screen->border;
register int i;
- Char *realloc(), *calloc();
if(screen->scrollbar)
return;
@@ -369,6 +384,7 @@
}
}
+void
ScrollBarOff(screen)
register TScreen *screen;
{
Index: tabs.c
--- xterm-original/tabs.c Wed Apr 27 03:12:32 1994
+++ xterm-patched/tabs.c Sat Jan 6 12:25:15 1996
@@ -29,6 +29,8 @@
#include "ptyx.h"
+#include "xterm.h"
+
/*
* This file presumes 32bits/word. This is somewhat of a crock, and should
* be fixed sometime.
@@ -37,6 +39,7 @@
/*
* places tabstops at only every 8 columns
*/
+void
TabReset(tabs)
Tabs tabs;
{
@@ -53,6 +56,7 @@
/*
* places a tabstop at col
*/
+void
TabSet(tabs, col)
Tabs tabs;
int col;
@@ -63,6 +67,7 @@
/*
* clears a tabstop at col
*/
+void
TabClear(tabs, col)
Tabs tabs;
int col;
@@ -75,6 +80,7 @@
* (or MAX_TABS - 1 if there are no more).
* A tabstop at col is ignored.
*/
+int
TabNext (tabs, col)
Tabs tabs;
int col;
@@ -96,6 +102,7 @@
/*
* clears all tabs
*/
+void
TabZonk (tabs)
Tabs tabs;
{
Index: util.c
--- xterm-original/util.c Sat Sep 23 03:09:30 1995
+++ xterm-patched/util.c Sat Jan 6 18:02:32 1996
@@ -35,12 +35,18 @@
#include <stdio.h>
-static void horizontal_copy_area();
-static void vertical_copy_area();
+#include "xterm.h"
+
+extern int handle_translated_exposure PROTO((TScreen *screen, int rect_x, int rect_y, unsigned int rect_width, unsigned int rect_height));
+extern void CopyWait PROTO((TScreen *screen));
+static void copy_area PROTO((TScreen *screen, int src_x, int src_y, unsigned int width, unsigned int height, int dest_x, int dest_y));
+static void horizontal_copy_area PROTO((TScreen *screen, int firstchar, int nchars, int amount));
+static void vertical_copy_area PROTO((TScreen *screen, int firstline, int nlines, int amount));
/*
* These routines are used for the jump scroll feature
*/
+void
FlushScroll(screen)
register TScreen *screen;
{
@@ -122,6 +128,7 @@
}
}
+int
AddToRefresh(screen)
register TScreen *screen;
{
@@ -156,6 +163,7 @@
* All done within the scrolling region, of course.
* requires: amount > 0
*/
+void
Scroll(screen, amount)
register TScreen *screen;
register int amount;
@@ -259,6 +267,7 @@
* All done within the scrolling region, of course.
* Requires: amount > 0
*/
+void
RevScroll(screen, amount)
register TScreen *screen;
register int amount;
@@ -327,6 +336,7 @@
* inserts n blank lines at the cursor's position. Lines above the
* bottom margin are lost.
*/
+void
InsertLine (screen, n)
register TScreen *screen;
register int n;
@@ -388,6 +398,7 @@
* 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(screen, n)
register TScreen *screen;
register int n;
@@ -468,6 +479,7 @@
/*
* Insert n blanks at the cursor's position, no wraparound
*/
+void
InsertChar (screen, n)
register TScreen *screen;
register int n;
@@ -511,6 +523,7 @@
/*
* Deletes n chars at the cursor's position, no wraparound.
*/
+void
DeleteChar (screen, n)
register TScreen *screen;
register int n;
@@ -550,6 +563,7 @@
/*
* Clear from cursor position to beginning of display, inclusive.
*/
+void
ClearAbove (screen)
register TScreen *screen;
{
@@ -577,6 +591,7 @@
/*
* Clear from cursor position to end of display, inclusive.
*/
+void
ClearBelow (screen)
register TScreen *screen;
{
@@ -599,6 +614,7 @@
/*
* Clear last part of cursor's line, inclusive.
*/
+void
ClearRight (screen)
register TScreen *screen;
{
@@ -632,6 +648,7 @@
/*
* Clear first part of cursor's line, inclusive.
*/
+void
ClearLeft (screen)
register TScreen *screen;
{
@@ -670,6 +687,7 @@
/*
* Erase the cursor's line.
*/
+void
ClearLine(screen)
register TScreen *screen;
{
@@ -693,6 +711,7 @@
bzero (screen->buf [4 * screen->cur_row + 3], (screen->max_col + 1));
}
+void
ClearScreen(screen)
register TScreen *screen;
{
@@ -716,6 +735,7 @@
ClearBufRows (screen, 0, screen->max_row);
}
+void
CopyWait(screen)
register TScreen *screen;
{
@@ -825,6 +845,7 @@
/*
* use when scrolling the entire screen
*/
+void
scrolling_copy_area(screen, firstline, nlines, amount)
TScreen *screen;
int firstline; /* line on screen to start copying at */
@@ -841,6 +862,7 @@
* Handler for Expose events on the VT widget.
* Returns 1 iff the area where the cursor was got refreshed.
*/
+int
HandleExposure (screen, event)
register TScreen *screen;
register XEvent *event;
@@ -886,6 +908,7 @@
* have been translated to allow for any CopyArea in progress.
* The rectangle passed in is pixel coordinates.
*/
+int
handle_translated_exposure (screen, rect_x, rect_y, rect_width, rect_height)
register TScreen *screen;
register int rect_x, rect_y;
@@ -939,10 +962,6 @@
ScrnColors *pColors;
{
register TScreen *screen = &term->screen;
- GC tmpGC;
- Window tek = TWindow(screen);
- unsigned long tmp;
-
pColors->which= 0;
SET_COLOR_VALUE(pColors,TEXT_FG, screen->foreground);
@@ -951,23 +970,19 @@
SET_COLOR_VALUE(pColors,MOUSE_FG, screen->mousecolor);
SET_COLOR_VALUE(pColors,MOUSE_BG, screen->mousecolorback);
-
SET_COLOR_VALUE(pColors,TEK_FG, screen->Tforeground);
SET_COLOR_VALUE(pColors,TEK_BG, screen->Tbackground);
}
-
+void
ChangeColors(term,pNew)
XtermWidget term;
ScrnColors *pNew;
{
register TScreen *screen = &term->screen;
- GC tmpGC;
Window tek = TWindow(screen);
- unsigned long tmp;
Bool newCursor= TRUE;
-
if (COLOR_DEFINED(pNew,TEXT_BG)) {
term->core.background_pixel= COLOR_VALUE(pNew,TEXT_BG);
}
@@ -1032,7 +1047,7 @@
/***====================================================================***/
-
+void
ReverseVideo (termw)
XtermWidget termw;
{
@@ -1085,11 +1100,11 @@
XClearWindow(screen->display, tek);
TekExpose((Widget)NULL, (XEvent *)NULL, (Region)NULL);
}
-ReverseOldColors();
+ ReverseOldColors();
update_reversevideo();
}
-
+void
recolor_cursor (cursor, fg, bg)
Cursor cursor; /* X cursor ID to set */
unsigned long fg, bg; /* pixel indexes to look up */
@@ -1105,4 +1120,3 @@
XRecolorCursor (dpy, cursor, colordefs, colordefs+1);
return;
}
-
Index: xterm.h
--- /dev/null Sun Jul 17 19:46:18 1994
+++ xterm-patched/xterm.h Sat Jan 6 20:01:16 1996
@@ -0,0 +1,189 @@
+/*
+ * Common/useful definitions for XTERM application
+ */
+#ifndef included_xterm_h
+#define included_xterm_h
+
+#include "proto.h"
+
+/* Tekproc.c */
+extern int TekInit PROTO((void));
+extern void ChangeTekColors PROTO((TScreen *screen, ScrnColors *pNew));
+extern void TCursorToggle PROTO((int toggle));
+extern void TekCopy PROTO((void));
+extern void TekEnqMouse PROTO((int c));
+extern void TekExpose NOPROTO((Widget w, XEvent *event, Region region));
+extern void TekGINoff PROTO((void));
+extern void TekReverseVideo PROTO((TScreen *screen));
+extern void TekRun PROTO((void));
+extern void TekSetFontSize PROTO((int newitem));
+extern void TekSimulatePageButton PROTO((Bool reset));
+extern void dorefresh PROTO((void));
+
+/* button.c */
+extern Boolean SendMousePosition PROTO((Widget w, XEvent* event));
+extern int SetCharacterClassRange PROTO((int low, int high, int value));
+extern void DiredButton PROTO_XT_ACTIONS_ARGS;
+extern void DisownSelection PROTO((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 ResizeSelection PROTO((TScreen *screen, int rows, int cols));
+extern void ScrollSelection PROTO((TScreen* screen, int amount));
+extern void TrackMouse PROTO((int func, int startrow, int startcol, int firstrow, int lastrow));
+extern void TrackText PROTO((int frow, int fcol, int trow, int tcol));
+extern void ViButton PROTO_XT_ACTIONS_ARGS;
+
+/* charproc.c */
+extern int VTInit PROTO((void));
+extern int v_write PROTO((int f, char *d, int len));
+extern void FindFontSelection PROTO((char *atom_name, Bool justprobe));
+extern void HideCursor PROTO((void));
+extern void SetVTFont PROTO((int i, Bool doresize, char *name1, char *name2));
+extern void ShowCursor PROTO((void));
+extern void SwitchBufPtrs PROTO((TScreen *screen));
+extern void VTReset PROTO((Boolean full));
+extern void VTRun PROTO((void));
+extern void set_cursor_gcs PROTO((TScreen *screen));
+extern void unparseputc PROTO((int c, int fd));
+extern void unparseseq PROTO((ANSI *ap, int fd));
+
+/* cursor.c */
+extern void CarriageReturn PROTO((TScreen *screen));
+extern void CursorBack PROTO((TScreen *screen, int n));
+extern void CursorDown PROTO((TScreen *screen, int n));
+extern void CursorForward PROTO((TScreen *screen, int n));
+extern void CursorRestore PROTO((XtermWidget term, SavedCursor *sc));
+extern void CursorSave PROTO((XtermWidget term, SavedCursor *sc));
+extern void CursorSet PROTO((TScreen *screen, int row, int col, unsigned flags));
+extern void CursorUp PROTO((TScreen *screen, int n));
+extern void Index PROTO((TScreen *screen, int amount));
+extern void RevIndex PROTO((TScreen *screen, int amount));
+
+/* input.c */
+extern void Input PROTO((TKeyboard *keyboard, TScreen *screen, XKeyEvent *event, Bool eightbit));
+extern void StringInput PROTO((TScreen *screen, char *string, int nbytes));
+
+/* main.c */
+extern int main PROTO((int argc, char **argv));
+
+extern int GetBytesAvailable PROTO((int fd));
+extern int kill_process_group PROTO((int pid, int sig));
+extern int nonblocking_wait PROTO((void));
+extern void first_map_occurred PROTO((void));
+extern void get_terminal PROTO((void));
+
+#ifndef AMOEBA
+extern int spawn PROTO((void));
+#endif
+
+#ifdef SIGNAL_T
+extern SIGNAL_T Exit NOPROTO((int n));
+#endif
+
+/* misc.c */
+extern Cursor make_colored_cursor PROTO((int cursorindex, unsigned long fg, unsigned long bg));
+extern char *SysErrorMsg PROTO((int n));
+extern char *strindex PROTO((char *s1, char *s2));
+extern int XStrCmp PROTO((char *s1, char *s2));
+extern int xerror PROTO((Display *d, XErrorEvent *ev));
+extern int xioerror PROTO((Display *dpy));
+extern void Bell PROTO((void));
+extern void Changename PROTO((char *name));
+extern void Changetitle PROTO((char *name));
+extern void Cleanup PROTO((int code));
+/* extern void Error NOPROTO((int i)); */
+extern void HandleBellPropertyChange PROTO_XT_EV_HANDLER_ARGS;
+extern void HandleEightBitKeyPressed PROTO_XT_ACTIONS_ARGS;
+extern void HandleEnterWindow PROTO_XT_EV_HANDLER_ARGS;
+extern void HandleFocusChange NOPROTO((Widget w, XtPointer eventdata, XEvent *event, Boolean* cont));
+extern void HandleKeyPressed PROTO_XT_ACTIONS_ARGS;
+extern void HandleLeaveWindow PROTO_XT_EV_HANDLER_ARGS;
+extern void HandleStringEvent PROTO_XT_ACTIONS_ARGS;
+extern void Panic PROTO((char *s, int a));
+extern void Redraw PROTO((void));
+extern void ReverseOldColors PROTO((void));
+extern void Setenv PROTO((char *var, char *value));
+extern void SysError PROTO((int i));
+extern void VisualBell PROTO((void));
+extern void creat_as PROTO((int uid, int gid, char *pathname, int mode));
+extern void do_osc PROTO((int (*func)(void)));
+extern void end_tek_mode PROTO((void));
+extern void end_vt_mode PROTO((void));
+extern void hide_tek_window PROTO((void));
+extern void hide_vt_window PROTO((void));
+extern void set_tek_visibility PROTO((Boolean on));
+extern void set_vt_visibility PROTO((Boolean on));
+extern void switch_modes PROTO((Bool tovt));
+extern void xevents PROTO((void));
+extern void xt_error PROTO((String message));
+
+#ifdef ALLOWLOGGING
+extern void StartLog PROTO((TScreen *screen));
+extern void CloseLog PROTO((TScreen *screen));
+extern void FlushLog PROTO((TScreen *screen));
+#endif
+
+/* screen.c */
+extern Bool non_blank_line PROTO((ScrnBuf sb, int row, int col, int len));
+extern ScrnBuf Allocate PROTO((int nrow, int ncol, Char **addr));
+extern int ScreenResize PROTO((TScreen *screen, int width, int height, unsigned *flags));
+extern int ScrnGetAttributes PROTO((TScreen *screen, int row, int col, Char *str, int length));
+extern void ClearBufRows PROTO((TScreen *screen, int first, int last));
+extern void ScreenWrite PROTO((TScreen *screen, char *str, unsigned flags, unsigned cur_fg, unsigned cur_bg, int length));
+extern void ScrnDeleteChar PROTO((ScrnBuf sb, int row, int size, int n, int col));
+extern void ScrnDeleteLine PROTO((ScrnBuf sb, int n, int last, int size, int where));
+extern void ScrnInsertChar PROTO((ScrnBuf sb, int row, int size, int col, int n));
+extern void ScrnInsertLine PROTO((ScrnBuf sb, int last, int where, int n, int size));
+extern void ScrnRefresh PROTO((TScreen *screen, int toprow, int leftcol, int nrows, int ncols, Boolean force));
+extern void ScrnSetAttributes PROTO((TScreen *screen, int row, int col, unsigned mask, unsigned value, int length));
+
+/* scrollbar.c */
+extern void DoResizeScreen PROTO((XtermWidget xw));
+extern void HandleScrollBack PROTO_XT_ACTIONS_ARGS;
+extern void HandleScrollForward PROTO_XT_ACTIONS_ARGS;
+extern void ResizeScrollBar PROTO((Widget scrollWidget, int x, int y, unsigned height));
+extern void ScrollBarDrawThumb PROTO((Widget scrollWidget));
+extern void ScrollBarOff PROTO((TScreen *screen));
+extern void ScrollBarOn PROTO((XtermWidget xw, int init, int doalloc));
+extern void ScrollBarReverseVideo PROTO((Widget scrollWidget));
+extern void WindowScroll PROTO((TScreen *screen, int top));
+
+/* tabs.c */
+extern int TabNext PROTO((Tabs tabs, int col));
+extern void TabClear PROTO((Tabs tabs, int col));
+extern void TabReset PROTO((Tabs tabs));
+extern void TabSet PROTO((Tabs tabs, int col));
+extern void TabZonk PROTO((Tabs tabs));
+
+/* util.c */
+extern int AddToRefresh PROTO((TScreen *screen));
+extern int HandleExposure PROTO((TScreen *screen, XEvent *event));
+extern void ChangeColors PROTO((XtermWidget term, ScrnColors *pNew));
+extern void ClearAbove PROTO((TScreen *screen));
+extern void ClearBelow PROTO((TScreen *screen));
+extern void ClearLeft PROTO((TScreen *screen));
+extern void ClearLine PROTO((TScreen *screen));
+extern void ClearRight PROTO((TScreen *screen));
+extern void ClearScreen PROTO((TScreen *screen));
+extern void DeleteChar PROTO((TScreen *screen, int n));
+extern void DeleteLine PROTO((TScreen *screen, int n));
+extern void FlushScroll PROTO((TScreen *screen));
+extern void GetColors PROTO((XtermWidget term, ScrnColors *pColors));
+extern void InsertChar PROTO((TScreen *screen, int n));
+extern void InsertLine PROTO((TScreen *screen, int n));
+extern void RevScroll PROTO((TScreen *screen, int amount));
+extern void ReverseVideo PROTO((XtermWidget termw));
+extern void Scroll PROTO((TScreen *screen, int amount));
+extern void recolor_cursor PROTO((Cursor cursor, unsigned long fg, unsigned long bg));
+extern void scrolling_copy_area PROTO((TScreen *screen, int firstline, int nlines, int amount));
+
+#endif /* included_xterm_h */