intl/uconv/tools/genimpldefine.pl

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rwxr-xr-x

Correct previous dual key logic pending first delivery installment.

michael@0 1 #!/user/local/bin/perl
michael@0 2 # -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
michael@0 3 #
michael@0 4 # This Source Code Form is subject to the terms of the Mozilla Public
michael@0 5 # License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 7
michael@0 8 $name = "ucvlatin";
michael@0 9 $dir = "./";
michael@0 10
michael@0 11 sub printnpl()
michael@0 12 {
michael@0 13 $npl = <<END_OF_NPL;
michael@0 14 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 15 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 16 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 17 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 18 END_OF_NPL
michael@0 19 print $npl;
michael@0 20 }
michael@0 21
michael@0 22 sub finddefine()
michael@0 23 {
michael@0 24 my($classname, $definename) = (@_);
michael@0 25 $cmd = 'egrep ' . $classname . ' ' . $dir . '*.h ' . $dir . '*.cpp | egrep "public" | egrep -v "Support[.]"' . '&> /dev/null';
michael@0 26 if( system($cmd)) {
michael@0 27 print "\/\/ ";
michael@0 28 }
michael@0 29 print "#define " . $definename . "\n";
michael@0 30 }
michael@0 31
michael@0 32
michael@0 33
michael@0 34 &printnpl();
michael@0 35 print "\n";
michael@0 36 print "#ifndef " . $name . "config_h__\n";
michael@0 37 print "#define " . $name . "config_h__\n";
michael@0 38 print "\n";
michael@0 39 print "\/* This file is generated by running mozilla/intl/uconv/tools/genimpldefine.pl on unix */\n";
michael@0 40
michael@0 41 &finddefine( "nsBasicDecoderSupport", "IMPL_NSBASICDECODER");
michael@0 42 &finddefine( "nsBufferDecoderSupport", "IMPL_NSBUFFERDECODER");
michael@0 43 &finddefine( "nsTableDecoderSupport", "IMPL_NSTABLEDECODER");
michael@0 44 &finddefine( "nsMultiTableDecoderSupport", "IMPL_NSMULTITABLEDECODER");
michael@0 45 &finddefine( "nsOneByteDecoderSupport", "IMPL_NSONEBYTEDECODER");
michael@0 46 &finddefine( "nsBasicEncoder", "IMPL_NSBASICENCODER");
michael@0 47 &finddefine( "nsEncoderSupport", "IMPL_NSENCODER");
michael@0 48 &finddefine( "nsTableEncoderSupport", "IMPL_NSTABLEENCODER");
michael@0 49 &finddefine( "nsMultiTableEncoderSupport", "IMPL_NSMULTITABLEENCODER");
michael@0 50 print "\n";
michael@0 51 print "#include \"" . $name . "rules.h\"\n";
michael@0 52 print "\n";
michael@0 53 print "#endif \/*" . $name . "config_h__ *\/\n";

mercurial