Skip to main content

sedona_geoarrow_c/
lib.rs

1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements.  See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership.  The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License.  You may obtain a copy of the License at
8//
9//   http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied.  See the License for the
15// specific language governing permissions and limitations
16// under the License.
17use std::ffi::CStr;
18
19mod error;
20mod geoarrow_c;
21mod geoarrow_c_bindgen;
22mod kernels;
23pub mod register;
24
25pub fn geoarrow_c_version() -> String {
26    let char_ptr = unsafe { geoarrow_c_bindgen::SedonaDBGeoArrowVersion() };
27    let c_str = unsafe { CStr::from_ptr(char_ptr).to_str().unwrap() };
28    c_str.to_string()
29}
30
31#[cfg(test)]
32mod tests {
33    use super::*;
34
35    #[test]
36    fn versions() {
37        assert_eq!(geoarrow_c_version(), "0.2.0-SNAPSHOT")
38    }
39}