2 Copyright © 1995-2015, The AROS Development Team. All rights reserved.
9 /******************************************************************************
26 Prints a list of all resources.
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: reslist 41.3 (11.3.2015)\n";
61 static int addres(struct Node
*r
, struct res
**l
, STRPTR
*e
)
90 static int fillbuffer(struct res
**buffer
, IPTR size
)
92 STRPTR end
=(STRPTR
)*buffer
+size
;
95 for(r
=(struct Node
*)SysBase
->ResourceList
.lh_Head
;
97 r
=(struct Node
*)r
->ln_Succ
)
99 if(!addres(r
,buffer
,&end
))
114 struct res
*buffer
,*ress
,*ress2
;
115 for(size
=2048;;size
+=2048)
117 buffer
=AllocVec(size
,MEMF_ANY
);
120 FPuts(Output(),"Not Enough memory for library buffer\n");
124 if(fillbuffer(&ress
,size
))
126 FPuts(Output(),"address\t\tname\n"
127 "------------------------------------------------------------\n");
128 for(ress2
=buffer
;ress2
<ress
;ress2
++)
131 args
[0] = (IPTR
)ress2
->address
;
132 args
[1] = (IPTR
)ress2
->name
;
134 VPrintf("0x%08.lx\t%s\n", args
);