-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into release-0.10.0-rc
- Loading branch information
Showing
5 changed files
with
46 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,24 @@ use std::{borrow::Cow, collections::HashMap, io::BufWriter, path::Path}; | |
|
||
const GENERATION_PATH: &str = "include/zenoh-gen.h"; | ||
const SPLITGUIDE_PATH: &str = "splitguide.yaml"; | ||
const HEADER: &str = r"// | ||
// Copyright (c) 2022 ZettaScale Technology | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License 2.0 which is available at | ||
// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
// which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
// | ||
// Contributors: | ||
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
#ifdef DOCS | ||
#define ALIGN(n) | ||
#define ZENOHC_API | ||
#endif | ||
"; | ||
|
||
fn main() { | ||
cbindgen::generate(std::env::var("CARGO_MANIFEST_DIR").unwrap()) | ||
|
@@ -100,6 +118,10 @@ fn split_bindings(split_guide: &SplitGuide) -> Result<(), String> { | |
(name.as_str(), BufWriter::new(file)) | ||
}) | ||
.collect::<HashMap<_, _>>(); | ||
for file in files.values_mut() { | ||
file.write_all(HEADER.as_bytes()) | ||
.map_err(|e| e.to_string())?; | ||
} | ||
let mut records = group_tokens(Tokenizer { | ||
filename: GENERATION_PATH, | ||
inner: &bindings, | ||
|
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 |
---|---|---|
|
@@ -24,21 +24,7 @@ language = "C" | |
|
||
############## Options for Wrapping the Contents of the Header ################# | ||
|
||
header = """ | ||
// | ||
// Copyright (c) 2022 ZettaScale Technology | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License 2.0 which is available at | ||
// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
// which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
// | ||
// Contributors: | ||
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
""" | ||
# header = "/* Text to put at the beginning of the generated file. Probably a license. */" | ||
# trailer = "/* Text to put at the end of the generated file */" | ||
# include_guard = "ZENOH_FUNCTIONS" | ||
# pragma_once = true | ||
|
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,3 +1,20 @@ | ||
// | ||
// Copyright (c) 2022 ZettaScale Technology | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License 2.0 which is available at | ||
// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
// which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
// | ||
// Contributors: | ||
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
#ifdef DOCS | ||
#define ALIGN(n) | ||
#define ZENOHC_API | ||
#endif | ||
/** | ||
* The kind of congestion control. | ||
* | ||
|
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 |
---|---|---|
|
@@ -11,6 +11,10 @@ | |
// Contributors: | ||
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
#ifdef DOCS | ||
#define ALIGN(n) | ||
#define ZENOHC_API | ||
#endif | ||
#include <stdarg.h> | ||
#include <stdbool.h> | ||
#include <stdint.h> | ||
|