2006-10-15 Bruno Haible <bruno@clisp.org>
+ * read-catalog-abstract.h (abstract_catalog_reader_ty): Renamed from
+ abstract_po_reader_ty.
+ (abstract_catalog_reader_class_ty): Renamed from
+ abstract_po_reader_class_ty. Update.
+ (ABSTRACT_CATALOG_READER_TY): Renamed from ABSTRACT_PO_READER_TY.
+ Update.
+ (abstract_catalog_reader_ty): Renamed from abstract_po_reader_ty.
+ Update.
+ (catalog_reader_alloc): Renamed from po_reader_alloc.
+ (catalog_reader_parse): Renamed from po_scan.
+ (catalog_reader_free): Renamed from po_reader_free.
+ * read-catalog.h: Update.
+ (default_catalog_reader_class_ty): Renamed from
+ default_po_reader_class_ty.
+ (DEFAULT_CATALOG_READER_TY): Renamed from DEFAULT_PO_READER_TY. Update.
+ (default_catalog_reader_ty): Renamed from default_po_reader_ty. Update.
+ (default_constructor, default_destructor, default_parse_brief,
+ default_parse_debrief, default_directive_domain,
+ default_directive_message, default_comment, default_comment_dot,
+ default_comment_filepos, default_comment_special, default_set_domain,
+ default_add_message): Update.
+ (default_catalog_reader_alloc): Renamed from default_po_reader_alloc.
+ Update.
+ (read_catalog_stream): Renamed from read_po.
+ (read_catalog_file): Renamed from read_po_file.
+ * open-catalog.h (open_catalog_file): Renamed from open_po_file.
+ * msgattrib.c: Update.
+ (main): Update.
+ * msgcat.c: Update.
+ * msgcmp.c: Update.
+ (compare): Update.
+ * msgcomm.c: Update.
+ * msgconv.c: Update.
+ (main): Update.
+ * msgen.c: Update.
+ (main): Update.
+ * msgexec.c: Update.
+ (main): Update.
+ * msgfilter.c: Update.
+ (main): Update.
+ * msgfmt.c: Update.
+ (read_catalog_file_msgfmt): Renamed from read_po_file_msgfmt. Update.
+ (main): Update.
+ (msgfmt_catalog_reader_ty): Renamed from msgfmt_po_reader_ty. Update.
+ (msgfmt_constructor, msgfmt_parse_debrief, msgfmt_set_domain,
+ msgfmt_add_message, msgfmt_frob_new_message, msgfmt_comment_special,
+ msgfmt_methods): Update.
+ (read_catalog_file_msgfmt): Renamed from read_po_file_msgfmt. Update.
+ * msggrep.c: Update.
+ (main): Update.
+ * msginit.c: Update.
+ (main): Update.
+ * msgl-cat.c: Update.
+ (catenate_msgdomain_list): Update.
+ * msgmerge.c: Update.
+ (compendium, merge): Update.
+ * msguniq.c: Update.
+ * open-catalog.c: Update.
+ (try_open_catalog_file): Renamed from try_open_po_file.
+ (open_catalog_file): Renamed from open_po_file. Update.
+ * po-gram-gen.y: Update.
+ * read-catalog-abstract.c: Update.
+ (callback_arg): Update.
+ (catalog_reader_alloc): Renamed from po_reader_alloc.
+ (catalog_reader_free): Renamed from po_reader_free.
+ (call_parse_brief, call_parse_debrief, call_directive_domain,
+ call_directive_message, call_comment, call_comment_dot,
+ call_comment_filepos, call_comment_special): Update.
+ (parse_start): Renamed from po_scan_start.
+ (parse_end): Renamed from po_scan_end.
+ (catalog_reader_parse): Renamed from po_scan.
+ * read-catalog.c: Update.
+ (call_set_domain, call_add_message, call_frob_new_message): Update.
+ (default_constructor, default_destructor, default_parse_brief,
+ default_parse_debrief, default_copy_comment_state,
+ default_reset_comment_state, default_directive_domain,
+ default_directive_message, default_comment, default_comment_dot,
+ default_comment_filepos, default_comment_special, default_set_domain,
+ default_add_message, default_methods): Update.
+ (default_catalog_reader_alloc): Renamed from default_po_reader_alloc.
+ (read_catalog_stream): Renamed from read_po. Update.
+ (read_catalog_file): Renamed from read_po_file. Update.
+ * read-csharp.c: Update.
+ (execute_and_read_po_output): Update.
+ * read-java.c: Update.
+ (execute_and_read_po_output): Update.
+ * read-properties.c: Update.
+ (properties_parse): Update.
+ * read-properties.h: Update.
+ (properties_parse): Update.
+ * read-resources.c: Update.
+ (execute_and_read_po_output): Update.
+ * read-stringtable.c: Update.
+ (stringtable_parse): Update.
+ * read-stringtable.h: Update.
+ (stringtable_parse): Update.
+ * read-tcl.c: Update.
+ (msgdomain_read_tcl): Update.
+ * x-po.c: Update.
+ (extract_add_message, extract_methods, extract): Update.
+ * xgettext.c: Update.
+ (exclude_directive_domain, exclude_directive_message, exclude_methods,
+ read_exclusion_file): Update.
+ * xgettext.h: Update.
+ * gettext-po.c: Update.
+ (po_file_read_v3, po_file_read_v2, po_file_read): Update.
+
* read-catalog-abstract.h: Renamed from read-po-abstract.h.
* read-catalog-abstract.c: Renamed from read-po-abstract.c.
* read-catalog.h: Renamed from read-po.h.
+-------------- Writing PO files
+-------------- Reading PO files
-| open-po.h
-| open-po.c
+| open-catalog.h
+| open-catalog.c
| Opening PO files for reading.
|
| po-charset.h
| po-lex.c
| Lexical analysis of PO files.
|
-| read-po-abstract.h
+| read-catalog-abstract.h
| po-gram.h
| po-gram-gen.y
| read-properties.h
| read-properties.c
| read-stringtable.h
| read-stringtable.c
-| read-po-abstract.c
+| read-catalog-abstract.c
| Parsing of PO files and Java .properties and NeXTstep/GNUstep
| .strings files.
-| read-po-abstract.h
+| read-catalog-abstract.h
| General parser structure.
| po-gram.h
| po-gram-gen.y
| read-stringtable.h
| read-stringtable.c
| Parsing of NeXTstep/GNUstep .strings files.
-| read-po-abstract.c
+| read-catalog-abstract.c
| Top-level parser functions and callbacks.
|
-| read-po.h
-| read-po.c
+| read-catalog.h
+| read-catalog.c
| Reading of a PO file, returning a list-of-messages.
|
+-------------- Reading PO files
#include "message.h"
#include "xalloc.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "write-catalog.h"
#include "write-po.h"
#include "error.h"
return NULL;
}
- /* Establish error handler around read_po(). */
+ /* Establish error handler around read_catalog_stream(). */
po_xerror =
(void (*) (int, const message_ty *, const char *, size_t, size_t, int, const char *))
handler->xerror;
file = (struct po_file *) xmalloc (sizeof (struct po_file));
file->real_filename = filename;
file->logical_filename = filename;
- file->mdlp = read_po (fp, file->real_filename, file->logical_filename);
+ file->mdlp =
+ read_catalog_stream (fp, file->real_filename, file->logical_filename);
file->domains = NULL;
/* Restore error handler. */
return NULL;
}
- /* Establish error handler around read_po(). */
+ /* Establish error handler around read_catalog_stream(). */
po_error = handler->error;
po_error_at_line = handler->error_at_line;
po_multiline_warning = handler->multiline_warning;
file = (struct po_file *) xmalloc (sizeof (struct po_file));
file->real_filename = filename;
file->logical_filename = filename;
- file->mdlp = read_po (fp, file->real_filename, file->logical_filename);
+ file->mdlp =
+ read_catalog_stream (fp, file->real_filename, file->logical_filename);
file->domains = NULL;
/* Restore error handler. */
file = (struct po_file *) xmalloc (sizeof (struct po_file));
file->real_filename = filename;
file->logical_filename = filename;
- file->mdlp = read_po (fp, file->real_filename, file->logical_filename);
+ file->mdlp =
+ read_catalog_stream (fp, file->real_filename, file->logical_filename);
file->domains = NULL;
if (fp != stdin)
#include "relocatable.h"
#include "basename.h"
#include "message.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "write-catalog.h"
#include "write-po.h"
#include "write-properties.h"
"--sort-output", "--sort-by-file");
/* Read input file. */
- result = read_po_file (input_file);
+ result = read_catalog_file (input_file);
/* Read optional files that limit the extent of the attribute changes. */
- only_mdlp = (only_file != NULL ? read_po_file (only_file) : NULL);
- ignore_mdlp = (ignore_file != NULL ? read_po_file (ignore_file) : NULL);
+ only_mdlp = (only_file != NULL ? read_catalog_file (only_file) : NULL);
+ ignore_mdlp = (ignore_file != NULL ? read_catalog_file (ignore_file) : NULL);
/* Filter the messages and manipulate the attributes. */
result = process_msgdomain_list (result, only_mdlp, ignore_mdlp);
#include "relocatable.h"
#include "basename.h"
#include "message.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "write-catalog.h"
#include "write-po.h"
#include "write-properties.h"
#include "basename.h"
#include "message.h"
#include "exit.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "msgl-iconv.h"
#include "c-strstr.h"
#include "c-strcase.h"
message_list_ty *empty_list;
/* This is the master file, created by a human. */
- def = remove_obsoletes (read_po_file (fn1));
+ def = remove_obsoletes (read_catalog_file (fn1));
/* This is the generated file, created by groping the sources with
the xgettext program. */
- ref = remove_obsoletes (read_po_file (fn2));
+ ref = remove_obsoletes (read_catalog_file (fn2));
/* The references file can be either in ASCII or in UTF-8. If it is
in UTF-8, we have to convert the definitions to UTF-8 as well. */
#include "relocatable.h"
#include "basename.h"
#include "message.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "write-catalog.h"
#include "write-po.h"
#include "write-properties.h"
#include "relocatable.h"
#include "basename.h"
#include "message.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "write-catalog.h"
#include "write-po.h"
#include "write-properties.h"
to_code = locale_charset ();
/* Read input file. */
- result = read_po_file (input_file);
+ result = read_catalog_file (input_file);
/* Convert if and only if the output syntax supports different encodings. */
if (!output_syntax->requires_utf8)
#include "relocatable.h"
#include "basename.h"
#include "message.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "msgl-english.h"
#include "write-catalog.h"
#include "write-po.h"
"--sort-output", "--sort-by-file");
/* Read input file and add English translations. */
- result = msgdomain_list_english (read_po_file (argv[optind]));
+ result = msgdomain_list_english (read_catalog_file (argv[optind]));
/* Sort the results. */
if (sort_by_filepos)
#include "relocatable.h"
#include "basename.h"
#include "message.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "xalloc.h"
#include "exit.h"
#include "full-write.h"
input_file = "-";
/* Read input file. */
- result = read_po_file (input_file);
+ result = read_catalog_file (input_file);
if (strcmp (sub_name, "0") != 0)
{
#include "relocatable.h"
#include "basename.h"
#include "message.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "write-catalog.h"
#include "write-po.h"
#include "write-properties.h"
input_file = "-";
/* Read input file. */
- result = read_po_file (input_file);
+ result = read_catalog_file (input_file);
/* Recognize special programs as built-ins. */
if (strcmp (sub_name, "recode-sr-latin") == 0 && sub_argc == 1)
#include "write-qt.h"
#include "propername.h"
#include "message.h"
-#include "open-po.h"
-#include "read-po.h"
+#include "open-catalog.h"
+#include "read-catalog.h"
#include "po-charset.h"
#include "msgl-check.h"
#include "gettext.h"
static const char *add_mo_suffix (const char *);
static struct msg_domain *new_domain (const char *name, const char *file_name);
static bool is_nonobsolete (const message_ty *mp);
-static void read_po_file_msgfmt (char *filename);
+static void read_catalog_file_msgfmt (char *filename);
int
current_domain = NULL;
/* And process the input file. */
- read_po_file_msgfmt (argv[optind]);
+ read_catalog_file_msgfmt (argv[optind]);
++optind;
}
}
-/* The rest of the file defines a subclass msgfmt_po_reader_ty of
- default_po_reader_ty. Its particularities are:
+/* The rest of the file defines a subclass msgfmt_catalog_reader_ty of
+ default_catalog_reader_ty. Its particularities are:
- The header entry check is performed on-the-fly.
- Comments are not stored, they are discarded right away.
(This is achieved by setting handle_comments = false and
*/
-/* This structure defines a derived class of the default_po_reader_ty class.
- (See read-po-abstract.h for an explanation.) */
-typedef struct msgfmt_po_reader_ty msgfmt_po_reader_ty;
-struct msgfmt_po_reader_ty
+/* This structure defines a derived class of the default_catalog_reader_ty
+ class. (See read-catalog-abstract.h for an explanation.) */
+typedef struct msgfmt_catalog_reader_ty msgfmt_catalog_reader_ty;
+struct msgfmt_catalog_reader_ty
{
/* inherited instance variables, etc */
- DEFAULT_PO_READER_TY
+ DEFAULT_CATALOG_READER_TY
bool has_header_entry;
bool has_nonfuzzy_header_entry;
/* Prepare for first message. */
static void
-msgfmt_constructor (abstract_po_reader_ty *that)
+msgfmt_constructor (abstract_catalog_reader_ty *that)
{
- msgfmt_po_reader_ty *this = (msgfmt_po_reader_ty *) that;
+ msgfmt_catalog_reader_ty *this = (msgfmt_catalog_reader_ty *) that;
/* Invoke superclass constructor. */
default_constructor (that);
/* Some checks after whole file is read. */
static void
-msgfmt_parse_debrief (abstract_po_reader_ty *that)
+msgfmt_parse_debrief (abstract_catalog_reader_ty *that)
{
- msgfmt_po_reader_ty *this = (msgfmt_po_reader_ty *) that;
+ msgfmt_catalog_reader_ty *this = (msgfmt_catalog_reader_ty *) that;
/* Invoke superclass method. */
default_parse_debrief (that);
/* Set 'domain' directive when seen in .po file. */
static void
-msgfmt_set_domain (default_po_reader_ty *this, char *name)
+msgfmt_set_domain (default_catalog_reader_ty *this, char *name)
{
/* If no output file was given, we change it with each `domain'
directive. */
static void
-msgfmt_add_message (default_po_reader_ty *this,
+msgfmt_add_message (default_catalog_reader_ty *this,
char *msgctxt,
char *msgid,
lex_pos_ty *msgid_pos,
static void
-msgfmt_frob_new_message (default_po_reader_ty *that, message_ty *mp,
+msgfmt_frob_new_message (default_catalog_reader_ty *that, message_ty *mp,
const lex_pos_ty *msgid_pos,
const lex_pos_ty *msgstr_pos)
{
- msgfmt_po_reader_ty *this = (msgfmt_po_reader_ty *) that;
+ msgfmt_catalog_reader_ty *this = (msgfmt_catalog_reader_ty *) that;
if (!mp->obsolete)
{
/* Test for `#, fuzzy' comments and warn. */
static void
-msgfmt_comment_special (abstract_po_reader_ty *that, const char *s)
+msgfmt_comment_special (abstract_catalog_reader_ty *that, const char *s)
{
- msgfmt_po_reader_ty *this = (msgfmt_po_reader_ty *) that;
+ msgfmt_catalog_reader_ty *this = (msgfmt_catalog_reader_ty *) that;
/* Invoke superclass method. */
default_comment_special (that, s);
and all actions resulting from the parse will be through
invocations of method functions of that object. */
-static default_po_reader_class_ty msgfmt_methods =
+static default_catalog_reader_class_ty msgfmt_methods =
{
{
- sizeof (msgfmt_po_reader_ty),
+ sizeof (msgfmt_catalog_reader_ty),
msgfmt_constructor,
default_destructor,
default_parse_brief,
/* Read .po file FILENAME and store translation pairs. */
static void
-read_po_file_msgfmt (char *filename)
+read_catalog_file_msgfmt (char *filename)
{
char *real_filename;
- FILE *fp = open_po_file (filename, &real_filename, true);
- default_po_reader_ty *pop;
+ FILE *fp = open_catalog_file (filename, &real_filename, true);
+ default_catalog_reader_ty *pop;
- pop = default_po_reader_alloc (&msgfmt_methods);
+ pop = default_catalog_reader_alloc (&msgfmt_methods);
pop->handle_comments = false;
pop->handle_filepos_comments = false;
pop->allow_domain_directives = true;
pop->mlp = current_domain->mlp;
}
po_lex_pass_obsolete_entries (true);
- po_scan ((abstract_po_reader_ty *) pop, fp, real_filename, filename,
- input_syntax);
- po_reader_free ((abstract_po_reader_ty *) pop);
+ catalog_reader_parse ((abstract_catalog_reader_ty *) pop, fp, real_filename,
+ filename, input_syntax);
+ catalog_reader_free ((abstract_catalog_reader_ty *) pop);
if (fp != stdin)
fclose (fp);
#include "relocatable.h"
#include "basename.h"
#include "message.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "write-catalog.h"
#include "write-po.h"
#include "write-properties.h"
}
/* Read input file. */
- result = read_po_file (input_file);
+ result = read_catalog_file (input_file);
if (grep_task[0].pattern_count > 0
|| grep_task[1].pattern_count > 0
#include "c-strstr.h"
#include "c-strcase.h"
#include "message.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "write-catalog.h"
#include "write-po.h"
#include "write-properties.h"
}
/* Read input file. */
- result = read_po_file (input_file);
+ result = read_catalog_file (input_file);
/* Fill the header entry. */
result = fill_header (result);
#include "xerror.h"
#include "xvasprintf.h"
#include "message.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "po-charset.h"
#include "msgl-ascii.h"
#include "msgl-equal.h"
mdlps =
(msgdomain_list_ty **) xmalloc (nfiles * sizeof (msgdomain_list_ty *));
for (n = 0; n < nfiles; n++)
- mdlps[n] = read_po_file (files[n]);
+ mdlps[n] = read_catalog_file (files[n]);
/* Determine the canonical name of each input file's encoding. */
canon_charsets = (const char ***) xmalloc (nfiles * sizeof (const char **));
#include "relocatable.h"
#include "basename.h"
#include "message.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "write-catalog.h"
#include "write-po.h"
#include "write-properties.h"
msgdomain_list_ty *mdlp;
size_t k;
- mdlp = read_po_file (filename);
+ mdlp = read_catalog_file (filename);
if (compendiums == NULL)
{
compendiums = message_list_list_alloc ();
stats.merged = stats.fuzzied = stats.missing = stats.obsolete = 0;
/* This is the definitions file, created by a human. */
- def = read_po_file (fn1);
+ def = read_catalog_file (fn1);
/* This is the references file, created by groping the sources with
the xgettext program. */
- ref = read_po_file (fn2);
+ ref = read_catalog_file (fn2);
/* Add a dummy header entry, if the references file contains none. */
for (k = 0; k < ref->nitems; k++)
if (message_list_search (ref->item[k]->messages, NULL, "") == NULL)
#include "relocatable.h"
#include "basename.h"
#include "message.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "write-catalog.h"
#include "write-po.h"
#include "write-properties.h"
#endif
/* Specification. */
-#include "open-po.h"
+#include "open-catalog.h"
#include <errno.h>
#include <stdbool.h>
#define SIZEOF(a) (sizeof(a)/sizeof(a[0]))
static FILE *
-try_open_po_file (const char *input_name, char **real_file_name_p)
+try_open_catalog_file (const char *input_name, char **real_file_name_p)
{
static const char *extension[] = { "", ".po", ".pot", };
char *file_name;
file's pathname is returned in *REAL_FILE_NAME_P, for error message
purposes. */
FILE *
-open_po_file (const char *input_name, char **real_file_name_p,
- bool exit_on_error)
+open_catalog_file (const char *input_name, char **real_file_name_p,
+ bool exit_on_error)
{
- FILE *fp = try_open_po_file (input_name, real_file_name_p);
+ FILE *fp = try_open_catalog_file (input_name, real_file_name_p);
if (fp == NULL && exit_on_error)
{
/* Opening PO files.
- Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
+ Copyright (C) 1995-1997, 2000-2003, 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
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifndef _OPEN_PO_H
-#define _OPEN_PO_H
+#ifndef _OPEN_CATALOG_H
+#define _OPEN_CATALOG_H
#include <stdbool.h>
#include <stdio.h>
not found, the list of directories in "dir-list.h" is searched. The
file's pathname is returned in *REAL_FILE_NAME_P, for error message
purposes. */
-extern FILE *open_po_file (const char *input_name, char **real_file_name_p,
- bool exit_on_error);
+extern FILE *open_catalog_file (const char *input_name,
+ char **real_file_name_p, bool exit_on_error);
#ifdef __cplusplus
#endif
-#endif /* _OPEN_PO_H */
+#endif /* _OPEN_CATALOG_H */
#include "error.h"
#include "xalloc.h"
#include "gettext.h"
-#include "read-po-abstract.h"
+#include "read-catalog-abstract.h"
#define _(str) gettext (str)
#endif
/* Specification. */
-#include "read-po-abstract.h"
+#include "read-catalog-abstract.h"
#include <stdlib.h>
#include <string.h>
#include "gettext.h"
/* Local variables. */
-static abstract_po_reader_ty *callback_arg;
+static abstract_catalog_reader_ty *callback_arg;
/* ========================================================================= */
-/* Allocating and freeing instances of abstract_po_reader_ty. */
+/* Allocating and freeing instances of abstract_catalog_reader_ty. */
-abstract_po_reader_ty *
-po_reader_alloc (abstract_po_reader_class_ty *method_table)
+abstract_catalog_reader_ty *
+catalog_reader_alloc (abstract_catalog_reader_class_ty *method_table)
{
- abstract_po_reader_ty *pop;
+ abstract_catalog_reader_ty *pop;
- pop = (abstract_po_reader_ty *) xmalloc (method_table->size);
+ pop = (abstract_catalog_reader_ty *) xmalloc (method_table->size);
pop->methods = method_table;
if (method_table->constructor)
method_table->constructor (pop);
void
-po_reader_free (abstract_po_reader_ty *pop)
+catalog_reader_free (abstract_catalog_reader_ty *pop)
{
if (pop->methods->destructor)
pop->methods->destructor (pop);
static inline void
-call_parse_brief (abstract_po_reader_ty *pop)
+call_parse_brief (abstract_catalog_reader_ty *pop)
{
if (pop->methods->parse_brief)
pop->methods->parse_brief (pop);
}
static inline void
-call_parse_debrief (abstract_po_reader_ty *pop)
+call_parse_debrief (abstract_catalog_reader_ty *pop)
{
if (pop->methods->parse_debrief)
pop->methods->parse_debrief (pop);
}
static inline void
-call_directive_domain (abstract_po_reader_ty *pop, char *name)
+call_directive_domain (abstract_catalog_reader_ty *pop, char *name)
{
if (pop->methods->directive_domain)
pop->methods->directive_domain (pop, name);
}
static inline void
-call_directive_message (abstract_po_reader_ty *pop,
+call_directive_message (abstract_catalog_reader_ty *pop,
char *msgctxt,
char *msgid,
lex_pos_ty *msgid_pos,
}
static inline void
-call_comment (abstract_po_reader_ty *pop, const char *s)
+call_comment (abstract_catalog_reader_ty *pop, const char *s)
{
if (pop->methods->comment != NULL)
pop->methods->comment (pop, s);
}
static inline void
-call_comment_dot (abstract_po_reader_ty *pop, const char *s)
+call_comment_dot (abstract_catalog_reader_ty *pop, const char *s)
{
if (pop->methods->comment_dot != NULL)
pop->methods->comment_dot (pop, s);
}
static inline void
-call_comment_filepos (abstract_po_reader_ty *pop, const char *name, size_t line)
+call_comment_filepos (abstract_catalog_reader_ty *pop, const char *name,
+ size_t line)
{
if (pop->methods->comment_filepos)
pop->methods->comment_filepos (pop, name, line);
}
static inline void
-call_comment_special (abstract_po_reader_ty *pop, const char *s)
+call_comment_special (abstract_catalog_reader_ty *pop, const char *s)
{
if (pop->methods->comment_special != NULL)
pop->methods->comment_special (pop, s);
static inline void
-po_scan_start (abstract_po_reader_ty *pop)
+parse_start (abstract_catalog_reader_ty *pop)
{
/* The parse will call the po_callback_... functions (see below)
when the various directive are recognised. The callback_arg
}
static inline void
-po_scan_end (abstract_po_reader_ty *pop)
+parse_end (abstract_catalog_reader_ty *pop)
{
call_parse_debrief (pop);
callback_arg = NULL;
void
-po_scan (abstract_po_reader_ty *pop, FILE *fp,
- const char *real_filename, const char *logical_filename,
- input_syntax_ty syntax)
+catalog_reader_parse (abstract_catalog_reader_ty *pop, FILE *fp,
+ const char *real_filename, const char *logical_filename,
+ input_syntax_ty syntax)
{
/* Parse the stream's content. */
+ parse_start (pop);
switch (syntax)
{
case syntax_po:
lex_start (fp, real_filename, logical_filename);
- po_scan_start (pop);
po_gram_parse ();
- po_scan_end (pop);
lex_end ();
break;
case syntax_properties:
- po_scan_start (pop);
properties_parse (pop, fp, real_filename, logical_filename);
- po_scan_end (pop);
break;
case syntax_stringtable:
- po_scan_start (pop);
stringtable_parse (pop, fp, real_filename, logical_filename);
- po_scan_end (pop);
break;
default:
abort ();
}
+ parse_end (pop);
if (error_message_count > 0)
po_xerror (PO_SEVERITY_FATAL_ERROR, NULL,
/* ========================================================================= */
-/* Callbacks used by po-gram.y or po-lex.c, indirectly from po_scan. */
+/* Callbacks used by po-gram.y or po-lex.c, indirectly from
+ catalog_reader_parse. */
/* This function is called by po_gram_lex() whenever a domain directive
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_ABSTRACT_H
-#define _READ_PO_ABSTRACT_H
+#ifndef _READ_CATALOG_ABSTRACT_H
+#define _READ_CATALOG_ABSTRACT_H
#include "po-lex.h"
#include "message.h"
and inheritance - more than enough for the immediate needs. */
/* Forward declaration. */
-struct abstract_po_reader_ty;
+struct abstract_catalog_reader_ty;
/* This first structure, playing the role of the "Class" in OO sense,
class (base or derived). Use a NULL pointer where no action is
required. */
-typedef struct abstract_po_reader_class_ty abstract_po_reader_class_ty;
-struct abstract_po_reader_class_ty
+typedef struct abstract_catalog_reader_class_ty
+ abstract_catalog_reader_class_ty;
+struct abstract_catalog_reader_class_ty
{
/* how many bytes to malloc for an instance of this class */
size_t size;
/* what to do immediately after the instance is malloc()ed */
- void (*constructor) (struct abstract_po_reader_ty *pop);
+ void (*constructor) (struct abstract_catalog_reader_ty *pop);
/* what to do immediately before the instance is free()ed */
- void (*destructor) (struct abstract_po_reader_ty *pop);
+ void (*destructor) (struct abstract_catalog_reader_ty *pop);
/* This method is invoked before the parse, but after the file is
opened by the lexer. */
- void (*parse_brief) (struct abstract_po_reader_ty *pop);
+ void (*parse_brief) (struct abstract_catalog_reader_ty *pop);
/* This method is invoked after the parse, but before the file is
closed by the lexer. The intention is to make consistency checks
against the file here, and emit the errors through the lex_error*
functions. */
- void (*parse_debrief) (struct abstract_po_reader_ty *pop);
+ void (*parse_debrief) (struct abstract_catalog_reader_ty *pop);
/* what to do with a domain directive */
- void (*directive_domain) (struct abstract_po_reader_ty *pop, char *name);
+ void (*directive_domain) (struct abstract_catalog_reader_ty *pop, char *name);
/* what to do with a message directive */
- void (*directive_message) (struct abstract_po_reader_ty *pop,
+ void (*directive_message) (struct abstract_catalog_reader_ty *pop,
char *msgctxt,
char *msgid, lex_pos_ty *msgid_pos,
char *msgid_plural,
/* What to do with a plain-vanilla comment - the expectation is that
they will be accumulated, and added to the next message
definition seen. Or completely ignored. */
- void (*comment) (struct abstract_po_reader_ty *pop, const char *s);
+ void (*comment) (struct abstract_catalog_reader_ty *pop, const char *s);
/* What to do with a comment that starts with a dot (i.e. extracted
by xgettext) - the expectation is that they will be accumulated,
and added to the next message definition seen. Or completely
ignored. */
- void (*comment_dot) (struct abstract_po_reader_ty *pop, const char *s);
+ void (*comment_dot) (struct abstract_catalog_reader_ty *pop, const char *s);
/* What to do with a file position seen in a comment (i.e. a message
location comment extracted by xgettext) - the expectation is that
they will be accumulated, and added to the next message
definition seen. Or completely ignored. */
- void (*comment_filepos) (struct abstract_po_reader_ty *pop,
+ void (*comment_filepos) (struct abstract_catalog_reader_ty *pop,
const char *s, size_t line);
/* What to do with a comment that starts with a ',' or '!' - this is a
special comment. One of the possible uses is to indicate a
inexact translation. */
- void (*comment_special) (struct abstract_po_reader_ty *pop, const char *s);
+ void (*comment_special) (struct abstract_catalog_reader_ty *pop,
+ const char *s);
};
Derived methods will often need to cast their first argument before
using it (this corresponds to the implicit ``this'' argument in C++).
- When declaring derived classes, use the ABSTRACT_PO_READER_TY define
+ When declaring derived classes, use the ABSTRACT_CATALOG_READER_TY define
at the start of the structure, to declare inherited instance variables,
etc. */
-#define ABSTRACT_PO_READER_TY \
- abstract_po_reader_class_ty *methods;
+#define ABSTRACT_CATALOG_READER_TY \
+ abstract_catalog_reader_class_ty *methods;
-typedef struct abstract_po_reader_ty abstract_po_reader_ty;
-struct abstract_po_reader_ty
+typedef struct abstract_catalog_reader_ty abstract_catalog_reader_ty;
+struct abstract_catalog_reader_ty
{
- ABSTRACT_PO_READER_TY
+ ABSTRACT_CATALOG_READER_TY
};
-/* Allocate a fresh abstract_po_reader_ty (or derived class) instance and
+/* Allocate a fresh abstract_catalog_reader_ty (or derived class) instance and
call its constructor. */
-extern abstract_po_reader_ty *
- po_reader_alloc (abstract_po_reader_class_ty *method_table);
+extern abstract_catalog_reader_ty *
+ catalog_reader_alloc (abstract_catalog_reader_class_ty *method_table);
/* Kinds of PO file input syntaxes. */
enum input_syntax_ty
typedef enum input_syntax_ty input_syntax_ty;
/* Read a PO file from a stream, and dispatch to the various
- abstract_po_reader_class_ty methods. */
+ abstract_catalog_reader_class_ty methods. */
extern void
- po_scan (abstract_po_reader_ty *pop, FILE *fp,
- const char *real_filename, const char *logical_filename,
- input_syntax_ty syntax);
+ catalog_reader_parse (abstract_catalog_reader_ty *pop, FILE *fp,
+ const char *real_filename,
+ const char *logical_filename,
+ input_syntax_ty syntax);
-/* Call the destructor and deallocate a abstract_po_reader_ty (or derived
+/* Call the destructor and deallocate a abstract_catalog_reader_ty (or derived
class) instance. */
extern void
- po_reader_free (abstract_po_reader_ty *pop);
+ catalog_reader_free (abstract_catalog_reader_ty *pop);
-/* Callbacks used by po-gram.y or po-lex.c, indirectly from po_scan. */
+/* Callbacks used by po-gram.y or po-lex.c, indirectly from
+ catalog_reader_parse. */
extern void po_callback_domain (char *name);
extern void po_callback_message (char *msgctxt,
char *msgid, lex_pos_ty *msgid_pos,
#endif
-#endif /* _READ_PO_ABSTRACT_H */
+#endif /* _READ_CATALOG_ABSTRACT_H */
#endif
/* Specification. */
-#include "read-po.h"
+#include "read-catalog.h"
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
-#include "open-po.h"
+#include "open-catalog.h"
#include "po-charset.h"
#include "po-xerror.h"
#include "xalloc.h"
/* Inline functions to invoke the methods. */
static inline void
-call_set_domain (struct default_po_reader_ty *this, char *name)
+call_set_domain (struct default_catalog_reader_ty *this, char *name)
{
- default_po_reader_class_ty *methods =
- (default_po_reader_class_ty *) this->methods;
+ default_catalog_reader_class_ty *methods =
+ (default_catalog_reader_class_ty *) this->methods;
if (methods->set_domain)
methods->set_domain (this, name);
}
static inline void
-call_add_message (struct default_po_reader_ty *this,
+call_add_message (struct default_catalog_reader_ty *this,
char *msgctxt,
char *msgid, lex_pos_ty *msgid_pos, char *msgid_plural,
char *msgstr, size_t msgstr_len, lex_pos_ty *msgstr_pos,
char *prev_msgctxt, char *prev_msgid, char *prev_msgid_plural,
bool force_fuzzy, bool obsolete)
{
- default_po_reader_class_ty *methods =
- (default_po_reader_class_ty *) this->methods;
+ default_catalog_reader_class_ty *methods =
+ (default_catalog_reader_class_ty *) this->methods;
if (methods->add_message)
methods->add_message (this, msgctxt,
}
static inline void
-call_frob_new_message (struct default_po_reader_ty *this, message_ty *mp,
+call_frob_new_message (struct default_catalog_reader_ty *this, message_ty *mp,
const lex_pos_ty *msgid_pos,
const lex_pos_ty *msgstr_pos)
{
- default_po_reader_class_ty *methods =
- (default_po_reader_class_ty *) this->methods;
+ default_catalog_reader_class_ty *methods =
+ (default_catalog_reader_class_ty *) this->methods;
if (methods->frob_new_message)
methods->frob_new_message (this, mp, msgid_pos, msgstr_pos);
/* ========================================================================= */
-/* Implementation of default_po_reader_ty's methods. */
+/* Implementation of default_catalog_reader_ty's methods. */
/* Implementation of methods declared in the superclass. */
/* Prepare for first message. */
void
-default_constructor (abstract_po_reader_ty *that)
+default_constructor (abstract_catalog_reader_ty *that)
{
- default_po_reader_ty *this = (default_po_reader_ty *) that;
+ default_catalog_reader_ty *this = (default_catalog_reader_ty *) that;
size_t i;
this->domain = MESSAGE_DOMAIN_DEFAULT;
void
-default_destructor (abstract_po_reader_ty *that)
+default_destructor (abstract_catalog_reader_ty *that)
{
- default_po_reader_ty *this = (default_po_reader_ty *) that;
+ default_catalog_reader_ty *this = (default_catalog_reader_ty *) that;
/* Do not free this->mdlp and this->mlp. */
if (this->handle_comments)
void
-default_parse_brief (abstract_po_reader_ty *that)
+default_parse_brief (abstract_catalog_reader_ty *that)
{
/* We need to parse comments, because even if this->handle_comments and
this->handle_filepos_comments are false, we need to know which messages
void
-default_parse_debrief (abstract_po_reader_ty *that)
+default_parse_debrief (abstract_catalog_reader_ty *that)
{
}
/* Add the accumulated comments to the message. */
static void
-default_copy_comment_state (default_po_reader_ty *this, message_ty *mp)
+default_copy_comment_state (default_catalog_reader_ty *this, message_ty *mp)
{
size_t j, i;
static void
-default_reset_comment_state (default_po_reader_ty *this)
+default_reset_comment_state (default_catalog_reader_ty *this)
{
size_t j, i;
/* Process 'domain' directive from .po file. */
void
-default_directive_domain (abstract_po_reader_ty *that, char *name)
+default_directive_domain (abstract_catalog_reader_ty *that, char *name)
{
- default_po_reader_ty *this = (default_po_reader_ty *) that;
+ default_catalog_reader_ty *this = (default_catalog_reader_ty *) that;
call_set_domain (this, name);
/* Process ['msgctxt'/]'msgid'/'msgstr' pair from .po file. */
void
-default_directive_message (abstract_po_reader_ty *that,
+default_directive_message (abstract_catalog_reader_ty *that,
char *msgctxt,
char *msgid,
lex_pos_ty *msgid_pos,
char *prev_msgid, char *prev_msgid_plural,
bool force_fuzzy, bool obsolete)
{
- default_po_reader_ty *this = (default_po_reader_ty *) that;
+ default_catalog_reader_ty *this = (default_catalog_reader_ty *) that;
call_add_message (this, msgctxt, msgid, msgid_pos, msgid_plural,
msgstr, msgstr_len, msgstr_pos,
void
-default_comment (abstract_po_reader_ty *that, const char *s)
+default_comment (abstract_catalog_reader_ty *that, const char *s)
{
- default_po_reader_ty *this = (default_po_reader_ty *) that;
+ default_catalog_reader_ty *this = (default_catalog_reader_ty *) that;
if (this->handle_comments)
{
void
-default_comment_dot (abstract_po_reader_ty *that, const char *s)
+default_comment_dot (abstract_catalog_reader_ty *that, const char *s)
{
- default_po_reader_ty *this = (default_po_reader_ty *) that;
+ default_catalog_reader_ty *this = (default_catalog_reader_ty *) that;
if (this->handle_comments)
{
void
-default_comment_filepos (abstract_po_reader_ty *that,
+default_comment_filepos (abstract_catalog_reader_ty *that,
const char *name, size_t line)
{
- default_po_reader_ty *this = (default_po_reader_ty *) that;
+ default_catalog_reader_ty *this = (default_catalog_reader_ty *) that;
if (this->handle_filepos_comments)
{
/* Test for '#, fuzzy' comments and warn. */
void
-default_comment_special (abstract_po_reader_ty *that, const char *s)
+default_comment_special (abstract_catalog_reader_ty *that, const char *s)
{
- default_po_reader_ty *this = (default_po_reader_ty *) that;
+ default_catalog_reader_ty *this = (default_catalog_reader_ty *) that;
po_parse_comment_special (s, &this->is_fuzzy, this->is_format,
&this->do_wrap);
void
-default_set_domain (default_po_reader_ty *this, char *name)
+default_set_domain (default_catalog_reader_ty *this, char *name)
{
if (this->allow_domain_directives)
/* Override current domain name. Don't free memory. */
}
void
-default_add_message (default_po_reader_ty *this,
+default_add_message (default_catalog_reader_ty *this,
char *msgctxt,
char *msgid,
lex_pos_ty *msgid_pos,
and all actions resulting from the parse will be through
invocations of method functions of that object. */
-static default_po_reader_class_ty default_methods =
+static default_catalog_reader_class_ty default_methods =
{
{
- sizeof (default_po_reader_ty),
+ sizeof (default_catalog_reader_ty),
default_constructor,
default_destructor,
default_parse_brief,
};
-default_po_reader_ty *
-default_po_reader_alloc (default_po_reader_class_ty *method_table)
+default_catalog_reader_ty *
+default_catalog_reader_alloc (default_catalog_reader_class_ty *method_table)
{
- return (default_po_reader_ty *) po_reader_alloc (&method_table->super);
+ return
+ (default_catalog_reader_ty *) catalog_reader_alloc (&method_table->super);
}
msgdomain_list_ty *
-read_po (FILE *fp, const char *real_filename, const char *logical_filename)
+read_catalog_stream (FILE *fp, const char *real_filename,
+ const char *logical_filename)
{
- default_po_reader_ty *pop;
+ default_catalog_reader_ty *pop;
msgdomain_list_ty *mdlp;
- pop = default_po_reader_alloc (&default_methods);
+ pop = default_catalog_reader_alloc (&default_methods);
pop->handle_comments = true;
pop->handle_filepos_comments = (line_comment != 0);
pop->allow_domain_directives = true;
convert strings to UTF-8. */
pop->mdlp->encoding = po_charset_utf8;
po_lex_pass_obsolete_entries (true);
- po_scan ((abstract_po_reader_ty *) pop, fp, real_filename, logical_filename,
- input_syntax);
+ catalog_reader_parse ((abstract_catalog_reader_ty *) pop, fp, real_filename,
+ logical_filename, input_syntax);
mdlp = pop->mdlp;
- po_reader_free ((abstract_po_reader_ty *) pop);
+ catalog_reader_free ((abstract_catalog_reader_ty *) pop);
return mdlp;
}
msgdomain_list_ty *
-read_po_file (const char *filename)
+read_catalog_file (const char *filename)
{
char *real_filename;
- FILE *fp = open_po_file (filename, &real_filename, true);
+ FILE *fp = open_catalog_file (filename, &real_filename, true);
msgdomain_list_ty *result;
- result = read_po (fp, real_filename, filename);
+ result = read_catalog_stream (fp, real_filename, filename);
if (fp != stdin)
fclose (fp);
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
+#ifndef _READ_CATALOG_H
+#define _READ_CATALOG_H
#include "message.h"
-#include "read-po-abstract.h"
+#include "read-catalog-abstract.h"
#include <stdbool.h>
#include <stdio.h>
/* The following pair of structures cooperate to create a derived class from
- class abstract_po_reader_ty. (See read-po-abstract.h for an explanation.)
- It implements the default behaviour of reading a PO file and converting it
- to an 'msgdomain_list_ty *'. */
+ class abstract_catalog_reader_ty. (See read-catalog-abstract.h for an
+ explanation.) It implements the default behaviour of reading a PO file
+ and converting it to an 'msgdomain_list_ty *'. */
/* Forward declaration. */
-struct default_po_reader_ty;
+struct default_catalog_reader_ty;
-typedef struct default_po_reader_class_ty default_po_reader_class_ty;
-struct default_po_reader_class_ty
+typedef struct default_catalog_reader_class_ty default_catalog_reader_class_ty;
+struct default_catalog_reader_class_ty
{
/* Methods inherited from superclass. */
- struct abstract_po_reader_class_ty super;
+ struct abstract_catalog_reader_class_ty super;
/* How to change the current domain. */
- void (*set_domain) (struct default_po_reader_ty *pop, char *name);
+ void (*set_domain) (struct default_catalog_reader_ty *pop, char *name);
/* How to add a message to the list. */
- void (*add_message) (struct default_po_reader_ty *pop,
+ void (*add_message) (struct default_catalog_reader_ty *pop,
char *msgctxt,
char *msgid, lex_pos_ty *msgid_pos, char *msgid_plural,
char *msgstr, size_t msgstr_len, lex_pos_ty *msgstr_pos,
bool force_fuzzy, bool obsolete);
/* How to modify a new message before adding it to the list. */
- void (*frob_new_message) (struct default_po_reader_ty *pop, message_ty *mp,
+ void (*frob_new_message) (struct default_catalog_reader_ty *pop,
+ message_ty *mp,
const lex_pos_ty *msgid_pos,
const lex_pos_ty *msgstr_pos);
};
-#define DEFAULT_PO_READER_TY \
- ABSTRACT_PO_READER_TY \
+#define DEFAULT_CATALOG_READER_TY \
+ ABSTRACT_CATALOG_READER_TY \
\
/* If true, pay attention to comments and filepos comments. */ \
bool handle_comments; \
enum is_format is_format[NFORMATS]; \
enum is_wrap do_wrap; \
-typedef struct default_po_reader_ty default_po_reader_ty;
-struct default_po_reader_ty
+typedef struct default_catalog_reader_ty default_catalog_reader_ty;
+struct default_catalog_reader_ty
{
- DEFAULT_PO_READER_TY
+ DEFAULT_CATALOG_READER_TY
};
-extern void default_constructor (abstract_po_reader_ty *that);
-extern void default_destructor (abstract_po_reader_ty *that);
-extern void default_parse_brief (abstract_po_reader_ty *that);
-extern void default_parse_debrief (abstract_po_reader_ty *that);
-extern void default_directive_domain (abstract_po_reader_ty *that, char *name);
-extern void default_directive_message (abstract_po_reader_ty *that,
+extern void default_constructor (abstract_catalog_reader_ty *that);
+extern void default_destructor (abstract_catalog_reader_ty *that);
+extern void default_parse_brief (abstract_catalog_reader_ty *that);
+extern void default_parse_debrief (abstract_catalog_reader_ty *that);
+extern void default_directive_domain (abstract_catalog_reader_ty *that,
+ char *name);
+extern void default_directive_message (abstract_catalog_reader_ty *that,
char *msgctxt,
char *msgid,
lex_pos_ty *msgid_pos,
char *prev_msgid,
char *prev_msgid_plural,
bool force_fuzzy, bool obsolete);
-extern void default_comment (abstract_po_reader_ty *that, const char *s);
-extern void default_comment_dot (abstract_po_reader_ty *that, const char *s);
-extern void default_comment_filepos (abstract_po_reader_ty *that,
+extern void default_comment (abstract_catalog_reader_ty *that, const char *s);
+extern void default_comment_dot (abstract_catalog_reader_ty *that,
+ const char *s);
+extern void default_comment_filepos (abstract_catalog_reader_ty *that,
const char *name, size_t line);
-extern void default_comment_special (abstract_po_reader_ty *that,
+extern void default_comment_special (abstract_catalog_reader_ty *that,
const char *s);
-extern void default_set_domain (default_po_reader_ty *this, char *name);
-extern void default_add_message (default_po_reader_ty *this,
+extern void default_set_domain (default_catalog_reader_ty *this, char *name);
+extern void default_add_message (default_catalog_reader_ty *this,
char *msgctxt,
char *msgid,
lex_pos_ty *msgid_pos,
char *prev_msgid_plural,
bool force_fuzzy, bool obsolete);
-/* Allocate a fresh default_po_reader_ty (or derived class) instance and
+/* Allocate a fresh default_catalog_reader_ty (or derived class) instance and
call its constructor. */
-extern default_po_reader_ty *
- default_po_reader_alloc (default_po_reader_class_ty *method_table);
+extern default_catalog_reader_ty *
+ default_catalog_reader_alloc (default_catalog_reader_class_ty *method_table);
/* If nonzero, remember comments for file name and line number for each
extern DLL_VARIABLE input_syntax_ty input_syntax;
/* Read the input file from a stream. Returns a list of messages. */
-extern msgdomain_list_ty *read_po (FILE *fp, const char *real_filename,
- const char *logical_filename);
+extern msgdomain_list_ty *read_catalog_stream (FILE *fp,
+ const char *real_filename,
+ const char *logical_filename);
/* 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_po_file (const char *input_name);
+extern msgdomain_list_ty *read_catalog_file (const char *input_name);
#ifdef __cplusplus
#endif
-#endif /* _READ_PO_H */
+#endif /* _READ_CATALOG_H */
/* Reading C# satellite assemblies.
- Copyright (C) 2003-2004 Free Software Foundation, Inc.
+ Copyright (C) 2003-2004, 2006 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify
#include "csharpexec.h"
#include "pipe.h"
#include "wait-process.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "xalloc.h"
#include "pathname.h"
#include "error.h"
error (EXIT_FAILURE, errno, _("fdopen() failed"));
/* Read the message list. */
- l->mdlp = read_po (fp, "(pipe)", "(pipe)");
+ l->mdlp = read_catalog_stream (fp, "(pipe)", "(pipe)");
fclose (fp);
/* Reading Java ResourceBundles.
- Copyright (C) 2001-2003 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2006 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
#include "javaexec.h"
#include "pipe.h"
#include "wait-process.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "error.h"
#include "exit.h"
#include "gettext.h"
error (EXIT_FAILURE, errno, _("fdopen() failed"));
/* Read the message list. */
- l->mdlp = read_po (fp, "(pipe)", "(pipe)");
+ l->mdlp = read_catalog_stream (fp, "(pipe)", "(pipe)");
fclose (fp);
#include "error.h"
#include "error-progname.h"
#include "message.h"
-#include "read-po-abstract.h"
+#include "read-catalog-abstract.h"
#include "xalloc.h"
#include "xvasprintf.h"
#include "po-xerror.h"
/* Read a .properties file from a stream, and dispatch to the various
- abstract_po_reader_class_ty methods. */
+ abstract_catalog_reader_class_ty methods. */
void
-properties_parse (abstract_po_reader_ty *this, FILE *file,
+properties_parse (abstract_catalog_reader_ty *this, FILE *file,
const char *real_filename, const char *logical_filename)
{
fp = file;
/* Reading Java .properties files.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify
#ifndef _READ_PROPERTIES_H
#define _READ_PROPERTIES_H
-#include "read-po-abstract.h"
+#include "read-catalog-abstract.h"
/* Read a .properties file from a stream, and dispatch to the various
- abstract_po_reader_class_ty methods. */
-extern void properties_parse (abstract_po_reader_ty *pop, FILE *fp,
+ abstract_catalog_reader_class_ty methods. */
+extern void properties_parse (abstract_catalog_reader_ty *pop, FILE *fp,
const char *real_filename,
const char *logical_filename);
/* Reading C# .resources files.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify
#include "csharpexec.h"
#include "pipe.h"
#include "wait-process.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "message.h"
#include "pathname.h"
#include "error.h"
error (EXIT_FAILURE, errno, _("fdopen() failed"));
/* Read the message list. */
- l->mdlp = read_po (fp, "(pipe)", "(pipe)");
+ l->mdlp = read_catalog_stream (fp, "(pipe)", "(pipe)");
fclose (fp);
#include "error.h"
#include "error-progname.h"
-#include "read-po-abstract.h"
+#include "read-catalog-abstract.h"
#include "xalloc.h"
#include "xvasprintf.h"
#include "po-xerror.h"
/* Read a .strings file from a stream, and dispatch to the various
- abstract_po_reader_class_ty methods. */
+ abstract_catalog_reader_class_ty methods. */
void
-stringtable_parse (abstract_po_reader_ty *pop, FILE *file,
+stringtable_parse (abstract_catalog_reader_ty *pop, FILE *file,
const char *real_filename, const char *logical_filename)
{
fp = file;
/* Reading NeXTstep/GNUstep .strings files.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify
#ifndef _READ_STRINGTABLE_H
#define _READ_STRINGTABLE_H
-#include "read-po-abstract.h"
+#include "read-catalog-abstract.h"
/* Read a .strings file from a stream, and dispatch to the various
- abstract_po_reader_class_ty methods. */
-extern void stringtable_parse (abstract_po_reader_ty *pop, FILE *fp,
+ abstract_catalog_reader_class_ty methods. */
+extern void stringtable_parse (abstract_catalog_reader_ty *pop, FILE *fp,
const char *real_filename,
const char *logical_filename);
/* Reading tcl/msgcat .msg files.
- Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This program is free software; you can redistribute it and/or modify
#include "sh-quote.h"
#include "pipe.h"
#include "wait-process.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "xallocsa.h"
#include "error.h"
#include "exit.h"
error (EXIT_FAILURE, errno, _("fdopen() failed"));
/* Read the message list. */
- mdlp = read_po (fp, "(pipe)", "(pipe)");
+ mdlp = read_catalog_stream (fp, "(pipe)", "(pipe)");
fclose (fp);
#include "x-properties.h"
#include "x-stringtable.h"
#include "xalloc.h"
-#include "read-po.h"
+#include "read-catalog.h"
#include "po-lex.h"
#include "gettext.h"
/* The charset found in the header entry. */
static char *header_charset;
-/* Define a subclass extract_po_reader_ty of default_po_reader_ty. */
+/* Define a subclass extract_catalog_reader_ty of default_catalog_reader_ty. */
static void
-extract_add_message (default_po_reader_ty *this,
+extract_add_message (default_catalog_reader_ty *this,
char *msgctxt,
char *msgid,
lex_pos_ty *msgid_pos,
and all actions resulting from the parse will be through
invocations of method functions of that object. */
-static default_po_reader_class_ty extract_methods =
+static default_catalog_reader_class_ty extract_methods =
{
{
- sizeof (default_po_reader_ty),
+ sizeof (default_catalog_reader_ty),
default_constructor,
default_destructor,
default_parse_brief,
input_syntax_ty syntax,
msgdomain_list_ty *mdlp)
{
- default_po_reader_ty *pop;
+ default_catalog_reader_ty *pop;
header_charset = NULL;
- pop = default_po_reader_alloc (&extract_methods);
+ pop = default_catalog_reader_alloc (&extract_methods);
pop->handle_comments = true;
pop->handle_filepos_comments = (line_comment != 0);
pop->allow_domain_directives = false;
pop->allow_duplicates_if_same_msgstr = true;
pop->mdlp = NULL;
pop->mlp = mdlp->item[0]->messages;
- po_scan ((abstract_po_reader_ty *) pop, fp, real_filename, logical_filename,
- syntax);
- po_reader_free ((abstract_po_reader_ty *) pop);
+ catalog_reader_parse ((abstract_catalog_reader_ty *) pop, fp, real_filename,
+ logical_filename, syntax);
+ catalog_reader_free ((abstract_catalog_reader_ty *) pop);
if (header_charset != NULL)
{
#include "exit.h"
#include "pathname.h"
#include "c-strcase.h"
-#include "open-po.h"
-#include "read-po-abstract.h"
+#include "open-catalog.h"
+#include "read-catalog-abstract.h"
#include "message.h"
#include "po-charset.h"
#include "msgl-iconv.h"
static void
-exclude_directive_domain (abstract_po_reader_ty *pop, char *name)
+exclude_directive_domain (abstract_catalog_reader_ty *pop, char *name)
{
po_gram_error_at_line (&gram_pos,
_("this file may not contain domain directives"));
static void
-exclude_directive_message (abstract_po_reader_ty *pop,
+exclude_directive_message (abstract_catalog_reader_ty *pop,
char *msgctxt,
char *msgid,
lex_pos_ty *msgid_pos,
and all actions resulting from the parse will be through
invocations of method functions of that object. */
-static abstract_po_reader_class_ty exclude_methods =
+static abstract_catalog_reader_class_ty exclude_methods =
{
- sizeof (abstract_po_reader_ty),
+ sizeof (abstract_catalog_reader_ty),
NULL, /* constructor */
NULL, /* destructor */
NULL, /* parse_brief */
read_exclusion_file (char *filename)
{
char *real_filename;
- FILE *fp = open_po_file (filename, &real_filename, true);
- abstract_po_reader_ty *pop;
+ FILE *fp = open_catalog_file (filename, &real_filename, true);
+ abstract_catalog_reader_ty *pop;
- pop = po_reader_alloc (&exclude_methods);
- po_scan (pop, fp, real_filename, filename, input_syntax);
- po_reader_free (pop);
+ pop = catalog_reader_alloc (&exclude_methods);
+ catalog_reader_parse (pop, fp, real_filename, filename, input_syntax);
+ catalog_reader_free (pop);
if (fp != stdin)
fclose (fp);
#include "str-list.h"
/* Declare 'line_comment' and 'input_syntax'. */
-#include "read-po.h"
+#include "read-catalog.h"
#ifdef __cplusplus