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 r

⟦850672163⟧ TextFile

    Length: 2271 (0x8df)
    Types: TextFile
    Names: »rfc2globalid.c«

Derivation

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

TextFile

/* rfc2globalid.c - Converts a RFC string into a GlobalDomId struct */

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

/*
 * $Header: /cs/research/pp/hubris/pp-beta/Lib/format/RCS/rfc2globalid.c,v 5.0 90/09/20 16:05:38 pp Exp Locker: pp $
 *
 * $Log:	rfc2globalid.c,v $
 * Revision 5.0  90/09/20  16:05:38  pp
 * rcsforce : 5.0 public release
 * 
 */



#include "util.h"
#include "mta.h"




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


int rfc2x400globalid (gp, str)
GlobalDomId	*gp;
char		*str;
{
	char	*start, *end;
	if (lexnequ (str, "/PRMD=", strlen("/PRMD=")) == 0) {
		start = str+strlen("/PRMD=");
		if ((end = index(start, '/')) == NULLCP)
			return NOTOK;
		*end = '\0';
		gp -> global_Private = strdup(start);
		*end = '/';
		str = end;
	}
	if (lexnequ (str, "/ADMD=", strlen("/ADMD=")) == 0) {
		start = str+strlen("/ADMD=");
		if ((end = index(start, '/')) == NULLCP) {
			if (gp -> global_Private != NULLCP) {
				free (gp -> global_Private);
				gp -> global_Private = NULLCP;
			}
			return NOTOK;
		}
		*end = '\0';
		gp -> global_Admin = strdup(start);
		*end = '/';
		str = end;
	}
	if (lexnequ (str, "/C=", strlen("/C=")) == 0) {
		start = str+strlen("/C=");
		if ((end = index(start, '/')) == NULLCP) {
			if (gp -> global_Private != NULLCP) {
				free (gp -> global_Private);
				gp -> global_Private = NULLCP;
			}
			if (gp -> global_Admin != NULLCP) {
				free (gp -> global_Admin);
				gp -> global_Admin = NULLCP;
			}
			return NOTOK;
		}
		*end = '\0';
		gp -> global_Country = strdup(start);
		*end = '/';
		str = end;
	}
	return OK;
}
	

int rfc2globalid (gp, str)
GlobalDomId     *gp;
char            *str;
{

	char    *cp = str,
		*bp = str;

	PP_DBG (("Lib/rfc2globalid (%s)", str));


	if (*cp == '*')
		return NOTOK;

	/* -- Country -- */
	cp = index (bp, '*');
	if (cp == NULLCP)
		return NOTOK;
	*cp++ = '\0';
	gp->global_Country = strdup (bp);
	bp = cp;

	/* -- Admin -- */
	cp = index (bp, '*');
	if (cp != NULLCP)
		*cp++ = '\0';
	gp->global_Admin = strdup (bp);
	bp = cp;

	/* -- Prmd -- */
	if (cp == NULLCP)
		return OK;
	gp->global_Private = strdup (bp);

	return OK;
}