Author: pfg Date: Fri Jul 15 15:37:54 2016 New Revision: 302903 URL: https://svnweb.freebsd.org/changeset/base/302903
Log: mail(1): Update more prototypes. Also rename delete and undelete_messages to deletecmd and undeletecmd respectively in an attempt to sync with other BSDs. Obtained from: OpenBSD Modified: head/usr.bin/mail/cmd1.c head/usr.bin/mail/cmd2.c head/usr.bin/mail/cmd3.c head/usr.bin/mail/cmdtab.c head/usr.bin/mail/extern.h head/usr.bin/mail/names.c Modified: head/usr.bin/mail/cmd1.c ============================================================================== --- head/usr.bin/mail/cmd1.c Fri Jul 15 15:32:09 2016 (r302902) +++ head/usr.bin/mail/cmd1.c Fri Jul 15 15:37:54 2016 (r302903) @@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$"); * User commands. */ -extern const struct cmd cmdtab[]; - /* * Print the current active headings. * Don't change dot if invoker didn't give an argument. @@ -54,8 +52,9 @@ extern const struct cmd cmdtab[]; static int screen; int -headers(int *msgvec) +headers(void *v) { + int *msgvec = v; int n, mesg, flag, size; struct message *mp; @@ -93,8 +92,9 @@ headers(int *msgvec) * Scroll to the next/previous screen */ int -scroll(char arg[]) +scroll(void *v) { + char *arg = v; int s, size; int cur[1]; @@ -146,8 +146,9 @@ screensize(void) * in the passed message list. */ int -from(int *msgvec) +from(void *v) { + int *msgvec = v; int *ip; for (ip = msgvec; *ip != 0; ip++) @@ -220,6 +221,7 @@ pdot(void) int pcmdlist(void) { + extern const struct cmd cmdtab[]; const struct cmd *cp; int cc; @@ -242,8 +244,9 @@ pcmdlist(void) * Paginate messages, honor ignored fields. */ int -more(int *msgvec) +more(void *v) { + int *msgvec = v; return (type1(msgvec, 1, 1)); } @@ -252,8 +255,9 @@ more(int *msgvec) * Paginate messages, even printing ignored fields. */ int -More(int *msgvec) +More(void *v) { + int *msgvec = v; return (type1(msgvec, 0, 1)); } @@ -262,8 +266,9 @@ More(int *msgvec) * Type out messages, honor ignored fields. */ int -type(int *msgvec) +type(void *v) { + int *msgvec = v; return (type1(msgvec, 1, 0)); } @@ -272,8 +277,9 @@ type(int *msgvec) * Type out messages, even printing ignored fields. */ int -Type(int *msgvec) +Type(void *v) { + int *msgvec = v; return (type1(msgvec, 0, 0)); } @@ -355,8 +361,9 @@ brokpipe(int signo __unused) * and defaults to 5. */ int -top(int *msgvec) +top(void *v) { + int *msgvec = v; int *ip; struct message *mp; int c, topl, lines, lineb; @@ -396,8 +403,9 @@ top(int *msgvec) * get mboxed. */ int -stouch(int msgvec[]) +stouch(void *v) { + int *msgvec = v; int *ip; for (ip = msgvec; *ip != 0; ip++) { @@ -412,8 +420,9 @@ stouch(int msgvec[]) * Make sure all passed messages get mboxed. */ int -mboxit(int msgvec[]) +mboxit(void *v) { + int *msgvec = v; int *ip; for (ip = msgvec; *ip != 0; ip++) { Modified: head/usr.bin/mail/cmd2.c ============================================================================== --- head/usr.bin/mail/cmd2.c Fri Jul 15 15:32:09 2016 (r302902) +++ head/usr.bin/mail/cmd2.c Fri Jul 15 15:37:54 2016 (r302903) @@ -53,9 +53,10 @@ extern int wait_status; * If given as first command with no arguments, print first message. */ int -next(int *msgvec) +next(void *v) { struct message *mp; + int *msgvec = v; int *ip, *ip2, list[2], mdot; if (*msgvec != 0) { @@ -210,8 +211,9 @@ save1(char str[], int mark, const char * * file name, minus header and trailing blank line. */ int -swrite(char str[]) +swrite(void *v) { + char *str = v; return (save1(str, 1, "write", ignoreall)); } @@ -226,7 +228,7 @@ swrite(char str[]) */ char * -snarf(char linebuf[], int *flag) +snarf(char *linebuf, int *flag) { char *cp; @@ -262,8 +264,9 @@ snarf(char linebuf[], int *flag) * Delete messages. */ int -delete(int msgvec[]) +deletecmd(void *v) { + int *msgvec = v; delm(msgvec); return (0); @@ -273,8 +276,9 @@ delete(int msgvec[]) * Delete messages, then type the new dot. */ int -deltype(int msgvec[]) +deltype(void *v) { + int *msgvec = v; int list[2]; int lastdot; @@ -335,10 +339,11 @@ delm(int *msgvec) * Undelete the indicated messages. */ int -undelete_messages(int *msgvec) +undeletecmd(void *v) { - struct message *mp; + int *msgvec = v; int *ip; + struct message *mp; for (ip = msgvec; *ip && ip-msgvec < msgCount; ip++) { mp = &message[*ip - 1]; @@ -412,8 +417,9 @@ clob1(int n) * If no arguments, print the current list of retained fields. */ int -retfield(char *list[]) +retfield(void *v) { + char **list = v; return (ignore1(list, ignore + 1, "retained")); } @@ -423,33 +429,36 @@ retfield(char *list[]) * If no arguments, print the current list of ignored fields. */ int -igfield(char *list[]) +igfield(void *v) { + char **list = v; return (ignore1(list, ignore, "ignored")); } int -saveretfield(char *list[]) +saveretfield(void *v) { + char **list = v; return (ignore1(list, saveignore + 1, "retained")); } int -saveigfield(char *list[]) +saveigfield(void *v) { + char **list = v; return (ignore1(list, saveignore, "ignored")); } int -ignore1(char *list[], struct ignoretab *tab, const char *which) +ignore1(char **list, struct ignoretab *tab, const char *which) { char field[LINESIZE]; - int h; - struct ignore *igp; char **ap; + struct ignore *igp; + int h; if (*list == NULL) return (igshow(tab, which)); Modified: head/usr.bin/mail/cmd3.c ============================================================================== --- head/usr.bin/mail/cmd3.c Fri Jul 15 15:32:09 2016 (r302902) +++ head/usr.bin/mail/cmd3.c Fri Jul 15 15:37:54 2016 (r302903) @@ -163,8 +163,9 @@ help(void) * Change user's working directory. */ int -schdir(char **arglist) +schdir(void *v) { + char **arglist = v; char *cp; if (*arglist == NULL) { @@ -182,8 +183,10 @@ schdir(char **arglist) } int -respond(int *msgvec) +respond(void *v) { + int *msgvec = v; + if (value("Replyall") == NULL && value("flipr") == NULL) return (dorespond(msgvec)); else @@ -280,8 +283,9 @@ reedit(char *subj) * back to the system mailbox. */ int -preserve(int *msgvec) +preserve(void *v) { + int *msgvec = v; int *ip, mesg; struct message *mp; @@ -303,8 +307,9 @@ preserve(int *msgvec) * Mark all given messages as unread. */ int -unread(int msgvec[]) +unread(void *v) { + int *msgvec = v; int *ip; for (ip = msgvec; *ip != 0; ip++) { @@ -319,8 +324,9 @@ unread(int msgvec[]) * Print the size of each message. */ int -messize(int *msgvec) +messize(void *v) { + int *msgvec = v; struct message *mp; int *ip, mesg; @@ -337,7 +343,7 @@ messize(int *msgvec) * by returning an error. */ int -rexit(int e __unused) +rexit(void *v) { if (sourcing) return (1); @@ -350,8 +356,9 @@ rexit(int e __unused) * of csh. */ int -set(char **arglist) +set(void *v) { + char **arglist = v; struct var *vp; char *cp, *cp2; char varbuf[BUFSIZ], **ap, **p; @@ -396,8 +403,9 @@ set(char **arglist) * Unset a bunch of variable values. */ int -unset(char **arglist) +unset(void *v) { + char **arglist = v; struct var *vp, *vp2; int errs, h; char **ap; @@ -435,8 +443,9 @@ unset(char **arglist) * Put add users to a group. */ int -group(char **argv) +group(void *v) { + char **argv = v; struct grouphead *gh; struct group *gp; char **ap, *gname, **p; Modified: head/usr.bin/mail/cmdtab.c ============================================================================== --- head/usr.bin/mail/cmdtab.c Fri Jul 15 15:32:09 2016 (r302902) +++ head/usr.bin/mail/cmdtab.c Fri Jul 15 15:37:54 2016 (r302903) @@ -58,10 +58,10 @@ const struct cmd cmdtab[] = { { "top", top, MSGLIST, 0, MMNDEL }, { "touch", stouch, W|MSGLIST, 0, MMNDEL }, { "preserve", preserve, W|MSGLIST, 0, MMNDEL }, - { "delete", delete, W|P|MSGLIST, 0, MMNDEL }, + { "delete", deletecmd, W|P|MSGLIST, 0, MMNDEL }, { "dp", deltype, W|MSGLIST, 0, MMNDEL }, { "dt", deltype, W|MSGLIST, 0, MMNDEL }, - { "undelete", undelete_messages, P|MSGLIST, MDELETED,MMNDEL }, + { "undelete", undeletecmd, P|MSGLIST, MDELETED,MMNDEL }, { "unset", unset, M|RAWLIST, 1, 1000 }, { "mail", sendmail, R|M|I|STRLIST, 0, 0 }, { "mbox", mboxit, W|MSGLIST, 0, 0 }, Modified: head/usr.bin/mail/extern.h ============================================================================== --- head/usr.bin/mail/extern.h Fri Jul 15 15:32:09 2016 (r302902) +++ head/usr.bin/mail/extern.h Fri Jul 15 15:37:54 2016 (r302903) @@ -32,11 +32,11 @@ */ struct name *cat(struct name *, struct name *); -struct name *delname(struct name *, char []); +struct name *delname(struct name *, char *); struct name *elide(struct name *); -struct name *extract(char [], int); +struct name *extract(char *, int); struct name *gexpand(struct name *, struct grouphead *, int, int); -struct name *nalloc(char [], int); +struct name *nalloc(char *, int); struct name *outof(struct name *, FILE *, struct header *); struct name *put(struct name *, struct name *); struct name *tailof(struct name *); @@ -52,11 +52,11 @@ char *getdeadletter(void); char *getname(uid_t); char *hfield(const char *, struct message *); FILE *infix(struct header *, FILE *); -char *ishfield(char [], char *, const char *); +char *ishfield(char *, char *, const char *); char *name1(struct message *, int); char *nameof(struct message *, int); char *nextword(char *, char *); -char *readtty(const char *, char []); +char *readtty(const char *, char *); char *reedit(char *); FILE *run_editor(FILE *, off_t, int, int); char *salloc(int); @@ -64,18 +64,18 @@ char *savestr(char *); FILE *setinput(struct message *); char *skin(char *); char *skip_comment(char *); -char *snarf(char [], int *); +char *snarf(char *, int *); char *username(void); char *value(const char *); char *vcopy(const char *); -char *yankword(char *, char []); -char *yanklogin(char *, char []); +char *yankword(char *, char *); +char *yanklogin(char *, char *); int Fclose(FILE *); -int More(int *); +int More(void *); int Pclose(FILE *); int Respond(int *); -int Type(int *); -int doRespond(int []); +int Type(void *); +int doRespond(int *); int dorespond(int *); void alter(char *); int alternates(char **); @@ -98,9 +98,9 @@ void commands(void); int copycmd(void *v); int core(void); int count(struct name *); -int delete(int []); -int delm(int []); -int deltype(int []); +int deletecmd(void *); +int delm(int *); +int deltype(void *); void demail(void); int diction(const void *, const void *); int dosh(char *); @@ -111,51 +111,51 @@ void edstop(void); int elsecmd(void); int endifcmd(void); int evalcol(int); -int execute(char [], int); -int exwrite(char [], FILE *, int); +int execute(char *, int); +int exwrite(char *, FILE *, int); void fail(const char *, const char *); int file(char **); struct grouphead * - findgroup(char []); + findgroup(char *); void findmail(char *, char *, int); int first(int, int); void fixhead(struct header *, struct name *); void fmt(const char *, struct name *, FILE *, int); int folders(void); -int forward(char [], FILE *, char *, int); +int forward(char *, FILE *, char *, int); void free_child(int); -int from(int *); +int from(void *); off_t fsize(FILE *); int getfold(char *, int); -int gethfield(FILE *, char [], int, char **); +int gethfield(FILE *, char *, int, char **); int getmsglist(char *, int *, int); -int getrawlist(char [], char **, int); -uid_t getuserid(char []); +int getrawlist(char *, char **, int); +uid_t getuserid(char *); int grabh(struct header *, int); -int group(char **); +int group(void *); void hangup(int); int hash(const char *); void hdrstop(int); -int headers(int *); +int headers(void *); int help(void); void holdsigs(void); int ifcmd(char **); int igcomp(const void *, const void *); -int igfield(char *[]); -int ignore1(char *[], struct ignoretab *, const char *); +int igfield(void *); +int ignore1(char **, struct ignoretab *, const char *); int igshow(struct ignoretab *, const char *); int inc(void *); int incfile(void); void intr(int); -int isdate(char []); -int isdir(char []); +int isdate(char *); +int isdir(char *); int isfileaddr(char *); -int ishead(char []); +int ishead(char *); int isign(const char *, struct ignoretab []); int isprefix(const char *, const char *); void istrncpy(char *, const char *, size_t); const struct cmd * - lex(char []); + lex(char *); void load(char *); struct var * lookup(const char *); @@ -164,26 +164,26 @@ int mail(struct name *, void mail1(struct header *, int); void makemessage(FILE *, int); void mark(int); -int markall(char [], int); +int markall(char *, int); int matchsender(char *, int); int matchfield(char *, int); -int mboxit(int []); +int mboxit(void *); int member(char *, struct ignoretab *); void mesedit(FILE *, int); -void mespipe(FILE *, char []); -int messize(int *); +void mespipe(FILE *, char *); +int messize(void *); int metamess(int, int); -int more(int *); +int more(void *); int newfileinfo(int); -int next(int *); +int next(void *); int null(int); -void parse(char [], struct headline *, char []); +void parse(char *, struct headline *, char *); int pcmdlist(void); int pdot(void); void prepare_child(sigset_t *, int, int); -int preserve(int *); +int preserve(void *); void prettyprint(struct name *); -void printgroup(char []); +void printgroup(char *); void printhead(int); int puthead(struct header *, FILE *, int); int putline(FILE *, char *, int); @@ -194,25 +194,25 @@ int readline(FILE *, char *, int); void register_file(FILE *, int, int); void regret(int); void relsesigs(void); -int respond(int *); -int retfield(char *[]); -int rexit(int); +int respond(void *); +int retfield(void *); +int rexit(void *); int rm(char *); int run_command(char *, sigset_t *, int, int, ...); int save(void *v); -int save1(char [], int, const char *, struct ignoretab *); +int save1(char *, int, const char *, struct ignoretab *); void savedeadletter(FILE *); -int saveigfield(char *[]); -int savemail(char [], FILE *); -int saveretfield(char *[]); +int saveigfield(void *); +int savemail(char *, FILE *); +int saveretfield(void *); int scan(char **); void scaninit(void); -int schdir(char **); +int schdir(void *); int screensize(void); -int scroll(char []); +int scroll(void *); int sendmessage(struct message *, FILE *, struct ignoretab *, char *); int sendmail(char *); -int set(char **); +int set(void *); int setfile(char *); void setmsize(int); void setptr(FILE *, off_t); @@ -226,21 +226,21 @@ void sreset(void); int start_command(char *, sigset_t *, int, int, ...); void statusput(struct message *, FILE *, char *); void stop(int); -int stouch(int []); -int swrite(char []); +int stouch(void *); +int swrite(void *); void tinit(void); -int top(int *); +int top(void *); void touch(struct message *); void ttyint(int); void ttystop(int); -int type(int *); +int type(void *); int type1(int *, int, int); -int undelete_messages(int *); +int undeletecmd(void *); void unmark(int); char **unpack(struct name *); -int unread(int []); +int unread(void *); void unregister_file(FILE *); -int unset(char **); +int unset(void *); int unstack(void); void vfree(char *); int visual(int *); Modified: head/usr.bin/mail/names.c ============================================================================== --- head/usr.bin/mail/names.c Fri Jul 15 15:32:09 2016 (r302902) +++ head/usr.bin/mail/names.c Fri Jul 15 15:37:54 2016 (r302903) @@ -85,7 +85,7 @@ tailof(struct name *name) * Return the list or NULL if none found. */ struct name * -extract(char line[], int ntype) +extract(char *line, int ntype) { char *cp, *nbuf; struct name *top, *np, *t; @@ -158,7 +158,7 @@ detract(struct name *np, int ntype) * Throw away things between ()'s, and take anything between <>. */ char * -yankword(char *ap, char wbuf[]) +yankword(char *ap, char *wbuf) { char *cp, *cp2; @@ -203,7 +203,7 @@ yankword(char *ap, char wbuf[]) * and look for words before metacharacters %, @, !. */ char * -yanklogin(char *ap, char wbuf[]) +yanklogin(char *ap, char *wbuf) { char *cp, *cp2, *cp_temp; int n; _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"