Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Eric v39.6.4.0 #6

Merged
merged 6 commits into from
Aug 5, 2024
Merged
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
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ To send the xml file, the path and password of the Elster certificate has to be
| Rust SDK | Eric |
| -------- | -------- |
| 0.1.0 | 38.1.6.0 |
| 0.2.0 | 39.6.4.0 |

### Test SDK

Expand Down
6 changes: 6 additions & 0 deletions eric-bindings/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
- changed
- removed

## v0.3.0 (2024-08-04)

- changed
- Support documentation for Eric v39.6.4.0

## v0.2.0 (2024-08-04)

- changed
- Support documentation for Eric v38.1.6.0
- Rename feature from `docs-rs` to `no-build`

## v0.1.2 (2024-08-03)
Expand Down
4 changes: 2 additions & 2 deletions eric-bindings/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "eric-bindings"
version = "0.2.0"
version = "0.3.0"
authors.workspace = true
edition.workspace = true
readme.workspace = true
Expand All @@ -13,7 +13,7 @@ keywords = ["eric", "bindings", "taxes", "accounting"]
categories = ["external-ffi-bindings"]
build = "build.rs"

exclude = ["src/bindings/bindings_eric_39_6_4_0_linux_x86_64.rs"]
exclude = ["src/bindings/bindings_eric_38_1_6_0_linux_x86_64.rs"]

[package.metadata.docs.rs]
features = ["no-build"]
Expand Down
2 changes: 1 addition & 1 deletion eric-bindings/src/bindings/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pub mod bindings_eric_38_1_6_0_linux_x86_64;
pub mod bindings_eric_39_6_4_0_linux_x86_64;
2 changes: 1 addition & 1 deletion eric-bindings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#[cfg(feature = "no-build")]
mod bindings;
#[cfg(feature = "no-build")]
pub use bindings::bindings_eric_38_1_6_0_linux_x86_64::*;
pub use bindings::bindings_eric_39_6_4_0_linux_x86_64::*;

#[cfg(not(feature = "no-build"))]
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
Expand Down
5 changes: 5 additions & 0 deletions eric-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
- changed
- removed

## v0.2.0 (2024-08-05)

- added
- Support Eric v39.6.4.0

## v0.1.0 (2024-08-05)

- added
Expand Down
4 changes: 2 additions & 2 deletions eric-sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "eric-sdk"
version = "0.1.0"
version = "0.2.0"
authors.workspace = true
edition.workspace = true
readme.workspace = true
Expand All @@ -24,7 +24,7 @@ eric-bindings-no-build = ["eric-bindings/no-build"]
external-test = []

[dependencies]
eric-bindings = { version = "0.2.0", path = "../eric-bindings" }
eric-bindings = { version = "0.3.0", path = "../eric-bindings" }
anyhow = { workspace = true }

[dev-dependencies]
Expand Down
8 changes: 6 additions & 2 deletions eric-sdk/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{certificate::Certificate, utils::ToCString, Preview, ProcessingFlag};
use eric_bindings::{eric_druck_parameter_t, eric_verschluesselungs_parameter_t};
use eric_bindings::{eric_druck_parameter_t, eric_verschluesselungs_parameter_t, EricPdfCallback};
use std::{
ffi::{CStr, CString},
ffi::{c_void, CStr, CString},
path::Path,
ptr,
};
Expand Down Expand Up @@ -86,6 +86,8 @@ pub(crate) struct PrintParameter {

impl PrintParameter {
pub(crate) fn new(pdf_path: &CStr, processing_flag: &ProcessingFlag) -> Self {
let mut user_data: EricPdfCallback = None;
let user_data_ptr: *mut c_void = &mut user_data as *mut _ as *mut c_void;
let print_parameter = eric_druck_parameter_t {
version: 2,
vorschau: match processing_flag {
Expand All @@ -100,6 +102,8 @@ impl PrintParameter {
// reference to the CString is given.
pdfName: pdf_path.as_ptr(),
fussText: ptr::null(),
pdfCallback: None,
pdfCallbackBenutzerdaten: user_data_ptr,
};

Self {
Expand Down
2 changes: 2 additions & 0 deletions eric-sdk/tests/test_validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use roxmltree::Document;
use std::{env::current_dir, fs, path::Path};

#[test]
#[cfg_attr(feature = "external-test", ignore)]
fn test_validate() {
let log_path = current_dir().unwrap();
let xml_path = Path::new("./test_data/taxonomy/v6.5/SteuerbilanzAutoverkaeufer_PersG.xml");
Expand Down Expand Up @@ -34,6 +35,7 @@ fn test_validate() {
}

#[test]
#[cfg_attr(feature = "external-test", ignore)]
fn test_validate_and_print() {
let log_path = current_dir().unwrap();
let xml_path = Path::new("./test_data/taxonomy/v6.5/SteuerbilanzAutoverkaeufer_PersG.xml");
Expand Down