Skip to content

Commit

Permalink
Merge branch 'master' into release-0.10.0-rc
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHecart committed Sep 29, 2023
2 parents 115b65f + f4359fc commit 7343d61
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 16 deletions.
22 changes: 22 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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,
Expand Down
16 changes: 1 addition & 15 deletions cbindgen.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
extensions = ['sphinx_c_autodoc', 'sphinx_c_autodoc.napoleon']
language = 'c'
c_autodoc_roots = ['../include']
c_autodoc_compilation_args = ["-DDOCS"]

# -- Options for HTML output -------------------------------------------------
html_theme = 'sphinx_rtd_theme'

# ----------------------------------------------------------------------------
Config.set_library_file('/usr/lib/llvm-6.0/lib/libclang.so.1')
Config.set_library_file('/usr/lib/llvm-14/lib/libclang.so.1')
17 changes: 17 additions & 0 deletions include/zenoh_commons.h
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.
*
Expand Down
4 changes: 4 additions & 0 deletions include/zenoh_concrete.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 7343d61

Please sign in to comment.