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.
2022-04-19 16:17:02 +02:00
2021-10-28 15:21:24 +02:00
2021-12-27 15:37:00 +01:00
2021-10-28 12:53:20 +02:00
2022-04-19 16:17:02 +02:00
2021-12-29 20:42:37 +01:00
2021-10-28 15:21:24 +02:00

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+

S
Description
No description provided
Readme
37 KiB
0 Stars 1 Watchers 0 Forks
Languages
Rust 73.4%
CMake 18.9%
C 7.7%