From a143a99fd86c234d0b778de9c28b420ce45982d7 Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Mon, 15 Jul 2024 16:48:25 +0200 Subject: [PATCH] add default enum constants --- CMakeLists.txt | 1 + include/zenoh.h | 1 + include/zenoh_constants.h | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 include/zenoh_constants.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d37aac6e..bdf872595 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,6 +119,7 @@ function(configure_cargo_toml cargo_toml_dir CARGO_PROJECT_VERSION CARGO_LIB_NAM file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/include/zenoh.h ${CMAKE_CURRENT_SOURCE_DIR}/include/zenoh_memory.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/zenoh_constants.h DESTINATION ${cargo_toml_dir}/include/) endif() configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Cargo.toml.in" "${cargo_toml_dir}/Cargo.toml" @ONLY) diff --git a/include/zenoh.h b/include/zenoh.h index 5a7845b57..9e4fb5ac2 100644 --- a/include/zenoh.h +++ b/include/zenoh.h @@ -33,6 +33,7 @@ extern "C" { #include "zenoh_concrete.h" #include "zenoh_opaque.h" #include "zenoh_commons.h" +#include "zenoh_constants.h" // clang-format on #ifdef __cplusplus diff --git a/include/zenoh_constants.h b/include/zenoh_constants.h new file mode 100644 index 000000000..aa108be81 --- /dev/null +++ b/include/zenoh_constants.h @@ -0,0 +1,20 @@ +// +// Copyright (c) 2022 ZettaScale Technology +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 +// which is available at https://www.apache.org/licenses/LICENSE-2.0. +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// +// Contributors: +// ZettaScale Zenoh Team, +#pragma once + +#define Z_CONGESTION_CONTROL_DEFAULT Z_CONGESTION_CONTROL_BLOCK +#define Z_CONSOLIDATION_MODE_DEFAULT Z_CONSOLIDATION_MODE_AUTO +#define Z_PRIORITY_DEFAULT Z_PRIORITY_DATA +#define Z_QUERY_TARGET_DEFAULT Z_QUERY_TARGET_BEST_MATCHING +#define Z_RELIABILITY_DEFAULT Z_RELIABILITY_RELIABLE +#define Z_SAMPLE_KIND_DEFAULT Z_SAMPLE_KIND_PUT