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
++)
142 Printf("0x%08.ix\t%ld\t%ld\t%ld\t0x%lx\t%s\n",
143 libs2
->address
, (ULONG
)libs2
->version
,
144 (ULONG
)libs2
->revision
,
145 (ULONG
)libs2
->opencnt
,
148 if(SetSignal(0L,SIGBREAKF_CTRL_C
) & SIGBREAKF_CTRL_C
)
151 SetIoErr(ERROR_BREAK
);
161 if (error
!= RETURN_OK
)
163 PrintFault(IoErr(), NULL
);