#include <stdio.h>
#include <string.h>
#ifdef MSDOS
#include <dir.h>
#include <dos.h>
#include <io.h>
#endif

#ifdef MSDOS
char *dirname = ".";
#else
char *dirname = "/nos";
#endif

typedef short int int16;

/* a mailbox entry */
struct let {
	long	start;
	long	size;
	long	bid;
	int16	status;
};


void main (int argc, char *argv[])
{
char buf[128];
struct let ff;
FILE *fp;
int k = 1;

	sprintf (buf, "%s/spool/mail/control/%s.ctl", dirname, argv[1]);
	fp = fopen (buf, "rb");
	printf (" #   START      SIZE      BID     STAT\n");
	while (!feof (fp))	{
		fread (&ff, sizeof(struct let), 1, fp);
		if (feof (fp))
			continue;
		printf ("%02d) %08lx  %08lx  %08lx  %04x\n", k, ff.start, ff.size, ff.bid, ff.status);
		k++;
	}
}

