pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp/src ChangeLog error.c getl.c


From: John Darrington
Subject: [Pspp-cvs] pspp/src ChangeLog error.c getl.c
Date: Fri, 23 Dec 2005 13:02:55 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Branch:         
Changes by:     John Darrington <address@hidden>        05/12/23 13:02:55

Modified files:
        src            : ChangeLog error.c getl.c 

Log message:
        Seperated file_loc from error.c

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/ChangeLog.diff?tr1=1.255&tr2=1.256&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/error.c.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/getl.c.diff?tr1=1.3&tr2=1.4&r1=text&r2=text

Patches:
Index: pspp/src/ChangeLog
diff -u pspp/src/ChangeLog:1.255 pspp/src/ChangeLog:1.256
--- pspp/src/ChangeLog:1.255    Mon Dec 19 06:42:32 2005
+++ pspp/src/ChangeLog  Fri Dec 23 13:02:55 2005
@@ -1,3 +1,7 @@
+Fri Dec 23 20:59:01 WST 2005 John Darrington <address@hidden>
+
+       * getl.c error.c: Separated file_loc functionality from error.c
+
 Mon Dec 19 14:01:56 WST 2005 John Darrington <address@hidden>
 
        * format.c: Additional error checking.
Index: pspp/src/error.c
diff -u pspp/src/error.c:1.20 pspp/src/error.c:1.21
--- pspp/src/error.c:1.20       Mon Dec 19 06:42:32 2005
+++ pspp/src/error.c    Fri Dec 23 13:02:55 2005
@@ -47,9 +47,6 @@
 
 int err_verbosity;
 
-/* File locator stack. */
-static const struct file_locator **file_loc;
-static int nfile_loc, mfile_loc;
 
 /* Fairly common public functions. */
 
@@ -114,46 +111,6 @@
     }
 }
 
-/* File locator stack functions. */
-
-/* Pushes F onto the stack of file locations. */
-void
-err_push_file_locator (const struct file_locator *f)
-{
-  if (nfile_loc >= mfile_loc)
-    {
-      if (mfile_loc == 0)
-       mfile_loc = 8;
-      else
-       mfile_loc *= 2;
-
-      file_loc = xnrealloc (file_loc, mfile_loc, sizeof *file_loc);
-    }
-
-  file_loc[nfile_loc++] = f;
-}
-
-/* Pops F off the stack of file locations.
-   Argument F is only used for verification that that is actually the
-   item on top of the stack. */
-void
-err_pop_file_locator (const struct file_locator *f)
-{
-  assert (nfile_loc >= 0 && file_loc[nfile_loc - 1] == f);
-  nfile_loc--;
-}
-
-/* Puts the current file and line number in F, or NULL and -1 if
-   none. */
-void
-err_location (struct file_locator *f)
-{
-  if (nfile_loc)
-    *f = *file_loc[nfile_loc - 1];
-  else
-    getl_location (&f->filename, &f->line_number);
-}
-
 /* Obscure public functions. */
 
 /* Writes a blank line to the error device(s).
@@ -204,10 +161,6 @@
   lex_done();
   getl_uninitialize ();
   readln_uninitialize();
-
-  free(file_loc);
-  file_loc = NULL;
-  nfile_loc = mfile_loc = 0;
 }
 
 void
Index: pspp/src/getl.c
diff -u pspp/src/getl.c:1.3 pspp/src/getl.c:1.4
--- pspp/src/getl.c:1.3 Mon Dec 19 06:42:32 2005
+++ pspp/src/getl.c     Fri Dec 23 13:02:55 2005
@@ -57,14 +57,6 @@
   ds_init (&getl_buf, 256);
 }
 
-/* Close getl. */
-void
-getl_uninitialize (void)
-{
-  getl_close_all();
-  ds_destroy (&getl_buf);
-  ds_destroy (&getl_include_path);
-}
 
 
 struct getl_script *getl_head;
@@ -333,3 +325,61 @@
   return (getl_head != NULL);
 }
 
+/* File locator stack. */
+static const struct file_locator **file_loc;
+static int nfile_loc, mfile_loc;
+
+/* Close getl. */
+void
+getl_uninitialize (void)
+{
+  getl_close_all();
+  ds_destroy (&getl_buf);
+  ds_destroy (&getl_include_path);
+  free(file_loc);
+  file_loc = NULL;
+  nfile_loc = mfile_loc = 0;
+}
+
+
+/* File locator stack functions. */
+
+/* Pushes F onto the stack of file locations. */
+void
+err_push_file_locator (const struct file_locator *f)
+{
+  if (nfile_loc >= mfile_loc)
+    {
+      if (mfile_loc == 0)
+       mfile_loc = 8;
+      else
+       mfile_loc *= 2;
+
+      file_loc = xnrealloc (file_loc, mfile_loc, sizeof *file_loc);
+    }
+
+  file_loc[nfile_loc++] = f;
+}
+
+/* Pops F off the stack of file locations.
+   Argument F is only used for verification that that is actually the
+   item on top of the stack. */
+void
+err_pop_file_locator (const struct file_locator *f)
+{
+  assert (nfile_loc >= 0 && file_loc[nfile_loc - 1] == f);
+  nfile_loc--;
+}
+
+/* Puts the current file and line number in F, or NULL and -1 if
+   none. */
+void
+err_location (struct file_locator *f)
+{
+  if (nfile_loc)
+    *f = *file_loc[nfile_loc - 1];
+  else
+    getl_location (&f->filename, &f->line_number);
+}
+
+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]