GNU gettext utilities: po_file_t API
Next: po_message_iterator_t API, Previous: Error Handling, Up: libgettextpo [Contents][Index]
9.13.2 po_file_t API
- Data Type
- po_file_t
- This is a pointer type that refers to the contents of a PO file, after it has been read into memory.
- Function
- po_file_t po_file_create ()
- The
po_file_createfunction creates an empty PO file representation in memory.
- Function: po_file_t po_file_read (const char *filename, struct po_xerror_handler *handler)
The
po_file_readfunction reads a PO file into memory. The file name is given as argument. The return value is a handle to the PO file’s contents, valid untilpo_file_freeis called on it. In case of error, the functions fromhandlerare called to signal it.This function is exported as ‘
po_file_read_v3’ at ABI level, but is defined aspo_file_readin C code after the inclusion of ‘<gettext-po.h>’.
- Function: po_file_t po_file_write (po_file_t file, const char *filename, struct po_xerror_handler *handler)
The
po_file_writefunction writes the contents of the memory structurefilethefilenamegiven. The return value isfileafter a successful operation. In case of error, the functions fromhandlerare called to signal it.This function is exported as ‘
po_file_write_v2’ at ABI level, but is defined aspo_file_writein C code after the inclusion of ‘<gettext-po.h>’.
- Function
- void po_file_free (po_file_t file)
- The
po_file_freefunction frees a PO file’s contents from memory, including all messages that are only implicitly accessible through iterators.
- Function
- const char * const * po_file_domains (po_file_t file)
- The
po_file_domainsfunction returns the domains for which the given PO file has messages. The return value is aNULLterminated array which is valid as long as thefilehandle is valid. For PO files which contain no ‘domain’ directive, the return value contains only one domain, namely the default domain"messages".
Next: po_message_iterator_t API, Previous: Error Handling, Up: libgettextpo [Contents][Index]