From 09a2a56e22ce36238dce94f927f1909b63493960 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Wed, 6 May 2020 17:42:40 -0400 Subject: File type is now returned for evaluation. Initial routines for saving implemented but unused. --- main.F90 | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'main.F90') diff --git a/main.F90 b/main.F90 index 7b2319d..13ff29a 100644 --- a/main.F90 +++ b/main.F90 @@ -22,6 +22,7 @@ implicit none logical::populated integer::return_code + character(256)::return_type integer, parameter::io = 100 @@ -77,7 +78,7 @@ implicit none call r%report_status("Requesting "//trim(current_url)) - return_code = request_url(current_url, io) + return_code = request_url(current_url, io, return_type) populated = .true. call update_status(r, current_url, return_code) @@ -103,12 +104,21 @@ implicit none locations_visited => add_location(locations_visited, current_url) - first_line => load_unit(io, file_type_gemini) - loaded = .true. - call r%new_page() - call r%report_status("Performing Layout") - call layout_lines(first_line, r) - + if(r%type_supported(return_type)) then + + first_line => load_unit(io, file_type_gemini) + loaded = .true. + call r%new_page() + call r%report_status("Performing Layout") + call layout_lines(first_line, r) + + else + + call r%draw_error("Cannot display file of type "//return_type) + call back_location(locations_visited, current_url) + + end if + end if do while(loaded .and. running) -- cgit v1.2.3