Skip to content

Commit

Permalink
build(cargo): Add FFI placeholder library
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Oct 7, 2022
1 parent e15bd02 commit 7da5544
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
7 changes: 7 additions & 0 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

members = [
"rekordcrate",
"rekordcrate-ffi",
]
18 changes: 18 additions & 0 deletions rekordcrate-ffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "rekordcrate-ffi"
version = "0.1.1"
authors = ["Jan Holthuis <[email protected]>"]
description = "C bindings for rekordcrate"
readme = "README.md"
repository = "https://github.com/Holzhaus/rekordcrate"
license = "MPL-2.0"
keywords = ["rekordbox", "dj", "export", "database", "parser"]
categories = ["parser-implementations"]
edition = "2021"
exclude = [".*"]

[dependencies]
rekordcrate = { version = "0.1.1", path = "../rekordcrate" }

[lib]
crate_type = ["cdylib"]
29 changes: 29 additions & 0 deletions rekordcrate-ffi/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) 2022 Jan Holthuis <[email protected]>
//
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy
// of the MPL was not distributed with this file, You can obtain one at
// http://mozilla.org/MPL/2.0/.
//
// SPDX-License-Identifier: MPL-2.0

//! Bindings for using rekordcrate from C code.
#![cfg_attr(not(debug_assertions), deny(warnings))]
#![deny(rust_2018_idioms)]
#![deny(rust_2021_compatibility)]
#![deny(missing_debug_implementations)]
#![deny(missing_docs)]
#![deny(rustdoc::broken_intra_doc_links)]
#![deny(clippy::all)]
#![deny(clippy::explicit_deref_methods)]
#![deny(clippy::explicit_into_iter_loop)]
#![deny(clippy::explicit_iter_loop)]
#![deny(clippy::must_use_candidate)]
#![cfg_attr(not(test), deny(clippy::panic_in_result_fn))]
#![cfg_attr(not(debug_assertions), deny(clippy::used_underscore_binding))]

/// This is just a test function.
#[no_mangle]
pub extern "C" fn rekordcrate_hello() {
println!("Hello World!");
}

0 comments on commit 7da5544

Please sign in to comment.