]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Reading PO files.
authorBruno Haible <bruno@clisp.org>
Wed, 18 Oct 2006 11:24:22 +0000 (11:24 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:14:09 +0000 (12:14 +0200)
gettext-tools/src/read-po.c [new file with mode: 0644]
gettext-tools/src/read-po.h [new file with mode: 0644]

diff --git a/gettext-tools/src/read-po.c b/gettext-tools/src/read-po.c
new file mode 100644 (file)
index 0000000..61a73a2
--- /dev/null
@@ -0,0 +1,43 @@
+/* Reading PO files.
+   Copyright (C) 1995-1996, 1998, 2000-2006 Free Software Foundation, Inc.
+
+   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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification.  */
+#include "read-po.h"
+
+#include "po-lex.h"
+#include "po-gram.h"
+
+/* Read a .po / .pot file from a stream, and dispatch to the various
+   abstract_catalog_reader_class_ty methods.  */
+static void
+po_parse (abstract_catalog_reader_ty *this, FILE *fp,
+         const char *real_filename, const char *logical_filename)
+{
+  lex_start (fp, real_filename, logical_filename);
+  po_gram_parse ();
+  lex_end ();
+}
+
+const struct catalog_input_format input_format_po =
+{
+  po_parse,                            /* parse */
+  false                                        /* produces_utf8 */
+};
diff --git a/gettext-tools/src/read-po.h b/gettext-tools/src/read-po.h
new file mode 100644 (file)
index 0000000..0cbd4e9
--- /dev/null
@@ -0,0 +1,27 @@
+/* Reading PO files.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+   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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _READ_PO_H
+#define _READ_PO_H
+
+#include "read-catalog-abstract.h"
+
+/* Describes a .po / .pot file parser.  */
+extern const struct catalog_input_format input_format_po;
+
+#endif /* _READ_PO_H */