diff --git a/examples/unix/c11/z_ping.c b/examples/unix/c11/z_ping.c index 4db578c7e..dc9cbf4f7 100644 --- a/examples/unix/c11/z_ping.c +++ b/examples/unix/c11/z_ping.c @@ -1,3 +1,17 @@ +// +// 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, +// + #include #include #include diff --git a/examples/unix/c11/z_pong.c b/examples/unix/c11/z_pong.c index 503c37e25..8acf09564 100644 --- a/examples/unix/c11/z_pong.c +++ b/examples/unix/c11/z_pong.c @@ -1,3 +1,17 @@ +// +// 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, +// + #include "stdio.h" #include "zenoh-pico.h" diff --git a/examples/unix/c11/z_scout.c b/examples/unix/c11/z_scout.c index 751609db1..3a6950aad 100644 --- a/examples/unix/c11/z_scout.c +++ b/examples/unix/c11/z_scout.c @@ -1,4 +1,3 @@ - // // Copyright (c) 2022 ZettaScale Technology // diff --git a/examples/unix/c99/z_ping.c b/examples/unix/c99/z_ping.c index 379afd986..cbae19ccb 100644 --- a/examples/unix/c99/z_ping.c +++ b/examples/unix/c99/z_ping.c @@ -1,3 +1,17 @@ +// +// 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, +// + #include #include #include diff --git a/examples/unix/c99/z_pong.c b/examples/unix/c99/z_pong.c index 1f0955d56..53f6d14ee 100644 --- a/examples/unix/c99/z_pong.c +++ b/examples/unix/c99/z_pong.c @@ -1,3 +1,17 @@ +// +// 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, +// + #include "stdio.h" #include "zenoh-pico.h" #include "zenoh-pico/api/primitives.h" diff --git a/examples/windows/z_ping.c b/examples/windows/z_ping.c index fe25ed3c9..dcfb1fc8e 100644 --- a/examples/windows/z_ping.c +++ b/examples/windows/z_ping.c @@ -1,3 +1,17 @@ +// +// 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, +// + #include #include #include diff --git a/examples/windows/z_pong.c b/examples/windows/z_pong.c index c0d1cd0b0..698c086f7 100644 --- a/examples/windows/z_pong.c +++ b/examples/windows/z_pong.c @@ -1,3 +1,17 @@ +// +// 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, +// + #include "stdio.h" #include "zenoh-pico.h" diff --git a/examples/windows/z_scout.c b/examples/windows/z_scout.c index 8d7feea64..378a61327 100644 --- a/examples/windows/z_scout.c +++ b/examples/windows/z_scout.c @@ -1,4 +1,3 @@ - // // Copyright (c) 2022 ZettaScale Technology // diff --git a/include/zenoh-pico/api/primitives.h b/include/zenoh-pico/api/primitives.h index 9b44c2c0e..68861d6f9 100644 --- a/include/zenoh-pico/api/primitives.h +++ b/include/zenoh-pico/api/primitives.h @@ -1142,9 +1142,9 @@ z_queryable_options_t z_queryable_options_default(void); * Parameters: * zs: A loaned instance of the the :c:type:`z_session_t` where to declare the subscriber. * keyexpr: A loaned instance of :c:type:`z_keyexpr_t` to associate with the subscriber. - * callback: A moved instance of :c:type:`z_owned_closure_query_t` containing the callbacks to be called and the context - * to pass to them. options: The options to apply to the queryable. If ``NULL`` is passed, the default options will be - * applied. + * callback: A moved instance of :c:type:`z_owned_closure_query_t` containing the callbacks to be called and the + * context to pass to them. options: The options to apply to the queryable. If ``NULL`` is passed, the default options + * will be applied. * * Returns: * A :c:type:`z_owned_queryable_t` with either a valid queryable or a failing queryable. diff --git a/include/zenoh-pico/link/link.h b/include/zenoh-pico/link/link.h index 10a892982..3f0400b20 100644 --- a/include/zenoh-pico/link/link.h +++ b/include/zenoh-pico/link/link.h @@ -52,10 +52,10 @@ * Z_LINK_CAPABILITY_MULTICAST: Bitmask to define and check if link is multicast. */ typedef enum { - Z_LINK_CAPABILITY_NONE = 0x00, // 0 + Z_LINK_CAPABILITY_NONE = 0x00, // 0 Z_LINK_CAPABILITY_RELIABLE = 0x01, // 1 << 0 - Z_LINK_CAPABILITY_STREAMED = 0x02, // 1 << 1 - Z_LINK_CAPABILITY_MULTICAST = 0x04 // 1 << 2 + Z_LINK_CAPABILITY_STREAMED = 0x02, // 1 << 1 + Z_LINK_CAPABILITY_MULTICAST = 0x04 // 1 << 2 } _z_link_capabilities_t; #define _Z_LINK_IS_RELIABLE(X) ((X & Z_LINK_CAPABILITY_RELIABLE) == Z_LINK_CAPABILITY_RELIABLE) diff --git a/src/protocol/codec/core.c b/src/protocol/codec/core.c index 403c28d8c..90ad38a4a 100644 --- a/src/protocol/codec/core.c +++ b/src/protocol/codec/core.c @@ -1,6 +1,21 @@ +// +// 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, +// + #include "zenoh-pico/protocol/codec/core.h" #include "zenoh-pico/protocol/iobuf.h" + int8_t _z_zbuf_read_exact(_z_zbuf_t *zbf, uint8_t *dest, size_t length) { if (length > _z_zbuf_len(zbf)) { return _Z_ERR_MESSAGE_DESERIALIZATION_FAILED; diff --git a/src/protocol/core.c b/src/protocol/core.c index c5cfc0c3f..b937f1e89 100644 --- a/src/protocol/core.c +++ b/src/protocol/core.c @@ -1,3 +1,17 @@ +// +// 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, +// + #include "zenoh-pico/protocol/core.h" #include "zenoh-pico/api/primitives.h" diff --git a/src/protocol/definitions/core.c b/src/protocol/definitions/core.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/protocol/definitions/message.c b/src/protocol/definitions/message.c index fc6b14491..e3865635f 100644 --- a/src/protocol/definitions/message.c +++ b/src/protocol/definitions/message.c @@ -1,3 +1,17 @@ +// +// 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, +// + #include "zenoh-pico/protocol/definitions/message.h" #include "zenoh-pico/collections/bytes.h" diff --git a/src/protocol/definitions/network.c b/src/protocol/definitions/network.c index af852e4e2..56855657c 100644 --- a/src/protocol/definitions/network.c +++ b/src/protocol/definitions/network.c @@ -1,3 +1,17 @@ +// +// 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, +// + #include "zenoh-pico/protocol/definitions/network.h" #include "zenoh-pico/api/constants.h" diff --git a/src/protocol/definitions/transport.c b/src/protocol/definitions/transport.c index 3be09369f..6960672a4 100644 --- a/src/protocol/definitions/transport.c +++ b/src/protocol/definitions/transport.c @@ -1,3 +1,17 @@ +// +// 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, +// + #include "zenoh-pico/protocol/definitions/transport.h" #include "zenoh-pico/collections/bytes.h" diff --git a/tests/z_keyexpr_test.c b/tests/z_keyexpr_test.c index 9b9567f7a..d4cf921ef 100644 --- a/tests/z_keyexpr_test.c +++ b/tests/z_keyexpr_test.c @@ -20,8 +20,7 @@ #undef NDEBUG #include -int main(void) -{ +int main(void) { assert(_z_keyexpr_intersects("a", strlen("a"), "a", strlen("a"))); assert(_z_keyexpr_intersects("a/b", strlen("a/b"), "a/b", strlen("a/b"))); assert(_z_keyexpr_intersects("*", strlen("*"), "abc", strlen("abc"))); @@ -339,8 +338,7 @@ int main(void) // clang-format on - for (int i = 0; i < N; i++) - { + for (int i = 0; i < N; i++) { const char *ke = input[i]; char *canon = (char *)malloc(128); memset(canon, 0, 128); @@ -350,15 +348,13 @@ int main(void) printf("%s ", ke); printf(" Status: %d : %d\n", status, expected[i]); assert(status == expected[i]); - if (status == Z_KEYEXPR_CANON_SUCCESS) - { + if (status == Z_KEYEXPR_CANON_SUCCESS) { printf(" Match: %.*s : %s\n", (int)canon_len, canon, canonized[i]); assert(strncmp(canonized[i], canon, canon_len) == 0); } } - for (int i = 0; i < N; i++) - { + for (int i = 0; i < N; i++) { const char *ke = input[i]; char *canon = (char *)malloc(128); memset(canon, 0, 128); @@ -368,8 +364,7 @@ int main(void) printf("%s ", ke); printf(" Status: %d : %d", status, expected[i]); assert(status == expected[i]); - if (status == Z_KEYEXPR_CANON_SUCCESS) - { + if (status == Z_KEYEXPR_CANON_SUCCESS) { printf(" Match: %.*s : %s", (int)canon_len, canon, canonized[i]); assert(strcmp(canonized[i], canon) == 0); }