Package: libzenohc
Version: 1.0.0
Architecture: armel
Maintainer: zenoh-dev@eclipse.org
Installed-Size: 16931
Filename: 1.0.0/libzenohc_1.0.0_armel.deb
Size: 4125188
MD5sum: a33f57a4f2ecb67b466504d85fb78c7f
SHA1: 308885e8cdb4f58cae06a273ebca261044c3a88b
SHA256: 0020512543a1064851fef6ce9241622512989be1a673cb2b0591f26248e81bea
Section: net
Priority: optional
Homepage: http://zenoh.io
Description: The Zenoh C API
 <img
 src="https://raw.githubusercontent.com/eclipse-zenoh/zenoh/main/zenoh-dragon.png"
 height="150">
 .
 [![CI](https://github.com/eclipse-zenoh/zenoh-c/workflows/CI/badge.svg)](https://github.com/eclipse-zenoh/zenoh-c/actions?query=workflow%3A%22CI%22)
 [![Documentation
 Status](https://readthedocs.org/projects/zenoh-c/badge/?version=latest)](https://zenoh-c.readthedocs.io/en/latest/?badge=latest)
 [![Discussion](https://img.shields.io/badge/discussion-on%20github-blue)](https://github.com/eclipse-zenoh/roadmap/discussions)
 [![Discord](https://img.shields.io/badge/chat-on%20discord-blue)](https://discord.gg/2GJ958VuHs)
 [![License](https://img.shields.io/badge/License-EPL%202.0-blue)](https://choosealicense.com/licenses/epl-2.0/)
 [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
 .
 # Eclipse Zenoh
 .
 The Eclipse Zenoh: Zero Overhead Pub/sub, Store/Query and Compute.
 .
 Zenoh (pronounce _/zeno/_) unifies data in motion, data at rest and
 computations. It carefully blends traditional pub/sub with geo-distributed
 storages, queries and computations, while retaining a level of time and space
 efficiency that is well beyond any of the mainstream stacks.
 .
 Check the website [zenoh.io](http://zenoh.io) and the
 [roadmap](https://github.com/eclipse-zenoh/roadmap) for more detailed
 information.
 .
 -------------------------------
 .
 # C API
 .
 This repository provides a C binding based on the main [Zenoh implementation
 written in Rust](https://github.com/eclipse-zenoh/zenoh).
 .
 -------------------------------
 .
 ## How to build it
 .
 > :warning: **WARNING** :warning: : Zenoh and its ecosystem are under active
 development. When you build from git, make sure you also build from git any
 other Zenoh repository you plan to use (e.g. binding, plugin, backend, etc.).
 It may happen that some changes in git are not compatible with the most recent
 packaged Zenoh release (e.g. deb, docker, pip). We put particular effort in
 maintaining compatibility between the various git repositories in the Zenoh
 project.
 .
 1. Make sure that [Rust](https://www.rust-lang.org) is available on your
 platform.
    Please check [here](https://www.rust-lang.org/tools/install) to learn how to
 install it.
    If you already have the Rust toolchain installed, make sure it is up-to-date
 with:
 .
    ```bash
    rustup update
    ```
 .
 2. Clone the [source] with `git`:
 .
    ```bash
    git clone https://github.com/eclipse-zenoh/zenoh-c.git
    ```
 .
    [source]: https://github.com/eclipse-zenoh/zenoh-c
 .
 3. Build:
 .
    Good CMake practice is to perform build outside of source directory, leaving
 source tree untouched. The examples below demonstrates this mode of building.
 On the other hand VScode by default creates build directory named 'build'
 inside source tree. In this case build script slightly changes its behavior.
 See more about it in section 'VScode'.
 .
    By default build configuration is set to `Release`, it's not necessary to
 add `-DCMAKE_BUILD_TYPE=Release` option on configuration step. But if your
 platform uses multi-config generator by default (this is the case on Windows),
 you may need to add option `--config Release` on build step. See more in CMake
 [build-configurations] documentation. Option`--config Release` is skipped in
 further examples for brewity. It's actually necessary for [Visual Studio
 generators] only. For [Ninja Multi-Config] the build script is able to select
 `Release` as the default configuration.
 .
    ```bash
    mkdir -p build && cd build
    cmake ../zenoh-c
    cmake --build . --config Release
    ```
 .
    The generator to use is selected with option `-G`. If Ninja is installed on
 your system, adding `-GNinja` to `cmake` command can greatly speed up the build
 time:
 .
    ```bash
    cmake ../zenoh-c -GNinja
    cmake --build .
    ```
 .
    Unstable api and/or shared memory support can be enabled by setting
 repectively `ZENOHC_BUILD_WITH_UNSTABLE_API` and
 `ZENOHC_BUILD_WITH_SHARED_MEMORY` Cmake flags to `true` during configuration
 step.
 .
    ```bash
    cmake -DZENOHC_BUILD_WITH_UNSTABLE_API=true
 -DZENOHC_BUILD_WITH_SHARED_MEMORY=true ../zenoh-c
    cmake --build . --config Release
    ```
 .
    [build-configurations]:
 https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations
    [Visual Studio generators]:
 https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#id14
    [Ninja Multi-Config]:
 https://cmake.org/cmake/help/latest/generator/Ninja%20Multi-Config.html
 .
 4. Install:
 .
    To install zenoh-c library into system just build target `install`. You need
 root privileges to do it, as the default install location is `/usr/local`.
 .
    ```bash
    cmake --build . --target install
    ```
 .
    If you want to install zenoh-c libraries locally, you can set the
 installation directory with `CMAKE_INSTALL_PREFIX`
 .
    ```bash
    cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local
    cmake --build . --target install
    ```
 .
    By default only dynamic library is built and installed. Set
 `BUILD_SHARED_LIBS` variable to false to build and install static library:
 .
    ```bash
    cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local -DBUILD_SHARED_LIBS=FALSE
    cmake --build . --target install
    ```
 .
    The result of installation is the header files in `include` directory, the
 library files in `lib` directory and cmake package configuration files for
 package `zenohc` in `lib/cmake` directory. The library later can be loaded with
 CMake command `find_package(zenohc)`.
    Add dependency in CMakeLists.txt on target
 .
    - `zenohc::shared` for linking dynamic library
    - `zenohc::static` for linking static library
    - `zenohc::lib` for linking static or dynamic library depending on boolean
 variable `BUILD_SHARED_LIBS`
 .
    For `Debug` configuration suffix `d` is added to names of library files
 (libzenohc**d**.so).
 .
 5. VScode
 .
    When zenoh-c project is opened in VSCode the build directory is set to
 `build` inside source tree (this is default behavior of Microsoft [CMake
 Tools]). The project build script detects this situation. In this case it
 places build files in `target` directory and `Cargo.toml` file (which is
 generated from `Cargo.toml.in`) into the root of source tree, as the rust
 developers used to and as the rust build tools expects by default. This
 behavior also can be explicitly enabled by setting
 `ZENOHC_BUILD_IN_SOURCE_TREE` variable to `TRUE`.
 .
    [CMake Tools]:
 https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools
 .
 ## Building the Examples
 .
 The examples can be built in two ways. One is to select `examples` as a build
 target of zenoh-c project (assuming here that the current directory is
 side-by-side with zenoh-c directory):
 .
 ```bash
 cmake ../zenoh-c
 cmake --build . --target examples
 ```
 .
 You may also use `--target <example_name>` if you wish to only build a specific
 example.
 .
 All build artifacts will be in the `target/release/examples` directory in this
 case.
 .
 The second way is to directly build `examples` as a root project:
 .
 ```bash
 cmake ../zenoh-c/examples
 cmake --build .
 ```
 .
 In this case, the examples executables will be built in the current directory.
 .
 As a root project the `examples` project links `zenoh-c` with CMake's
 [add_subdirectory] command by default. There are also other ways to link
 `zenoh-c` - with [find_package] or [FetchContent]:
 .
 [add_subdirectory]:
 https://cmake.org/cmake/help/latest/command/add_subdirectory.html
 [find_package]: https://cmake.org/cmake/help/latest/command/find_package.html
 [FetchContent]: https://cmake.org/cmake/help/latest/module/FetchContent.html
 .
 Link with `zenoh-c` installed into default location in the system (with
 [find_package]):
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE
 ```
 .
 Link with `zenoh-c` installed in `~/.local` directory:
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE
 -DCMAKE_INSTALL_PREFIX=~/.local
 ```
 .
 Download specific `zenoh-c` version from git with [FetchContent]:
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=GIT_URL -DZENOHC_GIT_TAG=0.11.0-rc
 ```
 .
 See also `configure_include_project` function in [helpers.cmake] for more
 information
 .
 [helpers.cmake]: cmake/helpers.cmake
 .
 ## Running the Examples
 .
 ### Basic Pub/Sub Example
 .
 ```bash
 ./target/release/examples/z_sub
 ```
 .
 ```bash
 ./target/release/examples/z_pub
 ```
 .
 ### Queryable and Query Example
 .
 ```bash
 ./target/release/examples/z_queryable
 ```
 .
 ```bash
 ./target/release/examples/z_get
 ```
 .
 ### Running the Throughput Examples
 .
 ```bash
 ./target/release/examples/z_sub_thr
 ```
 .
 ```bash
 ./target/release/examples/z_pub_thr
 ```
 .
 ## Documentation
 Zenoh-c API documentation is available on [Read the
 Docs](https://zenoh-c.readthedocs.io/en/latest/index.html).
 .
 It can be built manually by performing the following steps:
 .
 ```bash
 cd docs
 doxygen
 sphinx-build -b html . _build/html
 ```
 .
 ## Cross-Compilation
 .
 The following alternative options have been introduced to facilitate
 cross-compilation.
 > :warning: **WARNING** :warning: : Perhaps additional efforts are necessary,
 that will depend of your environment.
 .
 - `-DZENOHC_CARGO_CHANNEL="+nightly"|"+beta"|"+stable"`: refers to a specific
 rust toolchain release
 [[rust-channels](https://rust-lang.github.io/rustup/concepts/channels.html)]
 - `-DZENOHC_CARGO_FLAGS`: several optional flags can be used for compilation.
 [[cargo flags](https://doc.rust-lang.org/cargo/commands/cargo-build.html)]
 - `-DZENOHC_CUSTOM_TARGET`: specifies a crosscompilation target. Currently rust
 support several Tire-1, Tire-2 and Tire-3 targets
 [[targets](https://doc.rust-lang.org/nightly/rustc/platform-support.html)]. But
 keep in mind that zenoh-c only have support for following targets:
 `aarch64-unknown-linux-gnu`, `x86_64-unknown-linux-gnu`,
 `arm-unknown-linux-gnueabi`
 .
 Let's put all together in an example:
 Assuming you want to crosscompile for aarch64-unknown-linux-gnu.
 .
 1. Install required packages
    - `sudo apt install gcc-aarch64-linux-gnu`
 2. *(Only if you're using `nightly`)
    - `rustup component add rust-src --toolchain nightly`
 3. Compile Zenoh-C. Assume that it's in `zenoh-c` directory. Notice that build
 in this sample is performed outside of source directory
 .
    ```bash
    export RUSTFLAGS="-Clinker=aarch64-linux-gnu-gcc -Car=aarch64-linux-gnu-ar"
    mkdir -p build && cd build
    cmake ../zenoh-c  -DZENOHC_CARGO_CHANNEL="+nightly"
 -DZENOHC_CARGO_FLAGS="-Zbuild-std=std,panic_abort"
 -DZENOHC_CUSTOM_TARGET="aarch64-unknown-linux-gnu"
 -DCMAKE_INSTALL_PREFIX=../aarch64/stage
    cmake --build . --target install
    ```
 .
 Additionally you can use `RUSTFLAGS` environment variable for lead the
 compilation.
 .
 If all goes right the building files will be located at:
 `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release`
 and release files will be located at
 `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release`
 .
 ## Rust Version
 .
 The Rust version we use is defined in
 [rust-toolchain.toml](rust-toolchain.toml), which is `1.72.0`.
 There might be some memory mapping issue if you use the later version.
 .
 You can also specify the Rust version.
 .
 ```bash
 cmake ../zenoh-c -DZENOHC_CARGO_CHANNEL="+1.72.0"
 ```
 .
 ## Zenoh features support (enabling/disabling protocols, etc)
 .
 It's necessary sometimes to build zenoh-c library with set of features
 different from default. For example: enable TCP and UDP only. This can be done
 by changing `ZENOHC_CARGO_FLAGS` parameter for cmake (notice ";" instead of
 space due to cmake peculiarities)
 .
 Available features can be found in [Cargo.toml](./Cargo.toml)
 ```bash
 cmake ../zenoh-c
 -DZENOHC_CARGO_FLAGS="--no-default-features;--features=transport_tcp,transport_udp"
 ```
 .
 ## Versioning
 .
 Being a CMake project, zenoh-c is limited to the `MAJOR.MINOR.PATCH.TWEAK`
 version scheme [inherent
 to CMake](https://gitlab.kitware.com/cmake/cmake/-/issues/16716). However,
 zenoh-c also incorporates
 a Cargo package which cannot be versionned with the `MAJOR.MINOR.PATCH.TWEAK`
 version scheme (not
 SemVer compatible). Hence zenoh-c uses a one-to-one mapping between CMake
 versions and SemVer versions:
 .
 | CMake version           | SemVer equivalent | Meaning              |
 |-------------------------|-------------------|----------------------|
 | `1.2.3`                 | `1.2.3`           | Release version      |
 | `1.2.3.0`               | `1.2.3-dev`       | Developement version |
 | `1.2.3.x if x >= 1`     | `1.2.3-pre.x`     | Pre-release version  |
Vcs-Browser: https://github.com/eclipse-zenoh/zenoh-c
Vcs-Git: https://github.com/eclipse-zenoh/zenoh-c

Package: libzenohc
Version: 1.0.0
Architecture: amd64
Maintainer: zenoh-dev@eclipse.org
Installed-Size: 17353
Depends: libc6 (>= 2.29)
Filename: 1.0.0/libzenohc_1.0.0_amd64.deb
Size: 4261088
MD5sum: d82a2d5ba963c544736543ad7a2f738a
SHA1: 4006604417b79d2be725046b350cbd5fb913dc0e
SHA256: 24238799a5f43fb404816166accee86eedbf7398ce6818dc6ac2bec9abfc0ffe
Section: net
Priority: optional
Homepage: http://zenoh.io
Description: The Zenoh C API
 <img
 src="https://raw.githubusercontent.com/eclipse-zenoh/zenoh/main/zenoh-dragon.png"
 height="150">
 .
 [![CI](https://github.com/eclipse-zenoh/zenoh-c/workflows/CI/badge.svg)](https://github.com/eclipse-zenoh/zenoh-c/actions?query=workflow%3A%22CI%22)
 [![Documentation
 Status](https://readthedocs.org/projects/zenoh-c/badge/?version=latest)](https://zenoh-c.readthedocs.io/en/latest/?badge=latest)
 [![Discussion](https://img.shields.io/badge/discussion-on%20github-blue)](https://github.com/eclipse-zenoh/roadmap/discussions)
 [![Discord](https://img.shields.io/badge/chat-on%20discord-blue)](https://discord.gg/2GJ958VuHs)
 [![License](https://img.shields.io/badge/License-EPL%202.0-blue)](https://choosealicense.com/licenses/epl-2.0/)
 [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
 .
 # Eclipse Zenoh
 .
 The Eclipse Zenoh: Zero Overhead Pub/sub, Store/Query and Compute.
 .
 Zenoh (pronounce _/zeno/_) unifies data in motion, data at rest and
 computations. It carefully blends traditional pub/sub with geo-distributed
 storages, queries and computations, while retaining a level of time and space
 efficiency that is well beyond any of the mainstream stacks.
 .
 Check the website [zenoh.io](http://zenoh.io) and the
 [roadmap](https://github.com/eclipse-zenoh/roadmap) for more detailed
 information.
 .
 -------------------------------
 .
 # C API
 .
 This repository provides a C binding based on the main [Zenoh implementation
 written in Rust](https://github.com/eclipse-zenoh/zenoh).
 .
 -------------------------------
 .
 ## How to build it
 .
 > :warning: **WARNING** :warning: : Zenoh and its ecosystem are under active
 development. When you build from git, make sure you also build from git any
 other Zenoh repository you plan to use (e.g. binding, plugin, backend, etc.).
 It may happen that some changes in git are not compatible with the most recent
 packaged Zenoh release (e.g. deb, docker, pip). We put particular effort in
 maintaining compatibility between the various git repositories in the Zenoh
 project.
 .
 1. Make sure that [Rust](https://www.rust-lang.org) is available on your
 platform.
    Please check [here](https://www.rust-lang.org/tools/install) to learn how to
 install it.
    If you already have the Rust toolchain installed, make sure it is up-to-date
 with:
 .
    ```bash
    rustup update
    ```
 .
 2. Clone the [source] with `git`:
 .
    ```bash
    git clone https://github.com/eclipse-zenoh/zenoh-c.git
    ```
 .
    [source]: https://github.com/eclipse-zenoh/zenoh-c
 .
 3. Build:
 .
    Good CMake practice is to perform build outside of source directory, leaving
 source tree untouched. The examples below demonstrates this mode of building.
 On the other hand VScode by default creates build directory named 'build'
 inside source tree. In this case build script slightly changes its behavior.
 See more about it in section 'VScode'.
 .
    By default build configuration is set to `Release`, it's not necessary to
 add `-DCMAKE_BUILD_TYPE=Release` option on configuration step. But if your
 platform uses multi-config generator by default (this is the case on Windows),
 you may need to add option `--config Release` on build step. See more in CMake
 [build-configurations] documentation. Option`--config Release` is skipped in
 further examples for brewity. It's actually necessary for [Visual Studio
 generators] only. For [Ninja Multi-Config] the build script is able to select
 `Release` as the default configuration.
 .
    ```bash
    mkdir -p build && cd build
    cmake ../zenoh-c
    cmake --build . --config Release
    ```
 .
    The generator to use is selected with option `-G`. If Ninja is installed on
 your system, adding `-GNinja` to `cmake` command can greatly speed up the build
 time:
 .
    ```bash
    cmake ../zenoh-c -GNinja
    cmake --build .
    ```
 .
    Unstable api and/or shared memory support can be enabled by setting
 repectively `ZENOHC_BUILD_WITH_UNSTABLE_API` and
 `ZENOHC_BUILD_WITH_SHARED_MEMORY` Cmake flags to `true` during configuration
 step.
 .
    ```bash
    cmake -DZENOHC_BUILD_WITH_UNSTABLE_API=true
 -DZENOHC_BUILD_WITH_SHARED_MEMORY=true ../zenoh-c
    cmake --build . --config Release
    ```
 .
    [build-configurations]:
 https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations
    [Visual Studio generators]:
 https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#id14
    [Ninja Multi-Config]:
 https://cmake.org/cmake/help/latest/generator/Ninja%20Multi-Config.html
 .
 4. Install:
 .
    To install zenoh-c library into system just build target `install`. You need
 root privileges to do it, as the default install location is `/usr/local`.
 .
    ```bash
    cmake --build . --target install
    ```
 .
    If you want to install zenoh-c libraries locally, you can set the
 installation directory with `CMAKE_INSTALL_PREFIX`
 .
    ```bash
    cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local
    cmake --build . --target install
    ```
 .
    By default only dynamic library is built and installed. Set
 `BUILD_SHARED_LIBS` variable to false to build and install static library:
 .
    ```bash
    cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local -DBUILD_SHARED_LIBS=FALSE
    cmake --build . --target install
    ```
 .
    The result of installation is the header files in `include` directory, the
 library files in `lib` directory and cmake package configuration files for
 package `zenohc` in `lib/cmake` directory. The library later can be loaded with
 CMake command `find_package(zenohc)`.
    Add dependency in CMakeLists.txt on target
 .
    - `zenohc::shared` for linking dynamic library
    - `zenohc::static` for linking static library
    - `zenohc::lib` for linking static or dynamic library depending on boolean
 variable `BUILD_SHARED_LIBS`
 .
    For `Debug` configuration suffix `d` is added to names of library files
 (libzenohc**d**.so).
 .
 5. VScode
 .
    When zenoh-c project is opened in VSCode the build directory is set to
 `build` inside source tree (this is default behavior of Microsoft [CMake
 Tools]). The project build script detects this situation. In this case it
 places build files in `target` directory and `Cargo.toml` file (which is
 generated from `Cargo.toml.in`) into the root of source tree, as the rust
 developers used to and as the rust build tools expects by default. This
 behavior also can be explicitly enabled by setting
 `ZENOHC_BUILD_IN_SOURCE_TREE` variable to `TRUE`.
 .
    [CMake Tools]:
 https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools
 .
 ## Building the Examples
 .
 The examples can be built in two ways. One is to select `examples` as a build
 target of zenoh-c project (assuming here that the current directory is
 side-by-side with zenoh-c directory):
 .
 ```bash
 cmake ../zenoh-c
 cmake --build . --target examples
 ```
 .
 You may also use `--target <example_name>` if you wish to only build a specific
 example.
 .
 All build artifacts will be in the `target/release/examples` directory in this
 case.
 .
 The second way is to directly build `examples` as a root project:
 .
 ```bash
 cmake ../zenoh-c/examples
 cmake --build .
 ```
 .
 In this case, the examples executables will be built in the current directory.
 .
 As a root project the `examples` project links `zenoh-c` with CMake's
 [add_subdirectory] command by default. There are also other ways to link
 `zenoh-c` - with [find_package] or [FetchContent]:
 .
 [add_subdirectory]:
 https://cmake.org/cmake/help/latest/command/add_subdirectory.html
 [find_package]: https://cmake.org/cmake/help/latest/command/find_package.html
 [FetchContent]: https://cmake.org/cmake/help/latest/module/FetchContent.html
 .
 Link with `zenoh-c` installed into default location in the system (with
 [find_package]):
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE
 ```
 .
 Link with `zenoh-c` installed in `~/.local` directory:
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE
 -DCMAKE_INSTALL_PREFIX=~/.local
 ```
 .
 Download specific `zenoh-c` version from git with [FetchContent]:
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=GIT_URL -DZENOHC_GIT_TAG=0.11.0-rc
 ```
 .
 See also `configure_include_project` function in [helpers.cmake] for more
 information
 .
 [helpers.cmake]: cmake/helpers.cmake
 .
 ## Running the Examples
 .
 ### Basic Pub/Sub Example
 .
 ```bash
 ./target/release/examples/z_sub
 ```
 .
 ```bash
 ./target/release/examples/z_pub
 ```
 .
 ### Queryable and Query Example
 .
 ```bash
 ./target/release/examples/z_queryable
 ```
 .
 ```bash
 ./target/release/examples/z_get
 ```
 .
 ### Running the Throughput Examples
 .
 ```bash
 ./target/release/examples/z_sub_thr
 ```
 .
 ```bash
 ./target/release/examples/z_pub_thr
 ```
 .
 ## Documentation
 Zenoh-c API documentation is available on [Read the
 Docs](https://zenoh-c.readthedocs.io/en/latest/index.html).
 .
 It can be built manually by performing the following steps:
 .
 ```bash
 cd docs
 doxygen
 sphinx-build -b html . _build/html
 ```
 .
 ## Cross-Compilation
 .
 The following alternative options have been introduced to facilitate
 cross-compilation.
 > :warning: **WARNING** :warning: : Perhaps additional efforts are necessary,
 that will depend of your environment.
 .
 - `-DZENOHC_CARGO_CHANNEL="+nightly"|"+beta"|"+stable"`: refers to a specific
 rust toolchain release
 [[rust-channels](https://rust-lang.github.io/rustup/concepts/channels.html)]
 - `-DZENOHC_CARGO_FLAGS`: several optional flags can be used for compilation.
 [[cargo flags](https://doc.rust-lang.org/cargo/commands/cargo-build.html)]
 - `-DZENOHC_CUSTOM_TARGET`: specifies a crosscompilation target. Currently rust
 support several Tire-1, Tire-2 and Tire-3 targets
 [[targets](https://doc.rust-lang.org/nightly/rustc/platform-support.html)]. But
 keep in mind that zenoh-c only have support for following targets:
 `aarch64-unknown-linux-gnu`, `x86_64-unknown-linux-gnu`,
 `arm-unknown-linux-gnueabi`
 .
 Let's put all together in an example:
 Assuming you want to crosscompile for aarch64-unknown-linux-gnu.
 .
 1. Install required packages
    - `sudo apt install gcc-aarch64-linux-gnu`
 2. *(Only if you're using `nightly`)
    - `rustup component add rust-src --toolchain nightly`
 3. Compile Zenoh-C. Assume that it's in `zenoh-c` directory. Notice that build
 in this sample is performed outside of source directory
 .
    ```bash
    export RUSTFLAGS="-Clinker=aarch64-linux-gnu-gcc -Car=aarch64-linux-gnu-ar"
    mkdir -p build && cd build
    cmake ../zenoh-c  -DZENOHC_CARGO_CHANNEL="+nightly"
 -DZENOHC_CARGO_FLAGS="-Zbuild-std=std,panic_abort"
 -DZENOHC_CUSTOM_TARGET="aarch64-unknown-linux-gnu"
 -DCMAKE_INSTALL_PREFIX=../aarch64/stage
    cmake --build . --target install
    ```
 .
 Additionally you can use `RUSTFLAGS` environment variable for lead the
 compilation.
 .
 If all goes right the building files will be located at:
 `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release`
 and release files will be located at
 `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release`
 .
 ## Rust Version
 .
 The Rust version we use is defined in
 [rust-toolchain.toml](rust-toolchain.toml), which is `1.72.0`.
 There might be some memory mapping issue if you use the later version.
 .
 You can also specify the Rust version.
 .
 ```bash
 cmake ../zenoh-c -DZENOHC_CARGO_CHANNEL="+1.72.0"
 ```
 .
 ## Zenoh features support (enabling/disabling protocols, etc)
 .
 It's necessary sometimes to build zenoh-c library with set of features
 different from default. For example: enable TCP and UDP only. This can be done
 by changing `ZENOHC_CARGO_FLAGS` parameter for cmake (notice ";" instead of
 space due to cmake peculiarities)
 .
 Available features can be found in [Cargo.toml](./Cargo.toml)
 ```bash
 cmake ../zenoh-c
 -DZENOHC_CARGO_FLAGS="--no-default-features;--features=transport_tcp,transport_udp"
 ```
 .
 ## Versioning
 .
 Being a CMake project, zenoh-c is limited to the `MAJOR.MINOR.PATCH.TWEAK`
 version scheme [inherent
 to CMake](https://gitlab.kitware.com/cmake/cmake/-/issues/16716). However,
 zenoh-c also incorporates
 a Cargo package which cannot be versionned with the `MAJOR.MINOR.PATCH.TWEAK`
 version scheme (not
 SemVer compatible). Hence zenoh-c uses a one-to-one mapping between CMake
 versions and SemVer versions:
 .
 | CMake version           | SemVer equivalent | Meaning              |
 |-------------------------|-------------------|----------------------|
 | `1.2.3`                 | `1.2.3`           | Release version      |
 | `1.2.3.0`               | `1.2.3-dev`       | Developement version |
 | `1.2.3.x if x >= 1`     | `1.2.3-pre.x`     | Pre-release version  |
Vcs-Browser: https://github.com/eclipse-zenoh/zenoh-c
Vcs-Git: https://github.com/eclipse-zenoh/zenoh-c

Package: libzenohc
Version: 1.0.0
Architecture: armhf
Maintainer: zenoh-dev@eclipse.org
Installed-Size: 16716
Filename: 1.0.0/libzenohc_1.0.0_armhf.deb
Size: 4163828
MD5sum: 19aa5b2d4adafedd2c206bac363395bf
SHA1: 8ec2baccdd1770752eea2772b61d715faf5d12b6
SHA256: 6ee26ed6365d8e1da72fc24e186f9486dd122ebd83967e6b1d22930a6ee2dbad
Section: net
Priority: optional
Homepage: http://zenoh.io
Description: The Zenoh C API
 <img
 src="https://raw.githubusercontent.com/eclipse-zenoh/zenoh/main/zenoh-dragon.png"
 height="150">
 .
 [![CI](https://github.com/eclipse-zenoh/zenoh-c/workflows/CI/badge.svg)](https://github.com/eclipse-zenoh/zenoh-c/actions?query=workflow%3A%22CI%22)
 [![Documentation
 Status](https://readthedocs.org/projects/zenoh-c/badge/?version=latest)](https://zenoh-c.readthedocs.io/en/latest/?badge=latest)
 [![Discussion](https://img.shields.io/badge/discussion-on%20github-blue)](https://github.com/eclipse-zenoh/roadmap/discussions)
 [![Discord](https://img.shields.io/badge/chat-on%20discord-blue)](https://discord.gg/2GJ958VuHs)
 [![License](https://img.shields.io/badge/License-EPL%202.0-blue)](https://choosealicense.com/licenses/epl-2.0/)
 [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
 .
 # Eclipse Zenoh
 .
 The Eclipse Zenoh: Zero Overhead Pub/sub, Store/Query and Compute.
 .
 Zenoh (pronounce _/zeno/_) unifies data in motion, data at rest and
 computations. It carefully blends traditional pub/sub with geo-distributed
 storages, queries and computations, while retaining a level of time and space
 efficiency that is well beyond any of the mainstream stacks.
 .
 Check the website [zenoh.io](http://zenoh.io) and the
 [roadmap](https://github.com/eclipse-zenoh/roadmap) for more detailed
 information.
 .
 -------------------------------
 .
 # C API
 .
 This repository provides a C binding based on the main [Zenoh implementation
 written in Rust](https://github.com/eclipse-zenoh/zenoh).
 .
 -------------------------------
 .
 ## How to build it
 .
 > :warning: **WARNING** :warning: : Zenoh and its ecosystem are under active
 development. When you build from git, make sure you also build from git any
 other Zenoh repository you plan to use (e.g. binding, plugin, backend, etc.).
 It may happen that some changes in git are not compatible with the most recent
 packaged Zenoh release (e.g. deb, docker, pip). We put particular effort in
 maintaining compatibility between the various git repositories in the Zenoh
 project.
 .
 1. Make sure that [Rust](https://www.rust-lang.org) is available on your
 platform.
    Please check [here](https://www.rust-lang.org/tools/install) to learn how to
 install it.
    If you already have the Rust toolchain installed, make sure it is up-to-date
 with:
 .
    ```bash
    rustup update
    ```
 .
 2. Clone the [source] with `git`:
 .
    ```bash
    git clone https://github.com/eclipse-zenoh/zenoh-c.git
    ```
 .
    [source]: https://github.com/eclipse-zenoh/zenoh-c
 .
 3. Build:
 .
    Good CMake practice is to perform build outside of source directory, leaving
 source tree untouched. The examples below demonstrates this mode of building.
 On the other hand VScode by default creates build directory named 'build'
 inside source tree. In this case build script slightly changes its behavior.
 See more about it in section 'VScode'.
 .
    By default build configuration is set to `Release`, it's not necessary to
 add `-DCMAKE_BUILD_TYPE=Release` option on configuration step. But if your
 platform uses multi-config generator by default (this is the case on Windows),
 you may need to add option `--config Release` on build step. See more in CMake
 [build-configurations] documentation. Option`--config Release` is skipped in
 further examples for brewity. It's actually necessary for [Visual Studio
 generators] only. For [Ninja Multi-Config] the build script is able to select
 `Release` as the default configuration.
 .
    ```bash
    mkdir -p build && cd build
    cmake ../zenoh-c
    cmake --build . --config Release
    ```
 .
    The generator to use is selected with option `-G`. If Ninja is installed on
 your system, adding `-GNinja` to `cmake` command can greatly speed up the build
 time:
 .
    ```bash
    cmake ../zenoh-c -GNinja
    cmake --build .
    ```
 .
    Unstable api and/or shared memory support can be enabled by setting
 repectively `ZENOHC_BUILD_WITH_UNSTABLE_API` and
 `ZENOHC_BUILD_WITH_SHARED_MEMORY` Cmake flags to `true` during configuration
 step.
 .
    ```bash
    cmake -DZENOHC_BUILD_WITH_UNSTABLE_API=true
 -DZENOHC_BUILD_WITH_SHARED_MEMORY=true ../zenoh-c
    cmake --build . --config Release
    ```
 .
    [build-configurations]:
 https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations
    [Visual Studio generators]:
 https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#id14
    [Ninja Multi-Config]:
 https://cmake.org/cmake/help/latest/generator/Ninja%20Multi-Config.html
 .
 4. Install:
 .
    To install zenoh-c library into system just build target `install`. You need
 root privileges to do it, as the default install location is `/usr/local`.
 .
    ```bash
    cmake --build . --target install
    ```
 .
    If you want to install zenoh-c libraries locally, you can set the
 installation directory with `CMAKE_INSTALL_PREFIX`
 .
    ```bash
    cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local
    cmake --build . --target install
    ```
 .
    By default only dynamic library is built and installed. Set
 `BUILD_SHARED_LIBS` variable to false to build and install static library:
 .
    ```bash
    cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local -DBUILD_SHARED_LIBS=FALSE
    cmake --build . --target install
    ```
 .
    The result of installation is the header files in `include` directory, the
 library files in `lib` directory and cmake package configuration files for
 package `zenohc` in `lib/cmake` directory. The library later can be loaded with
 CMake command `find_package(zenohc)`.
    Add dependency in CMakeLists.txt on target
 .
    - `zenohc::shared` for linking dynamic library
    - `zenohc::static` for linking static library
    - `zenohc::lib` for linking static or dynamic library depending on boolean
 variable `BUILD_SHARED_LIBS`
 .
    For `Debug` configuration suffix `d` is added to names of library files
 (libzenohc**d**.so).
 .
 5. VScode
 .
    When zenoh-c project is opened in VSCode the build directory is set to
 `build` inside source tree (this is default behavior of Microsoft [CMake
 Tools]). The project build script detects this situation. In this case it
 places build files in `target` directory and `Cargo.toml` file (which is
 generated from `Cargo.toml.in`) into the root of source tree, as the rust
 developers used to and as the rust build tools expects by default. This
 behavior also can be explicitly enabled by setting
 `ZENOHC_BUILD_IN_SOURCE_TREE` variable to `TRUE`.
 .
    [CMake Tools]:
 https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools
 .
 ## Building the Examples
 .
 The examples can be built in two ways. One is to select `examples` as a build
 target of zenoh-c project (assuming here that the current directory is
 side-by-side with zenoh-c directory):
 .
 ```bash
 cmake ../zenoh-c
 cmake --build . --target examples
 ```
 .
 You may also use `--target <example_name>` if you wish to only build a specific
 example.
 .
 All build artifacts will be in the `target/release/examples` directory in this
 case.
 .
 The second way is to directly build `examples` as a root project:
 .
 ```bash
 cmake ../zenoh-c/examples
 cmake --build .
 ```
 .
 In this case, the examples executables will be built in the current directory.
 .
 As a root project the `examples` project links `zenoh-c` with CMake's
 [add_subdirectory] command by default. There are also other ways to link
 `zenoh-c` - with [find_package] or [FetchContent]:
 .
 [add_subdirectory]:
 https://cmake.org/cmake/help/latest/command/add_subdirectory.html
 [find_package]: https://cmake.org/cmake/help/latest/command/find_package.html
 [FetchContent]: https://cmake.org/cmake/help/latest/module/FetchContent.html
 .
 Link with `zenoh-c` installed into default location in the system (with
 [find_package]):
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE
 ```
 .
 Link with `zenoh-c` installed in `~/.local` directory:
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE
 -DCMAKE_INSTALL_PREFIX=~/.local
 ```
 .
 Download specific `zenoh-c` version from git with [FetchContent]:
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=GIT_URL -DZENOHC_GIT_TAG=0.11.0-rc
 ```
 .
 See also `configure_include_project` function in [helpers.cmake] for more
 information
 .
 [helpers.cmake]: cmake/helpers.cmake
 .
 ## Running the Examples
 .
 ### Basic Pub/Sub Example
 .
 ```bash
 ./target/release/examples/z_sub
 ```
 .
 ```bash
 ./target/release/examples/z_pub
 ```
 .
 ### Queryable and Query Example
 .
 ```bash
 ./target/release/examples/z_queryable
 ```
 .
 ```bash
 ./target/release/examples/z_get
 ```
 .
 ### Running the Throughput Examples
 .
 ```bash
 ./target/release/examples/z_sub_thr
 ```
 .
 ```bash
 ./target/release/examples/z_pub_thr
 ```
 .
 ## Documentation
 Zenoh-c API documentation is available on [Read the
 Docs](https://zenoh-c.readthedocs.io/en/latest/index.html).
 .
 It can be built manually by performing the following steps:
 .
 ```bash
 cd docs
 doxygen
 sphinx-build -b html . _build/html
 ```
 .
 ## Cross-Compilation
 .
 The following alternative options have been introduced to facilitate
 cross-compilation.
 > :warning: **WARNING** :warning: : Perhaps additional efforts are necessary,
 that will depend of your environment.
 .
 - `-DZENOHC_CARGO_CHANNEL="+nightly"|"+beta"|"+stable"`: refers to a specific
 rust toolchain release
 [[rust-channels](https://rust-lang.github.io/rustup/concepts/channels.html)]
 - `-DZENOHC_CARGO_FLAGS`: several optional flags can be used for compilation.
 [[cargo flags](https://doc.rust-lang.org/cargo/commands/cargo-build.html)]
 - `-DZENOHC_CUSTOM_TARGET`: specifies a crosscompilation target. Currently rust
 support several Tire-1, Tire-2 and Tire-3 targets
 [[targets](https://doc.rust-lang.org/nightly/rustc/platform-support.html)]. But
 keep in mind that zenoh-c only have support for following targets:
 `aarch64-unknown-linux-gnu`, `x86_64-unknown-linux-gnu`,
 `arm-unknown-linux-gnueabi`
 .
 Let's put all together in an example:
 Assuming you want to crosscompile for aarch64-unknown-linux-gnu.
 .
 1. Install required packages
    - `sudo apt install gcc-aarch64-linux-gnu`
 2. *(Only if you're using `nightly`)
    - `rustup component add rust-src --toolchain nightly`
 3. Compile Zenoh-C. Assume that it's in `zenoh-c` directory. Notice that build
 in this sample is performed outside of source directory
 .
    ```bash
    export RUSTFLAGS="-Clinker=aarch64-linux-gnu-gcc -Car=aarch64-linux-gnu-ar"
    mkdir -p build && cd build
    cmake ../zenoh-c  -DZENOHC_CARGO_CHANNEL="+nightly"
 -DZENOHC_CARGO_FLAGS="-Zbuild-std=std,panic_abort"
 -DZENOHC_CUSTOM_TARGET="aarch64-unknown-linux-gnu"
 -DCMAKE_INSTALL_PREFIX=../aarch64/stage
    cmake --build . --target install
    ```
 .
 Additionally you can use `RUSTFLAGS` environment variable for lead the
 compilation.
 .
 If all goes right the building files will be located at:
 `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release`
 and release files will be located at
 `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release`
 .
 ## Rust Version
 .
 The Rust version we use is defined in
 [rust-toolchain.toml](rust-toolchain.toml), which is `1.72.0`.
 There might be some memory mapping issue if you use the later version.
 .
 You can also specify the Rust version.
 .
 ```bash
 cmake ../zenoh-c -DZENOHC_CARGO_CHANNEL="+1.72.0"
 ```
 .
 ## Zenoh features support (enabling/disabling protocols, etc)
 .
 It's necessary sometimes to build zenoh-c library with set of features
 different from default. For example: enable TCP and UDP only. This can be done
 by changing `ZENOHC_CARGO_FLAGS` parameter for cmake (notice ";" instead of
 space due to cmake peculiarities)
 .
 Available features can be found in [Cargo.toml](./Cargo.toml)
 ```bash
 cmake ../zenoh-c
 -DZENOHC_CARGO_FLAGS="--no-default-features;--features=transport_tcp,transport_udp"
 ```
 .
 ## Versioning
 .
 Being a CMake project, zenoh-c is limited to the `MAJOR.MINOR.PATCH.TWEAK`
 version scheme [inherent
 to CMake](https://gitlab.kitware.com/cmake/cmake/-/issues/16716). However,
 zenoh-c also incorporates
 a Cargo package which cannot be versionned with the `MAJOR.MINOR.PATCH.TWEAK`
 version scheme (not
 SemVer compatible). Hence zenoh-c uses a one-to-one mapping between CMake
 versions and SemVer versions:
 .
 | CMake version           | SemVer equivalent | Meaning              |
 |-------------------------|-------------------|----------------------|
 | `1.2.3`                 | `1.2.3`           | Release version      |
 | `1.2.3.0`               | `1.2.3-dev`       | Developement version |
 | `1.2.3.x if x >= 1`     | `1.2.3-pre.x`     | Pre-release version  |
Vcs-Browser: https://github.com/eclipse-zenoh/zenoh-c
Vcs-Git: https://github.com/eclipse-zenoh/zenoh-c

Package: libzenohc
Version: 1.0.0
Architecture: arm64
Maintainer: zenoh-dev@eclipse.org
Installed-Size: 15786
Filename: 1.0.0/libzenohc_1.0.0_arm64.deb
Size: 3843292
MD5sum: bf0f0f8d27bb2ff8f3915ef01eeae1e0
SHA1: ffe231a2dce63e7ff8a7f062908cbd3d4ae15ac7
SHA256: 5ec838706ce56176cf23fe69ca8a2a292bac787b198d04124e8bd989627ae78c
Section: net
Priority: optional
Homepage: http://zenoh.io
Description: The Zenoh C API
 <img
 src="https://raw.githubusercontent.com/eclipse-zenoh/zenoh/main/zenoh-dragon.png"
 height="150">
 .
 [![CI](https://github.com/eclipse-zenoh/zenoh-c/workflows/CI/badge.svg)](https://github.com/eclipse-zenoh/zenoh-c/actions?query=workflow%3A%22CI%22)
 [![Documentation
 Status](https://readthedocs.org/projects/zenoh-c/badge/?version=latest)](https://zenoh-c.readthedocs.io/en/latest/?badge=latest)
 [![Discussion](https://img.shields.io/badge/discussion-on%20github-blue)](https://github.com/eclipse-zenoh/roadmap/discussions)
 [![Discord](https://img.shields.io/badge/chat-on%20discord-blue)](https://discord.gg/2GJ958VuHs)
 [![License](https://img.shields.io/badge/License-EPL%202.0-blue)](https://choosealicense.com/licenses/epl-2.0/)
 [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
 .
 # Eclipse Zenoh
 .
 The Eclipse Zenoh: Zero Overhead Pub/sub, Store/Query and Compute.
 .
 Zenoh (pronounce _/zeno/_) unifies data in motion, data at rest and
 computations. It carefully blends traditional pub/sub with geo-distributed
 storages, queries and computations, while retaining a level of time and space
 efficiency that is well beyond any of the mainstream stacks.
 .
 Check the website [zenoh.io](http://zenoh.io) and the
 [roadmap](https://github.com/eclipse-zenoh/roadmap) for more detailed
 information.
 .
 -------------------------------
 .
 # C API
 .
 This repository provides a C binding based on the main [Zenoh implementation
 written in Rust](https://github.com/eclipse-zenoh/zenoh).
 .
 -------------------------------
 .
 ## How to build it
 .
 > :warning: **WARNING** :warning: : Zenoh and its ecosystem are under active
 development. When you build from git, make sure you also build from git any
 other Zenoh repository you plan to use (e.g. binding, plugin, backend, etc.).
 It may happen that some changes in git are not compatible with the most recent
 packaged Zenoh release (e.g. deb, docker, pip). We put particular effort in
 maintaining compatibility between the various git repositories in the Zenoh
 project.
 .
 1. Make sure that [Rust](https://www.rust-lang.org) is available on your
 platform.
    Please check [here](https://www.rust-lang.org/tools/install) to learn how to
 install it.
    If you already have the Rust toolchain installed, make sure it is up-to-date
 with:
 .
    ```bash
    rustup update
    ```
 .
 2. Clone the [source] with `git`:
 .
    ```bash
    git clone https://github.com/eclipse-zenoh/zenoh-c.git
    ```
 .
    [source]: https://github.com/eclipse-zenoh/zenoh-c
 .
 3. Build:
 .
    Good CMake practice is to perform build outside of source directory, leaving
 source tree untouched. The examples below demonstrates this mode of building.
 On the other hand VScode by default creates build directory named 'build'
 inside source tree. In this case build script slightly changes its behavior.
 See more about it in section 'VScode'.
 .
    By default build configuration is set to `Release`, it's not necessary to
 add `-DCMAKE_BUILD_TYPE=Release` option on configuration step. But if your
 platform uses multi-config generator by default (this is the case on Windows),
 you may need to add option `--config Release` on build step. See more in CMake
 [build-configurations] documentation. Option`--config Release` is skipped in
 further examples for brewity. It's actually necessary for [Visual Studio
 generators] only. For [Ninja Multi-Config] the build script is able to select
 `Release` as the default configuration.
 .
    ```bash
    mkdir -p build && cd build
    cmake ../zenoh-c
    cmake --build . --config Release
    ```
 .
    The generator to use is selected with option `-G`. If Ninja is installed on
 your system, adding `-GNinja` to `cmake` command can greatly speed up the build
 time:
 .
    ```bash
    cmake ../zenoh-c -GNinja
    cmake --build .
    ```
 .
    Unstable api and/or shared memory support can be enabled by setting
 repectively `ZENOHC_BUILD_WITH_UNSTABLE_API` and
 `ZENOHC_BUILD_WITH_SHARED_MEMORY` Cmake flags to `true` during configuration
 step.
 .
    ```bash
    cmake -DZENOHC_BUILD_WITH_UNSTABLE_API=true
 -DZENOHC_BUILD_WITH_SHARED_MEMORY=true ../zenoh-c
    cmake --build . --config Release
    ```
 .
    [build-configurations]:
 https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations
    [Visual Studio generators]:
 https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#id14
    [Ninja Multi-Config]:
 https://cmake.org/cmake/help/latest/generator/Ninja%20Multi-Config.html
 .
 4. Install:
 .
    To install zenoh-c library into system just build target `install`. You need
 root privileges to do it, as the default install location is `/usr/local`.
 .
    ```bash
    cmake --build . --target install
    ```
 .
    If you want to install zenoh-c libraries locally, you can set the
 installation directory with `CMAKE_INSTALL_PREFIX`
 .
    ```bash
    cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local
    cmake --build . --target install
    ```
 .
    By default only dynamic library is built and installed. Set
 `BUILD_SHARED_LIBS` variable to false to build and install static library:
 .
    ```bash
    cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local -DBUILD_SHARED_LIBS=FALSE
    cmake --build . --target install
    ```
 .
    The result of installation is the header files in `include` directory, the
 library files in `lib` directory and cmake package configuration files for
 package `zenohc` in `lib/cmake` directory. The library later can be loaded with
 CMake command `find_package(zenohc)`.
    Add dependency in CMakeLists.txt on target
 .
    - `zenohc::shared` for linking dynamic library
    - `zenohc::static` for linking static library
    - `zenohc::lib` for linking static or dynamic library depending on boolean
 variable `BUILD_SHARED_LIBS`
 .
    For `Debug` configuration suffix `d` is added to names of library files
 (libzenohc**d**.so).
 .
 5. VScode
 .
    When zenoh-c project is opened in VSCode the build directory is set to
 `build` inside source tree (this is default behavior of Microsoft [CMake
 Tools]). The project build script detects this situation. In this case it
 places build files in `target` directory and `Cargo.toml` file (which is
 generated from `Cargo.toml.in`) into the root of source tree, as the rust
 developers used to and as the rust build tools expects by default. This
 behavior also can be explicitly enabled by setting
 `ZENOHC_BUILD_IN_SOURCE_TREE` variable to `TRUE`.
 .
    [CMake Tools]:
 https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools
 .
 ## Building the Examples
 .
 The examples can be built in two ways. One is to select `examples` as a build
 target of zenoh-c project (assuming here that the current directory is
 side-by-side with zenoh-c directory):
 .
 ```bash
 cmake ../zenoh-c
 cmake --build . --target examples
 ```
 .
 You may also use `--target <example_name>` if you wish to only build a specific
 example.
 .
 All build artifacts will be in the `target/release/examples` directory in this
 case.
 .
 The second way is to directly build `examples` as a root project:
 .
 ```bash
 cmake ../zenoh-c/examples
 cmake --build .
 ```
 .
 In this case, the examples executables will be built in the current directory.
 .
 As a root project the `examples` project links `zenoh-c` with CMake's
 [add_subdirectory] command by default. There are also other ways to link
 `zenoh-c` - with [find_package] or [FetchContent]:
 .
 [add_subdirectory]:
 https://cmake.org/cmake/help/latest/command/add_subdirectory.html
 [find_package]: https://cmake.org/cmake/help/latest/command/find_package.html
 [FetchContent]: https://cmake.org/cmake/help/latest/module/FetchContent.html
 .
 Link with `zenoh-c` installed into default location in the system (with
 [find_package]):
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE
 ```
 .
 Link with `zenoh-c` installed in `~/.local` directory:
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE
 -DCMAKE_INSTALL_PREFIX=~/.local
 ```
 .
 Download specific `zenoh-c` version from git with [FetchContent]:
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=GIT_URL -DZENOHC_GIT_TAG=0.11.0-rc
 ```
 .
 See also `configure_include_project` function in [helpers.cmake] for more
 information
 .
 [helpers.cmake]: cmake/helpers.cmake
 .
 ## Running the Examples
 .
 ### Basic Pub/Sub Example
 .
 ```bash
 ./target/release/examples/z_sub
 ```
 .
 ```bash
 ./target/release/examples/z_pub
 ```
 .
 ### Queryable and Query Example
 .
 ```bash
 ./target/release/examples/z_queryable
 ```
 .
 ```bash
 ./target/release/examples/z_get
 ```
 .
 ### Running the Throughput Examples
 .
 ```bash
 ./target/release/examples/z_sub_thr
 ```
 .
 ```bash
 ./target/release/examples/z_pub_thr
 ```
 .
 ## Documentation
 Zenoh-c API documentation is available on [Read the
 Docs](https://zenoh-c.readthedocs.io/en/latest/index.html).
 .
 It can be built manually by performing the following steps:
 .
 ```bash
 cd docs
 doxygen
 sphinx-build -b html . _build/html
 ```
 .
 ## Cross-Compilation
 .
 The following alternative options have been introduced to facilitate
 cross-compilation.
 > :warning: **WARNING** :warning: : Perhaps additional efforts are necessary,
 that will depend of your environment.
 .
 - `-DZENOHC_CARGO_CHANNEL="+nightly"|"+beta"|"+stable"`: refers to a specific
 rust toolchain release
 [[rust-channels](https://rust-lang.github.io/rustup/concepts/channels.html)]
 - `-DZENOHC_CARGO_FLAGS`: several optional flags can be used for compilation.
 [[cargo flags](https://doc.rust-lang.org/cargo/commands/cargo-build.html)]
 - `-DZENOHC_CUSTOM_TARGET`: specifies a crosscompilation target. Currently rust
 support several Tire-1, Tire-2 and Tire-3 targets
 [[targets](https://doc.rust-lang.org/nightly/rustc/platform-support.html)]. But
 keep in mind that zenoh-c only have support for following targets:
 `aarch64-unknown-linux-gnu`, `x86_64-unknown-linux-gnu`,
 `arm-unknown-linux-gnueabi`
 .
 Let's put all together in an example:
 Assuming you want to crosscompile for aarch64-unknown-linux-gnu.
 .
 1. Install required packages
    - `sudo apt install gcc-aarch64-linux-gnu`
 2. *(Only if you're using `nightly`)
    - `rustup component add rust-src --toolchain nightly`
 3. Compile Zenoh-C. Assume that it's in `zenoh-c` directory. Notice that build
 in this sample is performed outside of source directory
 .
    ```bash
    export RUSTFLAGS="-Clinker=aarch64-linux-gnu-gcc -Car=aarch64-linux-gnu-ar"
    mkdir -p build && cd build
    cmake ../zenoh-c  -DZENOHC_CARGO_CHANNEL="+nightly"
 -DZENOHC_CARGO_FLAGS="-Zbuild-std=std,panic_abort"
 -DZENOHC_CUSTOM_TARGET="aarch64-unknown-linux-gnu"
 -DCMAKE_INSTALL_PREFIX=../aarch64/stage
    cmake --build . --target install
    ```
 .
 Additionally you can use `RUSTFLAGS` environment variable for lead the
 compilation.
 .
 If all goes right the building files will be located at:
 `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release`
 and release files will be located at
 `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release`
 .
 ## Rust Version
 .
 The Rust version we use is defined in
 [rust-toolchain.toml](rust-toolchain.toml), which is `1.72.0`.
 There might be some memory mapping issue if you use the later version.
 .
 You can also specify the Rust version.
 .
 ```bash
 cmake ../zenoh-c -DZENOHC_CARGO_CHANNEL="+1.72.0"
 ```
 .
 ## Zenoh features support (enabling/disabling protocols, etc)
 .
 It's necessary sometimes to build zenoh-c library with set of features
 different from default. For example: enable TCP and UDP only. This can be done
 by changing `ZENOHC_CARGO_FLAGS` parameter for cmake (notice ";" instead of
 space due to cmake peculiarities)
 .
 Available features can be found in [Cargo.toml](./Cargo.toml)
 ```bash
 cmake ../zenoh-c
 -DZENOHC_CARGO_FLAGS="--no-default-features;--features=transport_tcp,transport_udp"
 ```
 .
 ## Versioning
 .
 Being a CMake project, zenoh-c is limited to the `MAJOR.MINOR.PATCH.TWEAK`
 version scheme [inherent
 to CMake](https://gitlab.kitware.com/cmake/cmake/-/issues/16716). However,
 zenoh-c also incorporates
 a Cargo package which cannot be versionned with the `MAJOR.MINOR.PATCH.TWEAK`
 version scheme (not
 SemVer compatible). Hence zenoh-c uses a one-to-one mapping between CMake
 versions and SemVer versions:
 .
 | CMake version           | SemVer equivalent | Meaning              |
 |-------------------------|-------------------|----------------------|
 | `1.2.3`                 | `1.2.3`           | Release version      |
 | `1.2.3.0`               | `1.2.3-dev`       | Developement version |
 | `1.2.3.x if x >= 1`     | `1.2.3-pre.x`     | Pre-release version  |
Vcs-Browser: https://github.com/eclipse-zenoh/zenoh-c
Vcs-Git: https://github.com/eclipse-zenoh/zenoh-c

Package: libzenohc-dev
Version: 1.0.0
Architecture: amd64
Maintainer: zenoh-dev@eclipse.org
Installed-Size: 339
Depends: libzenohc (=1.0.0)
Filename: 1.0.0/libzenohc-dev_1.0.0_amd64.deb
Size: 45500
MD5sum: 53089d8311c251baf294e565d17b538d
SHA1: 790e45ce79ebc48fe6ba935be3b9812d033127e1
SHA256: 384deee279eef39308e2fb119d5b520c42d43255c9e79309429294b794a625e2
Section: net
Priority: optional
Homepage: http://zenoh.io
Description: The Zenoh C API
 <img
 src="https://raw.githubusercontent.com/eclipse-zenoh/zenoh/main/zenoh-dragon.png"
 height="150">
 .
 [![CI](https://github.com/eclipse-zenoh/zenoh-c/workflows/CI/badge.svg)](https://github.com/eclipse-zenoh/zenoh-c/actions?query=workflow%3A%22CI%22)
 [![Documentation
 Status](https://readthedocs.org/projects/zenoh-c/badge/?version=latest)](https://zenoh-c.readthedocs.io/en/latest/?badge=latest)
 [![Discussion](https://img.shields.io/badge/discussion-on%20github-blue)](https://github.com/eclipse-zenoh/roadmap/discussions)
 [![Discord](https://img.shields.io/badge/chat-on%20discord-blue)](https://discord.gg/2GJ958VuHs)
 [![License](https://img.shields.io/badge/License-EPL%202.0-blue)](https://choosealicense.com/licenses/epl-2.0/)
 [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
 .
 # Eclipse Zenoh
 .
 The Eclipse Zenoh: Zero Overhead Pub/sub, Store/Query and Compute.
 .
 Zenoh (pronounce _/zeno/_) unifies data in motion, data at rest and
 computations. It carefully blends traditional pub/sub with geo-distributed
 storages, queries and computations, while retaining a level of time and space
 efficiency that is well beyond any of the mainstream stacks.
 .
 Check the website [zenoh.io](http://zenoh.io) and the
 [roadmap](https://github.com/eclipse-zenoh/roadmap) for more detailed
 information.
 .
 -------------------------------
 .
 # C API
 .
 This repository provides a C binding based on the main [Zenoh implementation
 written in Rust](https://github.com/eclipse-zenoh/zenoh).
 .
 -------------------------------
 .
 ## How to build it
 .
 > :warning: **WARNING** :warning: : Zenoh and its ecosystem are under active
 development. When you build from git, make sure you also build from git any
 other Zenoh repository you plan to use (e.g. binding, plugin, backend, etc.).
 It may happen that some changes in git are not compatible with the most recent
 packaged Zenoh release (e.g. deb, docker, pip). We put particular effort in
 maintaining compatibility between the various git repositories in the Zenoh
 project.
 .
 1. Make sure that [Rust](https://www.rust-lang.org) is available on your
 platform.
    Please check [here](https://www.rust-lang.org/tools/install) to learn how to
 install it.
    If you already have the Rust toolchain installed, make sure it is up-to-date
 with:
 .
    ```bash
    rustup update
    ```
 .
 2. Clone the [source] with `git`:
 .
    ```bash
    git clone https://github.com/eclipse-zenoh/zenoh-c.git
    ```
 .
    [source]: https://github.com/eclipse-zenoh/zenoh-c
 .
 3. Build:
 .
    Good CMake practice is to perform build outside of source directory, leaving
 source tree untouched. The examples below demonstrates this mode of building.
 On the other hand VScode by default creates build directory named 'build'
 inside source tree. In this case build script slightly changes its behavior.
 See more about it in section 'VScode'.
 .
    By default build configuration is set to `Release`, it's not necessary to
 add `-DCMAKE_BUILD_TYPE=Release` option on configuration step. But if your
 platform uses multi-config generator by default (this is the case on Windows),
 you may need to add option `--config Release` on build step. See more in CMake
 [build-configurations] documentation. Option`--config Release` is skipped in
 further examples for brewity. It's actually necessary for [Visual Studio
 generators] only. For [Ninja Multi-Config] the build script is able to select
 `Release` as the default configuration.
 .
    ```bash
    mkdir -p build && cd build
    cmake ../zenoh-c
    cmake --build . --config Release
    ```
 .
    The generator to use is selected with option `-G`. If Ninja is installed on
 your system, adding `-GNinja` to `cmake` command can greatly speed up the build
 time:
 .
    ```bash
    cmake ../zenoh-c -GNinja
    cmake --build .
    ```
 .
    Unstable api and/or shared memory support can be enabled by setting
 repectively `ZENOHC_BUILD_WITH_UNSTABLE_API` and
 `ZENOHC_BUILD_WITH_SHARED_MEMORY` Cmake flags to `true` during configuration
 step.
 .
    ```bash
    cmake -DZENOHC_BUILD_WITH_UNSTABLE_API=true
 -DZENOHC_BUILD_WITH_SHARED_MEMORY=true ../zenoh-c
    cmake --build . --config Release
    ```
 .
    [build-configurations]:
 https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations
    [Visual Studio generators]:
 https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#id14
    [Ninja Multi-Config]:
 https://cmake.org/cmake/help/latest/generator/Ninja%20Multi-Config.html
 .
 4. Install:
 .
    To install zenoh-c library into system just build target `install`. You need
 root privileges to do it, as the default install location is `/usr/local`.
 .
    ```bash
    cmake --build . --target install
    ```
 .
    If you want to install zenoh-c libraries locally, you can set the
 installation directory with `CMAKE_INSTALL_PREFIX`
 .
    ```bash
    cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local
    cmake --build . --target install
    ```
 .
    By default only dynamic library is built and installed. Set
 `BUILD_SHARED_LIBS` variable to false to build and install static library:
 .
    ```bash
    cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local -DBUILD_SHARED_LIBS=FALSE
    cmake --build . --target install
    ```
 .
    The result of installation is the header files in `include` directory, the
 library files in `lib` directory and cmake package configuration files for
 package `zenohc` in `lib/cmake` directory. The library later can be loaded with
 CMake command `find_package(zenohc)`.
    Add dependency in CMakeLists.txt on target
 .
    - `zenohc::shared` for linking dynamic library
    - `zenohc::static` for linking static library
    - `zenohc::lib` for linking static or dynamic library depending on boolean
 variable `BUILD_SHARED_LIBS`
 .
    For `Debug` configuration suffix `d` is added to names of library files
 (libzenohc**d**.so).
 .
 5. VScode
 .
    When zenoh-c project is opened in VSCode the build directory is set to
 `build` inside source tree (this is default behavior of Microsoft [CMake
 Tools]). The project build script detects this situation. In this case it
 places build files in `target` directory and `Cargo.toml` file (which is
 generated from `Cargo.toml.in`) into the root of source tree, as the rust
 developers used to and as the rust build tools expects by default. This
 behavior also can be explicitly enabled by setting
 `ZENOHC_BUILD_IN_SOURCE_TREE` variable to `TRUE`.
 .
    [CMake Tools]:
 https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools
 .
 ## Building the Examples
 .
 The examples can be built in two ways. One is to select `examples` as a build
 target of zenoh-c project (assuming here that the current directory is
 side-by-side with zenoh-c directory):
 .
 ```bash
 cmake ../zenoh-c
 cmake --build . --target examples
 ```
 .
 You may also use `--target <example_name>` if you wish to only build a specific
 example.
 .
 All build artifacts will be in the `target/release/examples` directory in this
 case.
 .
 The second way is to directly build `examples` as a root project:
 .
 ```bash
 cmake ../zenoh-c/examples
 cmake --build .
 ```
 .
 In this case, the examples executables will be built in the current directory.
 .
 As a root project the `examples` project links `zenoh-c` with CMake's
 [add_subdirectory] command by default. There are also other ways to link
 `zenoh-c` - with [find_package] or [FetchContent]:
 .
 [add_subdirectory]:
 https://cmake.org/cmake/help/latest/command/add_subdirectory.html
 [find_package]: https://cmake.org/cmake/help/latest/command/find_package.html
 [FetchContent]: https://cmake.org/cmake/help/latest/module/FetchContent.html
 .
 Link with `zenoh-c` installed into default location in the system (with
 [find_package]):
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE
 ```
 .
 Link with `zenoh-c` installed in `~/.local` directory:
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE
 -DCMAKE_INSTALL_PREFIX=~/.local
 ```
 .
 Download specific `zenoh-c` version from git with [FetchContent]:
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=GIT_URL -DZENOHC_GIT_TAG=0.11.0-rc
 ```
 .
 See also `configure_include_project` function in [helpers.cmake] for more
 information
 .
 [helpers.cmake]: cmake/helpers.cmake
 .
 ## Running the Examples
 .
 ### Basic Pub/Sub Example
 .
 ```bash
 ./target/release/examples/z_sub
 ```
 .
 ```bash
 ./target/release/examples/z_pub
 ```
 .
 ### Queryable and Query Example
 .
 ```bash
 ./target/release/examples/z_queryable
 ```
 .
 ```bash
 ./target/release/examples/z_get
 ```
 .
 ### Running the Throughput Examples
 .
 ```bash
 ./target/release/examples/z_sub_thr
 ```
 .
 ```bash
 ./target/release/examples/z_pub_thr
 ```
 .
 ## Documentation
 Zenoh-c API documentation is available on [Read the
 Docs](https://zenoh-c.readthedocs.io/en/latest/index.html).
 .
 It can be built manually by performing the following steps:
 .
 ```bash
 cd docs
 doxygen
 sphinx-build -b html . _build/html
 ```
 .
 ## Cross-Compilation
 .
 The following alternative options have been introduced to facilitate
 cross-compilation.
 > :warning: **WARNING** :warning: : Perhaps additional efforts are necessary,
 that will depend of your environment.
 .
 - `-DZENOHC_CARGO_CHANNEL="+nightly"|"+beta"|"+stable"`: refers to a specific
 rust toolchain release
 [[rust-channels](https://rust-lang.github.io/rustup/concepts/channels.html)]
 - `-DZENOHC_CARGO_FLAGS`: several optional flags can be used for compilation.
 [[cargo flags](https://doc.rust-lang.org/cargo/commands/cargo-build.html)]
 - `-DZENOHC_CUSTOM_TARGET`: specifies a crosscompilation target. Currently rust
 support several Tire-1, Tire-2 and Tire-3 targets
 [[targets](https://doc.rust-lang.org/nightly/rustc/platform-support.html)]. But
 keep in mind that zenoh-c only have support for following targets:
 `aarch64-unknown-linux-gnu`, `x86_64-unknown-linux-gnu`,
 `arm-unknown-linux-gnueabi`
 .
 Let's put all together in an example:
 Assuming you want to crosscompile for aarch64-unknown-linux-gnu.
 .
 1. Install required packages
    - `sudo apt install gcc-aarch64-linux-gnu`
 2. *(Only if you're using `nightly`)
    - `rustup component add rust-src --toolchain nightly`
 3. Compile Zenoh-C. Assume that it's in `zenoh-c` directory. Notice that build
 in this sample is performed outside of source directory
 .
    ```bash
    export RUSTFLAGS="-Clinker=aarch64-linux-gnu-gcc -Car=aarch64-linux-gnu-ar"
    mkdir -p build && cd build
    cmake ../zenoh-c  -DZENOHC_CARGO_CHANNEL="+nightly"
 -DZENOHC_CARGO_FLAGS="-Zbuild-std=std,panic_abort"
 -DZENOHC_CUSTOM_TARGET="aarch64-unknown-linux-gnu"
 -DCMAKE_INSTALL_PREFIX=../aarch64/stage
    cmake --build . --target install
    ```
 .
 Additionally you can use `RUSTFLAGS` environment variable for lead the
 compilation.
 .
 If all goes right the building files will be located at:
 `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release`
 and release files will be located at
 `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release`
 .
 ## Rust Version
 .
 The Rust version we use is defined in
 [rust-toolchain.toml](rust-toolchain.toml), which is `1.72.0`.
 There might be some memory mapping issue if you use the later version.
 .
 You can also specify the Rust version.
 .
 ```bash
 cmake ../zenoh-c -DZENOHC_CARGO_CHANNEL="+1.72.0"
 ```
 .
 ## Zenoh features support (enabling/disabling protocols, etc)
 .
 It's necessary sometimes to build zenoh-c library with set of features
 different from default. For example: enable TCP and UDP only. This can be done
 by changing `ZENOHC_CARGO_FLAGS` parameter for cmake (notice ";" instead of
 space due to cmake peculiarities)
 .
 Available features can be found in [Cargo.toml](./Cargo.toml)
 ```bash
 cmake ../zenoh-c
 -DZENOHC_CARGO_FLAGS="--no-default-features;--features=transport_tcp,transport_udp"
 ```
 .
 ## Versioning
 .
 Being a CMake project, zenoh-c is limited to the `MAJOR.MINOR.PATCH.TWEAK`
 version scheme [inherent
 to CMake](https://gitlab.kitware.com/cmake/cmake/-/issues/16716). However,
 zenoh-c also incorporates
 a Cargo package which cannot be versionned with the `MAJOR.MINOR.PATCH.TWEAK`
 version scheme (not
 SemVer compatible). Hence zenoh-c uses a one-to-one mapping between CMake
 versions and SemVer versions:
 .
 | CMake version           | SemVer equivalent | Meaning              |
 |-------------------------|-------------------|----------------------|
 | `1.2.3`                 | `1.2.3`           | Release version      |
 | `1.2.3.0`               | `1.2.3-dev`       | Developement version |
 | `1.2.3.x if x >= 1`     | `1.2.3-pre.x`     | Pre-release version  |
Vcs-Browser: https://github.com/eclipse-zenoh/zenoh-c
Vcs-Git: https://github.com/eclipse-zenoh/zenoh-c

Package: libzenohc-dev
Version: 1.0.0
Architecture: armel
Maintainer: zenoh-dev@eclipse.org
Installed-Size: 339
Depends: libzenohc (=1.0.0)
Filename: 1.0.0/libzenohc-dev_1.0.0_armel.deb
Size: 45496
MD5sum: 343d823560a73947e2ff9d1e2e6a6822
SHA1: bc23d8fdca17582a751247295539ee9f3121a1f8
SHA256: f5204f8ebe60c40c42161a07a0d0332b3d20f679fe5e9490d2a45336333622ca
Section: net
Priority: optional
Homepage: http://zenoh.io
Description: The Zenoh C API
 <img
 src="https://raw.githubusercontent.com/eclipse-zenoh/zenoh/main/zenoh-dragon.png"
 height="150">
 .
 [![CI](https://github.com/eclipse-zenoh/zenoh-c/workflows/CI/badge.svg)](https://github.com/eclipse-zenoh/zenoh-c/actions?query=workflow%3A%22CI%22)
 [![Documentation
 Status](https://readthedocs.org/projects/zenoh-c/badge/?version=latest)](https://zenoh-c.readthedocs.io/en/latest/?badge=latest)
 [![Discussion](https://img.shields.io/badge/discussion-on%20github-blue)](https://github.com/eclipse-zenoh/roadmap/discussions)
 [![Discord](https://img.shields.io/badge/chat-on%20discord-blue)](https://discord.gg/2GJ958VuHs)
 [![License](https://img.shields.io/badge/License-EPL%202.0-blue)](https://choosealicense.com/licenses/epl-2.0/)
 [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
 .
 # Eclipse Zenoh
 .
 The Eclipse Zenoh: Zero Overhead Pub/sub, Store/Query and Compute.
 .
 Zenoh (pronounce _/zeno/_) unifies data in motion, data at rest and
 computations. It carefully blends traditional pub/sub with geo-distributed
 storages, queries and computations, while retaining a level of time and space
 efficiency that is well beyond any of the mainstream stacks.
 .
 Check the website [zenoh.io](http://zenoh.io) and the
 [roadmap](https://github.com/eclipse-zenoh/roadmap) for more detailed
 information.
 .
 -------------------------------
 .
 # C API
 .
 This repository provides a C binding based on the main [Zenoh implementation
 written in Rust](https://github.com/eclipse-zenoh/zenoh).
 .
 -------------------------------
 .
 ## How to build it
 .
 > :warning: **WARNING** :warning: : Zenoh and its ecosystem are under active
 development. When you build from git, make sure you also build from git any
 other Zenoh repository you plan to use (e.g. binding, plugin, backend, etc.).
 It may happen that some changes in git are not compatible with the most recent
 packaged Zenoh release (e.g. deb, docker, pip). We put particular effort in
 maintaining compatibility between the various git repositories in the Zenoh
 project.
 .
 1. Make sure that [Rust](https://www.rust-lang.org) is available on your
 platform.
    Please check [here](https://www.rust-lang.org/tools/install) to learn how to
 install it.
    If you already have the Rust toolchain installed, make sure it is up-to-date
 with:
 .
    ```bash
    rustup update
    ```
 .
 2. Clone the [source] with `git`:
 .
    ```bash
    git clone https://github.com/eclipse-zenoh/zenoh-c.git
    ```
 .
    [source]: https://github.com/eclipse-zenoh/zenoh-c
 .
 3. Build:
 .
    Good CMake practice is to perform build outside of source directory, leaving
 source tree untouched. The examples below demonstrates this mode of building.
 On the other hand VScode by default creates build directory named 'build'
 inside source tree. In this case build script slightly changes its behavior.
 See more about it in section 'VScode'.
 .
    By default build configuration is set to `Release`, it's not necessary to
 add `-DCMAKE_BUILD_TYPE=Release` option on configuration step. But if your
 platform uses multi-config generator by default (this is the case on Windows),
 you may need to add option `--config Release` on build step. See more in CMake
 [build-configurations] documentation. Option`--config Release` is skipped in
 further examples for brewity. It's actually necessary for [Visual Studio
 generators] only. For [Ninja Multi-Config] the build script is able to select
 `Release` as the default configuration.
 .
    ```bash
    mkdir -p build && cd build
    cmake ../zenoh-c
    cmake --build . --config Release
    ```
 .
    The generator to use is selected with option `-G`. If Ninja is installed on
 your system, adding `-GNinja` to `cmake` command can greatly speed up the build
 time:
 .
    ```bash
    cmake ../zenoh-c -GNinja
    cmake --build .
    ```
 .
    Unstable api and/or shared memory support can be enabled by setting
 repectively `ZENOHC_BUILD_WITH_UNSTABLE_API` and
 `ZENOHC_BUILD_WITH_SHARED_MEMORY` Cmake flags to `true` during configuration
 step.
 .
    ```bash
    cmake -DZENOHC_BUILD_WITH_UNSTABLE_API=true
 -DZENOHC_BUILD_WITH_SHARED_MEMORY=true ../zenoh-c
    cmake --build . --config Release
    ```
 .
    [build-configurations]:
 https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations
    [Visual Studio generators]:
 https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#id14
    [Ninja Multi-Config]:
 https://cmake.org/cmake/help/latest/generator/Ninja%20Multi-Config.html
 .
 4. Install:
 .
    To install zenoh-c library into system just build target `install`. You need
 root privileges to do it, as the default install location is `/usr/local`.
 .
    ```bash
    cmake --build . --target install
    ```
 .
    If you want to install zenoh-c libraries locally, you can set the
 installation directory with `CMAKE_INSTALL_PREFIX`
 .
    ```bash
    cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local
    cmake --build . --target install
    ```
 .
    By default only dynamic library is built and installed. Set
 `BUILD_SHARED_LIBS` variable to false to build and install static library:
 .
    ```bash
    cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local -DBUILD_SHARED_LIBS=FALSE
    cmake --build . --target install
    ```
 .
    The result of installation is the header files in `include` directory, the
 library files in `lib` directory and cmake package configuration files for
 package `zenohc` in `lib/cmake` directory. The library later can be loaded with
 CMake command `find_package(zenohc)`.
    Add dependency in CMakeLists.txt on target
 .
    - `zenohc::shared` for linking dynamic library
    - `zenohc::static` for linking static library
    - `zenohc::lib` for linking static or dynamic library depending on boolean
 variable `BUILD_SHARED_LIBS`
 .
    For `Debug` configuration suffix `d` is added to names of library files
 (libzenohc**d**.so).
 .
 5. VScode
 .
    When zenoh-c project is opened in VSCode the build directory is set to
 `build` inside source tree (this is default behavior of Microsoft [CMake
 Tools]). The project build script detects this situation. In this case it
 places build files in `target` directory and `Cargo.toml` file (which is
 generated from `Cargo.toml.in`) into the root of source tree, as the rust
 developers used to and as the rust build tools expects by default. This
 behavior also can be explicitly enabled by setting
 `ZENOHC_BUILD_IN_SOURCE_TREE` variable to `TRUE`.
 .
    [CMake Tools]:
 https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools
 .
 ## Building the Examples
 .
 The examples can be built in two ways. One is to select `examples` as a build
 target of zenoh-c project (assuming here that the current directory is
 side-by-side with zenoh-c directory):
 .
 ```bash
 cmake ../zenoh-c
 cmake --build . --target examples
 ```
 .
 You may also use `--target <example_name>` if you wish to only build a specific
 example.
 .
 All build artifacts will be in the `target/release/examples` directory in this
 case.
 .
 The second way is to directly build `examples` as a root project:
 .
 ```bash
 cmake ../zenoh-c/examples
 cmake --build .
 ```
 .
 In this case, the examples executables will be built in the current directory.
 .
 As a root project the `examples` project links `zenoh-c` with CMake's
 [add_subdirectory] command by default. There are also other ways to link
 `zenoh-c` - with [find_package] or [FetchContent]:
 .
 [add_subdirectory]:
 https://cmake.org/cmake/help/latest/command/add_subdirectory.html
 [find_package]: https://cmake.org/cmake/help/latest/command/find_package.html
 [FetchContent]: https://cmake.org/cmake/help/latest/module/FetchContent.html
 .
 Link with `zenoh-c` installed into default location in the system (with
 [find_package]):
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE
 ```
 .
 Link with `zenoh-c` installed in `~/.local` directory:
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE
 -DCMAKE_INSTALL_PREFIX=~/.local
 ```
 .
 Download specific `zenoh-c` version from git with [FetchContent]:
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=GIT_URL -DZENOHC_GIT_TAG=0.11.0-rc
 ```
 .
 See also `configure_include_project` function in [helpers.cmake] for more
 information
 .
 [helpers.cmake]: cmake/helpers.cmake
 .
 ## Running the Examples
 .
 ### Basic Pub/Sub Example
 .
 ```bash
 ./target/release/examples/z_sub
 ```
 .
 ```bash
 ./target/release/examples/z_pub
 ```
 .
 ### Queryable and Query Example
 .
 ```bash
 ./target/release/examples/z_queryable
 ```
 .
 ```bash
 ./target/release/examples/z_get
 ```
 .
 ### Running the Throughput Examples
 .
 ```bash
 ./target/release/examples/z_sub_thr
 ```
 .
 ```bash
 ./target/release/examples/z_pub_thr
 ```
 .
 ## Documentation
 Zenoh-c API documentation is available on [Read the
 Docs](https://zenoh-c.readthedocs.io/en/latest/index.html).
 .
 It can be built manually by performing the following steps:
 .
 ```bash
 cd docs
 doxygen
 sphinx-build -b html . _build/html
 ```
 .
 ## Cross-Compilation
 .
 The following alternative options have been introduced to facilitate
 cross-compilation.
 > :warning: **WARNING** :warning: : Perhaps additional efforts are necessary,
 that will depend of your environment.
 .
 - `-DZENOHC_CARGO_CHANNEL="+nightly"|"+beta"|"+stable"`: refers to a specific
 rust toolchain release
 [[rust-channels](https://rust-lang.github.io/rustup/concepts/channels.html)]
 - `-DZENOHC_CARGO_FLAGS`: several optional flags can be used for compilation.
 [[cargo flags](https://doc.rust-lang.org/cargo/commands/cargo-build.html)]
 - `-DZENOHC_CUSTOM_TARGET`: specifies a crosscompilation target. Currently rust
 support several Tire-1, Tire-2 and Tire-3 targets
 [[targets](https://doc.rust-lang.org/nightly/rustc/platform-support.html)]. But
 keep in mind that zenoh-c only have support for following targets:
 `aarch64-unknown-linux-gnu`, `x86_64-unknown-linux-gnu`,
 `arm-unknown-linux-gnueabi`
 .
 Let's put all together in an example:
 Assuming you want to crosscompile for aarch64-unknown-linux-gnu.
 .
 1. Install required packages
    - `sudo apt install gcc-aarch64-linux-gnu`
 2. *(Only if you're using `nightly`)
    - `rustup component add rust-src --toolchain nightly`
 3. Compile Zenoh-C. Assume that it's in `zenoh-c` directory. Notice that build
 in this sample is performed outside of source directory
 .
    ```bash
    export RUSTFLAGS="-Clinker=aarch64-linux-gnu-gcc -Car=aarch64-linux-gnu-ar"
    mkdir -p build && cd build
    cmake ../zenoh-c  -DZENOHC_CARGO_CHANNEL="+nightly"
 -DZENOHC_CARGO_FLAGS="-Zbuild-std=std,panic_abort"
 -DZENOHC_CUSTOM_TARGET="aarch64-unknown-linux-gnu"
 -DCMAKE_INSTALL_PREFIX=../aarch64/stage
    cmake --build . --target install
    ```
 .
 Additionally you can use `RUSTFLAGS` environment variable for lead the
 compilation.
 .
 If all goes right the building files will be located at:
 `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release`
 and release files will be located at
 `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release`
 .
 ## Rust Version
 .
 The Rust version we use is defined in
 [rust-toolchain.toml](rust-toolchain.toml), which is `1.72.0`.
 There might be some memory mapping issue if you use the later version.
 .
 You can also specify the Rust version.
 .
 ```bash
 cmake ../zenoh-c -DZENOHC_CARGO_CHANNEL="+1.72.0"
 ```
 .
 ## Zenoh features support (enabling/disabling protocols, etc)
 .
 It's necessary sometimes to build zenoh-c library with set of features
 different from default. For example: enable TCP and UDP only. This can be done
 by changing `ZENOHC_CARGO_FLAGS` parameter for cmake (notice ";" instead of
 space due to cmake peculiarities)
 .
 Available features can be found in [Cargo.toml](./Cargo.toml)
 ```bash
 cmake ../zenoh-c
 -DZENOHC_CARGO_FLAGS="--no-default-features;--features=transport_tcp,transport_udp"
 ```
 .
 ## Versioning
 .
 Being a CMake project, zenoh-c is limited to the `MAJOR.MINOR.PATCH.TWEAK`
 version scheme [inherent
 to CMake](https://gitlab.kitware.com/cmake/cmake/-/issues/16716). However,
 zenoh-c also incorporates
 a Cargo package which cannot be versionned with the `MAJOR.MINOR.PATCH.TWEAK`
 version scheme (not
 SemVer compatible). Hence zenoh-c uses a one-to-one mapping between CMake
 versions and SemVer versions:
 .
 | CMake version           | SemVer equivalent | Meaning              |
 |-------------------------|-------------------|----------------------|
 | `1.2.3`                 | `1.2.3`           | Release version      |
 | `1.2.3.0`               | `1.2.3-dev`       | Developement version |
 | `1.2.3.x if x >= 1`     | `1.2.3-pre.x`     | Pre-release version  |
Vcs-Browser: https://github.com/eclipse-zenoh/zenoh-c
Vcs-Git: https://github.com/eclipse-zenoh/zenoh-c

Package: libzenohc-dev
Version: 1.0.0
Architecture: arm64
Maintainer: zenoh-dev@eclipse.org
Installed-Size: 339
Depends: libzenohc (=1.0.0)
Filename: 1.0.0/libzenohc-dev_1.0.0_arm64.deb
Size: 45504
MD5sum: e6821a0db5f7be983c93c523727d53ce
SHA1: 63fc549be5d88a0a5338e8e6b2ae12ef7e686612
SHA256: 11a4c054099e48e44d4372706fa96d69c830f729d19be3d76c320569410af0d4
Section: net
Priority: optional
Homepage: http://zenoh.io
Description: The Zenoh C API
 <img
 src="https://raw.githubusercontent.com/eclipse-zenoh/zenoh/main/zenoh-dragon.png"
 height="150">
 .
 [![CI](https://github.com/eclipse-zenoh/zenoh-c/workflows/CI/badge.svg)](https://github.com/eclipse-zenoh/zenoh-c/actions?query=workflow%3A%22CI%22)
 [![Documentation
 Status](https://readthedocs.org/projects/zenoh-c/badge/?version=latest)](https://zenoh-c.readthedocs.io/en/latest/?badge=latest)
 [![Discussion](https://img.shields.io/badge/discussion-on%20github-blue)](https://github.com/eclipse-zenoh/roadmap/discussions)
 [![Discord](https://img.shields.io/badge/chat-on%20discord-blue)](https://discord.gg/2GJ958VuHs)
 [![License](https://img.shields.io/badge/License-EPL%202.0-blue)](https://choosealicense.com/licenses/epl-2.0/)
 [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
 .
 # Eclipse Zenoh
 .
 The Eclipse Zenoh: Zero Overhead Pub/sub, Store/Query and Compute.
 .
 Zenoh (pronounce _/zeno/_) unifies data in motion, data at rest and
 computations. It carefully blends traditional pub/sub with geo-distributed
 storages, queries and computations, while retaining a level of time and space
 efficiency that is well beyond any of the mainstream stacks.
 .
 Check the website [zenoh.io](http://zenoh.io) and the
 [roadmap](https://github.com/eclipse-zenoh/roadmap) for more detailed
 information.
 .
 -------------------------------
 .
 # C API
 .
 This repository provides a C binding based on the main [Zenoh implementation
 written in Rust](https://github.com/eclipse-zenoh/zenoh).
 .
 -------------------------------
 .
 ## How to build it
 .
 > :warning: **WARNING** :warning: : Zenoh and its ecosystem are under active
 development. When you build from git, make sure you also build from git any
 other Zenoh repository you plan to use (e.g. binding, plugin, backend, etc.).
 It may happen that some changes in git are not compatible with the most recent
 packaged Zenoh release (e.g. deb, docker, pip). We put particular effort in
 maintaining compatibility between the various git repositories in the Zenoh
 project.
 .
 1. Make sure that [Rust](https://www.rust-lang.org) is available on your
 platform.
    Please check [here](https://www.rust-lang.org/tools/install) to learn how to
 install it.
    If you already have the Rust toolchain installed, make sure it is up-to-date
 with:
 .
    ```bash
    rustup update
    ```
 .
 2. Clone the [source] with `git`:
 .
    ```bash
    git clone https://github.com/eclipse-zenoh/zenoh-c.git
    ```
 .
    [source]: https://github.com/eclipse-zenoh/zenoh-c
 .
 3. Build:
 .
    Good CMake practice is to perform build outside of source directory, leaving
 source tree untouched. The examples below demonstrates this mode of building.
 On the other hand VScode by default creates build directory named 'build'
 inside source tree. In this case build script slightly changes its behavior.
 See more about it in section 'VScode'.
 .
    By default build configuration is set to `Release`, it's not necessary to
 add `-DCMAKE_BUILD_TYPE=Release` option on configuration step. But if your
 platform uses multi-config generator by default (this is the case on Windows),
 you may need to add option `--config Release` on build step. See more in CMake
 [build-configurations] documentation. Option`--config Release` is skipped in
 further examples for brewity. It's actually necessary for [Visual Studio
 generators] only. For [Ninja Multi-Config] the build script is able to select
 `Release` as the default configuration.
 .
    ```bash
    mkdir -p build && cd build
    cmake ../zenoh-c
    cmake --build . --config Release
    ```
 .
    The generator to use is selected with option `-G`. If Ninja is installed on
 your system, adding `-GNinja` to `cmake` command can greatly speed up the build
 time:
 .
    ```bash
    cmake ../zenoh-c -GNinja
    cmake --build .
    ```
 .
    Unstable api and/or shared memory support can be enabled by setting
 repectively `ZENOHC_BUILD_WITH_UNSTABLE_API` and
 `ZENOHC_BUILD_WITH_SHARED_MEMORY` Cmake flags to `true` during configuration
 step.
 .
    ```bash
    cmake -DZENOHC_BUILD_WITH_UNSTABLE_API=true
 -DZENOHC_BUILD_WITH_SHARED_MEMORY=true ../zenoh-c
    cmake --build . --config Release
    ```
 .
    [build-configurations]:
 https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations
    [Visual Studio generators]:
 https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#id14
    [Ninja Multi-Config]:
 https://cmake.org/cmake/help/latest/generator/Ninja%20Multi-Config.html
 .
 4. Install:
 .
    To install zenoh-c library into system just build target `install`. You need
 root privileges to do it, as the default install location is `/usr/local`.
 .
    ```bash
    cmake --build . --target install
    ```
 .
    If you want to install zenoh-c libraries locally, you can set the
 installation directory with `CMAKE_INSTALL_PREFIX`
 .
    ```bash
    cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local
    cmake --build . --target install
    ```
 .
    By default only dynamic library is built and installed. Set
 `BUILD_SHARED_LIBS` variable to false to build and install static library:
 .
    ```bash
    cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local -DBUILD_SHARED_LIBS=FALSE
    cmake --build . --target install
    ```
 .
    The result of installation is the header files in `include` directory, the
 library files in `lib` directory and cmake package configuration files for
 package `zenohc` in `lib/cmake` directory. The library later can be loaded with
 CMake command `find_package(zenohc)`.
    Add dependency in CMakeLists.txt on target
 .
    - `zenohc::shared` for linking dynamic library
    - `zenohc::static` for linking static library
    - `zenohc::lib` for linking static or dynamic library depending on boolean
 variable `BUILD_SHARED_LIBS`
 .
    For `Debug` configuration suffix `d` is added to names of library files
 (libzenohc**d**.so).
 .
 5. VScode
 .
    When zenoh-c project is opened in VSCode the build directory is set to
 `build` inside source tree (this is default behavior of Microsoft [CMake
 Tools]). The project build script detects this situation. In this case it
 places build files in `target` directory and `Cargo.toml` file (which is
 generated from `Cargo.toml.in`) into the root of source tree, as the rust
 developers used to and as the rust build tools expects by default. This
 behavior also can be explicitly enabled by setting
 `ZENOHC_BUILD_IN_SOURCE_TREE` variable to `TRUE`.
 .
    [CMake Tools]:
 https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools
 .
 ## Building the Examples
 .
 The examples can be built in two ways. One is to select `examples` as a build
 target of zenoh-c project (assuming here that the current directory is
 side-by-side with zenoh-c directory):
 .
 ```bash
 cmake ../zenoh-c
 cmake --build . --target examples
 ```
 .
 You may also use `--target <example_name>` if you wish to only build a specific
 example.
 .
 All build artifacts will be in the `target/release/examples` directory in this
 case.
 .
 The second way is to directly build `examples` as a root project:
 .
 ```bash
 cmake ../zenoh-c/examples
 cmake --build .
 ```
 .
 In this case, the examples executables will be built in the current directory.
 .
 As a root project the `examples` project links `zenoh-c` with CMake's
 [add_subdirectory] command by default. There are also other ways to link
 `zenoh-c` - with [find_package] or [FetchContent]:
 .
 [add_subdirectory]:
 https://cmake.org/cmake/help/latest/command/add_subdirectory.html
 [find_package]: https://cmake.org/cmake/help/latest/command/find_package.html
 [FetchContent]: https://cmake.org/cmake/help/latest/module/FetchContent.html
 .
 Link with `zenoh-c` installed into default location in the system (with
 [find_package]):
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE
 ```
 .
 Link with `zenoh-c` installed in `~/.local` directory:
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE
 -DCMAKE_INSTALL_PREFIX=~/.local
 ```
 .
 Download specific `zenoh-c` version from git with [FetchContent]:
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=GIT_URL -DZENOHC_GIT_TAG=0.11.0-rc
 ```
 .
 See also `configure_include_project` function in [helpers.cmake] for more
 information
 .
 [helpers.cmake]: cmake/helpers.cmake
 .
 ## Running the Examples
 .
 ### Basic Pub/Sub Example
 .
 ```bash
 ./target/release/examples/z_sub
 ```
 .
 ```bash
 ./target/release/examples/z_pub
 ```
 .
 ### Queryable and Query Example
 .
 ```bash
 ./target/release/examples/z_queryable
 ```
 .
 ```bash
 ./target/release/examples/z_get
 ```
 .
 ### Running the Throughput Examples
 .
 ```bash
 ./target/release/examples/z_sub_thr
 ```
 .
 ```bash
 ./target/release/examples/z_pub_thr
 ```
 .
 ## Documentation
 Zenoh-c API documentation is available on [Read the
 Docs](https://zenoh-c.readthedocs.io/en/latest/index.html).
 .
 It can be built manually by performing the following steps:
 .
 ```bash
 cd docs
 doxygen
 sphinx-build -b html . _build/html
 ```
 .
 ## Cross-Compilation
 .
 The following alternative options have been introduced to facilitate
 cross-compilation.
 > :warning: **WARNING** :warning: : Perhaps additional efforts are necessary,
 that will depend of your environment.
 .
 - `-DZENOHC_CARGO_CHANNEL="+nightly"|"+beta"|"+stable"`: refers to a specific
 rust toolchain release
 [[rust-channels](https://rust-lang.github.io/rustup/concepts/channels.html)]
 - `-DZENOHC_CARGO_FLAGS`: several optional flags can be used for compilation.
 [[cargo flags](https://doc.rust-lang.org/cargo/commands/cargo-build.html)]
 - `-DZENOHC_CUSTOM_TARGET`: specifies a crosscompilation target. Currently rust
 support several Tire-1, Tire-2 and Tire-3 targets
 [[targets](https://doc.rust-lang.org/nightly/rustc/platform-support.html)]. But
 keep in mind that zenoh-c only have support for following targets:
 `aarch64-unknown-linux-gnu`, `x86_64-unknown-linux-gnu`,
 `arm-unknown-linux-gnueabi`
 .
 Let's put all together in an example:
 Assuming you want to crosscompile for aarch64-unknown-linux-gnu.
 .
 1. Install required packages
    - `sudo apt install gcc-aarch64-linux-gnu`
 2. *(Only if you're using `nightly`)
    - `rustup component add rust-src --toolchain nightly`
 3. Compile Zenoh-C. Assume that it's in `zenoh-c` directory. Notice that build
 in this sample is performed outside of source directory
 .
    ```bash
    export RUSTFLAGS="-Clinker=aarch64-linux-gnu-gcc -Car=aarch64-linux-gnu-ar"
    mkdir -p build && cd build
    cmake ../zenoh-c  -DZENOHC_CARGO_CHANNEL="+nightly"
 -DZENOHC_CARGO_FLAGS="-Zbuild-std=std,panic_abort"
 -DZENOHC_CUSTOM_TARGET="aarch64-unknown-linux-gnu"
 -DCMAKE_INSTALL_PREFIX=../aarch64/stage
    cmake --build . --target install
    ```
 .
 Additionally you can use `RUSTFLAGS` environment variable for lead the
 compilation.
 .
 If all goes right the building files will be located at:
 `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release`
 and release files will be located at
 `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release`
 .
 ## Rust Version
 .
 The Rust version we use is defined in
 [rust-toolchain.toml](rust-toolchain.toml), which is `1.72.0`.
 There might be some memory mapping issue if you use the later version.
 .
 You can also specify the Rust version.
 .
 ```bash
 cmake ../zenoh-c -DZENOHC_CARGO_CHANNEL="+1.72.0"
 ```
 .
 ## Zenoh features support (enabling/disabling protocols, etc)
 .
 It's necessary sometimes to build zenoh-c library with set of features
 different from default. For example: enable TCP and UDP only. This can be done
 by changing `ZENOHC_CARGO_FLAGS` parameter for cmake (notice ";" instead of
 space due to cmake peculiarities)
 .
 Available features can be found in [Cargo.toml](./Cargo.toml)
 ```bash
 cmake ../zenoh-c
 -DZENOHC_CARGO_FLAGS="--no-default-features;--features=transport_tcp,transport_udp"
 ```
 .
 ## Versioning
 .
 Being a CMake project, zenoh-c is limited to the `MAJOR.MINOR.PATCH.TWEAK`
 version scheme [inherent
 to CMake](https://gitlab.kitware.com/cmake/cmake/-/issues/16716). However,
 zenoh-c also incorporates
 a Cargo package which cannot be versionned with the `MAJOR.MINOR.PATCH.TWEAK`
 version scheme (not
 SemVer compatible). Hence zenoh-c uses a one-to-one mapping between CMake
 versions and SemVer versions:
 .
 | CMake version           | SemVer equivalent | Meaning              |
 |-------------------------|-------------------|----------------------|
 | `1.2.3`                 | `1.2.3`           | Release version      |
 | `1.2.3.0`               | `1.2.3-dev`       | Developement version |
 | `1.2.3.x if x >= 1`     | `1.2.3-pre.x`     | Pre-release version  |
Vcs-Browser: https://github.com/eclipse-zenoh/zenoh-c
Vcs-Git: https://github.com/eclipse-zenoh/zenoh-c

Package: libzenohc-dev
Version: 1.0.0
Architecture: armhf
Maintainer: zenoh-dev@eclipse.org
Installed-Size: 339
Depends: libzenohc (=1.0.0)
Filename: 1.0.0/libzenohc-dev_1.0.0_armhf.deb
Size: 45496
MD5sum: deef5dfe89364931a961250b378fc8a9
SHA1: 977391d6bd4675abec65b3ada200511fdd2be724
SHA256: 83b68a7b27c049eee8efdf42818c51c0420df9246d330d1ce07327ee22098645
Section: net
Priority: optional
Homepage: http://zenoh.io
Description: The Zenoh C API
 <img
 src="https://raw.githubusercontent.com/eclipse-zenoh/zenoh/main/zenoh-dragon.png"
 height="150">
 .
 [![CI](https://github.com/eclipse-zenoh/zenoh-c/workflows/CI/badge.svg)](https://github.com/eclipse-zenoh/zenoh-c/actions?query=workflow%3A%22CI%22)
 [![Documentation
 Status](https://readthedocs.org/projects/zenoh-c/badge/?version=latest)](https://zenoh-c.readthedocs.io/en/latest/?badge=latest)
 [![Discussion](https://img.shields.io/badge/discussion-on%20github-blue)](https://github.com/eclipse-zenoh/roadmap/discussions)
 [![Discord](https://img.shields.io/badge/chat-on%20discord-blue)](https://discord.gg/2GJ958VuHs)
 [![License](https://img.shields.io/badge/License-EPL%202.0-blue)](https://choosealicense.com/licenses/epl-2.0/)
 [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
 .
 # Eclipse Zenoh
 .
 The Eclipse Zenoh: Zero Overhead Pub/sub, Store/Query and Compute.
 .
 Zenoh (pronounce _/zeno/_) unifies data in motion, data at rest and
 computations. It carefully blends traditional pub/sub with geo-distributed
 storages, queries and computations, while retaining a level of time and space
 efficiency that is well beyond any of the mainstream stacks.
 .
 Check the website [zenoh.io](http://zenoh.io) and the
 [roadmap](https://github.com/eclipse-zenoh/roadmap) for more detailed
 information.
 .
 -------------------------------
 .
 # C API
 .
 This repository provides a C binding based on the main [Zenoh implementation
 written in Rust](https://github.com/eclipse-zenoh/zenoh).
 .
 -------------------------------
 .
 ## How to build it
 .
 > :warning: **WARNING** :warning: : Zenoh and its ecosystem are under active
 development. When you build from git, make sure you also build from git any
 other Zenoh repository you plan to use (e.g. binding, plugin, backend, etc.).
 It may happen that some changes in git are not compatible with the most recent
 packaged Zenoh release (e.g. deb, docker, pip). We put particular effort in
 maintaining compatibility between the various git repositories in the Zenoh
 project.
 .
 1. Make sure that [Rust](https://www.rust-lang.org) is available on your
 platform.
    Please check [here](https://www.rust-lang.org/tools/install) to learn how to
 install it.
    If you already have the Rust toolchain installed, make sure it is up-to-date
 with:
 .
    ```bash
    rustup update
    ```
 .
 2. Clone the [source] with `git`:
 .
    ```bash
    git clone https://github.com/eclipse-zenoh/zenoh-c.git
    ```
 .
    [source]: https://github.com/eclipse-zenoh/zenoh-c
 .
 3. Build:
 .
    Good CMake practice is to perform build outside of source directory, leaving
 source tree untouched. The examples below demonstrates this mode of building.
 On the other hand VScode by default creates build directory named 'build'
 inside source tree. In this case build script slightly changes its behavior.
 See more about it in section 'VScode'.
 .
    By default build configuration is set to `Release`, it's not necessary to
 add `-DCMAKE_BUILD_TYPE=Release` option on configuration step. But if your
 platform uses multi-config generator by default (this is the case on Windows),
 you may need to add option `--config Release` on build step. See more in CMake
 [build-configurations] documentation. Option`--config Release` is skipped in
 further examples for brewity. It's actually necessary for [Visual Studio
 generators] only. For [Ninja Multi-Config] the build script is able to select
 `Release` as the default configuration.
 .
    ```bash
    mkdir -p build && cd build
    cmake ../zenoh-c
    cmake --build . --config Release
    ```
 .
    The generator to use is selected with option `-G`. If Ninja is installed on
 your system, adding `-GNinja` to `cmake` command can greatly speed up the build
 time:
 .
    ```bash
    cmake ../zenoh-c -GNinja
    cmake --build .
    ```
 .
    Unstable api and/or shared memory support can be enabled by setting
 repectively `ZENOHC_BUILD_WITH_UNSTABLE_API` and
 `ZENOHC_BUILD_WITH_SHARED_MEMORY` Cmake flags to `true` during configuration
 step.
 .
    ```bash
    cmake -DZENOHC_BUILD_WITH_UNSTABLE_API=true
 -DZENOHC_BUILD_WITH_SHARED_MEMORY=true ../zenoh-c
    cmake --build . --config Release
    ```
 .
    [build-configurations]:
 https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations
    [Visual Studio generators]:
 https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#id14
    [Ninja Multi-Config]:
 https://cmake.org/cmake/help/latest/generator/Ninja%20Multi-Config.html
 .
 4. Install:
 .
    To install zenoh-c library into system just build target `install`. You need
 root privileges to do it, as the default install location is `/usr/local`.
 .
    ```bash
    cmake --build . --target install
    ```
 .
    If you want to install zenoh-c libraries locally, you can set the
 installation directory with `CMAKE_INSTALL_PREFIX`
 .
    ```bash
    cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local
    cmake --build . --target install
    ```
 .
    By default only dynamic library is built and installed. Set
 `BUILD_SHARED_LIBS` variable to false to build and install static library:
 .
    ```bash
    cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local -DBUILD_SHARED_LIBS=FALSE
    cmake --build . --target install
    ```
 .
    The result of installation is the header files in `include` directory, the
 library files in `lib` directory and cmake package configuration files for
 package `zenohc` in `lib/cmake` directory. The library later can be loaded with
 CMake command `find_package(zenohc)`.
    Add dependency in CMakeLists.txt on target
 .
    - `zenohc::shared` for linking dynamic library
    - `zenohc::static` for linking static library
    - `zenohc::lib` for linking static or dynamic library depending on boolean
 variable `BUILD_SHARED_LIBS`
 .
    For `Debug` configuration suffix `d` is added to names of library files
 (libzenohc**d**.so).
 .
 5. VScode
 .
    When zenoh-c project is opened in VSCode the build directory is set to
 `build` inside source tree (this is default behavior of Microsoft [CMake
 Tools]). The project build script detects this situation. In this case it
 places build files in `target` directory and `Cargo.toml` file (which is
 generated from `Cargo.toml.in`) into the root of source tree, as the rust
 developers used to and as the rust build tools expects by default. This
 behavior also can be explicitly enabled by setting
 `ZENOHC_BUILD_IN_SOURCE_TREE` variable to `TRUE`.
 .
    [CMake Tools]:
 https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools
 .
 ## Building the Examples
 .
 The examples can be built in two ways. One is to select `examples` as a build
 target of zenoh-c project (assuming here that the current directory is
 side-by-side with zenoh-c directory):
 .
 ```bash
 cmake ../zenoh-c
 cmake --build . --target examples
 ```
 .
 You may also use `--target <example_name>` if you wish to only build a specific
 example.
 .
 All build artifacts will be in the `target/release/examples` directory in this
 case.
 .
 The second way is to directly build `examples` as a root project:
 .
 ```bash
 cmake ../zenoh-c/examples
 cmake --build .
 ```
 .
 In this case, the examples executables will be built in the current directory.
 .
 As a root project the `examples` project links `zenoh-c` with CMake's
 [add_subdirectory] command by default. There are also other ways to link
 `zenoh-c` - with [find_package] or [FetchContent]:
 .
 [add_subdirectory]:
 https://cmake.org/cmake/help/latest/command/add_subdirectory.html
 [find_package]: https://cmake.org/cmake/help/latest/command/find_package.html
 [FetchContent]: https://cmake.org/cmake/help/latest/module/FetchContent.html
 .
 Link with `zenoh-c` installed into default location in the system (with
 [find_package]):
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE
 ```
 .
 Link with `zenoh-c` installed in `~/.local` directory:
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE
 -DCMAKE_INSTALL_PREFIX=~/.local
 ```
 .
 Download specific `zenoh-c` version from git with [FetchContent]:
 .
 ```bash
 cmake ../zenoh-c/examples -DZENOHC_SOURCE=GIT_URL -DZENOHC_GIT_TAG=0.11.0-rc
 ```
 .
 See also `configure_include_project` function in [helpers.cmake] for more
 information
 .
 [helpers.cmake]: cmake/helpers.cmake
 .
 ## Running the Examples
 .
 ### Basic Pub/Sub Example
 .
 ```bash
 ./target/release/examples/z_sub
 ```
 .
 ```bash
 ./target/release/examples/z_pub
 ```
 .
 ### Queryable and Query Example
 .
 ```bash
 ./target/release/examples/z_queryable
 ```
 .
 ```bash
 ./target/release/examples/z_get
 ```
 .
 ### Running the Throughput Examples
 .
 ```bash
 ./target/release/examples/z_sub_thr
 ```
 .
 ```bash
 ./target/release/examples/z_pub_thr
 ```
 .
 ## Documentation
 Zenoh-c API documentation is available on [Read the
 Docs](https://zenoh-c.readthedocs.io/en/latest/index.html).
 .
 It can be built manually by performing the following steps:
 .
 ```bash
 cd docs
 doxygen
 sphinx-build -b html . _build/html
 ```
 .
 ## Cross-Compilation
 .
 The following alternative options have been introduced to facilitate
 cross-compilation.
 > :warning: **WARNING** :warning: : Perhaps additional efforts are necessary,
 that will depend of your environment.
 .
 - `-DZENOHC_CARGO_CHANNEL="+nightly"|"+beta"|"+stable"`: refers to a specific
 rust toolchain release
 [[rust-channels](https://rust-lang.github.io/rustup/concepts/channels.html)]
 - `-DZENOHC_CARGO_FLAGS`: several optional flags can be used for compilation.
 [[cargo flags](https://doc.rust-lang.org/cargo/commands/cargo-build.html)]
 - `-DZENOHC_CUSTOM_TARGET`: specifies a crosscompilation target. Currently rust
 support several Tire-1, Tire-2 and Tire-3 targets
 [[targets](https://doc.rust-lang.org/nightly/rustc/platform-support.html)]. But
 keep in mind that zenoh-c only have support for following targets:
 `aarch64-unknown-linux-gnu`, `x86_64-unknown-linux-gnu`,
 `arm-unknown-linux-gnueabi`
 .
 Let's put all together in an example:
 Assuming you want to crosscompile for aarch64-unknown-linux-gnu.
 .
 1. Install required packages
    - `sudo apt install gcc-aarch64-linux-gnu`
 2. *(Only if you're using `nightly`)
    - `rustup component add rust-src --toolchain nightly`
 3. Compile Zenoh-C. Assume that it's in `zenoh-c` directory. Notice that build
 in this sample is performed outside of source directory
 .
    ```bash
    export RUSTFLAGS="-Clinker=aarch64-linux-gnu-gcc -Car=aarch64-linux-gnu-ar"
    mkdir -p build && cd build
    cmake ../zenoh-c  -DZENOHC_CARGO_CHANNEL="+nightly"
 -DZENOHC_CARGO_FLAGS="-Zbuild-std=std,panic_abort"
 -DZENOHC_CUSTOM_TARGET="aarch64-unknown-linux-gnu"
 -DCMAKE_INSTALL_PREFIX=../aarch64/stage
    cmake --build . --target install
    ```
 .
 Additionally you can use `RUSTFLAGS` environment variable for lead the
 compilation.
 .
 If all goes right the building files will be located at:
 `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release`
 and release files will be located at
 `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release`
 .
 ## Rust Version
 .
 The Rust version we use is defined in
 [rust-toolchain.toml](rust-toolchain.toml), which is `1.72.0`.
 There might be some memory mapping issue if you use the later version.
 .
 You can also specify the Rust version.
 .
 ```bash
 cmake ../zenoh-c -DZENOHC_CARGO_CHANNEL="+1.72.0"
 ```
 .
 ## Zenoh features support (enabling/disabling protocols, etc)
 .
 It's necessary sometimes to build zenoh-c library with set of features
 different from default. For example: enable TCP and UDP only. This can be done
 by changing `ZENOHC_CARGO_FLAGS` parameter for cmake (notice ";" instead of
 space due to cmake peculiarities)
 .
 Available features can be found in [Cargo.toml](./Cargo.toml)
 ```bash
 cmake ../zenoh-c
 -DZENOHC_CARGO_FLAGS="--no-default-features;--features=transport_tcp,transport_udp"
 ```
 .
 ## Versioning
 .
 Being a CMake project, zenoh-c is limited to the `MAJOR.MINOR.PATCH.TWEAK`
 version scheme [inherent
 to CMake](https://gitlab.kitware.com/cmake/cmake/-/issues/16716). However,
 zenoh-c also incorporates
 a Cargo package which cannot be versionned with the `MAJOR.MINOR.PATCH.TWEAK`
 version scheme (not
 SemVer compatible). Hence zenoh-c uses a one-to-one mapping between CMake
 versions and SemVer versions:
 .
 | CMake version           | SemVer equivalent | Meaning              |
 |-------------------------|-------------------|----------------------|
 | `1.2.3`                 | `1.2.3`           | Release version      |
 | `1.2.3.0`               | `1.2.3-dev`       | Developement version |
 | `1.2.3.x if x >= 1`     | `1.2.3-pre.x`     | Pre-release version  |
Vcs-Browser: https://github.com/eclipse-zenoh/zenoh-c
Vcs-Git: https://github.com/eclipse-zenoh/zenoh-c

