]>
git.saurik.com Git - apple/security.git/blob - SecuritySNACCRuntime/compiler/back-ends/c-gen/util.h
2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
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
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.
20 * compiler/back-ends/c-gen/util.c - C encoder/decode related utility routines
24 * Copyright (C) 1992 Michael Sample and the University of British Columbia
26 * This program is free software; you can redistribute it and/or modify
27 * it under the terms of the GNU General Public License as published by
28 * the Free Software Foundation; either version 2 of the License, or
29 * (at your option) any later version.
31 * $Header: /cvs/Darwin/Security/SecuritySNACCRuntime/compiler/back-ends/c-gen/util.h,v 1.1.1.1 2001/05/18 23:14:09 mb Exp $
33 * Revision 1.1.1.1 2001/05/18 23:14:09 mb
34 * Move from private repository to open source repository
36 * Revision 1.2 2001/05/05 00:59:28 rmurphy
37 * Adding darwin license headers
39 * Revision 1.1.1.1 1999/03/16 18:06:44 aram
40 * Originals from SMIME Free Library.
42 * Revision 1.3 1995/07/25 18:48:39 rj
43 * changed `_' to `-' in file names.
45 * Revision 1.2 1994/10/08 03:48:21 rj
46 * since i was still irritated by cpp standing for c++ and not the C preprocessor, i renamed them to cxx (which is one known suffix for C++ source files). since the standard #define is __cplusplus, cplusplus would have been the more obvious choice, but it is a little too long.
48 * Revision 1.1 1994/08/28 09:48:45 rj
49 * first check-in. for a list of changes to the snacc-1.1 distribution please refer to the ChangeLog.
54 #define FIRST_LEVEL 1 /* must be 1 or greater */
55 #define MAX_VAR_REF 512 /* max chars for ref'ing a var eg v->foo->bar.x->v*/
57 void MakeVarPtrRef
PROTO (( CRules
* r
, TypeDef
* td
, Type
* parent
, Type
* fieldType
, char * parentVarName
, char * newVarName
));
59 void MakeVarValueRef
PROTO (( CRules
* r
, TypeDef
* td
, Type
* parent
, Type
* fieldType
, char * parentVarName
, char * newVarName
));
61 void MakeChoiceIdValueRef
PROTO (( CRules
* r
, TypeDef
* td
, Type
* parent
, Type
* fieldType
, char * parentVarName
, char * newVarName
));
63 void PrintElmtAllocCode
PROTO (( FILE * f
, Type
* type
, char * varPtrRefName
));
65 void PrintEocDecoders
PROTO (( FILE * f
, int maxLenLevel
, int minLenLevel
, char * lenBaseVarName
, int totalLevel
, char * totalBaseVarName
));