summaryrefslogtreecommitdiff
path: root/app/xterm/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/xterm/main.c')
-rw-r--r--app/xterm/main.c116
1 files changed, 13 insertions, 103 deletions
diff --git a/app/xterm/main.c b/app/xterm/main.c
index 661a11cb2..a1981af85 100644
--- a/app/xterm/main.c
+++ b/app/xterm/main.c
@@ -1,4 +1,4 @@
-/* $XTermId: main.c,v 1.923 2024/07/09 08:03:49 tom Exp $ */
+/* $XTermId: main.c,v 1.927 2024/09/30 08:03:20 tom Exp $ */
/*
* Copyright 2002-2023,2024 by Thomas E. Dickey
@@ -181,11 +181,6 @@ static GCC_NORETURN void HsSysError(int);
#endif
#endif
-#ifdef __MVS__
-#define USE_SYSV_PGRP
-#define USE_SYSV_SIGNALS
-#endif
-
#ifdef __CYGWIN__
#define WTMP
#endif
@@ -290,7 +285,6 @@ ttyslot(void)
#endif
#ifndef __linux__
-#ifndef VMS
#ifndef USE_POSIX_TERMIOS
#ifndef USE_ANY_SYSV_TERMIO
#include <sgtty.h>
@@ -301,7 +295,6 @@ ttyslot(void)
#else
#include <sys/resource.h>
#endif
-#endif /* !VMS */
#endif /* !__linux__ */
#endif /* __QNX__ */
@@ -313,7 +306,7 @@ ttyslot(void)
#ifndef NOFILE
#define NOFILE OPEN_MAX
#endif
-#elif !(defined(VMS) || defined(WIN32) || defined(Lynx) || defined(__GNU__) || defined(__MVS__))
+#elif !(defined(WIN32) || defined(Lynx) || defined(__GNU__))
#include <sys/param.h> /* for NOFILE */
#endif
@@ -468,7 +461,6 @@ extern char *ttyname();
extern char *ptsname(int);
#endif
-#ifndef VMS
static void reapchild(int /* n */ );
static int spawnXTerm(XtermWidget /* xw */
,unsigned /* line_speed */ );
@@ -476,7 +468,6 @@ static void remove_termcap_entry(char *, const char *);
#ifdef USE_PTY_SEARCH
static int pty_search(int * /* pty */ );
#endif
-#endif /* ! VMS */
static int get_pty(int *pty, char *from);
static void resize_termcap(XtermWidget xw);
@@ -596,7 +587,6 @@ static unsigned command_length_with_luit = 0;
#define CWERASE CONTROL('W')
#endif
-#ifndef VMS
#ifdef TERMIO_STRUCT
/* The following structures are initialized in main() in order
** to eliminate any assumptions about the internal order of their
@@ -650,7 +640,6 @@ static struct jtchars d_jtc =
};
#endif /* sony */
#endif /* TERMIO_STRUCT */
-#endif /* ! VMS */
/*
* SYSV has the termio.c_cc[V] and ltchars; BSD has tchars and ltchars;
@@ -898,6 +887,7 @@ static XtResource application_resources[] =
Ires(XtNminBufSize, XtCMinBufSize, minBufSize, 4096),
Ires(XtNmaxBufSize, XtCMaxBufSize, maxBufSize, 32768),
Sres(XtNmenuLocale, XtCMenuLocale, menuLocale, DEF_MENU_LOCALE),
+ Bres(XtNnotMapped, XtCNotMapped, notMapped, False),
Sres(XtNomitTranslation, XtCOmitTranslation, omitTranslation, NULL),
Sres(XtNkeyboardType, XtCKeyboardType, keyboardType, "unknown"),
#ifdef HAVE_LIB_XCURSOR
@@ -1098,6 +1088,8 @@ OPTS("-mesg", NO_ARG(XtNmessages), "off"),
OPTS("+mesg", NO_ARG(XtNmessages), "on"),
OPTS("-ms", MY_ARG(XtNpointerColor), NULL),
OPTS("-nb", MY_ARG(XtNnMarginBell), NULL),
+OPTS("-nomap", NO_ARG(XtNnotMapped), "on"),
+OPTS("+nomap", NO_ARG(XtNnotMapped), "off"),
OPTS("-nul", NO_ARG(XtNunderLine), "off"),
OPTS("+nul", NO_ARG(XtNunderLine), "on"),
OPTS("-pc", NO_ARG(XtNboldColors), "on"),
@@ -1309,6 +1301,7 @@ static OptionHelp xtermOptions[] = {
{ "-/+mesg", "forbid/allow messages" },
{ "-ms color", "pointer color" },
{ "-nb number", "margin bell in characters from right end" },
+{ "-/+nomap", "turn off/on initial mapping of window" },
{ "-/+nul", "turn off/on display of underlining" },
{ "-/+aw", "turn on/off auto wraparound" },
{ "-/+pc", "turn on/off PC-style bold colors" },
@@ -1576,7 +1569,7 @@ decode_keyvalue(char **ptr, int termcap)
if (*string == '^') {
switch (*++string) {
case '?':
- value = A2E(ANSI_DEL);
+ value = ANSI_DEL;
break;
case '-':
if (!termcap) {
@@ -2167,12 +2160,7 @@ setEffectiveGroup(gid_t group)
{
TRACE(("process %d setEffectiveGroup(%d)\n", (int) getpid(), (int) group));
if (setegid(group) == -1) {
-#ifdef __MVS__
- if (!(errno == EMVSERR)) /* could happen if _BPX_SHAREAS=REUSE */
-#endif
- {
- xtermPerror("setegid(%d)", (int) group);
- }
+ xtermPerror("setegid(%d)", (int) group);
}
TRACE_IDS;
}
@@ -2184,12 +2172,7 @@ setEffectiveUser(uid_t user)
{
TRACE(("process %d setEffectiveUser(%d)\n", (int) getpid(), (int) user));
if (seteuid(user) == -1) {
-#ifdef __MVS__
- if (!(errno == EMVSERR))
-#endif
- {
- xtermPerror("seteuid(%d)", (int) user);
- }
+ xtermPerror("seteuid(%d)", (int) user);
}
TRACE_IDS;
}
@@ -2604,9 +2587,6 @@ main(int argc, char *argv[]ENVP_ARG)
d_tio.c_cflag &= ~(HUPCL | PARENB);
d_tio.c_iflag |= BRKINT | ISTRIP | IGNPAR;
#endif
-#ifdef __MVS__
- d_tio.c_cflag &= ~(HUPCL | PARENB);
-#endif
{
Cardinal nn;
int i;
@@ -2755,13 +2735,9 @@ main(int argc, char *argv[]ENVP_ARG)
TRACE_ARGV("After XtOpenApplication", argv);
for (argc--, argv++; argc > 0; argc--, argv++) {
if (!isOption(*argv)) {
-#ifdef VMS
- Syntax(*argv);
-#else
if (argc > 1)
Syntax(*argv);
continue;
-#endif
}
TRACE(("parsing %s\n", argv[0]));
@@ -2980,7 +2956,6 @@ main(int argc, char *argv[]ENVP_ARG)
setresgid(save_rgid, save_rgid, save_rgid);
save_egid = -1;
-#ifndef VMS
/* Child process is out there, let's catch its termination */
#ifdef USE_POSIX_SIGNALS
@@ -3017,7 +2992,7 @@ main(int argc, char *argv[]ENVP_ARG)
}
#endif
#endif
-#if defined(USE_ANY_SYSV_TERMIO) || defined(__MVS__) || defined(__minix)
+#if defined(USE_ANY_SYSV_TERMIO) || defined(__minix)
if (0 > (mode = fcntl(screen->respond, F_GETFL, 0)))
SysError(ERROR_F_GETFL);
#ifdef O_NDELAY
@@ -3054,7 +3029,6 @@ main(int argc, char *argv[]ENVP_ARG)
? (1 + ConnectionNumber(screen->display))
: (1 + screen->respond));
-#endif /* !VMS */
if_DEBUG({
TRACE(("debugging on pid %d\n", (int) getpid()));
});
@@ -3235,11 +3209,7 @@ get_pty(int *pty, char *from GCC_UNUSED)
result = pty_search(pty);
#else
#if defined(USE_USG_PTYS) || defined(__CYGWIN__)
-#if defined(__MVS__)
- result = pty_search(pty);
-#else
result = ((*pty = open("/dev/ptmx", O_RDWR)) < 0);
-#endif
#if defined(SVR4) || defined(__SCO__)
if (!result)
strcpy(ttydev, ptsname(*pty));
@@ -3392,7 +3362,7 @@ pty_search(int *pty)
{
static int devindex = 0, letter = 0;
-#if defined(CRAY) || defined(__MVS__)
+#if defined(CRAY)
while (devindex < MAXPTTYS) {
sprintf(ttydev, TTYFORMAT, devindex);
sprintf(ptydev, PTYFORMAT, devindex);
@@ -3403,7 +3373,7 @@ pty_search(int *pty)
return 0;
}
}
-#else /* CRAY || __MVS__ */
+#else /* CRAY */
while (PTYCHAR1[letter]) {
ttydev[strlen(ttydev) - 2] =
ptydev[strlen(ptydev) - 2] = PTYCHAR1[letter];
@@ -3648,7 +3618,6 @@ HsSysError(int error)
}
#endif /* OPT_PTY_HANDSHAKE else !OPT_PTY_HANDSHAKE */
-#ifndef VMS
static void
set_owner(char *device, unsigned uid, unsigned gid, unsigned mode)
{
@@ -4048,9 +4017,6 @@ spawnXTerm(XtermWidget xw, unsigned line_speed)
#ifdef TERMIO_STRUCT
TERMIO_STRUCT tio;
-#ifdef __MVS__
- TERMIO_STRUCT gio;
-#endif /* __MVS__ */
#ifdef TIOCLSET
unsigned lmode;
#endif /* TIOCLSET */
@@ -4254,13 +4220,6 @@ spawnXTerm(XtermWidget xw, unsigned line_speed)
initial_erase));
}
#endif
-#ifdef __MVS__
- if (ttyGetAttr(ttyfd, &gio) == 0) {
- gio.c_cflag &= ~(HUPCL | PARENB);
- ttySetAttr(ttyfd, &gio);
- }
-#endif /* __MVS__ */
-
close_fd(ttyfd);
}
@@ -4489,9 +4448,7 @@ spawnXTerm(XtermWidget xw, unsigned line_speed)
#endif /* SVR4 */
#endif /* I_PUSH */
ttyfd = ptyfd;
-#ifndef __MVS__
close_fd(screen->respond);
-#endif /* __MVS__ */
#ifdef TTYSIZE_STRUCT
/* tell tty how big window is */
@@ -4540,10 +4497,8 @@ spawnXTerm(XtermWidget xw, unsigned line_speed)
/* we don't need the socket, or the pty master anymore */
close(ConnectionNumber(screen->display));
-#ifndef __MVS__
if (screen->respond >= 0)
close(screen->respond);
-#endif /* __MVS__ */
/* Now is the time to set up our process group and
* open up the pty slave.
@@ -4560,14 +4515,7 @@ spawnXTerm(XtermWidget xw, unsigned line_speed)
qsetlogin(getlogin(), ttydev);
#endif
if (ttyfd >= 0) {
-#ifdef __MVS__
- if (ttyGetAttr(ttyfd, &gio) == 0) {
- gio.c_cflag &= ~(HUPCL | PARENB);
- ttySetAttr(ttyfd, &gio);
- }
-#else /* !__MVS__ */
close_fd(ttyfd);
-#endif /* __MVS__ */
}
for (;;) {
@@ -4713,10 +4661,6 @@ spawnXTerm(XtermWidget xw, unsigned line_speed)
#else /* USE_POSIX_TERMIOS */
cfsetispeed(&tio, line_speed);
cfsetospeed(&tio, line_speed);
-#ifdef __MVS__
- /* turn off bits that can't be set from the slave side */
- tio.c_cflag &= ~(PACKET | PKT3270 | PTU3270 | PKTXTND);
-#endif /* __MVS__ */
/* Clear CLOCAL so that SIGHUP is sent to us
when the xterm ends */
tio.c_cflag &= (unsigned) ~CLOCAL;
@@ -4734,15 +4678,6 @@ spawnXTerm(XtermWidget xw, unsigned line_speed)
for (nn = 0; nn < XtNumber(ttyChars); ++nn) {
if (validTtyChar(tio, nn)) {
int sysMode = ttyChars[nn].sysMode;
-#ifdef __MVS__
- if (tio.c_cc[sysMode] != 0) {
- switch (sysMode) {
- case VEOL:
- case VEOF:
- continue;
- }
- }
-#endif
tio.c_cc[sysMode] = (cc_t) ttyChars[nn].myDefault;
}
}
@@ -5878,8 +5813,6 @@ resize_termcap(XtermWidget xw)
#endif /* USE_SYSV_ENVVARS */
}
-#endif /* ! VMS */
-
/*
* Does a non-blocking wait for a child process. If the system
* doesn't support non-blocking wait, do nothing.
@@ -5908,8 +5841,6 @@ nonblocking_wait(void)
return pid;
}
-#ifndef VMS
-
/* ARGSUSED */
static void
reapchild(int n GCC_UNUSED)
@@ -5940,7 +5871,6 @@ reapchild(int n GCC_UNUSED)
errno = olderrno;
}
-#endif /* !VMS */
static void
remove_termcap_entry(char *buf, const char *str)
@@ -6080,7 +6010,7 @@ GetBytesAvailable(Display *dpy)
#endif
return result;
}
-#endif /* !VMS */
+#endif /* !GetBytesAvailable */
/* Utility function to try to hide system differences from
everybody who used to call killpg() */
@@ -6096,26 +6026,6 @@ kill_process_group(int pid, int sig)
#endif
}
-#if OPT_EBCDIC
-int
-A2E(int x)
-{
- char c;
- c = x;
- __atoe_l(&c, 1);
- return c;
-}
-
-int
-E2A(int x)
-{
- char c;
- c = x;
- __etoa_l(&c, 1);
- return c;
-}
-#endif
-
#if defined(__QNX__) && !defined(__QNXNTO__)
#include <sys/types.h>
#include <sys/proc_msg.h>