doc: Add Header Entry API

* gettext-tools/doc/gettext.texi (PO Header Entry API): New
subsection.  Add po_file_domain_header, po_header_field and
po_header_set_field documentation.
(libgettextpo): Add subsection to the menu.
This commit is contained in:
Miguel Ángel Arruga Vivas
2019-05-06 16:27:09 +02:00
committed by Bruno Haible
parent d306ad390d
commit 70abc2219f
+30
View File
@@ -5336,6 +5336,7 @@ defined in a library called @samp{libgettextpo}.
* po_file_t API:: File management
* po_message_iterator_t API:: Message iteration
* po_message_t API:: The basic units of the file
* PO Header Entry API:: Meta information of the file
@end menu
The following example shows code how these functions can be used. Error
@@ -5634,6 +5635,35 @@ 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 PO Header Entry API
@subsection PO Header Entry API
The following functions provide an interface to extract and manipulate
the header entry (@pxref{Header Entry}) from a file loaded in memory.
The meta information must be written back into the domain message with
the empty string as msgid.
@deftypefun {const char *} po_file_domain_header (po_file_t @var{file},@
const char *@var{domain})
Return the header entry of a domain from @var{file}, a PO file loaded in
memory. The value @code{NULL} provided as @var{domain} denotes the
default domain. Return @code{NULL} if there is no header entry.
@end deftypefun
@deftypefun {char *} po_header_field (const char *@var{header},@
const char *@var{field})
Return the value of @var{field} in the @var{header} entry. The return
value is either a freshly allocated string, to be freed by the caller,
or @code{NULL}.
@end deftypefun
@deftypefun {char *} po_header_set_field (const char *@var{header},@
const char *@var{field}, const char *@var{value})
Return a freshly allocated string which contains the entry from
@var{header} with @var{field} set to @var{value}. The field is added if
necessary.
@end deftypefun
@node Binaries
@chapter Producing Binary MO Files