HuntnGather
/trunk/HuntnGather/Gather/Gather.c |
@@ -732,7 +732,7 @@ |
#else |
if((tp[i] = fopen(tmpNames->array[i], "r")) == NULL) { |
#endif |
fprintf(stderr, "Could not open file '%s' for reading.\n", tmpNames->array[i]); |
fprintf(stderr, "Could not open file '%s' for reading.\n", (char *)tmpNames->array[i]); |
// Close all temporary files. |
while(--i > -1) { |
#if defined ___AsyncIO___ |
@@ -861,7 +861,7 @@ |
return; |
} |
|
// Rememb er the last minimal line. |
// Remember the last minimal line. |
sprintf(rem, "%s", min); |
|
free(min); |
@@ -1076,7 +1076,7 @@ |
MergeTemporaryFiles(dbFile, tmpNames, stats->lines); |
|
// Remove all temporary files. |
RemoveFiles(tmpNames, tmpFiles); |
RemoveFiles(tmpNames); |
|
// Free temporary file names. |
free(tmpNames); |
/trunk/HuntnGather/shared/utilities.c |
@@ -272,6 +272,7 @@ |
*/ |
VECTOR *CreateTemporaryFiles(int files) { |
VECTOR *tmpNames; |
int total; |
|
if((tmpNames = malloc(1 * sizeof(*tmpNames))) == NULL) { |
fprintf(stderr, "Memory allocation failure.\n"); |
@@ -288,6 +289,7 @@ |
} |
|
tmpNames->length = 0; |
total = files; |
while(PROGRAM_RUN && --files > -1) { |
#if defined ___AmigaOS___ |
// Check if CTRL+C was pressed and abort the program. |
@@ -296,11 +298,11 @@ |
continue; |
} |
#endif |
tmpNames[files] = CreateTemporaryFile(); |
tmpNames->array[files] = CreateTemporaryFile(); |
++tmpNames->length; |
|
if(PROGRAM_VERBOSE) { |
fprintf(stdout, "Creating temporary files: %d%%.\r", 100 - (int)(((float)count / files) * 100.0)); |
fprintf(stdout, "Creating temporary files: %d%%.\r", (int)(((float)tmpNames->length / total) * 100.0)); |
} |
} |
|
@@ -479,19 +481,18 @@ |
#endif |
} |
|
|
/* |
* |
* Deletes files. |
*/ |
void RemoveFiles(char **names, int count) { |
void RemoveFiles(VECTOR *names) { |
int i; |
for(i = 0; i < count; ++i) { |
if(RemoveFile(names[i]) == FALSE) { |
fprintf(stderr, "Could not remove file '%s'.\n", names[i]); |
for(i = 0; i < names->length; ++i) { |
if(RemoveFile(names->array[i]) == FALSE) { |
fprintf(stderr, "Could not remove file '%s'.\n", (char *)names->array[i]); |
continue; |
} |
fprintf(stderr, "Removing file '%s'\n", names[i]); |
fprintf(stderr, "Removing file '%s'\n", (char *)names->array[i]); |
} |
} |
|
/trunk/HuntnGather/shared/utilities.h |
@@ -80,8 +80,8 @@ |
extern int CountFileLines(char *dbFile); |
extern char *PathToAbsolute(char *path); |
extern char *CreateTemporaryFile(void); |
extern char **CreateTemporaryFiles(int files); |
extern void RemoveFiles(char **names, int count); |
extern VECTOR *CreateTemporaryFiles(int files); |
extern void RemoveFiles(VECTOR *names); |
extern void CopyFile(char *a, char *b); |
|
extern dbEntry* CreateDatabaseEntry(dbLine *line); |