Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / src / x-c.h
1 /* xgettext C/C++/ObjectiveC backend.
2    Copyright (C) 2001-2003, 2006, 2009, 2015 Free Software Foundation,
3    Inc.
4    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
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 <http://www.gnu.org/licenses/>.  */
18
19
20 #include <stdio.h>
21
22 #include "message.h"
23 #include "xgettext.h"
24
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30
31 #define EXTENSIONS_C \
32   { "c",      "C"     },                                                \
33   { "h",      "C"     },                                                \
34   { "C",      "C++"   },                                                \
35   { "c++",    "C++"   },                                                \
36   { "cc",     "C++"   },                                                \
37   { "cxx",    "C++"   },                                                \
38   { "cpp",    "C++"   },                                                \
39   { "hh",     "C++"   },                                                \
40   { "hxx",    "C++"   },                                                \
41   { "hpp",    "C++"   },                                                \
42   { "m",      "ObjectiveC" },                                           \
43
44 #define SCANNERS_C \
45   { "C",                extract_c,                                      \
46                         &flag_table_c,                                  \
47                         &formatstring_c, NULL,                          \
48                         &literalstring_c },                             \
49   { "C++",              extract_cxx,                                    \
50                         &flag_table_c,                                  \
51                         &formatstring_c, NULL,                          \
52                         &literalstring_c },                             \
53   { "ObjectiveC",       extract_objc,                                   \
54                         &flag_table_objc,                               \
55                         &formatstring_c, &formatstring_objc,            \
56                         &literalstring_c },                             \
57   { "GCC-source",       extract_c,                                      \
58                         &flag_table_gcc_internal,                       \
59                         &formatstring_gcc_internal, &formatstring_gfc_internal, \
60                         &literalstring_c },                             \
61
62 /* Scan a C file and add its translatable strings to mdlp.  */
63 extern void extract_c (FILE *fp, const char *real_filename,
64                        const char *logical_filename,
65                        flag_context_list_table_ty *flag_table,
66                        msgdomain_list_ty *mdlp);
67 /* Scan a C++ file and add its translatable strings to mdlp.  */
68 extern void extract_cxx (FILE *fp, const char *real_filename,
69                          const char *logical_filename,
70                          flag_context_list_table_ty *flag_table,
71                          msgdomain_list_ty *mdlp);
72 /* Scan an ObjectiveC file and add its translatable strings to mdlp.  */
73 extern void extract_objc (FILE *fp, const char *real_filename,
74                           const char *logical_filename,
75                           flag_context_list_table_ty *flag_table,
76                           msgdomain_list_ty *mdlp);
77
78
79 /* Handling of options specific to this language.  */
80
81 extern void x_c_extract_all (void);
82
83 extern void x_c_keyword (const char *name);
84 extern void x_objc_keyword (const char *name);
85
86 extern void x_c_trigraphs (void);
87
88 extern void activate_additional_keywords_kde (void);
89
90 extern void init_flag_table_c (void);
91 extern void init_flag_table_objc (void);
92 extern void init_flag_table_gcc_internal (void);
93 extern void init_flag_table_kde (void);
94
95
96 extern struct literalstring_parser literalstring_c;
97
98
99 #ifdef __cplusplus
100 }
101 #endif