]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
doc: Update po_message_t API (III)
authorMiguel Ángel Arruga Vivas <rosen644835@gmail.com>
Mon, 6 May 2019 14:19:26 +0000 (16:19 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 26 Jul 2020 16:36:38 +0000 (18:36 +0200)
* gettext-tools/doc/gettext.texi (po_message_t API): Add
po_message_set_msgctxt, po_message_set_msgid,
po_message_set_msgid_plural, po_message_set_msgstr,
po_message_set_msgstr_plural, po_message_set_comments, and
po_message_set_extracted_comments documentation.

gettext-tools/doc/gettext.texi

index 95f69b45df3ea030562e834f4eb00283b3a8f172..5de247b4f84059b51b568cbe9e79e5121a444803 100644 (file)
@@ -5539,7 +5539,7 @@ into a file to manage its memory, as there is no @code{po_message_free}
 available to the user of the library.
 @end deftypefun
 
-The following functions returns details of a @code{po_message_t}.  Recall
+The following functions access details of a @code{po_message_t}.  Recall
 that the results are valid as long as the @var{file} handle is valid.
 
 @deftypefun {const char *} po_message_msgctxt (po_message_t @var{message})
@@ -5548,39 +5548,92 @@ context of the message.  Return @code{NULL} for a message not restricted
 to a context.
 @end deftypefun
 
+@deftypefun {void} po_message_set_msgctxt (po_message_t @var{message},@
+                   const char *@var{msgctxt})
+The @code{po_message_set_msgctxt} function changes the @code{msgctxt},
+the context of the message, to the value provided through
+@var{msgctxt}. The value @code{NULL} removes the restriction.
+@end deftypefun
+
 @deftypefun {const char *} po_message_msgid (po_message_t @var{message})
 The @code{po_message_msgid} function returns the @code{msgid} (untranslated
 English string) of a message.  This is guaranteed to be non-@code{NULL}.
 @end deftypefun
 
+@deftypefun {void} po_message_set_msgid (po_message_t @var{message},@
+                   const char *@var{msgid})
+The @code{po_message_set_msgid} function changes the @code{msgid}
+(untranslated English string) of a message to the value provided through
+@var{msgid}, a non-@code{NULL} string.
+@end deftypefun
+
 @deftypefun {const char *} po_message_msgid_plural (po_message_t @var{message})
 The @code{po_message_msgid_plural} function returns the @code{msgid_plural}
 (untranslated English plural string) of a message with plurals, or @code{NULL}
 for a message without plural.
 @end deftypefun
 
+@deftypefun {void} po_message_set_msgid_plural (po_message_t @var{message},@
+                   const char *@var{msgid_plural})
+The @code{po_message_set_msgid_plural} function changes the
+@code{msgid_plural} (untranslated English plural string) of a message to
+the value provided through @var{msgid_plural}, or removes the plurals if
+@code{NULL} is provided as @var{msgid_plural}.
+@end deftypefun
+
 @deftypefun {const char *} po_message_msgstr (po_message_t @var{message})
 The @code{po_message_msgstr} function returns the @code{msgstr} (translation)
 of a message.  For an untranslated message, the return value is an empty
 string.
 @end deftypefun
 
+@deftypefun {void} po_message_set_msgstr (po_message_t @var{message},@
+                   const char *@var{msgstr})
+The @code{po_message_set_msgstr} function changes the @code{msgstr}
+(translation) of a message to the value provided through @var{msgstr}, a
+non-@code{NULL} string.
+@end deftypefun
+
 @deftypefun {const char *} po_message_msgstr_plural (po_message_t @var{message}, int @var{index})
 The @code{po_message_msgstr_plural} function returns the
 @code{msgstr[@var{index}]} of a message with plurals, or @code{NULL} when
 the @var{index} is out of range or for a message without plural.
 @end deftypefun
 
+@deftypefun {void} po_message_set_msgstr_plural (po_message_t @var{message},@
+                   int @var{index}, const char *@var{msgstr_plural})
+The @code{po_message_set_msgstr_plural} function changes the
+@code{msgstr[@var{index}]} of a message with plurals to the value
+provided through @var{msgstr_plural}.  @var{message} must be a message
+with plurals.  Use @code{NULL} as the value of @var{msgstr_plural} with
+@var{index} pointing to the last element to reduce the number of plural
+forms.
+@end deftypefun
+
 @deftypefun {const char *} po_message_comments (po_message_t @var{message})
 The @code{po_message_comments} function returns the comments of a message,
 a multiline string, ending in a newline, or a non-@code{NULL} empty string.
 @end deftypefun
 
+@deftypefun {void} po_message_set_comments (po_message_t @var{message},@
+                   const char *@var{comments})
+The @code{po_message_set_comments} function changes the comments of a
+message to the value @var{comments}, a multiline string, ending in a
+newline, or a non-@code{NULL} empty string.
+@end deftypefun
+
 @deftypefun {const char *} po_message_extracted_comments (po_message_t @var{message})
 The @code{po_message_extracted_comments} function returns the extracted comments of a message,
 a multiline string, ending in a newline, or a non-@code{NULL} empty string.
 @end deftypefun
 
+@deftypefun {void} po_message_set_extracted_comments (po_message_t @var{message},@
+                   const char *@var{extracted_comments})
+The @code{po_message_set_extracted_comments} function changes the
+comments of a message to the value @var{extracted_comments}, a multiline
+string, ending in a newline, or a non-@code{NULL} empty string.
+@end deftypefun
+
 @node Binaries
 @chapter Producing Binary MO Files