+2008-10-04 Bruno Haible <bruno@clisp.org>
+
+ * gettext-po.h.in (po_message_is_range, po_message_set_range): New
+ declarations.
+ * gettext-po.c (po_message_is_range, po_message_set_range): New
+ functions.
+
2008-10-03 Bruno Haible <bruno@clisp.org>
* gettext-po.c (po_message_check_format): Update for signature changes
}
+/* If a numeric range of a message is set, return true and store the minimum
+ and maximum value in *MINP and *MAXP. */
+
+int
+po_message_is_range (po_message_t message, int *minp, int *maxp)
+{
+ message_ty *mp = (message_ty *) message;
+
+ if (has_range_p (mp->range))
+ {
+ *minp = mp->range.min;
+ *minp = mp->range.max;
+ return 1;
+ }
+ else
+ return 0;
+}
+
+
+/* Change the numeric range of a message. MIN and MAX must be non-negative,
+ with MIN < MAX. Use MIN = MAX = -1 to remove the numeric range of a
+ message. */
+
+void
+po_message_set_range (po_message_t message, int min, int max)
+{
+ message_ty *mp = (message_ty *) message;
+
+ if (min >= 0 && max >= min)
+ {
+ mp->range.min = min;
+ mp->range.max = max;
+ }
+ else if (min < 0 && max < 0)
+ {
+ mp->range.min = -1;
+ mp->range.max = -1;
+ }
+ /* Other values of min and max are invalid. */
+}
+
+
/* Return the file name. */
const char *
/* Public API for GNU gettext PO files - contained in libgettextpo.
- Copyright (C) 2003-2007 Free Software Foundation, Inc.
+ Copyright (C) 2003-2008 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
/* 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);
+/* If a numeric range of a message is set, return true and store the minimum
+ and maximum value in *MINP and *MAXP. */
+extern int po_message_is_range (po_message_t message, int *minp, int *maxp);
+
+/* Change the numeric range of a message. MIN and MAX must be non-negative,
+ with MIN < MAX. Use MIN = MAX = -1 to remove the numeric range of a
+ message. */
+extern void po_message_set_range (po_message_t message, int min, int max);
+
/* =========================== po_filepos_t API ============================ */