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

Diff for /src/usr.bin/mail/Attic/aux.c between version 1.12 and 1.13

version 1.12, 1997/08/04 17:30:22 version 1.13, 1997/11/14 00:23:41
Line 89 
Line 89 
 }  }
   
 /*  /*
  * Announce a fatal error and die.  
  */  
 #ifdef __STDC__  
 #include <stdarg.h>  
 #else  
 #include <varargs.h>  
 #endif  
   
 void  
 #ifdef __STDC__  
 panic(const char *fmt, ...)  
 #else  
 panic(fmt, va_alist)  
         char *fmt;  
         va_dcl  
 #endif  
 {  
         va_list ap;  
 #ifdef __STDC__  
         va_start(ap, fmt);  
 #else  
         va_start(ap);  
 #endif  
         (void)fprintf(stderr, "panic: ");  
         vfprintf(stderr, fmt, ap);  
         va_end(ap);  
         (void)putc('\n', stderr);  
         fflush(stderr);  
         abort();  
 }  
   
 /*  
  * Touch the named message by setting its MTOUCH flag.   * Touch the named message by setting its MTOUCH flag.
  * Touched messages have the effect of not being sent   * Touched messages have the effect of not being sent
  * back to the system mailbox on exit.   * back to the system mailbox on exit.
  */   */
 void  void
 touch(mp)  touch(mp)
         register struct message *mp;          struct message *mp;
 {  {
   
         mp->m_flag |= MTOUCH;          mp->m_flag |= MTOUCH;
Line 147 
Line 115 
   
         if (stat(name, &sbuf) < 0)          if (stat(name, &sbuf) < 0)
                 return(0);                  return(0);
         return((sbuf.st_mode & S_IFMT) == S_IFDIR);          return (S_ISDIR(sbuf.st_mode));
 }  }
   
 /*  /*
Line 157 
Line 125 
 argcount(argv)  argcount(argv)
         char **argv;          char **argv;
 {  {
         register char **ap;          char **ap;
   
         for (ap = argv; *ap++ != NULL;)          for (ap = argv; *ap++ != NULL;)
                 ;                  ;
Line 173 
Line 141 
         char field[];          char field[];
         struct message *mp;          struct message *mp;
 {  {
         register FILE *ibuf;          FILE *ibuf;
         char linebuf[LINESIZE];          char linebuf[LINESIZE];
         register int lc;          int lc;
         register char *hfield;          char *hfield;
         char *colon, *oldhfield = NULL;          char *colon, *oldhfield = NULL;
   
         ibuf = setinput(mp);          ibuf = setinput(mp);
Line 201 
Line 169 
  */   */
 int  int
 gethfield(f, linebuf, rem, colon)  gethfield(f, linebuf, rem, colon)
         register FILE *f;          FILE *f;
         char linebuf[];          char linebuf[];
         register int rem;          int rem;
         char **colon;          char **colon;
 {  {
         char line2[LINESIZE];          char line2[LINESIZE];
         register char *cp, *cp2;          char *cp, *cp2;
         register int c;          int c;
   
         for (;;) {          for (;;) {
                 if (--rem < 0)                  if (--rem < 0)
Line 263 
Line 231 
         char linebuf[], field[];          char linebuf[], field[];
         char *colon;          char *colon;
 {  {
         register char *cp = colon;          char *cp = colon;
   
         *cp = 0;          *cp = 0;
         if (strcasecmp(linebuf, field) != 0) {          if (strcasecmp(linebuf, field) != 0) {
Line 282 
Line 250 
  */   */
 void  void
 istrncpy(dest, src, dsize)  istrncpy(dest, src, dsize)
         register char *dest, *src;          char *dest, *src;
         register size_t dsize;          size_t dsize;
 {  {
   
         if (dsize != 0) {          if (dsize != 0) {
Line 382 
Line 350 
   
         if (stat(name, &sb))          if (stat(name, &sb))
                 return;                  return;
         tv[0].tv_sec = time((time_t *)0) + 1;          (void) gettimeofday(&tv[0], (struct timezone *)0);
         tv[1].tv_sec = sb.st_mtime;          tv[0].tv_sec++;
         tv[0].tv_usec = tv[1].tv_usec = 0;          TIMESPEC_TO_TIMEVAL(&tv[1], &sb.st_mtimespec);
         (void)utimes(name, tv);          (void)utimes(name, tv);
 }  }
   
Line 396 
Line 364 
 blankline(linebuf)  blankline(linebuf)
         char linebuf[];          char linebuf[];
 {  {
         register char *cp;          char *cp;
   
         for (cp = linebuf; *cp; cp++)          for (cp = linebuf; *cp; cp++)
                 if (*cp != ' ' && *cp != '\t')                  if (*cp != ' ' && *cp != '\t')
Line 411 
Line 379 
  */   */
 char *  char *
 nameof(mp, reptype)  nameof(mp, reptype)
         register struct message *mp;          struct message *mp;
         int reptype;          int reptype;
 {  {
         register char *cp, *cp2;          char *cp, *cp2;
   
         cp = skin(name1(mp, reptype));          cp = skin(name1(mp, reptype));
         if (reptype != 0 || charcount(cp, '!') < 2)          if (reptype != 0 || charcount(cp, '!') < 2)
Line 434 
Line 402 
  */   */
 char *  char *
 skip_comment(cp)  skip_comment(cp)
         register char *cp;          char *cp;
 {  {
         register nesting = 1;          int nesting = 1;
   
         for (; nesting > 0 && *cp; cp++) {          for (; nesting > 0 && *cp; cp++) {
                 switch (*cp) {                  switch (*cp) {
Line 463 
Line 431 
 skin(name)  skin(name)
         char *name;          char *name;
 {  {
         register int c;          char *nbuf, *bufend, *cp, *cp2;
         register char *cp, *cp2;          int c, gotlt, lastsp;
         int gotlt, lastsp;  
         char *nbuf, *bufend;  
   
         if (name == NULL)          if (name == NULL)
                 return(NULL);                  return(NULL);
Line 476 
Line 442 
   
         /* We assume that length(input) <= length(output) */          /* We assume that length(input) <= length(output) */
         if ((nbuf = (char *)malloc(strlen(name) + 1)) == NULL)          if ((nbuf = (char *)malloc(strlen(name) + 1)) == NULL)
                 panic("Out of memory");                  errx(1, "Out of memory");
         gotlt = 0;          gotlt = 0;
         lastsp = 0;          lastsp = 0;
         bufend = nbuf;          bufend = nbuf;
Line 561 
Line 527 
         *cp2 = 0;          *cp2 = 0;
   
         if ((nbuf = (char *)realloc(nbuf, strlen(nbuf) + 1)) == NULL)          if ((nbuf = (char *)realloc(nbuf, strlen(nbuf) + 1)) == NULL)
                 panic("Out of memory");                  errx(1, "Out of memory");
         return(nbuf);          return(nbuf);
 }  }
   
Line 574 
Line 540 
  */   */
 char *  char *
 name1(mp, reptype)  name1(mp, reptype)
         register struct message *mp;          struct message *mp;
         int reptype;          int reptype;
 {  {
         char namebuf[LINESIZE];          char namebuf[LINESIZE];
         char linebuf[LINESIZE];          char linebuf[LINESIZE];
         register char *cp, *cp2;          char *cp, *cp2;
         register FILE *ibuf;          FILE *ibuf;
         int first = 1;          int first = 1;
   
         if ((cp = hfield("from", mp)) != NULL)          if ((cp = hfield("from", mp)) != NULL)
Line 638 
Line 604 
         char *str;          char *str;
         int c;          int c;
 {  {
         register char *cp;          char *cp;
         register int i;          int i;
   
         for (i = 0, cp = str; *cp; cp++)          for (i = 0, cp = str; *cp; cp++)
                 if (*cp == c)                  if (*cp == c)
Line 652 
Line 618 
  */   */
 int  int
 anyof(s1, s2)  anyof(s1, s2)
         register char *s1, *s2;          char *s1, *s2;
 {  {
   
         while (*s1)          while (*s1)
Line 666 
Line 632 
  */   */
 int  int
 raise(c)  raise(c)
         register int c;          int c;
 {  {
   
         if (islower(c))          if (islower(c))
Line 679 
Line 645 
  */   */
 char *  char *
 copy(s1, s2)  copy(s1, s2)
         register char *s1, *s2;          char *s1, *s2;
 {  {
   
         while ((*s2++ = *s1++) != '\0')          while ((*s2++ = *s1++) != '\0')
Line 712 
Line 678 
   
 int  int
 member(realfield, table)  member(realfield, table)
         register char *realfield;          char *realfield;
         struct ignoretab *table;          struct ignoretab *table;
 {  {
         register struct ignore *igp;          struct ignore *igp;
   
         for (igp = table->i_head[hash(realfield)]; igp != 0; igp = igp->i_link)          for (igp = table->i_head[hash(realfield)]; igp != 0; igp = igp->i_link)
                 if (*igp->i_field == *realfield &&                  if (*igp->i_field == *realfield &&

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13