-/*
- * Copyright (C) 2012, 2013, 2014
- * Wolfgang Bumiller
- * Dale Weiler
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is furnished to do
- * so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
#include <string.h>
#include <stdlib.h>
static void opts_setdefault(void) {
memset(&opts, 0, sizeof(opts_cmd_t));
- OPTS_OPTION_BOOL(OPTION_CORRECTION) = true;
OPTS_OPTION_STR(OPTION_PROGSRC) = "progs.src";
/* warnings */
}
static size_t opts_ini_parse (
- fs_file_t *filehandle,
+ FILE *filehandle,
char *(*loadhandle)(const char *, const char *, const char *, char **),
char **errorhandle,
char **parse_file
char *read_name;
char *read_value;
- while (fs_file_getline(&line, &linesize, filehandle) != FS_FILE_EOF) {
+ while (util_getline(&line, &linesize, filehandle) != EOF) {
parse_beg = line;
/* handle BOM */
if (!strcmp(section, "includes")) {
static const char *include_error_beg = "failed to open file `";
static const char *include_error_end = "' for inclusion";
- fs_file_t *file = fs_file_open(value, "r");
+ FILE *file = fopen(value, "r");
found = true;
if (!file) {
vec_append(error, strlen(include_error_beg), include_error_beg);
/* Change the file name */
mem_d(*parse_file);
*parse_file = util_strdup(value);
- fs_file_close(file);
+ fclose(file);
}
}
char *error = NULL;
char *parse_file = NULL;
size_t line;
- fs_file_t *ini;
+ FILE *ini;
if (!file) {
/* try ini */
- if (!(ini = fs_file_open((file = "gmqcc.ini"), "r")))
+ if (!(ini = fopen((file = "gmqcc.ini"), "r")))
/* try cfg */
- if (!(ini = fs_file_open((file = "gmqcc.cfg"), "r")))
+ if (!(ini = fopen((file = "gmqcc.cfg"), "r")))
return;
- } else if (!(ini = fs_file_open(file, "r")))
+ } else if (!(ini = fopen(file, "r")))
return;
con_out("found ini file `%s`\n", file);
}
mem_d(parse_file);
- fs_file_close(ini);
+ fclose(ini);
}