intl/uconv/tools/genimpldefine.pl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rwxr-xr-x

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial