summaryrefslogtreecommitdiff
path: root/xc/programs/xterm
diff options
context:
space:
mode:
authorhersh <empty>1993-09-20 17:39:18 +0000
committerhersh <empty>1993-09-20 17:39:18 +0000
commit381f4508af1eb6e41d628253e0ef1a4ca9fdf42a (patch)
tree1082b81931349ee550c4d3a242e3ffbabb2d2b22 /xc/programs/xterm
parent31cabffb611102f815fd6e74f2a3418a8c4a37f2 (diff)
ANSIfied for R6
Diffstat (limited to 'xc/programs/xterm')
-rw-r--r--xc/programs/xterm/button.c8
-rw-r--r--xc/programs/xterm/charproc.c14
-rw-r--r--xc/programs/xterm/cursor.c6
-rw-r--r--xc/programs/xterm/main.c25
-rw-r--r--xc/programs/xterm/misc.c7
-rw-r--r--xc/programs/xterm/resize.c12
-rw-r--r--xc/programs/xterm/screen.c26
-rw-r--r--xc/programs/xterm/scrollbar.c4
8 files changed, 49 insertions, 53 deletions
diff --git a/xc/programs/xterm/button.c b/xc/programs/xterm/button.c
index 0bff1a185..c6218e5b6 100644
--- a/xc/programs/xterm/button.c
+++ b/xc/programs/xterm/button.c
@@ -1,4 +1,4 @@
-/* $XConsortium: button.c,v 1.66 91/05/31 17:00:03 gildea Exp $ */
+/* $XConsortium: button.c,v 1.67 93/09/11 14:39:49 rws Exp $ */
/*
* Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
*
@@ -1140,7 +1140,7 @@ int *format;
*targetP++ = XA_COMPOUND_TEXT(d);
*targetP++ = XA_LENGTH(d);
*targetP++ = XA_LIST_LENGTH(d);
- bcopy((char*)std_targets, (char*)targetP, sizeof(Atom)*std_length);
+ memmove( (char*)targetP, (char*)std_targets, sizeof(Atom)*std_length);
XtFree((char*)std_targets);
*type = XA_ATOM;
*format = 32;
@@ -1165,7 +1165,7 @@ int *format;
*(long*)*value = 1;
else {
long temp = 1;
- bcopy( ((char*)&temp)+sizeof(long)-4, (char*)*value, 4);
+ memmove( (char*)*value, ((char*)&temp)+sizeof(long)-4, 4);
}
*type = XA_INTEGER;
*length = 1;
@@ -1178,7 +1178,7 @@ int *format;
*(long*)*value = xterm->screen.selection_length;
else {
long temp = xterm->screen.selection_length;
- bcopy( ((char*)&temp)+sizeof(long)-4, (char*)*value, 4);
+ memmove( (char*)*value, ((char*)&temp)+sizeof(long)-4, 4);
}
*type = XA_INTEGER;
*length = 1;
diff --git a/xc/programs/xterm/charproc.c b/xc/programs/xterm/charproc.c
index 9d04900d9..daaab6c29 100644
--- a/xc/programs/xterm/charproc.c
+++ b/xc/programs/xterm/charproc.c
@@ -1,5 +1,5 @@
/*
- * $XConsortium: charproc.c,v 1.177 92/09/15 15:28:42 gildea Exp $
+ * $XConsortium: charproc.c,v 1.178 93/02/25 17:19:24 gildea Exp $
*/
/*
@@ -1174,13 +1174,13 @@ v_write(f, d, len)
if (v_bufend < v_bufptr + len) { /* we've run out of room */
if (v_bufstr != v_buffer) {
/* there is unused space, move everything down */
- /* possibly overlapping bcopy here */
+ /* possibly overlapping memmove here */
#ifdef DEBUG
if (debug)
fprintf(stderr, "moving data down %d\n",
v_bufstr - v_buffer);
#endif
- bcopy(v_bufstr, v_buffer, v_bufptr - v_bufstr);
+ memmove( v_buffer, v_bufstr, v_bufptr - v_bufstr);
v_bufptr -= v_bufstr - v_buffer;
v_bufstr = v_buffer;
}
@@ -1209,7 +1209,7 @@ v_write(f, d, len)
}
if (v_bufend >= v_bufptr + len) {
/* new stuff will fit */
- bcopy(d, v_bufptr, len);
+ memmove( v_bufptr, d, len);
v_bufptr += len;
}
}
@@ -2049,10 +2049,10 @@ SwitchBufPtrs(screen)
register int rows = screen->max_row + 1;
char *save [2 * MAX_ROWS];
- bcopy((char *)screen->buf, (char *)save, 2 * sizeof(char *) * rows);
- bcopy((char *)screen->altbuf, (char *)screen->buf,
+ memmove( (char *)save, (char *)screen->buf, 2 * sizeof(char *) * rows);
+ memmove( (char *)screen->buf, (char *)screen->altbuf,
2 * sizeof(char *) * rows);
- bcopy((char *)save, (char *)screen->altbuf, 2 * sizeof(char *) * rows);
+ memmove( (char *)screen->altbuf, (char *)save, 2 * sizeof(char *) * rows);
}
VTRun()
diff --git a/xc/programs/xterm/cursor.c b/xc/programs/xterm/cursor.c
index 2d811930e..67c4b68df 100644
--- a/xc/programs/xterm/cursor.c
+++ b/xc/programs/xterm/cursor.c
@@ -1,5 +1,5 @@
/*
- * $XConsortium: cursor.c,v 1.12 91/04/22 13:43:56 gildea Exp $
+ * $XConsortium: cursor.c,v 1.13 91/05/10 16:57:14 gildea Exp $
*/
/*
@@ -222,7 +222,7 @@ register SavedCursor *sc;
sc->flags = term->flags;
sc->curgl = screen->curgl;
sc->curgr = screen->curgr;
- bcopy(screen->gsets, sc->gsets, sizeof(screen->gsets));
+ memmove( sc->gsets, screen->gsets, sizeof(screen->gsets));
}
/*
@@ -234,7 +234,7 @@ register SavedCursor *sc;
{
register TScreen *screen = &term->screen;
- bcopy(sc->gsets, screen->gsets, sizeof(screen->gsets));
+ memmove( screen->gsets, sc->gsets, sizeof(screen->gsets));
screen->curgl = sc->curgl;
screen->curgr = sc->curgr;
term->flags &= ~(BOLD|INVERSE|UNDERLINE|ORIGIN);
diff --git a/xc/programs/xterm/main.c b/xc/programs/xterm/main.c
index f4f274300..f931556f5 100644
--- a/xc/programs/xterm/main.c
+++ b/xc/programs/xterm/main.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char *rid="$XConsortium: main.c,v 1.205 93/02/10 14:37:11 gildea Exp $";
+static char *rid="$XConsortium: main.c,v 1.206 93/02/25 17:04:02 gildea Exp $";
#endif /* lint */
/*
@@ -172,6 +172,10 @@ static Bool IsPts = False;
#include <errno.h>
#include <setjmp.h>
+#ifdef X_NOT_STDC_ENV
+extern int errno;
+#endif
+
#ifdef hpux
#include <sys/utsname.h>
#endif /* hpux */
@@ -255,10 +259,6 @@ extern void exit();
#ifdef X_NOT_POSIX
extern char *ttyname();
#endif
-#if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */
-char *malloc(), *realloc(), *calloc();
-char *ttyname(); /* and we don't get this from unistd.h */
-#endif /* macII */
#ifdef SYSV
extern char *ptsname();
@@ -1172,7 +1172,7 @@ char *name;
{
register char *cp;
- cp = rindex(name, '/');
+ cp = strrchr(name, '/');
return(cp ? cp + 1 : name);
}
@@ -2142,7 +2142,7 @@ spawn ()
envsize += 1; /* TERMCAP */
#endif /* USE_SYSV_ENVVARS */
envnew = (char **) calloc ((unsigned) i + envsize, sizeof(char *));
- bcopy((char *)environ, (char *)envnew, i * sizeof(char *));
+ memmove( (char *)envnew, (char *)environ, i * sizeof(char *));
environ = envnew;
Setenv ("TERM=", TermName);
if(!TermName)
@@ -2245,7 +2245,7 @@ spawn ()
(void) strncpy(buf, DisplayString(screen->display),
sizeof(buf));
{
- char *disfin = rindex(buf, ':');
+ char *disfin = strrchr(buf, ':');
if (disfin)
*disfin = '\0';
}
@@ -2467,7 +2467,7 @@ spawn ()
*(ptr = pw->pw_shell) == 0))
#endif /* UTMP */
ptr = "/bin/sh";
- if(shname = rindex(ptr, '/'))
+ if(shname = strrchr(ptr, '/'))
shname++;
else
shname = ptr;
@@ -2752,12 +2752,12 @@ register char *oldtc, *newtc;
sprintf (newtc, "%d", li_first ? screen->max_row + 1 :
screen->max_col + 1);
newtc += strlen(newtc);
- ptr1 = index (ptr1, ':');
+ ptr1 = strchr(ptr1, ':');
strncpy (newtc, ptr1, i = ptr2 - ptr1);
newtc += i;
sprintf (newtc, "%d", li_first ? screen->max_col + 1 :
screen->max_row + 1);
- ptr2 = index (ptr2, ':');
+ ptr2 = strchr(ptr2, ':');
strcat (newtc, ptr2);
#endif /* USE_SYSV_ENVVARS */
}
@@ -2819,7 +2819,6 @@ static SIGNAL_T reapchild (n)
consolepr(fmt,x0,x1,x2,x3,x4,x5,x6,x7,x8,x9)
char *fmt;
{
- extern int errno;
extern char *SysErrorMsg();
int oerrno;
int f;
@@ -2851,7 +2850,7 @@ remove_termcap_entry (buf, str)
strinbuf = strindex (buf, str);
if (strinbuf) {
- register char *colonPtr = index (strinbuf+1, ':');
+ register char *colonPtr = strchr(strinbuf+1, ':');
if (colonPtr) {
while (*colonPtr) {
*strinbuf++ = *colonPtr++; /* copy down */
diff --git a/xc/programs/xterm/misc.c b/xc/programs/xterm/misc.c
index 160256519..a9eb5f103 100644
--- a/xc/programs/xterm/misc.c
+++ b/xc/programs/xterm/misc.c
@@ -1,5 +1,5 @@
/*
- * $XConsortium: misc.c,v 1.94 93/02/08 16:51:01 gildea Exp $
+ * $XConsortium: misc.c,v 1.95 93/02/25 17:02:37 gildea Exp $
*/
/*
@@ -56,9 +56,6 @@ extern jmp_buf VTend;
extern char *malloc();
extern char *getenv();
#endif
-#if defined(macII) && !defined(__STDC__) /* stdlib.h fails to define these */
-char *malloc();
-#endif /* macII */
extern int child_wait();
@@ -860,7 +857,7 @@ register char *s1, *s2;
register char *s3;
int s2len = strlen (s2);
- while ((s3=index(s1, *s2)) != NULL) {
+ while ((s3=strchr(s1, *s2)) != NULL) {
if (strncmp(s3, s2, s2len) == 0)
return (s3);
s1 = ++s3;
diff --git a/xc/programs/xterm/resize.c b/xc/programs/xterm/resize.c
index af34720a2..91a9c0f7e 100644
--- a/xc/programs/xterm/resize.c
+++ b/xc/programs/xterm/resize.c
@@ -1,5 +1,5 @@
/*
- * $XConsortium: resize.c,v 1.27 91/07/23 11:11:19 rws Exp $
+ * $XConsortium: resize.c,v 1.28 93/07/02 17:26:29 rws Exp $
*/
/*
@@ -209,7 +209,7 @@ main (argc, argv)
extern char *ttyname();
#endif
- ptr = rindex(myname = argv[0], '/');
+ ptr = strrchr(myname = argv[0], '/');
if(ptr)
myname = ptr + 1;
if(strcmp(myname, sunname) == 0)
@@ -242,7 +242,7 @@ main (argc, argv)
/* this is the same default that xterm uses */
ptr = "/bin/sh";
- shell = rindex(ptr, '/');
+ shell = strrchr(ptr, '/');
if(shell)
shell++;
else
@@ -394,7 +394,7 @@ main (argc, argv)
i = ptr - termcap + 3;
strncpy (newtc, termcap, i);
sprintf (newtc + i, "%d", cols);
- ptr = index (ptr, ':');
+ ptr = strchr(ptr, ':');
strcat (newtc, ptr);
/* now do lines */
@@ -406,7 +406,7 @@ main (argc, argv)
i = ptr - newtc + 3;
strncpy (termcap, newtc, i);
sprintf (termcap + i, "%d", rows);
- ptr = index (ptr, ':');
+ ptr = strchr(ptr, ':');
strcat (termcap, ptr);
#endif /* USE_TERMCAP */
@@ -447,7 +447,7 @@ register char *s1, *s2;
register char *s3;
int s2len = strlen (s2);
- while ((s3 = index (s1, *s2)) != NULL)
+ while ((s3 = strchr(s1, *s2)) != NULL)
{
if (strncmp (s3, s2, s2len) == 0) return (s3);
s1 = ++s3;
diff --git a/xc/programs/xterm/screen.c b/xc/programs/xterm/screen.c
index 4eaec370f..695719dbb 100644
--- a/xc/programs/xterm/screen.c
+++ b/xc/programs/xterm/screen.c
@@ -1,5 +1,5 @@
/*
- * $XConsortium: screen.c,v 1.30 91/08/22 16:27:13 gildea Exp $
+ * $XConsortium: screen.c,v 1.31 93/07/02 17:26:02 rws Exp $
*/
/*
@@ -117,8 +117,8 @@ Reallocate(sbuf, sbufaddr, nrow, ncol, oldrow, oldcol)
- 2*(term->screen.max_row - term->screen.cur_row);
if (move_up < 0)
move_up = 0;
- /* Overlapping bcopy here! */
- bcopy(*sbuf+move_up, *sbuf,
+ /* Overlapping memmove here! */
+ memmove( *sbuf, *sbuf+move_up,
(oldrow-move_up)*sizeof((*sbuf)[0]) );
}
*sbuf = (ScrnBuf) realloc((char *) (*sbuf),
@@ -142,7 +142,7 @@ Reallocate(sbuf, sbufaddr, nrow, ncol, oldrow, oldcol)
tmp += ncol*move_down;
}
for (i = 0; i < minrows; i++, tmp += ncol) {
- bcopy(base[i], tmp, mincols);
+ memmove( tmp, base[i], mincols);
}
/*
* update the pointers in sbuf
@@ -179,7 +179,7 @@ register int length; /* length of string */
attrs = screen->buf[avail + 1] + screen->cur_col;
flags &= ATTRIBUTES;
flags |= CHARDRAWN;
- bcopy(str, col, length);
+ memmove( col, str, length);
while(length-- > 0)
*attrs++ = flags;
}
@@ -200,7 +200,7 @@ register int where, n, size;
/* save n lines at bottom */
- bcopy ((char *) &sb [2 * (last -= n - 1)], (char *) save,
+ memmove( (char *) save, (char *) &sb [2 * (last -= n - 1)],
2 * sizeof (char *) * n);
/* clear contents of old rows */
@@ -216,11 +216,11 @@ register int where, n, size;
*
* +--------|---------|----+
*/
- bcopy ((char *) &sb [2 * where], (char *) &sb [2 * (where + n)],
+ memmove( (char *) &sb [2 * (where + n)], (char *) &sb [2 * where],
2 * sizeof (char *) * (last - where));
/* reuse storage for new lines at where */
- bcopy ((char *)save, (char *) &sb[2 * where], 2 * sizeof(char *) * n);
+ memmove( (char *) &sb[2 * where], (char *)save, 2 * sizeof(char *) * n);
}
@@ -239,18 +239,18 @@ int where;
char *save [2 * MAX_ROWS];
/* save n lines at where */
- bcopy ((char *) &sb[2 * where], (char *)save, 2 * sizeof(char *) * n);
+ memmove( (char *)save, (char *) &sb[2 * where], 2 * sizeof(char *) * n);
/* clear contents of old rows */
for (i = 2 * n - 1 ; i >= 0 ; i--)
bzero ((char *) save [i], size);
/* move up lines */
- bcopy ((char *) &sb[2 * (where + n)], (char *) &sb[2 * where],
+ memmove( (char *) &sb[2 * where], (char *) &sb[2 * (where + n)],
2 * sizeof (char *) * ((last -= n - 1) - where));
/* reuse storage for new bottom lines */
- bcopy ((char *)save, (char *) &sb[2 * last],
+ memmove( (char *) &sb[2 * last], (char *)save,
2 * sizeof(char *) * n);
}
@@ -297,8 +297,8 @@ ScrnDeleteChar (sb, row, col, n, size)
register nbytes = (size - n - col);
int wrappedbit = attrs[0]&LINEWRAPPED;
- bcopy (ptr + col + n, ptr + col, nbytes);
- bcopy (attrs + col + n, attrs + col, nbytes);
+ memmove( ptr + col, ptr + col + n, nbytes);
+ memmove( attrs + col, attrs + col + n, nbytes);
bzero (ptr + size - n, n);
bzero (attrs + size - n, n);
if (wrappedbit)
diff --git a/xc/programs/xterm/scrollbar.c b/xc/programs/xterm/scrollbar.c
index fcbd46b25..5187cbb21 100644
--- a/xc/programs/xterm/scrollbar.c
+++ b/xc/programs/xterm/scrollbar.c
@@ -1,5 +1,5 @@
/*
- * $XConsortium: scrollbar.c,v 1.41 91/05/22 15:20:07 gildea Exp $
+ * $XConsortium: scrollbar.c,v 1.42 91/10/21 14:27:54 eswu Exp $
*/
/*
@@ -342,7 +342,7 @@ ScrollBarOn (xw, init, doalloc)
== NULL)
Error (ERROR_SBRALLOC);
screen->buf = &screen->allbuf[2 * screen->savelines];
- bcopy ((char *)screen->allbuf, (char *)screen->buf,
+ memmove( (char *)screen->buf, (char *)screen->allbuf,
2 * (screen->max_row + 2) * sizeof (char *));
for(i = 2 * screen->savelines - 1 ; i >= 0 ; i--)
if((screen->allbuf[i] =