priority_queue.h File Reference

A simple priority queue. More...

Detailed Description

A simple priority queue.

Author
Kaspar Schleiser kaspa.nosp@m.r@sc.nosp@m.hleis.nosp@m.er.d.nosp@m.e

Definition in file priority_queue.h.

#include <stddef.h>
#include <stdint.h>
+ Include dependency graph for priority_queue.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  priority_queue_node
 data type for priority queue nodes More...
 
struct  priority_queue_t
 data type for priority queues More...
 

Macros

#define PRIORITY_QUEUE_NODE_INIT   { NULL, 0, 0 }
 Static initializer for priority_queue_node_t.
 
#define PRIORITY_QUEUE_INIT   { NULL }
 Static initializer for priority_queue_t.
 

Typedefs

typedef struct priority_queue_node priority_queue_node_t
 data type for priority queue nodes
 

Functions

static void priority_queue_node_init (priority_queue_node_t *priority_queue_node)
 Initialize a priority queue node object. More...
 
static void priority_queue_init (priority_queue_t *priority_queue)
 Initialize a priority queue object. More...
 
priority_queue_node_tpriority_queue_remove_head (priority_queue_t *root)
 remove the priority queue's head More...
 
void priority_queue_add (priority_queue_t *root, priority_queue_node_t *new_obj)
 insert new_obj into root based on its priority More...
 
void priority_queue_remove (priority_queue_t *root, priority_queue_node_t *node)
 remove node from root More...
 
void priority_queue_print (priority_queue_t *root)
 print the data and priority of every node in the given priority queue More...
 
void priority_queue_print_node (priority_queue_t *root)
 print the data, priority, and successor of a given node More...