1 /* Internationalization Tag Set (ITS) handling
2 Copyright (C) 2015 Free Software Foundation, Inc.
4 This file was written by Daiki Ueno <ueno@gnu.org>, 2015.
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.
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.
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/>. */
29 enum its_whitespace_type_ty
31 ITS_WHITESPACE_PRESERVE,
32 ITS_WHITESPACE_NORMALIZE,
36 typedef struct its_rule_list_ty its_rule_list_ty;
39 (*its_extract_callback_ty) (message_list_ty *mlp,
43 const char *extracted_comment,
45 enum its_whitespace_type_ty whitespace);
47 /* Creates a fresh its_rule_list_ty holding global ITS rules. */
48 extern its_rule_list_ty *its_rule_list_alloc (void);
50 /* Releases memory allocated for RULES. */
51 extern void its_rule_list_free (its_rule_list_ty *rules);
53 /* Loads global ITS rules from STRING. */
54 extern bool its_rule_list_add_from_string (struct its_rule_list_ty *rules,
57 /* Loads global ITS rules from FILENAME. */
58 extern bool its_rule_list_add_from_file (its_rule_list_ty *rules,
59 const char *filename);
61 /* Extracts messages from FP, accoding to the loaded ITS rules. */
62 extern void its_rule_list_extract (its_rule_list_ty *rules,
63 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 its_extract_callback_ty callback);
69 typedef struct its_merge_context_ty its_merge_context_ty;
71 extern its_merge_context_ty *
72 its_merge_context_alloc (its_rule_list_ty *rules, const char *filename);
73 extern void its_merge_context_free (its_merge_context_ty *context);
74 extern void its_merge_context_merge (its_merge_context_ty *context,
76 message_list_ty *mlp);
78 extern void its_merge_context_write (its_merge_context_ty *context,