[BACK]Return to cmd3.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mail

Diff for /src/usr.bin/mail/cmd3.c between version 1.1 and 1.2

version 1.1, 1995/10/18 08:45:38 version 1.2, 1996/06/11 12:53:34
Line 1 
Line 1 
   /*      $OpenBSD$       */
   /*      $NetBSD: cmd3.c,v 1.5 1996/06/08 19:48:14 christos Exp $        */
   
 /*  /*
  * Copyright (c) 1980, 1993   * Copyright (c) 1980, 1993
  *      The Regents of the University of California.  All rights reserved.   *      The Regents of the University of California.  All rights reserved.
Line 32 
Line 35 
  */   */
   
 #ifndef lint  #ifndef lint
   #if 0
 static char sccsid[] = "@(#)cmd3.c      8.1 (Berkeley) 6/6/93";  static char sccsid[] = "@(#)cmd3.c      8.1 (Berkeley) 6/6/93";
 static char rcsid[] = "$Id$";  #else
   static char rcsid[] = "$OpenBSD$";
   #endif
 #endif /* not lint */  #endif /* not lint */
   
 #include "rcv.h"  #include "rcv.h"
Line 44 
Line 50 
  *   *
  * Still more user commands.   * Still more user commands.
  */   */
   static int diction __P((const void *, const void *));
   
 /*  /*
  * Process a shell escape by saving signals, ignoring signals,   * Process a shell escape by saving signals, ignoring signals,
  * and forking a sh -c   * and forking a sh -c
  */   */
 int  int
 shell(str)  shell(v)
         char *str;          void *v;
 {  {
           char *str = v;
         sig_t sigint = signal(SIGINT, SIG_IGN);          sig_t sigint = signal(SIGINT, SIG_IGN);
         char *shell;          char *shell;
         char cmd[BUFSIZ];          char cmd[BUFSIZ];
Line 73 
Line 81 
  */   */
 /*ARGSUSED*/  /*ARGSUSED*/
 int  int
 dosh(str)  dosh(v)
         char *str;          void *v;
 {  {
         sig_t sigint = signal(SIGINT, SIG_IGN);          sig_t sigint = signal(SIGINT, SIG_IGN);
         char *shell;          char *shell;
Line 147 
Line 155 
  */   */
   
 int  int
 help()  help(v)
           void *v;
 {  {
         register c;          register c;
         register FILE *f;          register FILE *f;
Line 166 
Line 175 
  * Change user's working directory.   * Change user's working directory.
  */   */
 int  int
 schdir(arglist)  schdir(v)
         char **arglist;          void *v;
 {  {
           char **arglist = v;
         char *cp;          char *cp;
   
         if (*arglist == NOSTR)          if (*arglist == NOSTR)
Line 184 
Line 194 
 }  }
   
 int  int
 respond(msgvec)  respond(v)
         int *msgvec;          void *v;
 {  {
           int *msgvec = v;
         if (value("Replyall") == NOSTR)          if (value("Replyall") == NOSTR)
                 return (_respond(msgvec));                  return (_respond(msgvec));
         else          else
Line 284 
Line 295 
  * back to the system mailbox.   * back to the system mailbox.
  */   */
 int  int
 preserve(msgvec)  preserve(v)
         int *msgvec;          void *v;
 {  {
           int *msgvec = v;
         register struct message *mp;          register struct message *mp;
         register int *ip, mesg;          register int *ip, mesg;
   
Line 308 
Line 320 
  * Mark all given messages as unread.   * Mark all given messages as unread.
  */   */
 int  int
 unread(msgvec)  unread(v)
         int     msgvec[];          void *v;
 {  {
           int     *msgvec = v;
         register int *ip;          register int *ip;
   
         for (ip = msgvec; *ip != NULL; ip++) {          for (ip = msgvec; *ip != NULL; ip++) {
Line 325 
Line 338 
  * Print the size of each message.   * Print the size of each message.
  */   */
 int  int
 messize(msgvec)  messize(v)
         int *msgvec;          void *v;
 {  {
           int *msgvec = v;
         register struct message *mp;          register struct message *mp;
         register int *ip, mesg;          register int *ip, mesg;
   
Line 344 
Line 358 
  * by returning an error.   * by returning an error.
  */   */
 int  int
 rexit(e)  rexit(v)
         int e;          void *v;
 {  {
         if (sourcing)          if (sourcing)
                 return(1);                  return(1);
         exit(e);          exit(0);
         /*NOTREACHED*/          /*NOTREACHED*/
 }  }
   
Line 358 
Line 372 
  * of csh.   * of csh.
  */   */
 int  int
 set(arglist)  set(v)
         char **arglist;          void *v;
 {  {
           char **arglist = v;
         register struct var *vp;          register struct var *vp;
         register char *cp, *cp2;          register char *cp, *cp2;
         char varbuf[BUFSIZ], **ap, **p;          char varbuf[BUFSIZ], **ap, **p;
Line 405 
Line 420 
  * Unset a bunch of variable values.   * Unset a bunch of variable values.
  */   */
 int  int
 unset(arglist)  unset(v)
         char **arglist;          void *v;
 {  {
           char **arglist = v;
         register struct var *vp, *vp2;          register struct var *vp, *vp2;
         int errs, h;          int errs, h;
         char **ap;          char **ap;
Line 443 
Line 459 
  * Put add users to a group.   * Put add users to a group.
  */   */
 int  int
 group(argv)  group(v)
         char **argv;          void *v;
 {  {
           char **argv = v;
         register struct grouphead *gh;          register struct grouphead *gh;
         register struct group *gp;          register struct group *gp;
         register int h;          register int h;
Line 504 
Line 521 
         char **list;          char **list;
 {  {
         register char **ap;          register char **ap;
         int diction();  
   
         for (ap = list; *ap != NOSTR; ap++)          for (ap = list; *ap != NOSTR; ap++)
                 ;                  ;
Line 517 
Line 533 
  * Do a dictionary order comparison of the arguments from   * Do a dictionary order comparison of the arguments from
  * qsort.   * qsort.
  */   */
 int  static int
 diction(a, b)  diction(a, b)
         const void *a, *b;          const void *a, *b;
 {  {
Line 530 
Line 546 
   
 /*ARGSUSED*/  /*ARGSUSED*/
 int  int
 null(e)  null(v)
         int e;          void *v;
 {  {
         return 0;          return 0;
 }  }
Line 541 
Line 557 
  * the current file.   * the current file.
  */   */
 int  int
 file(argv)  file(v)
         register char **argv;          void *v;
 {  {
           char **argv = v;
   
         if (argv[0] == NOSTR) {          if (argv[0] == NOSTR) {
                 newfileinfo();                  newfileinfo();
Line 559 
Line 576 
  * Expand file names like echo   * Expand file names like echo
  */   */
 int  int
 echo(argv)  echo(v)
         char **argv;          void *v;
 {  {
           char **argv = v;
         register char **ap;          register char **ap;
         register char *cp;          register char *cp;
   
Line 578 
Line 596 
 }  }
   
 int  int
 Respond(msgvec)  Respond(v)
         int *msgvec;          void *v;
 {  {
           int *msgvec = v;
         if (value("Replyall") == NOSTR)          if (value("Replyall") == NOSTR)
                 return (_Respond(msgvec));                  return (_Respond(msgvec));
         else          else
Line 628 
Line 647 
  * .mailrc and do some things if sending, others if receiving.   * .mailrc and do some things if sending, others if receiving.
  */   */
 int  int
 ifcmd(argv)  ifcmd(v)
         char **argv;          void *v;
 {  {
           char **argv = v;
         register char *cp;          register char *cp;
   
         if (cond != CANY) {          if (cond != CANY) {
Line 660 
Line 680 
  * flip over the conditional flag.   * flip over the conditional flag.
  */   */
 int  int
 elsecmd()  elsecmd(v)
           void *v;
 {  {
   
         switch (cond) {          switch (cond) {
Line 688 
Line 709 
  * End of if statement.  Just set cond back to anything.   * End of if statement.  Just set cond back to anything.
  */   */
 int  int
 endifcmd()  endifcmd(v)
           void *v;
 {  {
   
         if (cond == CANY) {          if (cond == CANY) {
Line 703 
Line 725 
  * Set the list of alternate names.   * Set the list of alternate names.
  */   */
 int  int
 alternates(namelist)  alternates(v)
         char **namelist;          void *v;
 {  {
           char **namelist = v;
         register int c;          register int c;
         register char **ap, **ap2, *cp;          register char **ap, **ap2, *cp;
   

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2