options.player_name = NULL;
options.identifier = NULL;
options.level_nr = NULL;
+ options.drop_file = NULL;
options.display_nr = 0;
if (option_arg == next_option)
options_left++;
}
+ else if (strncmp(option, "-drop-file", option_len) == 0)
+ {
+ if (option_arg == NULL)
+ FailWithHelp("option '%s' requires an argument", option_str);
+
+ options.drop_file = getStringCopy(option_arg);
+ if (option_arg == next_option)
+ options_left++;
+ }
else if (strncmp(option, "-verbose", option_len) == 0)
{
options.verbose = TRUE;
return result;
}
-int get_switch3_from_string(char *s)
+int get_switch_3_state_from_string(char *s)
{
char *s_lower = getStringToLower(s);
int result = FALSE;
get_integer_from_string(s) == 1)
result = TRUE;
else if (strEqual(s_lower, "auto"))
- result = AUTO;
+ result = STATE_AUTO;
+ else if (strEqual(s_lower, "ask"))
+ result = STATE_ASK;
free(s_lower);
#define MAX_BUFFER_SIZE 4096
-File *openFile(char *filename, char *mode)
+File *openFile(const char *filename, const char *mode)
{
File *file = checked_calloc(sizeof(File));
return fgets(line, size, file->file);
}
-int copyFile(char *filename_from, char *filename_to)
+int copyFile(const char *filename_from, const char *filename_to)
{
File *file_from, *file_to;
return 0;
}
-boolean touchFile(char *filename)
+boolean touchFile(const char *filename)
{
FILE *file;