Skip to content

Commit

Permalink
ENH: Fix script for C API.
Browse files Browse the repository at this point in the history
  • Loading branch information
MilanSkocic committed Jul 3, 2024
1 parent 4e75b04 commit 21d1767
Show file tree
Hide file tree
Showing 7 changed files with 2,763 additions and 2,763 deletions.
4 changes: 2 additions & 2 deletions scripts/gen_capi.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def write_constant(f, var, name, value, uncertainty, unit, year, count):
cnames.append(", ".join(cname[indexes[i]: indexes[i+1]]))
cnames.append(", ".join(cname[indexes[-1]:]))

f.write(f"type(codata_capi_constant_type), protected, public, bind(C, name=\"{var:s}{suffix}\") ::&" + ctag + newline)
f.write(f"codata_capi_{count:d}{suffix} = codata_capi_constant_type([ &" + ctag + newline)
f.write(f"type(capi_constant_type), protected, public, bind(C, name=\"{var:s}{suffix}\") ::&" + ctag + newline)
f.write(f"capi_{count:d}{suffix} = capi_constant_type([ &" + ctag + newline)

# last not comma at the end
for _cname in cnames[:-1]:
Expand Down
1,340 changes: 670 additions & 670 deletions src/capi_constants_2010.f90

Large diffs are not rendered by default.

1,340 changes: 670 additions & 670 deletions src/capi_constants_2014.f90

Large diffs are not rendered by default.

1,416 changes: 708 additions & 708 deletions src/capi_constants_2018.f90

Large diffs are not rendered by default.

1,420 changes: 710 additions & 710 deletions src/capi_constants_2022.f90

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/capi_constants_type.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module codata__capi_constants_type
use iso_c_binding, only: c_char, c_double
private

type, bind(C), public :: codata_capi_constant_type
type, bind(C), public :: capi_constant_type
!! Derived type for representing a Codata constant in C.
character(kind=c_char) :: name(65)
real(c_double) :: value
Expand Down
4 changes: 2 additions & 2 deletions src/capi_version.f90
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ module codata__capi_version

character(len=:), allocatable, target :: version_c

public :: codata_capi_get_version
public :: capi_get_version

contains


function codata_capi_get_version()bind(C, name="codata_get_version")result(cptr)
function capi_get_version()bind(C, name="codata_get_version")result(cptr)
!! Get the version
implicit none
type(c_ptr) :: cptr
Expand Down

0 comments on commit 21d1767

Please sign in to comment.