subroutinepush
subroutine push(list, s)
Append s to list, allocating it if needed.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| list | type(string_t) | inout | allocatabledimension(:) | the list |
| s | character(len=*) | in | the string to append |
Called by
- add_call
- add_links
- add_value
- admonition_lines
- apply_attributes
- apply_one
- apply_table
- array_values
- check_settings
- collect_definitions
- collect_docs
- connect
- doxygen_meta
- doxygen_params
- expand_file_includes
- find_sources
- link_calls
- list_items
- map_values
- parse_args
- parse_metadata
- parse_procedure_header
- read_binding
- read_declaration
- read_module_procedures
- read_tree
- read_type_statement
- row_cells
- sort_strings
- split_chunks
- split_on
- split_words
- stash_fenced_code
- stash_html
- stash_html_blocks
- top_split
- unique_id
Source
Show the code
subroutine push(list, s)
type(string_t), allocatable, intent(inout) :: list(:) !! the list
character(len=*), intent(in) :: s !! the string to append
type(string_t), allocatable :: tmp(:)
integer :: n, k
n = 0
if (allocated(list)) n = size(list)
allocate (tmp(n + 1))
do k = 1, n
call move_alloc(list(k)%s, tmp(k)%s)
end do
tmp(n + 1)%s = s
call move_alloc(tmp, list)
end subroutine push