home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
octa21fs.zip
/
octave
/
dlfcn
/
test
/
dlltest.c
next >
Wrap
C/C++ Source or Header
|
2000-01-15
|
603b
|
37 lines
/*
** Testing the dlfcn library.
** (c) 1997, Klaus Gebhardt
*/
#include <stdlib.h>
#include <stdio.h>
#include "../dlfcn.h"
int main (int argc, char *argv[])
{
void *hmod;
if (argc == 2)
{
printf ("\nLoading DLL: %s ...\n", argv[1]);
hmod = dlopen (argv[1], RTLD_LAZY);
if (hmod)
{
printf ("%s loaded.\n", argv[1]);
dlclose (hmod);
return 0;
}
else
{
printf ("%s not loaded.\n\n%s\n", argv[1], dlerror ());
return -1;
}
}
else
{
printf ("\nusage: test dll-filename\n");
return -1;
}
}