functiondump_links
character(len=:) function dump_links(p) result(text)
How entities are connected, as JSON, for comparison with FORD.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| p | type(project_t) | in | the project |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| text | character(len=:) | privateallocatable |
Calls
Source
Show the code
function dump_links(p) result(text)
type(project_t), intent(in) :: p !! the project
character(len=:), allocatable :: text
type(json_core) :: json
type(json_value), pointer :: root, node
integer :: k
call json%initialize()
call json%create_object(root, '')
do k = 1, p%list%n
associate (e => p%list%box(k)%e)
select case (e%kind)
case (E_MODULE, E_SUBMODULE, E_PROGRAM, E_SUBROUTINE, E_FUNCTION, E_MODPROC, E_INTERFACE, E_BOUNDPROC, E_TYPE)
if (allocated(e%external_url) .or. .not. allocated(e%name)) cycle
if (e%kind == E_BOUNDPROC .and. .not. allocated(e%more%binding_ids)) cycle
if (e%kind == E_TYPE) then
call json%create_object(node, qualified_name(p, k)//'#type')
else
call json%create_object(node, qualified_name(p, k))
end if
call json%add(root, node)
call add_links(json, node, p, k)
end select
end associate
end do
call json%serialize(root, text)
call json%destroy(root)
end function dump_links