2 Copyright © 1995-2015, The AROS Development Team. All rights reserved.
9 /******************************************************************************
26 Print list of all libraries.
44 ******************************************************************************/
46 #include <exec/memory.h>
47 #include <exec/tasks.h>
48 #include <exec/execbase.h>
49 #include <proto/exec.h>
50 #include <dos/dosextens.h>
51 #include <proto/dos.h>
53 const TEXT version
[] = "$VER: LibList 41.3 (11.3.2015)\n";
65 static int addlib(struct Library
*lib
, struct lib
**l
, STRPTR
*e
)
70 (*l
)->version
= lib
->lib_Version
;
71 (*l
)->revision
= lib
->lib_Revision
;
72 (*l
)->opencnt
= lib
->lib_OpenCnt
;
73 (*l
)->flags
= lib
->lib_Flags
;
75 s1
= lib
->lib_Node
.ln_Name
;
98 static int fillbuffer(struct lib
**buffer
, IPTR size
)
100 STRPTR end
=(STRPTR
)*buffer
+size
;
103 for(lib
=(struct Library
*)SysBase
->LibList
.lh_Head
;
104 lib
->lib_Node
.ln_Succ
!=NULL
;
105 lib
=(struct Library
*)lib
->lib_Node
.ln_Succ
)
107 if(!addlib(lib
,buffer
,&end
))
122 struct lib
*buffer
,*libs
,*libs2
;
123 LONG error
=RETURN_OK
;
125 for(size
=2048;;size
+=2048)
127 buffer
=AllocVec(size
,MEMF_ANY
);
130 FPuts(Output(),"Not Enough memory for library buffer\n");
131 SetIoErr(ERROR_NO_FREE_STORE
);
136 if(fillbuffer(&libs
,size
))
138 FPuts(Output(),"address\t\tversion\trev\topencnt\tflags\tname\n"
139 "------------------------------------------------------------\n");
140 for(libs2
=buffer
;libs2
<libs
;libs2
++)
143 args
[0] = (IPTR
)libs2
->address
;
144 args
[1] = (IPTR
)libs2
->version
;
145 args
[2] = (IPTR
)libs2
->revision
;
146 args
[3] = (IPTR
)libs2
->opencnt
;
147 args
[4] = (IPTR
)libs2
->flags
;
148 args
[5] = (IPTR
)libs2
->name
;
150 VPrintf("0x%08.lx\t%ld\t%ld\t%ld\t0x%lx\t%s\n", args
);
151 if(SetSignal(0L,SIGBREAKF_CTRL_C
) & SIGBREAKF_CTRL_C
)
154 SetIoErr(ERROR_BREAK
);
164 if (error
!= RETURN_OK
)
166 PrintFault(IoErr(), NULL
);