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 a

⟦061d73400⟧ TextFile

    Length: 1792 (0x700)
    Types: TextFile
    Names: »addr2ref.c«

Derivation

└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape
    └─⟦eba4602b1⟧ »./isode-5.0.tar.Z« 
        └─⟦d3ac74d73⟧ 
            └─⟦this⟧ »isode-5.0/psap/addr2ref.c« 

TextFile

/* addr2ref.c - manage encoded session addresses */

#ifndef	lint
static char *rcsid = "$Header: /f/osi/psap/RCS/addr2ref.c,v 6.0 89/03/18 23:38:08 mrose Rel $";
#endif

/* 
 * $Header: /f/osi/psap/RCS/addr2ref.c,v 6.0 89/03/18 23:38:08 mrose Rel $
 *
 *
 * $Log:	addr2ref.c,v $
 * Revision 6.0  89/03/18  23:38:08  mrose
 * Release 5.0
 * 
 */

/*
 *				  NOTICE
 *
 *    Acquisition, use, and distribution of this module and related
 *    materials are subject to the restrictions of a license agreement.
 *    Consult the Preface in the User's Manual for the full terms of
 *    this agreement.
 *
 */


/* LINTLIBRARY */

#include <stdio.h>
#include "psap.h"
#include "ssap.h"


long	time ();

/* \f

 */

struct SSAPref *addr2ref (addr)
register char   *addr;
{
    int     result;
    long    clock;
    register    PE pe;
    register struct tm *tm;
    struct UTCtime  uts;
    register struct UTCtime *ut = &uts;
    static struct SSAPref   srs;
    register struct SSAPref *sr = &srs;

    bzero ((char *) sr, sizeof *sr);

    if ((pe = t61s2prim (addr, strlen (addr))) == NULLPE)
	return NULL;
    result = stuff (pe, sr -> sr_udata, &sr -> sr_ulen);
    pe_free (pe);
    if (result == NOTOK)
	return NULL;

    if (time (&clock) == NOTOK || (tm = gmtime (&clock)) == NULL)
	return NULL;
    tm2ut (tm, ut);

    if ((pe = utct2prim (ut)) == NULLPE)
	return NULL;
    result = stuff (pe, sr -> sr_cdata, &sr -> sr_clen);
    pe_free (pe);
    if (result == NOTOK)
	return NULL;

    return sr;
}

/* \f

 */

static int  stuff (pe, dbase, dlen)
register PE pe;
register char *dbase;
register u_char *dlen;
{
    int     len;
    char   *base;

    if (pe2ssdu (pe, &base, &len) == NOTOK)
	return NOTOK;

    bcopy (base, dbase, (int) (*dlen = len));
    free (base);

    return OK;
}