From 51f10d4b16b75176c9598bb67c022f222f671ff9 Mon Sep 17 00:00:00 2001 From: charnier Date: Mon, 18 Aug 1997 07:21:48 +0000 Subject: Add usage. Use /usr/share/misc/map3270 instead of /etc/map3270. --- usr.bin/tn3270/api/api_bsd.c | 6 +++++- usr.bin/tn3270/ascii/default.map | 2 +- usr.bin/tn3270/ascii/map3270.c | 4 ++-- usr.bin/tn3270/ascii/mset.c | 26 +++++++++++++++++--------- usr.bin/tn3270/mset/map3270.5 | 4 ++-- usr.bin/tn3270/mset/mset.1 | 32 ++++++++++++++++---------------- usr.bin/tn3270/tn3270/tn3270.1 | 39 ++++++++++++++++++++------------------- 7 files changed, 63 insertions(+), 50 deletions(-) (limited to 'usr.bin/tn3270') diff --git a/usr.bin/tn3270/api/api_bsd.c b/usr.bin/tn3270/api/api_bsd.c index 46db372..7a884e8 100644 --- a/usr.bin/tn3270/api/api_bsd.c +++ b/usr.bin/tn3270/api/api_bsd.c @@ -32,7 +32,11 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)api_bsd.c 8.2 (Berkeley) 1/7/94"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ #if defined(unix) @@ -68,7 +72,7 @@ char *string; /* if non-zero, where to connect to */ struct hostent *hp; struct storage_descriptor sd; extern char *getenv(); - char thehostname[100]; + char thehostname[MAXHOSTNAMELEN]; char keyname[100]; char inkey[100]; FILE *keyfile; diff --git a/usr.bin/tn3270/ascii/default.map b/usr.bin/tn3270/ascii/default.map index a4cf6e1..f4ea6fd 100644 --- a/usr.bin/tn3270/ascii/default.map +++ b/usr.bin/tn3270/ascii/default.map @@ -35,7 +35,7 @@ /* default.map3270: This file is the system default for the key sequence * if neither the user's TERM nor "unknown" are found in either of - * MAP3270 or /etc/map3270. + * MAP3270 or /usr/share/misc/map3270. * * */ diff --git a/usr.bin/tn3270/ascii/map3270.c b/usr.bin/tn3270/ascii/map3270.c index 9ae1b2a..f076d16 100644 --- a/usr.bin/tn3270/ascii/map3270.c +++ b/usr.bin/tn3270/ascii/map3270.c @@ -907,7 +907,7 @@ int (*translator)(); /* Translates ascii string to integer */ GotIt = Position(environPointer, keybdPointer); } if (!GotIt) { - GotIt = Position("/etc/map3270", keybdPointer); + GotIt = Position("/usr/share/misc/map3270", keybdPointer); } } if (!GotIt) { @@ -915,7 +915,7 @@ int (*translator)(); /* Translates ascii string to integer */ GotIt = Position(environPointer, "unknown"); } if (!GotIt) { - GotIt = Position("/etc/map3270", keybdPointer); + GotIt = Position("/usr/share/misc/map3270", keybdPointer); } } if (!GotIt) { diff --git a/usr.bin/tn3270/ascii/mset.c b/usr.bin/tn3270/ascii/mset.c index b87a1ec..a26852d 100644 --- a/usr.bin/tn3270/ascii/mset.c +++ b/usr.bin/tn3270/ascii/mset.c @@ -32,13 +32,17 @@ */ #ifndef lint -static char copyright[] = +static const char copyright[] = "@(#) Copyright (c) 1988, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint +#if 0 static char sccsid[] = "@(#)mset.c 8.1 (Berkeley) 6/6/93"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ /* @@ -76,6 +80,8 @@ static char array[5000]; /* lot's of room */ static int toshell = 0; /* export to shell */ static int numbchars = 0; /* number of chars in envir. var */ +static void usage __P((void)); + static int MyStrcmp(str1, str2) char *str1, *str2; @@ -348,7 +354,6 @@ char *argv[]; { state *head; char *keybdPointer = (char *) 0; - char *commandName = argv[0]; extern char *getenv(); int picky = 0; @@ -358,9 +363,7 @@ char *argv[]; } else if (!strcmp(argv[1], "-shell")) { toshell++; } else { - fprintf(stderr, "usage: %s [-picky] [-shell] [keyboardname]\n", - commandName); - exit(1); + usage(); /*NOTREACHED*/ } argv++; @@ -369,10 +372,8 @@ char *argv[]; if (argc == 2) { keybdPointer = argv[1]; } else if (argc > 2) { - fprintf(stderr, "usage: %s [-picky] [-shell] [keyboardname]\n", - commandName); - exit(1); - /*NOTREACHED*/ + usage(); + /*NOTREACHED*/ } head = InitControl(keybdPointer, picky, ascii_to_index); if (!head) { @@ -408,3 +409,10 @@ char *argv[]; } return(0); } + +static void +usage() +{ + fprintf(stderr, "usage: mset [-picky] [-shell] [keyboardname]"); + exit(1); +} diff --git a/usr.bin/tn3270/mset/map3270.5 b/usr.bin/tn3270/mset/map3270.5 index 3230487..e580357 100644 --- a/usr.bin/tn3270/mset/map3270.5 +++ b/usr.bin/tn3270/mset/map3270.5 @@ -231,7 +231,7 @@ to send a (possibly visual) bell sequence to the user's terminal. .SH A SAMPLE ENTRY The following entry is used by tn3270(1) when unable to locate a reasonable version in the -user's environment and in /etc/map3270: +user's environment and in /usr/share/misc/map3270: .sp .nf name { # actual name comes from TERM variable @@ -321,7 +321,7 @@ and Erase current field control-u .fi .SH FILES -/etc/map3270 +/usr/share/misc/map3270 .SH SEE ALSO tn3270(1), mset(1), \fIYale ASCII Terminal Communication System II Program Description/Operator's Manual\fR diff --git a/usr.bin/tn3270/mset/mset.1 b/usr.bin/tn3270/mset/mset.1 index a806eaa..4a98b05 100644 --- a/usr.bin/tn3270/mset/mset.1 +++ b/usr.bin/tn3270/mset/mset.1 @@ -42,7 +42,7 @@ to .Tn IBM 3270 keyboard map .Sh SYNOPSIS -.Nm mset +.Nm .Op Fl picky .Op Fl shell .Op Ar keyboardname @@ -66,7 +66,7 @@ command (see .Xr tn3270 1 ) . .Pp The default -.Nm mset +.Nm output can be used to store the mapping information in the process environment in order to avoid scanning .Nm map3270 @@ -83,7 +83,7 @@ set noglob; setenv MAP3270 "\(gamset\(ga"; unset noglob If the .Ar keyboardname argument is not supplied, -.Nm mset +.Nm attempts to determine the name of the keyboard the user is using, by checking the .Ev KEYBD @@ -91,12 +91,12 @@ environment variable. If the .Ev KEYBD environment variable is not set, then -.Nm mset +.Nm uses the user's terminal type from the environment variable .Ev TERM as the keyboard name. Normally, -.Nm mset +.Nm then uses the file .Xr map3270 5 to find the keyboard mapping for that terminal. @@ -117,7 +117,7 @@ then a default mapping is used. .Pp The arguments to -.Nm mset +.Nm are: .Pp .Bl -tag -width Fl @@ -126,20 +126,20 @@ When processing the various .Pa map3270 entries (for the user's keyboard, and all those encountered before the one for the user's keyboard), -.Nm mset +.Nm normally will not complain about entries for unknown functions (like .Dq PFX1 ; the .Fl picky argument causes -.Nm mset +.Nm to issue warning messages about these unknown entries. .It Fl shell If the .Pa map3270 -entry is longer than the shell's 1024 environmental variable +entry is longer than the shell's 1024 environment variable length limit, the default -.Nm mset +.Nm output cannot be used to store the mapping information in the process environment to avoid scanning .Pa map3270 @@ -149,11 +149,11 @@ is invoked. The .Fl shell argument causes -.Nm mset -to generate shell commands to set the environmental variables +.Nm +to generate shell commands to set the environment variables .Ev MAP3270 , .Ev MAP3270A , -and so on, breaking up the entry to fit within the shell environmental +and so on, breaking up the entry to fit within the shell environment variable length limit. To set these variables, place the following command in your .Pa .login @@ -165,14 +165,14 @@ mset -shell > tmp ; source tmp ; /bin/rm tmp When searching for the .Pa map3270 entry that matches the user's keyboard, -.Nm mset +.Nm will use .Ar keyboardname instead of determining the keyboard name from the .Ev KEYBD or .Ev TERM -environmental variables. +environment variables. .Sh FILES .Bl -tag -width /usr/share/misc/map3270 -compact .It Pa /usr/share/misc/map3270 @@ -183,6 +183,6 @@ keyboard mapping for known keyboards .Xr map3270 5 .Sh HISTORY The -.Nm mset +.Nm command appeared in .Bx 4.3 . diff --git a/usr.bin/tn3270/tn3270/tn3270.1 b/usr.bin/tn3270/tn3270/tn3270.1 index a2aba2f..897475d 100644 --- a/usr.bin/tn3270/tn3270/tn3270.1 +++ b/usr.bin/tn3270/tn3270/tn3270.1 @@ -39,7 +39,7 @@ .Nd full-screen remote login to .Tn IBM VM/CMS .Sh SYNOPSIS -.Nm tn3270 +.Nm .Op Fl d .Op Fl n Ar filename .Op Fl t Ar commandname @@ -79,15 +79,15 @@ The flags to are as follows: .Bl -tag -width Fl .It Fl d -Turn on socket-level tracing (for super-user only) -.Fl n Ns Ar filename +Turn on socket-level tracing (for super-user only). +.It Fl n Ns Ar filename Specify a file to receive network trace data output (from commands "toggle netdata" and "toggle options", see .Xr telnet 1 ) ; the default is for output to be directed to the standard error file. -.Fl t Ns Ar commandname +.It Fl t Ns Ar commandname Specify a .Tn UNIX command to process @@ -103,7 +103,7 @@ command (see below). .It Ar port The port to connect to on the remote system. Normally, -.Nm tn3270 +.Nm attempts to connect to the standard .Tn TELNET @@ -112,26 +112,26 @@ port (port .El .Pp When -.Nm tn3270 +.Nm first connects to the remote system, it will negotiate to go into 3270 mode. Part of this negotiation involves telling the remote system what model 3270 it is emulating. In all cases, -.Nm tn3270 +.Nm emulates a 3278 terminal. To decide which specific model, -.Nm tn3270 +.Nm looks at the number of lines and columns on the actual terminal (as defined in the .Ev TERM environment variable; see .Xr termcap 5 ) . The terminal (or window in which -.Nm tn3270 +.Nm is running, on multiple window systems) must have at least 80 columns and 24 lines, or -.Nm tn3270 +.Nm will not go into emulation mode. If the terminal does have at least 80 columns and at least 24 lines, the following table describes the emulation: @@ -184,11 +184,11 @@ Any special function keys on the keyboard are used whenever possible. If an entry for the user's terminal is not found, -.Nm tn3270 +.Nm looks for an entry for the terminal type .Em unknown . If this is not found, -.Nm tn3270 +.Nm uses a default keyboard mapping (see .Xr map3270 5 ) . @@ -203,7 +203,7 @@ a control character, or an delete .Pq Tn DEL . If the user types an unrecognized function key sequence, -.Nm tn3270 +.Nm sends an .Tn ASCII bell @@ -215,13 +215,13 @@ and nothing is sent to the host. .Pp If -.Nm tn3270 +.Nm is invoked without specifying a remote host system name, it enters local command mode, indicated by the prompt .Dq Li tn3270>\ . In this mode, -.Nm tn3270 +.Nm accepts and executes all the commands of .Xr telnet 1 , @@ -240,7 +240,7 @@ command for command mode may also be entered, after connecting to a host, by typing a special escape sequence. If -.Nm tn3270 +.Nm has succeeded in negotiating 3270 mode with the remote host, the escape sequence will be as defined by the map3270 (see .Xr map3270 5 ) @@ -271,7 +271,7 @@ or by typing ``quit'' or ``close'' while in local command mode. The .Tn IBM 4994 style transparent mode command is invoked when -.Nm tn3270 +.Nm receives .Tn IBM 4994 style transparent output from the remote host. @@ -325,11 +325,12 @@ and .Re .Sh HISTORY The -.Nm tn3270 +.Nm command appeared in .Bx 4.3 . .Sh BUGS -Tn3270 is slow and uses system resources prodigiously. +.Nm Tn3270 +is slow and uses system resources prodigiously. .Pp Not all 3270 functions are supported, nor all Yale enhancements. -- cgit v1.1