06dl5:

This version contains a new test program: use_any_pkg.c which takes command
line arguments naming one or more modules that it should attempt to locate
f1 and f2 functions in.  This occurred to me because the only difference
in 05dl3 between usepkg1_via_dl.c and usepkg2_via_dl.c was the module name
used.  So why not take the module name from the command line?  And why not
take any number of command line parameters and iterate over them?

(In fact, I've removed usepkg[12].c, usepkg[12]_via_dl.c and pkgN.h files
as there seems no point keeping them)

So if you run:

./use_any_pkg pkg1

you get:

Calling pkg1's f1 function
pkg1::f1
pkg1::f2, returning 1
Called pkg1's f2 function, result is 1

and if you run:

./use_any_pkg pkg2

you get:

Calling pkg2's f1 function
pkg2::f1
pkg2::f2, returning 42
Called pkg2's f2 function, result is 42


Also, this version contains a third package (pkg3.[ch]), containing another
collection of functions - including a compatible f1, but no f2.

So if you run

./use_any_pkg pkg1 pkg2 pkg3 pkg10

you'll get:

Calling pkg1's f1 function
pkg1::f1
pkg1::f2, returning 1
Called pkg1's f2 function, result is 1

Calling pkg2's f1 function
pkg2::f1
pkg2::f2, returning 42
Called pkg2's f2 function, result is 42

Calling pkg3's f1 function
pkg3::f1
Failed to find f2 in libpkg3.so

Can't dlopen libpkg10.so
