386BSD 0.1 development
[unix-history] / usr / othersrc / contrib / isode / psap / pe2ssdu.c
CommitLineData
cf908fd1
WJ
1/* pe2ssdu.c - write a PE to a SSDU */
2
3#ifndef lint
4static char *rcsid = "$Header: /f/osi/psap/RCS/pe2ssdu.c,v 7.2 91/02/22 09:36:04 mrose Interim $";
5#endif
6
7/*
8 * $Header: /f/osi/psap/RCS/pe2ssdu.c,v 7.2 91/02/22 09:36:04 mrose Interim $
9 *
10 *
11 * $Log: pe2ssdu.c,v $
12 * Revision 7.2 91/02/22 09:36:04 mrose
13 * Interim 6.8
14 *
15 * Revision 7.1 91/01/24 14:50:19 mrose
16 * update
17 *
18 * Revision 7.0 89/11/23 22:12:57 mrose
19 * Release 6.0
20 *
21 */
22
23/*
24 * NOTICE
25 *
26 * Acquisition, use, and distribution of this module and related
27 * materials are subject to the restrictions of a license agreement.
28 * Consult the Preface in the User's Manual for the full terms of
29 * this agreement.
30 *
31 */
32
33
34/* LINTLIBRARY */
35
36#include <stdio.h>
37#include "psap.h"
38#include "tailor.h"
39
40/* \f */
41
42int pe2ssdu (pe, base, len)
43register PE pe;
44char **base;
45int *len;
46{
47 register int plen, ret;
48
49 *len = 0;
50 plen = ps_get_abs (pe);
51 Qcp = (char *)malloc(plen);
52 *base = Qcp;
53
54 if (Qcp == NULL)
55 return NOTOK;
56
57 Len = 0;
58 Ecp = Qcp + plen;
59 if ((ret = pe2qb_f(pe)) != plen) {
60 printf("pe2ssdu: bad length returned %d should be %d\n",
61 ret, plen);
62 return NOTOK;
63 }
64 *len = plen;
65
66#ifdef DEBUG
67 if (psap_log -> ll_events & LLOG_PDUS)
68 pe2text (psap_log, pe, 0, *len);
69#endif
70
71 return OK;
72}