lxapigen.pl
author Ryan C. Gordon <icculus@icculus.org>
Sun, 17 Jun 2018 22:21:52 -0400
changeset 134 352d3fac725f
parent 119 5a0e9fe5af19
child 144 012b8bf425c4
permissions -rwxr-xr-x
Let OS2APIINFO optionally take key/value pairs, use it for export names. This lets me remove my tcpip32 hack, and will let me export old symbols as all caps for OS/2's use and something more sane for regular use (like VioGetCurPos() in modern times is VIOGETCURPOS in viocalls.dll, etc).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
103
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     1
#!/usr/bin/perl -w
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     2
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     3
use warnings;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     4
use strict;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     5
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     6
my %typesizes = (
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     7
    'LONG' => 4,
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     8
    'ULONG' => 4,
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     9
    'SHORT' => 2,
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    10
    'USHORT' => 2,
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    11
    'HVIO' => 2,
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    12
    'HKBD' => 2,
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    13
);
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    14
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    15
sub typesize {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    16
    my $t = shift;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    17
    return 4 if ($t =~ /\AP/);  # pointers are 4 bytes (16:16).
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    18
    die("Unknown type '$t', please update \%typesizes\n") if not defined $typesizes{$t};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    19
    return $typesizes{$t};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    20
}
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    21
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    22
my $dirname = defined $ARGV[0] ? $ARGV[0] : 'native';
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    23
opendir(DIRH, $dirname) or die("Failed to opendir '$dirname': $!\n");
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    24
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    25
while (readdir(DIRH)) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    26
    next if not /\.h\Z/;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    27
    next if /\Aos2/;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    28
    next if /\-lx\.h\Z/;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    29
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    30
    my $module = $_;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    31
    my $header = "$dirname/$module";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    32
    $module =~ s/\.h\Z//;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    33
    open(IN, '<', $header) or die("Failed to open '$header' for reading: $!\n");
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    34
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    35
    print("$module ...\n");
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    36
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    37
    my %ordinalmap = ();
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    38
    my $has16bitfns = 0;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    39
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    40
    while (<IN>) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    41
        chomp;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    42
        next if not /OS2APIINFO/;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    43
        my $line = $_;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    44
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    45
        if (/\AOS2EXPORT\s+(.*?)\s+(OS2API|OS2API16)\s+(.*?)\((.*?)\)\s+OS2APIINFO\((.*?)\);/) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    46
            my %table = (
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    47
                'rettype' => $1,
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    48
                'apitype' => $2,
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    49
                'fn' => $3,
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    50
                'args' => $4,
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    51
            );
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    52
            my $apiinfo = $5;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    53
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    54
            my $is16bit = $table{'apitype'} eq 'OS2API16';
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    55
            $table{'is16bit'} = $is16bit;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    56
            $has16bitfns |= $is16bit;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    57
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    58
            #print("rettype='$rettype' fn='$fn' args='$args' apiinfo='$apiinfo'\n");
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    59
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    60
            my $fn = $table{'fn'};
134
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    61
            my $ordinal = undef;
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    62
            my $expname = undef;
103
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    63
            if ($apiinfo =~ /\A(\d+)\Z/) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    64
                $ordinal = int($1);
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    65
            } else {
134
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    66
                foreach (split(/,/, $apiinfo)) {
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    67
                    #print("apiinfoarg: '$_'\n");
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    68
                    my ($infokey, $infoval) = /\A(.*?)\=(.*)\Z/;
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    69
                    #print("apiinfo key='$infokey' val='$infoval'\n");
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    70
                    if ($infokey eq 'ord') {
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    71
                        if ($infoval =~ /\A(\d+)\Z/) {
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    72
                            $ordinal = int($1);
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    73
                        } else {
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    74
                            die("Invalid ordinal '$infoval' for '$fn'\n");
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    75
                        }
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    76
                    } elsif ($infokey eq 'name') {
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    77
                        $expname = $infoval;
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    78
                    } else {
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    79
                        die("unknown OS2APIINFO key '$infokey' for '$fn'\n");
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    80
                    }
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    81
                }
103
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    82
            }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    83
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    84
            $table{'ordinal'} = $ordinal;
134
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
    85
            $table{'expname'} = $expname if defined $expname;
