|
|
1.1 root 1: /* pe_extract.c - extract a PE */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/psap/RCS/pe_extract.c,v 7.0 89/11/23 22:13:04 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/psap/RCS/pe_extract.c,v 7.0 89/11/23 22:13:04 mrose Rel $
9: *
10: *
11: * $Log: pe_extract.c,v $
12: * Revision 7.0 89/11/23 22:13:04 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:
33: /* */
34:
35: /* assumes that q appears at most once directly under p... */
36:
37: int pe_extract (pe, r)
38: PE pe,
39: r;
40: {
41: register PE *p,
42: q;
43:
44: switch (pe -> pe_form) {
45: case PE_FORM_PRIM:
46: case PE_FORM_ICONS:
47: break;
48:
49: case PE_FORM_CONS:
50: for (p = &pe -> pe_cons; q = *p; p = &q -> pe_next)
51: if (q == r) {
52: (*p) = q -> pe_next;
53: q -> pe_next = NULLPE;
54: return 1;
55: }
56: else
57: if (pe_extract (q, r))
58: return 1;
59: break;
60: }
61:
62: return 0;
63: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.