
// browse.cpp
void UpDirectory(char * mp3path, char * mp3pathout);
bool IsWinampFile(fileinfo * file);
bool IsWinampFile(char * filename);
void AddFileToList(connection * conn,WIN32_FIND_DATA *find, char* mp3path, filesearch * search);
bool GoodPath(char* mp3path);
int Browse(connection * conn, char * mp3path);


// ClientConnection.cpp
DWORD WINAPI ClientConnection(LPVOID socket_param);
void MakeLogEntry(connection * conn);

// Config.cpp
BOOL CALLBACK ConfigUsersWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
BOOL CALLBACK ConfigAboutWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
BOOL CALLBACK ConfigServerWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
BOOL CALLBACK ConfigWebPageWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
BOOL CALLBACK ConfigBrowseWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
BOOL CALLBACK ConfigLogWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);

void config_read();
void config_write();
void ViewLog();
void NewConfig();

// Config_users.cpp
BOOL CALLBACK ConfigUsersWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
void UpdateUserInfoBoxes(HWND hwndDlg, HWND hwndList, char * ini_file, int item);
void DisplayDlgAccess(HWND hwndDlg, int access);
int GetDlgAccess(HWND hwndDlg);
user * RetrieveUsers(user * users, char * ini_file);
void UpdateUserList(char * ini_file, HWND hwndList);
void UpdateDlgUser(char * ini_file, HWND hwndDlg, HWND hwndList);
void UpdateUser(char * ini_file,char * username, char * password, int access);
void DeleteDlgUser(char * ini_file, HWND hwndDlg, HWND hwndList);
void DeleteUser(char * ini_file, char * username);

// DeletePlaylistEntry.cpp
int DeletePlaylistEntry(int track);
void FreePlaylist(playlistitem * startitem);
int DeletePlaylistEntry2(connection * conn, int track);

// main.cpp
BOOL WINAPI _DllMainCRTStartup(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved);
int init();
void config();
void quit();
bool InitServerSocket();
DWORD WINAPI HTTPServerThread(LPVOID param);
HWND WAwnd();
void Insert(fileinfo *file1, fileinfo *file2);
bool GoesBefore(char *file1, char *file2);

//net_http_html.cpp
void prints(connection * conn, char * string);
void flush(connection * conn);
void printsi(connection * conn, int number);
void ReportError(connection * conn, char * errstring);
void Send400(connection * conn);
bool GetRequest(connection * conn);
bool DecodeUrl(connection * conn);
void ListArgs(connection * conn);
bool GetArgValue(connection * conn, char * name, char * value, int len);
void Unescape_url(char * url);
char x2c(char *what);
void Escape_url(char * url);


// security.cpp
bool MD5(char * input, char * output, int output_len);
int SendBasic401(connection * conn,char * realm);
char * FindSubString(char * buffer,char * target);
void FindBasicAuth(connection * conn, char * buffer);
void ToBase64(char * instr, char * outstr);
void FromBase64(char * instr, char * outstr);
int CheckCredentials(connection * conn, char * user, char * pass);
int GetUserAccess(char * ini_file,char * user);

// strings.cpp
char * GetDelimitedString(char * buffer, char delimiter, char * result, int result_len);
bool GetUnquotedString(char * buffer, char * result, int result_len);
bool GetQuotedString(char * buffer, char * result, int result_len);
bool StartString(char* string1, char* string2);
char * GetAString(char* chptr, char* text);
void PrintTime(connection * conn, int mins, int seconds);
void PrintTrackTime(connection * conn);
void ToLowerCase(char * string);
char ToLowerCase(char c);
bool StrComp(char * string1, char * string2);
void ReplaceSlashes(char * string);
char * GetFilename(char * path);
int atoi2(const char *str );
bool contains(char * echars,char ch);
char * strstr2(char *string, char *substring);
