/[mailutils]/mailutils/examples/addr.c
ViewVC logotype

Diff of /mailutils/examples/addr.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by gray, Thu Aug 29 14:42:27 2002 UTC revision 1.9 by gray, Mon Sep 2 14:33:29 2002 UTC
# Line 58  parse (const char *str) Line 58  parse (const char *str)
58        printf ("%d ", no);        printf ("%d ", no);
59    
60        if (isgroup)        if (isgroup)
61          {          {
62            address_get_personal (address, no, buf, sizeof (buf), &got);            address_get_personal (address, no, buf, sizeof (buf), &got);
63    
64            printf ("group <%s>\n", buf);            printf ("group <%s>\n", buf);
65          }          }
66        else        else
67          {          {
68            address_get_email (address, no, buf, sizeof (buf), 0);            address_get_email (address, no, buf, sizeof (buf), 0);
69    
70            printf ("email <%s>\n", buf);            printf ("email <%s>\n", buf);
71          }          }
72    
73        address_get_personal (address, no, buf, sizeof (buf), &got);        address_get_personal (address, no, buf, sizeof (buf), &got);
74    
75        if (got && !isgroup)        if (got && !isgroup)
76          printf ("   personal <%s>\n", buf);          printf ("   personal <%s>\n", buf);
77    
78        address_get_comments (address, no, buf, sizeof (buf), &got);        address_get_comments (address, no, buf, sizeof (buf), &got);
79    
80        if (got)        if (got)
81          printf ("   comments <%s>\n", buf);          printf ("   comments <%s>\n", buf);
82    
83        address_get_local_part (address, no, buf, sizeof (buf), &got);        address_get_local_part (address, no, buf, sizeof (buf), &got);
84    
85        if (got)        if (got)
86          {          {
87            printf ("   local-part <%s>", buf);            printf ("   local-part <%s>", buf);
88    
89            address_get_domain (address, no, buf, sizeof (buf), &got);            address_get_domain (address, no, buf, sizeof (buf), &got);
90    
91            if (got)            if (got)
92              printf (" domain <%s>", buf);              printf (" domain <%s>", buf);
93    
94            printf ("\n");            printf ("\n");
95          }          }
96    
97        address_get_route (address, no, buf, sizeof (buf), &got);        address_get_route (address, no, buf, sizeof (buf), &got);
98    
99        if (got)        if (got)
100          printf ("   route <%s>\n", buf);          printf ("   route <%s>\n", buf);
101      }      }
102    address_destroy (&address);    address_destroy (&address);
103    
# Line 132  main (int argc, const char *argv[]) Line 132  main (int argc, const char *argv[])
132    for (; argv[argc]; argc++)    for (; argv[argc]; argc++)
133      {      {
134        if (strcmp (argv[argc], "-") == 0)        if (strcmp (argv[argc], "-") == 0)
135          {          {
136            parseinput ();            parseinput ();
137          }          }
138        else        else
139          {          {
140            parse (argv[argc]);            parse (argv[argc]);
141          }          }
142      }      }
143    
144    return 0;    return 0;

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

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26