From: Miguel Ángel Arruga Vivas Date: Tue, 7 May 2019 18:27:53 +0000 (+0200) Subject: doc: Add Checking API X-Git-Tag: v0.21~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00bb9eac569fc20db4ea9e13158f2e481eb9a0a3;p=thirdparty%2Fgettext.git doc: Add Checking API * gettext-tools/doc/gettext.texi (Checking API): New subsection. Add po_file_check_all, po_message_check_all, and po_message_check_format documentation (libgettextpo): Add entry to the menu. --- diff --git a/gettext-tools/doc/gettext.texi b/gettext-tools/doc/gettext.texi index b9625516e..77c5be8da 100644 --- a/gettext-tools/doc/gettext.texi +++ b/gettext-tools/doc/gettext.texi @@ -5339,6 +5339,7 @@ defined in a library called @samp{libgettextpo}. * PO Header Entry API:: Meta information of the file * po_filepos_t API:: References to the sources * Format Type API:: Supported format types +* Checking API:: Enforcing constraints @end menu The following example shows code how these functions can be used. Error @@ -5806,6 +5807,35 @@ it returns ``C#'' when @var{format_type} is ``csharp_format''. Return @code{NULL} if @var{format_type} is not a supported format type. @end deftypefun +@node Checking API +@subsection Checking API + +@deftypefun {void} po_file_check_all (po_file_t @var{file},@ + po_xerror_handler_t @var{handler}) +Test whether the entire @var{file} is valid, like msgfmt does it. If it +is invalid, pass the reasons to @var{handler}. +@end deftypefun + +@deftypefun {void} po_message_check_all (po_message_t @var{message},@ + po_message_iterator_t @var{iterator},@ + po_xerror_handler_t @var{handler}) +Test @var{message}, to be inserted at @var{iterator} in a PO file in memory, +like msgfmt does it. If it is invalid, pass the reasons to +@var{handler}. @var{iterator} is not modified by this call; it only +specifies the file and the domain. +@end deftypefun + +@deftypefun {void} po_message_check_format (po_message_t @var{message},@ + po_xerror_handler_t @var{handler}) +Test whether the message translation from @var{message} is a valid +format string if the message is marked as being a format string. If it +is invalid, pass the reasons to @var{handler}. + +This function is exported as @samp{po_message_check_format_v2} at ABI +level, but it defined as @code{po_message_check_format} in C code after +the inclusion of @samp{}. +@end deftypefun + @node Binaries @chapter Producing Binary MO Files