-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial telemetry ffi implementation * Add telemetry header generation to build script * Using the nightly toolchain when running cbindgen to expand functions in macros
- Loading branch information
1 parent
7068677
commit 78969e5
Showing
15 changed files
with
538 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021-Present Datadog, Inc. | ||
|
||
pub mod option; | ||
pub mod slice; | ||
pub mod tags; | ||
pub mod vec; | ||
|
||
pub use slice::Slice; | ||
pub use option::Option; | ||
pub use slice::{CharSlice, Slice}; | ||
pub use vec::Vec; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021-Present Datadog, Inc. | ||
|
||
#[repr(C)] | ||
#[derive(Debug, PartialEq, Eq)] | ||
pub enum Option<T> { | ||
Some(T), | ||
None, | ||
} | ||
|
||
impl<T> Option<T> { | ||
pub fn to_std(self) -> std::option::Option<T> { | ||
self.into() | ||
} | ||
} | ||
|
||
impl<T> From<Option<T>> for std::option::Option<T> { | ||
fn from(o: Option<T>) -> Self { | ||
match o { | ||
Option::Some(s) => Some(s), | ||
Option::None => None, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
# This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021-Present Datadog, Inc. | ||
|
||
[package] | ||
name = "ddtelemetry-ffi" | ||
version = "0.8.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
# LTO is ignored if "lib" is added as crate type | ||
# cf. https://github.com/rust-lang/rust/issues/51009 | ||
crate-type = ["staticlib", "cdylib"] | ||
|
||
[dependencies] | ||
ddtelemetry = { path = "../ddtelemetry", version = "0.8.0" } | ||
ddcommon-ffi = { path = "../ddcommon-ffi", version = "0.8.0" } | ||
paste = "1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
# This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021-Present Datadog, Inc. | ||
|
||
language = "C" | ||
tab_width = 2 | ||
header = """// Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021-Present Datadog, Inc. | ||
""" | ||
include_guard = "DDOG_TELEMETRY_H" | ||
style = "both" | ||
|
||
no_includes = true | ||
sys_includes = ["stdbool.h", "stddef.h", "stdint.h"] | ||
includes = ["datadog/common.h"] | ||
|
||
[export] | ||
prefix = "ddog_" | ||
|
||
[export.mangle] | ||
rename_types="SnakeCase" | ||
|
||
[enum] | ||
prefix_with_name = true | ||
rename_variants = "ScreamingSnakeCase" | ||
|
||
[fn] | ||
must_use = "DDOG_CHECK_RETURN" | ||
|
||
[parse] | ||
expand = ["ddtelemetry-ffi"] | ||
parse_deps = true | ||
include = ["ddcommon", "ddtelemetry", "ddcommon-ffi"] |
Oops, something went wrong.