Patrik Stridvall ps@leissner.se writes:
So what you basicly want is something like:
my %return_type_exceptions;
$return_type_exceptions{"foo"} = { Bar => "str", Baz => "ptr" };
$return_type_exceptions{"bar"} = { Foo => "str" };
Yes, that would work fine for now.
OK. I made a script (adapted winapi_extract) to do this (attached). Output attached as well, but you can regenerate it by doing tools/winapi/winapi_extract in the topsrcdir.
I realized that when I was at it I could output the argument types as well and thus having a hash table that can be given to wine::declare directly.
Here is also a script make_modules that generates modules to use this directly and thus there is no need to any spec2pm any longer.
However I'm not postive that we want to have seperate include for constants and functions. Perhaps it would be better if people used to C could just do
use winuser;
instead of
#include "winuser.h"
and not have to do any additional
use user32;
as well.
Oh, well, I don't really have any strong feelings in any direction. But it would be easier if you told me how you wanted it.
Oh BTW: What is your opinion on having special Perl adapted versions of some functions like:
sub GlobalGetAtomNameA { my $atom = shift; my $buffer = "\0" x 256; # FIXME: Fixed buffer length my $length = &kernel32::GlobalGetAtomNameA($atom, $buffer, length($buffer)); return substr($buffer, 0, $length); }
Should we have them as the default imported function in say kernel32.pm or should each test that wants a easier to use version declare it in the test itself.