Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

globals.c

Go to the documentation of this file.
00001 /*
00002 ** LCLint - annotation-assisted static program checker
00003 ** Copyright (C) 1994-2000 University of Virginia,
00004 **         Massachusetts Institute of Technology
00005 **
00006 ** This program is free software; you can redistribute it and/or modify it
00007 ** under the terms of the GNU General Public License as published by the
00008 ** Free Software Foundation; either version 2 of the License, or (at your
00009 ** option) any later version.
00010 ** 
00011 ** This program is distributed in the hope that it will be useful, but
00012 ** WITHOUT ANY WARRANTY; without even the implied warranty of
00013 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 ** General Public License for more details.
00015 ** 
00016 ** The GNU General Public License is available from http://www.gnu.org/ or
00017 ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00018 ** MA 02111-1307, USA.
00019 **
00020 ** For information on lclint: lclint-request@cs.virginia.edu
00021 ** To report a bug: lclint-bug@cs.virginia.edu
00022 ** For more information: http://lclint.cs.virginia.edu
00023 */
00024 /*
00025 ** globals.c
00026 */
00027 
00028 # include "lclintMacros.nf"
00029 # include "basic.h"
00030 
00031 fileloc g_currentloc;
00032 
00033 # ifndef NOLCL
00034 symtable g_symtab;
00035 /*@only@*/ lsymbolSet g_currentImports = lsymbolSet_undefined;
00036 # endif
00037 
00038 cstring g_codeFile = cstring_undefined;
00039 int g_codeLine = 0;
00040 
00041 cstring g_prevCodeFile = cstring_undefined;
00042 int g_prevCodeLine = 0;
00043 FILE *g_msgstream;
00044 
00045 /*
00046 ** These were in llmain.c.  Most should not be globals...
00047 */
00048 
00049 /*@observer@*/ char *g_localSpecPath = ".";
00050 
00051 # ifndef NOLCL
00052 /*@only@*/ cstring g_currentSpec;
00053 /*@only@*/ char *g_currentSpecName;
00054 # endif
00055 
00056 void printCodePoint (void)
00057 {
00058   static bool incode = FALSE;
00059 
00060   if (incode) {
00061     fprintf (stderr, "[[[ in code! ]]]\n");
00062   }
00063 
00064   incode = TRUE;
00065 
00066   if (cstring_isDefined (g_codeFile))
00067     {
00068       cstring temps = fileloc_unparseRaw (g_codeFile, g_codeLine);
00069 
00070       fprintf (stderr, "*** Last code point: %s\n", 
00071                cstring_toCharsSafe (temps));
00072 
00073       cstring_free (temps);
00074 
00075       if (cstring_isDefined (g_prevCodeFile))
00076         {
00077           temps = fileloc_unparseRaw (g_prevCodeFile, g_prevCodeLine);
00078           fprintf (stderr, "*** Previous code point: %s\n", 
00079                    cstring_toCharsSafe (temps));
00080 
00081           cstring_free (temps);
00082         }
00083     }
00084 
00085   incode = FALSE;
00086 }
00087 
00088 # ifdef WIN32
00089 int yywrap (void)
00090 {
00091   return 1;
00092 }
00093 # endif
00094 
00095 
00096 

Generated at Fri Nov 3 18:57:41 2000 for LCLint by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000