From 6dc92dae79fe0d442fee170bbbc1d66d7a2862c2 Mon Sep 17 00:00:00 2001 From: oddsock Date: Thu, 15 Jan 2004 04:24:57 +0000 Subject: [PATCH] fixed some variable definitions to be ANSI compatable. updated win32 project files with new files svn path=/trunk/icecast/; revision=5761 --- src/auth.c | 8 +++++--- src/cfgfile.c | 15 +++++++++------ win32/Icecast2win.clw | 18 +++++++++--------- win32/icecast.dsp | 16 ++++++++++++++++ 4 files changed, 39 insertions(+), 18 deletions(-) diff --git a/src/auth.c b/src/auth.c index db618a40..63484bda 100644 --- a/src/auth.c +++ b/src/auth.c @@ -24,6 +24,7 @@ auth_result auth_check_client(source_t *source, client_t *client) { auth_t *authenticator = source->authenticator; + auth_result result; if(authenticator) { /* This will look something like "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" */ @@ -56,7 +57,7 @@ auth_result auth_check_client(source_t *source, client_t *client) username = userpass; password = tmp+1; - auth_result result = authenticator->authenticate( + result = authenticator->authenticate( authenticator, username, password); if(result == AUTH_OK) @@ -118,12 +119,12 @@ static int get_line(FILE *file, char *buf, int len) static char *get_hash(char *data, int len) { struct MD5Context context; + unsigned char digest[16]; MD5Init(&context); MD5Update(&context, data, len); - unsigned char digest[16]; MD5Final(digest, &context); return util_bin_to_hex(digest, 16); @@ -179,11 +180,12 @@ static auth_result htpasswd_auth(auth_t *auth, char *username, char *password) static auth_t *auth_get_htpasswd_auth(config_options_t *options) { auth_t *authenticator = calloc(1, sizeof(auth_t)); + htpasswd_auth_state *state; authenticator->authenticate = htpasswd_auth; authenticator->free = htpasswd_clear; - htpasswd_auth_state *state = calloc(1, sizeof(htpasswd_auth_state)); + state = calloc(1, sizeof(htpasswd_auth_state)); while(options) { if(!strcmp(options->name, "filename")) diff --git a/src/cfgfile.c b/src/cfgfile.c index 1c7d33f8..5cde40df 100644 --- a/src/cfgfile.c +++ b/src/cfgfile.c @@ -106,6 +106,7 @@ void config_clear(ice_config_t *c) mount_proxy *mount, *nextmount; aliases *alias, *nextalias; int i; + config_options_t *option; if (c->config_filename) free(c->config_filename); @@ -172,7 +173,7 @@ void config_clear(ice_config_t *c) xmlFree(mount->fallback_mount); xmlFree(mount->auth_type); - config_options_t *option = mount->auth_options; + option = mount->auth_options; while(option) { config_options_t *nextopt = option->next; xmlFree(option->name); @@ -451,6 +452,8 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node, mount_proxy *mount = calloc(1, sizeof(mount_proxy)); mount_proxy *current = configuration->mounts; mount_proxy *last=NULL; + xmlNodePtr option; + config_options_t *last_option; while(current) { last = current; @@ -506,8 +509,8 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node, } else if (strcmp(node->name, "authentication") == 0) { mount->auth_type = xmlGetProp(node, "type"); - xmlNodePtr option = node->xmlChildrenNode; - config_options_t *last = NULL; + option = node->xmlChildrenNode; + last_option = NULL; while(option != NULL) { if(strcmp(option->name, "option") == 0) { config_options_t *opt = malloc(sizeof(config_options_t)); @@ -525,11 +528,11 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node, continue; } - if(last) - last->next = opt; + if(last_option) + last_option->next = opt; else mount->auth_options = opt; - last = opt; + last_option = opt; } option = option->next; } diff --git a/win32/Icecast2win.clw b/win32/Icecast2win.clw index b6a6d629..eef4a237 100755 --- a/win32/Icecast2win.clw +++ b/win32/Icecast2win.clw @@ -13,19 +13,19 @@ Class2=CIcecast2winDlg Class3=CAboutDlg ResourceCount=10 -Resource1=IDD_CONFIGDIALOG +Resource1=IDD_SSTATUS Resource2=IDR_MAINFRAME -Resource3=IDD_ICECAST2WIN_DIALOG -Resource4=IDR_MENU3 +Resource3=IDD_ABOUTBOX +Resource4=IDR_MENU2 Class4=CStatus -Resource5=IDD_STATSDIALOG +Resource5=IDR_TRAY Class5=CConfigTab Class6=CStatsTab -Resource6=IDR_MENU2 -Resource7=IDD_SSTATUS -Resource8=IDD_ABOUTBOX -Resource9=IDR_TRAY -Resource10=IDR_MENU4 +Resource6=IDR_MENU4 +Resource7=IDD_ICECAST2WIN_DIALOG +Resource8=IDD_CONFIGDIALOG +Resource9=IDR_MENU3 +Resource10=IDD_STATSDIALOG [CLS:CIcecast2winApp] Type=0 diff --git a/win32/icecast.dsp b/win32/icecast.dsp index 89f42445..064f25fe 100644 --- a/win32/icecast.dsp +++ b/win32/icecast.dsp @@ -93,6 +93,14 @@ SOURCE=..\src\admin.h # End Source File # Begin Source File +SOURCE=..\src\auth.c +# End Source File +# Begin Source File + +SOURCE=..\src\auth.h +# End Source File +# Begin Source File + SOURCE=..\src\avl\avl.c # End Source File # Begin Source File @@ -213,6 +221,14 @@ SOURCE=..\src\main.c # End Source File # Begin Source File +SOURCE=..\src\md5.c +# End Source File +# Begin Source File + +SOURCE=..\src\md5.h +# End Source File +# Begin Source File + SOURCE=..\src\os.h # End Source File # Begin Source File