Next: , Previous: , Up: Writing your own programs that process PO files   [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_create function 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_read function 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 until po_file_free is called on it. In case of error, the functions from handler are called to signal it.

This function is exported as ‘po_file_read_v3’ at ABI level, but is defined as po_file_read in 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_write function writes the contents of the memory structure file the filename given. The return value is file after a successful operation. In case of error, the functions from handler are called to signal it.

This function is exported as ‘po_file_write_v2’ at ABI level, but is defined as po_file_write in C code after the inclusion of ‘<gettext-po.h>’.

Function: void po_file_free (po_file_t file)

The po_file_free function 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_domains function returns the domains for which the given PO file has messages. The return value is a NULL terminated array which is valid as long as the file handle 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: Writing your own programs that process PO files   [Contents][Index]