-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
79 additions
and
461 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
|
||
## Supported Versions | ||
The `HEAD` and the latest release are supported by the Airup developers. The maintained versions are: | ||
- Mainline: `0.10.4` | ||
- Stable: `0.10.4` | ||
- Mainline: `0.10.5` | ||
- Stable: `0.10.5` | ||
|
||
## Reporting a Vulnerability | ||
Please [contact @sisungo](mailto:[email protected]) to report a vulnerability. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ authors = ["sisungo <[email protected]>"] | |
description = "SDK library of Airup" | ||
documentation = "https://docs.rs/airup-sdk" | ||
repository = "https://github.com/sisungo/airup" | ||
version = "0.10.4" | ||
version = "0.10.5" | ||
edition = "2021" | ||
license = "MIT" | ||
|
||
|
@@ -14,11 +14,11 @@ license = "MIT" | |
crate-type = ["rlib", "cdylib"] | ||
|
||
[features] | ||
_internal = ["tokio-1", "ffi"] | ||
_internal = ["tokio-1", "blocking", "ffi"] | ||
ffi = ["blocking"] | ||
blocking = [] | ||
nonblocking = [] | ||
ffi = ["blocking"] | ||
tokio-1 = ["tokio", "nonblocking"] | ||
tokio-1 = ["dep:tokio", "nonblocking"] | ||
|
||
[dependencies] | ||
cfg-if = "1" | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +0,0 @@ | ||
//! # Airup SDK for C | ||
//! This module contains Airup SDK for the C programming language. | ||
pub mod error; | ||
pub mod info; | ||
pub mod system; | ||
pub mod util; | ||
|
||
/// # Safety | ||
/// The caller must guarantee the pointer `path` is valid. | ||
#[no_mangle] | ||
pub unsafe extern "C" fn airup_connect( | ||
path: *const libc::c_char, | ||
) -> Option<Box<super::blocking::Connection>> { | ||
let path = std::ffi::CStr::from_ptr(path); | ||
match super::blocking::Connection::connect(&*path.to_string_lossy()) { | ||
Ok(conn) => Some(Box::new(conn)), | ||
Err(err) => { | ||
error::set_last_error(err.into()); | ||
None | ||
} | ||
} | ||
} | ||
|
||
#[no_mangle] | ||
pub extern "C" fn airup_disconnect(conn: Box<super::blocking::Connection>) { | ||
drop(conn); | ||
} | ||
|
||
#[no_mangle] | ||
pub extern "C" fn airup_build_manifest() -> *const libc::c_char { | ||
static VALUE: std::sync::OnceLock<std::ffi::CString> = std::sync::OnceLock::new(); | ||
|
||
let default = || { | ||
std::ffi::CString::new(include_str!("../../../build_manifest.json")) | ||
.expect("`build_manifest.json` should never contain NUL") | ||
}; | ||
|
||
VALUE.get_or_init(default).as_ptr() | ||
} | ||
|
||
#[no_mangle] | ||
pub extern "C" fn airup_default_path() -> *const libc::c_char { | ||
static VALUE: std::sync::OnceLock<std::ffi::CString> = std::sync::OnceLock::new(); | ||
|
||
let default = || { | ||
std::ffi::CString::new(&*crate::socket_path().to_string_lossy()) | ||
.expect("`AIRUP_SOCK` should never contain NUL") | ||
}; | ||
|
||
VALUE.get_or_init(default).as_ptr() | ||
} | ||
Oops, something went wrong.