90 integer,
dimension(:),
allocatable :: list_data
95 integer,
dimension(:),
pointer :: data => null()
104 integer,
dimension(:),
intent(in),
optional ::
data
109 if (present(
data))
then
110 allocate(self%data(
size(
data)))
124 do while (
associated(current))
126 if (
associated(current%data))
then
127 deallocate(current%data)
139 integer,
dimension(:),
intent(in),
optional ::
data
144 if (present(
data))
then
145 allocate(next%data(
size(
data)))
151 next%next => self%next
158 integer,
dimension(:),
intent(in) ::
data
160 if (
associated(self%data))
then
161 deallocate(self%data)
170 integer,
dimension(:),
pointer ::
data
197 call
list_init(list, transfer(ptr, list_data))
198 print *,
'Initializing list with data:', ptr%p
206 print *,
'Inserting node with data:', ptr%p
210 print *,
'Second node data:', ptr%p
215 print *,
'Head node data:', ptr%p
type(list_node_t) function, pointer, public list_next(self)
subroutine, public list_insert(self, data)
subroutine, public list_put(self, data)
subroutine, public list_init(self, data)
subroutine, public list_free(self)
integer function, dimension(:), pointer, public list_get(self)