]>
git.saurik.com Git - apple/security.git/blob - SecuritySNACCRuntime/compiler/core/exports.c
2 * compiler/core/exports.c
4 * ExportElmt list set up during parse.
5 * (not kept in Module data struct)
7 * SetExports runs through type, value & macro defs and sets the
8 * exported flag accordingly.
10 * The exportsParsed boolean means whether the symbol "EXPORTS"
11 * was parsed - since if EXPORTS was parsed and the export list
12 * is empty, NOTHING is exported, otherwise if the "EXPORTS"
13 * symbol was not parsed (export list is empty) then EVERYTHING
14 * is exported. If "EXPORTS" was parsed and the list is not
15 * empty, then mark each item is the list as exported and the
16 * rest (that are not in the list) as not exported.
20 * Copyright (C) 1991, 1992 Michael Sample
21 * and the University of British Columbia
23 * This program is free software; you can redistribute it and/or modify
24 * it under the terms of the GNU General Public License as published by
25 * the Free Software Foundation; either version 2 of the License, or
26 * (at your option) any later version.
28 * $Header: /cvs/Darwin/Security/SecuritySNACCRuntime/compiler/core/exports.c,v 1.1 2001/06/20 21:27:56 dmitch Exp $
30 * Revision 1.1 2001/06/20 21:27:56 dmitch
31 * Adding missing snacc compiler files.
33 * Revision 1.1.1.1 1999/03/16 18:06:48 aram
34 * Originals from SMIME Free Library.
36 * Revision 1.3 1995/07/25 19:41:27 rj
37 * changed `_' to `-' in file names.
39 * Revision 1.2 1994/09/01 00:33:28 rj
40 * snacc_config.h removed.
42 * Revision 1.1 1994/08/28 09:49:08 rj
43 * first check-in. for a list of changes to the snacc-1.1 distribution please refer to the ChangeLog.
50 #include "asn1module.h"
51 #include "snacc-util.h"
55 * called from main in snacc.c to set exported flags for
56 * typeDefs and valueDefs in the given module
59 SetExports
PARAMS ((m
, e
, exportsParsed
),
67 if (!exportsParsed
) /* export everything */
70 * set all typedefs', valuedefs' and macrodefs' exported flag
72 m
->exportStatus
= EXPORTS_ALL
;
73 FOR_EACH_LIST_ELMT (td
, m
->typeDefs
)
78 FOR_EACH_LIST_ELMT (vd
, m
->valueDefs
)
83 else /* EXPORTS sym parsed */
85 /* init every exports flag to false */
86 FOR_EACH_LIST_ELMT (td
, m
->typeDefs
)
90 FOR_EACH_LIST_ELMT (vd
, m
->valueDefs
)
95 if (e
== NULL
) /* export nothing */
97 m
->exportStatus
= EXPORTS_NOTHING
;
99 else /* just export types/values in export list */
101 m
->exportStatus
= EXPORTS_SOME
;
102 for (; e
!= NULL
; e
= e
->next
)
104 if ((td
= LookupType (m
->typeDefs
, e
->name
)) != NULL
)
107 else if ((vd
= LookupValue (m
->valueDefs
, e
->name
)) != NULL
)
111 PrintErrLoc (m
->asn1SrcFileName
, e
->lineNo
);
112 fprintf (stderr
, "ERROR - exporting undefined type/value \"%s\"\n", e
->name
);