windowing/windowserver/wins_switching/generate_stubs.pl
author Faisal Memon <faisal.memon@nokia.com>
Thu, 06 May 2010 15:42:13 +0100
branchNewGraphicsArchitecture
changeset 50 0af17dab16c3
parent 0 5d03bc08d59c
permissions -rw-r--r--
Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output. I left out the result of running this script due to a comment earlier to say there was a problem with the def files in my original patch.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
#!/bin/perl -w
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
     3
# Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
# All rights reserved.
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
# This component and the accompanying materials are made available
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
# under the terms of "Eclipse Public License v1.0"
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
# which accompanies this distribution, and is available
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
#
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
# Initial Contributors:
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
# Nokia Corporation - initial contribution.
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
#
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
# Contributors:
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
#
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
# Description:
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
# Generates the ws32_stubs.h header file and the ws32switchU.def
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
# file from the ws322U def file.
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    18
#
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
use strict;
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    22
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    23
my $COPYRIGHT = <<"EndCopyrightAndLicense";
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    24
/*
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    25
 * Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    26
 * All rights reserved.
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    27
 * This component and the accompanying materials are made available
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    28
 * under the terms of "Eclipse Public License v1.0"
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    29
 * which accompanies this distribution, and is available
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    30
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    31
 */
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    32
EndCopyrightAndLicense
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
my $SOURCE_DEF_SIZE = 0;
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
my $WS32_DEF = "../BWINS/";
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
my $WS32_DEF2 = "../BWINS/";
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
my $WS32SWITCH_HEADER = "";
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
my $WS32SWITCH_DEF = "../BWINS/";
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
&main();
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
exit(0);
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
sub main() {
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    44
       my $maxOrdinal = 1;
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    45
       my $def2MaxOrdinal = 1;
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    47
       $WS32_DEF .= $ARGV[0];
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    48
       $WS32SWITCH_HEADER = $ARGV[1];
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    49
       $WS32SWITCH_DEF .= $ARGV[2];
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    51
       open DEF, $WS32_DEF or
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    52
               die "Cannot open $WS32_DEF\n";
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    53
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    55
       my ($dev, $ino, $mode, $nlink, $uid, $gid,
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    56
               $rdev, $size, $atime, $mtime, $ctime,
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    57
               $blksize, $blocks)
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    58
               = stat($WS32_DEF);
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    59
       # the file size could be checked by the switcher build to verify that the stub is up to date.
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    60
       $SOURCE_DEF_SIZE= $size;
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    62
       open HEADER_OUT, ">${WS32SWITCH_HEADER}" or
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    63
               die "Cannot create $WS32SWITCH_HEADER\n";
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    64
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    65
       open DEF_OUT, ">${WS32SWITCH_DEF}" or
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    66
               die "Cannot create $WS32SWITCH_DEF\n";
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    68
       &printHeaderStart(\*HEADER_OUT);
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    69
       &printDefStart(\*DEF_OUT);
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    71
       while (<DEF>) {
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    72
               chomp;
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    73
               if (/^\s+\?/) {
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    74
                       if (s/.*;/;/) {
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    75
                               &printDefEntry(\*DEF_OUT, $maxOrdinal, $_);
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    76
                               &printHeaderEntry(\*HEADER_OUT,$maxOrdinal,$_);
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    77
                       } else {
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    78
                               &printDefEntry(\*DEF_OUT, $maxOrdinal, "");
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    79
                               &printHeaderEntry(\*HEADER_OUT,$maxOrdinal, "(noname)");
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    80
                       }
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    81
                       $maxOrdinal++;
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    82
               }
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    83
       }
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    84
       &printHeaderEnd(\*HEADER_OUT,$maxOrdinal);
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    85
       &printDefEnd(\*DEF_OUT);
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    87
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    89
       close DEF;
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    90
       close HEADER_OUT;
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    91
       close DEF_OUT;
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
sub printDefStart(\$) {
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    95
       my ($fh) = @_;
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
    96
       print $fh "EXPORTS\n";
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    97
}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
sub printDefEntry(\$\$\$) {
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   100
       my ($fh, $ordinal, $comment) = @_;
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   101
       print $fh "\tcall_vector_${ordinal} @ ${ordinal} NONAME $comment\n";
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
sub printDefEnd(\$) {
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   105
       my ($fh) = @_;
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   106
       print $fh "\n";
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
sub printHeaderStart(\$) {
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   110
       my ($fh) = @_;
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   112
       print $fh "$COPYRIGHT\n" .
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   113
               "/* Generated from  \"$WS32_DEF\" file size: $SOURCE_DEF_SIZE */\n\n" .
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   114
               "extern \"C\" {\n" .
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   115
               "void common_dispatch();\n" .
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   116
               "\n";
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   119
sub printHeaderEntry(\$\$\$) {
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   120
       my ($fh, $ordinal, $comment) = @_;
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   122
       print $fh "__declspec(dllexport)\n" .
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   123
               "__declspec(naked)\n" .
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   124
               "void call_vector_${ordinal} ()\n" .
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   125
               "\t{\n" .
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   126
               "\t// ${comment}\n" .
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   127
               "\t_asm mov eax, $ordinal\n" .
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   128
               "\t_asm jmp common_dispatch\n" .
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   129
               "\t}\n\n";
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   130
}
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
sub printHeaderEnd(\$\$) {
50
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   133
       my ($fh, $maxOrdinal) = @_;
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   134
       print $fh "}\n" .
0af17dab16c3 Apply patch 4. Fix the stub generator to insert proper license text in autogenerated output.
Faisal Memon <faisal.memon@nokia.com>
parents: 0
diff changeset
   135
               "#define MAX_ORDINAL $maxOrdinal\n\n";
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
}