Module dc_hash

module dc_hash

        ! Uses
    use dc_types, only : STRING

        ! Types
    public type HASH
    private type HASH_INTERNAL

        ! Interfaces
    public interface Put
    public interface Size
    public interface Put_Line
    public interface Rewind
    public interface Next
    public interface Get
    public interface Delete

        ! Subroutines and functions
    private subroutine DCHashPut (hashv, key, value)
    private function DCHashSize (hashv) result (result)
    private subroutine DCHashRewind (hashv)
    private subroutine DCHashNext (hashv, key, value, end)
    private subroutine DCHashPut_Line (hashv)
    private subroutine DCHashGet (hashv, key, value, found)
    private subroutine DCHashDelete (hashv, key)

end module dc_hash

Description of Types

HASH

public type HASH
    private
    type (HASH_INTERNAL), pointer, dimension (:) :: hash_table => null ()
    integer :: search_index = 0
end type HASH

HASH_INTERNAL

private type HASH_INTERNAL
    private
    character (len=STRING) :: key
    character (len=STRING) :: value
end type HASH_INTERNAL

Description of Interfaces

Put

public interface Put
    module procedure DCHashPut
end interface Put

Size

public interface Size
    module procedure DCHashSize
end interface Size

Put_Line

public interface Put_Line
    module procedure DCHashPut_Line
end interface Put_Line

Rewind

public interface Rewind
    module procedure DCHashRewind
end interface Rewind

Next

public interface Next
    module procedure DCHashNext
end interface Next

Get

public interface Get
    module procedure DCHashGet
end interface Get

Delete

public interface Delete
    module procedure DCHashDelete
end interface Delete

Description of Subroutines and Functions

DCHashPut

private subroutine DCHashPut (hashv, key, value)
    type (HASH), intent(inout) :: hashv
    character (len=*), intent(in) :: key
    character (len=*), intent(in) :: value
    ! Calls: DCHashGet
end subroutine DCHashPut

DCHashSize

private function DCHashSize (hashv) result (result)
    type (HASH), intent(in) :: hashv
    integer :: result
end function DCHashSize

DCHashRewind

private subroutine DCHashRewind (hashv)
    type (HASH), intent(inout) :: hashv
end subroutine DCHashRewind

DCHashNext

private subroutine DCHashNext (hashv, key, value, end)
    type (HASH), intent(inout) :: hashv
    character (len=*), intent(out) :: key
    character (len=*), optional, intent(out) :: value
    logical, intent(out) :: end
end subroutine DCHashNext

DCHashPut_Line

private subroutine DCHashPut_Line (hashv)
    type (HASH), intent(in) :: hashv
    ! Calls: DCHashNext, DCHashRewind, Printf
end subroutine DCHashPut_Line

DCHashGet

private subroutine DCHashGet (hashv, key, value, found)
    type (HASH), intent(inout) :: hashv
    character (len=*), intent(in) :: key
    character (len=*), intent(out) :: value
    logical, optional, intent(out) :: found
    ! Calls: DCHashNext, DCHashRewind
end subroutine DCHashGet

DCHashDelete

private subroutine DCHashDelete (hashv, key)
    type (HASH), intent(inout) :: hashv
    character (len=*), optional, intent(in) :: key
    ! Calls: DCHashGet
end subroutine DCHashDelete