From 1545914afff13e37bfcfee1b04828942e430a819 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Thu, 25 Mar 2021 10:11:12 -0400 Subject: Added endpoints and convenience functions for talking to the server. Completed task loop and run loop. --- player/utilities.F90 | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'player/utilities.F90') diff --git a/player/utilities.F90 b/player/utilities.F90 index c7fd523..2e19031 100644 --- a/player/utilities.F90 +++ b/player/utilities.F90 @@ -157,6 +157,7 @@ contains integer(kind=c_int32_t)::GetTempPath integer(kind=c_int32_t), value::n type(c_ptr), value::b + end function GetTempPath function GetTempFileName(pn, prefix, unique, b) bind(c, name='GetTempFileNameA') use iso_c_binding @@ -169,13 +170,13 @@ contains type(c_ptr)::tmp_path integer::res - tmp_path = c_malloc(1024) + tmp_path = c_malloc(int(1024, kind=c_size_t)) res = GetTempPath(1023, tmp_path) - tmp_name = c_malloc(1024) - res = GetTempFileName(tmp_path, c_null_ptr(), 0, tmp_name) + tmp_name = c_malloc(int(1024, kind=c_size_t)) + res = GetTempFileName(tmp_path, c_null_ptr, 0, tmp_name) - c_free(tmp_path) + call c_free(tmp_path) #else interface function tmpnam(p) bind(c, name='tmpnam') @@ -205,4 +206,17 @@ contains end function generate_temporary_filename + subroutine delete_file(filename) + implicit none + + character(*), intent(in)::filename + +#ifdef GNU + call unlink(filename) +#else + ! Not implemented... +#endif + + end subroutine delete_file + end module utilities \ No newline at end of file -- cgit v1.2.3