ServerInfo has just two functions: path() and list() that you're using.

The only thing I can think about is using C/C++ GetProcAddress( module, name );
And then read structure..

ncr100

12-25-2014, 12:38 AM

Thanks for the reply!

I'm on Mac, and I want to apply this technique also to scripts. I'd wanted to improve discoverability of plugins using a native plugin, either script or C.

I poked at a plugin using NM, OTOOL, and looked at the C SDK files. While these approaches would not work for scripts, only for binary plugins, I still could not figure out how to get the ServerDesc symbol from the compiled binary.

From there I could build a database of metadata with well-known plugin names, e.g. "BandSaw", and have the DB supply keywords from the documentation to help find and document the application's functionality. Find the section in the docs, and save it to the DB...you get the idea.

I could still request an API from LW3DG but I imagine it would not be in line with their product vision / be seen as a waste of dev resources.

While it's a bit of a bummer there's no public API to examine other modules / plugins in LightWave it's good to at least be able to put my idea away and move onto the next.

Sensei

12-25-2014, 01:30 AM

dlopen() is equivalent of LoadLibrary()
dlsym() is equivalent of GetProcAddress()
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/dlsym.3.html

Would one expect the well-known "ServerDesc" symbol (a global of type ServerRecord[]) be listed in the binary of the plugin, readable via 'strings' ( https://en.wikipedia.org/wiki/Strings_(Unix) ), for a release binary plugin? I don't see "ServerDesc" mentioned in any of my LW (release) plugins.

Also, is it well-known? I mean, are LightWave plugins by convention object files which contain a 'ServerRecord ServerDesc[]' global (plus a "static int Activate(...)" function)?

I've not tried dlsym() yet just the short-cut strings utility...perhaps embedded in the plugins there are obfuscated C string inaccessible to "strings"..?

EDIT: The binutils package http://stackoverflow.com/questions/3286675/readelf-like-tool-for-mac-os-x may have a tool to help me inspect from commandline.