>From 31b713a624408407e88258af6c8e16a7604323d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Sun, 5 May 2019 20:02:26 +0200 Subject: [PATCH 04/15] doc: Add po_file_write documentation * gettext-tools/doc/gettext.texi (libgettextpo): Add po_file_write documentation. * gettext-tools/doc/gettext-po.in.h (po_file_write): Update comment. --- gettext-tools/doc/gettext.texi | 15 ++++++++++++++- gettext-tools/libgettextpo/gettext-po.in.h | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gettext-tools/doc/gettext.texi b/gettext-tools/doc/gettext.texi index e7d58488f..b53d2397d 100644 --- a/gettext-tools/doc/gettext.texi +++ b/gettext-tools/doc/gettext.texi @@ -5267,7 +5267,8 @@ is not sufficient, a set of C functions is provided in a library, to make it possible to process PO files in your own programs. When you use this library, you don't need to write routines to parse the PO file; instead, you retrieve a pointer in memory to each of messages contained in the PO file. Functions -for writing PO files are not provided at this time. +for writing those memory structures to a file after working with them are +provided too. The functions are declared in the header file @samp{}, and are defined in a library called @samp{libgettextpo}. @@ -5356,6 +5357,18 @@ defined as @code{po_file_read} in C code after the inclusion of @samp{}. @end deftypefun address@hidden po_file_t po_file_write (po_file_t @var{file},@ + const char address@hidden, struct po_xerror_handler address@hidden) +The @code{po_file_write} function writes the contents of the memory +structure @var{file} the @var{filename} given. The return value is address@hidden after a successful operation. In case of error, the +functions from @var{handler} are called to signal it. + +This function is exported as @samp{po_file_write_v2} at ABI level, but +it defined as @code{po_file_write} in C code after the inclusion of address@hidden}. address@hidden deftypefun + @deftypefun void po_file_free (po_file_t @var{file}) The @code{po_file_free} function frees a PO file's contents from memory, including all messages that are only implicitly accessible through iterators. diff --git a/gettext-tools/libgettextpo/gettext-po.in.h b/gettext-tools/libgettextpo/gettext-po.in.h index ec619fbbe..1f2dcba05 100644 --- a/gettext-tools/libgettextpo/gettext-po.in.h +++ b/gettext-tools/libgettextpo/gettext-po.in.h @@ -137,7 +137,7 @@ extern po_file_t po_file_read (const char *filename, po_xerror_handler_t handler); /* Write an in-memory PO file to a file. - Upon failure, return NULL and set errno. */ + Upon failure, call function from handler. */ #define po_file_write po_file_write_v2 extern po_file_t po_file_write (po_file_t file, const char *filename, po_xerror_handler_t handler); -- 2.21.0