00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 #ifndef CLUSTALO_QUEUE_H
00023 #define CLUSTALO_QUEUE_H
00024 
00025 #include "list.h"
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 typedef list_t queue_t;
00034 
00035 
00036 #define QUEUE_INIT(prQueue, destroy_func) ListInit((prQueue), (destroy_func))
00037 
00038 
00039 #define QUEUE_DESTROY(prQueue) ListDestroy((prQueue))
00040 
00041 
00042 #define QUEUE_PUSH(prQueue, data) LIST_APPEND((prQueue), (data))
00043 
00044 
00045 #define QUEUE_POP(prQueue, data) ListRemoveNext((prQueue), NULL, (data))
00046 
00047 
00048 #define QUEUE_EMPTY(prQueue) (0==LIST_SIZE((prQueue)))
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056 typedef queue_t int_queue_t;
00057 
00058 
00059 #define INT_QUEUE_INIT(prQueue) INT_LIST_INIT((prQueue))
00060 
00061 
00062 #define INT_QUEUE_DESTROY(prQueue) INT_LIST_DESTROY((prQueue))
00063 
00064 
00065 #define INT_QUEUE_PUSH(prQueue, data) INT_LIST_APPEND((prQueue), (data))
00066 
00067 
00068 #define INT_QUEUE_POP(prQueue, data) IntListRemoveNext((prQueue), NULL, (data))
00069 
00070 
00071 #define INT_QUEUE_EMPTY(prQueue) (0==INT_LIST_SIZE((prQueue)))
00072 
00073 
00074 
00075 #endif