00001 #ifndef NPSML_QUEUE_H 00002 #define NPSML_QUEUE_H 00003 00004 typedef struct queue* nps_queue; 00005 00006 /* nps_queue_new: constructor 00007 * nps_queue_free: destructor 00008 */ 00009 nps_queue nps_queue_new(void); 00010 void nps_queue_free(nps_queue); 00011 00012 /* accessors (non-destructive) 00013 * nps_queue_empty: returns 1 if queue is empty, 0 otherwise 00014 * nps_queue_peek: returns element at the front of queue 00015 */ 00016 int nps_queue_empty(nps_queue); 00017 void* nps_queue_peek(nps_queue); 00018 00019 /* manipulators (destructive) 00020 * nps_queue_enqueue: add element to the back of the queue 00021 * nps_queue_dequeue: remove element from front of queue and return it 00022 */ 00023 void nps_queue_enqueue(void*, nps_queue); 00024 void* nps_queue_dequeue(nps_queue); 00025 00026 #endif