2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
9 #include <exec/memory.h>
10 #include <exec/tasks.h>
11 #include <exec/execbase.h>
12 #include <proto/exec.h>
13 #include <dos/dosextens.h>
14 #include <proto/dos.h>
16 const TEXT version
[] = "$VER: LibList 41.2 (10.10.2005)\n";
28 static int addlib(struct Library
*lib
, struct lib
**l
, STRPTR
*e
)
33 (*l
)->version
= lib
->lib_Version
;
34 (*l
)->revision
= lib
->lib_Revision
;
35 (*l
)->opencnt
= lib
->lib_OpenCnt
;
36 (*l
)->flags
= lib
->lib_Flags
;
38 s1
= lib
->lib_Node
.ln_Name
;
61 static int fillbuffer(struct lib
**buffer
, IPTR size
)
63 STRPTR end
=(STRPTR
)*buffer
+size
;
66 for(lib
=(struct Library
*)SysBase
->LibList
.lh_Head
;
67 lib
->lib_Node
.ln_Succ
!=NULL
;
68 lib
=(struct Library
*)lib
->lib_Node
.ln_Succ
)
69 if(!addlib(lib
,buffer
,&end
))
83 struct lib
*buffer
,*libs
,*libs2
;
86 for(size
=2048;;size
+=2048)
88 buffer
=AllocVec(size
,MEMF_ANY
);
91 FPuts(Output(),"Not Enough memory for library buffer\n");
92 SetIoErr(ERROR_NO_FREE_STORE
);
97 if(fillbuffer(&libs
,size
))
99 FPuts(Output(),"address\t\tversion\trev\topencnt\tflags\tname\n"
100 "------------------------------------------------------------\n");
101 for(libs2
=buffer
;libs2
<libs
;libs2
++)
104 args
[0] = (IPTR
)libs2
->address
;
105 args
[1] = (IPTR
)libs2
->version
;
106 args
[2] = (IPTR
)libs2
->revision
;
107 args
[3] = (IPTR
)libs2
->opencnt
;
108 args
[4] = (IPTR
)libs2
->flags
;
109 args
[5] = (IPTR
)libs2
->name
;
111 VPrintf("0x%08.lx\t%ld\t%ld\t%ld\t0x%lx\t%s\n", args
);
112 if(SetSignal(0L,SIGBREAKF_CTRL_C
) & SIGBREAKF_CTRL_C
)
115 SetIoErr(ERROR_BREAK
);
125 if (error
!= RETURN_OK
)
127 PrintFault(IoErr(), NULL
);