103
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    86
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    87
            if (defined $ordinalmap{$ordinal}) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    88
                my $dupfn = $ordinalmap{$ordinal}{'fn'};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    89
                die("Duplicate ordinal #$ordinal between '$fn' and '$dupfn'\n");
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    90
            }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    91
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    92
            $ordinalmap{$ordinal} = \%table;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    93
        } else {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    94
            die ("Couldn't parse:\n\n  $line\n\n")
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    95
        }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    96
    }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    97
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    98
    close(IN);
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    99
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   100
    next if (not %ordinalmap);  # no exported items?
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   101
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   102
    #use Data::Dumper qw(Dumper); print Dumper \%ordinalmap;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   103
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   104
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   105
    # Here we go...
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   106
114
23577dfa3fad lxapigen.pl: Don't overwrite files that didn't change.
Ryan C. Gordon <icculus@icculus.org>
parents: 103
diff changeset
   107
    my $finalfname = "$dirname/$module-lx.h";
23577dfa3fad lxapigen.pl: Don't overwrite files that didn't change.
Ryan C. Gordon <icculus@icculus.org>
parents: 103
diff changeset
   108
    my $outfname = "$finalfname-new";
103
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   109
    open(OUT, '>', $outfname) or die("Failed to open '$outfname' for writing: $!\n");
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   110
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   111
    print OUT <<EOF
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   112
/**
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   113
 * 2ine; an OS/2 emulator for Linux.
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   114
 *
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   115
 * Please see the file LICENSE.txt in the source's root directory.
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   116
 */
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   117
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   118
/* THIS FILE IS AUTOGENERATED. DO NOT EDIT BY HAND. see lxapigen.pl */
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   119
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   120
/* This is glue code for OS/2 binaries. Native binaries don't need this. */
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   121
#if LX_LEGACY
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   122
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   123
EOF
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   124
;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   125
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   126
    foreach (sort { $a <=> $b } keys(%ordinalmap) ) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   127
        my $tableref = $ordinalmap{$_};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   128
        my $fn = $tableref->{'fn'};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   129
        my $argstr = $tableref->{'args'};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   130
        my $rettype = $tableref->{'rettype'};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   131
        my $is16bit = $tableref->{'is16bit'};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   132
        my @args = ();
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   133
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   134
        if (($argstr ne 'VOID') and ($argstr ne 'void')) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   135
            @args = split /,/, $argstr;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   136
        }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   137
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   138
        # Build a little wrapper that'll pull arguments off the stack and
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   139
        #  convert to whatever the native calling conventions are.
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   140
        if ($is16bit) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   141
            print OUT "static $rettype bridge16to32_$fn(uint8 *args) {\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   142
            #foreach (@args) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   143
            # arguments are listed backwards here.
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   144
            for my $i (reverse 0..$#args) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   145
                my $arg = $args[$i];
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   146
                my ($t, $n) = $arg =~ /\A\s*(.*?)\s+(.*?)\s*\Z/;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   147
                #print("arg='$_' t='$t' n='$n'\n");
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   148
                my $a = ($t =~ /\AP/) ? 'PTRARG' : 'ARG';  # it's a pointer?
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   149
                print OUT "    LX_NATIVE_MODULE_16BIT_BRIDGE_$a($t, $n);\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   150
            }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   151
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   152
            print OUT "    ";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   153
            if (($rettype ne 'void') && ($rettype ne 'VOID')) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   154
                # Currently it's reasonable to assume the retval will land in EAX.
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   155
                print OUT "return ";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   156
            }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   157
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   158
            print OUT "$fn(";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   159
            my $comma = '';
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   160
            foreach (@args) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   161
                my ($t, $n) = /\A\s*(.*?)\s+(.*?)\s*\Z/;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   162
                print OUT "$comma$n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   163
                $comma = ', ';
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   164
            }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   165
            print OUT ");\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   166
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   167
            print OUT "}\n\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   168
        }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   169
    }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   170
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   171
    if ($has16bitfns) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   172
        print OUT "LX_NATIVE_MODULE_16BIT_SUPPORT()\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   173
        foreach (sort { $a <=> $b } keys(%ordinalmap) ) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   174
            my $tableref = $ordinalmap{$_};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   175
            next if not $tableref->{'is16bit'};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   176
            my $fn = $tableref->{'fn'};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   177
            print OUT "    LX_NATIVE_MODULE_16BIT_API($fn)\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   178
        }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   179
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   180
        print OUT "LX_NATIVE_MODULE_16BIT_SUPPORT_END()\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   181
        print OUT "\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   182
        print OUT "LX_NATIVE_MODULE_DEINIT({\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   183
        print OUT "    LX_NATIVE_MODULE_DEINIT_16BIT_SUPPORT();\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   184
        print OUT "})\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   185
        print OUT "\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   186
        print OUT "static int init16_$module(void) {\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   187
        print OUT "    LX_NATIVE_MODULE_INIT_16BIT_SUPPORT()\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   188
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   189
        foreach (sort { $a <=> $b } keys(%ordinalmap) ) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   190
            my $tableref = $ordinalmap{$_};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   191
            next if not $tableref->{'is16bit'};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   192
            my $fn = $tableref->{'fn'};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   193
            my $argstr = $tableref->{'args'};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   194
            my $argbytes = 0;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   195
            my @args = ();
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   196
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   197
            if (($argstr ne 'VOID') and ($argstr ne 'void')) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   198
                @args = split /,/, $argstr;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   199
            }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   200
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   201
            foreach (@args) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   202
                my ($t, $n) = /\A\s*(.*?)\s+(.*?)\s*\Z/;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   203
                $argbytes += typesize($t);
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   204
            }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   205
            print OUT "        LX_NATIVE_INIT_16BIT_BRIDGE($fn, $argbytes)\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   206
        }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   207
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   208
        print OUT "    LX_NATIVE_MODULE_INIT_16BIT_SUPPORT_END()\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   209
        print OUT "    return 1;\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   210
        print OUT "}\n\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   211
    }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   212
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   213
    print OUT "LX_NATIVE_MODULE_INIT(";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   214
    if ($has16bitfns) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   215
        print OUT "{ if (!init16_$module()) return 0; }";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   216
    }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   217
    print OUT ")\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   218
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   219
    my $comma = '';
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   220
    foreach (sort { $a <=> $b } keys(%ordinalmap) ) {
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   221
        my $tableref = $ordinalmap{$_};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   222
        my $fn = $tableref->{'fn'};
134
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
   223
        my $expname = $tableref->{'expname'};
103
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   224
        my $ordinal = $tableref->{'ordinal'};
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   225
        my $suffix = $tableref->{'is16bit'} ? '16' : '';
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   226
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   227
        print OUT $comma;
134
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
   228
        if (defined $expname) {
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
   229
            print OUT "    LX_NATIVE_EXPORT${suffix}_DIFFERENT_NAME($fn, \"$expname\", $ordinal)";
103
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   230
        } else {
134
352d3fac725f Let OS2APIINFO optionally take key/value pairs, use it for export names.
Ryan C. Gordon <icculus@icculus.org>
parents: 119
diff changeset
   231
            print OUT "    LX_NATIVE_EXPORT${suffix}($fn, $ordinal)";
103
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   232
        }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   233
        $comma = ",\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   234
    }
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   235
    print OUT "\n";
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   236
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   237
    print OUT <<EOF
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   238
LX_NATIVE_MODULE_INIT_END()
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   239
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   240
#endif /* LX_LEGACY */
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   241
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   242
/* end of $module-lx.h ... */
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   243
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   244
EOF
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   245
;
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   246
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   247
    close(OUT);
