|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T o
Length: 1925 (0x785)
Types: TextFile
Names: »or2rfc.c«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
└─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z«
└─⟦e5a54fb17⟧
└─⟦this⟧ »pp-5.0/Tools/ckor/or2rfc.c«
/* or2rfc.c: Parses an RFC address using the tables or, or2rfc and rfc2or */
# ifndef lint
static char Rcsid[] = "@(#)$Header: /cs/research/pp/hubris/pp-beta/Tools/ckor/RCS/or2rfc.c,v 5.0 90/09/20 16:25:45 pp Exp Locker: pp $";
# endif
/*
* $Header: /cs/research/pp/hubris/pp-beta/Tools/ckor/RCS/or2rfc.c,v 5.0 90/09/20 16:25:45 pp Exp Locker: pp $
*
* $Log: or2rfc.c,v $
* Revision 5.0 90/09/20 16:25:45 pp
* rcsforce : 5.0 public release
*
*/
#include "head.h"
#include "or.h"
extern char or_error[];
/* --------------------- Begin Routines -------------------------------- */
main (argc, argv)
int argc;
char *argv[];
{
char buf[BUFSIZ];
int i = 1;
sys_init (argv[0]);
if (or_init() == NOTOK ) {
printf ("or_init() failed\n");
exit (1);
}
if (argc == 1)
while (gets (buf) != NULL)
parse_address (buf);
else
while (i < argc)
parse_address (argv[i++]);
}
/* --------------------- Static Routines ------------------------------- */
static int parse_address (str)
char *str;
{
char rfcbuf [BUFSIZ];
char x400buf [BUFSIZ];
OR_ptr or = NULLOR;
or_error[0] = x400buf[0] = rfcbuf[0] = '\0';
if ((or = or_std2or (str)) == NULLOR)
goto error;
if (or_or2rfc (or, rfcbuf) == NOTOK)
goto error;
if (isstr (or_error))
goto error;
or_free (or);
or = NULLOR;
if (or_rfc2or (rfcbuf, &or) == NOTOK)
goto error;
if (isstr (or_error))
goto error;
or_or2std (or, x400buf, FALSE);
printf ("\n%s -> (rfc822) %s\n%-*s -> (x400) %s\n",
str, rfcbuf, strlen(str), "", x400buf);
goto finish;
error: ;
printf ("\nAddress parsing failed \nReason : %s\n", or_error);
if (rfcbuf[0] != '\0')
printf ("%s -> (rfc822) %s\n", str, rfcbuf);
if (x400buf[0] != '\0')
printf ("%s -> (x400) %s\n", str, x400buf);
finish: ;
printf ("\n");
fflush (stdout);
if (or)
or_free (or);
return;
}