summaryrefslogtreecommitdiff
path: root/gettext-tools/src/xgettext.h
blob: c6c98da558b52b8a395da3e61b2812d74c8f3860 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/* xgettext common functions.
   Copyright (C) 2001-2003, 2005-2006, 2008-2009, 2011, 2013-2014, 2018, 2020 Free Software Foundation, Inc.
   Written by Peter Miller <millerp@canb.auug.org.au>
   and Bruno Haible <haible@clisp.cons.org>, 2001.

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */

#ifndef _XGETTEXT_H
#define _XGETTEXT_H

#include <stdbool.h>
#include <stddef.h>

#include "message.h"
#include "rc-str-list.h"

#ifdef __cplusplus
extern "C" {
#endif


/* If true, add all comments immediately preceding one of the keywords. */
extern bool add_all_comments;

/* Tag used in comment of prevailing domain.  */
extern char *comment_tag;

/* List of messages whose msgids must not be extracted, or NULL.
   Used by remember_a_message().  */
extern message_list_ty *exclude;

/* String used as prefix for msgstr.  */
extern const char *msgstr_prefix;

/* String used as suffix for msgstr.  */
extern const char *msgstr_suffix;

/* If true, omit the header entry.
   If false, keep the header entry present in the input.  */
extern int xgettext_omit_header;

/* Be more verbose.  */
extern int verbose;

extern enum is_syntax_check default_syntax_check[NSYNTAXCHECKS];

/* Language dependent format string parser.
   NULL if the language has no notion of format strings.  */
extern struct formatstring_parser *current_formatstring_parser1;
extern struct formatstring_parser *current_formatstring_parser2;
extern struct formatstring_parser *current_formatstring_parser3;


/* Record a flag in the appropriate backend's table.  */
extern void xgettext_record_flag (const char *optionstring);


extern const char * xgettext_comment (size_t n);
extern void xgettext_comment_reset (void);

/* Comment handling for backends which support combining adjacent strings
   even across lines.
   In these backends we cannot use the xgettext_comment* functions directly,
   because in multiline string expressions like
           "string1" +
           "string2"
   the newline between "string1" and "string2" would cause a call to
   xgettext_comment_reset(), thus destroying the accumulated comments
   that we need a little later, when we have concatenated the two strings
   and pass them to remember_a_message().
   Instead, we do the bookkeeping of the accumulated comments directly,
   and save a pointer to the accumulated comments when we read "string1".
   In order to avoid excessive copying of strings, we use reference
   counting.  */

extern refcounted_string_list_ty *savable_comment;
extern void savable_comment_add (const char *str);
extern void savable_comment_reset (void);
extern void
       savable_comment_to_xgettext_comment (refcounted_string_list_ty *rslp);


extern bool recognize_qt_formatstrings (void);


#ifdef __cplusplus
}
#endif


#endif /* _XGETTEXT_H */