+2005-02-10 Bruno Haible <bruno@clisp.org>
+
+ * windows/gettextpo.def: Add po_message_remove_filepos,
+ po_message_add_filepos.
+
2005-02-10 Bruno Haible <bruno@clisp.org>
* windows/gettextpo.def: Add po_message_set_extracted_comments.
+2005-02-10 Bruno Haible <bruno@clisp.org>
+
+ * gettext-po.h (po_message_remove_filepos, po_message_add_filepos): New
+ declarations.
+ * gettext-po.c (po_message_remove_filepos, po_message_add_filepos): New
+ functions.
+ Suggested by Asgeir Frimannsson <asgeirf@redhat.com>.
+
2005-02-10 Bruno Haible <bruno@clisp.org>
* gettext-po.h (po_message_set_extracted_comments): New declaration.
}
+/* Remove the i-th file position from a message.
+ The indices of all following file positions for the message are decremented
+ by one. */
+
+void
+po_message_remove_filepos (po_message_t message, int i)
+{
+ message_ty *mp = (message_ty *) message;
+
+ if (i >= 0)
+ {
+ size_t j = (size_t)i;
+ size_t n = mp->filepos_count;
+
+ if (j < n)
+ {
+ mp->filepos_count = n = n - 1;
+ free ((char *) mp->filepos[j].file_name);
+ for (; j < n; j++)
+ mp->filepos[j] = mp->filepos[j + 1];
+ }
+ }
+}
+
+
+/* Add a file position to a message, if it is not already present for the
+ message.
+ file is the file name.
+ start_line is the line number where the string starts, or (size_t)(-1) if no
+ line number is available. */
+
+void
+po_message_add_filepos (po_message_t message, const char *file, size_t start_line)
+{
+ message_ty *mp = (message_ty *) message;
+
+ message_comment_filepos (mp, file, start_line);
+}
+
+
/* Return true if the message is marked obsolete. */
int
range. */
extern po_filepos_t po_message_filepos (po_message_t message, int i);
+/* Remove the i-th file position from a message.
+ The indices of all following file positions for the message are decremented
+ by one. */
+extern void po_message_remove_filepos (po_message_t message, int i);
+
+/* Add a file position to a message, if it is not already present for the
+ message.
+ file is the file name.
+ start_line is the line number where the string starts, or (size_t)(-1) if no
+ line number is available. */
+extern void po_message_add_filepos (po_message_t message, const char *file, size_t start_line);
+
/* Return true if the message is marked obsolete. */
extern int po_message_is_obsolete (po_message_t message);
po_filepos_file
po_filepos_start_line
po_header_field
+po_message_add_filepos
po_message_check_format
po_message_comments
po_message_create
po_message_msgid_plural
po_message_msgstr
po_message_msgstr_plural
+po_message_remove_filepos
po_message_set_comments
po_message_set_extracted_comments
po_message_set_format