v4.0.4-rc
This commit is contained in:
parent
73df7a5e74
commit
dddbe4b320
@ -18,6 +18,8 @@
|
|||||||
#ifndef GLACIERDATA_H_
|
#ifndef GLACIERDATA_H_
|
||||||
#define GLACIERDATA_H_
|
#define GLACIERDATA_H_
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* create_node
|
* create_node
|
||||||
*
|
*
|
||||||
@ -58,7 +60,7 @@ void add_child(struct node *parent, struct node *child);
|
|||||||
/*
|
/*
|
||||||
* print_tree
|
* print_tree
|
||||||
*
|
*
|
||||||
* DESCRIPTION: Print_tree prints a dependency tree specified at its root node
|
* DESCRIPTION: Print_tree prints a dependency tree specified at its root node.
|
||||||
* PARAMETERS:
|
* PARAMETERS:
|
||||||
* struct node *root -> The tree to print
|
* struct node *root -> The tree to print
|
||||||
* int level -> The number of levels to descend
|
* int level -> The number of levels to descend
|
||||||
@ -74,6 +76,16 @@ void print_tree(struct node *root, int level);
|
|||||||
|
|
||||||
/**************************************************************************************************************/
|
/**************************************************************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* queue
|
||||||
|
*
|
||||||
|
* DESCRIPTION: Queue is a type definition for the queue data structure.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef struct queue;
|
||||||
|
|
||||||
|
/**************************************************************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* init_queue
|
* init_queue
|
||||||
*
|
*
|
||||||
@ -95,7 +107,7 @@ void init_queue(queue *q);
|
|||||||
/*
|
/*
|
||||||
* queue_is_empty
|
* queue_is_empty
|
||||||
*
|
*
|
||||||
* DESCRIPTION: Queue_is_empty checks if queue *q is empty
|
* DESCRIPTION: Queue_is_empty checks if queue *q is empty.
|
||||||
* PARAMETERS:
|
* PARAMETERS:
|
||||||
* queue *q -> The queue to check
|
* queue *q -> The queue to check
|
||||||
* RETURN VALUES:
|
* RETURN VALUES:
|
||||||
@ -116,7 +128,7 @@ bool queue_is_empty(queue *q);
|
|||||||
/*
|
/*
|
||||||
* queue_is_full
|
* queue_is_full
|
||||||
*
|
*
|
||||||
* DESCRIPTION: Queue_is_full checks if queue *q is full
|
* DESCRIPTION: Queue_is_full checks if queue *q is full.
|
||||||
* PARAMETERS:
|
* PARAMETERS:
|
||||||
* queue *q -> The queue to check
|
* queue *q -> The queue to check
|
||||||
* RETURN VALUES:
|
* RETURN VALUES:
|
||||||
@ -137,20 +149,80 @@ bool queue_is_full(queue *q);
|
|||||||
/*
|
/*
|
||||||
* enqueue
|
* enqueue
|
||||||
*
|
*
|
||||||
* DESCRIPTION: Enqueue enqueues an element at the back of the queue
|
* DESCRIPTION: Enqueue enqueues an element at the back of the queue.
|
||||||
* PARAMETERS:
|
* PARAMETERS:
|
||||||
* queue *q -> The queue to enqueue to
|
* queue *q -> The queue to enqueue to
|
||||||
* int value ->
|
* int value -> The value of the element to enqueue
|
||||||
* RETURN VALUES:
|
* RETURN VALUES:
|
||||||
* true on full, false on not full
|
* None.
|
||||||
* CAVEATS:
|
* CAVEATS:
|
||||||
* None.
|
* None.
|
||||||
* EXAMPLE:
|
* EXAMPLE:
|
||||||
* if (queue_is_full(q)) {
|
* if (! queue_is_full(q)) {
|
||||||
* printf("Queue is full\n");
|
* enqueue(q, 15);
|
||||||
* return;
|
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
void enqueue(queue *q, int value);
|
||||||
|
|
||||||
|
/**************************************************************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* dequeue
|
||||||
|
*
|
||||||
|
* DESCRIPTION: Dequeue dequeues an element at the front of the queue.
|
||||||
|
* PARAMETERS:
|
||||||
|
* queue *q -> The queue to dequeue to
|
||||||
|
* RETURN VALUES:
|
||||||
|
* None.
|
||||||
|
* CAVEATS:
|
||||||
|
* None.
|
||||||
|
* EXAMPLE:
|
||||||
|
* if (! queue_is_empty(q)) {
|
||||||
|
* dequeue(q);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
|
||||||
|
void dequeue(queue *q);
|
||||||
|
|
||||||
|
/**************************************************************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* peek
|
||||||
|
*
|
||||||
|
* DESCRIPTION: Peek displays the first element in a specified queue.
|
||||||
|
* PARAMETERS:
|
||||||
|
* queue *q -> The queue to peek at
|
||||||
|
* RETURN VALUES:
|
||||||
|
* -1 on queue is empty, element value (!= -1) on success
|
||||||
|
* CAVEATS:
|
||||||
|
* None.
|
||||||
|
* EXAMPLE:
|
||||||
|
* if (! queue_is_full(q)) {
|
||||||
|
* peek(q);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
|
||||||
|
int peek(queue *q);
|
||||||
|
|
||||||
|
/**************************************************************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* print_queue
|
||||||
|
*
|
||||||
|
* DESCRIPTION: Print_queue displays the contents of the queue in order.
|
||||||
|
* PARAMETERS:
|
||||||
|
* queue *q -> The queue to print
|
||||||
|
* RETURN VALUES:
|
||||||
|
* None.
|
||||||
|
* CAVEATS:
|
||||||
|
* None.
|
||||||
|
* EXAMPLE:
|
||||||
|
* if (! queue_is_full(q)) {
|
||||||
|
* print_queue(q);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
|
||||||
|
void print_queue(queue *q);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user