From: Bruno Haible Date: Sun, 28 Jul 2024 11:24:29 +0000 (+0200) Subject: Refactor. X-Git-Tag: v0.23~217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d65b86bfffe6d40b68c12a801e31702b0a67ae2c;p=thirdparty%2Fgettext.git Refactor. * gettext-tools/src/read-catalog-abstract.h (abstract_catalog_reader_class_ty::comment_filepos): Change parameter names. (po_callback_comment_filepos): Likewise. * gettext-tools/src/read-catalog-abstract.c (call_comment_filepos, po_callback_comment_filepos): Likewise. * gettext-tools/src/read-catalog.h (default_comment_filepos): Likewise. * gettext-tools/src/read-catalog.c (default_comment_filepos): Likewise. --- diff --git a/gettext-tools/src/read-catalog-abstract.c b/gettext-tools/src/read-catalog-abstract.c index 4e6901f12..3b1c12d91 100644 --- a/gettext-tools/src/read-catalog-abstract.c +++ b/gettext-tools/src/read-catalog-abstract.c @@ -129,11 +129,11 @@ call_comment_dot (abstract_catalog_reader_ty *pop, const char *s) } static inline void -call_comment_filepos (abstract_catalog_reader_ty *pop, const char *name, - size_t line) +call_comment_filepos (abstract_catalog_reader_ty *pop, + const char *file_name, size_t line_number) { if (pop->methods->comment_filepos) - pop->methods->comment_filepos (pop, name, line); + pop->methods->comment_filepos (pop, file_name, line_number); } static inline void @@ -243,12 +243,12 @@ po_callback_comment_dot (const char *s) /* This function is called by po_parse_comment_filepos(), once for each - filename. */ + file name. */ void -po_callback_comment_filepos (const char *name, size_t line) +po_callback_comment_filepos (const char *file_name, size_t line_number) { /* assert(callback_arg); */ - call_comment_filepos (callback_arg, name, line); + call_comment_filepos (callback_arg, file_name, line_number); } diff --git a/gettext-tools/src/read-catalog-abstract.h b/gettext-tools/src/read-catalog-abstract.h index 91d487c7c..282dcb155 100644 --- a/gettext-tools/src/read-catalog-abstract.h +++ b/gettext-tools/src/read-catalog-abstract.h @@ -1,5 +1,5 @@ /* Reading PO files, abstract class. - Copyright (C) 1995-1996, 1998, 2000-2003, 2005-2006, 2008-2009, 2012, 2015, 2023 Free Software Foundation, Inc. + Copyright (C) 1995-2024 Free Software Foundation, Inc. This file was written by Peter Miller @@ -89,7 +89,7 @@ struct abstract_catalog_reader_class_ty definition seen. Or completely ignored. */ 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 + /* 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. */ @@ -100,7 +100,7 @@ struct abstract_catalog_reader_class_ty they will be accumulated, and added to the next message definition seen. Or completely ignored. */ void (*comment_filepos) (struct abstract_catalog_reader_ty *pop, - const char *s, size_t line); + const char *file_name, size_t line_number); /* 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 @@ -177,7 +177,8 @@ extern void po_callback_message (char *msgctxt, bool force_fuzzy, bool obsolete); extern void po_callback_comment (const char *s); extern void po_callback_comment_dot (const char *s); -extern void po_callback_comment_filepos (const char *s, size_t line); +extern void po_callback_comment_filepos (const char *file_name, + size_t line_number); extern void po_callback_comment_special (const char *s); extern void po_callback_comment_dispatcher (const char *s); diff --git a/gettext-tools/src/read-catalog.c b/gettext-tools/src/read-catalog.c index 3ae2d702c..10bf97762 100644 --- a/gettext-tools/src/read-catalog.c +++ b/gettext-tools/src/read-catalog.c @@ -1,5 +1,5 @@ /* Reading PO files. - Copyright (C) 1995-1998, 2000-2003, 2005-2006, 2008-2009, 2014-2016, 2023 Free Software Foundation, Inc. + Copyright (C) 1995-2024 Free Software Foundation, Inc. This file was written by Peter Miller This program is free software: you can redistribute it and/or modify @@ -283,7 +283,7 @@ default_comment_dot (abstract_catalog_reader_ty *that, const char *s) void default_comment_filepos (abstract_catalog_reader_ty *that, - const char *name, size_t line) + const char *file_name, size_t line_number) { default_catalog_reader_ty *this = (default_catalog_reader_ty *) that; size_t nbytes; @@ -292,8 +292,8 @@ default_comment_filepos (abstract_catalog_reader_ty *that, nbytes = (this->filepos_count + 1) * sizeof (this->filepos[0]); this->filepos = xrealloc (this->filepos, nbytes); pp = &this->filepos[this->filepos_count++]; - pp->file_name = xstrdup (name); - pp->line_number = line; + pp->file_name = xstrdup (file_name); + pp->line_number = line_number; } diff --git a/gettext-tools/src/read-catalog.h b/gettext-tools/src/read-catalog.h index 238524f0d..97358dc94 100644 --- a/gettext-tools/src/read-catalog.h +++ b/gettext-tools/src/read-catalog.h @@ -1,5 +1,5 @@ /* Reading PO files. - Copyright (C) 1995-2023 Free Software Foundation, Inc. + Copyright (C) 1995-2024 Free Software Foundation, Inc. This file was written by Bruno Haible . This program is free software: you can redistribute it and/or modify @@ -142,7 +142,7 @@ 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); + const char *file_name, size_t line_number); extern void default_comment_special (abstract_catalog_reader_ty *that, const char *s); extern void default_set_domain (default_catalog_reader_ty *this, char *name);