DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T X

⟦91a033930⟧ TextFile

    Length: 1534 (0x5fe)
    Types: TextFile
    Names: »X400_addr.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z« 
        └─⟦e5a54fb17⟧ 
            └─⟦this⟧ »pp-5.0/Uip/misc/X400_addr.c« 

TextFile

/* x400_adr.c: basically ckadr but stripped */
/*	returns the x400 form of the given addresses */

# ifndef lint
static char Rcsid[] = "@(#)$Header: /cs/research/pp/hubris/pp-beta/Uip/misc/RCS/X400_addr.c,v 5.0 90/09/20 16:33:15 pp Exp Locker: pp $";
# endif

/*
 * $Header: /cs/research/pp/hubris/pp-beta/Uip/misc/RCS/X400_addr.c,v 5.0 90/09/20 16:33:15 pp Exp Locker: pp $
 *
 * $Log:	X400_addr.c,v $
 * Revision 5.0  90/09/20  16:33:15  pp
 * rcsforce : 5.0 public release
 * 
 */



#include "util.h"
#include "adr.h"
#include "retcode.h"
#include "list_rchan.h"


static int	responsibility = NO;
static int	parse= CH_UK_PREF;
static void	parse_address();


/* ---------------------  Begin  Routines  ---------------------------------- */

main(argc, argv)
int	   argc;
char	   **argv;
{
	char	buf[BUFSIZ];
	int	i = 1;
	int	opt;

	sys_init(argv[0]);
	
	argc--;
	argv++;
		
	if (argc == 0) 
		while (gets(buf) != NULL)
			parse_address(buf);
	else 
		while (argc--)
			parse_address(*argv++);
}

static void parse_address(str)
char	*str;
{
	ADDR		*ad;
	RP_Buf		rp;
	int		origType;
	int		type, first;
	LIST_RCHAN	*ix;


	if (index (str, '@'))
		type = AD_822_TYPE; 
	else if (str[0] == '/')
		type = AD_X400_TYPE;
	else 
		type = AD_822_TYPE;

	ad = adr_new(str, type, 0);
	ad -> ad_resp = responsibility;
	origType = ad->ad_type;

	if (rp_isbad(ad_parse(ad, &rp, parse)))
		printf("Address parsing failed:\nReason: %s\nParsing gave this:\n\n", ad->ad_parse_message);
	if (isstr(ad->ad_r400adr))
		printf("%s\n", ad->ad_r400adr);
}