added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / arch / .unmaintained / amiga / boot / printresmodules.c
blob81934098a298072578bdd0584dd3dbdcd3950a36
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <exec/execbase.h>
7 #include <exec/resident.h>
9 #include <proto/dos.h>
11 #include <stdio.h>
13 extern struct ExecBase *SysBase;
15 const UBYTE ver[] = "$VER: printresmodules 41.2 (15.3.1997)\n\r";
16 const UBYTE nul[] = "(null)";
18 void ResType(UBYTE);
20 int main(void)
22 int i;
23 ULONG *ptr;
25 for(i = 1, ptr = SysBase->ResModules; *ptr; i++, ptr++)
27 if(*ptr & 0x80000000) ptr = (ULONG *)(*ptr & 0x7fffffff);
30 struct Resident *res = (struct Resident *)*ptr;
32 Printf("%2lu: 0x%08lx %4ld ", i, *ptr, res->rt_Pri);
33 ResType(res->rt_Flags);
34 Printf("%s\n", (ULONG)res->rt_Name ? (ULONG)res->rt_Name : (ULONG)&nul);
38 return 0;
41 void ResType(UBYTE type)
43 int i = 0;
45 if (type == RTF_AUTOINIT)
47 PutStr(" RTF_AUTOINIT "); i++;
49 else
50 if (type == RTF_SINGLETASK)
52 PutStr(" RTF_SINGLETASK "); i++;
54 else
56 if (type & RTF_COLDSTART ) { PutStr("RTF_COLDSTART "); i++; }
57 if (type & RTF_AUTOINIT ) { PutStr("RTF_AUTOINIT "); i++; }
58 if (type & RTF_AFTERDOS ) { PutStr("RTF_AFTERDOS "); i++; }
59 if (type & RTF_SINGLETASK) { PutStr("RTF_SINGLETASK "); i++; }
60 switch(i)
62 case 0:
63 PutStr(" ");
64 break;
65 case 1:
66 PutStr(" ");
67 break;
68 default:
69 break;
70 } /* switch */