]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
libgettextpo: Remove static variable 'directory'.
authorBruno Haible <bruno@clisp.org>
Sat, 11 Nov 2023 15:48:00 +0000 (16:48 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 11 Nov 2023 15:48:00 +0000 (16:48 +0100)
* gettext-tools/src/read-catalog-file.h: New file, extracted from
gettext-tools/src/read-catalog.h.
* gettext-tools/src/read-catalog.h (read_catalog_file): Remove declaration.
* gettext-tools/src/read-catalog-file.c: New file, extracted from
gettext-tools/src/read-catalog.c.
* gettext-tools/src/read-catalog.c: Don't include open-catalog.h.
(read_catalog_file): Remove function.
* gettext-tools/src/msgl-cat.c: Include read-catalog-file.h instead of
read-catalog.h.
* gettext-tools/src/msgattrib.c: Likewise.
* gettext-tools/src/msgcmp.c: Likewise.
* gettext-tools/src/msgconv.c: Likewise.
* gettext-tools/src/msgen.c: Likewise.
* gettext-tools/src/msgexec.c: Likewise.
* gettext-tools/src/msgfilter.c: Likewise.
* gettext-tools/src/msgfmt.c: Likewise.
* gettext-tools/src/msggrep.c: Likewise.
* gettext-tools/src/msginit.c: Likewise.
* gettext-tools/src/msgmerge.c: Likewise.
* gettext-tools/src/FILES: Mention read-catalog-file.h, read-catalog-file.c.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add read-catalog-file.h.
(libgettextsrc_la_SOURCES): Add read-catalog-file.c.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Remove
dir-list.c, open-catalog.c.

18 files changed:
gettext-tools/libgettextpo/Makefile.am
gettext-tools/src/FILES
gettext-tools/src/Makefile.am
gettext-tools/src/msgattrib.c
gettext-tools/src/msgcmp.c
gettext-tools/src/msgconv.c
gettext-tools/src/msgen.c
gettext-tools/src/msgexec.c
gettext-tools/src/msgfilter.c
gettext-tools/src/msgfmt.c
gettext-tools/src/msggrep.c
gettext-tools/src/msginit.c
gettext-tools/src/msgl-cat.c
gettext-tools/src/msgmerge.c
gettext-tools/src/read-catalog-file.c [new file with mode: 0644]
gettext-tools/src/read-catalog-file.h [new file with mode: 0644]
gettext-tools/src/read-catalog.c
gettext-tools/src/read-catalog.h

index 0fe0995d0dac49dfa65dfc0f228897c5bccc6fac..090efbd761850b14de923f954b837b825966ca38 100644 (file)
@@ -54,7 +54,6 @@ libgettextpo_la_SOURCES = \
 # These are auxiliary sources whose symbols should not be exported.
 libgettextpo_la_AUXSOURCES = \
   ../src/str-list.c \
-  ../src/dir-list.c \
   ../src/message.c \
   ../src/pos.c \
   ../src/msgl-ascii.c \
@@ -62,7 +61,6 @@ libgettextpo_la_AUXSOURCES = \
   ../src/po-xerror.c \
   ../src/write-catalog.c \
   ../src/write-po.c \
-  ../src/open-catalog.c \
   ../src/po-charset.c \
   ../src/po-lex.c \
   ../src/po-gram-gen.c \
index 68ba0127ac79c59781be6f5d6e9a2537a92624ab..ff1fa3dd159049881be5dcff0e0dec623670a736 100644 (file)
@@ -110,6 +110,8 @@ po-xerror.c
 |
 | read-catalog.h
 | read-catalog.c
+| read-catalog-file.h
+| read-catalog-file.c
 |               Reading of a PO file, returning a list-of-messages.
 |
 | read-desktop.h
index dcf98880ef16509c363559f719a7cd841f5f665d..4f60cc40c1b34fd915dabbdff2ce613dc37dbfce 100644 (file)
@@ -38,7 +38,7 @@ lib_LTLIBRARIES = libgettextsrc.la
 noinst_HEADERS = \
   pos.h message.h po-error.h po-xerror.h po-gram.h po-charset.h \
   po-lex.h open-catalog.h read-catalog-abstract.h read-catalog.h \
-  read-po.h read-properties.h read-stringtable.h \
+  read-catalog-file.h read-po.h read-properties.h read-stringtable.h \
   str-list.h \
   write-catalog.h write-po.h write-properties.h write-stringtable.h \
   dir-list.h file-list.h po-gram-gen.h po-gram-gen2.h cldr-plural.h \
@@ -131,9 +131,9 @@ CSHARPCOMPFLAGS = @CSHARPCOMPFLAGS@
 # read-csharp.c and read-resources.c.)
 # message.c -> str-list.c.
 # (read-catalog-abstract.c <--> po-gram-gen.y <--> po-lex.c) -> str-list.c.
-# (read-catalog-abstract.c <--> po-gram-gen.y <--> po-lex.c) -> open-catalog.c -> dir-list.c -> str-list.c.
 # (read-catalog-abstract.c <--> po-gram-gen.y <--> po-lex.c) -> po-charset.c.
 # (read-catalog-abstract.c <--> po-gram-gen.y <--> po-lex.c) -> message.c -> str-list.c.
+# read-catalog-file.c -> open-catalog.c -> dir-list.c -> str-list.c.
 COMMON_SOURCE = message.c pos.c po-error.c po-xerror.c \
 read-catalog-abstract.c po-lex.c po-gram-gen.y po-charset.c \
 read-po.c read-properties.c read-stringtable.c open-catalog.c \
@@ -180,7 +180,7 @@ FORMAT_SOURCE += \
 # libgettextsrc contains all code that is needed by at least two programs.
 libgettextsrc_la_SOURCES = \
   $(COMMON_SOURCE) \
-  read-catalog.c \
+  read-catalog.c read-catalog-file.c \
   write-catalog.c write-properties.c write-stringtable.c write-po.c \
   msgl-ascii.c \
   msgl-ofn.c \
index b79c440b8453c777a109a9f8da1e0a9772b031f6..051afb1420b9b4ea2a945f950783fb66b8c4e129 100644 (file)
@@ -37,7 +37,7 @@
 #include "relocatable.h"
 #include "basename-lgpl.h"
 #include "message.h"
-#include "read-catalog.h"
+#include "read-catalog-file.h"
 #include "read-po.h"
 #include "read-properties.h"
 #include "read-stringtable.h"
index e1ab1f2d60a394279d3e1c5aafe6dcb922b7c545..17f6e4700755bb3b048f61c78604aaf9de4c1af4 100644 (file)
@@ -35,7 +35,7 @@
 #include "relocatable.h"
 #include "basename-lgpl.h"
 #include "message.h"
-#include "read-catalog.h"
+#include "read-catalog-file.h"
 #include "read-po.h"
 #include "read-properties.h"
 #include "read-stringtable.h"
index b0842c240825214c2eeb95350cf8e4e28f18c592..e51312511d613c2e518b2ee9b24acb1efb80bfd0 100644 (file)
@@ -37,7 +37,7 @@
 #include "relocatable.h"
 #include "basename-lgpl.h"
 #include "message.h"
-#include "read-catalog.h"
+#include "read-catalog-file.h"
 #include "read-po.h"
 #include "read-properties.h"
 #include "read-stringtable.h"
index a9591cfb7623829ec5fca3836b84429da17517b7..31d34ca16f533940f1c4e5029852eb4c0824f336 100644 (file)
@@ -37,7 +37,7 @@
 #include "relocatable.h"
 #include "basename-lgpl.h"
 #include "message.h"
-#include "read-catalog.h"
+#include "read-catalog-file.h"
 #include "read-po.h"
 #include "read-properties.h"
 #include "read-stringtable.h"
index 61dd1f1174b3083a6bbaa587e3e471f8a571f57f..070224b81f94860dc0c814e401a735ed8ff7e10a 100644 (file)
@@ -41,7 +41,7 @@
 #include "relocatable.h"
 #include "basename-lgpl.h"
 #include "message.h"
-#include "read-catalog.h"
+#include "read-catalog-file.h"
 #include "read-po.h"
 #include "read-properties.h"
 #include "read-stringtable.h"
index c2bb9d369590132a08fd7b477d37100bbdbfeb5f..5fb66f123c2e72972067f3d8b8a12adc27b005c8 100644 (file)
@@ -42,7 +42,7 @@
 #include "relocatable.h"
 #include "basename-lgpl.h"
 #include "message.h"
-#include "read-catalog.h"
+#include "read-catalog-file.h"
 #include "read-po.h"
 #include "read-properties.h"
 #include "read-stringtable.h"
index e14c9620940d715c6aaa047082b0a9e39e8c39af..c84536cbf20cf280b14f729b5f51a5995716b5bc 100644 (file)
@@ -54,7 +54,7 @@
 #include "propername.h"
 #include "message.h"
 #include "open-catalog.h"
-#include "read-catalog.h"
+#include "read-catalog-file.h"
 #include "read-po.h"
 #include "read-properties.h"
 #include "read-stringtable.h"
index 9200c75cab18d59703ab4e7b4e4b2de4b4345513..8a875b765a2dcdedfb387b28800c99bd5e4f0d58 100644 (file)
@@ -48,7 +48,7 @@
 #include "relocatable.h"
 #include "basename-lgpl.h"
 #include "message.h"
-#include "read-catalog.h"
+#include "read-catalog-file.h"
 #include "read-po.h"
 #include "read-properties.h"
 #include "read-stringtable.h"
index 8ef758a8271868e39e57dbced9c7316ef1e94d27..c3856030051185c7f688d20724896a48428d7a34 100644 (file)
@@ -64,7 +64,7 @@
 #include "c-strstr.h"
 #include "c-strcase.h"
 #include "message.h"
-#include "read-catalog.h"
+#include "read-catalog-file.h"
 #include "read-po.h"
 #include "read-properties.h"
 #include "read-stringtable.h"
index 54bb92f334a9c9547dad8900a2def7669fdb12ed..a7c7592a9e7d381143e5ea58d54ba7198c1e1616 100644 (file)
@@ -34,7 +34,7 @@
 #include "xerror.h"
 #include "xvasprintf.h"
 #include "message.h"
-#include "read-catalog.h"
+#include "read-catalog-file.h"
 #include "po-charset.h"
 #include "msgl-ascii.h"
 #include "msgl-ofn.h"
index c3e614289579a701401b50c0e9c20b25f82eb48c..397fd675f5794413d45bbf463aa6c5554f913a41 100644 (file)
@@ -42,7 +42,7 @@
 #include "relocatable.h"
 #include "basename-lgpl.h"
 #include "message.h"
-#include "read-catalog.h"
+#include "read-catalog-file.h"
 #include "read-po.h"
 #include "read-properties.h"
 #include "read-stringtable.h"
diff --git a/gettext-tools/src/read-catalog-file.c b/gettext-tools/src/read-catalog-file.c
new file mode 100644 (file)
index 0000000..759fb7a
--- /dev/null
@@ -0,0 +1,41 @@
+/* Reading PO files.
+   Copyright (C) 1995-2023 Free Software Foundation, Inc.
+   This file was written by Peter Miller <millerp@canb.auug.org.au>
+
+   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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification.  */
+#include "read-catalog-file.h"
+
+#include "open-catalog.h"
+
+
+msgdomain_list_ty *
+read_catalog_file (const char *filename, catalog_input_format_ty input_syntax)
+{
+  char *real_filename;
+  FILE *fp = open_catalog_file (filename, &real_filename, true);
+  msgdomain_list_ty *result;
+
+  result = read_catalog_stream (fp, real_filename, filename, input_syntax);
+
+  if (fp != stdin)
+    fclose (fp);
+
+  return result;
+}
diff --git a/gettext-tools/src/read-catalog-file.h b/gettext-tools/src/read-catalog-file.h
new file mode 100644 (file)
index 0000000..fc057bf
--- /dev/null
@@ -0,0 +1,43 @@
+/* Reading PO files.
+   Copyright (C) 1995-2023 Free Software Foundation, Inc.
+   This file was written by Bruno Haible <haible@clisp.cons.org>.
+
+   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 3 of the License, 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, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _READ_CATALOG_FILE_H
+#define _READ_CATALOG_FILE_H
+
+#include "read-catalog.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Read the input file with the name INPUT_NAME.  The ending .po is added
+   if necessary.  If INPUT_NAME is not an absolute file name and the file is
+   not found, the list of directories in "dir-list.h" is searched.  Returns
+   a list of messages.  */
+extern msgdomain_list_ty *
+       read_catalog_file (const char *input_name,
+                          catalog_input_format_ty input_syntax);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _READ_CATALOG_FILE_H */
index 2dd3bd66ac1fb1705f394d0ecd272b6c998456e6..3ae2d702cfe6207aabad18035fdada5880bc9bf9 100644 (file)
@@ -26,7 +26,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "open-catalog.h"
 #include "po-charset.h"
 #include "po-xerror.h"
 #include "xalloc.h"
@@ -484,19 +483,3 @@ read_catalog_stream (FILE *fp, const char *real_filename,
   catalog_reader_free ((abstract_catalog_reader_ty *) pop);
   return mdlp;
 }
-
-
-msgdomain_list_ty *
-read_catalog_file (const char *filename, catalog_input_format_ty input_syntax)
-{
-  char *real_filename;
-  FILE *fp = open_catalog_file (filename, &real_filename, true);
-  msgdomain_list_ty *result;
-
-  result = read_catalog_stream (fp, real_filename, filename, input_syntax);
-
-  if (fp != stdin)
-    fclose (fp);
-
-  return result;
-}
index b928137ddec416142981f245a5c3e4077ada65d5..238524f0da306a92f1ccac59aba3fc395aed7805 100644 (file)
@@ -1,6 +1,5 @@
 /* Reading PO files.
-   Copyright (C) 1995-1998, 2000-2003, 2005-2006, 2008-2009, 2014-2015 Free
-   Software Foundation, Inc.
+   Copyright (C) 1995-2023 Free Software Foundation, Inc.
    This file was written by Bruno Haible <haible@clisp.cons.org>.
 
    This program is free software: you can redistribute it and/or modify
@@ -177,14 +176,6 @@ extern msgdomain_list_ty *
                             const char *logical_filename,
                             catalog_input_format_ty input_syntax);
 
-/* Read the input file with the name INPUT_NAME.  The ending .po is added
-   if necessary.  If INPUT_NAME is not an absolute file name and the file is
-   not found, the list of directories in "dir-list.h" is searched.  Returns
-   a list of messages.  */
-extern msgdomain_list_ty *
-       read_catalog_file (const char *input_name,
-                          catalog_input_format_ty input_syntax);
-
 
 #ifdef __cplusplus
 }