alc_list.h

Go to the documentation of this file.
00001 
00034 #ifndef _ALCLIST_H_
00035 #define _ALCLIST_H_
00036 
00037 #ifdef _MSC_VER
00038 #include <winsock2.h>
00039 #else
00040 #include <pthread.h>
00041 #include <sys/socket.h>
00042 #include <sys/time.h>
00043 #endif
00044 
00045 #include "defines.h"
00046 
00052 typedef struct alc_rcv_container {
00053     char recvbuf[MAX_PACKET_LENGTH]; 
00054     struct sockaddr_storage from;       
00056 #ifdef _MSC_VER
00057     int fromlen;                                        
00058 #else
00059     socklen_t fromlen;                          
00060 #endif
00061 
00062     int recvlen;                                        
00064     struct timeval time_stamp;
00065 } alc_rcv_container_t;
00066 
00072 typedef struct alc_list_node {
00073     struct alc_list_node  *next; 
00074     void  *data;                                
00075 } alc_list_node_t;
00076 
00082 typedef struct alc_list {
00083     struct alc_list_node  *first_elem; 
00084     struct alc_list_node  *last_elem;  
00086 #ifdef _MSC_VER
00087     RTL_CRITICAL_SECTION session_variables_semaphore; 
00088 #else
00089     pthread_mutex_t session_variables_semaphore;      
00090 #endif
00091 
00092 } alc_list_t;
00093 
00102 void push_back(alc_list_t *a_list, alc_rcv_container_t *a_data);
00103 
00112 void push_front(alc_list_t *a_list, alc_rcv_container_t *a_data);
00113 
00123 alc_rcv_container_t *pop_front(alc_list_t *a_list);
00124 
00134 int is_empty(const alc_list_t *a_list);
00135 
00143 alc_list_t* build_list(void);
00144 
00152 void destroy_list(alc_list_t *a_list);
00153 
00154 #endif

Generated on Fri Mar 9 20:08:50 2007 for MAD-FCL by  doxygen 1.5.0