home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Source Code 1992 March
/
Source_Code_CD-ROM_Walnut_Creek_March_1992.iso
/
msdos
/
sysutl
/
showdevs.arc
/
SHOWDEVS.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-03-12
|
889b
|
41 lines
#include <dos.h> /* only required if you use the C version of get_lol() */
typedef unsigned char far *charptr;
charptr get_lol();
struct { /* store all data as simple types: */
union { long next; int endflag; } u;
int attrib;
unsigned int strat,intrp;
char dname[9];
} dhdr;
main()
{
charptr d;
d=get_lol(); /* get MS-DOS List of Lists */
d+=0x22;
printf("\nAddress Name attrib strat intrp\n\n");
while (dhdr.u.endflag != -1)
{
copy18((char *)(&dhdr),d);
printf("%Fp ",d);
if (dhdr.attrib & 0x8000) printf("%-9s", dhdr.dname );
else printf("(%1d units)", dhdr.dname[0] );
printf(" %04X %Np %Np\n", dhdr.attrib, dhdr.strat, dhdr.intrp);
d=(charptr)dhdr.u.next;
}
}
copy18( char *d, charptr s )
{
int i;
for (i=0;i<18;++i)
d[i]=s[i];
}