1 /* GNU gettext - internationalization aids
2 Copyright (C) 1995-1998, 2000-2003, 2006, 2008, 2014, 2018-2019, 2021, 2023 Free Software Foundation, Inc.
3
4 This file was written by Peter Miller <millerp@canb.auug.org.au>
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <https://www.gnu.org/licenses/>. */
18
19 #ifndef _WRITE_PO_H
20 #define _WRITE_PO_H
21
22 #include <stdbool.h>
23
24 #include <textstyle.h>
25
26 #include "attribute.h"
27 #include "message.h"
28
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34
35 enum filepos_comment_type
36 {
37 filepos_comment_none,
38 filepos_comment_full,
39 filepos_comment_file
40 };
41
42 /* These functions are used to output a #, flags line. */
43 extern const char *
44 make_format_description_string (enum is_format is_format,
45 const char *lang, bool debug);
46 extern bool
47 significant_format_p (enum is_format is_format);
48
49 extern char *
50 make_range_description_string (struct argument_range range)
51 ATTRIBUTE_MALLOC;
52
53 /* These functions output parts of a message, as comments. */
54 extern void
55 message_print_comment (const message_ty *mp, ostream_t stream);
56 extern void
57 message_print_comment_dot (const message_ty *mp, ostream_t stream);
58 extern void
59 message_print_comment_filepos (const message_ty *mp, ostream_t stream,
60 const char *charset, bool uniforum,
61 size_t page_width);
62 extern void
63 message_print_comment_flags (const message_ty *mp, ostream_t stream,
64 bool debug);
65
66 /* These functions set some parameters for use by 'output_format_po.print'. */
67 extern void
68 message_page_width_ignore (void);
69 extern void
70 message_print_style_indent (void);
71 extern void
72 message_print_style_uniforum (void);
73 extern void
74 message_print_style_escape (bool flag);
75 extern void
76 message_print_style_comment (bool flag);
77 extern void
78 message_print_style_filepos (enum filepos_comment_type type);
79
80 /* --add-location argument handling. Return an error indicator. */
81 extern bool handle_filepos_comment_option (const char *option);
82
83
84 /* Describes a PO file in .po syntax. */
85 extern DLL_VARIABLE const struct catalog_output_format output_format_po;
86
87
88 #ifdef __cplusplus
89 }
90 #endif
91
92
93 #endif /* _WRITE_PO_H */