X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=contrib%2Fbobtoolz%2Flists.cpp;fp=contrib%2Fbobtoolz%2Flists.cpp;h=74e31bc89a2a00f07d2fcc206f1076ff8f92220b;hp=9830c3764134fee7ae7b86d4d0e5ad4a4a2640f8;hb=cd6613e5171544b68d4ae70546c90a15c99b22a5;hpb=cd7ff1a1798cfae5d14811a310f56d2f1908490b diff --git a/contrib/bobtoolz/lists.cpp b/contrib/bobtoolz/lists.cpp index 9830c376..74e31bc8 100644 --- a/contrib/bobtoolz/lists.cpp +++ b/contrib/bobtoolz/lists.cpp @@ -26,56 +26,58 @@ #include "misc.h" -bool LoadExclusionList(char *filename, std::list *exclusionList) -{ - FILE *eFile = fopen(filename, "r"); - if (eFile) { - char buffer[256]; - int cnt = 0; - while (!feof(eFile)) { - memset(buffer, 0, 256); - fscanf(eFile, "%s\n", buffer); - - if (strlen(buffer) > 0) { - exclusionList->push_back(buffer); - } else { - cnt++; - } - } - - fclose(eFile); - - return TRUE; - } - - globalErrorStream() << "Failed To Load Exclusion List: " << filename << "\n"; - return FALSE; +bool LoadExclusionList( char* filename, std::list* exclusionList ){ + FILE* eFile = fopen( filename, "r" ); + if ( eFile ) { + char buffer[256]; + int cnt = 0; + while ( !feof( eFile ) ) + { + memset( buffer, 0, 256 ); + fscanf( eFile, "%s\n", buffer ); + + if ( strlen( buffer ) > 0 ) { + exclusionList->push_back( buffer ); + } + else{ + cnt++; + } + } + + fclose( eFile ); + + return TRUE; + } + + globalErrorStream() << "Failed To Load Exclusion List: " << filename << "\n"; + return FALSE; } -bool LoadGList(char *filename, ui::ListStore loadlist) -{ - FILE *eFile = fopen(filename, "r"); - if (eFile) { - char buffer[256]; - int cnt = 0; - while (!feof(eFile)) { - memset(buffer, 0, 256); - fscanf(eFile, "%s\n", buffer); - - if (strlen(buffer) > 0) { - char *buffer2 = new char[strlen(buffer) + 1]; - strcpy(buffer2, buffer); - loadlist.append(0, buffer2); - } else { - cnt++; - } - } - - fclose(eFile); - - return TRUE; - } - - globalErrorStream() << "Failed To Load GList: " << filename << "\n"; - return FALSE; +bool LoadGList( char* filename, ui::ListStore loadlist ){ + FILE* eFile = fopen( filename, "r" ); + if ( eFile ) { + char buffer[256]; + int cnt = 0; + while ( !feof( eFile ) ) + { + memset( buffer, 0, 256 ); + fscanf( eFile, "%s\n", buffer ); + + if ( strlen( buffer ) > 0 ) { + char* buffer2 = new char[strlen( buffer ) + 1]; + strcpy( buffer2, buffer ); + loadlist.append(0, buffer2); + } + else{ + cnt++; + } + } + + fclose( eFile ); + + return TRUE; + } + + globalErrorStream() << "Failed To Load GList: " << filename << "\n"; + return FALSE; }