Allocate a new ocean handle and return its opaque C pointer. Caller
(rdb_ocean_create_from_string) is responsible for eventually
passing it to handle_destroy — including on every early-return
failure path, so a handle that never reached is_initialised does
not leak.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(ocean_handle_t), | private, | pointer | :: | h |
function handle_create() result(c_handle) !! Allocate a new ocean handle and return its opaque C pointer. Caller !! (`rdb_ocean_create_from_string`) is responsible for eventually !! passing it to `handle_destroy` — including on every early-return !! failure path, so a handle that never reached `is_initialised` does !! not leak. type(c_ptr) :: c_handle type(ocean_handle_t), pointer :: h allocate (h) h%magic = MAGIC_OCEAN c_handle = c_loc(h) end function handle_create