mirror of
https://github.com/chatmail/core.git
synced 2026-05-12 19:36:32 +03:00
stop autogenerating the header
This commit is contained in:
1
deltachat-ffi/.gitignore
vendored
1
deltachat-ffi/.gitignore
vendored
@@ -2,4 +2,3 @@
|
|||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
.profile
|
.profile
|
||||||
*.h
|
|
||||||
|
|||||||
@@ -16,6 +16,3 @@ crate-type = ["cdylib", "staticlib"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
deltachat = { path = "../" }
|
deltachat = { path = "../" }
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
|
|
||||||
[build-dependencies]
|
|
||||||
cbindgen = "0.8"
|
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
fn main() {
|
|
||||||
let crate_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
|
|
||||||
|
|
||||||
let cfg = cbindgen::Config::from_root_or_default(std::path::Path::new(&crate_dir));
|
|
||||||
|
|
||||||
let c = cbindgen::Builder::new()
|
|
||||||
.with_config(cfg)
|
|
||||||
.with_crate(crate_dir)
|
|
||||||
.with_language(cbindgen::Language::C)
|
|
||||||
.generate();
|
|
||||||
|
|
||||||
// This is needed to ensure we don't panic if there are errors in the crates code
|
|
||||||
// but rather just tell the rest of the system we can't proceed.
|
|
||||||
match c {
|
|
||||||
Ok(res) => {
|
|
||||||
res.write_to_file("deltachat.h");
|
|
||||||
}
|
|
||||||
Err(err) => {
|
|
||||||
eprintln!("unable to generate bindings: {:#?}", err);
|
|
||||||
std::process::exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
[parse]
|
|
||||||
parse_deps = true
|
|
||||||
include = ["deltachat"]
|
|
||||||
1228
deltachat-ffi/deltachat.h
Normal file
1228
deltachat-ffi/deltachat.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6,21 +6,33 @@
|
|||||||
non_camel_case_types,
|
non_camel_case_types,
|
||||||
non_snake_case
|
non_snake_case
|
||||||
)]
|
)]
|
||||||
|
|
||||||
|
extern crate deltachat;
|
||||||
|
extern crate libc;
|
||||||
|
|
||||||
use deltachat::*;
|
use deltachat::*;
|
||||||
use libc;
|
|
||||||
|
|
||||||
pub const DC_VERSION_STR: &'static str = "0.43.0\x00";
|
pub const DC_VERSION_STR: &'static str = "0.43.0\x00";
|
||||||
|
|
||||||
// TODO: dc_context_new (wrt callback)
|
|
||||||
// TODO: constants
|
// TODO: constants
|
||||||
|
|
||||||
// dc_context_t
|
// dc_context_t
|
||||||
|
|
||||||
#[no_mangle]
|
|
||||||
pub type dc_context_t = dc_context::dc_context_t;
|
pub type dc_context_t = dc_context::dc_context_t;
|
||||||
|
|
||||||
|
pub type dc_callback_t = types::dc_callback_t;
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe extern "C" fn dc_context_unref(context: *mut dc_context::dc_context_t) {
|
pub unsafe extern "C" fn dc_context_new(
|
||||||
|
cb: dc_callback_t,
|
||||||
|
userdata: *mut libc::c_void,
|
||||||
|
os_name: *const libc::c_char,
|
||||||
|
) -> *mut dc_context_t {
|
||||||
|
dc_context::dc_context_new(cb, userdata, os_name)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub unsafe extern "C" fn dc_context_unref(context: *mut dc_context_t) {
|
||||||
dc_context::dc_context_unref(context)
|
dc_context::dc_context_unref(context)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user