1 /* GNU gettext - internationalization aids
2 Copyright (C) 1995-1998, 2000-2003, 2006, 2008 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 #ifndef _WRITE_CATALOG_H
18 #define _WRITE_CATALOG_H
31 /* This structure describes a textual catalog output format. */
32 struct catalog_output_format
34 /* Outputs a list of domains of messages to a stream. */
35 void (*print) (msgdomain_list_ty *mdlp, ostream_t stream, size_t page_width, bool debug);
37 /* Whether the print function requires the MDLP to be encoded in UTF-8
41 /* Whether the print function supports styled output. */
44 /* Whether the format supports multiple domains in a single file. */
45 bool supports_multiple_domains;
47 /* Whether the format supports contexts. */
48 bool supports_contexts;
50 /* Whether the format supports plurals. */
51 bool supports_plurals;
53 /* Whether the formats sorts obsolete messages at the end. */
54 bool sorts_obsoletes_to_end;
56 /* Whether the PO file format is a suitable alternative output format for
58 bool alternative_is_po;
60 /* Whether a Java class is a suitable alternative output format for this
62 bool alternative_is_java_class;
65 typedef const struct catalog_output_format * catalog_output_format_ty;
67 /* These functions set some parameters for use by 'msgdomain_list_print'. */
69 message_page_width_set (size_t width);
71 /* Output MDLP into a PO file with the given FILENAME, according to the
72 parameters set by the functions above. */
74 msgdomain_list_print (msgdomain_list_ty *mdlp,
76 catalog_output_format_ty output_syntax,
77 bool force, bool debug);
79 /* Sort MDLP destructively according to the given criterion. */
81 msgdomain_list_sort_by_msgid (msgdomain_list_ty *mdlp);
83 msgdomain_list_sort_by_filepos (msgdomain_list_ty *mdlp);
91 #endif /* _WRITE_CATALOG_H */