This repository has been archived on 2026-01-13 . You can view files and clone it. You cannot open issues or pull requests or push a commit.
master
cryioffi
Glue crate to use Rust libraries from C/C++ code.
Usage example of tiff crate in C:
#include <cryiorust_export.h>
int main() {
int dim1, dim2, ret = 0;
rust_tif_t *rt;
double *array;
/* get rust_tif_t pointer, if it is NULL, we have an error */
rt = rust_tif_new("cool_file.tif");
if (rt == NULL) {
ret = 1;
goto exit;
}
/* read dims of the array */
rust_tif_dims(rt, &dim1, &dim2);
array = malloc(dim1 * dim2 * sizeof(double));
/* read array, if result is 0, then it is an error */
if (!array || !rust_tif_read(rt, array)) {
ret = 2;
goto exit_free;
}
exit_free:
/* free rust_tif_t */
rust_tif_free(rt);
free(array);
exit:
return ret;
}
The exported unsafe functions do not do any checks.
License: GPL-3.0+
Languages
Rust
73.4%
CMake
18.9%
C
7.7%