return_a_string Subroutine

private subroutine return_a_string(ival, buffer) bind(c,name='return_a_string')

Just a test of f_string_to_c_ptr.

Arguments

Type IntentOptional Attributes Name
integer(kind=c_int), intent(in), value :: ival
type(c_ptr), intent(inout) :: buffer

a preallocated string buffer


Calls

proc~~return_a_string~~CallsGraph proc~return_a_string c_interface_module::return_a_string proc~f_string_to_c_ptr c_interface_module::f_string_to_c_ptr proc~return_a_string->proc~f_string_to_c_ptr interface~strlen c_interface_module::strlen proc~f_string_to_c_ptr->interface~strlen s s proc~f_string_to_c_ptr->s

Source Code

    subroutine return_a_string(ival,buffer) bind(c,name='return_a_string')

    implicit none

    integer(c_int),intent(in),value :: ival
    type(c_ptr),intent(inout)       :: buffer  !! a preallocated string buffer

    call f_string_to_c_ptr(repeat('*',ival),buffer)

    end subroutine return_a_string