[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CodingStandards up

>Up, I uploaded the CodingStandard stuff. HTML version is at
>ps/pdf/tarred-html/gzipped-docbook versions are in ftpspace

Other Libraries
Keep dependencies to a minimum

One thing not mentioned in this section is dynamic loading of entry points
at run time. This is a good thing to
do if the library contains functionality that is useful but not essential
to the running of the program.

Of couse it means a bit of work if you need to get a lot of entry points.

For example, PenguinSound has the can interface with the esound daemon. Not
 everybody uses the esound
daemon or even has it on their system. So that people don't have to install
 esound just so they can use
something that uses PenguinSound I load libesd.so at runtime and get the
necessary entry points.

In linux you use dlopen to open the shared object then dlsym to get the
entry point and finally dlclose. These
are declared in dlfcn.h.

In windows you use LoadLibrary and GetProcAddress.

There may be other ways of doing this for other platforms.

Somebody might like to write a class or utility so we can use the same
interface for all platforms, although
this will be of limited benefit since most libraries are not portable to
all platforms.

Peter Burns