#include <stdio.h>
#include <sys/types.h>
#include "defs.h"
#include "struct.h"
#include "data.h"

int main()
{

    int i;
    struct queuewait *lwait;

    openmem(0);
    printf("Status tourn: %u \n",status->tourn);

    printf("    Queue name (number)   sem  max  free  cnt  flags");
    printf("  first,last ptr\n");
    for (i=0; i < MAXQUEUE; i++){
	printf("%20s(%1i)    %2i   %2i    %2i   %2u   %4i  %p,%p\n",
	       queues[i].q_name,
	       i,
	       queues[i].enter_sem,
	       queues[i].max_slots,
	       queues[i].free_slots,
	       queues[i].count,
	       queues[i].q_flags,
	       queues[i].first,
	       queues[i].last);
	lwait = queues[i].first;
	while (lwait != NULL){
	    printf("  Process %i, ",lwait->process);
	    printf("  prev %p,",lwait->previous); 
	    printf("  me:  %p,",lwait);
	    printf("  next %p,\n",lwait->next);
	    lwait = lwait->next;
	}
    }

    return 1;		/* satisfy lint */
}
