|
|
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 p
Length: 1677 (0x68d)
Types: TextFile
Names: »pe.c«
└─⟦3d0c2be1b⟧ Bits:30001254 ISODE-5.0 Tape
└─⟦eba4602b1⟧ »./isode-5.0.tar.Z«
└─⟦d3ac74d73⟧
└─⟦this⟧ »isode-5.0/dsap/common/pe.c«
/* pe.c - General PE utility routines */
#ifndef lint
static char *rcsid = "$Header: /f/osi/dsap/common/RCS/pe.c,v 6.0 89/03/18 23:27:43 mrose Rel $";
#endif
/*
* $Header: /f/osi/dsap/common/RCS/pe.c,v 6.0 89/03/18 23:27:43 mrose Rel $
*
*
* $Log: pe.c,v $
* Revision 6.0 89/03/18 23:27:43 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 "quipu/util.h"
#include "psap.h"
#include "quipu/attr.h" /* for defn of READOUT */
pe_print (ps, pe, format)
register PS ps;
register PE pe;
int format;
{
char * ptr;
register int i;
PS sps;
char * fmt;
if ((sps = ps_alloc (str_open)) == NULLPS)
return;
if (str_setup (sps,NULLCP,LINESIZE,0) == NOTOK)
return;
if (format == READOUT )
fmt = "%02x ";
else
fmt = "%02x";
(void) pe2ps (sps,pe);
ptr = sps->ps_base;
for (i=0; i<sps->ps_byteno; i++)
ps_printf (ps,fmt,*ptr++ & 255);
ps_print (ps,"00");
ps_free (sps);
}
PE asn2pe (str)
char * str;
{
char * ptr;
char * pe_ptr;
register int i,j;
PS sps;
void StripSpace ();
PE pe;
StripSpace (str);
j = strlen (str);
pe_ptr = (char *) smalloc (j+10);
ptr = pe_ptr;
for ( i=0 ; i<j; i++) {
(void) sscanf (str,"%2x",ptr++);
str++; str++;
}
if ((sps = ps_alloc (str_open)) == NULLPS)
return(NULLPE);
if (str_setup (sps,pe_ptr,j,1) == NOTOK)
return(NULLPE);
pe = ps2pe (sps);
ps_free (sps);
return (pe);
}