#ifndef AQ_H_SEEN
#define AQ_H_SEEN
/*************************************************************

/**************************************************/
/* Define the structures to be used inside of alarmQueue.  These are */
/* private parts so don't look at them. */
struct aqueue_record {
    struct aqueue_record *succ;
    struct aqueue_record *pred;
    struct alarm_packet alarm;
};
typedef struct aqueue_record aq_record;

struct alarm_queue {
    aq_record *head;	/* The head of the list. */
    aq_record *curr;	/* The last alarm found in the list. */
    aq_record *firstInCoinc;	/* The first alarm in coincidence */
    aq_record *lastInCoinc;	/* The last alarm in coincidence. */
};
typedef struct alarm_queue AQ;


AQ* insert_alarm(AQ*, struct alarm_packet* alarm);

AQ* init_aq();
int sizeofaq(AQ*);
AQ *clean_aq(AQ*);
AQ *delete_one_alarm(AQ*);
AQ *return_front(AQ*);
int alarmcmp(aq_record*,aq_record*);
int search_aq(AQ*);

#endif
