Sync usage with man page.
[netbsd-mini2440.git] / external / bsd / ntp / dist / include / ntp_data_structures.h
blob58b9d6114f94746c0e5fd00cbd357f1ea526e51c
1 /* $NetBSD$ */
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
7 * simulator.
9 * Written By: Sachin Kamboj
10 * University of Delaware
11 * Newark, DE 19711
12 * Copyright (c) 2006
15 #ifndef __NTP_DATA_STRUCTURES_H__
16 #define __NTP_DATA_STRUCTURES_H__
19 /* Structures for storing a priority queue
20 * ---------------------------------------
23 typedef struct node {
24 union {
25 struct node *next;
26 double d;
27 } nodeu;
28 } node;
29 #define node_next nodeu.next
31 typedef struct Queue {
32 int (*get_order)(void *, void *);
33 node *front;
34 int no_of_elements;
35 } queue;
38 /* FUNCTION PROTOTYPES
39 * -------------------
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);
55 #endif