#include <stdlib.h>
#include <stdio.h>


/* Doubly Linked List to use as the Queue */
typedef struct _q_node {
        int value;
        struct _q_node *prev;
        struct _q_node *next;
} q_node;

typedef struct _Queue {
        q_node *head;
        q_node *tail;
        int size;
} Queue;

void init_queue(Queue *q); 

/* Insert value at the end of q.*/
void insert_q(Queue *q, int value);

/* Remove value from the end of q*/
void remove_q(Queue *q, int value);

/*Return the value of the first in queue.*/
int next_in_q(Queue *q);

/* Returns the size of the queue (if > 0, queue is not empty)*/
int is_empty_q(Queue *q);

/* Returns the value of the first in queue and deletes it from the queue.*/
int pop_next_in_q(Queue *q);

/* Prints out the contents of the queue.*/
void print_q(Queue *q);

/* Returns an int array of the values in q (excluding the head and tail)*/
void view_q(Queue *q, int **contents);
