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

⟦772bf3902⟧ TextFile

    Length: 1859 (0x743)
    Types: TextFile
    Names: »x400_rfc822.c«

Derivation

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

TextFile

/* x400_rfc822.c: address conversion from x400 to 822 */

# ifndef lint
static char Rcsid[] = "@(#)$Header: /cs/research/pp/hubris/pp-beta/Lib/parse/RCS/x400_rfc822.c,v 5.0 90/09/20 16:10:00 pp Exp Locker: pp $";
# endif

/*
 * $Header: /cs/research/pp/hubris/pp-beta/Lib/parse/RCS/x400_rfc822.c,v 5.0 90/09/20 16:10:00 pp Exp Locker: pp $
 *
 * $Log:	x400_rfc822.c,v $
 * Revision 5.0  90/09/20  16:10:00  pp
 * rcsforce : 5.0 public release
 * 
 */



#include "head.h"
#include "adr.h"
#include "or.h"
#include "ap.h"



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


extern char	or_error[];

int x400_rfc822 (ad, or, order_pref, full, 
		 pgroup, pname, plocal, pdomain, proute)
ADDR    *ad;
OR_ptr	or;
int     order_pref;
AP_ptr	*pgroup,
	*pname,
	*plocal,
	*pdomain,
	*proute;
{
	char            tbuf[LINESIZE];
	char		*value;
	int		retval;	

	
	if (ad->ad_r400adr != NULLCP)
		value = ad->ad_r400adr;
	else
		value = ad->ad_value;

	PP_DBG (("x400_rfc822 (%s)", value));

	or = or_std2or (value);

	/* -- failed to convert -- */
	if (or == NULLOR) {	/* SEK - should log failure */
		PP_LOG(LLOG_EXCEPTIONS,
		       ("Lib/parse/x400_rfc822: failed to convert '%s'",
			value));
		return RP_PARSE;
	}

	if (ad->ad_r400adr == NULLCP) {
		or_or2std (or, tbuf, FALSE);
		ad->ad_r400adr = strdup (tbuf);
	}



	retval = or_or2rfc (or, tbuf);

	if (retval == DONE) {
		or_free (or);
		or = NULLOR;
		return RP_AOK;
	}
	else if (retval == NOTOK) { 
		or_free (or);
		or = NULLOR;
		PP_DBG(("x400_rfc822/Conversion failed (%s)", or_error));
		return RP_PARSE;
	}



	if (ad->ad_r822adr)
		free (ad->ad_r822adr);

	ad->ad_r822adr = strdup (tbuf);
	
	if (rp_isbad(rfc822_parse (ad, order_pref, full,
				   pgroup, pname, plocal, pdomain, proute)))
		return RP_PARSE;

	PP_DBG (("x400_rfc822 (%s)", tbuf));

	return (RP_AOK);
}