From: Bruno Haible Date: Wed, 18 Oct 2006 11:24:22 +0000 (+0000) Subject: Reading PO files. X-Git-Tag: 0.16.x-branchpoint~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=412d2b4a7ba134358d037fee01d986b5c3be3f20;p=thirdparty%2Fgettext.git Reading PO files. --- diff --git a/gettext-tools/src/read-po.c b/gettext-tools/src/read-po.c new file mode 100644 index 000000000..61a73a2c4 --- /dev/null +++ b/gettext-tools/src/read-po.c @@ -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 +#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 index 000000000..0cbd4e9c6 --- /dev/null +++ b/gettext-tools/src/read-po.h @@ -0,0 +1,27 @@ +/* Reading PO files. + Copyright (C) 2006 Free Software Foundation, Inc. + Written by Bruno Haible , 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 */