|
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: 1807 (0x70f) Types: TextFile Names: »pe.c«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0 └─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z« └─⟦de7628f85⟧ └─⟦this⟧ »isode-6.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 7.0 89/11/23 21:44:20 mrose Rel $"; #endif /* * $Header: /f/osi/dsap/common/RCS/pe.c,v 7.0 89/11/23 21:44:20 mrose Rel $ * * * $Log: pe.c,v $ * Revision 7.0 89/11/23 21:44:20 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 "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 ( format == FILEOUT) { (void) pe2ps (ps,pe); return; } if ((sps = ps_alloc (str_open)) == NULLPS) return; if (str_setup (sps,NULLCP,LINESIZE,0) == NOTOK) return; if (format == READOUT) fmt = "%02x "; else { ps_print (ps,"{ASN} "); 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 (); int val; 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",&val); *ptr++ = val & 0xff; 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); }