Dump to a buffer and return the pointer to the resulting string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L | ||||
type(cbuf_type), | intent(out) | :: | buf | |||
integer | :: | length | ||||
integer | :: | iError |
subroutine flu_dump_toBuf(L, buf, length, iError) type(flu_State) :: L type(cbuf_type), intent(out) :: buf integer :: length integer :: iError type(c_ptr) :: string_c integer(kind=c_int) :: length_c integer(kind=c_int) :: iErr string_c = dump_lua_toBuf(L%state, length_c, iErr) iError = int(iErr) if (iError == 0) then length = int(length_c) buf%ptr = string_c call c_f_pointer(string_c, buf%buffer, [length]) else length = 0 end if end subroutine flu_dump_toBuf