|
|
1.1 root 1: /* ssdu2pe.c - read a PE from SSDU */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/psap/RCS/ssdu2pe.c,v 7.0 89/11/23 22:13:44 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/psap/RCS/ssdu2pe.c,v 7.0 89/11/23 22:13:44 mrose Rel $
9: *
10: *
11: * $Log: ssdu2pe.c,v $
12: * Revision 7.0 89/11/23 22:13:44 mrose
13: * Release 6.0
14: *
15: */
16:
17: /*
18: * NOTICE
19: *
20: * Acquisition, use, and distribution of this module and related
21: * materials are subject to the restrictions of a license agreement.
22: * Consult the Preface in the User's Manual for the full terms of
23: * this agreement.
24: *
25: */
26:
27:
28: /* LINTLIBRARY */
29:
30: #include <stdio.h>
31: #include "psap.h"
32: #include "tailor.h"
33:
34: /* */
35:
36: PE ssdu2pe (base, len, realbase, result)
37: char *base,
38: *realbase;
39: int len;
40: int *result;
41: {
42: register PE pe;
43: register PS ps;
44:
45: if ((ps = ps_alloc (str_open)) == NULLPS) {
46: *result = PS_ERR_NMEM;
47: return NULLPE;
48: }
49: if (str_setup (ps, base, len, 1) == OK) {
50: if (!realbase)
51: ps -> ps_inline = 0;
52: if (pe = ps2pe (ps)) {
53: if (realbase)
54: pe -> pe_realbase = realbase;
55:
56: ps -> ps_errno = PS_ERR_NONE;
57: }
58: else
59: if (ps -> ps_errno == PS_ERR_NONE)
60: ps -> ps_errno = PS_ERR_EOF;
61: }
62:
63: *result = ps -> ps_errno;
64:
65: ps -> ps_inline = 1;
66: ps_free (ps);
67:
68: #ifdef DEBUG
69: if (pe && (psap_log -> ll_events & LLOG_PDUS))
70: pe2text (psap_log, pe, 1, len);
71: #endif
72:
73: return pe;
74: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.