3 /* ntp_data_structures.h
5 * This file contains the structures and function prototypes for the data
6 * structures used by the ntp configuration code and the discrete event
9 * Written By: Sachin Kamboj
10 * University of Delaware
15 #ifndef __NTP_DATA_STRUCTURES_H__
16 #define __NTP_DATA_STRUCTURES_H__
19 /* Structures for storing a priority queue
20 * ---------------------------------------
29 #define node_next nodeu.next
31 typedef struct Queue
{
32 int (*get_order
)(void *, void *);
38 /* FUNCTION PROTOTYPES
41 queue
*create_priority_queue(int (*get_order
)(void *, void *));
42 void destroy_queue(queue
*my_queue
);
43 void *get_node(size_t size
);
44 void free_node(void *my_node
);
45 void *next_node(void *my_node
);
46 int empty(queue
*my_queue
);
47 void *queue_head(queue
*my_queue
);
48 queue
*enqueue(queue
*my_queue
, void *my_node
);
49 void *dequeue(queue
*my_queue
);
50 int get_no_of_elements(queue
*my_queue
);
51 void append_queue(queue
*q1
, queue
*q2
);
52 int get_fifo_order(void *el1
, void *el2
);
53 queue
*create_queue(void);