GNU gettext utilities: po_message_t API
From Get docs
Gettext/docs/latest/po 005fmessage 005ft-API
Next: PO Header Entry API, Previous: po_message_iterator_t API, Up: libgettextpo [Contents][Index]
9.13.4 po_message_t API
- Data Type
- po_message_t
- This is a pointer type that refers to a message of a PO file, including its translation.
- Function
- po_message_t po_message_create (void)
- Returns a freshly constructed message. To finish initializing the message, you must set the
msgidandmsgstr. It must be inserted into a file to manage its memory, as there is nopo_message_freeavailable to the user of the library.
The following functions access details of a po_message_t. Recall that the results are valid as long as the file handle is valid.
- Function
- const char * po_message_msgctxt (po_message_t message)
- The
po_message_msgctxtfunction returns themsgctxt, the context ofmessage. ReturnsNULLfor a message not restricted to a context.
- Function
- void po_message_set_msgctxt (po_message_t message, const char *msgctxt)
- The
po_message_set_msgctxtfunction changes themsgctxt, the context of the message, to the value provided throughmsgctxt. The valueNULLremoves the restriction.
- Function
- const char * po_message_msgid (po_message_t message)
- The
po_message_msgidfunction returns themsgid(untranslated English string) ofmessage. This is guaranteed to be non-NULL.
- Function
- void po_message_set_msgid (po_message_t message, const char *msgid)
- The
po_message_set_msgidfunction changes themsgid(untranslated English string) ofmessageto the value provided throughmsgid, a non-NULLstring.
- Function
- const char * po_message_msgid_plural (po_message_t message)
- The
po_message_msgid_pluralfunction returns themsgid_plural(untranslated English plural string) ofmessage, a message with plurals, orNULLfor a message without plural.
- Function
- void po_message_set_msgid_plural (po_message_t message, const char *msgid_plural)
- The
po_message_set_msgid_pluralfunction changes themsgid_plural(untranslated English plural string) of a message to the value provided throughmsgid_plural, or removes the plurals ifNULLis provided asmsgid_plural.
- Function
- const char * po_message_msgstr (po_message_t message)
- The
po_message_msgstrfunction returns themsgstr(translation) ofmessage. For an untranslated message, the return value is an empty string.
- Function
- void po_message_set_msgstr (po_message_t message, const char *msgstr)
- The
po_message_set_msgstrfunction changes themsgstr(translation) ofmessageto the value provided throughmsgstr, a non-NULLstring.
- Function
- const char * po_message_msgstr_plural (po_message_t message, int index)
- The
po_message_msgstr_pluralfunction returns themsgstr[index]ofmessage, a message with plurals, orNULLwhen theindexis out of range or for a message without plural.
- Function
- void po_message_set_msgstr_plural (po_message_t message, int index, const char *msgstr_plural)
- The
po_message_set_msgstr_pluralfunction changes themsgstr[index]ofmessage, a message with plurals, to the value provided throughmsgstr_plural.messagemust be a message with plurals. UseNULLas the value ofmsgstr_pluralwithindexpointing to the last element to reduce the number of plural forms.
- Function
- const char * po_message_comments (po_message_t message)
- The
po_message_commentsfunction returns the comments ofmessage, a multiline string, ending in a newline, or a non-NULLempty string.
- Function
- void po_message_set_comments (po_message_t message, const char *comments)
- The
po_message_set_commentsfunction changes the comments ofmessageto the valuecomments, a multiline string, ending in a newline, or a non-NULLempty string.
- Function
- const char * po_message_extracted_comments (po_message_t message)
- The
po_message_extracted_commentsfunction returns the extracted comments ofmessage, a multiline string, ending in a newline, or a non-NULLempty string.
- Function
- void po_message_set_extracted_comments (po_message_t message, const char *extracted_comments)
- The
po_message_set_extracted_commentsfunction changes the comments ofmessageto the valueextracted_comments, a multiline string, ending in a newline, or a non-NULLempty string.
- Function
- const char * po_message_prev_msgctxt (po_message_t message)
- The
po_message_prev_msgctxtfunction returns the previousmsgctxt, the previous context ofmessage. ReturnNULLfor a message that does not have a previous context.
- Function
- void po_message_set_prev_msgctxt (po_message_t message, const char *prev_msgctxt)
- The
po_message_set_prev_msgctxtfunction changes the previousmsgctxt, the context of the message, to the value provided throughprev_msgctxt. The valueNULLremoves the stored previous msgctxt.
- Function
- const char * po_message_prev_msgid (po_message_t message)
- The
po_message_prev_msgidfunction returns the previousmsgid(untranslated English string) ofmessage, orNULLif there is no previousmsgidstored.
- Function
- void po_message_set_prev_msgid (po_message_t message, const char *prev_msgid)
- The
po_message_set_prev_msgidfunction changes the previousmsgid(untranslated English string) ofmessageto the value provided throughprev_msgid, or removes the message when it isNULL.
- Function
- const char * po_message_prev_msgid_plural (po_message_t message)
- The
po_message_prev_msgid_pluralfunction returns the previousmsgid_plural(untranslated English plural string) ofmessage, a message with plurals, orNULLfor a message without plural without any stored previousmsgid_plural.
- Function
- void po_message_set_prev_msgid_plural (po_message_t message, const char *prev_msgid_plural)
- The
po_message_set_prev_msgid_pluralfunction changes the previousmsgid_plural(untranslated English plural string) of a message to the value provided throughprev_msgid_plural, or removes the stored previousmsgid_pluralifNULLis provided asprev_msgid_plural.
- Function
- int po_message_is_obsolete (po_message_t message)
- The
po_message_is_obsoletefunction returns true whenmessageis marked as obsolete.
- Function
- void po_message_set_obsolete (po_message_t message, int obsolete)
- The
po_message_set_obsoletefunction changes the obsolete mark ofmessage.
- Function
- int po_message_is_fuzzy (po_message_t message)
- The
po_message_is_fuzzyfunction returns true whenmessageis marked as fuzzy.
- Function
- void po_message_set_fuzzy (po_message_t message, int fuzzy)
- The
po_message_set_fuzzyfunction changes the fuzzy mark ofmessage.
- Function
- int po_message_is_format (po_message_t message, const char *format_type)
- The
po_message_is_formatfunction returns true when the message is marked as being a format string offormat_type.
- Function
- void po_message_set_format (po_message_t message, const char *format_type, int value)
- The
po_message_set_fuzzyfunction changes the format mark of the message for theformat_typeprovided.
- Function
- int po_message_is_range (po_message_t message, int *minp, int *maxp)
- The
po_message_is_rangefunction returns true when the message has a numeric range set, and stores the minimum and maximum value in the locations pointed byminpandmaxprespectively.
- Function
- void po_message_set_range (po_message_t message, int min, int max)
- The
po_message_set_rangefunction changes the numeric range of the message.minandmaxmust be non-negative, withmin<max. Useminandmaxwith value-1to remove the numeric range ofmessage.
Next: PO Header Entry API, Previous: po_message_iterator_t API, Up: libgettextpo [Contents][Index]