[#1] Adjusted the library to use the new server.
Removed the scribe and weave requirements. Scribe was only being used in the build, so it was switched to print statements. Weave was being used for error, but it was switched over to the Rust core and std error versions.
This commit is contained in:
parent
16878ec911
commit
19c15f8aff
15
Cargo.toml
15
Cargo.toml
@ -8,26 +8,17 @@ repository = "https://gitlab.com/CyberMages/Core/pact.git"
|
||||
documentation = ""
|
||||
keywords = ["c", "libc", "binding", "ffi", "pact", "nostd"]
|
||||
build = "build.rs"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
|
||||
[features]
|
||||
default = []
|
||||
use_std = ["scribe/use_std", "binding/use_std", "weave/use_std"]
|
||||
use_std = ["binding/use_std"]
|
||||
rust_lib = []
|
||||
no_mem_manip = []
|
||||
weak = []
|
||||
|
||||
|
||||
[build-dependencies.scribe]
|
||||
git = "ssh://git@gitlab.com/CyberMages/Core/scribe.git"
|
||||
|
||||
|
||||
[dependencies.scribe]
|
||||
git = "ssh://git@gitlab.com/CyberMages/Core/scribe.git"
|
||||
|
||||
[dependencies.binding]
|
||||
git = "ssh://git@gitlab.com/CyberMages/Core/binding.git"
|
||||
|
||||
[dependencies.weave]
|
||||
git = "ssh://git@gitlab.com/CyberMages/Core/weave.git"
|
||||
git = "ssh://gitea@workshop.cybermages.tech:3022/CyberMages/binding.git"
|
||||
|
17
build.rs
17
build.rs
@ -1,6 +1,3 @@
|
||||
use scribe::{error, warn};
|
||||
|
||||
|
||||
use std::env;
|
||||
use std::ffi::OsString;
|
||||
use std::path::PathBuf;
|
||||
@ -58,7 +55,7 @@ fn determine_output_dir() -> PathBuf
|
||||
Err(error) =>
|
||||
{
|
||||
// Then just default to "".
|
||||
warn!("{}", error);
|
||||
println!("WARN: {}", error);
|
||||
output_dir = PathBuf::new();
|
||||
}
|
||||
}
|
||||
@ -137,13 +134,15 @@ fn compile(src_files: &[PathBuf], output_name: &str) -> PathBuf
|
||||
{
|
||||
if output.status.success() == false
|
||||
{
|
||||
error!("{:?}", output);
|
||||
println!("ERROR: {:?}", output);
|
||||
panic!();
|
||||
}
|
||||
}
|
||||
|
||||
Err(error) =>
|
||||
{
|
||||
error!("{}", error);
|
||||
println!("ERROR: {}", error);
|
||||
panic!();
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,13 +163,15 @@ fn run(executable: PathBuf, args: &[PathBuf])
|
||||
{
|
||||
if output.status.success() == false
|
||||
{
|
||||
error!("{:?}", output);
|
||||
println!("ERROR: {:?}", output);
|
||||
panic!();
|
||||
}
|
||||
}
|
||||
|
||||
Err(error) =>
|
||||
{
|
||||
error!("{}", error);
|
||||
println!("ERROR: {}", error);
|
||||
panic!();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use weave::Error;
|
||||
//use weave::Error;
|
||||
use binding::CInt;
|
||||
|
||||
|
||||
@ -96,20 +96,28 @@ impl CError
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for CError
|
||||
impl std::fmt::Debug for CError
|
||||
{
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result
|
||||
{
|
||||
::std::fmt::Display::fmt(self, f)
|
||||
std::fmt::Display::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Display for CError
|
||||
impl std::fmt::Display for CError
|
||||
{
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result
|
||||
{
|
||||
//write!(f, "{}", self.to_str())
|
||||
write!(f, "{}", self.get_description())
|
||||
match *self
|
||||
{
|
||||
CError::None => { write!(f, "{}", "There was no error") }
|
||||
CError::Domain => { write!(f, "{}", "Math argument out of domain of function") }
|
||||
CError::Range => { write!(f, "{}", "Math result not representable") }
|
||||
CError::IllegalSequence => { write!(f, "{}", "Illegal byte sequence") }
|
||||
CError::Unhandled { errno: _val } =>
|
||||
{ write!(f, "{}", "Detected an Error not handled by CError") }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,20 +151,12 @@ impl Into<i32> for CError
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for CError
|
||||
impl std::error::Error for CError
|
||||
{
|
||||
fn get_description(&self) -> &str
|
||||
{
|
||||
match *self
|
||||
{
|
||||
CError::None => { "There was no error" }
|
||||
CError::Domain => { "Math argument out of domain of function" }
|
||||
CError::Range => { "Math result not representable" }
|
||||
CError::IllegalSequence => { "Illegal byte sequence" }
|
||||
CError::Unhandled { errno: _val } =>
|
||||
{ "Detected an Error not handled by CError" }
|
||||
}
|
||||
}
|
||||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)>
|
||||
{
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user