Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / i18npool / source / localedata / genstaticheader.pl
blob3d9935876488ad7470bca427d66c470a5911116f
1 #!/usr/bin/perl -w # -*- tab-width: 4; indent-tabs-mode: nil;
3 # Version: MPL 1.1 / GPLv3+ / LGPLv3+
5 # The contents of this file are subject to the Mozilla Public License Version
6 # 1.1 (the "License"); you may not use this file except in compliance with
7 # the License or as specified alternatively below. You may obtain a copy of
8 # the License at http://www.mozilla.org/MPL/
10 # Software distributed under the License is distributed on an "AS IS" basis,
11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 # for the specific language governing rights and limitations under the
13 # License.
15 # Major Contributor(s):
16 # Copyright (C) 2012 Tor Lillqvist <tml@iki.fi> (initial developer)
17 # Copyright (C) 2012 SUSE Linux http://suse.com (initial developer's employer)
19 # All Rights Reserved.
21 # For minor contributions see the git repository.
23 # Alternatively, the contents of this file may be used under the terms of
24 # either the GNU General Public License Version 3 or later (the "GPLv3+"), or
25 # the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
26 # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
28 my @FUNCS = qw(
29 getAllCalendars
30 getAllCurrencies
31 getAllFormats0
32 getBreakIteratorRules
33 getCollationOptions
34 getCollatorImplementation
35 getContinuousNumberingLevels
36 getDateAcceptancePatterns
37 getFollowPageWords
38 getForbiddenCharacters
39 getIndexAlgorithm
40 getLCInfo
41 getLocaleItem
42 getOutlineNumberingLevels
43 getReservedWords
44 getSearchOptions
45 getTransliterations
46 getUnicodeScripts
47 getAllFormats1
50 print 'extern "C" {
54 foreach my $lang (@ARGV) {
55 foreach my $func (@FUNCS) {
56 if ($func eq 'getAllFormats1') {
57 if ($lang eq 'en_US') {
58 printf("void %s_%s();\n", $func, $lang);
60 } else {
61 printf("void %s_%s();\n", $func, $lang);
66 print '
67 static const struct {
68 const char *pLocale;
70 foreach my $func (@FUNCS) {
71 printf(" void (*%s)();\n", $func);
73 print '} aLibTable[] = {
76 foreach my $lang (@ARGV) {
77 printf(" {\n");
78 printf(" \"%s\",\n", $lang);
79 foreach my $func (@FUNCS) {
80 if ($func eq 'getAllFormats1') {
81 if ($lang eq 'en_US') {
82 printf(" %s_%s,\n", $func, $lang);
83 } else {
84 printf(" 0,\n");
86 } else {
87 printf(" %s_%s,\n", $func, $lang);
90 printf(" }%s\n", ($lang ne $ARGV[$#ARGV]) ? ',' : '');
93 print '};
98 # vim:set shiftwidth=4 softtabstop=4 expandtab: