00001 00030 #ifndef FS_ 00031 #define FS_ 00032 00033 #include <string> 00034 #include <map> 00035 00036 using namespace std; 00037 00039 #define MAX_FS_ERROR_COUNTER 3 00040 00042 00043 struct ltstr { 00044 bool operator()(const string s1, const string s2) const { 00045 return (s1<s2); 00046 } 00047 }; 00048 00050 00055 struct file_struct { 00056 string full_name; 00057 int max_clients; 00058 int cur_clients; 00059 }; 00060 00062 00067 struct database_struct { 00068 map<const string, file_struct*, ltstr> files; 00069 pthread_mutex_t mutex; 00070 }; 00071 00073 00077 int get_filesize(const char* filename); 00078 00080 00091 void* req_server(void* csk); 00092 00094 00110 void* listen (void* sock); 00111 00112 int main(int argc, char* argv[]); 00113 00114 #endif /*FS_*/