2 ** Splint - annotation-assisted static program checker
3 ** Copyright (C) 1994-2002 University of Virginia,
4 ** Massachusetts Institute of Technology
6 ** This program is free software; you can redistribute it and/or modify it
7 ** under the terms of the GNU General Public License as published by the
8 ** Free Software Foundation; either version 2 of the License, or (at your
9 ** option) any later version.
11 ** This program is distributed in the hope that it will be useful, but
12 ** WITHOUT ANY WARRANTY; without even the implied warranty of
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 ** General Public License for more details.
16 ** The GNU General Public License is available from http://www.gnu.org/ or
17 ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18 ** MA 02111-1307, USA.
20 ** For information on splint: info@splint.org
21 ** To report a bug: splint-bug@splint.org
22 ** For more information: http://www.splint.org
28 # include "splintMacros.nf"
34 return (globSet_undefined);
38 globSet_clear (globSet g)
44 globSet_insert (/*@returned@*/ globSet s, /*@exposed@*/ sRef el)
46 if (sRef_isKnown (el) && !sRef_isConst (el) && !sRef_isType (el))
48 llassertprint (sRef_isFileOrGlobalScope (el) || sRef_isKindSpecial (el),
49 ("el: %s", sRef_unparse (el)));
51 return (sRefSet_insert (s, el));
60 globSet_single (/*@exposed@*/ sRef el)
62 globSet res = globSet_new ();
63 return globSet_insert (res, el);
67 globSet_markImmutable (globSet g)
69 sRefSet_markImmutable (g);
73 globSet_copyInto (/*@returned@*/ globSet s1, /*@exposed@*/ globSet s2)
75 return (sRefSet_copyInto (s1, s2));
79 globSet_newCopy (globSet s)
81 return (sRefSet_newCopy (s));
85 globSet_member (globSet s, sRef el)
87 return (sRefSet_member (s, el));
90 /*@exposed@*/ sRef globSet_lookup (globSet s, sRef el)
92 sRefSet_allElements (s, e)
94 if (sRef_similar (e, el))
98 } end_sRefSet_allElements;
100 return sRef_undefined;
104 globSet_hasStatic (globSet s)
106 sRefSet_allElements (s, el)
108 if (sRef_isFileStatic (el))
112 } end_sRefSet_allElements;
118 globSet_free (/*@only@*/ globSet s)
124 globSet_dump (globSet lset)
126 cstring st = cstring_undefined;
130 sRefSet_allElements (lset, el)
134 st = cstring_appendChar (st, ',');
141 st = cstring_concatFree (st, sRef_dumpGlobal (el));
142 } end_sRefSet_allElements;
148 globSet_undump (char **s)
151 sRefSet sl = sRefSet_new ();
153 while ((c = **s) != '#' && c != '@' && c != '$' && c != '&')
155 sl = sRefSet_insert (sl, sRef_undumpGlobal (s));
168 globSet_unparse (globSet ll)
170 return (sRefSet_unparseFull (ll));
171 /* return (sRefSet_unparsePlain (ll)); */
175 globSet_compare (globSet l1, globSet l2)
177 return (sRefSet_compare (l1, l2));