Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dggal-rust"
version = "0.0.1"
version = "0.0.4"
edition = "2021"
description = "The dggal-rust crate"
license-file = "LICENSE"
Expand Down
16 changes: 16 additions & 0 deletions NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Notes

When changing to a new version, do this:

* update submodules for ecere/dggal and ecere/eC using `git submodule update --remote --merge`
* copy these files
```
cp ecere/eC/bindings/rust/ecrt.rs src/bindings/ecrt.rs
cp ecere/eC/bindings/rust/ecrt_cffi.rs src/ffi/ecrt_cffi.rs
cp ecere/dggal/bindings/rust/dggal.rs src/bindings/dggal.rs
cp ecere/dggal/bindings/rust/dggal_cffi.rs src/ffi/dggal_cffi.rs
````
* add `unsafe impl` Send and Sync for Application {}, DGGRS {}, and DGGAL {}
* make sure to adjust the `use` statements
* replace the README.md
* run `cargo fmt`
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ or running [fetchAndBuild.sh](fetchAndBuild.sh) / [fetchAndBuild.bat](fetchAndBu
This method will use this `eC-core` branch meant to be used with the [stand-alone eC development kit and eC runtime library](https://github.com/ecere/eC),
avoiding unnecessary dependencies on other components of the Ecere SDK runtime library.

The script will clone both the eC and DGGAL repositories and build everything, including the C, C++, rust and Python bindings
The script will clone both the eC and DGGAL repositories and build everything, including the C, C++, Rust and Python bindings
if the required development tools are properly installed and configured.

## Language bindings

While the library is written in the [eC programming language](https://ec-lang.org), object-oriented bindings for C, C++ and Python generated using the
Ecere SDK's [`bgen` tool](https://github.com/ecere/bgen) are provided. Partial bindings for rust are available as well.
Ecere SDK's [`bgen` tool](https://github.com/ecere/bgen) are provided. Bindings for Rust are available as well.
Support for additional languages may be added in the future.

### C Bindings
Expand All @@ -69,11 +69,11 @@ Python bindings (depending on the C bindings) are [available here](https://githu

A Python example using the DGGAL Python bindings is [available here](https://github.com/ecere/dggal/blob/eC-core/bindings_examples/py/info.py).

### rust Bindings
### Rust Bindings

rust bindings (depending on the C bindings) are [available here](https://github.com/ecere/dggal/tree/eC-core/bindings/rust).
Rust bindings (depending on the C bindings) are [available here](https://github.com/ecere/dggal/tree/eC-core/bindings/rust).

A rust example using the DGGAL rust bindings is [available here](https://github.com/ecere/dggal/blob/eC-core/bindings_examples/rust/info.rs).
A Rust example using the DGGAL Rust bindings is [available here](https://github.com/ecere/dggal/blob/eC-core/bindings_examples/rust/info.rs).

## `dgg` tool

Expand Down
2 changes: 1 addition & 1 deletion ecere/dggal
Submodule dggal updated 58 files
+91 −1 Makefile.dggal
+91 −1 Makefile.dggal.static
+103 −63 README.md
+1 −1 bindings/c/Makefile.dggal_c.static
+137 −7 bindings/c/dggal.c
+208 −21 bindings/c/dggal.h
+162 −0 bindings/c_fn/Makefile
+166 −0 bindings/c_fn/Makefile.allinone
+389 −0 bindings/c_fn/dggal_c.c
+145 −0 bindings/c_fn/dggal_c.h
+378 −1 bindings/cpp/dggal.cpp
+7,001 −1,864 bindings/cpp/dggal.hpp
+156 −19 bindings/py/cffi-dggal.h
+505 −12 bindings/py/dggal.py
+1 −1 bindings/rust/dggal.rs
+283 −25 bindings/rust/dggal_cffi.rs
+37 −5 bindings_examples/c/info.c
+149 −0 bindings_examples/c_fn/Makefile
+250 −0 bindings_examples/c_fn/info.c
+38 −5 bindings_examples/cpp/info.cpp
+10 −3 bindings_examples/py/togeo.py
+12 −2 bindings_examples/py/togeo_json.py
+12 −2 bindings_examples/py/togeo_text.py
+21 −7 bindings_examples/rust/geom.rs
+23 −10 bindings_examples/rust/info.rs
+22 −8 bindings_examples/rust/list.rs
+21 −7 bindings_examples/rust/zone.rs
+1 −1 commands/geom.ec
+46 −12 commands/info.ec
+8 −1 commands/togeo.ec
+7 −1 commands/zone.ec
+35 −9 dgg.ec
+1 −5 dgg.epj
+12 −18 dggal.epj
+123 −64 dggal.org/index.html
+14 −0 fetchAndBuild.bat
+14 −0 fetchAndBuild.sh
+ images/isea3h-grid-level3.png
+2 −2 src/dggrs/GNOSISGlobalGrid.ec
+1,000 −0 src/dggrs/HEALPixGrid.ec
+16 −15 src/dggrs/I3HSubZones.ec
+13 −0 src/dggrs/ISEA4R.ec
+13 −0 src/dggrs/ISEA7H.ec
+13 −0 src/dggrs/IVEA4R.ec
+13 −0 src/dggrs/IVEA7H.ec
+334 −315 src/dggrs/RI3H.ec
+870 −0 src/dggrs/RI4R.ec
+2,801 −0 src/dggrs/RI7H.ec
+27 −58 src/dggrs/RI9R.ec
+13 −0 src/dggrs/RTEA4R.ec
+13 −0 src/dggrs/RTEA7H.ec
+48 −32 src/dggrs/rHEALPixGrid.ec
+9 −1 src/projections/icoVertexGreatCircle.ec
+18 −5 src/projections/rHEALPix.ec
+14 −7 src/projections/ri5x6.ec
+191 −3 tests/dggalTest.ec
+1 −1 tests/dggalTest.epj
+161 −161 tests/dggrs/isea3HTests.ec
8 changes: 5 additions & 3 deletions src/bindings/dggal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//#![allow(unused_variables)]

use crate::bindings::ecrt;

use crate::ffi::ecrt_cffi as ecrt_sys;

use crate::define_bitclass;
Expand Down Expand Up @@ -69,15 +70,14 @@ macro_rules! CRS {
pub const epsg: dggal_sys::CRSRegistry = dggal_sys::CRSRegistry_CRSRegistry_epsg;
pub const ogc: dggal_sys::CRSRegistry = dggal_sys::CRSRegistry_CRSRegistry_ogc;

unsafe impl Sync for DGGRS {}
unsafe impl Send for DGGRS {}
unsafe impl Sync for DGGAL {}
unsafe impl Send for DGGAL {}
pub struct DGGRS {
imp: dggal_sys::DGGRS,
mDGGAL: ecrt_sys::Module,
}

unsafe impl Send for DGGAL {}
unsafe impl Sync for DGGAL {}
pub struct DGGAL {
mDGGAL: ecrt_sys::Module,
}
Expand Down Expand Up @@ -1428,6 +1428,8 @@ impl Drop for DGGRS {
}
}

unsafe impl Sync for DGGRS {}

#[repr(transparent)]
pub struct DGGSJSONDepth(pub Instance);
delegate_ttau64_and_default!(DGGSJSONDepth);
Expand Down
Loading