|
|
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 a
Length: 1792 (0x700)
Types: TextFile
Names: »addr2ref.c«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
└─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z«
└─⟦de7628f85⟧
└─⟦this⟧ »isode-6.0/psap/addr2ref.c«
/* addr2ref.c - manage encoded session addresses */
#ifndef lint
static char *rcsid = "$Header: /f/osi/psap/RCS/addr2ref.c,v 7.0 89/11/23 22:12:30 mrose Rel $";
#endif
/*
* $Header: /f/osi/psap/RCS/addr2ref.c,v 7.0 89/11/23 22:12:30 mrose Rel $
*
*
* $Log: addr2ref.c,v $
* Revision 7.0 89/11/23 22:12:30 mrose
* Release 6.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;
}