fitpack
Modern Fortran library for curve and surface fitting with splines
Loading...
Searching...
No Matches
fitpack_fitters_c::f_char Interface Reference

Pointer view of a null-terminated C string: a character(:,c_char), pointer result aliasing the C buffer — no copy, no allocation. Always associated: a null, zero-length or ABSENT input yields a 0-length module sentinel, safe to pass to required character(*) dummies and to trim(). Two overloads: More...

Public Member Functions

character(len=:, kind=c_char) function, pointer from_c_string_ptr_cptr (c_str)
 Pointer view from a type(c_ptr) C string. Aliases the C buffer; always associated (0-length sentinel for null/empty input). The sentinel is a NUL byte viewed as zero-length, so it is simultaneously an empty Fortran string and a valid empty C string: a callee that re-derives the length with strlen (any character(len=1) :: s(*) dummy) stops at the NUL instead of reading on into adjacent statics.
 
character(len=:, kind=c_char) function, pointer from_c_string_ptr_arr (c_str)
 Pointer view from a character(*) assumed-size C buffer. The dummy is optional: an absent argument (NULL passed to the optional bind(C) dummy) maps to the 0-length sentinel — always associated, safe for required character(*) callee dummies.
 

Detailed Description

Pointer view of a null-terminated C string: a character(:,c_char), pointer result aliasing the C buffer — no copy, no allocation. Always associated: a null, zero-length or ABSENT input yields a 0-length module sentinel, safe to pass to required character(*) dummies and to trim(). Two overloads:

  • f_char(c_str) with c_str a type(c_ptr)
  • f_char(c_str) with c_str a character(*) buffer (optional) Where the callee dummy is optional, use f_char_opt instead: it forwards an absent argument as a disassociated pointer, which an optional character(*) dummy reads as "not present" (F2018 15.5.2.12).

Member Function/Subroutine Documentation

◆ from_c_string_ptr_arr()

character(len=:, kind=c_char) function, pointer fitpack_fitters_c::f_char::from_c_string_ptr_arr ( character(len=1, kind=c_char), dimension(*), intent(in), optional, target c_str)

Pointer view from a character(*) assumed-size C buffer. The dummy is optional: an absent argument (NULL passed to the optional bind(C) dummy) maps to the 0-length sentinel — always associated, safe for required character(*) callee dummies.

Here is the call graph for this function:

◆ from_c_string_ptr_cptr()

character(len=:, kind=c_char) function, pointer fitpack_fitters_c::f_char::from_c_string_ptr_cptr ( type(c_ptr), intent(in) c_str)

Pointer view from a type(c_ptr) C string. Aliases the C buffer; always associated (0-length sentinel for null/empty input). The sentinel is a NUL byte viewed as zero-length, so it is simultaneously an empty Fortran string and a valid empty C string: a callee that re-derives the length with strlen (any character(len=1) :: s(*) dummy) stops at the NUL instead of reading on into adjacent statics.

Here is the call graph for this function:

The documentation for this interface was generated from the following file: