/* pe.c - General PE utility routines */
static char *rcsid
= "$Header: /f/osi/dsap/common/RCS/pe.c,v 7.2 91/02/22 09:19:56 mrose Interim $";
* $Header: /f/osi/dsap/common/RCS/pe.c,v 7.2 91/02/22 09:19:56 mrose Interim $
* Revision 7.2 91/02/22 09:19:56 mrose
* Revision 7.1 90/10/17 11:42:32 mrose
* Revision 7.0 89/11/23 21:44:20 mrose
* 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
#include "quipu/attr.h" /* for defn of READOUT */
pe_print (ps
, pe
, format
)
static char hex
[] = "0123456789abcdef";
if ( format
== FILEOUT
) {
if ((format
== READOUT
) && (pe
->pe_len
>= LINESIZE
)) {
ps_print (ps
,"ASN attribute too big to print here!");
if ((sps
= ps_alloc (str_open
)) == NULLPS
)
if (str_setup (sps
,NULLCP
,LINESIZE
,0) == NOTOK
)
(void) ps_write (ps
, (PElementData
)"{ASN}", 5);
for (i
=0, j
=0; i
<sps
->ps_byteno
; i
++) {
ps_printf (sps2,fmt,*ptr++ & 255);
*s
++ = hex
[((*ptr
& 255)/16) % 16];
*s
++ = hex
[(*ptr
++ & 255) % 16];
(void) ps_write (ps
, (PElementData
)buffer
, j
);
(void) ps_write (ps
, (PElementData
)buffer
, j
);
(void) ps_write (ps
, (PElementData
)"00", 2);
pe_ptr
= (char *) smalloc (j
+10);
(void) sscanf (str
,"%2x",&val
);
if ((sps
= ps_alloc (str_open
)) == NULLPS
)
if (str_setup (sps
,pe_ptr
,j
,1) == NOTOK
)
if (sps
->ps_errno
!= PS_ERR_NONE
) {
LLOG (log_dsap
,LLOG_EXCEPTIONS
,("%s in ASN attribute ",ps_error(sps
->ps_errno
)));