Portable Declarations

Blitz3D Forums/Blitz3D Userlibs/Portable Declarations

_PJ_(Posted 2012) [#1]
Not sure how useful this might be to many of you, but I find it can be helpful in making sure only the relevant libraries and their declarations are used by my B3D projects, especially if more than one project uses the same, specific methods from the same libraries.

Rather than continually use complete decls for the entire library of methods, or to edit individual copies of decls files across project folders, this snippet can automate the process of duplication and compactification simply and easily.

Basically, the functions below copy the data from within decls files from a source directory and combines them into a single decls file in the location of your choosing.

Just make a new bb file with the functions and call the function BuildPortableDecls([sourcedirectorypath$][targetdirectorypath$])

The function returns TRUE or FALSE, with a FALSE value reporting if there were any issues at all encountered.
It's recommended to run thios in DEBUG mode, as verbose details are outputted to the blitz DebugLog.

My apologies if this is not the best forum, since it's not really a contribution for the code archives, but more an aid to development where the developer is utilising Blitz' ability to call library functions. As such, it is really intended to be used as-is, not something that would be incorporated into any other projects.

If anyone does find it useful, then I'm glad I could help :)




Last edited 2012


virtlands(Posted 2013) [#2]
Quite interesting...
I think what you're saying is that when many userlibs are created by
various users that there is the potential for duplication of DLL functions,
and duplications of their declarations in the DECLS files.

My only idea so far for organizing it is to keep it simple.
For example, if a certain Windows API function resides within shell32.dll, then name the DECLS file shell32.decls

There is this great free program that can help organize this information:

DLL Function Viewer by D-Net Software
http://uploadingit.com/file/mefrr7klpsvk37lw/DLLFunctionViewer_v1.0.0.4.zip
http://www.brothersoft.com/dll-function-viewer-download-176528.html