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

Diff for /src/usr.bin/mail/list.c between version 1.8 and 1.9

version 1.8, 1997/08/04 17:30:22 version 1.9, 1997/11/14 00:23:49
Line 46 
Line 46 
 #include <ctype.h>  #include <ctype.h>
 #include "extern.h"  #include "extern.h"
   
   int     matchto __P((char *, int));
   
 /*  /*
  * Mail -- a mail program   * Mail -- a mail program
  *   *
Line 63 
Line 65 
         char *buf;          char *buf;
         int *vector, flags;          int *vector, flags;
 {  {
         register int *ip;          int *ip;
         register struct message *mp;          struct message *mp;
   
         if (msgCount == 0) {          if (msgCount == 0) {
                 *vector = 0;                  *vector = 0;
Line 122 
Line 124 
         char buf[];          char buf[];
         int f;          int f;
 {  {
         register char **np;          char **np;
         register int i;          int i;
         register struct message *mp;          struct message *mp;
         char *namelist[NMLSIZE], *bufp;          char *namelist[NMLSIZE], *bufp;
         int tok, beg, mc, star, other, valdot, colmod, colresult;          int tok, beg, mc, star, other, valdot, colmod, colresult;
   
Line 318 
Line 320 
   
         if (colmod != 0) {          if (colmod != 0) {
                 for (i = 1; i <= msgCount; i++) {                  for (i = 1; i <= msgCount; i++) {
                         register struct coltab *colp;                          struct coltab *colp;
   
                         mp = &message[i - 1];                          mp = &message[i - 1];
                         for (colp = &coltab[0]; colp->co_char; colp++)                          for (colp = &coltab[0]; colp->co_char; colp++)
Line 332 
Line 334 
                         if (mp->m_flag & MMARK)                          if (mp->m_flag & MMARK)
                                 break;                                  break;
                 if (mp >= &message[msgCount]) {                  if (mp >= &message[msgCount]) {
                         register struct coltab *colp;                          struct coltab *colp;
   
                         fputs("No messages satisfy", stdout);                          fputs("No messages satisfy", stdout);
                         for (colp = &coltab[0]; colp->co_char; colp++)                          for (colp = &coltab[0]; colp->co_char; colp++)
Line 353 
Line 355 
 evalcol(col)  evalcol(col)
         int col;          int col;
 {  {
         register struct coltab *colp;          struct coltab *colp;
   
         if (col == 0)          if (col == 0)
                 return(lastcolmod);                  return(lastcolmod);
Line 372 
Line 374 
 check(mesg, f)  check(mesg, f)
         int mesg, f;          int mesg, f;
 {  {
         register struct message *mp;          struct message *mp;
   
         if (mesg < 1 || mesg > msgCount) {          if (mesg < 1 || mesg > msgCount) {
                 printf("%d: Invalid message number\n", mesg);                  printf("%d: Invalid message number\n", mesg);
Line 396 
Line 398 
         char **argv;          char **argv;
         int  argc;          int  argc;
 {  {
         register char c, *cp, *cp2, quotec;          char c, *cp, *cp2, quotec;
         int argn;          int argn;
         char *linebuf;          char *linebuf;
         size_t linebufsize = BUFSIZ;          size_t linebufsize = BUFSIZ;
   
         if ((linebuf = (char *)malloc(linebufsize)) == NULL)          if ((linebuf = (char *)malloc(linebufsize)) == NULL)
                 panic("Out of memory");                  errx(1, "Out of memory");
   
         argn = 0;          argn = 0;
         cp = line;          cp = line;
Line 423 
Line 425 
                                 linebufsize += BUFSIZ;                                  linebufsize += BUFSIZ;
                                 linebuf = (char *)realloc(linebuf, linebufsize);                                  linebuf = (char *)realloc(linebuf, linebufsize);
                                 if (linebuf == NULL)                                  if (linebuf == NULL)
                                         panic("Out of memory");                                          errx(1, "Out of memory");
                                 cp2 = linebuf + linebufsize - BUFSIZ - 1;                                  cp2 = linebuf + linebufsize - BUFSIZ - 1;
                         }                          }
                         cp++;                          cp++;
Line 521 
Line 523 
 scan(sp)  scan(sp)
         char **sp;          char **sp;
 {  {
         register char *cp, *cp2;          char *cp, *cp2;
         register int c;          int c;
         register struct lex *lp;          struct lex *lp;
         int quotec;          int quotec;
   
         if (regretp >= 0) {          if (regretp >= 0) {
Line 624 
Line 626 
         int token;          int token;
 {  {
         if (++regretp >= REGDEP)          if (++regretp >= REGDEP)
                 panic("Too many regrets");                  errx(1, "Too many regrets");
         regretstack[regretp] = token;          regretstack[regretp] = token;
         lexstring[STRINGLEN-1] = '\0';          lexstring[STRINGLEN-1] = '\0';
         string_stack[regretp] = savestr(lexstring);          string_stack[regretp] = savestr(lexstring);
Line 648 
Line 650 
 first(f, m)  first(f, m)
         int f, m;          int f, m;
 {  {
         register struct message *mp;          struct message *mp;
   
         if (msgCount == 0)          if (msgCount == 0)
                 return(0);                  return(0);
Line 672 
Line 674 
         char *str;          char *str;
         int mesg;          int mesg;
 {  {
         register char *cp, *cp2, *backup;          char *cp, *cp2, *backup;
   
         if (!*str)      /* null string matches nothing instead of everything */          if (!*str)      /* null string matches nothing instead of everything */
                 return(0);                  return(0);
Line 700 
Line 702 
 matchto(str, mesg)  matchto(str, mesg)
         char *str;          char *str;
 {  {
         register struct message *mp;          struct message *mp;
         register char *cp, *cp2, *backup, **to;          char *cp, *cp2, *backup, **to;
   
         str++;          str++;
   
Line 744 
Line 746 
         char *str;          char *str;
         int mesg;          int mesg;
 {  {
         register struct message *mp;          struct message *mp;
         register char *cp, *cp2, *backup;          char *cp, *cp2, *backup;
   
         str++;          str++;
         if (*str == '\0')          if (*str == '\0')
Line 794 
Line 796 
 mark(mesg)  mark(mesg)
         int mesg;          int mesg;
 {  {
         register int i;          int i;
   
         i = mesg;          i = mesg;
         if (i < 1 || i > msgCount)          if (i < 1 || i > msgCount)
                 panic("Bad message number to mark");                  errx(1, "Bad message number to mark");
         message[i-1].m_flag |= MMARK;          message[i-1].m_flag |= MMARK;
 }  }
   
Line 809 
Line 811 
 unmark(mesg)  unmark(mesg)
         int mesg;          int mesg;
 {  {
         register int i;          int i;
   
         i = mesg;          i = mesg;
         if (i < 1 || i > msgCount)          if (i < 1 || i > msgCount)
                 panic("Bad message number to unmark");                  errx(1, "Bad message number to unmark");
         message[i-1].m_flag &= ~MMARK;          message[i-1].m_flag &= ~MMARK;
 }  }
   
Line 824 
Line 826 
 metamess(meta, f)  metamess(meta, f)
         int meta, f;          int meta, f;
 {  {
         register int c, m;          int c, m;
         register struct message *mp;          struct message *mp;
   
         c = meta;          c = meta;
         switch (c) {          switch (c) {

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9