src/ui-prefs.c
static bool process_pref_file_named(const char *path, bool quiet, bool user) {
	ang_file *f = file_open(path, MODE_READ, -1);
	errr e = 0;

	if (!f) {
		if (!quiet)
			msg("Cannot open '%s'.", path);

		e = PARSE_ERROR_INTERNAL; /* signal failure to callers */
	} else {
		char line[1024];
		int line_no = 0;

		struct parser *p = init_parse_prefs(user);
		while (file_getl(f, line, sizeof line)) {
			line_no++;

			e = parser_parse(p, line);
			if (e != PARSE_ERROR_NONE) {
				print_error(path, p);
				break;
			}
		}
		finish_parse_prefs(p);

		file_close(f);
		mem_free(parser_priv(p));
		parser_destroy(p);
	}

	/* Result */
	return e == PARSE_ERROR_NONE;
}
/**
 * Process the user pref file with a given path.
 *
 * \param name is the name of the pref file.
 * \param quiet means "don't complain about not finding the file".
 * \param user should be TRUE if the pref file is user-specific and not a game
 * default.
 */
Process the user pref file with a given path.
\param name is the name of the pref file.
\param quiet means "don't complain about not finding the file".
\param user should be TRUE if the pref file is user-specific and not a game
default.
Process the user pref file with a given path . \ param name is the name of the pref file . \ param quiet means " don ' t complain about not finding the file " . \ param user should be TRUE if the pref file is user - specific and not a game default .
static bool process_pref_file_named(const char *path, bool quiet, bool user) {
	ang_file *f = file_open(path, MODE_READ, -1);
	errr e = 0;
	if (!f) {
		if (!quiet)
			msg("Cannot open '%s'.", path);
		e = PARSE_ERROR_INTERNAL; 
	} else {
		char line[1024];
		int line_no = 0;
		struct parser *p = init_parse_prefs(user);
		while (file_getl(f, line, sizeof line)) {
			line_no++;
			e = parser_parse(p, line);
			if (e != PARSE_ERROR_NONE) {
				print_error(path, p);
				break;
			}
		}
		finish_parse_prefs(p);
		file_close(f);
		mem_free(parser_priv(p));
		parser_destroy(p);
	}
	return e == PARSE_ERROR_NONE;
}
static bool process_pref_file_named ( const char * path , bool quiet , bool user ) { ang_file * f = file_open ( path , MODE_READ , -1 ) ; errr e = 0 ; if ( ! f ) { if ( ! quiet ) msg ( " " , path ) ; e = PARSE_ERROR_INTERNAL ; } else { char line [ 1024 ] ; int line_no = 0 ; struct parser * p = init_parse_prefs ( user ) ; while ( file_getl ( f , line , sizeof line ) ) { line_no ++ ; e = parser_parse ( p , line ) ; if ( e != PARSE_ERROR_NONE ) { print_error ( path , p ) ; break ; } } finish_parse_prefs ( p ) ; file_close ( f ) ; mem_free ( parser_priv ( p ) ) ; parser_destroy ( p ) ; } return e == PARSE_ERROR_NONE ; }
Process the user pref file with a given path.
Process the user pref file with a given path .
/* signal failure to callers */ /* Result */