diff options
author | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-04-02 13:08:37 -0400 |
---|---|---|
committer | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-04-02 13:08:37 -0400 |
commit | b27bd7cfa58eb82fc2a6c76aaa848e07a6fa7c24 (patch) | |
tree | f611937418d1ea5416431715ab1f6a44d42d1905 /captain/special.f90 | |
parent | da47fdfddc46e35a939b7771eda21debec50c094 (diff) | |
download | levitating-b27bd7cfa58eb82fc2a6c76aaa848e07a6fa7c24.tar.gz levitating-b27bd7cfa58eb82fc2a6c76aaa848e07a6fa7c24.zip |
API calls to the gemini interface should work. API calls to the titan interface need implementation.
Diffstat (limited to 'captain/special.f90')
-rw-r--r-- | captain/special.f90 | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/captain/special.f90 b/captain/special.f90 new file mode 100644 index 0000000..1bbf220 --- /dev/null +++ b/captain/special.f90 @@ -0,0 +1,53 @@ +module special_filenames +implicit none + +contains + + function get_special_full_filename(category, filename) result(res) + use utilities, only: combine_paths + use config + implicit none + + character(*), intent(in)::category, filename + character(len=:), pointer::res + + res => null() + + if(trim(category) == "releases") then + allocate(character(len=(len_trim(release_dir)+len_trim(filename)+1)) :: res) + call combine_paths(release_dir, filename, res) + else if(trim(category) == "uploads") then + allocate(character(len=(len_trim(release_dir)+len_trim(filename)+1)) :: res) + call combine_paths(release_dir, filename, res) + else if(trim(category) == "results") then + allocate(character(len=(len_trim(results_dir)+len_trim(filename)+1)) :: res) + call combine_paths(results_dir, filename, res) + else if(trim(category) == "static") then + allocate(character(len=(len_trim(static_dir)+len_trim(filename)+1)) :: res) + call combine_paths(static_dir, filename, res) + else if(trim(category) == "favicon.txt") then + allocate(character(len=(len_trim(static_dir)+len_trim(filename)+1)) :: res) + call combine_paths(static_dir, filename, res) + else if(trim(category) == "instructions") then + allocate(character(len=(len_trim(instructions_dir)+len_trim(filename)+1)) :: res) + call combine_paths(instructions_dir, filename, res) + end if + + end function get_special_full_filename + + function get_instructions_static_filename(instruction_id) result(res) + use captain_db + implicit none + + integer, intent(in)::instruction_id + character(len=:), pointer::res + + character(PLAYER_NAME_LENGTH)::instruction_name + + call get_instruction_name(instruction_id, instruction_name) + + res => get_special_full_filename("instructions", trim(instruction_name)//".json") + + end function get_instructions_static_filename + +end module special_filenames |