q = (char *) alloca (len + 1);
memcpy (q, p, len + 1);
i = len - 1;
- while (i >=0 && IS_DIR_SEPARATOR(q[i]))
+ while (i >=0 && IS_DIR_SEPARATOR (q[i]))
q[i--] = '\0';
if (stat (q, &st))
else
gfc_advance_line ();
- if (gfc_at_eof())
+ if (gfc_at_eof ())
goto not_continuation;
/* We've got a continuation line. If we are on the very next line after
}
-static gfc_try load_file (const char *, const char *, bool);
+static bool load_file (const char *, const char *, bool);
/* include_line()-- Checks a line buffer to see if it is an include
line. If so, we call load_file() recursively to load the included
read by anything else. */
filename = gfc_widechar_to_char (begin, -1);
- if (load_file (filename, NULL, false) == FAILURE)
+ if (!load_file (filename, NULL, false))
exit (FATAL_EXIT_CODE);
free (filename);
/* Load a file into memory by calling load_line until the file ends. */
-static gfc_try
+static bool
load_file (const char *realfilename, const char *displayedname, bool initial)
{
gfc_char_t *line;
fprintf (stderr, "%s:%d: Error: File '%s' is being included "
"recursively\n", current_file->filename, current_file->line,
filename);
- return FAILURE;
+ return false;
}
if (initial)
if (input == NULL)
{
gfc_error_now ("Can't open file '%s'", filename);
- return FAILURE;
+ return false;
}
}
else
{
fprintf (stderr, "%s:%d: Error: Can't open included file '%s'\n",
current_file->filename, current_file->line, filename);
- return FAILURE;
+ return false;
}
}
add_file_change (NULL, current_file->inclusion_line + 1);
current_file = current_file->up;
linemap_add (line_table, LC_LEAVE, 0, NULL, 0);
- return SUCCESS;
+ return true;
}
-/* Open a new file and start scanning from that file. Returns SUCCESS
- if everything went OK, FAILURE otherwise. If form == FORM_UNKNOWN
+/* Open a new file and start scanning from that file. Returns true
+ if everything went OK, false otherwise. If form == FORM_UNKNOWN
it tries to determine the source form from the filename, defaulting
to free form. */
-gfc_try
+bool
gfc_new_file (void)
{
- gfc_try result;
+ bool result;
if (gfc_cpp_enabled ())
{