
#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];
}


