Skip to content

Commit

Permalink
add c bindings for variable functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mcflugen committed Nov 9, 2024
1 parent 4d8790a commit 8d7730e
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions docs/source/bmi.var_funcs.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ int get_var_grid(in string name, out int grid);
def get_var_grid(self, name: str) -> int:
```
:::
:::{tab-item} c
:sync: c
```c
int get_var_grid(void *self, const char *name, int *grid);
```
:::
::::
Each input and output variable is defined on a grid.
Expand Down Expand Up @@ -69,6 +75,12 @@ int get_var_type(in string name, out string type);
def get_var_type(self, name: str) -> str:
```
:::
:::{tab-item} c
:sync: c
```c
int get_var_type(void *self, const char *name, char *type);
```
:::
::::
The `get_var_type` function provides the data type of the
Expand Down Expand Up @@ -107,6 +119,12 @@ int get_var_units(in string name, out string units);
def get_var_units(self, name: str) -> str:
```
:::
:::{tab-item} c
:sync: c
```c
int get_var_units(void *self, const char *name, char *units);
```
:::
::::
Get the units of the given variable.
Expand Down Expand Up @@ -151,6 +169,12 @@ int get_var_itemsize(in string name, out int size);
def get_var_itemsize(self, name: str) -> int:
```
:::
:::{tab-item} c
:sync: c
```c
int get_var_itemsize(void *self, const char *name, int *size);
```
:::
::::
The `get_var_itemsize` function provides the size, in bytes,
Expand Down Expand Up @@ -185,6 +209,12 @@ int get_var_nbytes(in string name, out int nbytes);
def get_var_nbytes(self, name: str) -> int:
```
:::
:::{tab-item} c
:sync: c
```c
int get_var_nbytes(void *self, const char *name, int *nbytes);
```
:::
::::
The `get_var_nbytes` function provides the total amount of memory used to store
Expand Down Expand Up @@ -217,6 +247,12 @@ int get_var_location(in string name, out string location);
def get_var_location(self, name: str) -> str:
```
:::
:::{tab-item} c
:sync: c
```c
int get_var_location(void *self, const char *name, char *location);
```
:::
::::
The `get_var_location` function,
Expand Down

0 comments on commit 8d7730e

Please sign in to comment.