From a3f5468dbc5b5494103dbb23c915320a98626ea0 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 17 Oct 2006 12:01:33 +0000 Subject: [PATCH] Big renaming of functions parsing catalogs: read-po -> read-catalog. --- gettext-tools/src/ChangeLog | 107 ++++++++++++++++++++++ gettext-tools/src/FILES | 16 ++-- gettext-tools/src/gettext-po.c | 15 +-- gettext-tools/src/msgattrib.c | 8 +- gettext-tools/src/msgcat.c | 2 +- gettext-tools/src/msgcmp.c | 6 +- gettext-tools/src/msgcomm.c | 2 +- gettext-tools/src/msgconv.c | 4 +- gettext-tools/src/msgen.c | 4 +- gettext-tools/src/msgexec.c | 4 +- gettext-tools/src/msgfilter.c | 4 +- gettext-tools/src/msgfmt.c | 60 ++++++------ gettext-tools/src/msggrep.c | 4 +- gettext-tools/src/msginit.c | 4 +- gettext-tools/src/msgl-cat.c | 4 +- gettext-tools/src/msgmerge.c | 8 +- gettext-tools/src/msguniq.c | 2 +- gettext-tools/src/open-catalog.c | 10 +- gettext-tools/src/open-catalog.h | 12 +-- gettext-tools/src/po-gram-gen.y | 2 +- gettext-tools/src/read-catalog-abstract.c | 54 ++++++----- gettext-tools/src/read-catalog-abstract.h | 68 +++++++------- gettext-tools/src/read-catalog.c | 98 ++++++++++---------- gettext-tools/src/read-catalog.h | 78 ++++++++-------- gettext-tools/src/read-csharp.c | 6 +- gettext-tools/src/read-java.c | 6 +- gettext-tools/src/read-properties.c | 6 +- gettext-tools/src/read-properties.h | 8 +- gettext-tools/src/read-resources.c | 6 +- gettext-tools/src/read-stringtable.c | 6 +- gettext-tools/src/read-stringtable.h | 8 +- gettext-tools/src/read-tcl.c | 6 +- gettext-tools/src/x-po.c | 20 ++-- gettext-tools/src/xgettext.c | 22 ++--- gettext-tools/src/xgettext.h | 2 +- 35 files changed, 395 insertions(+), 277 deletions(-) diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index b976b26fc..70a523402 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,5 +1,112 @@ 2006-10-15 Bruno Haible + * 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. diff --git a/gettext-tools/src/FILES b/gettext-tools/src/FILES index 905de77ef..7be1c0472 100644 --- a/gettext-tools/src/FILES +++ b/gettext-tools/src/FILES @@ -59,8 +59,8 @@ po-xerror.c +-------------- 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 @@ -71,17 +71,17 @@ po-xerror.c | 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 @@ -92,11 +92,11 @@ po-xerror.c | 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 diff --git a/gettext-tools/src/gettext-po.c b/gettext-tools/src/gettext-po.c index 092b21c2b..fa7f0c1e9 100644 --- a/gettext-tools/src/gettext-po.c +++ b/gettext-tools/src/gettext-po.c @@ -32,7 +32,7 @@ #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" @@ -109,7 +109,7 @@ po_file_read (const char *filename, po_xerror_handler_t handler) 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; @@ -121,7 +121,8 @@ po_file_read (const char *filename, po_xerror_handler_t 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; /* Restore error handler. */ @@ -153,7 +154,7 @@ po_file_read_v2 (const char *filename, po_error_handler_t 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; @@ -163,7 +164,8 @@ po_file_read_v2 (const char *filename, po_error_handler_t 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; /* Restore error handler. */ @@ -200,7 +202,8 @@ po_file_read (const char *filename) 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) diff --git a/gettext-tools/src/msgattrib.c b/gettext-tools/src/msgattrib.c index aefbcd064..d3ff75aaf 100644 --- a/gettext-tools/src/msgattrib.c +++ b/gettext-tools/src/msgattrib.c @@ -35,7 +35,7 @@ #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" @@ -354,11 +354,11 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ "--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); diff --git a/gettext-tools/src/msgcat.c b/gettext-tools/src/msgcat.c index 60346fff5..e0b31a362 100644 --- a/gettext-tools/src/msgcat.c +++ b/gettext-tools/src/msgcat.c @@ -37,7 +37,7 @@ #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" diff --git a/gettext-tools/src/msgcmp.c b/gettext-tools/src/msgcmp.c index 662502339..a79d61a4d 100644 --- a/gettext-tools/src/msgcmp.c +++ b/gettext-tools/src/msgcmp.c @@ -36,7 +36,7 @@ #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" @@ -345,11 +345,11 @@ compare (const char *fn1, const char *fn2) 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. */ diff --git a/gettext-tools/src/msgcomm.c b/gettext-tools/src/msgcomm.c index 6303cc3aa..765963033 100644 --- a/gettext-tools/src/msgcomm.c +++ b/gettext-tools/src/msgcomm.c @@ -37,7 +37,7 @@ #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" diff --git a/gettext-tools/src/msgconv.c b/gettext-tools/src/msgconv.c index f98f4cc2d..24cb9cb41 100644 --- a/gettext-tools/src/msgconv.c +++ b/gettext-tools/src/msgconv.c @@ -35,7 +35,7 @@ #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" @@ -256,7 +256,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ 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) diff --git a/gettext-tools/src/msgen.c b/gettext-tools/src/msgen.c index 3b8a4890e..248e54ca5 100644 --- a/gettext-tools/src/msgen.c +++ b/gettext-tools/src/msgen.c @@ -35,7 +35,7 @@ #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" @@ -241,7 +241,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ "--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) diff --git a/gettext-tools/src/msgexec.c b/gettext-tools/src/msgexec.c index 607461693..38f27bc7d 100644 --- a/gettext-tools/src/msgexec.c +++ b/gettext-tools/src/msgexec.c @@ -40,7 +40,7 @@ #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" @@ -203,7 +203,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ input_file = "-"; /* Read input file. */ - result = read_po_file (input_file); + result = read_catalog_file (input_file); if (strcmp (sub_name, "0") != 0) { diff --git a/gettext-tools/src/msgfilter.c b/gettext-tools/src/msgfilter.c index 2120a6d7d..fe20333e6 100644 --- a/gettext-tools/src/msgfilter.c +++ b/gettext-tools/src/msgfilter.c @@ -53,7 +53,7 @@ #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" @@ -342,7 +342,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ 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) diff --git a/gettext-tools/src/msgfmt.c b/gettext-tools/src/msgfmt.c index 405e385f6..5035a7c06 100644 --- a/gettext-tools/src/msgfmt.c +++ b/gettext-tools/src/msgfmt.c @@ -49,8 +49,8 @@ #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" @@ -188,7 +188,7 @@ static void usage (int status) 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 @@ -506,7 +506,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ current_domain = NULL; /* And process the input file. */ - read_po_file_msgfmt (argv[optind]); + read_catalog_file_msgfmt (argv[optind]); ++optind; } @@ -810,8 +810,8 @@ is_nonobsolete (const message_ty *mp) } -/* 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 @@ -820,13 +820,13 @@ is_nonobsolete (const message_ty *mp) */ -/* 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; @@ -835,9 +835,9 @@ struct msgfmt_po_reader_ty /* 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); @@ -849,9 +849,9 @@ msgfmt_constructor (abstract_po_reader_ty *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); @@ -886,7 +886,7 @@ warning: older versions of msgfmt will give an error on this\n"))); /* 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. */ @@ -929,7 +929,7 @@ domain name \"%s\" not suitable as file name: will use prefix"), name); 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, @@ -961,11 +961,11 @@ msgfmt_add_message (default_po_reader_ty *this, 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) { @@ -1016,9 +1016,9 @@ msgfmt_frob_new_message (default_po_reader_ty *that, message_ty *mp, /* 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); @@ -1044,10 +1044,10 @@ msgfmt_comment_special (abstract_po_reader_ty *that, const char *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, @@ -1067,13 +1067,13 @@ static default_po_reader_class_ty msgfmt_methods = /* 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; @@ -1088,9 +1088,9 @@ read_po_file_msgfmt (char *filename) 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); diff --git a/gettext-tools/src/msggrep.c b/gettext-tools/src/msggrep.c index f6823ce25..3dcaa93bb 100644 --- a/gettext-tools/src/msggrep.c +++ b/gettext-tools/src/msggrep.c @@ -46,7 +46,7 @@ #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" @@ -446,7 +446,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ } /* 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 diff --git a/gettext-tools/src/msginit.c b/gettext-tools/src/msginit.c index 05595a4c6..ebf3bbe14 100644 --- a/gettext-tools/src/msginit.c +++ b/gettext-tools/src/msginit.c @@ -59,7 +59,7 @@ #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" @@ -315,7 +315,7 @@ the output .po file through the --output-file option.\n"), } /* Read input file. */ - result = read_po_file (input_file); + result = read_catalog_file (input_file); /* Fill the header entry. */ result = fill_header (result); diff --git a/gettext-tools/src/msgl-cat.c b/gettext-tools/src/msgl-cat.c index 241179cc1..e600ffede 100644 --- a/gettext-tools/src/msgl-cat.c +++ b/gettext-tools/src/msgl-cat.c @@ -33,7 +33,7 @@ #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" @@ -119,7 +119,7 @@ catenate_msgdomain_list (string_list_ty *file_list, const char *to_code) 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 **)); diff --git a/gettext-tools/src/msgmerge.c b/gettext-tools/src/msgmerge.c index 181bde660..1f73e3701 100644 --- a/gettext-tools/src/msgmerge.c +++ b/gettext-tools/src/msgmerge.c @@ -37,7 +37,7 @@ #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" @@ -583,7 +583,7 @@ compendium (const char *filename) 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 (); @@ -1365,11 +1365,11 @@ merge (const char *fn1, const char *fn2, msgdomain_list_ty **defp) 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) diff --git a/gettext-tools/src/msguniq.c b/gettext-tools/src/msguniq.c index fe6e1fddd..e8dca9689 100644 --- a/gettext-tools/src/msguniq.c +++ b/gettext-tools/src/msguniq.c @@ -36,7 +36,7 @@ #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" diff --git a/gettext-tools/src/open-catalog.c b/gettext-tools/src/open-catalog.c index d92569fc1..1d83826d7 100644 --- a/gettext-tools/src/open-catalog.c +++ b/gettext-tools/src/open-catalog.c @@ -21,7 +21,7 @@ #endif /* Specification. */ -#include "open-po.h" +#include "open-catalog.h" #include #include @@ -42,7 +42,7 @@ #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; @@ -109,10 +109,10 @@ try_open_po_file (const char *input_name, char **real_file_name_p) 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) { diff --git a/gettext-tools/src/open-catalog.h b/gettext-tools/src/open-catalog.h index b78e0001f..3dd10a3d2 100644 --- a/gettext-tools/src/open-catalog.h +++ b/gettext-tools/src/open-catalog.h @@ -1,5 +1,5 @@ /* 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 @@ -15,8 +15,8 @@ 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 #include @@ -32,8 +32,8 @@ extern "C" { 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 @@ -41,4 +41,4 @@ extern FILE *open_po_file (const char *input_name, char **real_file_name_p, #endif -#endif /* _OPEN_PO_H */ +#endif /* _OPEN_CATALOG_H */ diff --git a/gettext-tools/src/po-gram-gen.y b/gettext-tools/src/po-gram-gen.y index 145f27351..61f73f61f 100644 --- a/gettext-tools/src/po-gram-gen.y +++ b/gettext-tools/src/po-gram-gen.y @@ -36,7 +36,7 @@ #include "error.h" #include "xalloc.h" #include "gettext.h" -#include "read-po-abstract.h" +#include "read-catalog-abstract.h" #define _(str) gettext (str) diff --git a/gettext-tools/src/read-catalog-abstract.c b/gettext-tools/src/read-catalog-abstract.c index c330b4d17..9406596b4 100644 --- a/gettext-tools/src/read-catalog-abstract.c +++ b/gettext-tools/src/read-catalog-abstract.c @@ -23,7 +23,7 @@ #endif /* Specification. */ -#include "read-po-abstract.h" +#include "read-catalog-abstract.h" #include #include @@ -37,19 +37,19 @@ #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); @@ -58,7 +58,7 @@ po_reader_alloc (abstract_po_reader_class_ty *method_table) 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); @@ -71,28 +71,28 @@ po_reader_free (abstract_po_reader_ty *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, @@ -115,28 +115,29 @@ call_directive_message (abstract_po_reader_ty *pop, } 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); @@ -148,7 +149,7 @@ call_comment_special (abstract_po_reader_ty *pop, const char *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 @@ -160,7 +161,7 @@ po_scan_start (abstract_po_reader_ty *pop) } 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; @@ -168,33 +169,29 @@ po_scan_end (abstract_po_reader_ty *pop) 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, @@ -208,7 +205,8 @@ po_scan (abstract_po_reader_ty *pop, FILE *fp, /* ========================================================================= */ -/* 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 diff --git a/gettext-tools/src/read-catalog-abstract.h b/gettext-tools/src/read-catalog-abstract.h index f3c9a323b..ede334b25 100644 --- a/gettext-tools/src/read-catalog-abstract.h +++ b/gettext-tools/src/read-catalog-abstract.h @@ -17,8 +17,8 @@ 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" @@ -40,7 +40,7 @@ extern "C" { 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, @@ -48,33 +48,34 @@ struct abstract_po_reader_ty; 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, @@ -87,25 +88,26 @@ struct abstract_po_reader_class_ty /* 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); }; @@ -113,24 +115,24 @@ struct abstract_po_reader_class_ty 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 @@ -142,19 +144,21 @@ 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, @@ -181,4 +185,4 @@ extern void po_parse_comment_special (const char *s, bool *fuzzyp, #endif -#endif /* _READ_PO_ABSTRACT_H */ +#endif /* _READ_CATALOG_ABSTRACT_H */ diff --git a/gettext-tools/src/read-catalog.c b/gettext-tools/src/read-catalog.c index 2ea14187d..82a4d1e6b 100644 --- a/gettext-tools/src/read-catalog.c +++ b/gettext-tools/src/read-catalog.c @@ -21,13 +21,13 @@ #endif /* Specification. */ -#include "read-po.h" +#include "read-catalog.h" #include #include #include -#include "open-po.h" +#include "open-catalog.h" #include "po-charset.h" #include "po-xerror.h" #include "xalloc.h" @@ -40,25 +40,25 @@ /* 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, @@ -69,12 +69,12 @@ call_add_message (struct default_po_reader_ty *this, } 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); @@ -82,7 +82,7 @@ call_frob_new_message (struct default_po_reader_ty *this, message_ty *mp, /* ========================================================================= */ -/* Implementation of default_po_reader_ty's methods. */ +/* Implementation of default_catalog_reader_ty's methods. */ /* Implementation of methods declared in the superclass. */ @@ -90,9 +90,9 @@ call_frob_new_message (struct default_po_reader_ty *this, message_ty *mp, /* 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; @@ -108,9 +108,9 @@ default_constructor (abstract_po_reader_ty *that) 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) @@ -133,7 +133,7 @@ default_destructor (abstract_po_reader_ty *that) 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 @@ -143,14 +143,14 @@ default_parse_brief (abstract_po_reader_ty *that) 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; @@ -181,7 +181,7 @@ default_copy_comment_state (default_po_reader_ty *this, message_ty *mp) static void -default_reset_comment_state (default_po_reader_ty *this) +default_reset_comment_state (default_catalog_reader_ty *this) { size_t j, i; @@ -216,9 +216,9 @@ default_reset_comment_state (default_po_reader_ty *this) /* 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); @@ -231,7 +231,7 @@ default_directive_domain (abstract_po_reader_ty *that, char *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, @@ -242,7 +242,7 @@ default_directive_message (abstract_po_reader_ty *that, 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, @@ -255,9 +255,9 @@ default_directive_message (abstract_po_reader_ty *that, 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) { @@ -269,9 +269,9 @@ default_comment (abstract_po_reader_ty *that, const char *s) 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) { @@ -283,10 +283,10 @@ default_comment_dot (abstract_po_reader_ty *that, const char *s) 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) { @@ -304,9 +304,9 @@ default_comment_filepos (abstract_po_reader_ty *that, /* 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); @@ -317,7 +317,7 @@ default_comment_special (abstract_po_reader_ty *that, const char *s) 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. */ @@ -333,7 +333,7 @@ default_set_domain (default_po_reader_ty *this, char *name) } 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, @@ -421,10 +421,10 @@ default_add_message (default_po_reader_ty *this, 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, @@ -442,10 +442,11 @@ static default_po_reader_class_ty default_methods = }; -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); } @@ -467,12 +468,13 @@ input_syntax_ty input_syntax = syntax_po; 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; @@ -485,22 +487,22 @@ read_po (FILE *fp, const char *real_filename, const char *logical_filename) 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); diff --git a/gettext-tools/src/read-catalog.h b/gettext-tools/src/read-catalog.h index 268de395b..2f944b552 100644 --- a/gettext-tools/src/read-catalog.h +++ b/gettext-tools/src/read-catalog.h @@ -16,11 +16,11 @@ 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 #include @@ -37,25 +37,25 @@ extern "C" { /* 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, @@ -65,14 +65,15 @@ struct default_po_reader_class_ty 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; \ @@ -114,18 +115,19 @@ struct default_po_reader_class_ty 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, @@ -136,14 +138,15 @@ extern void default_directive_message (abstract_po_reader_ty *that, 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, @@ -155,10 +158,10 @@ extern void default_add_message (default_po_reader_ty *this, 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 @@ -174,14 +177,15 @@ extern DLL_VARIABLE bool allow_duplicates; 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 @@ -189,4 +193,4 @@ extern msgdomain_list_ty *read_po_file (const char *input_name); #endif -#endif /* _READ_PO_H */ +#endif /* _READ_CATALOG_H */ diff --git a/gettext-tools/src/read-csharp.c b/gettext-tools/src/read-csharp.c index 8164440fe..4968d7476 100644 --- a/gettext-tools/src/read-csharp.c +++ b/gettext-tools/src/read-csharp.c @@ -1,5 +1,5 @@ /* 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 , 2003. This program is free software; you can redistribute it and/or modify @@ -33,7 +33,7 @@ #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" @@ -73,7 +73,7 @@ execute_and_read_po_output (const char *progname, 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); diff --git a/gettext-tools/src/read-java.c b/gettext-tools/src/read-java.c index ca3a4687c..1f7331c3d 100644 --- a/gettext-tools/src/read-java.c +++ b/gettext-tools/src/read-java.c @@ -1,5 +1,5 @@ /* Reading Java ResourceBundles. - Copyright (C) 2001-2003 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -33,7 +33,7 @@ #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" @@ -71,7 +71,7 @@ execute_and_read_po_output (const char *progname, 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); diff --git a/gettext-tools/src/read-properties.c b/gettext-tools/src/read-properties.c index 755627551..e880f5a84 100644 --- a/gettext-tools/src/read-properties.c +++ b/gettext-tools/src/read-properties.c @@ -33,7 +33,7 @@ #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" @@ -444,9 +444,9 @@ read_escaped_string (bool in_key) /* 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; diff --git a/gettext-tools/src/read-properties.h b/gettext-tools/src/read-properties.h index d5b7987a5..847bdab39 100644 --- a/gettext-tools/src/read-properties.h +++ b/gettext-tools/src/read-properties.h @@ -1,5 +1,5 @@ /* Reading Java .properties files. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2006 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify @@ -19,11 +19,11 @@ #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); diff --git a/gettext-tools/src/read-resources.c b/gettext-tools/src/read-resources.c index 7393191fc..fadae7aaa 100644 --- a/gettext-tools/src/read-resources.c +++ b/gettext-tools/src/read-resources.c @@ -1,5 +1,5 @@ /* Reading C# .resources files. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2006 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify @@ -33,7 +33,7 @@ #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" @@ -74,7 +74,7 @@ execute_and_read_po_output (const char *progname, 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); diff --git a/gettext-tools/src/read-stringtable.c b/gettext-tools/src/read-stringtable.c index 1228f3c7f..135cb1823 100644 --- a/gettext-tools/src/read-stringtable.c +++ b/gettext-tools/src/read-stringtable.c @@ -32,7 +32,7 @@ #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" @@ -826,9 +826,9 @@ read_string (lex_pos_ty *pos) /* 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; diff --git a/gettext-tools/src/read-stringtable.h b/gettext-tools/src/read-stringtable.h index ccf83b637..2c95444ff 100644 --- a/gettext-tools/src/read-stringtable.h +++ b/gettext-tools/src/read-stringtable.h @@ -1,5 +1,5 @@ /* Reading NeXTstep/GNUstep .strings files. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2006 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify @@ -19,11 +19,11 @@ #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); diff --git a/gettext-tools/src/read-tcl.c b/gettext-tools/src/read-tcl.c index f101570b7..d1e70dee4 100644 --- a/gettext-tools/src/read-tcl.c +++ b/gettext-tools/src/read-tcl.c @@ -1,5 +1,5 @@ /* 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 , 2002. This program is free software; you can redistribute it and/or modify @@ -34,7 +34,7 @@ #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" @@ -111,7 +111,7 @@ msgdomain_read_tcl (const char *locale_name, const char *directory) 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); diff --git a/gettext-tools/src/x-po.c b/gettext-tools/src/x-po.c index 5db3af3f5..c4e6eabf6 100644 --- a/gettext-tools/src/x-po.c +++ b/gettext-tools/src/x-po.c @@ -32,7 +32,7 @@ #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" @@ -43,10 +43,10 @@ /* 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, @@ -116,10 +116,10 @@ extract_add_message (default_po_reader_ty *this, 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, @@ -143,11 +143,11 @@ extract (FILE *fp, 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; @@ -155,9 +155,9 @@ extract (FILE *fp, 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) { diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c index ac0a46f33..dbcfcf593 100644 --- a/gettext-tools/src/xgettext.c +++ b/gettext-tools/src/xgettext.c @@ -51,8 +51,8 @@ #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" @@ -900,7 +900,7 @@ Informative output:\n")); 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")); @@ -908,7 +908,7 @@ exclude_directive_domain (abstract_po_reader_ty *pop, char *name) 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, @@ -947,9 +947,9 @@ exclude_directive_message (abstract_po_reader_ty *pop, 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 */ @@ -967,12 +967,12 @@ static void 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); diff --git a/gettext-tools/src/xgettext.h b/gettext-tools/src/xgettext.h index f95b70881..3ef721d04 100644 --- a/gettext-tools/src/xgettext.h +++ b/gettext-tools/src/xgettext.h @@ -33,7 +33,7 @@ #include "str-list.h" /* Declare 'line_comment' and 'input_syntax'. */ -#include "read-po.h" +#include "read-catalog.h" #ifdef __cplusplus -- 2.47.2