Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / src / read-po.c
1 /* Reading PO files.
2    Copyright (C) 1995-1996, 1998, 2000-2006, 2015 Free Software
3    Foundation, Inc.
4
5    This program is free software: you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 3 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
17
18 #ifdef HAVE_CONFIG_H
19 # include <config.h>
20 #endif
21
22 /* Specification.  */
23 #include "read-po.h"
24
25 #include "po-lex.h"
26 #include "po-gram.h"
27
28 /* For compiling this file in C++ mode.  */
29 #ifdef __cplusplus
30 # define this thiss
31 #endif
32
33
34 /* Read a .po / .pot file from a stream, and dispatch to the various
35    abstract_catalog_reader_class_ty methods.  */
36 static void
37 po_parse (abstract_catalog_reader_ty *this, FILE *fp,
38           const char *real_filename, const char *logical_filename)
39 {
40   lex_start (fp, real_filename, logical_filename);
41   po_gram_parse ();
42   lex_end ();
43 }
44
45 const struct catalog_input_format input_format_po =
46 {
47   po_parse,                             /* parse */
48   false                                 /* produces_utf8 */
49 };