]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Compile classpath.c once, instead of #including it twice.
authorBruno Haible <bruno@clisp.org>
Tue, 14 Jan 2003 13:36:58 +0000 (13:36 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:08:56 +0000 (12:08 +0200)
lib/ChangeLog
lib/Makefile.am
lib/classpath.c
lib/classpath.h [new file with mode: 0644]
lib/javacomp.c
lib/javaexec.c

index 84bbb4f1c41fb0856797ae35394ca81ee16928c9..0baf3c0d3b81504c1dafc22b8b08bb2a0f829da9 100644 (file)
@@ -1,3 +1,13 @@
+2003-01-12  Bruno Haible  <bruno@clisp.org>
+
+       * classpath.h: New file.
+       * classpath.c: Turn into an independent source file.
+       (new_classpath, set_classpath, reset_classpath): Make non-static.
+       * javacomp.c: Include classpath.h instead of classpath.c.
+       * javaexec.c: Likewise.
+       * Makefile.am (libgettextlib_la_SOURCES): Add classpath.h, classpath.c.
+       (EXTRA_DIST): Remove classpath.c.
+
 2003-01-12  Bruno Haible  <bruno@clisp.org>
 
        * localcharset.h: New file.
index c300e0e389ff2ffb553328f27ae98c05f4bd7b3c..b1e9ab4452b46a25c7099ee7461afda83f501666 100644 (file)
@@ -36,6 +36,7 @@ libgettextlib_la_SOURCES = \
   basename.h basename.c \
   binary-io.h \
   c-ctype.h c-ctype.c \
+  classpath.h classpath.c \
   copy-file.h copy-file.c \
   error.h error.c \
   execute.h execute.c \
@@ -115,7 +116,7 @@ gettextsrc_DATA = gettext.h
 
 noinst_HEADERS = gettext.h
 
-EXTRA_DIST += classpath.c \
+EXTRA_DIST += \
 $(LIBADD_SOURCE) $(UNUSED_SOURCE) \
 gen-lbrkprop.c 3level.h Combining.txt
 
index a58924f2956f361821bd2add1bc9242c2c1fbb2b..ae88a3d67dcd299788e0f9a123d99d6b9ef09d5b 100644 (file)
@@ -1,5 +1,5 @@
 /* Java CLASSPATH handling.
-   Copyright (C) 2001-2002 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
    along with this program; if not, write to the Free Software Foundation,
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification.  */
+#include "classpath.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "xsetenv.h"
+#include "xmalloc.h"
 
 /* Separator in PATH like lists of pathnames.  */
 #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
 # define PATH_SEPARATOR ':' 
 #endif
 
-
 /* Return the new CLASSPATH value.  The given classpaths are prepended to
    the current CLASSPATH value.   If use_minimal_classpath, the current
    CLASSPATH is ignored.  */
-static char *
+char *
 new_classpath (const char * const *classpaths, unsigned int classpaths_count,
               bool use_minimal_classpath)
 {
@@ -75,7 +87,7 @@ new_classpath (const char * const *classpaths, unsigned int classpaths_count,
 }
 
 /* Set CLASSPATH and returns a safe copy of its old value.  */
-static char *
+char *
 set_classpath (const char * const *classpaths, unsigned int classpaths_count,
               bool use_minimal_classpath, bool verbose)
 {
@@ -95,7 +107,7 @@ set_classpath (const char * const *classpaths, unsigned int classpaths_count,
 }
 
 /* Restore CLASSPATH to its previous value.  */
-static void
+void
 reset_classpath (char *old_classpath)
 {
   if (old_classpath != NULL)
diff --git a/lib/classpath.h b/lib/classpath.h
new file mode 100644 (file)
index 0000000..cce847f
--- /dev/null
@@ -0,0 +1,34 @@
+/* Java CLASSPATH handling.
+   Copyright (C) 2003 Free Software Foundation, Inc.
+   Written by Bruno Haible <haible@clisp.cons.org>, 2003.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#include <stdbool.h>
+
+/* Return the new CLASSPATH value.  The given classpaths are prepended to
+   the current CLASSPATH value.   If use_minimal_classpath, the current
+   CLASSPATH is ignored.  */
+extern char * new_classpath (const char * const *classpaths,
+                            unsigned int classpaths_count,
+                            bool use_minimal_classpath);
+
+/* Set CLASSPATH and returns a safe copy of its old value.  */
+extern char * set_classpath (const char * const *classpaths,
+                            unsigned int classpaths_count,
+                            bool use_minimal_classpath, bool verbose);
+
+/* Restore CLASSPATH to its previous value.  */
+extern void reset_classpath (char *old_classpath);
index 06a2c3a0a90e33807ff4d39140dce6ad9283075b..03c9fe11bc9d0327d7c076f7bc088d0df6e0a7ab 100644 (file)
@@ -31,6 +31,7 @@
 #include "execute.h"
 #include "pipe.h"
 #include "wait-process.h"
+#include "classpath.h"
 #include "xsetenv.h"
 #include "sh-quote.h"
 #include "safe-read.h"
@@ -41,9 +42,6 @@
 #define _(str) gettext (str)
 
 
-/* CLASSPATH handling subroutines.  */
-#include "classpath.c"
-
 /* Survey of Java compilers.
 
    A = does it work without CLASSPATH being set
index 8193a07eb4e739b3b8fab266f734fba84c50fa61..fcfe596fecf6762533b61b53a8b4f3e043b5027b 100644 (file)
@@ -29,6 +29,7 @@
 #include <string.h>
 
 #include "execute.h"
+#include "classpath.h"
 #include "xsetenv.h"
 #include "sh-quote.h"
 #include "pathname.h"
@@ -39,9 +40,6 @@
 #define _(str) gettext (str)
 
 
-/* CLASSPATH handling subroutines.  */
-#include "classpath.c"
-
 /* Survey of Java virtual machines.
 
    A = does it work without CLASSPATH being set