-Version 0.23 - October 2024
+Version 0.23 - November 2024
* Programming languages support:
- XML:
* libgettextpo library:
- This library is now multithread-safe.
+ - The function 'po_message_set_format' now supports resetting a format string
+ mark.
Version 0.22.5 - February 2024
@end deftypefun
@deftypefun {void} po_message_set_format (po_message_t@tie{}@var{message}, const@tie{}char@tie{}*@var{format_type}, int@tie{}@var{value})
-The @code{po_message_set_fuzzy} function changes the format mark of
-the message for the @var{format_type} provided.
+The @code{po_message_set_format} function changes
+the format string mark of the message for the @var{format_type} provided.
+Pass @var{value} = 1
+to assert the format string mark (leading to e.g. @samp{c-format}),
+@var{value} = 0
+to assert the opposite (leading to e.g. @samp{no-c-format}),
+or @var{value} = -1
+to remove the format string mark and its opposite.
@end deftypefun
@deftypefun {int} po_message_is_range (po_message_t@tie{}@var{message}, int@tie{}*@var{minp}, int@tie{}*@var{maxp})
/* Change the format string mark for a given type of a message. */
void
-po_message_set_format (po_message_t message, const char *format_type, /*bool*/int value)
+po_message_set_format (po_message_t message, const char *format_type, int value)
{
message_ty *mp = (message_ty *) message;
size_t len = strlen (format_type);
if (strlen (format_language[i]) == len - 7
&& memcmp (format_language[i], format_type, len - 7) == 0)
/* The given format_type corresponds to (enum format_type) i. */
- mp->is_format[i] = (value ? yes : no);
+ mp->is_format[i] = (value >= 0 ? (value ? yes : no) : undecided);
}
type (e.g. "c-format"). */
extern int po_message_is_format (po_message_t message, const char *format_type);
-/* Change the format string mark for a given type of a message. */
-extern void po_message_set_format (po_message_t message, const char *format_type, /*bool*/int value);
+/* Change the format string mark for a given type of a message.
+ Pass value = 1 to assert the format string mark (e.g. "c-format"),
+ value = 0 to assert the opposite (leading to e.g. "no-c-format"),
+ or value = -1 to remove the format string mark and its opposite. */
+extern void po_message_set_format (po_message_t message, const char *format_type, int value);
/* If a numeric range of a message is set, return true and store the minimum
and maximum value in *MINP and *MAXP. */