Skip to content

Commit

Permalink
z_check and z_null made internal (#605)
Browse files Browse the repository at this point in the history
* fix: Rename `bump.bash` to `bump-and-tag.bash`

* feat: Add `version.txt` and infer version in `bump-and-tag.bash`

* fix: Clone repository using actions/checkout

* fix: Add `CMakeFiles` to `.gitignore`

* fix: Add `debug` and `release` to `.gitignore`

* fix: Provide default release number for testing

* fix: Don't bump deps when pattern is undefined

* fix sizes of zcu_owned_matching_listener_t and z_owned_reply_t

* build: Sync  with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#330)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* fix: Specify git remote when pushing the tag

* fix: Require `VERSION`in `bump-and-tag.bash`

* fix: Override release tag if it already exists

* feat(tracing): using tracing and zenoh-util init_log (#308)

* feat(tracing): using tracing and zenoh-util init_log

Signed-off-by: gabrik <[email protected]>

* chore: adding Cargo.lock

Signed-off-by: gabrik <[email protected]>

* chore: updated Cargo.toml.in

Signed-off-by: gabrik <[email protected]>

* feat(tracing): using zenoh main branch

Signed-off-by: gabrik <[email protected]>

---------

Signed-off-by: gabrik <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#335)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@23c5932 from 2024-04-16 (#337)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* fix: Support jq 1.6

ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator.

See: jqlang/jq#1168.

* chore: using new try_init_log_from_env

Signed-off-by: gabrik <[email protected]>

* Align examples and remove reading from stdin (#255)

* Remove reading from stdin, align example implementations

* Add argument parsing implementation for examples

* Add argument parsing to examples, format files

* Replace getchar with sleep in z_pong example

* Fix typo in include

* Use null-pointers instead of empty strings, remove unnecessary mallocs

* Free returned pointer after parse_pos_args usage

* Add common and positional args parsing to z_ping example

* Add formatting for parsed config options

* Add const to function parameters

* Update mode option help

* Fix pos_args memory leak

* Refactor parse_args, remove possible strcpy buffer overflow

* Change parse_args function returns to const where applicable

* Fix const initialization warning

* Remove redundant const for value parameters

* Fix buf variable memory leak

* Update insert json-list config error message

* Add usage example for -e and -l arguments in help

* Update example notation in help message

Co-authored-by: Alexander <[email protected]>

* Update example notation in help message (2/2)

* Fix parameter in error message

Co-authored-by: Alexander <[email protected]>

---------

Co-authored-by: Alexander <[email protected]>

* Bugfix: Unable to build z_queryable_with_channels.c (#340)

Signed-off-by: ChenYing Kuo <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@0283aaa from 2024-04-19 (#341)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@e8916bf from 2024-04-26 (#343)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Update README and specify Rust version (#342)

* Clean up the Markdown format.

Signed-off-by: ChenYing Kuo <[email protected]>

* Specify Rust version in README.

Signed-off-by: ChenYing Kuo <[email protected]>

---------

Signed-off-by: ChenYing Kuo <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@ea604b6 from 2024-04-29 (#344)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@371ca6b from 2024-04-30 (#347)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@7a47445 from 2024-05-03 (#348)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@f5195c0 from 2024-05-03 (#350)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@e53364f from 2024-05-04 (#351)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@7e5d5e8 from 2024-05-07 (#355)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@b8dd01d from 2024-05-07 (#356)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@45e05f0 from 2024-05-13 (#360)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Fix build with CMAKE_BUILD_TYPE=None

This is the default build type for debhelper (Debian).

* build: Sync  with eclipse-zenoh/zenoh@763a05f from 2024-05-14 (#363)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@75aa273 from 2024-05-15 (#364)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@25f06bd from 2024-05-21 (#369)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@3118d31 from 2024-05-28 (#399)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@009f666 from 2024-05-30 (#411)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@d574654 from 2024-06-03 (#420)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* chore: Update artifacts action to v4 (#421)

artifacts actions v3 are deprecated

* build: Sync  with eclipse-zenoh/zenoh@c279982 from 2024-06-05 (#424)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@d8e66de from 2024-06-10 (#436)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@9d09742 from 2024-06-11 (#446)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@ed6c636 from 2024-06-12 (#450)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@8160b01 from 2024-06-13 (#457)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Enable releasing from any branch (#456)

* build: Sync  with eclipse-zenoh/zenoh@7adad94 from 2024-06-14 (#460)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Update to latest zenoh

* Replace `-rc` with `-pre` and document versioning (#466)

* build: Sync  with eclipse-zenoh/zenoh@2500e5a from 2024-06-20 (#467)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* macro generation

* moved types added to decl

* moved type drop

* switched rust to z_moved

* moved closures

* build macros fixed

* z_move name restored

* into_rust_type for moved, payloads

* tests updated

* cargo fmt

* moved structs in some drops/undeclares

* moved as separate parameter

* removed asref from moved

* moved unfinished

* build: Sync  with eclipse-zenoh/zenoh@869ace6 from 2024-07-02 (#494)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* moved type with into_rust_type trait, comiles without shm

* build with shm passed

* option added to some decl_c_type

* clippy fix

* build fix

* moved types added

* task moved used

* build: Sync  with eclipse-zenoh/zenoh@b93ca84 from 2024-07-03 (#500)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* some examples fixes

* macros corrected to use auto derive loaned type from owned feature

* optional comma allowed in macros where forgotten

* property moved get

* put options move

* publisher delete options made simpler

* put options with moved

* delete options timestamp simplified

* more moved in options, timestamp simplified

* examples,tests updated

* tests compile fixes

* fix for test failure due to calling z_moved_xxx_t destructor on unitialized memory

* cargo fmt imports

* build fixes

* build: Sync  with eclipse-zenoh/zenoh@b3e42ce from 2024-07-08 (#508)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Ensure that find_package(zenohc) can be called two times (#470)

* Update CMakeLists.txt (#473)

* Install zenohc.dll in <prefix>/bin on Windows (#471)

* build: Sync  with eclipse-zenoh/zenoh@0a969cb from 2024-07-25 (#546)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@e587aa9 from 2024-07-26 (#552)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* some xompile errors fixed

* some build errors fixed

* some build errors fixed

* build fixes

* cargo fmt

* into_rust_type usage fixes

* encoding drop fixed

* restored headers

* zcu renamed back to zc

* zcu renamed back to zc

* z_xxx_move is static inline, cpp fixes

* build: Sync  with eclipse-zenoh/zenoh@2d88c7b from 2024-07-29 (#556)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* clang format from start

* cargo fmt

* macros contains funcions now, it needs types defined

* removed zenoh_macros include

* zenoh_macros include returned back to place

* C++ build test added, fails for now

* C++ enabling correction

* C++ compilation for tests added

* C++ build test

* cargo lock update

* retrun value if not void from template functions

* cargo fmt

* build fixes

* build fix after cargo.lock update

* moved types for buffer creation functions

* clippy fix

* clippy fix: c_char can be i8 or u8 depending on platform

* headers restored

* cargo fmt

* -c c++ flag for clang only

* c++ build fix - brackets removed

* type specific take functions added, _ptr in moved

* generic_take_cpp

* z_take impls at the end

* take funcs before generics

* take moved after null

* names fix

* missing null functioj added

* tests fixed for c++

* explicit null calls

* fix generic parameter names c compilation

* null call fix

* misprint fixed

* return removed

* Rename `close` to `undeclare` for Publication Cache and Querying Subscriber

* Temporarily use original pull request branch

* Update to eclipse-zenoh/zenoh@ce4e9bf

* Fix `z_ref_shm_client_storage_global`

* Update Cargo.toml

* decl_c_type corrected

* cargo check run

* borrow error fix

* compilation fix

* parse arg fix

* example compilation fix

* examples compile fix

* examples build fixes

* removed duplicated z_config_default (it's called in parsing args later)

* clang format

* clang format

* cargo.toml restore

* added underscore to _z_null and _z_check

* missing functions updated

* rename to z_internal_null/check

* clang format fix

* restored headers, corrected cargo.toml

---------

Signed-off-by: gabrik <[email protected]>
Signed-off-by: ChenYing Kuo <[email protected]>
Co-authored-by: Mahmoud Mazouz <[email protected]>
Co-authored-by: Denis Biryukov <[email protected]>
Co-authored-by: eclipse-zenoh-bot <[email protected]>
Co-authored-by: eclipse-zenoh-bot <[email protected]>
Co-authored-by: Mahmoud Mazouz <[email protected]>
Co-authored-by: Gabriele Baldoni <[email protected]>
Co-authored-by: gabrik <[email protected]>
Co-authored-by: oteffahi <[email protected]>
Co-authored-by: Alexander <[email protected]>
Co-authored-by: ChenYing Kuo (CY) <[email protected]>
Co-authored-by: Jochen Sprickerhof <[email protected]>
Co-authored-by: Diogo Matsubara <[email protected]>
Co-authored-by: OlivierHecart <[email protected]>
Co-authored-by: Silvio Traversaro <[email protected]>
Co-authored-by: Luca Cominardi <[email protected]>
  • Loading branch information
16 people authored Aug 21, 2024
1 parent e626980 commit 9e30b34
Show file tree
Hide file tree
Showing 45 changed files with 850 additions and 783 deletions.
14 changes: 10 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ build = "build.rs"

[features]
logger-autoinit = []
shared-memory = ["zenoh/shared-memory", "dep:zenoh-ext", "zenoh-ext/shared-memory"]
shared-memory = [
"zenoh/shared-memory",
"dep:zenoh-ext",
"zenoh-ext/shared-memory",
]
unstable = ["zenoh/unstable", "zenoh-ext/unstable", "dep:zenoh-ext"]
default = ["zenoh/default"]

Expand All @@ -52,10 +56,12 @@ rand = "0.8.5"
spin = "0.9.5"
unwrap-infallible = "0.1.5"
const_format = "0.2.32"
zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = ["internal"] }
zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" , optional = true }
zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = [
"internal",
] }
zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", optional = true }
zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" }
zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" }
zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" }
flume = "*"

[build-dependencies]
Expand Down
22 changes: 11 additions & 11 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -992,15 +992,15 @@ pub fn create_generics_header(path_in: &str, path_out: &str) {

if drops != nulls {
msgs.push(format!(
"the list of z_xxx_drop and z_xxx_null functions are different:\n missing z_xxx_null for {:?}\n missing z_xxx_drop for {:?}",
"the list of z_xxx_drop and z_internal_xxx_null functions are different:\n missing z_internal_xxx_null for {:?}\n missing z_xxx_drop for {:?}",
drops.difference(&nulls),
nulls.difference(&drops)
));
}

if drops != checks {
msgs.push(format!(
"the list of z_xxx_drop and z_xxx_check functions are different:\n missing z_xxx_check for {:?}\n missing z_xxx_drop for {:?}",
"the list of z_xxx_drop and z_internal_xxx_check functions are different:\n missing z_internal_xxx_check for {:?}\n missing z_xxx_drop for {:?}",
drops.difference(&checks),
checks.difference(&drops)
));
Expand Down Expand Up @@ -1244,15 +1244,15 @@ pub fn find_drop_functions(path_in: &str) -> Vec<FunctionSignature> {

pub fn find_null_functions(path_in: &str) -> Vec<FunctionSignature> {
let bindings = std::fs::read_to_string(path_in).unwrap();
let re = Regex::new(r"(\w+)_null\(struct (\w+) \*(\w+)\);").unwrap();
let re = Regex::new(r" (z.?_internal_\w+_null)\(struct (\w+) \*(\w+)\);").unwrap();
let mut res = Vec::<FunctionSignature>::new();

for (_, [func_name, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract()) {
let (_, _, semantic, _) = split_type_name(arg_type);
let f = FunctionSignature::new(
semantic,
"void",
func_name.to_string() + "_null",
func_name.to_string(),
vec![FuncArg::new(&(arg_type.to_string() + "*"), arg_name)],
);
res.push(f);
Expand All @@ -1262,15 +1262,15 @@ pub fn find_null_functions(path_in: &str) -> Vec<FunctionSignature> {

pub fn find_check_functions(path_in: &str) -> Vec<FunctionSignature> {
let bindings = std::fs::read_to_string(path_in).unwrap();
let re = Regex::new(r"bool (\w+)_check\(const struct (\w+) \*(\w+)\);").unwrap();
let re = Regex::new(r"bool (z.?_internal_\w+_check)\(const struct (\w+) \*(\w+)\);").unwrap();
let mut res = Vec::<FunctionSignature>::new();

for (_, [func_name, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract()) {
let (_, _, semantic, _) = split_type_name(arg_type);
let f = FunctionSignature::new(
semantic,
"bool",
func_name.to_string() + "_check",
func_name.to_string(),
vec![FuncArg::new(
&("const ".to_string() + arg_type + "*"),
arg_name,
Expand Down Expand Up @@ -1415,7 +1415,7 @@ pub fn generate_take_functions(macro_func: &[FunctionSignature]) -> String {
for sig in macro_func {
let (prefix, _, semantic, _) = split_type_name(&sig.args[0].typename.typename);
out += &format!(
"static inline void {}({} {}, {} {}) {{ *{} = {}->_this; {}_{}_null(&{}->_this); }}\n",
"static inline void {}({} {}, {} {}) {{ *{} = {}->_this; {}_internal_{}_null(&{}->_this); }}\n",
sig.func_name,
sig.args[0].typename.typename,
sig.args[0].name,
Expand Down Expand Up @@ -1460,11 +1460,11 @@ pub fn generate_move_functions_cpp(macro_func: &[FunctionSignature]) -> String {
}

pub fn generate_generic_null_c(macro_func: &[FunctionSignature]) -> String {
generate_generic_c(macro_func, "z_null", false)
generate_generic_c(macro_func, "z_internal_null", false)
}

pub fn generate_generic_check_c(macro_func: &[FunctionSignature]) -> String {
generate_generic_c(macro_func, "z_check", true)
generate_generic_c(macro_func, "z_internal_check", true)
}

pub fn generate_generic_call_c(macro_func: &[FunctionSignature]) -> String {
Expand Down Expand Up @@ -1589,11 +1589,11 @@ pub fn generate_generic_take_cpp(macro_func: &[FunctionSignature]) -> String {
}

pub fn generate_generic_null_cpp(macro_func: &[FunctionSignature]) -> String {
generate_generic_cpp(macro_func, "z_null", false)
generate_generic_cpp(macro_func, "z_internal_null", false)
}

pub fn generate_generic_check_cpp(macro_func: &[FunctionSignature]) -> String {
generate_generic_cpp(macro_func, "z_check", true)
generate_generic_cpp(macro_func, "z_internal_check", true)
}

pub fn generate_generic_call_cpp(macro_func: &[FunctionSignature]) -> String {
Expand Down
Loading

0 comments on commit 9e30b34

Please sign in to comment.