--- Alexandre Julliard julliard@winehq.com wrote:
Andriy Palamarchuk apa3a@yahoo.com writes:
The next my step would be to translate my own unit tests to Perl. My tests extensively use number constants, declared in C header file with defines
and
C structures.
The defines can be translated to Perl constants; I once started writing a tool to do that automatically, I'll try do dig it out.
h2xs in standard Perl installation filtered put defines to the .xs file. Try to run "h2xs winuser.h" and look in the generated files. The tool has some issues: - processes one .h file at a time - does not do full-fledged header parsing, so it can have problems with complex precompilator structures - generates C code for the constants. This approach looks more efficient than simple declaring but requires to regenerate and recompile the C file whenever header is changed.
We also can chage h2xs to the behavior we need.
Structures should be converted with pack/unpack (cf. the win.pl example), we probably want to export the pack format strings for each structure from some Perl module too. The advantage of doing that is that the structures are not derived from the C code, which allow checking that the layout is correct. The drawback is that you need to write the format string for each structure, but you only need to do it once.
Looks good.
Andriy
__________________________________________________ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com