Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy z_config_peer/z_config_client methods #641

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ if(UNIX OR MSVC)
add_executable(z_bytes_test ${PROJECT_SOURCE_DIR}/tests/z_bytes_test.c)
add_executable(z_api_bytes_test ${PROJECT_SOURCE_DIR}/tests/z_api_bytes_test.c)
add_executable(z_api_encoding_test ${PROJECT_SOURCE_DIR}/tests/z_api_encoding_test.c)
add_executable(z_api_config_test ${PROJECT_SOURCE_DIR}/tests/z_api_config_test.c)
add_executable(z_refcount_test ${PROJECT_SOURCE_DIR}/tests/z_refcount_test.c)

target_link_libraries(z_data_struct_test ${Libname})
Expand All @@ -433,7 +432,6 @@ if(UNIX OR MSVC)
target_link_libraries(z_bytes_test ${Libname})
target_link_libraries(z_api_bytes_test ${Libname})
target_link_libraries(z_api_encoding_test ${Libname})
target_link_libraries(z_api_config_test ${Libname})
target_link_libraries(z_refcount_test ${Libname})

configure_file(${PROJECT_SOURCE_DIR}/tests/modularity.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/modularity.py COPYONLY)
Expand All @@ -456,7 +454,6 @@ if(UNIX OR MSVC)
add_test(z_bytes_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/z_bytes_test)
add_test(z_api_bytes_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/z_api_bytes_test)
add_test(z_api_encoding_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/z_api_encoding_test)
add_test(z_api_config_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/z_api_config_test)
add_test(z_refcount_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/z_refcount_test)
endif()

Expand Down
2 changes: 0 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,6 @@ Primitives
.. autocfunction:: primitives.h::z_keyexpr_join
.. autocfunction:: primitives.h::z_config_new
.. autocfunction:: primitives.h::z_config_default
.. autocfunction:: primitives.h::z_config_client
.. autocfunction:: primitives.h::z_config_peer
.. autocfunction:: primitives.h::zp_config_get
.. autocfunction:: primitives.h::zp_config_insert
.. autocfunction:: primitives.h::z_encoding_from_str
Expand Down
23 changes: 0 additions & 23 deletions include/zenoh-pico/api/primitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,29 +309,6 @@ int8_t z_config_default(z_owned_config_t *config);
*/
void z_config_clone(z_owned_config_t *config, const z_loaned_config_t *src);

/**
* Builds a new, zenoh-allocated, client configuration.
*
* Parameters:
* config: Pointer to uninitialized :c:type:`z_owned_config_t`.
* locator: Zenoh router locator string, if null multicast scouting will be performed.
*
* Return:
* `0`` in case of success, or a ``negative value`` otherwise.
*/
int8_t z_config_client(z_owned_config_t *config, const char *locator);
/**
* Builds a new, zenoh-allocated, peer configuration.
*
* Parameters:
* config: Pointer to uninitialized :c:type:`z_owned_config_t`.
* locator: Multicast address for peer-to-peer communication.
*
* Return:
* `0`` in case of success, or a ``negative value`` otherwise.
*/
int8_t z_config_peer(z_owned_config_t *config, const char *locator);

/**
* Gets the property with the given integer key from the configuration.
*
Expand Down
16 changes: 0 additions & 16 deletions src/api/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,22 +190,6 @@ int8_t z_config_default(z_owned_config_t *config) { return _z_config_default(&co

void z_config_clone(z_owned_config_t *config, const z_loaned_config_t *src) { config->_val = _z_config_clone(src); }

int8_t z_config_client(z_owned_config_t *config, const char *locator) {
return _z_config_client(&config->_val, locator);
}

int8_t z_config_peer(z_owned_config_t *config, const char *locator) {
if (locator == NULL) {
return _Z_ERR_INVALID;
}
_Z_RETURN_IF_ERR(z_config_default(config));
_Z_CLEAN_RETURN_IF_ERR(zp_config_insert(&config->_val, Z_CONFIG_MODE_KEY, Z_CONFIG_MODE_PEER),
z_config_drop(z_config_move(config)));
_Z_CLEAN_RETURN_IF_ERR(zp_config_insert(&config->_val, Z_CONFIG_CONNECT_KEY, locator),
z_config_drop(z_config_move(config)));
return _Z_RES_OK;
}

const char *zp_config_get(const z_loaned_config_t *config, uint8_t key) { return _z_config_get(config, key); }

int8_t zp_config_insert(z_loaned_config_t *config, uint8_t key, const char *value) {
Expand Down
49 changes: 0 additions & 49 deletions tests/z_api_config_test.c

This file was deleted.

Loading