aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 22a4ac8..bfffa31 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -2,5 +2,18 @@ pub mod dsb;
pub mod types;
-mod error;
+pub(crate) mod error;
pub use error::Error;
+
+/// create a new dsb_parse error
+#[macro_export]
+macro_rules! err_dsb_parse {
+ ($fmt:expr) => ({
+ $crate::error::Error::DsbParse{ msg: ($fmt).
+ to_string() }
+ });
+ ($fmt:expr, $($arg:tt)*) => ({
+ $crate::error::Error::DsbParse{ msg: format!
+ ($fmt, $($arg)*) }
+ });
+}