Commit | Line | Data |
---|---|---|
9e8e5516 C |
1 | /* flag2prim.c - boolean to presentation element */ |
2 | ||
3 | #ifndef lint | |
4 | static char *rcsid = "$Header: /f/osi/psap/RCS/flag2prim.c,v 7.1 91/02/22 09:35:38 mrose Interim $"; | |
5 | #endif | |
6 | ||
7 | /* | |
8 | * $Header: /f/osi/psap/RCS/flag2prim.c,v 7.1 91/02/22 09:35:38 mrose Interim $ | |
9 | * | |
10 | * | |
11 | * $Log: flag2prim.c,v $ | |
12 | * Revision 7.1 91/02/22 09:35:38 mrose | |
13 | * Interim 6.8 | |
14 | * | |
15 | * Revision 7.0 89/11/23 22:12:36 mrose | |
16 | * Release 6.0 | |
17 | * | |
18 | */ | |
19 | ||
20 | /* | |
21 | * NOTICE | |
22 | * | |
23 | * Acquisition, use, and distribution of this module and related | |
24 | * materials are subject to the restrictions of a license agreement. | |
25 | * Consult the Preface in the User's Manual for the full terms of | |
26 | * this agreement. | |
27 | * | |
28 | */ | |
29 | ||
30 | ||
31 | /* LINTLIBRARY */ | |
32 | ||
33 | #include <stdio.h> | |
34 | #include "psap.h" | |
35 | ||
36 | /* \f */ | |
37 | ||
38 | PE flag2prim (b, class, id) | |
39 | register int b; | |
40 | PElementClass class; | |
41 | PElementID id; | |
42 | { | |
43 | register PE pe; | |
44 | ||
45 | if ((pe = pe_alloc (class, PE_FORM_PRIM, id)) == NULLPE) | |
46 | return NULLPE; | |
47 | ||
48 | if ((pe -> pe_prim = PEDalloc (pe -> pe_len = 1)) == NULLPED) { | |
49 | pe_free (pe); | |
50 | return NULLPE; | |
51 | } | |
52 | ||
53 | *pe -> pe_prim = b ? 0xff : 0x00; | |
54 | ||
55 | return pe; | |
56 | } |