>From d019f985704a8ea7eeb4710cd95f083839fd0dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Tue, 7 May 2019 20:27:53 +0200 Subject: [PATCH 17/17] 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. --- gettext-tools/doc/gettext.texi | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/gettext-tools/doc/gettext.texi b/gettext-tools/doc/gettext.texi index e57c9939b..12da03b8f 100644 --- a/gettext-tools/doc/gettext.texi +++ b/gettext-tools/doc/gettext.texi @@ -5324,6 +5324,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 @@ -5791,6 +5792,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 address@hidden Checking API address@hidden Checking API + address@hidden {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}. address@hidden deftypefun + address@hidden {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 address@hidden @var{iterator} is not modified by this call; it only +specifies the file and the domain. address@hidden deftypefun + address@hidden {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{}. address@hidden deftypefun + @node Binaries @chapter Producing Binary MO Files -- 2.21.0