Pelles C > Feature requests

Library to header correlation...

<< < (2/4) > >>

Anonymous:

--- Quote from: "timovjl" ---First Aid:

You could make include file for example libs.h
and insert known libs to there.

// libs.h
#ifdef _SHELLAPI_H
#pragma lib "shell32.lib"
#endif
--- End quote ---


Yep.  I was, in fact, just thinking about that.  It needs to be a little more complex than the example and it would have to be the last on the list but it would work.  

Something like...

--- Code: ---
#ifdef _SHELLAPI_H_

#ifndef SHELl32_LIB
#define SHELL32_LIB
#pragma lib "shell32.lib"
#end if

#end if

--- End code ---

... repeated for each header.  The extra would be necessary to prevent duplicating the pragmas since there is often more than one header for each library and sometimes more than one library for a header.

The ideal would be to include the middle part (between the blank lines above)  into the actual headers themselves...  I'd be happy to do the work and contribute it to the project... From there, Pelle would just have to keep it up to date.  What I need, though, is some kind of crossreference to work from...  What goes with what?

I wonder if there's a list someplace???

Pelle:

--- Quote from: "ldblake" ---The ideal would be to include the middle part (between the blank lines above)  into the actual headers themselves...  I'd be happy to do the work and contribute it to the project... From there, Pelle would just have to keep it up to date.  What I need, though, is some kind of crossreference to work from...  What goes with what?

I wonder if there's a list someplace???
--- End quote ---

This is the big question. I'm not aware of any such list, but maybe there is one. With this info, I can easily write a small script to insert the necessary lines into the #include files.

Pelle

Anonymous:

--- Quote from: "Pelle" ---
--- Quote from: "ldblake" ---I wonder if there's a list someplace???
--- End quote ---

This is the big question. I'm not aware of any such list, but maybe there is one. With this info, I can easily write a small script to insert the necessary lines into the #include files.
Pelle
--- End quote ---


Fear Not!  :)   I'm half way there!

1) I took your sysdefs.tag file and parsed it down to a csv list of functions in each header.  As :  <function>,<header>

2) I used polib to list all the stuff in the libraries, giving me a list of functions in each library.   (300 + files worth... Thank goodness for batch files!)

3) Next I just have to tap up a little code to transform the library list files into a csv list of functions by library.  As :  <function>,<library>

4) Then all I have to do is tap up one last bit of code to sort and correlate the function names producing a list of  libraries by header.  Take out the duplicate lines and the final output would be a text file consiting of:

<header name>,<library name>
<header name>,<library name>
<header name>,<library name>

It shouldn't take long...  From there it would be a matter of sequentially opening each header, locating the header's #define _HEADER_H line and tucking in the required number of #pragma blocks, as in my earlier message.  

(There will be multiple lines for some headers, if they call in more than one library, so your script will have to account for that.  It's also possible some headers won't be referenced at all, if they don't match up to a library.)


Will this do as a source list for your script?

Pelle:

--- Quote from: "ldblake" ---Will this do as a source list for your script?
--- End quote ---

Sure - this list (in pretty much any format) is exactly what I need!

Pelle

Anonymous:

--- Quote from: "Pelle" ---
--- Quote from: "ldblake" ---Will this do as a source list for your script?
--- End quote ---

Sure - this list (in pretty much any format) is exactly what I need!

Pelle
--- End quote ---


Excellent...

I just finished transforming all the library listings...

One more editor nacro to correlate names and we're home free!

You should have it sometime later today...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version