]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
doc: Add Checking API
authorMiguel Ángel Arruga Vivas <rosen644835@gmail.com>
Tue, 7 May 2019 18:27:53 +0000 (20:27 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 26 Jul 2020 16:36:54 +0000 (18:36 +0200)
* 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

index b9625516e564b4089a1b91ec0d3b8297c8586d11..77c5be8da424acb35acf7733f4805c833a4bc77c 100644 (file)
@@ -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{<gettext-po.h>}.
+@end deftypefun
+
 @node Binaries
 @chapter Producing Binary MO Files