home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d1xx
/
d168
/
dillonstuff.lha
/
src
/
com
/
libs.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-11-22
|
1KB
|
53 lines
/*
* LIBS.C
*
* Libs [libname]
*
* Libs - list currently loaded libraries
* Libs dres.library - expunge specified lib on last close if no
* further opens
*/
#include <local/typedefs.h>
extern EXECBASE *SysBase;
main(ac,av)
char *av[];
{
short i;
LIB *lib;
if (ac == 1) {
NODE *node;
for (node = SysBase->LibList.lh_Head; node->ln_Succ; node = node->ln_Succ) {
printf("%-20s ver %3ld refs %ld\n",
node->ln_Name,
((LIB *)node)->lib_Version,
((LIB *)node)->lib_OpenCnt
);
}
puts("");
for (node = SysBase->DeviceList.lh_Head; node->ln_Succ; node = node->ln_Succ) {
printf("%-20s ver %3ld refs %ld\n",
node->ln_Name,
((LIB *)node)->lib_Version,
((LIB *)node)->lib_OpenCnt
);
}
}
for (i = 1; i < ac; ++i) {
lib = OpenLibrary(av[i], 0);
if (lib) {
RemLibrary(lib);
printf("library refs: %ld\n", lib->lib_OpenCnt - 1);
puts("Will expunge on last close if no new opens");
CloseLibrary(lib);
} else {
puts("Unable to open library");
}
}
}