On Tuesday 19 December 2000 10:22 am, you wrote:
> I have (almost). Just look in wine/tools/winapi_check/winapi_parser.pm.
I tried, but I think my brain is just not wired to understand perl beyond a
certain level... after 5 minutes of staring at lines like:
elsif(/WAVEOUT_SHORTCUT_0\s*\(\s*(.*?)\s*,\s*(.*?)\s*\)/s)
I begin to realise that A) my skills lie elsewhere, and B) I might need my
sight checked ;-)
> Any way, I can write it for you if you wish.
That would be superb, thankyou.
> Let get this straight, what you want is a script that takes a list of
> header (.h) files and generates a stub implementation for them?
Its actually slightly simpler than that. The ideal script would take a symbol
name and a directory. Then it would look at every file in the directory and
return either the first occurence of a prototype for that symbol, or nothing
(if not found).
So if I called: " proto_grep.pl Foo ~/include " it would print to stdout:
"FLOAT WINAPI Foo(LPVOID table, LPSTR str, LPWSTR wstr, INT x, FLOAT y);"
The problem is in determining if you have found a prototype or just a define
or comment, or another function which matches part of the name (which is
where I gave up). The return/calling conventions and parameters can also all
be on different lines.
I think you need to search for something of the form
whitespace,SYMBOL,[whitespace],'(',[anything],matching-')',[whitespace],';'
If you find that looking forwards from the symbol then you can look backward
until you hit a comment, #directive, or ';'. The string from that point, up
to and including the ';' at the end is what should be returned, with any line
breaks removed.
The TRACE code and mapping the symbol to DLLNAME_symbol etc would be done by
the calling program (since it could potentially output the trace in different
ways, with/without forwarding for example).
> Anyway I'm at work now so it will have to wait until I get home.
Its no hurry at all, just something I thought would be cool for future work,
and save a lot of typing for new DLLs (msvcrt comes to mind, for example). If
you do want to code it I'll certainly add the generation of proper prototypes
and stubs to specbuilder (or specmaker, Francois pointed out, thats
probably more appropriate).
If you do want to implement this sometime, please mail me the script and
I'll integrate it in.
Thanks!
Jon
--
"May their negative actions ripen upon me. And may all my virtues ripen upon
them."
"If it could be talked about, everybody would have told their brother."
[EMAIL PROTECTED] , [EMAIL PROTECTED]