cache Module


Uses


Functions

public function get_cache_dir() result(cache_dir)

Arguments

None

Return Value character(len=:), allocatable

public function get_cache_subdir(subdir_name) result(subdir_path)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: subdir_name

Return Value character(len=:), allocatable

public function get_cache_key(source_files, dependencies) result(cache_key)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: source_files(:)
character(len=*), intent(in) :: dependencies(:)

Return Value character(len=64)

public function get_fpm_digest(source_dir) result(digest_key)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: source_dir

Return Value character(len=32)

public function cache_exists(hash_key) result(cache_found)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: hash_key

Check if cache entry exists

Return Value logical

public function get_content_hash(source_files) result(hash_key)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: source_files(:)

Generate content-based hash using FPM's fnv_1a algorithm

Return Value character(len=32)

public function get_single_file_content_hash(file_path) result(hash_key)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: file_path

Generate content-based hash for a single file using FPM's fnv_1a algorithm

Return Value character(len=32)


Subroutines

public subroutine ensure_cache_dir(cache_dir, success)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: cache_dir
logical, intent(out) :: success

public subroutine ensure_cache_structure(cache_dir, success)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: cache_dir
logical, intent(out) :: success

public subroutine store_module_cache(cache_key, module_files, success)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: cache_key
character(len=*), intent(in) :: module_files(:)
logical, intent(out) :: success

public subroutine store_executable_cache(cache_key, executable_path, success)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: cache_key
character(len=*), intent(in) :: executable_path
logical, intent(out) :: success

public subroutine store_build_artifacts(hash_key, build_dir, success)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: hash_key

Store compiled modules and executables in cache

character(len=*), intent(in) :: build_dir

Store compiled modules and executables in cache

logical, intent(out) :: success

public subroutine retrieve_build_artifacts(hash_key, target_dir, success)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: hash_key

Retrieve cached build artifacts

character(len=*), intent(in) :: target_dir

Retrieve cached build artifacts

logical, intent(out) :: success

public subroutine invalidate_cache(hash_key, success)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: hash_key

Remove cache entry

logical, intent(out) :: success

public subroutine clear_cache(custom_cache_dir, success)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: custom_cache_dir
logical, intent(out) :: success

public subroutine get_cache_info(custom_cache_dir, info)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: custom_cache_dir
character(len=*), intent(out) :: info