home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <proto/exec.h>
- #include <dos/dos.h>
- #include <dos/dosextens.h>
- #include <exec/execbase.h>
- #include <exec/devices.h>
-
- char *ver="\0$VER: reslist Snoopy Support Tool 1.1 (01.01.94)";
- extern struct ExecBase *SysBase;
-
- struct di
- {
- struct di *next;
- char *message;
- };
-
- struct di *anchor = NULL;
-
- void AddDevInfo( struct Device *d )
- {
- struct di *n;
-
- if( ( n = (struct di *)calloc( 1, sizeof( struct di ) ) ) != NULL )
- {
- n->next = anchor;
- anchor = n;
- n->message = strdup( d->dd_Library.lib_Node.ln_Name );
- }
- }
-
- void main( void )
- {
- struct Node *np;
- struct di *ptr;
-
- Forbid();
- for( np = SysBase->ResourceList.lh_Head;
- np != (struct Node *)&(SysBase->ResourceList.lh_Tail);
- np = np->ln_Succ )
- {
- AddDevInfo( (struct Device *)np );
- }
- Permit();
-
- for( ptr=anchor; ptr != NULL; ptr = ptr->next )
- printf( "RESOURCE \"%s\"\n", ptr->message );
- }
-