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

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

version 1.8, 1997/07/31 02:48:14 version 1.9, 1997/11/14 00:23:53
Line 62 
Line 62 
         char str[];          char str[];
         int ntype;          int ntype;
 {  {
         register struct name *np;          struct name *np;
   
         np = (struct name *)salloc(sizeof(*np));          np = (struct name *)salloc(sizeof(*np));
         np->n_flink = NIL;          np->n_flink = NIL;
Line 79 
Line 79 
 tailof(name)  tailof(name)
         struct name *name;          struct name *name;
 {  {
         register struct name *np;          struct name *np;
   
         np = name;          np = name;
         if (np == NIL)          if (np == NIL)
Line 99 
Line 99 
         char line[];          char line[];
         int ntype;          int ntype;
 {  {
         register char *cp;          char *cp;
         register struct name *top, *np, *t;          struct name *top, *np, *t;
         char *nbuf;          char *nbuf;
   
         if (line == NULL || *line == '\0')          if (line == NULL || *line == '\0')
                 return(NIL);                  return(NIL);
         if ((nbuf = (char *)malloc(strlen(line) + 1)) == NULL)          if ((nbuf = (char *)malloc(strlen(line) + 1)) == NULL)
                 panic("Out of memory");                  errx(1, "Out of memory");
         top = NIL;          top = NIL;
         np = NIL;          np = NIL;
         cp = line;          cp = line;
Line 128 
Line 128 
  */   */
 char *  char *
 detract(np, ntype)  detract(np, ntype)
         register struct name *np;          struct name *np;
         int ntype;          int ntype;
 {  {
         register int s;          int s, comma;
         register char *cp, *top;          char *cp, *top;
         register struct name *p;          struct name *p;
         register int comma;  
   
         comma = ntype & GCOMMA;          comma = ntype & GCOMMA;
         if (np == NIL)          if (np == NIL)
Line 177 
Line 176 
 yankword(ap, wbuf)  yankword(ap, wbuf)
         char *ap, wbuf[];          char *ap, wbuf[];
 {  {
         register char *cp, *cp2;          char *cp, *cp2;
   
         cp = ap;          cp = ap;
         for (;;) {          for (;;) {
                 if (*cp == '\0')                  if (*cp == '\0')
                         return(NULL);                          return(NULL);
                 if (*cp == '(') {                  if (*cp == '(') {
                         register int nesting = 0;                          int nesting = 0;
   
                         while (*cp != '\0') {                          while (*cp != '\0') {
                                 switch (*cp++) {                                  switch (*cp++) {
Line 227 
Line 226 
         FILE *fo;          FILE *fo;
         struct header *hp;          struct header *hp;
 {  {
         register int c;          int c, ispipe;
         register struct name *np, *top;          struct name *np, *top;
         time_t now;          time_t now;
         char *date, *fname;          char *date, *fname;
         FILE *fout, *fin;          FILE *fout, *fin;
         int ispipe;  
   
         top = names;          top = names;
         np = names;          np = names;
Line 371 
Line 369 
 isfileaddr(name)  isfileaddr(name)
         char *name;          char *name;
 {  {
         register char *cp;          char *cp;
   
         if (*name == '+')          if (*name == '+')
                 return(1);                  return(1);
Line 395 
Line 393 
 usermap(names)  usermap(names)
         struct name *names;          struct name *names;
 {  {
         register struct name *new, *np, *cp;          struct name *new, *np, *cp;
         struct grouphead *gh;          struct grouphead *gh;
         register int metoo;          int metoo;
   
         new = NIL;          new = NIL;
         np = names;          np = names;
Line 477 
Line 475 
 cat(n1, n2)  cat(n1, n2)
         struct name *n1, *n2;          struct name *n1, *n2;
 {  {
         register struct name *tail;          struct name *tail;
   
         if (n1 == NIL)          if (n1 == NIL)
                 return(n2);                  return(n2);
Line 497 
Line 495 
 unpack(np)  unpack(np)
         struct name *np;          struct name *np;
 {  {
         register char **ap, **top;          char **ap, **top;
         register struct name *n;          struct name *n;
         int t, extra, metoo, verbose;          int t, extra, metoo, verbose;
   
         n = np;          n = np;
         if ((t = count(n)) == 0)          if ((t = count(n)) == 0)
                 panic("No names to unpack");                  errx(1, "No names to unpack");
         /*          /*
          * Compute the number of extra arguments we will need.           * Compute the number of extra arguments we will need.
          * We need at least two extra -- one for "mail" and one for           * We need at least two extra -- one for "mail" and one for
Line 542 
Line 540 
 elide(names)  elide(names)
         struct name *names;          struct name *names;
 {  {
         register struct name *np, *t, *new;          struct name *np, *t, *new;
         struct name *x;          struct name *x;
   
         if (names == NIL)          if (names == NIL)
Line 654 
Line 652 
  */   */
 int  int
 count(np)  count(np)
         register struct name *np;          struct name *np;
 {  {
         register int c;          int c;
   
         for (c = 0; np != NIL; np = np->n_flink)          for (c = 0; np != NIL; np = np->n_flink)
                 if ((np->n_type & GDEL) == 0)                  if ((np->n_type & GDEL) == 0)
Line 669 
Line 667 
  */   */
 struct name *  struct name *
 delname(np, name)  delname(np, name)
         register struct name *np;          struct name *np;
         char name[];          char name[];
 {  {
         register struct name *p;          struct name *p;
   
         for (p = np; p != NIL; p = p->n_flink)          for (p = np; p != NIL; p = p->n_flink)
                 if (strcasecmp(p->n_name, name) == 0) {                  if (strcasecmp(p->n_name, name) == 0) {
Line 703 
Line 701 
 prettyprint(name)  prettyprint(name)
         struct name *name;          struct name *name;
 {  {
         register struct name *np;          struct name *np;
   
         np = name;          np = name;
         while (np != NIL) {          while (np != NIL) {

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