]> git.saurik.com Git - apple/security.git/blob - SecuritySNACCRuntime/c++-lib/inc/snacc.h
4124e9db42b6c805e00e3ba90932aa2c91aa8f55
[apple/security.git] / SecuritySNACCRuntime / c++-lib / inc / snacc.h
1 /*
2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
3 *
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
8 * using this file.
9 *
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
16 */
17
18
19 /*
20 * file: snacc.h
21 *
22 *
23 * ------------------------------------------------------------------------
24 * - J.G. Van Dyke & Associates, Inc. Modification History of SNACC 1.3 -
25 * ------------------------------------------------------------------------
26 *
27 * All modification are relative to the v1.3 of SNACC. We used SunOS 4.1.3's
28 * SCCS. The revision #'s start at 1.1, which is the original version from
29 * SNACC 1.3.
30 *
31 *
32 * ../SCCS/s.snacc.h:
33 *
34 * D 1.3 98/04/24 22:30:19 pleonber 3 2 00002/00000/00157
35 * added INSERT_VDA_COMMENTS comment for script that adds SCCS history.
36 *
37 * D 1.2 97/11/07 08:01:08 pleonber 2 1 00004/00000/00153
38 * added #ifndef _gVDADER_RULES extern int gVDADER_RULES #endif
39 *
40 * D 1.1 97/10/30 13:09:44 cmmaster 1 0 00153/00000/00000
41 * date and time created 97/10/30 13:09:44 by cmmaster
42 *
43 * ----------------------- End of VDA Modifications ---------------------------
44 *
45 *
46 *
47 * $Header: /cvs/Darwin/Security/SecuritySNACCRuntime/c++-lib/inc/snacc.h,v 1.1.1.1 2001/05/18 23:14:06 mb Exp $
48 * $Log: snacc.h,v $
49 * Revision 1.1.1.1 2001/05/18 23:14:06 mb
50 * Move from private repository to open source repository
51 *
52 * Revision 1.2 2001/05/05 00:59:18 rmurphy
53 * Adding darwin license headers
54 *
55 * Revision 1.1 2000/06/15 18:47:21 dmitch
56 * Files duplicated or copied from elsewhere. See Apple_README for gory details.
57 *
58 * Revision 1.1.1.1 2000/03/09 01:00:04 rmurphy
59 * Base Fortissimo Tree
60 *
61 * Revision 1.1 1999/02/25 05:32:31 mb
62 * Added public headers.
63 *
64 * Revision 1.7 1997/04/07 13:13:18 wan
65 * Made more C++ readable (credits to Steve Walker)
66 *
67 * Revision 1.6 1997/02/28 13:39:35 wan
68 * Modifications collected for new version 1.3: Bug fixes, tk4.2.
69 *
70 * Revision 1.5 1997/02/15 20:38:48 rj
71 * In member functions, return *this after calling abort() for stupid compilers that don't seem to know about volatile abort() (they would otherwise abort with an error).
72 *
73 * Revision 1.4 1995/07/24 15:06:52 rj
74 * configure checks for mem* functions. define replacements using b* functions, if necessary.
75 *
76 */
77
78 #ifndef _SNACC_H_
79 #define _SNACC_H_
80
81 #define GLASS 1
82 #define KHO 1
83
84 #include "config.h"
85
86 #if STDC_HEADERS
87 #include <stdlib.h>
88 #endif
89
90 #ifndef NULL
91 #define NULL 0
92 #endif
93
94 #if HAVE_MEMCMP /* memcmp(3) returns <0, 0 and 0, bcmp(3) returns only 0 and !0 */
95 #define memcmpeq( a, b, len) memcmp (a, b, len)
96 #else
97 #define memcmpeq( a, b, len) bcmp (a, b, len)
98 #endif
99 #if HAVE_MEMSET
100 #define memzero( p, len) memset (p, 0, len)
101 #else
102 #define memzero( p, len) bzero (p, len)
103 #endif
104 #if !HAVE_MEMCPY
105 #define memcpy( dst, src, len) bcopy (src, dst, len)
106 #endif
107
108 #ifdef __cplusplus
109
110 #ifdef VOLATILE_RETRUN
111 # define RETURN_THIS_FOR_COMPILERS_WITHOUT_VOLATILE_FUNCTIONS return *this;
112 #else
113 # define RETURN_THIS_FOR_COMPILERS_WITHOUT_VOLATILE_FUNCTIONS
114 #endif
115
116 #if !BOOL_BUILTIN
117 #ifndef true
118 // enum bool { false, true };
119 // the above looks elegant, but leads to anachronisms (<, ==, !=, ... return value of type int, not enum bool), therefore:
120 typedef int bool;
121 enum { false, true };
122 #endif
123 #endif
124
125 #else /* !__cplusplus */
126
127 #ifndef FALSE
128 #define FALSE 0
129 #endif
130 #ifndef TRUE
131 #define TRUE 1
132 #endif
133
134 #endif /* __cplusplus */
135
136 /*
137 * Inspired by gdb 4.0, for better or worse...
138 * (grabbed from Barry Brachman - MS)
139 *
140 * These macros munge C routine declarations such
141 * that they work for ANSI or non-ANSI C compilers
142 */
143 #ifdef __USE_ANSI_C__
144
145 #define PROTO( X) X
146 #define PARAMS( arglist, args) (args)
147 #define NOPARAMS() (void)
148 #define _AND_ ,
149 #define DOTS , ...
150
151 #else /* !__USE_ANSI_C__ */
152
153 #define PROTO( X) ()
154 #define PARAMS( arglist, args) arglist args;
155 #define NOPARAMS() ()
156 #define _AND_ ;
157 #define DOTS
158 #define void char
159
160 #endif /* __USE_ANSI_C__ */
161
162 #include "policy.h"
163
164 #if COMPILER
165 #define TCL (HAVE_TCL && !NO_TCL)
166 #define META (TCL && !NO_META)
167 #endif
168
169 #if MAKEDEPEND
170 #if !NO_META
171 #ifdef META
172 #undef META
173 #endif
174 #define META 1
175 #endif
176 #if !NO_TCL
177 #ifdef TCL
178 #undef TCL
179 #endif
180 #define TCL 1
181 #endif
182 #endif
183
184 #if TCL
185 #ifdef META
186 #undef META
187 #endif
188 #define META 1
189 #endif
190
191 #define COMMA ,
192
193 #ifdef _IBM_ENC_
194 #define if_IBM_ENC( code) code
195 #else
196 #define if_IBM_ENC( code)
197 #endif
198
199 #if META
200 #define if_META( code) code
201 #else
202 #define if_META( code)
203 #endif
204
205 #if TCL && META
206 #define if_TCL( code) code
207 #else
208 #define if_TCL( code)
209 #endif
210
211 #ifndef _gVDADER_RULES
212 extern int gVDADER_RULES;
213 #endif
214
215 #endif /* _SNACC_H_ */