diff options
Diffstat (limited to 'usr/src/cmd')
| -rw-r--r-- | usr/src/cmd/fmt/fmt.c | 93 | ||||
| -rw-r--r-- | usr/src/cmd/fmt/head.c | 324 | ||||
| -rwxr-xr-x | usr/src/cmd/fmt/inc.flg | 30 | ||||
| -rw-r--r-- | usr/src/cmd/mail/Makefile | 4 | ||||
| -rw-r--r-- | usr/src/cmd/mail/add_recip.c | 20 | ||||
| -rw-r--r-- | usr/src/cmd/mail/copylet.c | 18 | ||||
| -rw-r--r-- | usr/src/cmd/mail/getcomment.c | 17 | ||||
| -rw-r--r-- | usr/src/cmd/mail/gethead.c | 33 | ||||
| -rw-r--r-- | usr/src/cmd/mail/islocal.c | 10 | ||||
| -rw-r--r-- | usr/src/cmd/mail/istext.c | 16 | ||||
| -rw-r--r-- | usr/src/cmd/mail/maid.c | 29 | ||||
| -rw-r--r-- | usr/src/cmd/mail/mail.h | 15 | ||||
| -rw-r--r-- | usr/src/cmd/mail/main.c | 14 | ||||
| -rw-r--r-- | usr/src/cmd/mail/parse.c | 17 | ||||
| -rw-r--r-- | usr/src/cmd/mail/pckaffspot.c | 13 | ||||
| -rw-r--r-- | usr/src/cmd/mail/pckrcvspot.c | 13 | ||||
| -rw-r--r-- | usr/src/cmd/mail/pipletr.c | 16 | ||||
| -rw-r--r-- | usr/src/cmd/mail/printhdr.c | 22 | ||||
| -rw-r--r-- | usr/src/cmd/mail/sel_disp.c | 14 | ||||
| -rw-r--r-- | usr/src/cmd/mail/sendlist.c | 22 | ||||
| -rw-r--r-- | usr/src/cmd/tar/tar.c | 4 |
21 files changed, 229 insertions, 515 deletions
diff --git a/usr/src/cmd/fmt/fmt.c b/usr/src/cmd/fmt/fmt.c index 28e035a258..816b8a3f89 100644 --- a/usr/src/cmd/fmt/fmt.c +++ b/usr/src/cmd/fmt/fmt.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 1997 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -47,7 +47,7 @@ * Author: Kurt Shoens (UCB) 12/7/78 */ -#define NOSTR ((wchar_t *) 0) /* Null string pointer for lint */ +#define NOSTR ((wchar_t *)0) /* Null string pointer for lint */ #define MAXLINES 100 /* maximum mail header lines to verify */ wchar_t outbuf[BUFSIZ]; /* Sandbagged output line image */ @@ -85,12 +85,25 @@ enum hdr_type hdr_state = not_in_hdr; wchar_t *hdrbuf[MAXLINES]; /* buffer to hold potential mail header lines */ int h_lines; /* index into lines of hdrbuf */ -int (*(split))(); +void (*(split))(wchar_t []); extern int scrwidth(wchar_t); +extern int ishead(char []); -static void fill_hdrbuf(wchar_t line[]); + +static void fill_hdrbuf(wchar_t []); static void header_chk(void); static void process_hdrbuf(void); +static void leadin(void); +static void tabulate(wchar_t []); +static void oflush(void); +static void pack(wchar_t []); +static void msplit(wchar_t []); +static void csplit(wchar_t []); +static void _wckind_init(void); +static void prefix(wchar_t []); +static void fmt(FILE *); +static int setopt(char *); +int _wckind(wchar_t); /* * Drive the whole formatter by managing input files. Also, @@ -98,15 +111,14 @@ static void process_hdrbuf(void); * at the end. */ +int main(int argc, char **argv) { - register FILE *fi; + FILE *fi; char sobuf[BUFSIZ]; - register char *cp; + char *cp; int nofile; char *locale; - int csplit(), msplit(); - void _wckind_init(); outp = NOSTR; setbuf(stdout, sobuf); @@ -116,7 +128,7 @@ main(int argc, char **argv) split = csplit; } else { split = msplit; - (void) _wckind_init(); + _wckind_init(); } if (argc < 2) { single: @@ -141,8 +153,7 @@ single: if (nofile) goto single; oflush(); - exit(errs); - /* NOTREACHED */ + return (errs); } /* @@ -151,11 +162,12 @@ single: * and sending each line down for analysis. */ +static void fmt(FILE *fi) { wchar_t linebuf[BUFSIZ], canonb[BUFSIZ]; - register wchar_t *cp, *cp2; - register int col; + wchar_t *cp, *cp2; + int col; wchar_t c; char cbuf[BUFSIZ]; /* stores wchar_t string as char string */ @@ -282,11 +294,11 @@ fmt(FILE *fi) * it on a line by itself. */ +static void prefix(wchar_t line[]) { - register wchar_t *cp; - register int np; - register int i; + wchar_t *cp; + int np; int nosplit = 0; /* flag set if line should not be split */ if (line[0] == L'\0') { @@ -368,9 +380,10 @@ prefix(wchar_t line[]) * line packer. */ +static void csplit(wchar_t line[]) { - register wchar_t *cp, *cp2; + wchar_t *cp, *cp2; wchar_t word[BUFSIZ]; static const wchar_t *srchlist = (const wchar_t *) L".:!?"; @@ -406,9 +419,10 @@ csplit(wchar_t line[]) } } +static void msplit(wchar_t line[]) { - register wchar_t *cp, *cp2, prev; + wchar_t *cp, *cp2, prev; wchar_t word[BUFSIZ]; static const wchar_t *srchlist = (const wchar_t *) L".:!?"; @@ -469,10 +483,11 @@ msplit(wchar_t line[]) * just give it its own and hope for the best. */ +static void pack(wchar_t word[]) { - register wchar_t *cp; - register int s, t; + wchar_t *cp; + int s, t; if (outp == NOSTR) leadin(); @@ -496,6 +511,7 @@ pack(wchar_t word[]) * line prefix. */ +static void oflush(void) { if (outp == NOSTR) @@ -510,10 +526,11 @@ oflush(void) * output on standard output (finally). */ +static void tabulate(wchar_t line[]) { - register wchar_t *cp, *cp2; - register int b, t; + wchar_t *cp; + int b, t; /* Toss trailing blanks in the output line */ @@ -544,11 +561,12 @@ tabulate(wchar_t line[]) * leading blanks. */ -leadin() +static void +leadin(void) { - register int b; - register wchar_t *cp; - register int l; + int b; + wchar_t *cp; + int l; switch (crown_state) { case c_head: @@ -580,6 +598,7 @@ leadin() * Is s1 a prefix of s2?? */ +static int ispref(wchar_t *s1, wchar_t *s2) { @@ -593,8 +612,8 @@ ispref(wchar_t *s1, wchar_t *s2) * Set an input option */ -setopt(cp) - register char *cp; +static int +setopt(char *cp) { static int ws = 0; @@ -628,14 +647,14 @@ setopt(cp) #define LIB_WDRESOLVE "/usr/lib/locale/%s/LC_CTYPE/wdresolve.so" #define WCHKIND "_wdchkind_" -static int _wckind_c_locale(); +static int _wckind_c_locale(wchar_t); -static int (*__wckind)() = _wckind_c_locale; +static int (*__wckind)(wchar_t) = _wckind_c_locale; static void *dlhandle = NULL; -void -_wckind_init() +static void +_wckind_init(void) { char *locale; char path[MAXPATHLEN + 1]; @@ -653,7 +672,7 @@ _wckind_init() (void) sprintf(path, LIB_WDRESOLVE, locale); if ((dlhandle = dlopen(path, RTLD_LAZY)) != NULL) { - __wckind = (int (*)(int))dlsym(dlhandle, WCHKIND); + __wckind = (int (*)(wchar_t))dlsym(dlhandle, WCHKIND); if (__wckind != NULL) return; (void) dlclose(dlhandle); @@ -666,16 +685,14 @@ c_locale: int -_wckind(wc) -wchar_t wc; +_wckind(wchar_t wc) { return (*__wckind) (wc); } static int -_wckind_c_locale(wc) -wchar_t wc; +_wckind_c_locale(wchar_t wc) { int ret; @@ -732,7 +749,7 @@ header_chk(void) for (l = 0; l < h_lines; l++) { /* skip initial blanks */ for (cp = hdrbuf[l]; *cp == L' '; cp++); - for (hp = &headnames[0]; *hp != (wchar_t *) 0; hp++) + for (hp = &headnames[0]; *hp != (wchar_t *)0; hp++) if (ispref(*hp, cp)) { hdrcount++; break; diff --git a/usr/src/cmd/fmt/head.c b/usr/src/cmd/fmt/head.c deleted file mode 100644 index 12f44beac0..0000000000 --- a/usr/src/cmd/fmt/head.c +++ /dev/null @@ -1,324 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 1988 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ - -/* - * University Copyright- Copyright (c) 1982, 1986, 1988 - * The Regents of the University of California - * All Rights Reserved - * - * University Acknowledgment- Portions of this document are derived from - * software developed by the University of California, Berkeley, and its - * contributors. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "rcv.h" - -/* - * mailx -- a modified version of a University of California at Berkeley - * mail program - * - * Routines for processing and detecting headlines. - */ - -/* - * See if the passed line buffer is a mail header. - * Return true if yes. Note the extreme pains to - * accomodate all funny formats. - */ - -extern int debug; - -ishead(linebuf) - char linebuf[]; -{ - register char *cp; - struct headline hl; - char parbuf[BUFSIZ]; - - cp = linebuf; - if (strncmp("From ", cp, 5) != 0) - return(0); - parse(cp, &hl, parbuf); - if (hl.l_from == NOSTR || hl.l_date == NOSTR) { - fail(linebuf, "No from or date field"); - return(0); - } -#ifdef notdef - /* - * Seems to be no reason to be so fussy. - */ - if (!Tflag && !isdate(hl.l_date)) { - fail(linebuf, "Date field not legal date"); - return(0); - } -#endif - - /* - * I guess we got it! - */ - - return(1); -} - -fail(linebuf, reason) - char linebuf[], reason[]; -{ - - if (debug) - (void)fprintf(stderr, "\"%s\"\nnot a header because %s\n", linebuf, reason); -} - -/* - * Split a headline into its useful components. - * Copy the line into dynamic string space, then set - * pointers into the copied line in the passed headline - * structure. Actually, it scans. - */ - -parse(line, hl, pbuf) - char line[], pbuf[]; - struct headline *hl; -{ - register char *cp, *dp; - char *sp; - char word[LINESIZE]; - - hl->l_from = NOSTR; - hl->l_tty = NOSTR; - hl->l_date = NOSTR; - cp = line; - sp = pbuf; - - /* - * Skip the first "word" of the line, which should be "From" - * anyway. - */ - - cp = nextword(cp, word); - dp = nextword(cp, word); - if (dp == NOSTR) - return; - if (!equal(word, "")) - hl->l_from = copyin(word, &sp); - if (strncmp(dp, "tty", 3) == 0) { - cp = nextword(dp, word); - hl->l_tty = copyin(word, &sp); - if (cp != NOSTR) - hl->l_date = copyin(cp, &sp); - } - else - if (dp != NOSTR) - hl->l_date = copyin(dp, &sp); -} - -/* - * Copy the string on the left into the string on the right - * and bump the right (reference) string pointer by the length. - * Thus, dynamically allocate space in the right string, copying - * the left string into it. - */ - -char * -copyin(src, space) - char src[]; - char **space; -{ - register char *cp, *top; - register int s; - - s = strlen(src); - cp = *space; - top = cp; - (void)strcpy(cp, src); - cp += s + 1; - *space = cp; - return(top); -} - -#ifdef notdef -/* - * Test to see if the passed string is a ctime(3) generated - * date string as documented in the manual. The template - * below is used as the criterion of correctness. - * Also, we check for a possible trailing time zone using - * the auxtype template. - */ - -#define L 1 /* A lower case char */ -#define S 2 /* A space */ -#define D 3 /* A digit */ -#define O 4 /* An optional digit or space */ -#define C 5 /* A colon */ -#define N 6 /* A new line */ -#define U 7 /* An upper case char */ - -char ctypes[] = {U,L,L,S,U,L,L,S,O,D,S,D,D,C,D,D,C,D,D,S,D,D,D,D,0}; -char tmztypes[] = {U,L,L,S,U,L,L,S,O,D,S,D,D,C,D,D,C,D,D,S,U,U,U,S,D,D,D,D,0}; - -isdate(date) - char date[]; -{ - register char *cp; - - cp = date; - if (cmatch(cp, ctypes)) - return(1); - return(cmatch(cp, tmztypes)); -} - -/* - * Match the given string against the given template. - * Return 1 if they match, 0 if they don't - */ - -cmatch(str, temp) - char str[], temp[]; -{ - register char *cp, *tp; - register int c; - - cp = str; - tp = temp; - while (*cp != '\0' && *tp != 0) { - c = *cp++; - switch (*tp++) { - case L: - if (c < 'a' || c > 'z') - return(0); - break; - - case U: - if (c < 'A' || c > 'Z') - return(0); - break; - - case S: - if (c != ' ') - return(0); - break; - - case D: - if (!isdigit(c)) - return(0); - break; - - case O: - if (c != ' ' && !isdigit(c)) - return(0); - break; - - case C: - if (c != ':') - return(0); - break; - - case N: - if (c != '\n') - return(0); - break; - } - } - if (*cp != '\0' || *tp != 0) - return(0); - return(1); -} -#endif - -/* - * Collect a liberal (space, tab delimited) word into the word buffer - * passed. Also, return a pointer to the next word following that, - * or NOSTR if none follow. - */ - -char * -nextword(wp, wbuf) - char wp[], wbuf[]; -{ - register char *cp, *cp2; - - if ((cp = wp) == NOSTR) { - (void)copy("", wbuf); - return(NOSTR); - } - cp2 = wbuf; - while (!any(*cp, " \t") && *cp != '\0') - if (*cp == '"') { - *cp2++ = *cp++; - while (*cp != '\0' && *cp != '"') - *cp2++ = *cp++; - if (*cp == '"') - *cp2++ = *cp++; - } else - *cp2++ = *cp++; - *cp2 = '\0'; - while (any(*cp, " \t")) - cp++; - if (*cp == '\0') - return(NOSTR); - return(cp); -} - -/* - * Copy str1 to str2, return pointer to null in str2. - */ - -char * -copy(str1, str2) - char *str1, *str2; -{ - register char *s1, *s2; - - s1 = str1; - s2 = str2; - while (*s1) - *s2++ = *s1++; - *s2 = 0; - return(s2); -} - -/* - * Is ch any of the characters in str? - */ - -any(ch, str) - char *str; -{ - register char *f; - register c; - - f = str; - c = ch; - while (*f) - if (c == *f++) - return(1); - return(0); -} - diff --git a/usr/src/cmd/fmt/inc.flg b/usr/src/cmd/fmt/inc.flg new file mode 100755 index 0000000000..c223ee0e7e --- /dev/null +++ b/usr/src/cmd/fmt/inc.flg @@ -0,0 +1,30 @@ +#!/bin/sh +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License, Version 1.0 only +# (the "License"). You may not use this file except in compliance +# with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. + +#ident "%Z%%M% %I% %E% SMI" + +echo_file usr/src/cmd/mailx/Makefile +echo_file usr/src/cmd/mailx/head.c +find_files "*.h" usr/src/cmd/mailx/hdr diff --git a/usr/src/cmd/mail/Makefile b/usr/src/cmd/mail/Makefile index edc35db692..648d786859 100644 --- a/usr/src/cmd/mail/Makefile +++ b/usr/src/cmd/mail/Makefile @@ -21,7 +21,7 @@ # # # -# Copyright 1989, 2002 Sun Microsystems, Inc. All rights reserved. +# Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" @@ -51,7 +51,7 @@ MAILOBJS= add_recip.o cat.o ckdlivopts.o \ pickFrom.o pipletr.o poplist.o printhdr.o printmail.o \ pushlist.o savehdrs.o sel_disp.o sendlist.o \ sendmail.o setsig.o \ - stamp.o Tout.o maid.o + stamp.o Tout.o MAILSRC= $(MAILOBJS:%.o=%.c) diff --git a/usr/src/cmd/mail/add_recip.c b/usr/src/cmd/mail/add_recip.c index 29159034a1..13fb8519b3 100644 --- a/usr/src/cmd/mail/add_recip.c +++ b/usr/src/cmd/mail/add_recip.c @@ -19,19 +19,23 @@ * * CDDL HEADER END */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ #pragma ident "%Z%%M% %I% %E% SMI" - /* SVr4.0 1.5 */ /* NAME add_recip, madd_recip - add recipients to recipient list SYNOPSIS int add_recip(reciplist *plist, char *name, int checkdups) - int madd_recip(reciplist *plist, char *name, int checkdups) + void madd_recip(reciplist *plist, char *name, int checkdups) DESCRIPTION add_recip() adds the name to the recipient linked list. @@ -44,10 +48,8 @@ #include "mail.h" -add_recip (plist, name, checkdups) -reciplist *plist; -char *name; -int checkdups; +int +add_recip(reciplist *plist, char *name, int checkdups) { char *p; static char pn[] = "add_recip"; @@ -95,10 +97,8 @@ int checkdups; return(1); } -madd_recip (plist, namelist, checkdups) -reciplist *plist; -char *namelist; -int checkdups; +void +madd_recip(reciplist *plist, char *namelist, int checkdups) { char *name; for (name = strtok(namelist, " \t"); name; name = strtok((char*)0, " \t")) diff --git a/usr/src/cmd/mail/copylet.c b/usr/src/cmd/mail/copylet.c index 2e61f9b1f2..63e02034b4 100644 --- a/usr/src/cmd/mail/copylet.c +++ b/usr/src/cmd/mail/copylet.c @@ -19,18 +19,18 @@ * * CDDL HEADER END */ -/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ - - /* - * Copyright 2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ +/* All Rights Reserved */ + #pragma ident "%Z%%M% %I% %E% SMI" #include "mail.h" + /* NAME copylet - copy a given letter to a file pointer @@ -49,8 +49,8 @@ Returns TRUE on a completely successful copy. */ -copylet(letnum, f, type) -register FILE *f; +int +copylet(int letnum, FILE *f, int type) { int pos = ftell(f); int rc = xxxcopylet(letnum, f, type); @@ -68,8 +68,8 @@ register FILE *f; return(rc); } -xxxcopylet(letnum, f, type) -register FILE *f; +int +xxxcopylet(int letnum, FILE *f, int type) { static char pn[] = "copylet"; char buf[LSIZE], lastc; diff --git a/usr/src/cmd/mail/getcomment.c b/usr/src/cmd/mail/getcomment.c index ff258f31e9..ac8674c066 100644 --- a/usr/src/cmd/mail/getcomment.c +++ b/usr/src/cmd/mail/getcomment.c @@ -19,12 +19,17 @@ * * CDDL HEADER END */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ #pragma ident "%Z%%M% %I% %E% SMI" - /* SVr4.0 2. */ + #include "mail.h" /* * Get comment field, if any, from line. @@ -33,12 +38,12 @@ * -1 ==> no closing (terminating) paren found for comment. */ -getcomment(s, q) -register char *s; -register char *q; /* Copy comment, if found, to here */ +int +getcomment(char *s, char *q) + /* Copy comment, if found, to q */ { - register char *p, *sav_q; - register int depth = 0; + char *p, *sav_q; + int depth = 0; if ((p = strchr(s, '(')) == (char *)NULL) { /* no comment found */ diff --git a/usr/src/cmd/mail/gethead.c b/usr/src/cmd/mail/gethead.c index 6b72936efb..be671b8a23 100644 --- a/usr/src/cmd/mail/gethead.c +++ b/usr/src/cmd/mail/gethead.c @@ -19,15 +19,14 @@ * * CDDL HEADER END */ -/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ - - /* - * Copyright 2002 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ +/* All Rights Reserved */ + #pragma ident "%Z%%M% %I% %E% SMI" #include "mail.h" @@ -200,7 +199,7 @@ gethead(int current, int all) } void -tmperr() +tmperr(void) { fclose(tmpf); errmsg(E_TMP, ""); @@ -210,8 +209,8 @@ tmperr() * Write a string out to tmp file, with error checking. * Return 1 on success, else 0 */ -wtmpf(str, length) -char *str; +int +wtmpf(char *str, int length) { if (fwrite(str, 1, length, tmpf) != length) { tmperr(); @@ -225,10 +224,7 @@ char *str; * return number of bytes in length */ int -getline(ptr2line, max, f) -char *ptr2line; -int max; -FILE *f; +getline(char *ptr2line, int max, FILE *f) { int i, ch; for (i = 0; i < max-1 && (ch = getc(f)) != EOF; ) @@ -241,7 +237,7 @@ FILE *f; * Make temporary file for letter */ void -mktmp() +mktmp(void) { static char tmpl[] = "/var/tmp/mailXXXXXX"; int fd = mkstemp(lettmp = tmpl); @@ -257,8 +253,8 @@ mktmp() * Get a number from user's reply, * return its value or zero if none present, -1 on error */ -getnumbr(s) -char *s; +int +getnumbr(char *s) { int k = 0; @@ -283,7 +279,8 @@ char *s; * If valid msgnum return 1, * else print message and return 0 */ -validmsg(i) +int +validmsg(int i) { if ((i < 0) || (i > nlet)) { printf("No such message\n"); @@ -296,9 +293,7 @@ validmsg(i) * Set letter to passed status, and adjust changed as necessary */ void -setletr(letter, status) -int letter; -int status; +setletr(int letter, int status) { if (status == ' ') { if (let[letter].change != ' ') diff --git a/usr/src/cmd/mail/islocal.c b/usr/src/cmd/mail/islocal.c index ae0a4772d5..508f6b7b70 100644 --- a/usr/src/cmd/mail/islocal.c +++ b/usr/src/cmd/mail/islocal.c @@ -19,6 +19,11 @@ * * CDDL HEADER END */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ @@ -30,9 +35,8 @@ /* * islocal (char *user, uid_t *puid) - see if user exists on this system */ -islocal(user, puid) -char *user; -uid_t *puid; +int +islocal(char *user, uid_t *puid) { char fname[MAXPATHLEN]; struct stat statb; diff --git a/usr/src/cmd/mail/istext.c b/usr/src/cmd/mail/istext.c index 799d51f159..72d5ce5d1d 100644 --- a/usr/src/cmd/mail/istext.c +++ b/usr/src/cmd/mail/istext.c @@ -19,23 +19,27 @@ * * CDDL HEADER END */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ -#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1. */ +#pragma ident "%Z%%M% %I% %E% SMI" + #include "mail.h" /* * istext(line, size) - check for text characters */ int -istext(s, size) -register unsigned char *s; -int size; +istext(unsigned char *s, int size) { - register unsigned char *ep; - register c; + unsigned char *ep; + int c; for (ep = s+size; --ep >= s; ) { c = *ep; diff --git a/usr/src/cmd/mail/maid.c b/usr/src/cmd/mail/maid.c deleted file mode 100644 index e2eb72780e..0000000000 --- a/usr/src/cmd/mail/maid.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ - - -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.5 */ -ma_id() { -static char mastamp[]="@{#}@{#} ma.sl 2.116"; -static char mawhat[]="@(#) ma.sl 2.116"; } diff --git a/usr/src/cmd/mail/mail.h b/usr/src/cmd/mail/mail.h index e22a541778..35c3296ee5 100644 --- a/usr/src/cmd/mail/mail.h +++ b/usr/src/cmd/mail/mail.h @@ -19,15 +19,14 @@ * * CDDL HEADER END */ -/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ - - /* - * Copyright 2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ +/* All Rights Reserved */ + #ifndef _MAIL_H #define _MAIL_H @@ -332,7 +331,7 @@ extern void createmf(uid_t uid, char *file); extern void del_reciplist (reciplist *list); extern void delete(int); extern void doFopt(void); -extern void done(int); +extern void done(int) __NORETURN; extern void sig_done(int); extern FILE *doopen(char *file, char *type, int errnum); extern int dowait(pid_t pidval); @@ -355,7 +354,7 @@ extern int islocal(char *user, uid_t *puid); extern int istext(unsigned char *s, int size); extern int legal(char *file); extern void lock(char *user); -extern int madd_recip(reciplist *plist, char *name, int checkdups); +extern void madd_recip(reciplist *plist, char *name, int checkdups); extern char *mailcompile(string *pattern, int *retlen, int *retnbra); extern void mkdead(void); extern void mktmp(void); @@ -433,7 +432,7 @@ extern int islocal(); extern int istext(); extern int legal(); extern void lock(); -extern int madd_recip(); +extern void madd_recip(); extern char *mailcompile(); extern void mkdead(); extern void mktmp(); diff --git a/usr/src/cmd/mail/main.c b/usr/src/cmd/mail/main.c index ffe89d581c..009e02cb3b 100644 --- a/usr/src/cmd/mail/main.c +++ b/usr/src/cmd/mail/main.c @@ -19,14 +19,14 @@ * * CDDL HEADER END */ -/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ - /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ +/* All Rights Reserved */ + #pragma ident "%Z%%M% %I% %E% SMI" #include "mail.h" @@ -39,8 +39,8 @@ * mail [ -tw ] [ -m messagetype ] persons * rmail [ -tw ] persons */ -main(argc, argv) -char **argv; +int +main(int argc, char **argv) { register int i; char *cptr, *p; @@ -240,5 +240,5 @@ char **argv; sending = TRUE; sendmail(argc, argv); } - done(0); /*NOTREACHED*/ + done(0); } diff --git a/usr/src/cmd/mail/parse.c b/usr/src/cmd/mail/parse.c index c449264b16..6fc32764f1 100644 --- a/usr/src/cmd/mail/parse.c +++ b/usr/src/cmd/mail/parse.c @@ -19,22 +19,27 @@ * * CDDL HEADER END */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ -#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 2.1 */ +#pragma ident "%Z%%M% %I% %E% SMI" + #include "mail.h" /* Parse the command line. Return index of first non-option field (i.e. user) */ -parse(argc, argv) -int argc; -char **argv; +int +parse(int argc, char **argv) { - register int c; - register char *tmailsurr; + int c; + char *tmailsurr; static char pn[] = "parse"; /* diff --git a/usr/src/cmd/mail/pckaffspot.c b/usr/src/cmd/mail/pckaffspot.c index 51cddaf0e5..7ffdf6e08b 100644 --- a/usr/src/cmd/mail/pckaffspot.c +++ b/usr/src/cmd/mail/pckaffspot.c @@ -19,12 +19,16 @@ * * CDDL HEADER END */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - #pragma ident "%Z%%M% %I% %E% SMI" - /* SVr4.0 2. */ + #include "mail.h" /* * If any H_AFWDFROM lines in msg, decide where to put them. @@ -33,10 +37,11 @@ * > 0 ==> Header line type after (before) which to place H_AFWDFROM * lines and H_AFWDCNT */ -pckaffspot() +int +pckaffspot(void) { static char pn[] = "pckaffspot"; - register int rc; + int rc; if (hdrlines[H_AFWDFROM].head == (struct hdrs *)NULL) { rc = -1; diff --git a/usr/src/cmd/mail/pckrcvspot.c b/usr/src/cmd/mail/pckrcvspot.c index 87fbfdbbcc..bde3dfa851 100644 --- a/usr/src/cmd/mail/pckrcvspot.c +++ b/usr/src/cmd/mail/pckrcvspot.c @@ -19,12 +19,16 @@ * * CDDL HEADER END */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - #pragma ident "%Z%%M% %I% %E% SMI" - /* SVr4.0 2. */ + #include "mail.h" /* * If any H_RECEIVED lines in msg, decide where to put them. @@ -32,10 +36,11 @@ * -1 ==> No H_RECEIVED lines to be printed. * > 0 ==> Header line type after (before) which to place H_RECEIVED lines */ -pckrcvspot() +int +pckrcvspot(void) { static char pn[] = "pckrcvspot"; - register int rc; + int rc; if (hdrlines[H_RECEIVED].head == (struct hdrs *)NULL) { rc = -1; diff --git a/usr/src/cmd/mail/pipletr.c b/usr/src/cmd/mail/pipletr.c index cfc22ac017..557d8bbcf1 100644 --- a/usr/src/cmd/mail/pipletr.c +++ b/usr/src/cmd/mail/pipletr.c @@ -19,18 +19,22 @@ * * CDDL HEADER END */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - #pragma ident "%Z%%M% %I% %E% SMI" #include "mail.h" -dowait(pidval) -pid_t pidval; +int +dowait(pid_t pidval) { - register pid_t w; + pid_t w; int status; void (*istat)(), (*qstat)(); @@ -61,8 +65,8 @@ pid_t pidval; return: status -> command exit status */ -systm(s) -char *s; +int +systm(char *s) { pid_t pid; diff --git a/usr/src/cmd/mail/printhdr.c b/usr/src/cmd/mail/printhdr.c index 4852a0aa8d..9188793dcd 100644 --- a/usr/src/cmd/mail/printhdr.c +++ b/usr/src/cmd/mail/printhdr.c @@ -19,27 +19,23 @@ * * CDDL HEADER END */ -/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ - - -#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 2. */ - - /* - * Copyright 2002 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ +/* All Rights Reserved */ + +#pragma ident "%Z%%M% %I% %E% SMI" + #include "mail.h" -printhdr(type, hdrtype, hptr, fp) -int hdrtype; -struct hdrs *hptr; -FILE *fp; +int +printhdr(int type, int hdrtype, struct hdrs *hptr, FILE *fp) { char buf[1024]; - register int n; + int n; struct hdrs *contptr; diff --git a/usr/src/cmd/mail/sel_disp.c b/usr/src/cmd/mail/sel_disp.c index 9b228d674d..0049391ef9 100644 --- a/usr/src/cmd/mail/sel_disp.c +++ b/usr/src/cmd/mail/sel_disp.c @@ -19,10 +19,14 @@ * * CDDL HEADER END */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ - #pragma ident "%Z%%M% %I% %E% SMI" #include "mail.h" @@ -34,13 +38,11 @@ * the default output mode will be listed in the seldisp[] array. * This can all be overridden via the 'P' command at the ? prompt. */ -sel_disp (type, hdrtype, s) -int type; -int hdrtype; -char *s; +int +sel_disp(int type, int hdrtype, char *s) { static char pn[] = "sel_disp"; - register char *p; + char *p; static int sav_lastrc = 0; int i, rc = 0; diff --git a/usr/src/cmd/mail/sendlist.c b/usr/src/cmd/mail/sendlist.c index 9bde5837d5..00d5696a33 100644 --- a/usr/src/cmd/mail/sendlist.c +++ b/usr/src/cmd/mail/sendlist.c @@ -19,14 +19,13 @@ * * CDDL HEADER END */ -/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ - - /* - * Copyright 2001-2002 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ + #pragma ident "%Z%%M% %I% %E% SMI" #include "mail.h" @@ -53,11 +52,10 @@ static char *sendmail_prog = SENDMAIL; +static void notifybiff(char *); + int -sendlist(list, letnum, level) -reciplist *list; -int letnum; -int level; +sendlist(reciplist *list, int letnum, int level) { recip *to; int rc = 0; @@ -141,9 +139,7 @@ int level; int -send_mbox(mbox, letnum) -char *mbox; -int letnum; +send_mbox(char *mbox, int letnum) { char file[PATH_MAX]; char biffmsg[PATH_MAX]; @@ -211,8 +207,8 @@ done: #include <sys/socket.h> #include <netinet/in.h> -notifybiff(msg) - char *msg; +static void +notifybiff(char *msg) { static struct sockaddr_in addr; static int f = -1; diff --git a/usr/src/cmd/tar/tar.c b/usr/src/cmd/tar/tar.c index 9e1677a3aa..9a005ce4b7 100644 --- a/usr/src/cmd/tar/tar.c +++ b/usr/src/cmd/tar/tar.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -153,7 +153,7 @@ int utimes(const char *path, const struct timeval timeval_ptr[]); #define OCTAL7CHAR 2 #else /* normal values */ -#define TAR_OFFSET_MAX 077777777777 +#define TAR_OFFSET_MAX 077777777777ULL #define OCTAL7CHAR 07777777 #endif |
