00001 /* ndk - [ queue.h ] 00002 * 00003 * Basic abstract queue class 00004 * 00005 * (c)2004 dcipher / neuraldk 00006 * www.neuraldk.org 00007 */ 00008 00017 #include <errorCodes.h> 00018 #include <types.h> 00019 00020 // TODO: add "exandingQueue" class... will actually be a linked list of 00021 // these queue classes, used to mimick an infinitely large queue (no 00022 // max size)... advantage being, then able to reuse this code 00023 00024 typedef struct _Queue *Queue; 00025 00026 ErrorCode queueCreate(Queue *q, uint32 size); 00027 ErrorCode queueAdd(Queue q, Pointer item); 00028 ErrorCode queueGet(Queue q, Pointer *item); 00029 ErrorCode queuePeek(Queue q, Pointer *item); 00030 ErrorCode queueGetSize(Queue q, uint32 *size); 00031 ErrorCode queueGetRemaining(Queue q, uint32 *rem); 00032 ErrorCode queueDestroy(Queue *q); 00033