]> andersk Git - splint.git/blobdiff - src/cppmain.c
Fixed all /*@i...@*/ tags (except 1).
[splint.git] / src / cppmain.c
index 74c68ba24658b90243418cd3c145003f1e4c0e4c..61bca213413d65e034b683cb6220c42e0d34071f 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ** Splint - annotation-assisted static program checker
-** Copyright (C) 1994-2002 University of Virginia,
+** Copyright (C) 1994-2003 University of Virginia,
 **         Massachusetts Institute of Technology
 **
 ** This program is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  what you give them.   Help stamp out software-hoarding!  */
 
 # include "splintMacros.nf"
-# include "llbasic.h"
+# include "basic.h"
 # include "cpplib.h"
 # include "cpphash.h"
 # include "cpperror.h"
@@ -89,6 +89,12 @@ void cppReader_initMod ()
   /*@-compdef@*/ /* g_cppState is not yet innitialized */
 } /*@=compdef@*/
 
+void cppReader_destroyMod () 
+  /*@globals killed g_cppState@*/
+{
+  cppCleanup (&g_cppState);
+}
+
 void cppReader_initialize ()
 {
   cpplib_initializeReader (&g_cppState);
@@ -116,7 +122,7 @@ int cppProcess (/*@dependent@*/ cstring infile,
       llexit (LLFAILURE);
     }
 
-  ofile = fileTable_openFile (context_fileTable (), outfile, "w");
+  ofile = fileTable_createFile (context_fileTable (), outfile);
   
   if (ofile == NULL) 
     {
@@ -137,6 +143,8 @@ int cppProcess (/*@dependent@*/ cstring infile,
 
       if (!opts->no_output)
        {
+         DPRINTF (("Writing: %s", cstring_copyLength (g_cppState.token_buffer, cpplib_getWritten (&g_cppState))));
+
          (void) fwrite (g_cppState.token_buffer, (size_t) 1,
                         cpplib_getWritten (&g_cppState), ofile);
        }
@@ -174,6 +182,8 @@ void cppAddIncludeDir (cstring dir)
   ** Add the -I- code.  This code provided by Robin Watts <Robin.Watts@wss.co.uk>
   */
 
+  DPRINTF (("Adding include: %s", dir));
+
   if (cstring_equalLit (dir, "-I-"))
     {
       struct cppOptions *opts = CPPOPTIONS (&g_cppState);    
@@ -181,11 +191,10 @@ void cppAddIncludeDir (cstring dir)
     } 
   else 
     {
-      /* -I option (Add directory to include path) */
       struct file_name_list *dirtmp = (struct file_name_list *) dmalloc (sizeof (*dirtmp));
       
       DPRINTF (("Add include: %s", dir));
-      
+
       dirtmp->next = 0;                /* New one goes on the end */
       dirtmp->control_macro = 0;
       dirtmp->c_system_include_path = FALSE;
This page took 0.042129 seconds and 4 git commands to generate.