return addListEntry(list->next, token, value);
}
+#if 0
#ifdef DEBUG
static void printSetupFileList(SetupFileList *list)
{
printSetupFileList(list->next);
}
#endif
+#endif
#ifdef DEBUG
DEFINE_HASHTABLE_INSERT(insert_hash_entry, char, char);
char *directory_name)
{
#if 0
- static unsigned long progress_delay = 0;
- unsigned long progress_delay_value = 100; /* (in milliseconds) */
+ static unsigned int progress_delay = 0;
+ unsigned int progress_delay_value = 100; /* (in milliseconds) */
#endif
char *directory_path = getPath2(level_directory, directory_name);
char *filename = getPath2(directory_path, LEVELINFO_FILENAME);
LevelDirTree *level_node)
{
#if 0
- static unsigned long progress_delay = 0;
- unsigned long progress_delay_value = 100; /* (in milliseconds) */
+ static unsigned int progress_delay = 0;
+ unsigned int progress_delay_value = 100; /* (in milliseconds) */
#endif
int type = (*artwork_node)->type;
{
static char *level_directory = NULL;
DIR *dir;
+#if 0
struct dirent *dir_entry;
+#endif
/* check for more levels besides the 'levels' field of 'levelinfo.conf' */
if ((dir = opendir(level_directory)) == NULL)
{
Error(ERR_WARN, "cannot read level directory '%s'", level_directory);
+
return;
}
+#if 0
while ((dir_entry = readdir(dir)) != NULL) /* last directory entry */
{
if (strlen(dir_entry->d_name) > 4 &&
levelnum_value = atoi(levelnum_str);
-#if 0
if (levelnum_value < leveldir_current->first_level)
{
Error(ERR_WARN, "additional level %d found", levelnum_value);
Error(ERR_WARN, "additional level %d found", levelnum_value);
leveldir_current->last_level = levelnum_value;
}
-#endif
}
}
+#endif
closedir(dir);
}
BEGIN_HASH_ITERATION(level_setup_hash, itr)
{
char *token = HASH_ITERATION_TOKEN(itr);
- char *value = HASH_ITERATION_TOKEN(itr);
+ char *value = HASH_ITERATION_VALUE(itr);
if (strlen(token) == 3 &&
token[0] >= '0' && token[0] <= '9' &&
{
int level_nr = atoi(token);
- LevelStats_setPlayed(level_nr, atoi(value));
- LevelStats_setSolved(level_nr, atoi(strchr(value, ' ')));
+ if (value != NULL)
+ LevelStats_setPlayed(level_nr, atoi(value)); /* read 1st column */
+
+ value = strchr(value, ' ');
+
+ if (value != NULL)
+ LevelStats_setSolved(level_nr, atoi(value)); /* read 2nd column */
}
}
END_HASH_ITERATION(hash, itr)