87 if (q->
full(q) ==
true) {
112 if (q->
empty(q) ==
true) {
145 if (q->
empty(q) ==
true) {
151 if ((idx < 0) && (idx >= q->
count)) {
181 if (q->
full(q) ==
true) {
201 if (q->
full(q) ==
true) {
228 return ((
t_queue*)d)->count == 0;
252 return "ARRAY_QUEUE";
268 printf(
"%s {max: %d} {type:%s} {size: %d} {front/rear: [%d:%d]} \n",q->
name,
273 for (i = q->
front; (i != -1) && (i <= q->rear); i ++) {
301 while (q->
empty(q) !=
true) {
302 q->
free(q->
deq(q), __FILE__, __LINE__);
t_gen create_link_list(char *name, e_lltype type, t_dparams *prm)
Create an instance of link list
@ eDOUBLE_LINKLIST
Doubly Link list.
#define LOG_WARN(mod, fmt, args...)
#define free_mem(mem_addr)
#define get_mem(nmemb, size)
int queue_size(t_gen d)
Return queue size
bool queue_full(t_gen d)
Check queue full
t_gen queue_dequeue_arr(t_gen s)
pop front element in queue
void destroy_queue(t_gen d)
Destroy queue instance
void queue_enqueue_arr(t_gen s, t_gen data)
add element in queue
void queue_enqueue_ll(t_gen s, t_gen data)
add element in queue
bool queue_empty(t_gen d)
Check queue empty
void queue_print(t_gen d)
queue_print_info
t_gen queue_peek(t_gen d, int idx)
peek front element in queue
t_gen create_queue(char *name, int max_size, e_queuetype qtype, t_dparams *prm)
Destroy queue instance
t_gen queue_dequeue_ll(t_gen s)
pop front element in queue
f_ins q_enq[]
Look Up function ptrs to enq elems to queue.
f_gen q_deq[]
Look Up function ptrs to deq elems to queue.
Contains declations of queue types, operations and structure.
e_queuetype
types of queue
@ eLL_QUEUE_CIRC
Link List Based Queue.
@ eARRAY_QUEUE_CIRC
Array Based Queue.
f_free free
Routine used for freeing elements of said data.
f_print print_data
Routine used for printing elem data.
Link List main structure.
f_get_idx get_idx
routine to get node at idx
f_ins append
routine to Add elem at end of link list
f_print print
routine to print the link list
f_destroy destroy
routine destroy the link list instance
f_del_idx del_idx
routine to del node at idx
f_gen get_node_data
routine to get data in given node
f_len len
routine to get length queue
f_print print
routine to print queue elements
e_queuetype type
Stack Type.
char * name
Stack instance name.
f_gen deq
routine to pop elements out of queue
f_destroy destroy
routine to detroy queue instance
f_empty empty
routine to check if queue empty
f_genidx peek
routine to peek node in queue
int max_size
Max Size of queue.
f_full full
routine to check if queue full
int front
Queue Front Pointer.
int count
Total elems present in queue.
f_ins enq
routine to push elements to queue
t_gen * data
Ptr to link List or array based on type of queue.
int rear
Queue Rear Pointer.
void * t_gen
Base Data type used for all data structure and data elements.
f_vgen2 f_ins
fn type of insert elem function
t_gen(* f_gen)(t_gen)
Generic data pointer definitions that are common to most data structure operations.