1
0

Source code upload

This commit is contained in:
calmsacibis995
2022-09-29 17:59:04 +03:00
parent 72fa9da3d7
commit 8fc8fa8089
33399 changed files with 11964078 additions and 0 deletions
+75
View File
@@ -0,0 +1,75 @@
#!smake
#
# makefile for cmd/message_system
#
#ident "$Revision: 1.14 $"
BASEVERSION = n32bit
#ifndef SRC_PRD
ALTVERSIONS = troot
#endif
WANTPARALLEL = yes-please
include $(ROOT)/usr/include/make/cmdcommondefs
CFILES = explain.c caterr.c
COMFILES = cmdmsgfmt.c cmdgetmsg.c cmdmsg.c
COMOBJS = $(COMFILES:.c=.o)
LDIRT = msgsys.exp* msgsys.cat* *.i
MSG_SRC = errmsg
MSG_CAT_NAME = msgsys
EXPLAIN_CAT_SUFFIX = .exp
MESSAGE_CAT_SUFFIX = .cat
MKMSGS_SUFFIX = .m
default: $(TARGETS) $(MSG_CAT_NAME)$(MESSAGE_CAT_SUFFIX) $(MSG_CAT_NAME)$(EXPLAIN_CAT_SUFFIX)
headers: tmac.sg
$(INSTALL) -m 644 -F /usr/share/lib/tmac tmac.sg
include $(CMDCOMMONRULES)
TLINKXARGS += -x tmac.sg
n32bitinstall: default
$(INSTALL) -F /usr/bin $(COMMANDS)
$(INSTALL) -F /usr/lib/locale/C/LC_MESSAGES \
$(MSG_CAT_NAME)$(MESSAGE_CAT_SUFFIX)
$(INSTALL) -F /usr/lib/locale/C/LC_MESSAGES \
$(MSG_CAT_NAME)$(MESSAGE_CAT_SUFFIX)$(MKMSGS_SUFFIX)
$(INSTALL) -F /usr/lib/locale/C/LC_MESSAGES \
$(MSG_CAT_NAME)$(EXPLAIN_CAT_SUFFIX)
$(INSTALL) -F /usr/lib/locale/C/LC_MESSAGES \
$(MSG_CAT_NAME)$(EXPLAIN_CAT_SUFFIX)$(MKMSGS_SUFFIX)
$(INSTALL) -F /usr/share/lib/tmac tmac.sg
trootinstall: default
$(INSTALL) -F /usr/bin $(COMMANDS)
$(INSTALL) -F /usr/lib/locale/C/LC_MESSAGES \
$(MSG_CAT_NAME)$(MESSAGE_CAT_SUFFIX)
$(INSTALL) -F /usr/lib/locale/C/LC_MESSAGES \
$(MSG_CAT_NAME)$(MESSAGE_CAT_SUFFIX)$(MKMSGS_SUFFIX)
$(INSTALL) -F /usr/lib/locale/C/LC_MESSAGES \
$(MSG_CAT_NAME)$(EXPLAIN_CAT_SUFFIX)
$(INSTALL) -F /usr/lib/locale/C/LC_MESSAGES \
$(MSG_CAT_NAME)$(EXPLAIN_CAT_SUFFIX)$(MKMSGS_SUFFIX)
explain: explain.o $(COMOBJS)
$(CCF) explain.o $(COMOBJS) $(LDFLAGS) -o $@
caterr: caterr.o $(COMOBJS)
$(CCF) caterr.o $(COMOBJS) $(LDFLAGS) -o $@
$(MSG_CAT_NAME)$(MESSAGE_CAT_SUFFIX): $(MSG_SRC).msg $(MSG_SRC).h
${TOOLROOTSAFE} $(TOOLROOT)/usr/bin/caterr -c \
$(MSG_CAT_NAME)$(MESSAGE_CAT_SUFFIX) \
-s -Yc,$(TOOLROOT)/usr/bin/gencat \
$(MSG_SRC).msg
$(MSG_CAT_NAME)$(EXPLAIN_CAT_SUFFIX): $(MSG_SRC).msg $(MSG_SRC).h
${TOOLROOTSAFE} $(TOOLROOT)/usr/bin/caterr -c \
$(MSG_CAT_NAME)$(EXPLAIN_CAT_SUFFIX) \
-s -e -Yc,$(TOOLROOT)/usr/bin/gencat \
-Yn,$(TOOLROOT)/usr/bin/nroff \
-Ym,$(ROOT)/usr/share/lib/tmac/tmac.sg $(MSG_SRC).msg
+971
View File
@@ -0,0 +1,971 @@
/*
*
* Copyright 1997, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
#ident "$Header: /proj/irix6.5.7m/isms/eoe/cmd/message_system/RCS/caterr.c,v 1.3 1997/08/23 17:36:34 bforney Exp $"
/* caterr: IRIX Message Catalog Text Preprocessor
*
* caterr [-c 'catfile'] [-e] [-Y 'x','path'] [-s [-P cpp_opts]] [msgfile]
*
* caterr converts the error message text source in msgfile into 'gencat'
* format. If caterr is invoked without the -e option, conversion of the
* messages text is assumed.
*
* The -c option is used to identify a catalog file, caterr invokes gencat
* to update the catalog using the generated output. If no catfile is
* provided, caterr sends the gencat source to standard output.
*
* The -e option is used to convert the explanation text into 'gencat'
* format.
*
* The -Y option allows the user to specify the version of nroff, gencat,
* and nroff message macros that caterr calls.
* The -Y option takes two arguments: a key letter which indicates whether
* the path name is for nroff, gencat or message macros and a path name.
* "-Y c," followed by a path, an alternate gencat as specified by 'path'
* will be used instead of /usr/bin/gencat.
*
* "-Y n," followed by a path, an alternate nroff as specified by 'path'
* will be used instead of /usr/bin/nroff.
*
* If nroff is not available on the system, explanation catalog will not
* be made. If there is an existing catalog, then the file is touched.
* If there is no explanation catalog, then an empty catalog is
* created.
*
* "-Y m," followed by a path, an alternate message macros as specified
* by 'path' will be used instead of /usr/share/lib/tmac/tmac.sg
*
* Alternate tool path specified with the -Y option must be absolute path.
* The -Y option can be specified three times in the same command line if
* all three alternate nroff, gencat and message macros paths are to be
* used.
*
* The -s option is used to call the C preprocessor for the symbolic names
* used in the message text file. The message text file can use symbolic
* names for the msg/exp numbers, then includes the file containing the
* definitions of the symbolic names. The -s option will then replace
* the symbolic names used in the message text with the defined msg/exp
* numbers before further processing.
*
* The "-P cpp_opts" option is used to pass options to the C preprocessor.
* It must be used in combination with the -s option.
*
* If the 'msgfile' is not specified or if a dash (-) is specified, caterr
* reads from standard input.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <ctype.h>
#include <nl_types.h>
#include <sys/param.h>
#include <unistd.h>
#include <sys/stat.h>
#include <errno.h>
#include "errmsg.h"
/* maximum number of argc allowed */
#define MAX_ARGC 10
/* default locations for c preprocessor and gencat */
#define DEFAULT_CPP_PATH "/lib/cpp"
#define DEFAULT_GENCAT_PATH "/usr/bin/gencat"
#define DEFAULT_NROFF_PATH "/usr/bin/nroff"
/* message catalogs */
#define CMDCAT "msgsys.cat"
#define SYSCAT ""
void usage_err();
void process_sym();
void make_sym();
void process_msg();
void process_exp();
char *cmdname;
main(argc, argv)
int argc;
char *argv[];
{
extern char *optarg;
extern int optind;
int cflg = 0;
int eflg = 0;
int yflg1 = 0; /* flag for calling alternate tool or macros */
int yflg2 = 0; /* flag for calling alternate tool or macros */
int yflg3 = 0; /* flag for calling alternate tool or macros */
int cpathflg = 0; /* flag to call alternate gencat */
int npathflg = 0; /* flag to call alternate nroff */
int mpathflg = 0; /* flag to call nroff message macros */
int symflg = 0; /* flag to call C preprocessor for symbolic names */
int cppflg = 0; /* flag for options to the C preprocessor */
char *temppath1;
char *temppath2;
char *temppath3;
char *cpp_opts = NULL;
char gencatpath[MAXPATHLEN]; /* path for alternate gencat */
char nroffpath[MAXPATHLEN]; /* path for alternate nroff */
char macrospath[MAXPATHLEN]; /* path for alternate message macros */
int errflg =0;
int c;
char *catfile; /* catalog file */
char textfile[MAXPATHLEN]; /* message text file */
FILE *textfd;
char msgbuf[MAXPATHLEN];
char gcatcmd[NL_TEXTMAX];
FILE *tempstream;
struct stat statbuf; /* file information */
extern int optind;
int stdinflg= 0;
cmdname = argv[0];
while ((c=getopt(argc, argv, "esY:c:P:")) != EOF){
switch(c){
case 'c':
catfile = optarg;
cflg ++;
/* gencat will validate the catalog. It's entirely
legal for the catalog file not to exist until
gencat creates it. */
break;
case 'e':
eflg++;
break;
/* The -Y option can be specified concurrently for
key letters 'n', 'c' or 'm'. */
case 'Y':
if (! yflg1) {
yflg1 ++;
temppath1 = optarg;
}
else if (! yflg2) {
yflg2 ++;
temppath2 = optarg;
}
else if (! yflg3) {
yflg3 ++;
temppath3 = optarg;
}
else errflg ++;
break;
case 's':
symflg++;
break;
case 'P':
cppflg++;
cpp_opts = optarg;
break;
case '?':
errflg++;
}
} /* while */
if (errflg) usage_err();
/* check to see if any of the -Y options is set */
if (yflg1) {
/* key letter for the first -Y option is 'c' */
if ((temppath1[0] == 'c') && (temppath1[1] == ',')) {
cpathflg ++;
sprintf(gencatpath, "%s", temppath1 + 2);
}
/* key letter for the first -Y option is 'n' */
else if ((temppath1[0] == 'n') && (temppath1[1] == ',')) {
npathflg ++;
sprintf(nroffpath, "%s", temppath1 + 2);
}
/* key letter for the first -Y option is 'm' */
else if ((temppath1[0] == 'm') && (temppath1[1] == ',')) {
mpathflg ++;
sprintf(macrospath, "%s", temppath1 + 2);
}
else usage_err();
} /* yflg1 */
if (yflg2) {
/* key letter for the first -Y option is 'c' */
if ((temppath2[0] == 'c') && (temppath2[1] == ',')) {
/* if alternate gencat is not already set */
if (! cpathflg) {
cpathflg ++;
sprintf(gencatpath, "%s", temppath2 + 2);
}
}
/* key letter for the first -Y option is 'n' */
else if ((temppath2[0] == 'n') && (temppath2[1] == ',')) {
/* if alternate nroff is not already set */
if (! npathflg) {
npathflg ++;
sprintf(nroffpath, "%s", temppath2 + 2);
}
}
/* key letter for the first -Y option is 'm' */
else if ((temppath2[0] == 'm') && (temppath2[1] == ',')) {
/* if alternate macros is not already set */
if (! mpathflg) {
mpathflg ++;
sprintf(macrospath, "%s", temppath2 + 2);
}
}
else
usage_err();
} /* yflg2 */
if (yflg3) {
/* key letter for the first -Y option is 'c' */
if ((temppath3[0] == 'c') && (temppath3[1] == ',')) {
/* if alternate gencat is not already set */
if (! cpathflg) {
cpathflg ++;
sprintf(gencatpath, "%s", temppath3 + 2);
}
}
/* key letter for the first -Y option is 'n' */
else if ((temppath3[0] == 'n') && (temppath3[1] == ',')) {
/* if alternate nroff is not already set */
if (! npathflg) {
npathflg ++;
sprintf(nroffpath, "%s", temppath3 + 2);
}
}
/* key letter for the first -Y option is 'm' */
else if ((temppath3[0] == 'm') && (temppath3[1] == ',')) {
/* if alternate macros is not already set */
if (! mpathflg) {
mpathflg ++;
sprintf(macrospath, "%s", temppath3 + 2);
}
}
else
usage_err();
} /* yflg3 */
/* -P cpp_opts MUST be used with the -s flag */
if (cppflg && !symflg)
usage_err();
/* Check to see if the input is to come from stdin or
** should get the next argument as the message text file
*/
if ((optind == argc) ||
((*argv[optind] == '-') && (*argv[optind+1]=='\0'))) {
stdinflg++;
textfd = stdin;
}
if (!stdinflg) {
strcpy(textfile, argv[optind]);
if ((textfd = fopen (textfile, "r")) == NULL) {
_cmdmsg(ERRMSG_FOPENTEXTF, errno, "ERROR", cmdname,
CMDCAT, SYSCAT, textfile);
exit(2);
}
}
/* if symbolic labels are used, call either process_sym()
** or make_sym() to preprocess them. make_sym() makes the
** a preprocessed message text file from standard input.
*/
if (symflg) {
if (!stdinflg)
process_sym(textfd, textfile, eflg, cpp_opts);
else
make_sym(&textfd, textfile, eflg, cpp_opts);
}
if (! npathflg)
strcpy(nroffpath, DEFAULT_NROFF_PATH);
/* if ((stat(nroffpath, &statbuf) == -1) &&
(errno == ENOENT)) {
if (eflg) {
_cmdmsg(ERRMSG_NROFF, 0, "ERROR", cmdname, CMDCAT,
SYSCAT, nroffpath);
exit(2);
}
}
strcat(nroffpath, " -Tlp ");
if (mpathflg) {
if ((stat(macrospath, &statbuf) == -1) ||
(S_ISDIR(statbuf.st_mode))) {
_cmdmsg(ERRMSG_MACROACCESS, 0, "ERROR", cmdname,
CMDCAT, SYSCAT, macrospath);
exit(2);
}
strcat(nroffpath, macrospath);
strcat(nroffpath, " ");
}
else
strcat(nroffpath, "-msg ");*/
/* -c option to make catalog */
if (cflg) {
if (cpathflg) {
strcpy(gcatcmd, gencatpath);
}
else
strcpy(gcatcmd, DEFAULT_GENCAT_PATH);
if (access(gcatcmd, X_OK) == -1 ) {
_cmdmsg(CMD_ACCESS, 0, "ERROR", cmdname, CMDCAT,
SYSCAT, gcatcmd);
exit(2);
}
strcat(gcatcmd, " ");
strcat(gcatcmd, catfile );
strcat(gcatcmd, "\n");
/* open stream for calling gencat */
tempstream = popen(gcatcmd, "w");
if (tempstream == NULL) {
_cmdmsg(CMD_POPEN, 0, "ERROR", cmdname, CMDCAT,
SYSCAT, gcatcmd);
exit(2);
}
if (eflg)
if (mpathflg)
process_exp(textfd, tempstream, nroffpath, macrospath);
else
process_exp(textfd, tempstream, nroffpath, NULL);
else
process_msg(textfd, tempstream);
if (pclose(tempstream) == -1)
_cmdmsg(CMD_PCLOSE, 0, "ERROR", cmdname, CMDCAT,
SYSCAT);
} /* if cflg, else do not call gencat */
else {
if (eflg)
if (mpathflg)
process_exp(textfd, stdout, nroffpath, macrospath);
else
process_exp(textfd, stdout, nroffpath, NULL);
else
process_msg(textfd, stdout);
} /* else cflg */
/* close message source text file */
(void) fclose(textfd);
/* unlink the intermediate file produced by calling C pre-processor */
if (symflg) (void) unlink(textfile);
return(0);
}
void process_msg(tfd, tempfd)
FILE *tfd, *tempfd;
{
char textbuf[NL_TEXTMAX];
int cont_flg = 0;
void readtext();
/* generate the set directives */
fprintf(tempfd, "$set %d\n", NL_MSGSET);
while (fgets(textbuf, NL_TEXTMAX, tfd) != NULL) {
if ((strncmp(textbuf, "$msg ", 5) == 0) ||
(strncmp(textbuf, "$msg\t", 5) == 0 )) {
readtext(textbuf, tempfd);
cont_flg = check_bslash(textbuf);
}
else if ((strncmp(textbuf, "$ USMID ", 8) == 0) ||
(strncmp(textbuf, "$ USMID\t ", 8) == 0) ||
(strncmp(textbuf, "$\tUSMID ", 8) == 0) ||
(strncmp(textbuf, "$\tUSMID\t", 8) == 0)) {
fprintf(tempfd, "%s", textbuf);
/* usmid line should not be within a $msg */
if (cont_flg) {
_cmdmsg(ERRMSG_USMID, 0, "WARNING", cmdname,
CMDCAT, SYSCAT);
cont_flg= 0;
}
}
/* if the continuation flag is set, then just output the
line */
else if (cont_flg) {
fprintf(tempfd, "%s", textbuf);
cont_flg = check_bslash(textbuf);
}
/* other lines are ignored. */
}
}
void readtext(textline, tfd)
char textline[];
FILE *tfd;
{
int i;
for (i=5; i < ((int) strlen(textline)); i++) {
if (isdigit(textline[i])) {
fprintf(tfd, "%s", textline+i);
break;
}
}
}
void process_exp(tfd, tempfd, npath, macrospath)
FILE *tfd, *tempfd;
char *npath;
char *macrospath;
{
char textbuf[NL_TEXTMAX];
int cont_flg = 0;
int nexp_flg = 0;
int nroff_flg = 0;
char *nscrfile; /* scratch file for nroff output */
FILE *nscrfd;
char msgbuf[256];
void call_nroff();
/* generate the set directives */
fprintf(tempfd, "$set %d\n", NL_EXPSET);
/* create a scratch file for input to nroff */
nscrfile = tempnam(NULL, "cat.");
if ((nscrfd = fopen(nscrfile, "w")) == NULL) {
_cmdmsg(CMD_FOPEN, errno, "ERROR", cmdname, CMDCAT,
SYSCAT, nscrfile);
free(nscrfile);
exit(2);
}
while (fgets(textbuf, NL_TEXTMAX, tfd) != NULL) {
if ((strncmp(textbuf, "$exp ", 5) == 0) ||
(strncmp(textbuf, "$exp\t", 5) == 0)) {
if (nroff_flg) {
rewind(nscrfd);
(void) fclose(nscrfd);
call_nroff(nscrfile, tempfd, npath,
macrospath);
if ((nscrfd = fopen(nscrfile, "w")) == NULL) {
_cmdmsg(CMD_FOPEN, errno, "ERROR",
cmdname, CMDCAT, SYSCAT,
nscrfile);
free(nscrfile);
exit(2);
}
nroff_flg = 0;
}
readtext(textbuf, tempfd);
cont_flg = check_bslash(textbuf);
}
else if ((strncmp(textbuf, "$ USMID ", 8) == 0) ||
(strncmp(textbuf, "$ USMID\t ", 8) == 0) ||
(strncmp(textbuf, "$\tUSMID ", 8) == 0) ||
(strncmp(textbuf, "$\tUSMID\t", 8) == 0)) {
fprintf(tempfd, "%s", textbuf);
if (nexp_flg) nexp_flg = 0;
if (cont_flg) {
_cmdmsg(ERRMSG_USMID, 0, "WARNING",
cmdname, CMDCAT, SYSCAT);
cont_flg = 0;
}
}
/* nroff expands the tab to spaces, they
will have to be removed for gencat, so
the tab is not preserved when converting
nexp to exp */
else if ((strncmp(textbuf, "$nexp ", 6) == 0) ||
(strncmp(textbuf, "$nexp\t", 6) == 0)) {
if (!(nroff_flg)) nroff_flg = 1;
nexp_flg = 1;
fprintf(nscrfd, ".MS $exp %s", textbuf+6);
}
/* if the continuation flag is set, then just output
the following exp lines */
else if (cont_flg) {
fprintf(tempfd, "%s", textbuf);
cont_flg = check_bslash(textbuf);
}
/* pick up any following nexp lines */
else if (nexp_flg) {
if ((strncmp(textbuf,"$msg ", 5) == 0) ||
(strncmp(textbuf, "$msg\t", 5) == 0) ||
(strncmp(textbuf,"$ ", 2) == 0) ||
(strncmp(textbuf, "$\t", 2) == 0) ||
(strncmp(textbuf, "$\n", 2) == 0))
nexp_flg = 0;
else
fprintf(nscrfd, "%s", textbuf);
}
/* other lines are ignored. */
}
/* process any remaining nexp lines */
if (nroff_flg) {
(void) fclose(nscrfd);
call_nroff(nscrfile, tempfd, npath, macrospath);
}
/* unlink the file created by tempname */
(void) unlink(nscrfile);
}
int check_bslash(tbuf)
char *tbuf;
{
int cnt_flg = 0;
char *tempbuf;
/* find the last occurrence of backslash, if any */
tempbuf = strrchr(tbuf, '\\');
/* if the next char following the last back slash is a
new line character '\n' then the back slash is to be
interpreted as continuation. */
if (tempbuf != NULL) {
if (tempbuf[1] == '\n') cnt_flg++;
}
return(cnt_flg);
}
void call_nroff(n_infile, tfd, nroffp, macrospath)
char *n_infile;
FILE *tfd;
char *nroffp;
char *macrospath;
{
char *nout; /* scratch file for nroff output */
char *nout1;
char nroffcmd[NL_TEXTMAX];
char msgbuf[256];
struct stat statbuf; /* file information */
void rm_blanks();
void add_bslash();
/* make sure nroff exists */
if ((stat(nroffp, &statbuf) == -1) &&
(errno == ENOENT)) {
_cmdmsg(ERRMSG_NROFF, 0, "ERROR", cmdname, CMDCAT,
SYSCAT, nroffp);
exit(2);
}
strcpy(nroffcmd, nroffp);
strcat(nroffcmd, " ");
/* add the macropath */
if (macrospath != NULL) {
if ((stat(macrospath, &statbuf) == -1) ||
(S_ISDIR(statbuf.st_mode))) {
_cmdmsg(ERRMSG_MACROACCESS, 0, "ERROR", cmdname,
CMDCAT, SYSCAT, macrospath);
exit(2);
}
strcat(nroffcmd, macrospath);
strcat(nroffcmd, " ");
}
else
strcat(nroffcmd, "-msg ");
/* create a scratch file for nroff output */
if ((nout = tempnam(NULL, "cat.")) == NULL) {
_cmdmsg(CMD_TEMPNAM, errno, "ERROR", cmdname, CMDCAT, SYSCAT);
exit(2);
}
if ((nout1 = tempnam(NULL, "cat.")) == NULL) {
_cmdmsg(CMD_TEMPNAM, errno, "ERROR", cmdname, CMDCAT, SYSCAT);
exit(2);
}
/* call nroff */
strcat(nroffcmd, n_infile);
strcat(nroffcmd, " > ");
strcat(nroffcmd, nout);
if (system(nroffcmd)) {
_cmdmsg(CMD_SYSTEM, errno, "ERROR", cmdname, CMDCAT,
SYSCAT, nroffcmd);
exit(2);
}
if (! stat(nout, &statbuf)) {
/* check nroff output file size */
if (statbuf.st_size == 0) {
_cmdmsg(ERRMSG_NROFFEMPTY, 0, "ERROR", cmdname,
CMDCAT, SYSCAT, nout);
(void) unlink(n_infile);
(void) unlink(nout);
exit(2);
}
}
errno = 0;
strcpy(nroffcmd, "/bin/cat ");
strcat(nroffcmd, nout);
strcat(nroffcmd, " | /bin/col -b > ");
strcat(nroffcmd, nout1);
if (system (nroffcmd)) {
_cmdmsg(CMD_SYSTEM, errno, "ERROR", cmdname, CMDCAT,
SYSCAT, nroffcmd);
exit(2);
}
errno = 0;
strcpy(nroffcmd, "/bin/mv ");
strcat(nroffcmd, nout1);
strcat(nroffcmd, " ");
strcat(nroffcmd, nout);
if (system (nroffcmd)) {
_cmdmsg(CMD_SYSTEM, errno, "ERROR", cmdname, CMDCAT,
SYSCAT, nroffcmd);
exit(2);
}
/* remove the trailing blank lines produced by nroff */
rm_blanks(nout);
/* add the back slash new line characters, remove the exp tags,
and write it to the output stream */
add_bslash(nout, tfd);
/* unlink or remove the nroff scratch file */
(void) unlink(nout);
}
void rm_blanks(n_file)
char *n_file;
{
FILE *nstream;
char msgbuf[256];
char c;
int nfd;
long int nfdtemp;
/* open the nroff output file in read/write mode */
if ((nfd = open(n_file, O_RDWR)) == -1) {
_cmdmsg(CMD_OPEN, errno, "ERROR", cmdname, CMDCAT,
SYSCAT, n_file);
exit(2);
}
/* get stream associated with the file descriptor for file
manipulation */
if ((nstream = fdopen(nfd, "r+")) == NULL) {
_cmdmsg(CMD_FDOPEN, errno, "ERROR", cmdname, CMDCAT,
SYSCAT, n_file);
exit(2);
}
/* go to the last byte of the file */
if (fseek(nstream, -1L, SEEK_END)) {
_cmdmsg(ERRMSG_SEEKLAST, errno, "ERROR", cmdname, CMDCAT,
SYSCAT, n_file);
exit(2);
}
else {
/* trace back the file until no new line character is
encountered */
c= (char) fgetc(nstream);
while (c == '\n') {
if (fseek(nstream, -2, SEEK_CUR)) {
_cmdmsg(ERRMSG_SEEKBLANK, errno, "ERROR",
cmdname, CMDCAT, SYSCAT, n_file);
exit(2);
}
c= (char) fgetc(nstream);
}
/* save the last two new line characters */
if (fseek(nstream, 2, SEEK_CUR)) {
_cmdmsg(CMD_FSEEK, errno, "ERROR", cmdname, CMDCAT,
SYSCAT, n_file);
exit(2);
}
/* find the position to truncate */
nfdtemp= ftell(nstream);
if ( ftruncate(nfd, nfdtemp) == -1) {
_cmdmsg(ERRMSG_TRUNCNROFF, errno, "ERROR", cmdname,
CMDCAT, SYSCAT, n_file);
exit(2);
}
}
(void) close(nfd);
}
void add_bslash(n_outfile, outfd)
char *n_outfile;
FILE *outfd;
{
char tempbuf[NL_TEXTMAX];
char textbuf[NL_TEXTMAX];
char printbuf[NL_TEXTMAX];
char msgbuf[256];
int len;
FILE *noutfd;
int expstart = 0;
strcpy(tempbuf, "\0");
strcpy(printbuf, "\0");
if ((noutfd = fopen(n_outfile, "r")) == NULL) {
_cmdmsg(CMD_FOPEN, errno, "ERROR", cmdname, CMDCAT,
SYSCAT, n_outfile);
exit(2);
}
while (fgets(textbuf, NL_TEXTMAX, noutfd) != NULL) {
if (printbuf != NULL)
fprintf(outfd, "%s", printbuf);
if ((strncmp(textbuf, "$exp ", 5) == 0) ||
(strncmp(textbuf, "$exp\t", 5) == 0)) {
/* set flag to indicate starting text for exp's */
if (! expstart) expstart ++;
if (strcmp(tempbuf,"\0") != 0)
sprintf(printbuf, "%s", tempbuf);
sprintf(tempbuf, "%s", textbuf+5);
}
else {
/* nroff output lines contains the new line char */
if (expstart) {
if (strcmp(tempbuf, "\0") != 0) {
len = strlen(tempbuf);
tempbuf[len-1] = '\\';
tempbuf[len]= 'n';
tempbuf[len+1] = '\\';
tempbuf[len+2]= '\n';
tempbuf[len+3]= '\0';
sprintf(printbuf, "%s", tempbuf);
}
sprintf(tempbuf, "%s", textbuf);
} /* expstart */
} /* else */
}
/* print the last contents in the printing buffer */
if (printbuf != NULL) {
fprintf(outfd, "%s\n", printbuf);
}
(void) fclose(noutfd);
}
/* This routine prints the caterr's usage message then exits the program */
void usage_err()
{
_cmdmsg(ERRMSG_CATERRUSAGE, 0, "ERROR", cmdname, CMDCAT, SYSCAT);
exit(2);
}
/* get_cppname() makes up the cpp file name from the argument 'tname'.
*/
void get_cppname(tname, cname, e_flag)
char *tname;
char cname[];
int e_flag;
{
char *p;
/* get basename of file */
p= strrchr(tname, '/');
if (p == NULL)
p = tname;
else
p++;
strcpy(cname, p);
/* replace any '.stuff' at the end of the name with '.i' */
p= strrchr(cname, '.');
if (p == NULL)
strcat(cname, ".i");
else
strcpy(p, ".i");
}
/*
* check_cpp
*
* copies the c preprocessor command line into sysline. The environment
* variable USECPPPATH is checked first. If USECPPPATH is not defined,
* a default value of cc -E -Uunix is used
*
*/
void
check_cpp(char *sysline)
{
char *usecpppath;
if (((usecpppath= getenv("USECPPPATH")) != NULL) &&
(!access(usecpppath, X_OK))) {
strcpy(sysline, usecpppath);
} else if(!access(DEFAULT_CPP_PATH, X_OK)) {
/* use default */
strcpy(sysline, DEFAULT_CPP_PATH);
strcat(sysline, " -Uunix ");
} else {
_cmdmsg(ERRMSG_LIBCPP, 0, "ERROR", cmdname, CMDCAT, SYSCAT,
DEFAULT_CPP_PATH);
exit(1);
}
}
/* process_sym() takes the input message text file and process it through
** cpp. After cpp preprocessing, the pointer tfd is changed to pointed
** the cpp outputfile and the file name 'tfile' is changed to the name
** of the cpp output file for unlinking after the catalog is mad.
*/
void process_sym(tfd, tfile, exp_flag, cpp_opts)
FILE *tfd;
char *tfile;
int exp_flag;
char *cpp_opts;
{
char symcmd[NL_TEXTMAX];
char cppfile[MAXPATHLEN];
char msgbuf[256];
get_cppname(tfile, cppfile, exp_flag);
check_cpp(symcmd);
if (cpp_opts) {
strcat(symcmd, cpp_opts);
strcat(symcmd, " ");
}
strcat(symcmd, tfile);
strcat(symcmd, " > ");
strcat(symcmd, cppfile);
if (system(symcmd)) {
_cmdmsg(ERRMSG_SYMNAME, 0, "ERROR", cmdname, CMDCAT, SYSCAT);
exit(1);
}
/* set the message text file to the cppfile for further processing */
strcpy(tfile, cppfile);
(void) fclose (tfd);
if ((tfd= fopen(tfile, "r")) == NULL) {
_cmdmsg(ERRMSG_FOPENPROCF, errno, "ERROR", cmdname, CMDCAT,
SYSCAT, tfile);
exit(2);
}
}
/* make_sym() copies the input from standard in to a temporary message
** text file for cpp preprocessing.
** After cpp preprocessing, the pointer tfd is changed to pointed
** the cpp outputfile and the file name 'tfile' is changed to the name
** of the cpp output file for unlinking after the catalog is mad.
*/
void make_sym(tfd, tfile, exp_flag, cpp_opts)
FILE **tfd;
char tfile[];
int exp_flag;
char *cpp_opts;
{
char symcmd[NL_TEXTMAX];
char *p;
FILE *tmpfd;
char cppfile[MAXPATHLEN];
char line[256];
char *tmpfile;
tmpfile = tempnam(NULL, "");
p= strrchr(tmpfile, '/');
if (p != NULL) {
p++;
strcpy(tmpfile, p);
}
if ((tmpfd = fopen(tmpfile, "w")) == NULL) {
_cmdmsg(CMD_FOPEN, 0, "ERROR", cmdname, CMDCAT, SYSCAT, tmpfile);
exit(1);
}
while (fgets(line, 255, *tfd) != NULL)
fputs(line, tmpfd);
(void) fclose (tmpfd);
check_cpp(symcmd);
if (cpp_opts) {
strcat(symcmd, cpp_opts);
strcat(symcmd, " ");
}
strcat(symcmd, tmpfile);
if (system(symcmd)) {
_cmdmsg(ERRMSG_SYMNAME, 0, "ERROR", cmdname, CMDCAT, SYSCAT);
exit(1);
}
/* unlink the file holding the text coming in from stdin */
(void) unlink(tmpfile);
if ((tmpfd = fopen(cppfile, "r")) == NULL) {
_cmdmsg(CMD_FOPEN, 0, "ERROR", cmdname, CMDCAT, SYSCAT, cppfile);
exit(1);
}
strcpy(tfile, cppfile);
*tfd = tmpfd;
}
+209
View File
@@ -0,0 +1,209 @@
/*
*
* Copyright 1997, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
#ident "$Header: /proj/irix6.5.7m/isms/eoe/cmd/message_system/RCS/cmdgetmsg.c,v 1.3 1997/05/09 21:24:35 bforney Exp $"
#include <nl_types.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <malloc.h>
#define MAXMLN 1024 /* Maximum message length */
char *_docmdgetmsg();
nl_catd _open_catalog(const char *);
/*
* _cmdgetmsg() - Get a message from the Unicos utility command
* and/or system message catalogs
*
* "cmdgetmsg()" returns up to "buflen" characters of the requested
* message string identified by the utility message number 'msgno'
* and/or system error number 'erno'. The message string is placed
* in the user-supplied buffer 'buf'. If the message is longer than
* 'buflen' characters, it is truncated with a null-byte.
*
* If an invalid buffer length (bufle <1), a pointer to a null string
* ("") is returned, otherwise, _cmdgetmsg() returns a pointer to the
* message string in 'buf'.
*
* Formal parameters:
* msgno - message catalog message number
* erno - system error number
* buf - user supplied buffer
* buflen - length of user supplied buffer
*/
char *
_cmdgetmsg(int msgno,
int erno,
char *buf,
int buflen,
const char *cmdname,
const char *cmdcat,
const char *syscat,
...)
{
va_list args;
char *bufp;
va_start(args, syscat);
bufp = _docmdgetmsg(msgno, erno, buf, buflen, cmdname,
cmdcat, syscat, args);
va_end(args);
return(bufp);
}
/*
* _docmdgetmsg() - Get a message from the IRIX utility command
* and/or system message catalogs
*
* "docmdgetmsg()" returns up to "buflen" characters of the requested
* message string identified by the utility message number 'msgno'
* and/or system error number 'erno'. The message string is placed
* in the user-supplied buffer 'buf'. If the message is longer than
* 'buflen' characters, it is truncated with a null-byte.
*
* If an invalid buffer length (bufle <1), a pointer to a null string
* ("") is returned, otherwise, _docmdgetmsg() returns a pointer to the
* message string in 'buf'.
*
* Formal parameters:
* msgno - message catalog message number
* erno - system error number
* buf - user supplied buffer
* buflen - length of user supplied buffer
* args - argument list
*/
char *
_docmdgetmsg(int msgno,
int erno,
char *buf,
int buflen,
const char *cmdname,
const char *cmdcat,
const char *syscat,
va_list args)
{
nl_catd cfd; /* Message catalog descriptor */
char msgbuf[MAXMLN *2 +1]; /* Message buffer */
char *msgptr; /* Pointer to message */
char tmpbuf[MAXMLN+1]; /* Temporary message buffer */
char *tptr; /* Pointer to tmp message buffer*/
char *nptr; /* Null message pointer */
static char n; /* Null message string */
int msglen; /* Message length */
/* check valid buflen */
n ='\0';
nptr =&n;
if (buflen < 1) return(nptr);
msgptr = &msgbuf[0];
*msgptr = '\0';
if (msgno) {
/* open command utility message catalog */
if ((cfd = _open_catalog(cmdcat)) == (nl_catd)-1) {
sprintf(msgptr, "Cannot open the message catalog for %s.", cmdname);
}
else {
/* put command message into msgbuf */
if ((tptr = catgetmsg(cfd, NL_MSGSET, msgno,
tmpbuf, MAXMLN)) == NULL) {
(void) sprintf(msgptr, "Cannot retrieve message for message number '%d' from the message catalog for %s.",
msgno, cmdname);
}
else {
(void) vsprintf(msgptr, tmpbuf, args);
}
(void) catclose (cfd);
}
if (erno) {
/* back over ending period */
msgptr += strlen(msgptr) -1;
/* modify message to perror() format */
strcpy(msgptr, ": ");
msgptr += strlen(msgptr);
}
}
if (erno) {
tptr = strerror(erno);
if (tptr != NULL) {
strcpy(msgptr, tptr);
} else {
sprintf(msgptr, "Cannot retrieve message for errno '%d' from system message catalog.", erno);
}
}
else if (!msgno) {
(void) sprintf(msgptr,
"%s(INTERNAL): Message number and errno are both zero.\n",
cmdname);
}
/* check message length */
msglen = strlen(msgbuf);
if (msglen > buflen) {
msglen = buflen -1;
}
/* transfer message to user supplied buffer, terminate with Null */
(void) strncpy(buf, msgbuf, msglen);
buf[msglen] = '\0';
return(buf);
}
/*
* _open_catalog - open explanation catalog
*
* Tries to open the catalog with cmdcat. If this fails, the .cat
* is stripped off. This is done incase the NLSPATH is set to
* %N.cat instead of %N, as is commonly done by module files for
* Cray products.
*/
nl_catd
_open_catalog(const char *cmdcat)
{
char *new_str, *temp;
nl_catd cfd;
if ((cfd = catopen(cmdcat, 0)) == (nl_catd)-1) {
/* try stripping off ".cat" suffix and call catopen again */
if (((temp = strstr(cmdcat, ".cat")) != NULL) &&
((new_str = (char *)malloc(temp-cmdcat+sizeof(char)))
!= NULL)) {
strncpy(new_str, cmdcat, temp-cmdcat);
new_str[temp-cmdcat] = '\0';
cfd = catopen(new_str, 0);
}
}
return(cfd);
}
+111
View File
@@ -0,0 +1,111 @@
/*
*
* Copyright 1997, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
#ident "$Header: /proj/irix6.5.7m/isms/eoe/cmd/message_system/RCS/cmdmsg.c,v 1.1 1997/03/25 22:42:17 bforney Exp $"
#include <nl_types.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#define ERRFILE stderr /* Default output stream */
#define MAXMLN 1024 /* Maximum message length */
#define Nulchar '\0'
static void _docmdmsg();
void _docmdprompt();
extern char *_docmdgetmsg();
FILE *errfile = ERRFILE;
/************************************************************************/
/* Name: _cmdmsg */
/* */
/* Description: */
/* IRIX utility command run time message handler. */
/* */
/* Formal parameters: */
/* msgno - message catalog message number */
/* erno - system error number */
/* severity - Pointer to severity string, "" string if no */
/* severity */
/************************************************************************/
void
_cmdmsg(int msgno, int erno, const char *severity, const char *cmdname,
const char *cmdcat, const char *syscat, ...)
{
va_list args;
/* add varargs to tmpbuf */
va_start(args, syscat);
(void) _docmdmsg(msgno, erno, severity, cmdname, cmdcat,
syscat, args);
va_end(args);
}
/************************************************************************/
/* Name: _docmdmsg */
/* */
/* Description: */
/* IRIX utility command run time message handler. */
/* */
/* Formal parameters: */
/* msgno - message catalog message number */
/* erno - system error number */
/* severity - Pointer to severity string, "" string if no */
/* severity */
/* args - argument list */
/************************************************************************/
static void
_docmdmsg(int msgno,
int erno,
const char *severity,
const char *cmdname,
const char *cmdcat,
const char *syscat,
va_list args)
{
char msgbuf[MAXMLN*2+1]; /* Message buffer */
char outbuf[MAXMLN*2+1]; /* Formatted output buffer */
char *mp; /* Pointer to message buffer */
msgbuf[0] = '\0';
mp = _docmdgetmsg(msgno, erno, msgbuf, MAXMLN*2, cmdname, cmdcat,
syscat, args);
/* build formatted message */
(void) cmdmsgfmt(cmdname, msgno? cmdcat: syscat,
msgno? msgno:erno, severity, msgbuf, outbuf,
sizeof(outbuf));
/* print formatted message */
(void) write(fileno(errfile), outbuf, strlen(outbuf));
return;
}
+152
View File
@@ -0,0 +1,152 @@
/*
*
* Copyright 1997, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
#ident "$Header: /proj/irix6.5.7m/isms/eoe/cmd/message_system/RCS/cmdmsgfmt.c,v 1.3 1997/05/09 21:26:38 bforney Exp $"
#define __NLS_INTERNALS 1
#include <nl_types.h>
#undef __NLS_INTERNALS
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
/* --- Environment variable defaults --- */
#define CMDMSG_FORMAT "CMDMSG_FORMAT"
#define D_CMDMSG_FORMAT "%G-%N %C: %M\n"
#define EQUAL_CHAR "="
#define MESSAGE_CAT_EXT ".cat"
/*
* cmdmsgfmt - format an error message
*
* char *
* cmdmsgfmt(
* char *cmdname,
* char *groupcode,
* int msg_num,
* char *severity,
* char *msgtext,
* char *buf,
* int buflen)
*
* cmdmsgfmt() formats up to "buflen" characters a message containing
* the command name "cmdname", group code "groupcode", message number
* "msg_num", severity level "severity", the text of the message
* "msgtext". The formatted essage is placed in the user-supplied
* buffer "buf".
*
* The msg_num parameter is an integer which is converted to an ASCII
* string of digits. The cmdname, groupcode, severity, and msgtext
* parameters are all null-terminated character strings.
*
* The CMDMSG_FORMAT environment variable controls how the message
* is formatted. The MSG_FORMAT environment variable also controls
* how the message is formatted if the CMDMSG_FORMAT is not defined.
* If either variable is defined, a default formatting value is used.
*
*/
char *
cmdmsgfmt(const char *cmdname, const char *groupcode, int msg_num,
const char *severity, const char *msgtext, char *buf, int buflen)
{
char *cmdmsg_format_env;
char *msg_format_env,
*save_msg_format,
*temp = NULL;
char *return_val,
groupcode_stripped[NL_MAXPATHLEN];
cmdmsg_format_env = getenv(CMDMSG_FORMAT);
/* check if the MSG_FORMAT evironment variable needs to be changed.
* two cases where a change is needed:
* - CMDMSG_FORMAT environment variable is defined.
* - neither CMDMSG_FORMAT nor MSG_FORMAT environment variables are defined.
*/
if (cmdmsg_format_env != NULL ||
((temp = getenv(MSG_FORMAT)) == NULL
/* && cmdmsg_format_env == NULL
(implicit in the evaluation of the if) */
)) {
/* save MSG_FORMAT environment variable */
if (temp == NULL) {
temp = getenv(MSG_FORMAT);
}
if (temp != NULL) {
save_msg_format = (char *)malloc(strlen(temp));
strcpy(save_msg_format, temp);
} else {
save_msg_format = NULL;
}
/* set MSG_FORMAT environment variable to new value */
msg_format_env = (char *)malloc(strlen(MSG_FORMAT)+
strlen(cmdmsg_format_env ?
cmdmsg_format_env :
D_CMDMSG_FORMAT)+2);
if (msg_format_env == NULL) {
return NULL;
}
strcpy(msg_format_env, MSG_FORMAT);
strcat(msg_format_env, EQUAL_CHAR);
strcat(msg_format_env,
cmdmsg_format_env ?
cmdmsg_format_env : D_CMDMSG_FORMAT);
if (putenv(msg_format_env) != 0) {
free(msg_format_env);
return NULL;
}
free(msg_format_env);
} else {
save_msg_format = NULL;
}
/* strip off MESSAGE_CAT_EXT from groupcode if it exists */
if ((temp = strstr(groupcode, MESSAGE_CAT_EXT)) != NULL) {
strncpy(groupcode_stripped, groupcode, temp-groupcode);
groupcode_stripped[temp-groupcode] = '\0';
} else {
strcpy(groupcode_stripped, groupcode);
}
return_val =
catmsgfmt(cmdname, groupcode_stripped, msg_num, severity, msgtext,
buf, buflen, NULL, NULL);
/* restore MSG_FORMAT environment variable if needed */
if (save_msg_format != NULL) {
msg_format_env = (char *)malloc(strlen(MSG_FORMAT)+
strlen(save_msg_format)+2);
if (msg_format_env == NULL) {
return NULL;
}
strcpy(msg_format_env, MSG_FORMAT);
strcat(msg_format_env, EQUAL_CHAR);
strcat(msg_format_env, save_msg_format);
putenv(save_msg_format);
}
return return_val;
}
+76
View File
@@ -0,0 +1,76 @@
/*
*
* Copyright 1997, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
#ident "$Header: /proj/irix6.5.7m/isms/eoe/cmd/message_system/RCS/errmsg.h,v 1.2 1997/04/10 16:22:10 bforney Exp $"
/* 'errmsg' utility msg include file
*
* message code #define format:
* #define msgcode nnn
*/
#ifndef _ERRMSG_H
#define _ERRMSG_H
/* cmdmsg function prototypes */
extern void _cmdmsg (int, int, const char *, const char *, const char *,
const char *, ...);
/* #define starts here: */
#define CMD_ACCESS 1001 /* access(); Cannot access '%s'. */
#define CMD_FDOPEN 1002 /* fdopen(); Cannot open '%s'. */
#define CMD_FOPEN 1003 /* fopen(); Cannot open '%s'. */
#define CMD_FSEEK 1004 /* fseek() '%s' failed. */
#define CMD_OPEN 1005 /* open(); Cannot open '%s'. */
#define CMD_PCLOSE 1006 /* pclose(); Cannot open pipe. */
#define CMD_POPEN 1007 /* popen(); Cannot open pipe to '%s'. */
#define CMD_STAT 1008 /* stat(); Cannot stat '%s'. */
#define CMD_SYSTEM 1009 /* system() of string %s failed. */
#define CMD_TEMPNAM 1010 /* tempnam() failed. */
#define ERRMSG_CATERRUSAGE 1940
#define ERRMSG_MACROACCESS 1941
#define ERRMSG_USMID 1942
#define ERRMSG_NROFFEMPTY 1943
#define ERRMSG_LIBCPP 1944
#define ERRMSG_SYMNAME 1945
#define ERRMSG_FOPENTEXTF 1946
#define ERRMSG_SEEKLAST 1947
#define ERRMSG_SEEKBLANK 1948
#define ERRMSG_TRUNCNROFF 1949
#define ERRMSG_FOPENPROCF 1950
#define ERRMSG_EXPLAINUSAGE 1951
#define ERRMSG_MSGIDENT 1952
#define ERRMSG_EXPCATOPEN 1953
#define ERRMSG_NOEXPMSG 1954
#define ERRMSG_NL_MALLOC 1955
#define ERRMSG_NL_MAXOPEN 1956
#define ERRMSG_NL_MAP 1957
#define ERRMSG_NL_HEADER 1958
#define ERRMSG_NROFF 1959
#endif /* _ERRMSG_H */
+402
View File
@@ -0,0 +1,402 @@
$
$ (C) COPYRIGHT CRAY RESEARCH, INC.
$ UNPUBLISHED PROPRIETARY INFORMATION.
$ ALL RIGHTS RESERVED.
$ 'errmsg' utility message text file
$ $msg format:
$ $msg ERRMSG_MSGCODE message...
#ifndef _ERRMSG_H
#include "errmsg.h"
#endif /* _ERRMSG.H */
$ messages and explanations:
$ access() call failed
$msg CMD_ACCESS Cannot access '%s'.
$nexp CMD_ACCESS
Cannot access \*Vfile\fP.
.PP
The access system call failed to access the \*Vfile\fP.
The access system call checks a \*Vfile\fP for accessibility.
.PP
Inorder to access a \*Vfile\fP, the access system call requires
search permission to all components of the path prefix for the
\*Vfile\fP.
.PP
For a list of error conditions that will cause the access
system call to fail, see access(2).
.ME
$ ---------------------------------------------------------------------------
$ fdopen() call failed
$msg CMD_FDOPEN Cannot open '%s'.
$nexp CMD_FDOPEN
Cannot open \*Vfile\fP.
.PP
The fdopen function failed.
The fdopen function associates a stream with the given file descriptor
\*Vfildes\fP, which was obtained from a successful open, dup, creat, or
pipe system call.
.PP
Opening a file, with the fdopen function, will fail if the
\*Vtype\fP of the stream does not agree with the \*Vmode\fP of the open
file associated with the file descriptor.
.ME
$ -------------------------------------------------------------------------
$ fopen() call failed
$msg CMD_FOPEN Cannot open '%s'.
$nexp CMD_FOPEN
Cannot open \*Vfile\fP.
.PP
The fopen function failed.
The fopen function opens the specified \*Vfile\fP and associates
a stream with it.
Opening a file with write mode will create the file, if it does not
exist, or truncate the file to zero length.
.PP
Opening a file with read mode fails if the file does not exist or
the read permission is denied.
Opening a file with read/write mode fails if
the \*Vfile\fP exists and write permission is denied or
the \*Vfile\fP does not exist and the directory in which the
file is to be created does not permit writing.
The fopen function requires
search permission to all components of the path prefix for the
\*Vfile\fP.
.PP
For a list of error conditions that will cause the fopen
function to fail, see open(2).
.ME
$ -------------------------------------------------------------------------
$ fseek() call failed.
$msg CMD_FSEEK Cannot reposition file pointer in '%s'.
$nexp CMD_FSEEK
Cannot reposition file pointer in \*Vfile\fP.
.PP
The fseek function failed.
The fseek function sets the file pointer of the specified
\*Vstream\fP to the specified byte \*Voffset\fP.
.PP
The fseek function will fail if the resulting position of the
file pointer is negative.
The fseek function will also fail if the \*Vstream\fP is
associated with a terminal.
.ME
$ -------------------------------------------------------------------------
$ open() call failed.
$msg CMD_OPEN Cannot open '%s'.
$nexp CMD_OPEN
Cannot open \*Vfile\fP.
.PP
The open system call failed.
The open system call opens the specified \*Vfile\fP for reading or
writing. With the O_CREAT flag, the open system call will create
the specified \*Vfile\fP, if it does not exist; otherwise the flag
has no effect.
.PP
Opening a file with the read mode fails if the file does not exist or
the read permission is denied.
Opening a file with the read/write mode fails if
the \*Vfile\fP exists and write permission is denied or
the \*Vfile\fP does not exist and the directory in which the
file is to be created does not permit writing.
The open system call requires
search permission to all components of the path prefix for the
\*Vfile\fP.
.PP
For a list of error conditions that will cause the open
system call to fail, see open(2).
.ME
$ -------------------------------------------------------------------------
$ pclose() call failed
$msg CMD_PCLOSE Cannot close pipe.
$nexp CMD_PCLOSE
Cannot close pipe.
.PP
The pclose function failed.
.PP
The pclose function closes a pipe stream, that was opened by popen.
The pclose function waits for the associated child process to
terminate and returns the exit status of the command.
Upon successful return, the pclose function returns the termination
status of the shell that ran the command. Otherwise, pclose returns
-1 and set errno to indicate the error.
.ME
$ -------------------------------------------------------------------------
$ popen() call failed
$msg CMD_POPEN Cannot open pipe to '%s'.
$nexp CMD_POPEN
Cannot open pipe to \*Vcommand\fP.
.PP
The popen function creates a pipe
between the calling program and the \*Vcommand\fP to be executed.
The popen function allows the user to open a pipe between a
process and any other executable file.
.PP
The popen function will fail to create a pipe to the specified
\*Vcommand\fP, if the specified \*Vcommand\fP is not a valid shell
command line.
.ME
$ -------------------------------------------------------------------------
$ stat() call failed.
$msg CMD_STAT Cannot obtain file status on '%s'.
$nexp CMD_STAT
Cannot obtain file status on \*Vfile\fP.
.PP
The stat system call failed.
The stat system call obtains information about the specified \*Vfile\fP.
.PP
The stat system call will fail to obtain information about the
\*Vfile\fP if search permission is denied for a component of the
path prefix of \*Vfile\fP.
.PP
The stat system call will fail to obtain the information on a
\*Vfile\fP, if the process is not granted read permission to the
\*Vfile\fP via the security level and compartments, and the process
does not have the appropriate privilege.
.PP
For a list of error conditions that will cause the stat
system call to fail, see stat(2).
.ME
$ -------------------------------------------------------------------------
$ system(string) call failed.
$msg CMD_SYSTEM Execution of command '%s' failed.
$nexp CMD_SYSTEM
Execution of command \*Vstring\fP failed.
.PP
The system function failed.
The system function passes the \*Vstring\fP to the host
environment to be executed by a "command processor" (sh(1)) as input,
as if \*Vstring\fP had been typed as a command at a terminal.
.PP
The system function will fail if the vfork system call or
exec system call fails.
.ME
$ -------------------------------------------------------------------------$
$ tempnam() call failed
$msg CMD_TEMPNAM Failed to obtain a name for temporary file.
$nexp CMD_TEMPNAM
Failed to obtain a name for temporary file.
.PP
The tempnam function failed.
The tempnam function generates a valid file name that is not
the same as the name of an existing file and that can safely be used
for the name of a temporary file.
.PP
The tempnam function will fail if it is unable to find an
accessible directory for the temporary file.
The tempnam function first tries the directory specified by the
\*Vdir\fP argument, then the directory \*VP_tmpdir\fP
as specified in the header file stdio.h, and finally /tmp will be
tried as a last resort, if the other directories are not accessible.
If the \*VTMPDIR\fP environment variable is set to an accessible
directory, then this directory will override the other possible
directories for the location of the temporary file.
.ME
$ -------------------------------------------------------------------------$
$msg ERRMSG_CATERRUSAGE \n\
Usage: caterr [-c catfile] [-e] [-Y n,pathname] [-Y c,pathname] \n\
[-Y m,pathname] [-s [-P cpp_opts]] [msgfile]
$nexp ERRMSG_CATERRUSAGE
Usage error
.PP
Either an incomplete command line or an unrecognized option was entered
with the \*Ccaterr\fR utility.
.PP
For details about the \*Ccaterr\fR utility and options, and the following
command line:
.CS
man caterr
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_MACROACCESS Cannot access %s or it is a directory.
$nexp ERRMSG_MACROACCESS
Cannot access \*Vfile\fP or it is a directory.
.PP
The \*Caccess\fR system call determines the accessibility of the path name |
pointed to by the path argument.
The \*Caccess\fR system call requires search permission to all components
of the path prefix for the path.
Either the \*Caccess\fR system call failed to access the message macro specified
by the path or the path specified for the message macro points to a directory.
.PP
For a list of error conditions that will cause the \*Caccess\fR system call to fail,
see access(2).
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_USMID Encounter USMID line, more text is expected for $msg.
$nexp ERRMSG_USMID
Encounter USMID line, more text is expected for $msg.
.PP
While expecting more text for the $msg currently being
processed, \*Ccaterr\fR encounter an USMID line.
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_NROFFEMPTY Nroff command failed, file '%s' is empty.
$nexp ERRMSG_NROFFEMPTY
Nroff command failed, file \*Vfilename\fP is empty.
.PP
The output file produced by nroff is of zero length.
Nroff command failed to format the explanations.
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_LIBCPP Cannot access '%s'.
$nexp ERRMSG_LIBCPP
Cannot access \*Vfile\fP.
.PP
The \*Caccess\fR system call failed to access \*Vfile\fP.
In order to access a \*Vfile\fP, the \*Caccess\fR system call require search
permission to all components of the path prefix for the \*Vfile\fP.
.PP
For a list of error conditions that will cause the \*Caccess\fR system
call to fail, see access(2).
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_SYMNAME Cannot process symbolic names.
$nexp ERRMSG_SYMNAME
Cannot process symbolic names.
.PP
The \*Ccaterr\fR utility calls the C language preprocessor, cpp to
preprocess symbolic message names into message numbers.
The system call to process the symbolic names failed.
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_FOPENTEXTF Cannot open message text file '%s'.
$nexp ERRMSG_FOPENTEXTF
Cannot open message text file \*Vmsgfile\fP.
.PP
The \*Ccatxt\fR utility cannot open the input message text file you
have specified. Check the path name again and make sure that you have
read permission to the file.
The function call \*Cfopen\fR() failed.
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_SEEKLAST Cannot fseek to the last byte of file '%s'.
$nexp ERRMSG_SEEKLAST
Cannot fseek to the last byte of file \*Vfile\fP.
.PP
As part of the message text file processing, trailing blank lines
produced by nroff are removed.
An internal error occurred in repositioning the file descriptor
within the nroff output file.
The function call \*Cfseek\fR() failed.
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_SEEKBLANK fseek() error on file '%s'; file contains possibly only blank lines.
$nexp ERRMSG_SEEKBLANK
fseek() error on file \*Vfile\fP; file contains possibly only blank lines.
.PP
As part of the message text file processing, trailing blank lines
produced by nroff are removed.
From the information returned by the function call \*Cfseek\fR, the
output file produced by nroff contains only blanks lines.
The function call \*Cfseek\fR() failed.
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_TRUNCNROFF Error truncating nroff output file '%s'.
$nexp ERRMSG_TRUNCNROFF
Error truncating nroff output file \*Vfile\fP.
.PP
As part of the message text file processing, trailing blank lines
produced by nroff are removed.
An internal error occurred in truncating the nroff output file after
the blank lines are removed.
The function call \*Cftruncate\fR() failed.
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_FOPENPROCF Cannot open the now processed message file '%s'.
$nexp ERRMSG_FOPENPROCF
Cannot open the now processed message file \*Vmsgfile\fP.
.PP
An internal error occurred in opening the pre-processed message file.
The function call \*Cfopen\fR() failed.
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_EXPLAINUSAGE Usage: explain groupcode-msgnumber
$nexp ERRMSG_EXPLAINUSAGE
Usage: explain groupcode-msgnumber
.PP
Either an incomplete command line or an unrecognized option was entered
with the \*Cexplain\fR utility.
.PP
For details about the \*Cexplain\fR utility, enter the following command line:
.CS
man explain
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_MSGIDENT %s-%s is not a valid message identifier.
$nexp ERRMSG_MSGIDENT
\*Vgroupcode\fP-\*Vmsgnumber\fP is not a valid message identifier.
.PP
The message identifier specified to the \*Cexplain\fR
utility \*Vgroupcode\fP-\*Vmsgnumber\fP was not valid.
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_EXPCATOPEN Cannot open explanation catalog for message group '%s'.
$nexp ERRMSG_EXPCATOPEN
Cannot open explanation catalog for message group \*Vgroupcode\fP.
.PP
The \*Cexplain\fR utility could not access the explanation catalog
specified by the group \*Vgroup\fR.
Check the value of the NLSPATH environment variable if it is set
to ensure that the path name of the catalog is in the message system
search path.
See the \*Ccatopen\fR(3C) man page for a description of the NLSPATH variable.
The function call \*Ccatopen\fR failed.
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_NOEXPMSG No explanation available for %s-%s.
$nexp ERRMSG_NOEXPMSG
No explanation available for \*Vgroupcode\fP-\*Vmsgnumber\fP.
.PP
The \*Cexplain\fR utility could not access the explanation catalog
specified by the group \*Vgroupcode\fR or the explanation specified by
message number \*Vmsgnumber\fR was not found.
Check the value of the NLSPATH environment variable if it is set
to ensure that the path name of the catalog is in the message system
search path.
See the \*Ccatopen\fR(3C) man page for a description of the NLSPATH variable.
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_NL_MALLOC Cannot open explanation catalog, catopen() unable to allocate memory for internal structures.
$nexp ERRMSG_NL_MALLOC
Cannot open explanation catalog, catopen() unable to allocate memory for internal structures.
.PP
The \*Cexplain\fR utility cannot open the explanation catalog.
The library function call catopen() failed.
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_NL_MAXOPEN Cannot open explanation catalog, too many message catalogs are open.
$nexp ERRMSG_NL_MAXOPEN
Cannot open explanation catalog, too many message catalogs are open.
.PP
The \*Cexplain\fR utility cannot open the explanation catalog. The per
program limit NL_MAX_OPEN of open catalogs has been reached.
NL_MAX_OPENED is defined in /usr/include/nl_types.h.
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_NL_MAP Cannot open explanation catalog, mmap() cannot map the explanation catalog.
$nexp ERRMSG_NL_MAP
Cannot open explanation catalog, mmap() cannot map the explanation catalog.
.PP
The \*Cexplain\fR utility cannot open the explanation catalog. The mmap()
system call could not map the explanation catalog into memory.
.ME
$ -----------------------------------------------------------------------
$msg ERRMSG_NL_HEADER Cannot open explanation catalog, incorrect file header.
$nexp ERRMSG_NL_HEADER
Cannot open explanation catalog, incorrect file header.
.PP
The \*Cexplain\fR utility cannot open the explanation catalog. The explanation catalog header has incorrect information and could be corrupt.
$ -----------------------------------------------------------------------
$msg ERRMSG_NROFF The message file contains $nexp symbols, but '%s' cannot be found.
$nexp ERRMSG_NROFF
The message file contains $nexp symbols, but \*Vfile\fP cannot be found.
.PP
\*Ccaterr\fR found $nexp symbols in the message file. nroff is needed to
process these explanations, but could not be found. If the explanations
do not contain nroff formatting, $exp symbols may be used instead of $nexp
symbols.
.ME
+199
View File
@@ -0,0 +1,199 @@
/*
*
* Copyright 1997, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
#ident "$Header: /proj/irix6.5.7m/isms/eoe/cmd/message_system/RCS/explain.c,v 1.6 1997/06/23 20:31:17 bforney Exp $"
/*
* explain: IRIX message explanation display tool
*
* explain msgid
*
* Explain gets one message identifier from the command line then breaks the id
* into group code and message number. It opens the message catalog for the
* indicated group and retrieves the numbered message from the explanation set.
* If the output device is a tty, "more" (or a user specified PAGER) is used to
* page the output.
*
* Tabs are set up to be read with tab spacing = 3
*/
#include <malloc.h>
#define __NLS_INTERNALS 1
#include <nl_types.h>
#undef __NLS_INTERNALS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "errmsg.h"
#include <errno.h>
#include <dirent.h>
#include <sys/param.h>
#define MORE "more -s" /* default paging filter */
#define CMDCAT "msgsys.cat"
#define SYSCAT ""
#define EXPLAIN_CAT_EXT ".exp"
#define MESSAGE_CAT_EXT ".cat"
void catopenErrMsg(int, const char *);
void
main(int argc, char **argv)
{
char *cmdname; /* pointer to command invocation name */
char *gptr; /* pointer to group code name */
char *nptr; /* pointer to message number string */
char *mptr; /* pointer to explanation in message buffer */
char *junk; /* miscellaneous pointer */
char *pager; /* pointer to pager string */
char nbuff[MAXPATHLEN]; /* character manipulation buffer */
FILE *pfd; /* pipe file descriptor */
int bufsize = 2000; /* explanation buffer size */
int msgno; /* message number value */
int catopenErr;
nl_catd catd = (nl_catd)-1; /* catalog descriptor */
char path[NL_MAXPATHLEN];
char exp_filepath[NL_MAXPATHLEN];
/* Get command and validate number of arguments */
if (cmdname = strrchr(argv[0], '/'))
++cmdname;
else
cmdname = argv[0];
if (argc < 2 || argc > 3) {
_cmdmsg(ERRMSG_EXPLAINUSAGE, 0, "ERROR", cmdname, CMDCAT,
SYSCAT);
exit(1);
}
/* Get group code and message number from arguments */
if (argc == 2) {
gptr = argv[1];
if (nptr = strchr(argv[1], '-'))
*nptr++ = '\0';
else {
nptr = argv[1] + strcspn(argv[1], "0123456789");
junk = nbuff;
while (*nptr != '\0') {
*junk++ = *nptr;
*nptr++ = '\0';
}
*junk = '\0';
nptr = nbuff;
}
}
else {
gptr = argv[1];
nptr = argv[2];
}
msgno = strtol(nptr, &junk, 10);
if (!junk || junk == nptr || strlen(gptr) == 0) {
_cmdmsg(ERRMSG_MSGIDENT, 0, "ERROR", cmdname, CMDCAT,
SYSCAT, gptr, nptr);
exit(1);
}
if ((mptr = _cat_name(gptr, path, 0, NL_MAXPATHLEN )) != 0) {
char *temp;
/* check for a MESSAGE_CAT_EXT string at the end of the file
path. If it exists, don't copy it. */
if ((temp = strstr(mptr, MESSAGE_CAT_EXT)) != NULL) {
strncpy(exp_filepath, mptr, temp-mptr);
exp_filepath[temp-mptr] = '\0';
} else {
strcpy(exp_filepath, mptr);
}
strcat(exp_filepath, EXPLAIN_CAT_EXT);
catd = catopen(exp_filepath, 0);
}
if (catd == (nl_catd)-1) {
catopenErr= __catopen_error_code();
if (catopenErr < 0) {
catopenErrMsg(catopenErr, cmdname);
} else {
_cmdmsg(ERRMSG_EXPCATOPEN, catopenErr, "ERROR", cmdname, CMDCAT,
SYSCAT, gptr);
}
exit(1);
}
/* Read explanation from catalog and print it. More than one read may
* be required to insure that the entire message comes in */
mptr = catgets(catd, NL_EXPSET, msgno, NULL);
if (mptr == NULL) {
_cmdmsg(ERRMSG_NOEXPMSG, 0, "ERROR", cmdname,
CMDCAT, SYSCAT, gptr, nptr);
exit(1);
}
/* If stdout is a tty, pipe the output thru the pager. Otherwise, write
* directly to stdout.
*/
if (isatty(fileno(stdout))) {
if ((pager = getenv("PAGER")) == NULL)
pager = MORE;
if ((pfd = popen(pager, "w")) == NULL) {
_cmdmsg(CMD_POPEN, 0, "ERROR", cmdname, CMDCAT,
SYSCAT, pager);
exit(1);
}
fputs (mptr, pfd);
(void) pclose (pfd);
}
else
fputs (mptr, stdout);
catclose(catd);
exit(0);
}
void
catopenErrMsg(int CatOpenErr, const char *cmdname)
{
switch(CatOpenErr) {
case NL_ERR_MALLOC:
_cmdmsg(ERRMSG_NL_MALLOC, 0, "ERROR", cmdname,
CMDCAT, SYSCAT);
break;
case NL_ERR_MAXOPEN:
_cmdmsg(ERRMSG_NL_MAXOPEN, 0, "ERROR", cmdname,
CMDCAT, SYSCAT);
break;
case NL_ERR_MAP:
_cmdmsg(ERRMSG_NL_MAP, 0, "ERROR", cmdname,
CMDCAT, SYSCAT);
case NL_ERR_HEADER:
_cmdmsg(ERRMSG_NL_HEADER, 0, "ERROR", cmdname,
CMDCAT, SYSCAT);
break;
}
}
+901
View File
@@ -0,0 +1,901 @@
'\" Copyright 1997, Silicon Graphics, Inc.
'\" All Rights Reserved.
'\"
'\" This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
'\" the contents of this file may not be disclosed to third parties, copied or
'\" duplicated in any form, in whole or in part, without the prior written
'\" permission of Silicon Graphics, Inc.
'\"
'\" RESTRICTED RIGHTS LEGEND:
'\" Use, duplication or disclosure by the Government is subject to restrictions
'\" as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
'\" and Computer Software clause at DFARS 252.227-7013, and/or in similar or
'\" successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
'\" rights reserved under the Copyright Laws of the United States.
'\"
'\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\"
'\" '\"
'\" IRIX Message System Macro Package (tmac.sg) '\"
'\" copyright 1990, 1991, 1992, 1993, 1994 Cray Research, Inc. (CRI)'\"
'\" copyright 1997, Silicon Graphics, Inc. '\"
'\" '\"
'\" This macro package is intended exclusively for formatting '\"
'\" messages for the IRIX Message System. Neither its author nor '\"
'\" Silicon Graphics are responsible for the consequences of '\"
'\" attempting to use '\"
'\" it for anything else. '\"
'\" '\"
'\" If any problems are found in using it to format IRIX Message '\"
'\" System message text, after appropriate preprocessing by the '\"
'\" caterr(1) command, forward those problems to CRI's Software '\"
'\" division via standard SPR procedures '\"
'\" '\"
'\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\" '\"
'\" Registers possibly set via ?roff -r option:
'\" F register set to 1 on invocation means NewCenturySchoolBook font
'\" P register set to 1 on invocation means small manual (7" x 9")
'\" N register set to 1 on invocation means no section/subsection numbers
'\" Y register set to 1 on invocation prints RELEASE footer
'\" y register set to 1 on invocation prints DRAFT footer
'\"
'\" Test for ditroff or old troff (old troff has no Courier font):
.ft C
.nr cA \n(.f
.ft R
.ie \n(.f=\n(cA .nr cA 0 \" Courier not available
.el .nr cA 1 \" Courier is available
'\"####################### START STRING DEFINITIONS ############################
.ds x "\s-1\%CRAY\ X-MP\s+1
.ds 2 "\s-1\%CRAY-2\s+1
.ds e "\s-1\%CRAY\ X-MP\ EA\s+1
.ds y "\s-1\%CRAY\ Y-MP\s+1
.ds ys "\s-1\%CRAY\ Y-MP\ EL\s+1
.ds c9 "\s-1\%CRAY\ C90\s+1
.ds m "\%\s-1CRAY\ T3D\s+1
.ds YE "\s-1\%CRAY\ Y-MP/IOS-E\s+1
.ds Ie "\s-1\%IOS-E\s+1
.ds a "\\v'-2u*\\n(.sp/3u',\\v'2u*\\n(.sp/3u'
.ds Cr "Cray Research, Inc.
.ds Ca "\s-1CRI\s+1
.ds u "\s-1UNICOS\s+1
.ds UR "\*u\ \s-18.0\s+1
'\"
'\" NEW 8.0 STRINGS:
.ds UM \%\s-1UNICOS\s+1\ \s-1MAX\s+1
.ds MX \%\s-1MAX\s+1
.ds EL \%\s-1EL\s+1\ series
.ds EO \%\s-1EL\s+1\ \s-1IOS\s+1
.ds MP Cray \s-1MPP\s+1 systems
.ds ID \s-1IOS\s+1 models B, C, or D
.ds IE \s-1IOS\s+1 model\ E
.ds YM \%\s-1CRAY\s+1\ \s-1Y-MP\s+1 systems
'\"
'\" Man page section cross-reference strings:
.ds 11 "\s-1(1)\s+1
.ds 1b "\s-1(1B)\s+1
.ds 12 "\s-1(2)\s+1
.ds 3 "\s-1(3)\s+1
.ds 4 "\s-1(4)\s+1
.ds 4p "\s-1(4P)\s+1
.ds 5 "\s-1(5)\s+1
.ds 7 "\s-1(7)\s+1
.ds 8 "\s-1(8)\s+1
'\"
' \" Manual title strings:
.ds Ba "\fI\*u Basic Administration Guide\fR
.ds Ui "\fI\*u Installation Guide\fR
.ds Cc "\fI\*u User Commands Reference Manual\fR
.ds Cm "\fI\*u Administrator Commands Reference Manual\fR
.ds Cs "\fI\*u System Calls Reference Manual\fR
.ds l1 "\fI\*u Math and Scientific Library Reference Manual\fR
.ds l2 "\fI\*u Macros and Opdefs Reference Manual for \%\s-1CRAY\s+1-2 Computer Systems\fR
.ds l4 "\fI\*u Internal Library Reference Manual\fR
.ds l6 "\fI\*u C Library Reference Manual\fR
.ds l7 "\fI\*u Specialized Libraries Reference Manual\fR
.ds l9 "\fI\*u Fortran Library Reference Manual\fR
.ds Cp "\fI\*u File Formats and Special Files Reference Manual\fR
.ds Cx "\fI\*u System Administration\fR
.ds Ft "\fI\s-1CF77\s+1 Compiling System, Volume 1: Fortran Reference Manual\fR
.ds Ss "\fI\*u Source Code Control System (\s-1SCCS\s+1) User's Guide\fR
'\" Ag is for HP printer problem with Courier accent grave (`) character:
.ds Ag "\`
'\"######################## END STRING DEFINITIONS #############################
'\" NOTE: "\&" in Z string required to prevent psdit errors (8-27-91):
.ds Z "\&\!\p
.nr nQ 0 1 \" initialize counter for \*n string (see also .CR macro)
.ds n \\n+(nQ
'\"
'\" STRINGS AND FLAGS FOR INTERNAL USE:
.nr mD 0.2i \" Margin Distance--distance into the margin change bars are put.
.nr vA 0.6v \" Vertical Adjustment to length of change bars
.nr vO 1.3v \" vertical offset for change bars (amount to move UP)
.nr mL 0 \" initialize manual title string width register
.nr cL 0 \" initialize chapter title string width register
.nr 2F 0 \" initialize 2-column flag to false.
'\"-----------------------------------------------------------------------------
.de IZ \" INTERNAL: Initialization macro; executed before text file is read.
.nr bD 0 \" set Break Diversion flag to false
.nr pP 0 \" initialize page-counter for new sections to 0.
.nr nS 0 \" init. New Section Flag to true
.nr nH 1 \" init. No Header Flag to true
.if \\nY \{.ds Cf Cray Research, Inc.
. rm CF \}
.if \\ny \{.ie !\\nQ .ds Cf \\n(mo-\\n(dy-\\n(yr REVIEW DRAFT - CRI PRIVATE
. el .ds Cf CRI PRIVATE DRAFT
. rm CF \}
.ie t \{.ie \\n(cA \{.ds C \\&\\fC
. ds F \\&\\fC
. ds Cb \\&\\f(CB
. ds Co \\&\\f(CO
' \}
. el \{.ds C \\fB
. ds F \\fB
. ds Cb \\fB
. ds Co \\fB
' \}
. ds V \\&\\fI
. ds I \\*V
. ds z "\&\!\p
. ie !\\nP \{.nr LL 6.85i \" Default line length
. nr FM 1.2i \" Default footer margine
. nr BM \\n(FMu/2u
. nr VS 12 \" Default leading (interline spacing)
. nr PO 1.0i \" Default Page Offset (for odd-numbered pages)
' \} \" End case for normal-sized manual, start else for 7" x 9" manual:
. el \{.nr LL 5.675i \" Default line length
. nr FM 3.25i
. nr BM 2.63i
. nr VS 11 \" Default leading (interline spacing)
. nr PO 1.35i \" Default Page Offset (for odd-numbered pages)
' \} \" End case for small-sized manual (7" x 9")
. nr LT \\n(LLu
'\" HM defined here only for 1st page (w/.ST). At end of .ST, it's redefined:
. nr HM 1.4i
. ds Bu \s-1\(bu\s+1
. vs \\n(VS
. nr PD 0.12i \" Default inter-paragraph spacing
. nr PL 11i
. wh 0 NP
. wh -17i MC
. wh -15.5i 2%
. wh -\\n(FMu FO
. wh -\\n(BMu BT
' \}
.el \{.ds C \\fB
. ds F \\fB
. ds V \\fI
. ds I \\*V
. fp 5 C \" makes courier work in nroff
. fp 6 CB \" makes courier bold work in nroff
. nr LL 77n
. nr LT \\n(LLu
. nr nL \\n(LLu
. nr PO 4n
. nr FM 0
. nr HM 6v
. ds Bu *
. nr VS 12
. vs \\n(VS
. nr PD 26u
. nr PL 15i
. rn M0 MS
. rn M1 M#
. rn M2 ME
. rm PT NP FO BT HX BS BE CD 2S 2E 2% MC
' \}
.pl \\n(PLu
.ie !\\nP .nr PS 11 \" Default point size for normal-sized manual
.el .nr PS 10 \" Default point size for 7" x 9" manual
.ps \\n(PSp
.ll \\n(LLu
.nr SI 0 \" Standard Indent for 2-col message format...
'in \\n(SIu
.nh
.na
.ZN
'\" following are for .TL, .DL, .BL, & .NL:
.rr i0 i1 b1 l1 Z1
..
.de PT \" INTERNAL: Page Titles, called from .NP
'sp |\\n(HMu/2u
.lt \\n(LLu
.pc %
.ps 9p
.ie o .tl \\*(O1
.el .tl \\*(E2
.ev 1
.sp 5p
.po \\n(POu
.ie t \{.sp -1.2
\\s7\l'\\n(LLu'\\s0
' br \}
.el \l'\\n(LLu~'
.sp
.ev
.lt \\n(.lu
.ll \\n(LLu
..
.de NP \" INTERNAL: New Page macro
.nr iH 0 \" zero first-page flag for 2-column indexes (see .2S).
.if t \{.ie e \{.ie !\\nP .nr PO 0.65i \" Page offset for even page, reg. manual
. el .nr PO 1.36i \} \" Page offset for even page, 7" x 9" manual
. el \{.ie !\\nP .nr PO 1.0i \" Page offset for odd page, reg. manual
. el .nr PO 1.35i \} \} \" Page offset for odd page, 7" x 9" manual
.po \\n(POu
.nr eF \\n(.f
.nr eS \\n(.s
.ft 1
.ie !\\n(nH \{.PT
' sp |\\n(HMu \}
.el \{'sp |\\n(HMu/2u
. rr nH \}
.ps \\n(eS
'in \\n(eKu \" eK set in .FO to indent existing there & reinstated here
.ft \\n(eF
.rr eF eS eK
.os
.ns
.if \\n(aF .mk bS
.if \\n(2F \{.ch FO -15.5i
. nr iS \\n(HM
. nr 1F 1 \" set col-1 flag true
. nr SI 0 \" in case it's reset in .MS
' in 0
. ll \\n(nLu
. ch 2% -\\n(FMu \}
..
.de FO \" INTERNAL: FOoter macro
.if \\n(aF \{.nr bF \\n(.h \" This ends change bars where *text* ends on page
. CD
' \}
.nr eK \\n(.i \" DON'T Remove eK at end, .NP uses it to reinstate indent.
.if \\n(nH \&\c
'bp
..
.de BT \" INTERNAL: Bottom Title macro (does footer)
.nr eF \\n(.f
.nr eS \\n(.s
.ft 1
.ie !\\nP .ps 9 \" Footer point size for reg. manual
.el .ps 8 \" Footer point size for 7" x 9" manual
.lt \\n(LLu
.ie o .tl \fR\\*(Mn\fR\\*(Cf\\*(Sn%
.el .tl \\*(Sn%\fR\\*(Cf\fR\\*(Mn
.ft \\n(eF
.ps \\n(eS
.rr eF eS
..
.de TS \" EXTERNAL: Table Start macro
.nr eP \\n(.s
.br
.ul 0
.ti \\n(.iu
.SP
..
.de TE \" EXTERNAL: Table End macro
.SQ
.ps \\n(eP
.rr eP
..
.de MN \" EXTERNAL: Manual Number; Puts pub # in a string for footer
.ds Mn \\$1
..
.de CN \" EXTERNAL: Chapter Number (mostly for release notices)
.ds Sn "\\$1\^\-\^
.br
\s+1\fBI am a blank page \- recycle me.\fR\s-1
.pn 1
.bp
..
.de CF \" EXTERNAL: Center Footer; gets string for center of footer
.ds Cf \\$1
..
.de MT \" EXTERNAL: Manual Title; gets manual title string for headers
.nr mL \\w\\$1u
.nr sU \\n(LLu-\\n(mLu
.if \\n(sU<0 .ab #@ FORMAT ERROR, source file line \\n(.c: Manual title too long
.ds Mt \\$1
.rr sU
..
.de HD \" INTERNAL: Header Definitions; called in .ST, to set up headers
.ie (\\n(mLu+\\n(cLu)>\\n(LLu \{.ds O1 \fR\\*(Ct \\*(No
. ds E2 \fI\\*(Mt\fR
' \}
.el \{.ds O1 \fI\\*(Mt\fR\fR\\*(Ct \\*(No
. ds E2 \fR\\*(Ct \\*(No\fI\\*(Mt\fR
' \}
..
.de SF \" EXTERNAL: Section Front; section title w/o sect. numbering.
.nr N 1 \" Flag to turn off section numbering.
.ST "\\$1"
..
.de ST \" EXTERNAL: Section Title macro
'\" 1 argument: $1 - String for section title
.fl
.nr s0 +1 \" Increment section number
.nr tC \\n(s0
.af tC A \" set count and format for reg. used in TOC generation (.GA macro)
.if \\n(nlu>(\\n(HMu/2u) \{.nr nH 1 \" No Header flag so .NP doesn't do header
\&\c
' bp \}
.ie \\nN .ds No "
.el .ds No "[\\n(s0]
'in 0
.ll \\n(LLu
.ft R
.ad r
.ns
.ps \\n(PS-1 \" do this so \w[$1] is correct.
.br
.if \\n(nlu>(\\n(HMu/2u) .sp -1v \" absolute positioning doesn't work
.nr cL \\w\\$1 \\*(Nou
.ds Ct "\\$1
.ad r
'in 0
.ll \\n(LLu
.ps 24p
.vs 26p
\&\c
.sp -0.42i
\\$1 \\*(No
.fl
.vs \\n(VS
.ps \\n(PS
.ll \\n(LLu
'in 0
.ie t \{'\" Start drawing Thick Line
. ps 36
\l'\\n(LLu'
. sp -0.89v
\l'\\n(LLu'
. sp -0.89v
\l'\\n(LLu'
. sp -0.89v
\l'\\n(LLu'
. ps \\n(PS
. fl \} \" End drawing Thick Line (troff)
.el \l'\\n(LLu#'
'in \\n(SIu
.ad l
.fl
.ie !\\nP .sp |2.55i \" start of text after .ST for reg. manual
.el .sp |2.55i \" start of text after .ST for 7" x 9" manual
.fl
.ps \\n(PS
.HD
.nr HM 1.4i
.nr tA \\n(.pu-\\n(HMu-\\n(FMu
.rm No
.rr nH
..
.de SP \" EXTERNAL: space macro that doesn't reset anything like .PP
.sp \\n(PDu
.if !"\\$1"" .KT \\$1
..
.de SQ \" EXTERNAL: half paragraph space macro that doesn't reset anything:
.sp \\n(PDu/2u
.if !"\\$1"" .KT \\$1
..
.de PP \" EXTERNAL: Paragraph macro
'\" optional $1 is # output lines to keep together
.fl
.if !"\\$1"" .KT \\$1
.ZN \" Zeros .NL numbers & redefines list spacings (d0 & d1).
.ie t .sp \\n(PDu
.el .sp
'in 0
.CL
.ft R
..
.de CS \" EXTERNAL: Code-segment Start
.fl
.if n .in +5n
.sp 1v
.nf
.ft R
.if t \{.ie \\n(cA .ft C \" if hardcopy with ditroff change to Courier font
. el .cs R 22
' \}
..
.de CE \" EXTERNAL: Code-segment End
.fl
.if t \{.ie \\n(cA .ft R
. el .cs R
' \}
.if t .sp \\n(PDu/2u \" followed by .PP, this makes 1v--same as in .CS
.fi
.if n .in -5n
..
.de FP \" EXTERNAL: First Paragraph macro
.sp 3v
.vs \\n(VS
.fl
..
.de CH \" EXTERNAL: Column Headings; $1 = indent, $2 = Head1, $3 = Head2
.nr c1 1 \" set column heading flag to true.
.fl
.sp \\n(PDu
'br \" hep added this 11-30-89 to fix page-bottom space squishing
.fl
.ie "\\n(.z"" .if (\\n(nlu+\\n(FMu+4v)>\\n(.pu .sp \\n(.tu
.el \\!.if (\\n(nlu+\\n(FMu+4v)>\\n(.pu .sp \\n(.tu
.ds H1 \\$2
.ds h1 \\$3
.nr Z1 \\w\\$2u
.nr z1 \\w\\$3u
.ie (\\n(.lu-\\n(.iu-\\$1)<5n .nr hW \\$1u \" if Col2 < 5n, then Col1 = $1u
.el .nr hW \\$1n
.ie n .nr iW 17u*\\n(hWu/24u
.el .nr iW \\n(hW
.ie \\n(iW<(\\n(Z1u+3n) .nr w1 \\n(Z1u+3n
.el .nr w1 \\n(iW
.rr hW iW
.nr i0 \\n(.iu
.nr i1 \\n(.iu+\\n(w1u
.HC
\\$2
\\$3
.fl
.ie t \{.sp -0.73v
. nr eS \\n(.s
. HC
\\s8\l'\\n(Z1u'
\l'\\n(z1u'\\s0
' \}
.el \{.HC
\l'\\n(Z1u\-'
\l'\\n(z1u\-'
' \}
.fl
.rr eS
..
.de HC \" INTERNAL: Headings Continue; repeats col headings at page tops
'in 0
.fi
.it 1 T]
.di Tt
..
.de LP \" INTERNAL: Adjusts .TL indents based on .TL argument
.ie !\\n(w1 \{.ie \\$1<56 .nr iI \\$1*\\n(.s*4u
. el .nr iI \\$1
. if n \{.nr iJ 17u*\\n(iIu/24u
. nr iI \\n(iJ
. rm iJ \}
. nr i1 \\n(iIu
. nr Z1 \\n(iI
. rm iI \}
.el .nr w1 0
..
.de HX \" INTERNAL: Called to repeat col heads at page top.
.HC
\\*(H1
\\*(h1
.sp -0.73v
.fl
.ie t \{.nr eS \\n(.s
. HC
\\s8\l'\\n(Z1u'
\l'\\n(z1u'\\s0
' \}
.el \{.HC
\l'\\n(Z1u'
\l'\\n(z1u' \}
.fl
.sp \\n(d1u
..
.de TL \" EXTERNAL: Tagged List macro (analogous to .TP -man macro)
.fl
.ds Lo "
.if !"\\$1"" \{.ie "\\$1"d" .nr d1 \\n(PDu
. el \{.ie "\\$1"s" .nr d1 \\n(PDu/2u
. el .LP \\$1
' \} \}
.if !"\\$2"" \{.ie "\\$2"d" .nr d1 \\n(PDu
. el \{.ie "\\$2"s" .nr d1 \\n(PDu/2u
. el .ds Lo "KT \\$2
' \} \}
.if !"\\$3"" .ds Lo "KT \\$3
'\"
.if !\\n(i1 .nr i1 5n
'\"
.sp \\n(d1u
'br
.fl
.\\*(Lo
'\" Top-of-page check to repeat column heads:
.ie "\\n(.z"" .if \\n(nl<(\\n(HMu+0.71v) .if \\n(c1 .HX
.el \\!.if \\n(nl<(\\n(HMu+0.71v) .if \\n(c1 .HX
'in 0
.fi
.it 1 T]
.di Tt
..
.de T] \" INTERNAL: Tag Finish macro (completes .TL & .HC)
.br
.di
.ds Ss \&\\*(Tt\\
'in \\n(i1u
.ti \\n(i0u
.ie (\w\\*(Ssu+3p)>(\\n(i1u-\\n(i0u) \{.fi
\\*(Ss
. br \}
.el \\*(Ss\h'|\\n(i1u-\\n(i0u'\c
.rm Ss
..
.de BL \" EXTERNAL: Bullet macro (actually uses .TL)
.ie !\\n(b1 \{.nr b1 1
. if \\n(d1u<\\n(PDu .SQ
. ds La "2.9 \\$1 \\$2
'\}
.el .ds La "\\$1 \\$2
.TL \\*(La
\\*(Bu
.rm La
..
.de DL \" EXTERNAL: Dashed List macro
.ie !\\n(b1 \{.nr b1 1
. if \\n(d1u<\\n(PDu .SQ
. ds La "2.9 \\$1 \\$2
'\}
.el .ds La "\\$1 \\$2
.TL \\*(La
\-
.rm La
..
.de NL \" EXTERNAL: Numbered List macro
'\" $1 = counter character or "d" for double-spacing
'\" $2 = dist between tag & para; $3 'number' value at which to start
'\" $4 = d for double-spacing
.ie !"\\$2"" \{.ie "\\$1"d" .ds Ia \\$2 d
. el \{.ds Ia \\$2
. af l1 \\$1 \} \}
.el .ie !"\\$1"" \{.ds Ia 3.3
. ie "\\$1"a" .af l1 \\$1
. el .ie "\\$1"A" \{.ds Ia 4
. af l1 \\$1 \}
. el .ie "\\$1"i" \{.ds Ia 4.5
. af l1 \\$1 \}
. el .ie "\\$1"I" \{.ds Ia 5
. af l1 \\$1 \}
. el .if "\\$1"d" .ds Ia 3.3 d
. if \\n(l1<0 .nr l1 0 \}
.el .if "\\n(l1"0" .ds Ia 3.3
.if !"\\$3"" .nr l1 \\$3-1 \" subtracting one allows for +1 later:
.if "\\$4"d" .ds Ia "\\*(Ia d
.TL \\*(Ia
.nr l1 +1
\\n(l1.
.rm Ia
..
.de NN \" EXTERNAL: Resets .NL numbers for current indent level (iN=x)
.nr l1 0
.rm Ia
..
.de RN \" EXTERNAL: ReNumber macro; renumbers pages, figures, and tables.
'\" $2 page number is taken care of by the calling shell script (troff -n opt.)
.if !\\n(nS \{.if !\\$1 \{.nr fN \\$1-1 1 \" reset figure #'s
. if !\\$2 \{.if \\n%=1 .pn \\$2
. if !\\$3 \{.nr tN \\$3-1 1 \" reset table #'s
. if !\\$4 .nr s0 \\$4-1 \" reset sect. #'s
' \} \} \} \}
.if !\\$5\\g(s0 \{.af s0 \\$5 \" set format of section numbers, if new
. nr s0 \\$4-1 \} \" if format changes, then reset sec. #'s also.
..
.de SN \" EXTERNAL: Sequential Numbering macro (goes between sections)
.ie e .nr pA 1
.el \{.ie \\n(nl<(\\n(HMu+0.71v) .nr pA 0
. el .nr pA 2 \}
.nr nS 1 \" set New Section flag to true
.nr nH 1 \" set No Header flag to true (checked & reset in .NP)
.nr pP \\n%+\\n(pA
.pn \\n(pP \" set page # for cases of more than one section in one file.
.na
..
.de CL \" INTERNAL: CLear macro; clears various flags & strings
.rr b0 b1 c1 i0 i1 w1 Z1
.rm H1 h1 z1
.fi
..
'\" BEGIN TWO-COLUMN MACROS:
.de 2S \" EXTERNAL: Start 2-Column format:
.rn 2S 2s
.sp 1v
.if \\n(.tu<6.5v .sp \\n(.tu
.mk iS
.nr sF 1
.nr 2F 1 \" set 2-column Flag to true
.nr 1F 1 \" set Column-1 flag to true
.ch FO -15i
.ch 2% -\\n(FMu
.nr F2 \\n(.f \"Save existing text properties:
.nr I2 \\n(SI
.nr V2 \\n(VS
.nr P2 \\n(PS
.nr SI 0 \" must be reset for .TL to work in 2-col format.
'in \\n(SIu
.ie \\nF .nr PS 9 \" Use 9 pt. for NewCenturySchoolBook font
.el .nr PS 10 # Use bigger point size for the small default Times font
.ps \\n(PSp
'\" .nr VS \\n(PS+2
.nr VS 12
.vs \\n(VS
.nr nL (\\n(LLu-0.25i)/2u
.nr iD \\n(nLu+0.25i \" define second-column indent
.ll \\n(nLu
.br
.sp |\\n(iSu
.br
..
.de 2% \" INTERNAL: Ends column-1 in two-column format, starts col-2
.if \\n(aF \{.nr bF \\n(.h \" This ends change bars where *text* ends on page
. CD
' \}
.nr 1F 0 \" set col-1 flag false
.ch 2% -15.5i
.ch FO -\\n(FMu
.sp |\\n(iSu
.if \\n(aF .mk bS
.ll \\n(LLu
.nr SI \\n(iDu \" must be reset for .TL to work in 2-col format.
'in \\n(iDu
..
.de 2E \" EXTERNAL: End 2-column format:
.nr 2F 0 \" Set 2-col flag false
.ch 2% -15.5i \" set 2nd-col macro to deep space
.nr SI \\n(I2
.nr VS \\n(V2
.nr PS \\n(P2
.ft \\n(F2
.ps \\n(PS
.vs \\n(VS
'in \\n(SIu
.ll \\n(LLu
.rn 2s 2S
..
'\" END TWO-COLUMN MACROS
.de RS \" EXTERNAL: Revision Start
.ie \\n(.z \{.nr aF 1
. mk bS
' \}
.el \\!.RS
..
.de RE \" EXTERNAL: Revision End
.ie \\n(.z \{.CD
. rr aF
' \}
.el \\!.RE
..
.de CD \" INTERNAL: Called from .FO and .RE to draw change bars
.ie !\\n(1F .ch FO -14i
.el .ch 2% -15.5i
.if \\n(bD .ch MC -16i
.nr eI \\n(.iu
.nr hP \\n(.k \" save current Horizontal Position
.ev 2
.nr eS \\n(.s
.nr eJ \\n(.iu
.if (\\n(hPu+\w'\ n')>(\\n(LLu-\\n(.iu) \{.nr hP 0
. br \}
.mk vP \" save current Vertical Position
.fl
.if !\\n(bS .nr bS \\n(HM \" Just in case bS is unset somehow
.if !\\n(bF .nr bF \\n(nlu
.nr bV \\n(bFu+\\n(vAu-\\n(bSu
.if \\n(bV<0.5v .nr bV 0.75v
'in 0
.sp |\\n(bSu
.ps 36
.ie !\\n(1F \v'-\\n(vOu'\h'\\n(LLu-\\n(.iu+\\n(mDu'\L'\\n(bVu'\h'0.05c'\L'-\\n(bVu'
.el \v'-\\n(vOu'\h'|-\\n(mDu'\L'\\n(bVu'\h'-0.05c'\L'-\\n(bVu'
.ps \\n(eS
'in \\n(eJu
.sp |\\n(vPu
.if \\n(hP \h'\\n(hPu'\c
.ev
.ie !\\n(1F .ch FO -\\n(FMu
.el .ch 2% -\\n(FMu
.if \\n(bD .ch MC -\\n(FMu-2v
'in \\n(eIu
.rr bF bV eS eI hP vP
..
.de CR \" EXTERNAL: Counter Reset macro; resets counter accessed by \*n
'\" $1 is number at which to start count, $2 is type of counter character.
.ie !"\\$1"" \{.ie !"\\$3"" \{.nr n\\$3 (\\$1-1) 1
. .af n\\$3 \\$2 \}
. el \{.nr nQ (\\$1-1) 1
. if !"\\$2"" .af nQ \\$2 \} \}
.el .nr nQ 0 1
..
.de ZN \" INTERNAL: Zero Numbers; zeros .NL numbers. Called from .SH & .PP
.rr l0 l1
.ie t \{.nr d0 \\n(PDu/2u \" initialize inter-list spacing (.TL, .BL, etc):
. nr d1 \\n(PDu/2u \}
.el \{.nr d0 \\n(PDu
. nr d1 \\n(PDu \}
..
'\"-----------------------------------------------------------------------------
'\" START MESSAGE-SPECIFIC MACROS
'\"
.de KT \" EXTERNAL: Keep Together next $1 lines or inches of output (like .ne)
.fl
.ie !"\\n(.z"" \\!.KT \\$1
.el \{.ie 0\\$1>(\\n(tAu/\\n(VS) .nr kT 0\\$1u
. el .nr kT \\$1v
. if \\n(kTu<=\\n(tAu .if \\n(kTu>\\n(.tu .sp \\n(.tu
' \}
..
.de GC \" EXTERNAL: Defines 'group code' for one product's msgs.
.ds Gc "\\$1 \-
.nr SI 0
..
.de MC \" INTERNAL: Message Continued; puts note at pg bottom
.sp 1v
.fl
.ta \\n(nLuR
(continued)
'\" .ie \\n(1F \{ (continued next column)
'\" ' \}
'\" .el \{ (continued next page)
'\" ' \}
.fl
..
'\" START TROFF DEFINITIONS OF MESSAGE START/END MACROS:
.de MS \" EXTERNAL: Message Start; keeps together text for one message
'\" $1 is either "$exp" or msg-#
'\" $2 is either msg-# or optional "b"
'\" $3 is optional "b"
.fl
.ps 10p
.vs \\n(VS
.fi
.ie \\$1$exp \{.ds Gc "\\$1
. nr bD 1
. if !\\$2 \{.ds No "\\$2
. .if \\$3b .nr bD 1 \} \}
.el \{.ds No "\\$1
. if \\$2b .nr bD 1 \}
.di Kt
.ll \\n(nLu
'in 0
.ie !\\*(No \{\l'\\n(nLu'
\\*(Gc\\*(No
. sp -0.55v
\l'\\n(nLu'
' \}
.el \{\l'\\n(nLu'
. sp -0.1i
\l'\\n(nLu'
. sp 0.33v \}
.it 1 M#
.vs \\n(VS
.ps 10p
.ie \\n(cA .ft C
.el .ft B
..
.de M# \" INTERNAL: Returns to normal font & pt. size after message text done
.fl
.ft R
.ps \\n(PSp
.vs \\n(VS
..
.de ME \" EXTERNAL: Message End; ends .MS block
'\" $1 = amount to .KT after the message is printed
.br \" break and end diversion to "Kt"
.sp -1v
.di
.ie \\n(nlu>(\\n(iSu+1.9v) .sp 2.1v \" Shortest possible msg >= 1.9v
.el .sp |\\n(iSu
.if \\n(dnu>\\n(tAu .nr bD 1
.ie !\\n(bD .if \\n(dnu>=\\n(.tu .sp \\n(.tu
.el \{.if \\n(.tu<6.5v .sp \\n(.tu
. ch MC -\\n(FMu-2v \}
.ps \\n(PSp
.vs \\n(VS
.ie \\n(1F \{'in 0
. ll \\n(nLu \}
.el \{'in \\n(iDu
. ll \\n(LLu \}
.nf
\\*(Kt
.fl
.fi
.rm Kt No
.if \\n(bD \{.nr bD 0
. ch MC -17i \}
.if !\\$1 .KT \\$1
..
'\" END TROFF DEFINITIONS OF MESSAGE START/END MACROS:
'\"
'\" START NROFF DEFINITIONS OF MESSAGE START/END MACROS:
.de M0 \" EXTERNAL: NROFF Message Start; keeps together text for one message
'\" $1 is either "$exp" or msg-#
'\" $2 is either msg-# or optional "b"
'\" $3 is optional "b"
.vs \\n(VS
.fi
.ie \\$1$exp \{.ds Gc "\\$1
. nr bD 1
. if !\\$2 \{.ds No "\\$2
. .if \\$3b .nr bD 1 \} \}
.el \{.ds No "\\$1
. if \\$2b .nr bD 1 \}
.ll \\n(nLu
'in 0
.if !\\*(No \{\\*(Gc\\*(No
. br \}
.it 1 M#
.ft B
..
.de M1 \" INTERNAL: NROFF returns to normal font & pt. size after message text done
.fl
.ft R
..
.de M2 \" EXTERNAL: NROFF Message End; ends .MS block
'\" $1 = amount to .KT after the message is printed
.fl
.rm No
..
'\" END NROFF DEFINITIONS OF MESSAGE START/END MACROS:
'\"- - - - - - - - - - - - - Start -ms EQN macros
.de EQ \" EXTERNAL: start EQuation
'\" $1 = "C", "L", or "I"
'\" $2 =
'\" $3 = amount to move horizontally
'\" .ft 1 = roman, .ft 2= italic, .ft 3 = bold
.nr UR \\n(.u
.rm EE
.nr LE 1 \" default centered
.ds E! \fR\\$1\fP
.if \\$1C .ds E! \fR\\$2\fP
.if \\$1L \{.ds E! \fR\\$2\fP
. nr LE 0 \}
.if \\$1I \{.ds E! \fR\\$2\fP
. nr LE 0
. ds EE \\h'|10n'
. if !\\$3 .ds EE \\h'\\$3' \}
.di EZ
..
.de EN \" EXTERNAL: end EQuation
.if !\\*(10 .br
.di
.rm EZ
.nr dL \\n(dn
.ie \\n(dL .PP
.el .if !\\*(E! .nr dL 1
.ie "\\n(.z"" \{.if \\n(dL>0 .if !\\n(nl=\\n(PE .SQ
' \}
.el \{.if \\n(dL>0 .if !\\n(.d=\\n(PE .SQ
' \}
.pc
.if \\n(BD>0 .nr LE 0 \" can't mean centering in this case.
.if \\n(MK>0 .if \\n(LE=1 .ds EE \\h'|10n'
.if \\n(MK>0 .nr LE 0 \" don't center if mark/lineup
.lt \\n(.lu
.if \\n(EP=0 .if \\n(dL>0 \{\
. if \\n(LE>0 .tl \\*(10\\*(E!
. if \\n(LE=0 .if \\n(BD=0 .tl \\*(EE\\*(10\\*(E!
. if \\n(LE=0 .if \\n(BD>0 .if \\n(BD<\\w\\*(10 .nr BD \\w\\*(10
. if \\n(LE=0 .if \\n(BD>0 \!\\*(10\\t\\*(E!
.\}
.if \\n(EP>0 .if \\n(dL>0 \{\
. if \\n(LE>0 .tl \\*(E!\\*(10
. if \\n(LE=0 .if \\n(BD=0 .tl \\*(E!\\*(EE\\*(10
. if \\n(LE=0 .if \\n(BD>0 .if \\n(BD<\\w\\*(10 .nr BD \\w\\*(10
. if \\n(LE=0 .if \\n(BD>0 \!\\h'-\\\\n(.iu'\\*(E!\\h'|0'\\*(10
.\}
.lt \\n(LLu
.pc %
.if \\n(UR>0 .fi
.rm 10 11 12 13 14 15 16 17 18 19 20 21 22 23 E!
.rr 10 11 12 13 14 15 16 17 18 19 20 21 22 23
.if \\n(dL>0 .if t .SQ
.ie "\\n(.z"" .nr PE \\n(nl
.el .nr PE \\n(.d
..
'\" End EQN macros
'\"
'\" END ALL MACRO DEFINITIONS; set print defaults:
'\"
.co \" WHAT DOES THIS DO?
.IZ
.rm IZ
+5
View File
@@ -0,0 +1,5 @@
VERSION = troot
OBJECT_STYLE = N32
VCOPTS = -non_shared
VLDOPTS = -nostdlib -L$(ROOT)/usr/lib32/mips3/nonshared -L$(ROOT)/usr/lib32/nonshared
COMMANDS = caterr explain
+4
View File
@@ -0,0 +1,4 @@
VERSION = n32bit
OBJECT_STYLE = N32
VLDOPTS = -nostdlib
COMMANDS = explain caterr