XFree86 3.9Ah - xterm patch #78 - T.Dickey <dickey@clark.net>
# ------------------------------------------------------------------------------
# charproc.c | 333 +++++++++++++++++++++++--------------------------------
# main.c | 115 ++++++------------
# misc.c | 223 ++++++++++++++----------------------
# print.c | 14 ++
# screen.c | 166 ++++++++++++++-------------
# util.c | 243 ++++++++++++++++------------------------
# version.h | 2
# xterm.log.html | 11 +
# 8 files changed, 479 insertions, 628 deletions
# ------------------------------------------------------------------------------
Index: charproc.c
--- xterm-77+/charproc.c Mon May 25 20:52:22 1998
+++ xterm-78/charproc.c Thu May 28 18:50:52 1998
@@ -118,22 +118,17 @@
static int LoadNewFont (TScreen *screen, char *nfontname, char *bfontname, Bool doresize, int fontnum);
static int in_put (void);
static int set_character_class (char *s);
-static void DoSetSelectedFont PROTO_XT_SEL_CB_ARGS;
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 VTGraphicsOrNoExpose (XEvent *event);
-static void VTNonMaskableEvent PROTO_XT_EV_HANDLER_ARGS;
static void VTallocbuf (void);
-static void VTparse (void);
static void WriteText (TScreen *screen, Char *str, int 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 report_win_label (TScreen *screen, int code, XTextProperty *text, Status ok);
static void restoremodes (XtermWidget termw);
static void savemodes (XtermWidget termw);
static void set_vt_box (TScreen *screen);
@@ -150,12 +145,6 @@
#define StopBlinking(screen) /* nothing */
#endif
-#if OPT_ISO_COLORS
-static void setExtendedFG (void);
-static void reset_SGR_Colors (void);
-static void reset_SGR_Foreground (void);
-#endif
-
#define DEFAULT -1
#define TEXT_BUF_SIZE 256
#define TRACKTIMESEC 4L
@@ -880,8 +869,7 @@
* XDrawImageString and XDrawString)
* area (X11 graphics context used in XClearArea and XFillRectangle)
*/
-void SGR_Foreground(color)
- int color;
+void SGR_Foreground(int color)
{
register TScreen *screen = &term->screen;
Pixel fg;
@@ -904,8 +892,7 @@
}
}
-void SGR_Background(color)
- int color;
+void SGR_Background(int color)
{
register TScreen *screen = &term->screen;
Pixel bg;
@@ -931,7 +918,7 @@
* index to use for foreground. (See also 'extract_fg()').
*/
static void
-setExtendedFG()
+setExtendedFG(void)
{
int fg = term->sgr_foreground;
@@ -964,22 +951,21 @@
}
static void
-reset_SGR_Foreground()
+reset_SGR_Foreground(void)
{
term->sgr_foreground = -1;
setExtendedFG();
}
static void
-reset_SGR_Colors()
+reset_SGR_Colors(void)
{
reset_SGR_Foreground();
SGR_Background(-1);
}
#endif /* OPT_ISO_COLORS */
-void resetCharsets(screen)
- TScreen *screen;
+void resetCharsets(TScreen *screen)
{
screen->gsets[0] = 'B'; /* ASCII_G */
screen->gsets[1] = '0'; /* line drawing */
@@ -990,7 +976,7 @@
screen->curss = 0; /* No single shift. */
}
-static void VTparse()
+static void VTparse(void)
{
/* Buffer for processing strings (e.g., OSC ... ST) */
static Char *string_area;
@@ -2155,10 +2141,7 @@
or generated by us in response to a query ESC sequence. */
int
-v_write(f, d, len)
- int f;
- char *d;
- int len;
+v_write(int f, char *d, int len)
{
int riten;
int c = len;
@@ -2315,7 +2298,7 @@
static int pty_read_bytes;
static int
-in_put()
+in_put(void)
{
register TScreen *screen = &term->screen;
register int i;
@@ -2476,11 +2459,11 @@
* by charset. worry about end of line conditions (wraparound if selected).
*/
void
-dotext(screen, charset, buf, ptr)
- register TScreen *screen;
- char charset;
- Char *buf; /* start of characters to process */
- Char *ptr; /* end */
+dotext(
+ register TScreen *screen,
+ int charset,
+ Char *buf, /* start of characters to process */
+ Char *ptr) /* end */
{
register int len;
register int n;
@@ -2549,10 +2532,10 @@
* the current cursor position. update cursor position.
*/
static void
-WriteText(screen, str, len)
- register TScreen *screen;
- register Char *str;
- register int len;
+WriteText(
+ register TScreen *screen,
+ register Char *str,
+ register int len)
{
unsigned flags = term->flags;
int fg_bg = makeColorPair(term->cur_foreground, term->cur_background);
@@ -2632,11 +2615,11 @@
#if OPT_ZICONBEEP
/* Flag icon name with "***" on window output when iconified.
*/
-static void HandleMapUnmap(w, closure, event, cont )
- Widget w GCC_UNUSED;
- XtPointer closure GCC_UNUSED;
- XEvent *event;
- Boolean *cont GCC_UNUSED;
+static void HandleMapUnmap(
+ Widget w GCC_UNUSED,
+ XtPointer closure GCC_UNUSED,
+ XEvent *event,
+ Boolean *cont GCC_UNUSED)
{
static char *icon_name;
static Arg args[] = {
@@ -2675,9 +2658,9 @@
* process ANSI modes set, reset
*/
static void
-ansi_modes(termw, func)
- XtermWidget termw;
- void (*func) (unsigned *p, unsigned mask);
+ansi_modes(
+ XtermWidget termw,
+ void (*func) (unsigned *p, unsigned mask))
{
register int i;
@@ -2707,9 +2690,9 @@
* process DEC private modes set, reset
*/
static void
-dpmodes(termw, func)
- XtermWidget termw;
- void (*func) (unsigned *p, unsigned mask);
+dpmodes(
+ XtermWidget termw,
+ void (*func) (unsigned *p, unsigned mask))
{
register TScreen *screen = &termw->screen;
register int i, j;
@@ -2900,8 +2883,7 @@
* process xterm private modes save
*/
static void
-savemodes(termw)
- XtermWidget termw;
+savemodes(XtermWidget termw)
{
register TScreen *screen = &termw->screen;
register int i;
@@ -2972,8 +2954,7 @@
* process xterm private modes restore
*/
static void
-restoremodes(termw)
- XtermWidget termw;
+restoremodes(XtermWidget termw)
{
register TScreen *screen = &termw->screen;
register int i, j;
@@ -3086,11 +3067,11 @@
* ESC ] code label ESC backslash
*/
static void
-report_win_label(screen, code, text, ok)
- TScreen *screen;
- int code;
- XTextProperty *text;
- Status ok;
+report_win_label(
+ TScreen *screen,
+ int code,
+ XTextProperty *text,
+ Status ok)
{
char **list;
int length = 0;
@@ -3122,8 +3103,7 @@
* Window operations (from CDE dtterm description)
*/
static void
-window_ops(termw)
- XtermWidget termw;
+window_ops(XtermWidget termw)
{
register TScreen *screen = &termw->screen;
XWindowChanges values;
@@ -3259,9 +3239,7 @@
/*
* set a bit in a word given a pointer to the word and a mask.
*/
-static void bitset(p, mask)
- unsigned *p;
- unsigned mask;
+static void bitset(unsigned *p, unsigned mask)
{
*p |= mask;
}
@@ -3269,9 +3247,7 @@
/*
* clear a bit in a word given a pointer to the word and a mask.
*/
-static void bitclr(p, mask)
- unsigned *p;
- unsigned mask;
+static void bitclr(unsigned *p, unsigned mask)
{
*p &= ~mask;
}
@@ -3279,19 +3255,14 @@
/*
* Copy bits from one word to another, given a mask
*/
-static void bitcpy(p, q, mask)
- unsigned *p;
- unsigned q;
- unsigned mask;
+static void bitcpy(unsigned *p, unsigned q, unsigned mask)
{
bitclr(p, mask);
bitset(p, q & mask);
}
void
-unparseputc1(c, fd)
- int c;
- int fd;
+unparseputc1(int c, int fd)
{
if (c >= 0x80 && c <= 0x9F) {
if (!term->screen.control_eight_bits) {
@@ -3303,9 +3274,7 @@
}
void
-unparseseq(ap, fd)
- register ANSI *ap;
- int fd;
+unparseseq(register ANSI *ap, int fd)
{
register int c;
register int i;
@@ -3331,9 +3300,7 @@
}
static void
-unparseputn(n, fd)
-unsigned int n;
-int fd;
+unparseputn(unsigned int n, int fd)
{
unsigned int q;
@@ -3344,9 +3311,7 @@
}
void
-unparseputc(c, fd)
-char c;
-int fd;
+unparseputc(int c, int fd)
{
Char buf[2];
register i = 1;
@@ -3368,8 +3333,7 @@
}
void
-ToggleAlternate(screen)
- register TScreen *screen;
+ToggleAlternate(register TScreen *screen)
{
if (screen->alternate)
FromAlternate(screen);
@@ -3378,8 +3342,7 @@
}
static void
-ToAlternate(screen)
- register TScreen *screen;
+ToAlternate(register TScreen *screen)
{
if(screen->alternate)
return;
@@ -3392,8 +3355,7 @@
}
static void
-FromAlternate(screen)
- register TScreen *screen;
+FromAlternate(register TScreen *screen)
{
if(!screen->alternate)
return;
@@ -3403,8 +3365,7 @@
}
static void
-SwitchBufs(screen)
- register TScreen *screen;
+SwitchBufs(register TScreen *screen)
{
register int rows, top;
@@ -3435,8 +3396,7 @@
/* swap buffer line pointers between alt and regular screens */
void
-SwitchBufPtrs(screen)
- register TScreen *screen;
+SwitchBufPtrs(register TScreen *screen)
{
size_t len = ScrnPointers(screen, screen->max_row + 1);
@@ -3446,7 +3406,7 @@
}
void
-VTRun()
+VTRun(void)
{
register TScreen *screen = &term->screen;
#if OPT_TEK4014
@@ -3487,10 +3447,10 @@
}
/*ARGSUSED*/
-static void VTExpose(w, event, region)
- Widget w GCC_UNUSED;
- XEvent *event;
- Region region GCC_UNUSED;
+static void VTExpose(
+ Widget w GCC_UNUSED,
+ XEvent *event,
+ Region region GCC_UNUSED)
{
register TScreen *screen = &term->screen;
@@ -3502,8 +3462,7 @@
HandleExposure (screen, event);
}
-static void VTGraphicsOrNoExpose (event)
- XEvent *event;
+static void VTGraphicsOrNoExpose (XEvent *event)
{
register TScreen *screen = &term->screen;
if (screen->incopy <= 0) {
@@ -3526,11 +3485,11 @@
}
/*ARGSUSED*/
-static void VTNonMaskableEvent (w, closure, event, cont)
-Widget w GCC_UNUSED;
-XtPointer closure GCC_UNUSED;
-XEvent *event;
-Boolean *cont GCC_UNUSED;
+static void VTNonMaskableEvent (
+ Widget w GCC_UNUSED,
+ XtPointer closure GCC_UNUSED,
+ XEvent *event,
+ Boolean *cont GCC_UNUSED)
{
switch (event->type) {
case GraphicsExpose:
@@ -3543,8 +3502,7 @@
-static void VTResize(w)
- Widget w;
+static void VTResize(Widget w)
{
if (XtIsRealized(w))
ScreenResize (&term->screen, term->core.width, term->core.height,
@@ -3552,11 +3510,11 @@
}
-static void RequestResize(termw, rows, cols, text)
- XtermWidget termw;
- int rows;
- int cols;
- int text;
+static void RequestResize(
+ XtermWidget termw,
+ int rows,
+ int cols,
+ int text)
{
register TScreen *screen = &termw->screen;
Dimension replyWidth, replyHeight;
@@ -3623,7 +3581,7 @@
"<ClientMessage>WM_PROTOCOLS: DeleteWindow()\n\
<MappingNotify>: KeyboardMapping()\n";
-int VTInit ()
+int VTInit (void)
{
register TScreen *screen = &term->screen;
Widget vtparent = term->core.parent;
@@ -3637,7 +3595,7 @@
return (1);
}
-static void VTallocbuf ()
+static void VTallocbuf (void)
{
register TScreen *screen = &term->screen;
int nrows = screen->max_row + 1;
@@ -3654,7 +3612,7 @@
return;
}
-static void VTClassInit ()
+static void VTClassInit (void)
{
XtAddConverter(XtRString, XtRGravity, XmuCvtStringToGravity,
(XtConvertArgList) NULL, (Cardinal) 0);
@@ -3662,10 +3620,11 @@
/* ARGSUSED */
-static void VTInitialize (wrequest, wnew, args, num_args)
- Widget wrequest, wnew;
- ArgList args GCC_UNUSED;
- Cardinal *num_args GCC_UNUSED;
+static void VTInitialize (
+ Widget wrequest,
+ Widget wnew,
+ ArgList args GCC_UNUSED,
+ Cardinal *num_args GCC_UNUSED)
{
XtermWidget request = (XtermWidget) wrequest;
XtermWidget new = (XtermWidget) wnew;
@@ -3864,17 +3823,16 @@
}
-static void VTDestroy (w)
-Widget w;
+static void VTDestroy (Widget w)
{
XtFree(((XtermWidget)w)->screen.selection);
}
/*ARGSUSED*/
-static void VTRealize (w, valuemask, values)
- Widget w;
- XtValueMask *valuemask;
- XSetWindowAttributes *values;
+static void VTRealize (
+ Widget w,
+ XtValueMask *valuemask,
+ XSetWindowAttributes *values)
{
unsigned int width, height;
register TScreen *screen = &term->screen;
@@ -4112,7 +4070,7 @@
}
#if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
-static void VTInitI18N()
+static void VTInitI18N(void)
{
unsigned i;
char *p,
@@ -4240,10 +4198,12 @@
#endif
-static Boolean VTSetValues (cur, request, new, args, num_args)
- Widget cur, request GCC_UNUSED, new;
- ArgList args GCC_UNUSED;
- Cardinal *num_args GCC_UNUSED;
+static Boolean VTSetValues (
+ Widget cur,
+ Widget request GCC_UNUSED,
+ Widget new,
+ ArgList args GCC_UNUSED,
+ Cardinal *num_args GCC_UNUSED)
{
XtermWidget curvt = (XtermWidget) cur;
XtermWidget newvt = (XtermWidget) new;
@@ -4302,7 +4262,7 @@
* Shows cursor at new cursor position in screen.
*/
void
-ShowCursor()
+ShowCursor(void)
{
register TScreen *screen = &term->screen;
register int x, y, flags;
@@ -4401,7 +4361,7 @@
* hide cursor at previous cursor position in screen.
*/
void
-HideCursor()
+HideCursor(void)
{
register TScreen *screen = &term->screen;
GC currentGC;
@@ -4457,8 +4417,7 @@
#if OPT_BLINK_CURS
static void
-StartBlinking(screen)
- TScreen *screen;
+StartBlinking(TScreen *screen)
{
if (screen->cursor_blink > 0
&& screen->cursor_timer == 0) {
@@ -4474,8 +4433,7 @@
}
static void
-StopBlinking(screen)
- TScreen *screen;
+StopBlinking(TScreen *screen)
{
if (screen->cursor_blink > 0)
XtRemoveTimeOut(screen->cursor_timer);
@@ -4488,9 +4446,7 @@
* logic simple.
*/
static void
-BlinkCursor(closure, id) /* XtTimerCallbackProc */
- XtPointer closure;
- XtIntervalId* id;
+BlinkCursor(XtPointer closure, XtIntervalId* id)
{
TScreen *screen = (TScreen *)closure;
@@ -4523,9 +4479,7 @@
* (but the control sequence does this anyway).
*/
void
-VTReset(full, saved)
- Boolean full;
- Boolean saved;
+VTReset(Bool full, Bool saved)
{
register TScreen *screen = &term->screen;
@@ -4626,8 +4580,7 @@
* and sets the indicated ranges to the indicated values.
*/
static int
-set_character_class (s)
- register char *s;
+set_character_class (register char *s)
{
register int i; /* iterator, index into s */
int len; /* length of s */
@@ -4722,11 +4675,11 @@
}
/* ARGSUSED */
-static void HandleKeymapChange(w, event, params, param_count)
- Widget w;
- XEvent *event GCC_UNUSED;
- String *params;
- Cardinal *param_count;
+static void HandleKeymapChange(
+ Widget w,
+ XEvent *event GCC_UNUSED,
+ String *params,
+ Cardinal *param_count)
{
static XtTranslations keymap, original;
static XtResource key_resources[] = {
@@ -4770,11 +4723,11 @@
/* ARGSUSED */
-static void HandleBell(w, event, params, param_count)
- Widget w;
- XEvent *event GCC_UNUSED;
- String *params; /* [0] = volume */
- Cardinal *param_count; /* 0 or 1 */
+static void HandleBell(
+ Widget w,
+ XEvent *event GCC_UNUSED,
+ String *params, /* [0] = volume */
+ Cardinal *param_count) /* 0 or 1 */
{
int percent = (*param_count) ? atoi(params[0]) : 0;
@@ -4788,22 +4741,22 @@
/* ARGSUSED */
-static void HandleVisualBell(w, event, params, param_count)
- Widget w GCC_UNUSED;
- XEvent *event GCC_UNUSED;
- String *params GCC_UNUSED;
- Cardinal *param_count GCC_UNUSED;
+static void HandleVisualBell(
+ Widget w GCC_UNUSED,
+ XEvent *event GCC_UNUSED,
+ String *params GCC_UNUSED,
+ Cardinal *param_count GCC_UNUSED)
{
VisualBell();
}
/* ARGSUSED */
-static void HandleIgnore(w, event, params, param_count)
- Widget w;
- XEvent *event;
- String *params GCC_UNUSED;
- Cardinal *param_count GCC_UNUSED;
+static void HandleIgnore(
+ Widget w,
+ XEvent *event,
+ String *params GCC_UNUSED,
+ Cardinal *param_count GCC_UNUSED)
{
/* do nothing, but check for funny escape sequences */
(void) SendMousePosition(w, event);
@@ -4812,14 +4765,14 @@
/* ARGSUSED */
static void
-DoSetSelectedFont(w, client_data, selection, type, value, length, format)
- Widget w GCC_UNUSED;
- XtPointer client_data GCC_UNUSED;
- Atom *selection GCC_UNUSED;
- Atom *type;
- XtPointer value;
- unsigned long *length GCC_UNUSED;
- int *format;
+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;
@@ -4841,9 +4794,7 @@
}
}
-void FindFontSelection (atom_name, justprobe)
- char *atom_name;
- Bool justprobe;
+void FindFontSelection (char *atom_name, Bool justprobe)
{
static AtomPtr *atoms;
static int atomCount = 0;
@@ -4877,11 +4828,11 @@
/* ARGSUSED */
static void
-HandleSetFont(w, event, params, param_count)
- Widget w GCC_UNUSED;
- XEvent *event GCC_UNUSED;
- String *params;
- Cardinal *param_count;
+HandleSetFont(
+ Widget w GCC_UNUSED,
+ XEvent *event GCC_UNUSED,
+ String *params,
+ Cardinal *param_count)
{
int fontnum;
char *name1 = NULL, *name2 = NULL;
@@ -4932,10 +4883,11 @@
}
-void SetVTFont (i, doresize, name1, name2)
- int i;
- Bool doresize;
- char *name1, *name2;
+void SetVTFont (
+ int i,
+ Bool doresize,
+ char *name1,
+ char *name2)
{
TScreen *screen = &term->screen;
@@ -4955,11 +4907,12 @@
}
static int
-LoadNewFont (screen, nfontname, bfontname, doresize, fontnum)
- TScreen *screen;
- char *nfontname, *bfontname;
- Bool doresize;
- int fontnum;
+LoadNewFont (
+ TScreen *screen,
+ char *nfontname,
+ char *bfontname,
+ Bool doresize,
+ int fontnum)
{
XFontStruct *nfs = NULL, *bfs = NULL;
XGCValues xgcv;
@@ -5095,9 +5048,7 @@
static void
-update_font_info (screen, doresize)
- TScreen *screen;
- Bool doresize;
+update_font_info (TScreen *screen, Bool doresize)
{
int i, j, width, height, scrollbar_width;
@@ -5129,8 +5080,7 @@
}
static void
-set_vt_box (screen)
- TScreen *screen;
+set_vt_box (TScreen *screen)
{
XPoint *vp;
@@ -5143,8 +5093,7 @@
}
void
-set_cursor_gcs (screen)
- TScreen *screen;
+set_cursor_gcs (TScreen *screen)
{
XGCValues xgcv;
XtGCMask mask;
Index: main.c
--- xterm-77+/main.c Mon May 25 20:54:38 1998
+++ xterm-78/main.c Wed May 27 21:37:46 1998
@@ -490,12 +490,6 @@
static int pty_search (int *pty);
static int remove_termcap_entry (char *buf, char *str);
static int spawn (void);
-static void DeleteWindow PROTO_XT_ACTIONS_ARGS;
-static void Help (void);
-static void HsSysError (int pf, int error);
-static void KeyboardMapping PROTO_XT_ACTIONS_ARGS;
-static void Syntax (char *badOption);
-static void Version (void);
static void get_terminal (void);
static void resize (TScreen *s, char *oldtc, char *newtc);
@@ -683,11 +677,6 @@
static int inhibit;
static char passedPty[2]; /* name if pty if slave */
-#ifndef AMOEBA
-static int get_pty (int *pty);
-static SIGNAL_T hungtty (int i);
-#endif
-
#if defined(TIOCCONS) || defined(SRIOCSREDIR)
static int Console;
#include <X11/Xmu/SysUtil.h> /* XmuGetHostname */
@@ -695,7 +684,6 @@
#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
@@ -1009,8 +997,7 @@
return ((len >= 2) && (!strncmp(tst, cmp, len)));
}
-static void Syntax (badOption)
- char *badOption;
+static void Syntax (char *badOption)
{
struct _options *opt;
int col;
@@ -1035,13 +1022,13 @@
exit (1);
}
-static void Version ()
+static void Version (void)
{
puts (XTERM_VERSION);
exit (0);
}
-static void Help ()
+static void Help (void)
{
struct _options *opt;
char **cpp;
@@ -1066,12 +1053,14 @@
#if defined(TIOCCONS) || defined(SRIOCSREDIR)
/* ARGSUSED */
static Boolean
-ConvertConsoleSelection(w, selection, target, type, value, length, format)
- Widget w GCC_UNUSED;
- Atom *selection GCC_UNUSED, *target GCC_UNUSED, *type GCC_UNUSED;
- XtPointer *value GCC_UNUSED;
- unsigned long *length GCC_UNUSED;
- int *format GCC_UNUSED;
+ConvertConsoleSelection(
+ Widget w GCC_UNUSED,
+ Atom *selection GCC_UNUSED,
+ Atom *target GCC_UNUSED,
+ Atom *type 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;
@@ -1092,11 +1081,11 @@
*/
/* ARGSUSED */
static void
-DeleteWindow(w, event, params, num_params)
- Widget w;
- XEvent *event GCC_UNUSED;
- String *params GCC_UNUSED;
- Cardinal *num_params GCC_UNUSED;
+DeleteWindow(
+ Widget w,
+ XEvent *event GCC_UNUSED,
+ String *params GCC_UNUSED,
+ Cardinal *num_params GCC_UNUSED)
{
#if OPT_TEK4014
if (w == toplevel)
@@ -1114,11 +1103,11 @@
/* ARGSUSED */
static void
-KeyboardMapping(w, event, params, num_params)
- Widget w GCC_UNUSED;
- XEvent *event;
- String *params GCC_UNUSED;
- Cardinal *num_params GCC_UNUSED;
+KeyboardMapping(
+ Widget w GCC_UNUSED,
+ XEvent *event,
+ String *params GCC_UNUSED,
+ Cardinal *num_params GCC_UNUSED)
{
switch (event->type) {
case MappingNotify:
@@ -1138,9 +1127,7 @@
extern fd_set pty_mask;
int
-main (argc, argv)
-int argc;
-char **argv;
+main (int argc, char *argv[])
{
register TScreen *screen;
int mode;
@@ -1787,8 +1774,7 @@
}
static char *
-base_name(name)
-char *name;
+base_name(char *name)
{
register char *cp;
@@ -1805,8 +1791,7 @@
*/
static int
-get_pty (pty)
- int *pty;
+get_pty (int *pty)
{
#ifdef __osf__
int tty;
@@ -1930,8 +1915,7 @@
* Returns 0 if found a pty, 1 if fails.
*/
static int
-pty_search(pty)
- int *pty;
+pty_search(int *pty)
{
static int devindex, letter = 0;
@@ -1986,7 +1970,7 @@
#endif /* AMOEBA */
static void
-get_terminal ()
+get_terminal (void)
/*
* sets up X and initializes the terminal structure except for term.buf.fildes.
*/
@@ -2044,8 +2028,7 @@
};
/* ARGSUSED */
-static SIGNAL_T hungtty(i)
- int i GCC_UNUSED;
+static SIGNAL_T hungtty(int i GCC_UNUSED)
{
longjmp(env, 1);
SIGNAL_RETURN;
@@ -2088,9 +2071,7 @@
*/
static void
-HsSysError(pf, error)
-int pf;
-int error;
+HsSysError(int pf, int error)
{
handshake_t handshake;
@@ -2102,7 +2083,7 @@
exit(error);
}
-void first_map_occurred ()
+void first_map_occurred (void)
{
handshake_t handshake;
register TScreen *screen = &term->screen;
@@ -2120,15 +2101,14 @@
* temporary hack to get xterm working on att ptys
*/
void
-HsSysError(pf, error)
- int pf;
- int error;
+HsSysError(int pf, int error)
{
fprintf(stderr, "%s: fatal pty error %d (errno=%d) on tty %s\n",
xterm_name, error, errno, ttydev);
exit(error);
}
-void first_map_occurred ()
+
+void first_map_occurred (void)
{
return;
}
@@ -2139,7 +2119,7 @@
extern char **environ;
static int
-spawn ()
+spawn (void)
/*
* Inits pty and tty and forks a login process.
* Does not close fd Xsocket.
@@ -3602,7 +3582,7 @@
/*
* Spawn off tty threads and fork the login process.
*/
-static int spawn()
+static int spawn(void)
{
register TScreen *screen = &term->screen;
char *TermName = NULL;
@@ -3871,8 +3851,7 @@
#endif /* AMOEBA */
SIGNAL_T
-Exit(n)
- int n;
+Exit(int n)
{
register TScreen *screen = &term->screen;
#ifdef UTMP
@@ -4003,9 +3982,7 @@
/* ARGSUSED */
static void
-resize(screen, oldtc, newtc)
-TScreen *screen;
-register char *oldtc, *newtc;
+resize(TScreen *screen, register char *oldtc, register char *newtc)
{
#ifndef USE_SYSV_ENVVARS
register char *ptr1, *ptr2;
@@ -4050,7 +4027,7 @@
* Returns the pid of the child, or 0 or -1 if none or error.
*/
int
-nonblocking_wait()
+nonblocking_wait(void)
{
#ifdef USE_POSIX_WAIT
pid_t pid;
@@ -4076,8 +4053,7 @@
}
/* ARGSUSED */
-static SIGNAL_T reapchild (n)
- int n GCC_UNUSED;
+static SIGNAL_T reapchild (int n GCC_UNUSED)
{
int pid;
@@ -4135,9 +4111,7 @@
#endif
static int
-remove_termcap_entry (buf, str)
- char *buf;
- char *str;
+remove_termcap_entry (char *buf, char *str)
{
register char *strinbuf;
@@ -4164,9 +4138,7 @@
* where setting consists of the words in the modelist followed by a character
* or ^char.
*/
-static int parse_tty_modes (s, modelist)
- char *s;
- struct _xttymodes *modelist;
+static int parse_tty_modes (char *s, struct _xttymodes *modelist)
{
struct _xttymodes *mp;
int c;
@@ -4198,8 +4170,7 @@
}
}
-int GetBytesAvailable (fd)
- int fd;
+int GetBytesAvailable (int fd)
{
#ifndef AMOEBA
#ifdef FIONREAD
@@ -4257,9 +4228,7 @@
everybody who used to call killpg() */
int
-kill_process_group(pid, sig)
- int pid;
- int sig;
+kill_process_group(int pid, int sig)
{
TRACE(("kill_process_group(pid=%d, sig=%d)\n", pid, sig))
#ifndef AMOEBA
Index: misc.c
--- xterm-77+/misc.c Mon May 25 22:10:49 1998
+++ xterm-78/misc.c Wed May 27 21:39:25 1998
@@ -88,23 +88,14 @@
(event.xcrossing.window == XtWindow(XtParent(term))))
#endif
-static Boolean AllocateColor (XtermWidget pTerm, ScrnColors *pNew, int ndx, char *name);
static Boolean ChangeColorsRequest (XtermWidget pTerm, int start, char *names);
-static Boolean GetOldColors ( XtermWidget pTerm);
-static Boolean UpdateOldColors (XtermWidget pTerm, ScrnColors *pNew);
-static int hexvalue (int c);
-static void ChangeGroup (String attribute, XtArgVal value);
static void DoSpecialEnterNotify (XEnterWindowEvent *ev);
static void DoSpecialLeaveNotify (XEnterWindowEvent *ev);
static void selectwindow (TScreen *screen, int flag);
static void unselectwindow (TScreen *screen, int flag);
-#if OPT_TEK4014
-static void withdraw_window (Display *dpy, Window w, int scr);
-#endif
-
void
-do_xevents()
+do_xevents(void)
{
register TScreen *screen = &term->screen;
@@ -114,7 +105,7 @@
}
void
-xevents()
+xevents(void)
{
XEvent event;
XtInputMask input_mask;
@@ -162,9 +153,10 @@
}
-Cursor make_colored_cursor (cursorindex, fg, bg)
- unsigned cursorindex; /* index into font */
- unsigned long fg, bg; /* pixel value */
+Cursor make_colored_cursor (
+ unsigned cursorindex, /* index into font */
+ unsigned long fg, /* pixel value */
+ unsigned long bg) /* pixel value */
{
register TScreen *screen = &term->screen;
Cursor c;
@@ -178,11 +170,11 @@
}
/* ARGSUSED */
-void HandleKeyPressed(w, event, params, nparams)
- Widget w GCC_UNUSED;
- XEvent *event;
- String *params GCC_UNUSED;
- Cardinal *nparams GCC_UNUSED;
+void HandleKeyPressed(
+ Widget w GCC_UNUSED,
+ XEvent *event,
+ String *params GCC_UNUSED,
+ Cardinal *nparams GCC_UNUSED)
{
register TScreen *screen = &term->screen;
@@ -193,11 +185,11 @@
}
/* ARGSUSED */
-void HandleEightBitKeyPressed(w, event, params, nparams)
- Widget w GCC_UNUSED;
- XEvent *event;
- String *params GCC_UNUSED;
- Cardinal *nparams GCC_UNUSED;
+void HandleEightBitKeyPressed(
+ Widget w GCC_UNUSED,
+ XEvent *event,
+ String *params GCC_UNUSED,
+ Cardinal *nparams GCC_UNUSED)
{
register TScreen *screen = &term->screen;
@@ -208,11 +200,11 @@
}
/* ARGSUSED */
-void HandleStringEvent(w, event, params, nparams)
- Widget w GCC_UNUSED;
- XEvent *event GCC_UNUSED;
- String *params;
- Cardinal *nparams;
+void HandleStringEvent(
+ Widget w GCC_UNUSED,
+ XEvent *event GCC_UNUSED,
+ String *params,
+ Cardinal *nparams)
{
register TScreen *screen = &term->screen;
@@ -243,8 +235,7 @@
}
}
-static void DoSpecialEnterNotify (ev)
- register XEnterWindowEvent *ev;
+static void DoSpecialEnterNotify (register XEnterWindowEvent *ev)
{
register TScreen *screen = &term->screen;
@@ -258,18 +249,17 @@
}
/*ARGSUSED*/
-void HandleEnterWindow(w, eventdata, event, cont)
-Widget w GCC_UNUSED;
-XtPointer eventdata GCC_UNUSED;
-XEvent *event GCC_UNUSED;
-Boolean *cont GCC_UNUSED;
+void HandleEnterWindow(
+ Widget w GCC_UNUSED,
+ XtPointer eventdata GCC_UNUSED,
+ XEvent *event GCC_UNUSED,
+ Boolean *cont GCC_UNUSED)
{
/* NOP since we handled it above */
}
-static void DoSpecialLeaveNotify (ev)
- register XEnterWindowEvent *ev;
+static void DoSpecialLeaveNotify (register XEnterWindowEvent *ev)
{
register TScreen *screen = &term->screen;
@@ -284,22 +274,22 @@
/*ARGSUSED*/
-void HandleLeaveWindow(w, eventdata, event, cont)
-Widget w GCC_UNUSED;
-XtPointer eventdata GCC_UNUSED;
-XEvent *event GCC_UNUSED;
-Boolean *cont GCC_UNUSED;
+void HandleLeaveWindow(
+ Widget w GCC_UNUSED,
+ XtPointer eventdata GCC_UNUSED,
+ XEvent *event GCC_UNUSED,
+ Boolean *cont GCC_UNUSED)
{
/* NOP since we handled it above */
}
/*ARGSUSED*/
-void HandleFocusChange(w, eventdata, ev, cont)
-Widget w GCC_UNUSED;
-XEvent *ev;
-XtPointer eventdata GCC_UNUSED;
-Boolean *cont GCC_UNUSED;
+void HandleFocusChange(
+ Widget w GCC_UNUSED,
+ XtPointer eventdata GCC_UNUSED,
+ XEvent *ev,
+ Boolean *cont GCC_UNUSED)
{
register XFocusChangeEvent *event = (XFocusChangeEvent *)ev;
register TScreen *screen = &term->screen;
@@ -323,9 +313,7 @@
static void
-selectwindow(screen, flag)
-register TScreen *screen;
-register int flag;
+selectwindow(register TScreen *screen, register int flag)
{
#if OPT_TEK4014
if(screen->TekEmu) {
@@ -353,9 +341,7 @@
}
static void
-unselectwindow(screen, flag)
-register TScreen *screen;
-register int flag;
+unselectwindow(register TScreen *screen, register int flag)
{
if (screen->always_highlight) return;
@@ -382,9 +368,7 @@
static long lastBellTime; /* in milliseconds */
void
-Bell(which,percent)
- int which GCC_UNUSED;
- int percent;
+Bell(int which GCC_UNUSED, int percent)
{
register TScreen *screen = &term->screen;
struct timeval curtime;
@@ -430,7 +414,7 @@
}
void
-VisualBell()
+VisualBell(void)
{
register TScreen *screen = &term->screen;
register Pixel xorPixel = screen->foreground ^ term->core.background_pixel;
@@ -479,11 +463,11 @@
}
/* ARGSUSED */
-void HandleBellPropertyChange(w, data, ev, more)
- Widget w GCC_UNUSED;
- XtPointer data GCC_UNUSED;
- XEvent *ev;
- Boolean *more GCC_UNUSED;
+void HandleBellPropertyChange(
+ Widget w GCC_UNUSED,
+ XtPointer data GCC_UNUSED,
+ XEvent *ev,
+ Boolean *more GCC_UNUSED)
{
register TScreen *screen = &term->screen;
@@ -493,7 +477,7 @@
}
void
-Redraw()
+Redraw(void)
{
register TScreen *screen = &term->screen;
XExposeEvent event;
@@ -537,11 +521,7 @@
* for the debug logs.
*/
void
-creat_as(uid, gid, pathname, mode)
- int uid;
- int gid;
- char *pathname;
- int mode;
+creat_as(int uid, int gid, char *pathname, int mode)
{
int fd;
int pid;
@@ -607,8 +587,7 @@
#endif /* ALLOWLOGFILEEXEC */
void
-StartLog(screen)
-register TScreen *screen;
+StartLog(register TScreen *screen)
{
static char *log_default;
#ifdef ALLOWLOGFILEEXEC
@@ -718,8 +697,7 @@
}
void
-CloseLog(screen)
-register TScreen *screen;
+CloseLog(register TScreen *screen)
{
if(!screen->logging || (screen->inhibit & I_LOG))
return;
@@ -730,8 +708,7 @@
}
void
-FlushLog(screen)
-register TScreen *screen;
+FlushLog(register TScreen *screen)
{
register Char *cp;
register int i;
@@ -745,9 +722,7 @@
#endif /* ALLOWLOGGING */
void
-do_osc(oscbuf, len)
-Char *oscbuf;
-int len GCC_UNUSED;
+do_osc(Char *oscbuf, int len GCC_UNUSED)
{
register int mode;
register Char *cp;
@@ -842,8 +817,7 @@
} user_keys[MAX_UDK];
static int
-hexvalue(c)
- int c;
+hexvalue(int c)
{
if (c >= '0' && c <= '9') return c - '0';
if (c >= 'A' && c <= 'F') return c - 'A' + 10;
@@ -852,7 +826,7 @@
}
void
-reset_decudk()
+reset_decudk(void)
{
int n;
for (n = 0; n < MAX_UDK; n++) {
@@ -865,9 +839,7 @@
}
void
-do_dcs(dcsbuf, dcslen)
-Char *dcsbuf;
-size_t dcslen;
+do_dcs(Char *dcsbuf, size_t dcslen)
{
register TScreen *screen = &term->screen;
char *cp = (char *)dcsbuf;
@@ -994,9 +966,7 @@
}
char *
-udk_lookup(keycode, len)
- int keycode;
- int *len;
+udk_lookup(int keycode, int *len)
{
if (keycode < MAX_UDK) {
*len = user_keys[keycode].len;
@@ -1006,9 +976,7 @@
}
static void
-ChangeGroup(attribute, value)
- String attribute;
- XtArgVal value;
+ChangeGroup(String attribute, XtArgVal value)
{
Arg args[1];
char *name = (value != 0) ? (char *)value : "";
@@ -1030,8 +998,7 @@
}
void
-Changename(name)
-register char *name;
+Changename(register char *name)
{
#if OPT_ZICONBEEP /* If warning should be given then give it */
if ( zIconBeep && zIconBeep_flagged ) {
@@ -1050,8 +1017,7 @@
}
void
-Changetitle(name)
-register char *name;
+Changetitle(register char *name)
{
ChangeGroup( XtNtitle, (XtArgVal)name );
}
@@ -1061,8 +1027,7 @@
ScrnColors *pOldColors= NULL;
static Boolean
-GetOldColors(pTerm)
-XtermWidget pTerm;
+GetOldColors(XtermWidget pTerm)
{
int i;
if (pOldColors==NULL) {
@@ -1082,9 +1047,9 @@
}
static Boolean
-UpdateOldColors(pTerm,pNew)
-XtermWidget pTerm GCC_UNUSED;
-ScrnColors *pNew;
+UpdateOldColors(
+ XtermWidget pTerm GCC_UNUSED,
+ ScrnColors *pNew)
{
int i;
@@ -1111,7 +1076,7 @@
}
void
-ReverseOldColors()
+ReverseOldColors(void)
{
register ScrnColors *pOld= pOldColors;
Pixel tmpPix;
@@ -1162,11 +1127,11 @@
}
static Boolean
-AllocateColor(pTerm,pNew,ndx,name)
-XtermWidget pTerm;
-ScrnColors *pNew;
-int ndx;
-char *name;
+AllocateColor(
+ XtermWidget pTerm,
+ ScrnColors *pNew,
+ int ndx,
+ char *name)
{
XColor def;
register TScreen *screen= &pTerm->screen;
@@ -1187,10 +1152,10 @@
}
static Boolean
-ChangeColorsRequest(pTerm,start,names)
-XtermWidget pTerm;
-int start;
-register char *names;
+ChangeColorsRequest(
+ XtermWidget pTerm,
+ int start,
+ register char *names)
{
char *thisName;
ScrnColors newColors;
@@ -1239,9 +1204,7 @@
/* ARGSUSED */
#endif
void
-Panic(s, a)
-char *s GCC_UNUSED;
-int a GCC_UNUSED;
+Panic(char *s GCC_UNUSED, int a GCC_UNUSED)
{
#ifdef DEBUG
if(debug) {
@@ -1253,16 +1216,14 @@
#endif /* DEBUG */
}
-char *SysErrorMsg (n)
- int n;
+char *SysErrorMsg (int n)
{
register char *s = strerror(n);
return s ? s : "unknown error";
}
void
-SysError (i)
-int i;
+SysError (int i)
{
int oerrno;
@@ -1274,8 +1235,7 @@
}
void
-Error (i)
-int i;
+Error (int i)
{
fprintf (stderr, "%s: Error %d\n", xterm_name, i);
Cleanup(i);
@@ -1286,8 +1246,7 @@
* cleanup by sending SIGHUP to client processes
*/
void
-Cleanup (code)
-int code;
+Cleanup (int code)
{
register TScreen *screen;
@@ -1312,8 +1271,7 @@
* to have to do a realloc().
*/
void
-Setenv (var, value)
-register char *var, *value;
+Setenv (register char *var, register char *value)
{
register int envindex = 0;
register size_t len = strlen(var);
@@ -1343,8 +1301,7 @@
* returns a pointer to the first occurrence of s2 in s1,
* or NULL if there are none.
*/
-char *strindex (s1, s2)
-register char *s1, *s2;
+char *strindex ( register char *s1, register char *s2)
{
register char *s3;
size_t s2len = strlen (s2);
@@ -1359,9 +1316,7 @@
/*ARGSUSED*/
int
-xerror(d, ev)
-Display *d;
-register XErrorEvent *ev;
+xerror(Display *d, register XErrorEvent *ev)
{
fprintf (stderr, "%s: warning, error event received:\n", xterm_name);
(void) XmuPrintDefaultErrorMessage (d, ev, stderr);
@@ -1371,8 +1326,7 @@
/*ARGSUSED*/
int
-xioerror(dpy)
-Display *dpy;
+xioerror(Display *dpy)
{
(void) fprintf (stderr,
"%s: fatal IO error %d (%s) or KillClient on X server \"%s\"\r\n",
@@ -1385,16 +1339,14 @@
extern char *ProgramName;
-void xt_error(message)
- String message;
+void xt_error(String message)
{
(void) fprintf (stderr, "%s Xt error: %s\n", ProgramName, message);
exit(1);
}
int
-XStrCmp(s1, s2)
-char *s1, *s2;
+XStrCmp(char *s1, char *s2)
{
if (s1 && s2) return(strcmp(s1, s2));
if (s1 && *s1) return(1);
@@ -1403,10 +1355,7 @@
}
#if OPT_TEK4014
-static void withdraw_window (dpy, w, scr)
- Display *dpy;
- Window w;
- int scr;
+static void withdraw_window (Display *dpy, Window w, int scr)
{
(void) XmuUpdateMapHints (dpy, w, NULL);
XWithdrawWindow (dpy, w, scr);
Index: print.c
--- xterm-77+/print.c Mon May 25 16:27:51 1998
+++ xterm-78/print.c Wed Jun 3 21:08:15 1998
@@ -275,9 +275,21 @@
SysError (ERROR_FORK);
if (Printer_pid == 0) {
+ TRACE(((char *)0))
close(my_pipe[1]); /* printer is silent */
- setgid (screen->gid);
+ close (screen->respond);
+
+ close(fileno(stdout));
+ dup2(fileno(stderr), 1);
+
+ if (fileno(stderr) != 2) {
+ dup2(fileno(stderr), 2);
+ close(fileno(stderr));
+ }
+
+ setgid (screen->gid); /* don't want privileges! */
setuid (screen->uid);
+
Printer = popen(screen->printer_command, "w");
input = fdopen(my_pipe[0], "r");
while ((c = fgetc(input)) != EOF) {
Index: screen.c
--- xterm-77+/screen.c Mon May 25 21:00:10 1998
+++ xterm-78/screen.c Thu May 28 07:02:46 1998
@@ -98,7 +98,6 @@
};
#endif
-ScrnBuf Allocate (nrow, ncol, addr)
/*
* 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
@@ -114,8 +113,7 @@
* with the intention of being able to change the total number of pointers per
* row according to whether the user wants color or not.
*/
-register int nrow, ncol;
-Char **addr;
+ScrnBuf Allocate (register int nrow, register int ncol, Char **addr)
{
register ScrnBuf base;
register Char *tmp;
@@ -149,9 +147,12 @@
*/
static int
Reallocate(
- ScrnBuf *sbuf,
- Char **sbufaddr,
- int nrow, int ncol, int oldrow, int oldcol)
+ ScrnBuf *sbuf,
+ Char **sbufaddr,
+ int nrow,
+ int ncol,
+ int oldrow,
+ int oldcol)
{
register ScrnBuf base;
register Char *tmp;
@@ -239,17 +240,17 @@
return move_down ? move_down : -move_up; /* convert to rows */
}
-void
-ScreenWrite (screen, str, flags, cur_fg_bg, length)
/*
* Writes str into buf at screen's current row and column. Characters are set
* to match flags.
*/
-TScreen *screen;
-Char *str;
-register unsigned flags;
-register unsigned cur_fg_bg;
-register int length; /* length of string */
+void
+ScreenWrite (
+ TScreen *screen,
+ Char *str,
+ register unsigned flags,
+ register unsigned cur_fg_bg,
+ register int length) /* length of string */
{
#if OPT_ISO_COLORS
register Char *fb = 0;
@@ -342,9 +343,7 @@
}
size_t
-ScrnPointers (screen, len)
-TScreen *screen;
-size_t len;
+ScrnPointers (TScreen *screen, size_t len)
{
len *= (MAX_PTRS * sizeof(Char *));
@@ -360,17 +359,19 @@
return len;
}
-void
-ScrnInsertLine (screen, sb, last, where, n, size)
/*
- Inserts n blank lines at sb + where, treating last as a bottom margin.
- Size is the size of each entry in sb.
- Requires: 0 <= where < where + n <= last
+ * Inserts n blank lines at sb + where, treating last as a bottom margin.
+ * Size is the size of each entry in sb.
+ * Requires: 0 <= where < where + n <= last
*/
-TScreen *screen;
-register ScrnBuf sb;
-int last;
-register int where, n, size;
+void
+ScrnInsertLine (
+ TScreen *screen,
+ register ScrnBuf sb,
+ int last,
+ register int where,
+ register int n,
+ register int size)
{
size_t len = ScrnPointers(screen, n);
@@ -396,17 +397,19 @@
len);
}
-void
-ScrnDeleteLine (screen, sb, last, where, n, size)
/*
- Deletes n lines at sb + where, treating last as a bottom margin.
- Size is the size of each entry in sb.
- Requires 0 <= where < where + n < = last
+ * Deletes n lines at sb + where, treating last as a bottom margin.
+ * Size is the size of each entry in sb.
+ * Requires 0 <= where < where + n < = last
*/
-TScreen *screen;
-register ScrnBuf sb;
-register int n, last, size;
-int where;
+void
+ScrnDeleteLine (
+ TScreen *screen,
+ register ScrnBuf sb,
+ register int last,
+ int where,
+ register int n,
+ register int size)
{
ScrnClearLines(screen, sb, where, n, size);
@@ -421,15 +424,15 @@
MAX_PTRS * sizeof(char *) * n);
}
+/*
+ * Inserts n blanks in screen at current row, col. Size is the size of each
+ * row.
+ */
void
-ScrnInsertChar (screen, n, size)
- /*
- * Inserts n blanks in screen at current row, col. Size is the size of each
- * row.
- */
- register TScreen *screen;
- register int n;
- int size;
+ScrnInsertChar (
+ register TScreen *screen,
+ register int n,
+ int size)
{
ScrnBuf sb = screen->visbuf;
int row = screen->cur_row;
@@ -468,14 +471,14 @@
ScrnClrWrapped(screen, row);
}
+/*
+ * Deletes n characters at current row, col. Size is the size of each row.
+ */
void
-ScrnDeleteChar (screen, n, size)
- /*
- Deletes n characters at current row, col. Size is the size of each row.
- */
- register TScreen *screen;
- register int size;
- register int n;
+ScrnDeleteChar (
+ register TScreen *screen,
+ register int n,
+ register int size)
{
ScrnBuf sb = screen->visbuf;
int row = screen->cur_row;
@@ -506,18 +509,21 @@
ScrnClrWrapped(screen, row);
}
-void
-ScrnRefresh (screen, toprow, leftcol, nrows, ncols, force)
/*
- Repaints the area enclosed by the parameters.
- Requires: (toprow, leftcol), (toprow + nrows, leftcol + ncols) are
- coordinates of characters in screen;
- nrows and ncols positive.
- all dimensions are based on single-characters.
+ * Repaints the area enclosed by the parameters.
+ * Requires: (toprow, leftcol), (toprow + nrows, leftcol + ncols) are
+ * coordinates of characters in screen;
+ * nrows and ncols positive.
+ * all dimensions are based on single-characters.
*/
-register TScreen *screen;
-int toprow, leftcol, nrows, ncols;
-Boolean force; /* ... leading/trailing spaces */
+void
+ScrnRefresh (
+ register TScreen *screen,
+ int toprow,
+ int leftcol,
+ int nrows,
+ int ncols,
+ Bool force) /* ... leading/trailing spaces */
{
int y = toprow * FontHeight(screen) + screen->border;
register int row;
@@ -747,14 +753,15 @@
#endif
}
-void
-ClearBufRows (screen, first, last)
/*
- Sets the rows first though last of the buffer of screen to spaces.
- Requires first <= last; first, last are rows of screen->buf.
+ * Sets the rows first though last of the buffer of screen to spaces.
+ * Requires first <= last; first, last are rows of screen->buf.
*/
-register TScreen *screen;
-register int first, last;
+void
+ClearBufRows (
+ register TScreen *screen,
+ register int first,
+ register int last)
{
ScrnBuf buf = screen->visbuf;
int len = screen->max_col + 1;
@@ -791,10 +798,11 @@
8. Returns 0
*/
int
-ScreenResize (screen, width, height, flags)
- register TScreen *screen;
- int width, height;
- unsigned *flags;
+ScreenResize (
+ register TScreen *screen,
+ int width,
+ int height,
+ unsigned *flags)
{
int code;
int rows, cols;
@@ -959,35 +967,31 @@
}
void
-ScrnClrWrapped(screen, row)
- TScreen *screen;
- int row;
+ScrnClrWrapped(TScreen *screen, int row)
{
long value = (long)SCRN_BUF_FLAGS(screen, row + screen->topline) & ~ LINEWRAPPED;
SCRN_BUF_FLAGS(screen, row + screen->topline) = (Char *)value;
}
void
-ScrnSetWrapped(screen, row)
- TScreen *screen;
- int row;
+ScrnSetWrapped(TScreen *screen, int row)
{
long value = (long)SCRN_BUF_FLAGS(screen, row + screen->topline) | LINEWRAPPED;
SCRN_BUF_FLAGS(screen, row + screen->topline) = (Char *)value;
}
Bool
-ScrnTstWrapped(screen, row)
- TScreen *screen;
- int row;
+ScrnTstWrapped(TScreen *screen, int row)
{
return (long)SCRN_BUF_FLAGS(screen, row + screen->topline) & LINEWRAPPED;
}
Bool
-non_blank_line(sb, row, col, len)
-ScrnBuf sb;
-register int row, col, len;
+non_blank_line(
+ ScrnBuf sb,
+ register int row,
+ register int col,
+ register int len)
{
register int i;
register Char *ptr = BUF_CHARS(sb, row);
Index: util.c
--- xterm-77+/util.c Mon May 25 21:00:48 1998
+++ xterm-78/util.c Wed May 27 21:26:21 1998
@@ -45,12 +45,8 @@
static int ClearInLine (TScreen *screen, int row, int col, int len);
static int handle_translated_exposure (TScreen *screen, int rect_x, int rect_y, unsigned int rect_width, unsigned int rect_height);
-static void ClearAbove (TScreen *screen);
-static void ClearBelow (TScreen *screen);
static void ClearLeft (TScreen *screen);
-static void ClearLine (TScreen *screen);
static void CopyWait (TScreen *screen);
-static void copy_area (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 (TScreen *screen, int firstchar, int nchars, int amount);
static void vertical_copy_area (TScreen *screen, int firstline, int nlines, int amount);
@@ -58,8 +54,7 @@
* These routines are used for the jump scroll feature
*/
void
-FlushScroll(screen)
-register TScreen *screen;
+FlushScroll(register TScreen *screen)
{
register int i;
register int shift = -screen->topline;
@@ -137,8 +132,7 @@
}
int
-AddToRefresh(screen)
-register TScreen *screen;
+AddToRefresh(register TScreen *screen)
{
register int amount = screen->refresh_amt;
register int row = screen->cur_row;
@@ -172,9 +166,7 @@
* requires: amount > 0
*/
void
-Scroll(screen, amount)
-register TScreen *screen;
-register int amount;
+Scroll(register TScreen *screen, register int amount)
{
register int i = screen->bot_marg - screen->top_marg + 1;
register int shift;
@@ -275,9 +267,7 @@
* Requires: amount > 0
*/
void
-RevScroll(screen, amount)
-register TScreen *screen;
-register int amount;
+RevScroll(register TScreen *screen, register int amount)
{
register int i = screen->bot_marg - screen->top_marg + 1;
register int shift;
@@ -342,9 +332,7 @@
* bottom margin are lost.
*/
void
-InsertLine (screen, n)
-register TScreen *screen;
-register int n;
+InsertLine (register TScreen *screen, register int n)
{
register int i;
register int shift;
@@ -401,9 +389,7 @@
* at the cursor's position, lines added at bottom margin are blank.
*/
void
-DeleteLine(screen, n)
-register TScreen *screen;
-register int n;
+DeleteLine(register TScreen *screen, register int n)
{
register int i;
register int shift;
@@ -482,9 +468,7 @@
* Insert n blanks at the cursor's position, no wraparound
*/
void
-InsertChar (screen, n)
- register TScreen *screen;
- register int n;
+InsertChar (register TScreen *screen, register int n)
{
if(screen->cursor_state)
HideCursor();
@@ -526,9 +510,7 @@
* Deletes n chars at the cursor's position, no wraparound.
*/
void
-DeleteChar (screen, n)
- register TScreen *screen;
- register int n;
+DeleteChar (register TScreen *screen, register int n)
{
register int width;
@@ -569,8 +551,7 @@
* Clear from cursor position to beginning of display, inclusive.
*/
static void
-ClearAbove (screen)
-register TScreen *screen;
+ClearAbove (register TScreen *screen)
{
if (screen->protected_mode != OFF_PROTECT) {
register int row;
@@ -605,8 +586,7 @@
* Clear from cursor position to end of display, inclusive.
*/
static void
-ClearBelow (screen)
-register TScreen *screen;
+ClearBelow (register TScreen *screen)
{
ClearRight(screen, -1);
@@ -637,11 +617,7 @@
* protected characters were found, 0 otherwise.
*/
static int
-ClearInLine(screen, row, col, len)
- register TScreen *screen;
- int row;
- int col;
- int len;
+ClearInLine(register TScreen *screen, int row, int col, int len)
{
int rc = 1;
int flags = TERM_COLOR_FLAGS;
@@ -730,9 +706,7 @@
* position.
*/
void
-ClearRight (screen, n)
-register TScreen *screen;
-int n;
+ClearRight (register TScreen *screen, int n)
{
int len = (screen->max_col - screen->cur_col + 1);
@@ -754,8 +728,7 @@
* Clear first part of cursor's line, inclusive.
*/
static void
-ClearLeft (screen)
-register TScreen *screen;
+ClearLeft (register TScreen *screen)
{
(void) ClearInLine(screen, screen->cur_row, 0, screen->cur_col + 1);
}
@@ -764,15 +737,13 @@
* Erase the cursor's line.
*/
static void
-ClearLine(screen)
-register TScreen *screen;
+ClearLine(register TScreen *screen)
{
(void) ClearInLine(screen, screen->cur_row, 0, screen->max_col + 1);
}
void
-ClearScreen(screen)
-register TScreen *screen;
+ClearScreen(register TScreen *screen)
{
register int top;
@@ -797,10 +768,10 @@
* ignore the protected flags.
*/
void
-do_erase_line(screen, param, mode)
- register TScreen *screen;
- int param;
- int mode;
+do_erase_line(
+ register TScreen *screen,
+ int param,
+ int mode)
{
int saved_mode = screen->protected_mode;
@@ -830,10 +801,10 @@
* protected mode flag in the screen data (it's slower).
*/
void
-do_erase_display(screen, param, mode)
- register TScreen *screen;
- int param;
- int mode;
+do_erase_display(
+ register TScreen *screen,
+ int param,
+ int mode)
{
int saved_mode = screen->protected_mode;
@@ -886,8 +857,7 @@
}
static void
-CopyWait(screen)
-register TScreen *screen;
+CopyWait(register TScreen *screen)
{
XEvent reply;
XEvent *rep = &reply;
@@ -928,11 +898,14 @@
* used by vertical_copy_area and and horizontal_copy_area
*/
static void
-copy_area(screen, src_x, src_y, width, height, dest_x, dest_y)
- TScreen *screen;
- int src_x, src_y;
- unsigned int width, height;
- int dest_x, dest_y;
+copy_area(
+ TScreen *screen,
+ int src_x,
+ int src_y,
+ unsigned int width,
+ unsigned int height,
+ int dest_x,
+ int dest_y)
{
/* wait for previous CopyArea to complete unless
multiscroll is enabled and active */
@@ -958,11 +931,11 @@
* use when inserting or deleting characters on the current line
*/
static void
-horizontal_copy_area(screen, firstchar, nchars, amount)
- TScreen *screen;
- int firstchar; /* char pos on screen to start copying at */
- int nchars;
- int amount; /* number of characters to move right */
+horizontal_copy_area(
+ TScreen *screen,
+ int firstchar, /* char pos on screen to start copying at */
+ int nchars,
+ int amount) /* number of characters to move right */
{
int src_x = CurCursorX(screen, screen->cur_row, firstchar);
int src_y = CursorY(screen, screen->cur_row);
@@ -977,11 +950,11 @@
* use when inserting or deleting lines from the screen
*/
static void
-vertical_copy_area(screen, firstline, nlines, amount)
- TScreen *screen;
- int firstline; /* line on screen to start copying at */
- int nlines;
- int amount; /* number of lines to move up (neg=down) */
+vertical_copy_area(
+ TScreen *screen,
+ int firstline, /* line on screen to start copying at */
+ int nlines,
+ int amount) /* number of lines to move up (neg=down) */
{
if(nlines > 0) {
int src_x = OriginX(screen);
@@ -997,11 +970,11 @@
* 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 */
- int nlines;
- int amount; /* number of lines to move up (neg=down) */
+scrolling_copy_area(
+ TScreen *screen,
+ int firstline, /* line on screen to start copying at */
+ int nlines,
+ int amount) /* number of lines to move up (neg=down) */
{
if(nlines > 0) {
@@ -1014,9 +987,9 @@
* Returns 1 iff the area where the cursor was got refreshed.
*/
int
-HandleExposure (screen, event)
- register TScreen *screen;
- register XEvent *event;
+HandleExposure (
+ register TScreen *screen,
+ register XEvent *event)
{
register XExposeEvent *reply = (XExposeEvent *)event;
@@ -1067,10 +1040,12 @@
* The rectangle passed in is pixel coordinates.
*/
static int
-handle_translated_exposure (screen, rect_x, rect_y, rect_width, rect_height)
- register TScreen *screen;
- register int rect_x, rect_y;
- register unsigned int rect_width, rect_height;
+handle_translated_exposure (
+ register TScreen *screen,
+ register int rect_x,
+ register int rect_y,
+ register unsigned int rect_width,
+ register unsigned int rect_height)
{
register int toprow, leftcol, nrows, ncols;
@@ -1116,9 +1091,7 @@
/***====================================================================***/
void
-GetColors(tw,pColors)
- XtermWidget tw;
- ScrnColors *pColors;
+GetColors(XtermWidget tw, ScrnColors *pColors)
{
register TScreen *screen = &tw->screen;
@@ -1138,9 +1111,7 @@
}
void
-ChangeColors(tw,pNew)
- XtermWidget tw;
- ScrnColors *pNew;
+ChangeColors(XtermWidget tw, ScrnColors *pNew)
{
register TScreen *screen = &tw->screen;
Bool newCursor= TRUE;
@@ -1228,8 +1199,7 @@
#define EXCHANGE(a,b,tmp) tmp = a; a = b; b = tmp;
void
-ReverseVideo (termw)
- XtermWidget termw;
+ReverseVideo (XtermWidget termw)
{
register TScreen *screen = &termw->screen;
GC tmpGC;
@@ -1314,9 +1284,10 @@
}
void
-recolor_cursor (cursor, fg, bg)
- Cursor cursor; /* X cursor ID to set */
- unsigned long fg, bg; /* pixel indexes to look up */
+recolor_cursor (
+ Cursor cursor, /* X cursor ID to set */
+ unsigned long fg, /* pixel indexes to look up */
+ unsigned long bg) /* pixel indexes to look up */
{
register TScreen *screen = &term->screen;
register Display *dpy = screen->display;
@@ -1334,15 +1305,15 @@
* Draws text with the specified combination of bold/underline
*/
int
-drawXtermText(screen, flags, gc, x, y, chrset, text, len)
- register TScreen *screen;
- unsigned flags;
- GC gc;
- int x;
- int y;
- int chrset;
- Char *text;
- int len;
+drawXtermText(
+ register TScreen *screen,
+ unsigned flags,
+ GC gc,
+ int x,
+ int y,
+ int chrset,
+ Char *text,
+ int len)
{
#if OPT_DEC_CHRSET
if (CSET_DOUBLE(chrset)) {
@@ -1428,11 +1399,11 @@
* current screen foreground and background colors.
*/
GC
-updatedXtermGC(screen, flags, fg_bg, hilite)
- register TScreen *screen;
- int flags;
- int fg_bg;
- Bool hilite;
+updatedXtermGC(
+ register TScreen *screen,
+ int flags,
+ int fg_bg,
+ Bool hilite)
{
Pixel fg_pix = getXtermForeground(flags,extract_fg(fg_bg,flags));
Pixel bg_pix = getXtermBackground(flags,extract_bg(fg_bg));
@@ -1477,10 +1448,10 @@
* duplicates some logic, but only modifies 1/4 as many GC's.
*/
void
-resetXtermGC(screen, flags, hilite)
- register TScreen *screen;
- int flags;
- Bool hilite;
+resetXtermGC(
+ register TScreen *screen,
+ int flags,
+ Bool hilite)
{
Pixel fg_pix = getXtermForeground(flags,term->cur_foreground);
Pixel bg_pix = getXtermBackground(flags,term->cur_background);
@@ -1513,9 +1484,9 @@
* BOLD or UNDERLINE color-mode active, those will be used.
*/
int
-extract_fg (color, flags)
- unsigned color;
- unsigned flags;
+extract_fg (
+ unsigned color,
+ unsigned flags)
{
int fg = (int) ((color >> 4) & 0xf);
@@ -1532,8 +1503,7 @@
}
int
-extract_bg (color)
- unsigned color;
+extract_bg (unsigned color)
{
return (int) (color & 0xf);
}
@@ -1548,9 +1518,7 @@
* attribute colors.
*/
unsigned
-makeColorPair (fg, bg)
- int fg;
- int bg;
+makeColorPair (int fg, int bg)
{
unsigned my_bg = (bg >= 0) && (bg < 16) ? bg : 0;
unsigned my_fg = (fg >= 0) && (fg < 16) ? fg : my_bg;
@@ -1558,16 +1526,14 @@
}
unsigned
-xtermColorPair ()
+xtermColorPair (void)
{
/* FIXME? */
return makeColorPair(term->sgr_foreground, term->cur_background);
}
Pixel
-getXtermForeground(flags, color)
- int flags;
- int color;
+getXtermForeground(int flags, int color)
{
Pixel fg = (flags & FG_COLOR) && (color >= 0)
? term->screen.Acolors[color]
@@ -1577,9 +1543,7 @@
}
Pixel
-getXtermBackground(flags, color)
- int flags;
- int color;
+getXtermBackground(int flags, int color)
{
Pixel bg = (flags & BG_COLOR) && (color >= 0)
? term->screen.Acolors[color]
@@ -1594,8 +1558,7 @@
* in the current SGR background. Otherwise, reset to the window's default
* background.
*/
-void useCurBackground(flag)
- Bool flag;
+void useCurBackground(Bool flag)
{
TScreen *screen = &term->screen;
int color = flag ? term->cur_background : -1;
@@ -1607,12 +1570,12 @@
/*
* Using the "current" SGR background, clear a rectangle.
*/
-void ClearCurBackground(screen, top,left, height,width)
- register TScreen *screen;
- int top;
- int left;
- unsigned height;
- unsigned width;
+void ClearCurBackground(
+ register TScreen *screen,
+ int top,
+ int left,
+ unsigned height,
+ unsigned width)
{
useCurBackground(TRUE);
XClearArea (screen->display, TextWindow(screen),
@@ -1623,9 +1586,7 @@
#if OPT_DEC_CHRSET
int
-getXtermChrSet(row, col)
- int row;
- int col;
+getXtermChrSet(int row, int col)
{
TScreen *screen = &term->screen;
Char set = SCRN_BUF_CSETS(screen, row)[0];
@@ -1635,8 +1596,7 @@
}
int
-curXtermChrSet(row)
- int row;
+curXtermChrSet(int row)
{
TScreen *screen = &term->screen;
Char set = SCRN_BUF_CSETS(screen, row)[0];
@@ -1648,10 +1608,7 @@
#ifdef HAVE_CONFIG_H
#if USE_MY_MEMMOVE
-char * my_memmove(s1, s2, n)
- char * s1;
- char * s2;
- size_t n;
+char * my_memmove(char * s1, char * s2, size_t n)
{
if (n != 0) {
if ((s1+n > s2) && (s2+n > s1)) {
@@ -1676,7 +1633,7 @@
#endif /* USE_MY_MEMMOVE */
#if !HAVE_STRERROR
-char *my_strerror(n)
+char *my_strerror(int n)
{
extern char *sys_errlist[];
extern int sys_nerr;
Index: version.h
--- xterm-77+/version.h Mon May 25 20:07:18 1998
+++ xterm-78/version.h Thu May 28 05:36:47 1998
@@ -6,4 +6,4 @@
* version of xterm has been built. The number in parentheses is my patch
* number (T.Dickey).
*/
-#define XTERM_VERSION "XFree86 3.9Ah(77)"
+#define XTERM_VERSION "XFree86 3.9Ah(78)"
Index: xterm.log.html
--- xterm-77+/xterm.log.html Tue May 26 06:45:26 1998
+++ xterm-78/xterm.log.html Wed Jun 3 21:18:00 1998
@@ -41,6 +41,7 @@
xc/programs/Xserver/hw/xfree86).
<UL>
+<LI><A HREF="#xterm_78">Patch #78 - 1998/6/3 - XFree86 3.9Ah and 3.3.2</A>
<LI><A HREF="#xterm_77">Patch #77 - 1998/5/26 - XFree86 3.9Ah and 3.3.2</A>
<LI><A HREF="#xterm_76">Patch #76 - 1998/5/8 - XFree86 3.9Ah and 3.3.2</A>
<LI><A HREF="#xterm_75">Patch #75 - 1998/5/7 - XFree86 3.9Ah and 3.3.2</A>
@@ -119,6 +120,16 @@
<LI><A HREF="#xterm_02">Patch #2 - 1996/1/7</A>
<LI><A HREF="#xterm_01">Patch #1 - 1996/1/6</A>
</UL>
+
+<H1><A NAME="xterm_78">Patch #78 - 1998/6/3 - XFree86 3.9Ah and 3.3.2</A></H1>
+
+Again, most of the bulk of this patch is for ANSI conversion. I used the
+IRIX compiler's -wlint option to find the remaining functions that use
+K&R syntax (since gcc does not do this properly).
+
+Also, I changed the logic in the print code slightly to close unwanted files
+before opening a pipe to the printer. This may help in some configurations
+where the line printer hangs until xterm closes the pipe.
<H1><A NAME="xterm_77">Patch #77 - 1998/5/26 - XFree86 3.9Ah and 3.3.2</A></H1>