114
23577dfa3fad lxapigen.pl: Don't overwrite files that didn't change.
Ryan C. Gordon <icculus@icculus.org>
parents: 103
diff changeset
   248
119
5a0e9fe5af19 lxapigen.pl: show full diffs when changing things.
Ryan C. Gordon <icculus@icculus.org>
parents: 114
diff changeset
   249
    if ((system("diff -u '$finalfname' '$outfname'") == -1) || ($? != 0)) {
114
23577dfa3fad lxapigen.pl: Don't overwrite files that didn't change.
Ryan C. Gordon <icculus@icculus.org>
parents: 103
diff changeset
   250
        rename($outfname, $finalfname) or die("Failed to rename '$outfname' to '$finalfname': $!\n");
23577dfa3fad lxapigen.pl: Don't overwrite files that didn't change.
Ryan C. Gordon <icculus@icculus.org>
parents: 103
diff changeset
   251
    } else {
23577dfa3fad lxapigen.pl: Don't overwrite files that didn't change.
Ryan C. Gordon <icculus@icculus.org>
parents: 103
diff changeset
   252
        unlink($outfname);  # they match, just delete the new copy so build system doesn't rebuild everything.
23577dfa3fad lxapigen.pl: Don't overwrite files that didn't change.
Ryan C. Gordon <icculus@icculus.org>
parents: 103
diff changeset
   253
    }
103
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   254
}
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   255
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   256
closedir(DIRH);
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   257
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   258
# end of lxapigen.pl ...
0aaa6d47f023 Automate handling of support code for OS/2 binaries.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   259