This is an automated email from the ASF dual-hosted git repository. pnoltes pushed a commit to branch feature/export_headers in repository https://gitbox.apache.org/repos/asf/celix.git
commit c3bcde55fe9499b7ea053c275a36cf29500ae2f3 Author: Pepijn Noltes <[email protected]> AuthorDate: Fri Apr 14 19:28:22 2023 +0200 Add symbols export configuration for celix_utils --- libs/utils/CMakeLists.txt | 31 +++++-- libs/utils/include/celix_array_list.h | 44 ++++++++- libs/utils/include_deprecated/array_list.h | 52 +++++------ libs/utils/include_deprecated/filter.h | 14 +-- libs/utils/include_deprecated/hash_map.h | 100 ++++++++++----------- libs/utils/include_deprecated/ip_utils.h | 12 +-- libs/utils/include_deprecated/linked_list.h | 48 +++++----- .../include_deprecated/linked_list_iterator.h | 24 ++--- libs/utils/include_deprecated/properties.h | 24 ++--- libs/utils/include_deprecated/utils.h | 18 ++-- libs/utils/include_deprecated/version.h | 28 +++--- libs/utils/include_deprecated/version_range.h | 23 ++--- libs/utils/src/array_list_private.h | 3 +- libs/utils/src/hash_map.c | 2 +- libs/utils/src/hash_map_private.h | 15 ++-- libs/utils/src/linked_list.c | 2 +- 16 files changed, 251 insertions(+), 189 deletions(-) diff --git a/libs/utils/CMakeLists.txt b/libs/utils/CMakeLists.txt index e5040bca..d1381656 100644 --- a/libs/utils/CMakeLists.txt +++ b/libs/utils/CMakeLists.txt @@ -45,7 +45,7 @@ add_library(utils_obj OBJECT src/celix_file_utils.c src/celix_convert_utils.c ${MEMSTREAM_SOURCES} - ) +) target_link_libraries(utils_obj PRIVATE libzip::libzip) if (NOT OPEN_MEMSTREAM_EXISTS) target_compile_definitions(utils_obj PUBLIC -DCELIX_UTILS_NO_MEMSTREAM_AVAILABLE) @@ -70,19 +70,36 @@ ELSEIF(ANDROID) target_link_libraries(utils_obj PRIVATE m) ENDIF() +include(GenerateExportHeader) +generate_export_header(utils_obj + BASE_NAME "CELIX_UTILS" + EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/gen_include/celix_utils_export.h") +target_include_directories(utils_obj PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/gen_include>) + add_library(utils SHARED) target_link_libraries(utils PUBLIC utils_obj) -set_target_properties(utils PROPERTIES OUTPUT_NAME "celix_utils") -set_target_properties(utils PROPERTIES "SOVERSION" 2) + +set_target_properties(utils + PROPERTIES + CXX_VISIBILITY_PRESET hidden + C_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN true + SOVERSION ${CELIX_MAJOR} + OUTPUT_NAME "celix_utils" +) # By omitting OBJECTS DESTINATION, object files will NOT be installed. install(TARGETS utils utils_obj EXPORT celix LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix) -install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix COMPONENT framework - PATTERN memstream* EXCLUDE) + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix_utils) +install(DIRECTORY include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix_utils + COMPONENT framework PATTERN memstream* EXCLUDE) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gen_include/celix_utils_export.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix_utils + COMPONENT framework) if (CELIX_INSTALL_DEPRECATED_API) - install(DIRECTORY include_deprecated/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix COMPONENT framework) + install(DIRECTORY include_deprecated/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/celix_utils COMPONENT framework) endif () #Alias setup to match external usage diff --git a/libs/utils/include/celix_array_list.h b/libs/utils/include/celix_array_list.h index 77e174ec..b0a37cbe 100644 --- a/libs/utils/include/celix_array_list.h +++ b/libs/utils/include/celix_array_list.h @@ -17,11 +17,11 @@ * under the License. */ -#include "celix_errno.h" -#include "stdbool.h" - #include <stdbool.h> +#include "celix_errno.h" +#include "celix_utils_export.h" + #ifndef CELIX_ARRAY_LIST_H_ #define CELIX_ARRAY_LIST_H_ @@ -117,6 +117,7 @@ typedef struct celix_array_list_create_options { /** * @brief Creates a new empty array list. */ +CELIX_UTILS_EXPORT celix_array_list_t* celix_arrayList_create(); /** @@ -124,12 +125,14 @@ celix_array_list_t* celix_arrayList_create(); * are equal. * @deprecated This functions is deprecated, use celix_arrayList_createWithOptions instead. */ +CELIX_UTILS_EXPORT celix_array_list_t* celix_arrayList_createWithEquals(celix_arrayList_equals_fp equals); /** * @brief Creates a new empty array listusing using the provided array list create options. * @param opts The create options, only used during the creation of the array list. */ +CELIX_UTILS_EXPORT celix_array_list_t* celix_arrayList_createWithOptions(const celix_array_list_create_options_t* opts); /** @@ -137,11 +140,13 @@ celix_array_list_t* celix_arrayList_createWithOptions(const celix_array_list_cre * * @note If a (simple) removed callback is configured, the callback will be called for every array list entry. */ +CELIX_UTILS_EXPORT void celix_arrayList_destroy(celix_array_list_t *list); /** * @brief Returns the size of the array list. */ +CELIX_UTILS_EXPORT int celix_arrayList_size(const celix_array_list_t *list); /** @@ -151,6 +156,7 @@ int celix_arrayList_size(const celix_array_list_t *list); * @param index The entry index to return. * @return Returns the pointer value for the index. Returns NULL if index is out of bound. */ +CELIX_UTILS_EXPORT void* celix_arrayList_get(const celix_array_list_t *list, int index); /** @@ -160,6 +166,7 @@ void* celix_arrayList_get(const celix_array_list_t *list, int index); * @param index The entry index to return. * @return Returns the int value for the index. Returns 0 if index is out of bound. */ +CELIX_UTILS_EXPORT int celix_arrayList_getInt(const celix_array_list_t *list, int index); /** @@ -169,6 +176,7 @@ int celix_arrayList_getInt(const celix_array_list_t *list, int index); * @param index The entry index to return. * @return Returns the long value for the index. Returns 0 if index is out of bound. */ +CELIX_UTILS_EXPORT long int celix_arrayList_getLong(const celix_array_list_t *list, int index); /** @@ -178,6 +186,7 @@ long int celix_arrayList_getLong(const celix_array_list_t *list, int index); * @param index The entry index to return. * @return Returns the unsigned int value for the index. Returns 0 if index is out of bound. */ +CELIX_UTILS_EXPORT unsigned int celix_arrayList_getUInt(const celix_array_list_t *list, int index); /** @@ -187,6 +196,7 @@ unsigned int celix_arrayList_getUInt(const celix_array_list_t *list, int index); * @param index The entry index to return. * @return Returns the unsigned long value for the index. Returns 0 if index is out of bound. */ +CELIX_UTILS_EXPORT unsigned long int celix_arrayList_getULong(const celix_array_list_t *list, int index); /** @@ -196,6 +206,7 @@ unsigned long int celix_arrayList_getULong(const celix_array_list_t *list, int i * @param index The entry index to return. * @return Returns the float value for the index. Returns 0 if index is out of bound. */ +CELIX_UTILS_EXPORT float celix_arrayList_getFloat(const celix_array_list_t *list, int index); /** @@ -205,6 +216,7 @@ float celix_arrayList_getFloat(const celix_array_list_t *list, int index); * @param index The entry index to return. * @return Returns the double value for the index. Returns 0 if index is out of bound. */ +CELIX_UTILS_EXPORT double celix_arrayList_getDouble(const celix_array_list_t *list, int index); /** @@ -214,6 +226,7 @@ double celix_arrayList_getDouble(const celix_array_list_t *list, int index); * @param index The entry index to return. * @return Returns the bool value for the index. Returns false if index is out of bound. */ +CELIX_UTILS_EXPORT bool celix_arrayList_getBool(const celix_array_list_t *list, int index); /** @@ -223,6 +236,7 @@ bool celix_arrayList_getBool(const celix_array_list_t *list, int index); * @param index The entry index to return. * @return Returns the size_t value for the index. Returns 0 if index is out of bound. */ +CELIX_UTILS_EXPORT size_t celix_arrayList_getSize(const celix_array_list_t *list, int index); /** @@ -231,6 +245,7 @@ size_t celix_arrayList_getSize(const celix_array_list_t *list, int index); * @param map The array list. * @param value The pointer value to add to the array list. */ +CELIX_UTILS_EXPORT void celix_arrayList_add(celix_array_list_t *list, void* value); /** @@ -239,6 +254,7 @@ void celix_arrayList_add(celix_array_list_t *list, void* value); * @param map The array list. * @param value The int value to add to the array list. */ +CELIX_UTILS_EXPORT void celix_arrayList_addInt(celix_array_list_t *list, int value); /** @@ -247,6 +263,7 @@ void celix_arrayList_addInt(celix_array_list_t *list, int value); * @param map The array list. * @param value The long value to add to the array list. */ +CELIX_UTILS_EXPORT void celix_arrayList_addLong(celix_array_list_t *list, long value); /** @@ -255,6 +272,7 @@ void celix_arrayList_addLong(celix_array_list_t *list, long value); * @param map The array list. * @param value The unsigned int value to add to the array list. */ +CELIX_UTILS_EXPORT void celix_arrayList_addUInt(celix_array_list_t *list, unsigned int value); /** @@ -263,6 +281,7 @@ void celix_arrayList_addUInt(celix_array_list_t *list, unsigned int value); * @param map The array list. * @param value The unsigned long value to add to the array list. */ +CELIX_UTILS_EXPORT void celix_arrayList_addULong(celix_array_list_t *list, unsigned long value); /** @@ -271,6 +290,7 @@ void celix_arrayList_addULong(celix_array_list_t *list, unsigned long value); * @param map The array list. * @param value The float value to add to the array list. */ +CELIX_UTILS_EXPORT void celix_arrayList_addFloat(celix_array_list_t *list, float value); /** @@ -279,6 +299,7 @@ void celix_arrayList_addFloat(celix_array_list_t *list, float value); * @param map The array list. * @param value The double value to add to the array list. */ +CELIX_UTILS_EXPORT void celix_arrayList_addDouble(celix_array_list_t *list, double value); /** @@ -287,6 +308,7 @@ void celix_arrayList_addDouble(celix_array_list_t *list, double value); * @param map The array list. * @param value The bool value to add to the array list. */ +CELIX_UTILS_EXPORT void celix_arrayList_addBool(celix_array_list_t *list, bool value); /** @@ -295,6 +317,7 @@ void celix_arrayList_addBool(celix_array_list_t *list, bool value); * @param map The array list. * @param value The size_t value to add to the array list. */ +CELIX_UTILS_EXPORT void celix_arrayList_addSize(celix_array_list_t *list, size_t value); /** @@ -310,12 +333,14 @@ void celix_arrayList_addSize(celix_array_list_t *list, size_t value); * @param entry The entry to find. * @return The index of the entry or -1 if the entry is not found. */ +CELIX_UTILS_EXPORT int celix_arrayList_indexOf(celix_array_list_t *list, celix_array_list_entry_t entry); /** * @brief Removes an entry at the provided index. * If the provided index < 0 or out of bound, nothing will be removed. */ +CELIX_UTILS_EXPORT void celix_arrayList_removeAt(celix_array_list_t *list, int index); /** @@ -323,6 +348,7 @@ void celix_arrayList_removeAt(celix_array_list_t *list, int index); * * @note If a (simple) removed callback is configured, the callback will be called for every array list entry. */ +CELIX_UTILS_EXPORT void celix_arrayList_clear(celix_array_list_t *list); /** @@ -334,6 +360,7 @@ void celix_arrayList_clear(celix_array_list_t *list); * The equals callback provided when the array list was created will be used to find the entry. * If there was no equals callback provided a direct memory compare will be done. */ +CELIX_UTILS_EXPORT void celix_arrayList_removeEntry(celix_array_list_t *list, celix_array_list_entry_t entry); /** @@ -342,6 +369,7 @@ void celix_arrayList_removeEntry(celix_array_list_t *list, celix_array_list_entr * The equals callback provided when the array list was created will be used to find the entry. * If there was no equals callback provided a direct memory compare will be done. */ +CELIX_UTILS_EXPORT void celix_arrayList_remove(celix_array_list_t *list, void *value); /** @@ -350,6 +378,7 @@ void celix_arrayList_remove(celix_array_list_t *list, void *value); * The equals callback provided when the array list was created will be used to find the entry. * If there was no equals callback provided a direct memory compare will be done. */ +CELIX_UTILS_EXPORT void celix_arrayList_removeInt(celix_array_list_t *list, int value); /** @@ -358,6 +387,7 @@ void celix_arrayList_removeInt(celix_array_list_t *list, int value); * The equals callback provided when the array list was created will be used to find the entry. * If there was no equals callback provided a direct memory compare will be done. */ +CELIX_UTILS_EXPORT void celix_arrayList_removeLong(celix_array_list_t *list, long value); /** @@ -366,6 +396,7 @@ void celix_arrayList_removeLong(celix_array_list_t *list, long value); * The equals callback provided when the array list was created will be used to find the entry. * If there was no equals callback provided a direct memory compare will be done. */ +CELIX_UTILS_EXPORT void celix_arrayList_removeUInt(celix_array_list_t *list, unsigned int value); /** @@ -374,6 +405,7 @@ void celix_arrayList_removeUInt(celix_array_list_t *list, unsigned int value); * The equals callback provided when the array list was created will be used to find the entry. * If there was no equals callback provided a direct memory compare will be done. */ +CELIX_UTILS_EXPORT void celix_arrayList_removeULong(celix_array_list_t *list, unsigned long value); /** @@ -382,6 +414,7 @@ void celix_arrayList_removeULong(celix_array_list_t *list, unsigned long value); * The equals callback provided when the array list was created will be used to find the entry. * If there was no equals callback provided a direct memory compare will be done. */ +CELIX_UTILS_EXPORT void celix_arrayList_removeFloat(celix_array_list_t *list, float value); /** @@ -390,6 +423,7 @@ void celix_arrayList_removeFloat(celix_array_list_t *list, float value); * The equals callback provided when the array list was created will be used to find the entry. * If there was no equals callback provided a direct memory compare will be done. */ +CELIX_UTILS_EXPORT void celix_arrayList_removeDouble(celix_array_list_t *list, double value); /** @@ -398,6 +432,7 @@ void celix_arrayList_removeDouble(celix_array_list_t *list, double value); * The equals callback provided when the array list was created will be used to find the entry. * If there was no equals callback provided a direct memory compare will be done. */ +CELIX_UTILS_EXPORT void celix_arrayList_removeBool(celix_array_list_t *list, bool value); /** @@ -406,17 +441,20 @@ void celix_arrayList_removeBool(celix_array_list_t *list, bool value); * The equals callback provided when the array list was created will be used to find the entry. * If there was no equals callback provided a direct memory compare will be done. */ +CELIX_UTILS_EXPORT void celix_arrayList_removeSize(celix_array_list_t *list, size_t value); /** * @brief Sort the array list using the provided sort function. */ +CELIX_UTILS_EXPORT void celix_arrayList_sortEntries(celix_array_list_t *list, celix_array_list_sort_entries_fp sortFp); /** * @warning Never use this function with array of doubles, since on some 32-bit platform (sizeof(double)==8 && sizeof(void*)==4) * @deprecated This function is deprecated, use celix_arrayList_sortEntries instead. */ +CELIX_UTILS_EXPORT void celix_arrayList_sort(celix_array_list_t *list, celix_arrayList_sort_fp sortFp); #ifdef __cplusplus diff --git a/libs/utils/include_deprecated/array_list.h b/libs/utils/include_deprecated/array_list.h index cde701da..1abaf16e 100644 --- a/libs/utils/include_deprecated/array_list.h +++ b/libs/utils/include_deprecated/array_list.h @@ -39,57 +39,57 @@ typedef struct celix_array_list_iterator array_list_iterator_t; typedef celix_status_t (*array_list_element_equals_pt)(const void *, const void *, bool *equals); -UTILS_EXPORT celix_status_t arrayList_create(celix_array_list_t **list); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t arrayList_create(celix_array_list_t **list); -UTILS_EXPORT celix_status_t arrayList_createWithEquals(array_list_element_equals_pt equals, celix_array_list_t **list); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t arrayList_createWithEquals(array_list_element_equals_pt equals, celix_array_list_t **list); -UTILS_EXPORT void arrayList_destroy(celix_array_list_t *list); +CELIX_UTILS_DEPRECATED_EXPORT void arrayList_destroy(celix_array_list_t *list); -UTILS_EXPORT void arrayList_trimToSize(celix_array_list_t *list); +CELIX_UTILS_DEPRECATED_EXPORT void arrayList_trimToSize(celix_array_list_t *list); -UTILS_EXPORT void arrayList_ensureCapacity(celix_array_list_t *list, int capacity); +CELIX_UTILS_DEPRECATED_EXPORT void arrayList_ensureCapacity(celix_array_list_t *list, int capacity); -UTILS_EXPORT unsigned int arrayList_size(celix_array_list_t *list); +CELIX_UTILS_DEPRECATED_EXPORT unsigned int arrayList_size(celix_array_list_t *list); -UTILS_EXPORT bool arrayList_isEmpty(celix_array_list_t *list); +CELIX_UTILS_DEPRECATED_EXPORT bool arrayList_isEmpty(celix_array_list_t *list); -UTILS_EXPORT bool arrayList_contains(celix_array_list_t *list, void *element); +CELIX_UTILS_DEPRECATED_EXPORT bool arrayList_contains(celix_array_list_t *list, void *element); -UTILS_EXPORT int arrayList_indexOf(celix_array_list_t *list, void *element); +CELIX_UTILS_DEPRECATED_EXPORT int arrayList_indexOf(celix_array_list_t *list, void *element); -UTILS_EXPORT int arrayList_lastIndexOf(celix_array_list_t *list, void *element); +CELIX_UTILS_DEPRECATED_EXPORT int arrayList_lastIndexOf(celix_array_list_t *list, void *element); -UTILS_EXPORT void *arrayList_get(celix_array_list_t *list, unsigned int index); +CELIX_UTILS_DEPRECATED_EXPORT void *arrayList_get(celix_array_list_t *list, unsigned int index); -UTILS_EXPORT void *arrayList_set(celix_array_list_t *list, unsigned int index, void *element); +CELIX_UTILS_DEPRECATED_EXPORT void *arrayList_set(celix_array_list_t *list, unsigned int index, void *element); -UTILS_EXPORT bool arrayList_add(celix_array_list_t *list, void *element); +CELIX_UTILS_DEPRECATED_EXPORT bool arrayList_add(celix_array_list_t *list, void *element); -UTILS_EXPORT int arrayList_addIndex(celix_array_list_t *list, unsigned int index, void *element); +CELIX_UTILS_DEPRECATED_EXPORT int arrayList_addIndex(celix_array_list_t *list, unsigned int index, void *element); -UTILS_EXPORT bool arrayList_addAll(celix_array_list_t *list, celix_array_list_t *toAdd); +CELIX_UTILS_DEPRECATED_EXPORT bool arrayList_addAll(celix_array_list_t *list, celix_array_list_t *toAdd); -UTILS_EXPORT void *arrayList_remove(celix_array_list_t *list, unsigned int index); +CELIX_UTILS_DEPRECATED_EXPORT void *arrayList_remove(celix_array_list_t *list, unsigned int index); -UTILS_EXPORT bool arrayList_removeElement(celix_array_list_t *list, void *element); +CELIX_UTILS_DEPRECATED_EXPORT bool arrayList_removeElement(celix_array_list_t *list, void *element); -UTILS_EXPORT void arrayList_clear(celix_array_list_t *list); +CELIX_UTILS_DEPRECATED_EXPORT void arrayList_clear(celix_array_list_t *list); -UTILS_EXPORT celix_array_list_t *arrayList_clone(celix_array_list_t *list); +CELIX_UTILS_DEPRECATED_EXPORT celix_array_list_t *arrayList_clone(celix_array_list_t *list); -UTILS_EXPORT array_list_iterator_pt arrayListIterator_create(celix_array_list_t *list); +CELIX_UTILS_DEPRECATED_EXPORT array_list_iterator_pt arrayListIterator_create(celix_array_list_t *list); -UTILS_EXPORT void arrayListIterator_destroy(array_list_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT void arrayListIterator_destroy(array_list_iterator_pt iterator); -UTILS_EXPORT bool arrayListIterator_hasNext(array_list_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT bool arrayListIterator_hasNext(array_list_iterator_pt iterator); -UTILS_EXPORT void *arrayListIterator_next(array_list_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT void *arrayListIterator_next(array_list_iterator_pt iterator); -UTILS_EXPORT bool arrayListIterator_hasPrevious(array_list_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT bool arrayListIterator_hasPrevious(array_list_iterator_pt iterator); -UTILS_EXPORT void *arrayListIterator_previous(array_list_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT void *arrayListIterator_previous(array_list_iterator_pt iterator); -UTILS_EXPORT void arrayListIterator_remove(array_list_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT void arrayListIterator_remove(array_list_iterator_pt iterator); #ifdef __cplusplus } diff --git a/libs/utils/include_deprecated/filter.h b/libs/utils/include_deprecated/filter.h index 738baaa9..37fa84ac 100644 --- a/libs/utils/include_deprecated/filter.h +++ b/libs/utils/include_deprecated/filter.h @@ -24,6 +24,7 @@ #include "properties.h" #include "celix_properties.h" #include "celix_filter.h" +#include "celix_utils_export.h" #ifdef __cplusplus extern "C" { @@ -33,15 +34,18 @@ typedef struct celix_filter_struct filter_t __attribute__((deprecated("filter is typedef struct celix_filter_struct *filter_pt __attribute__((deprecated("filter is deprecated use celix_filter instead"))); -celix_filter_t* filter_create(const char *filterString); +CELIX_UTILS_DEPRECATED_EXPORT celix_filter_t* filter_create(const char *filterString); -void filter_destroy(celix_filter_t *filter); +CELIX_UTILS_DEPRECATED_EXPORT void filter_destroy(celix_filter_t *filter); -celix_status_t filter_match(celix_filter_t *filter, celix_properties_t *properties, bool *result); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t filter_match( + celix_filter_t *filter, + celix_properties_t *properties, + bool *result); -celix_status_t filter_match_filter(celix_filter_t *src, filter_t *dest, bool *result); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t filter_match_filter(celix_filter_t *src, filter_t *dest, bool *result); -celix_status_t filter_getString(celix_filter_t *filter, const char **filterStr); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t filter_getString(celix_filter_t *filter, const char **filterStr); #ifdef __cplusplus diff --git a/libs/utils/include_deprecated/hash_map.h b/libs/utils/include_deprecated/hash_map.h index 4ac9016c..0cf9d75f 100644 --- a/libs/utils/include_deprecated/hash_map.h +++ b/libs/utils/include_deprecated/hash_map.h @@ -28,7 +28,7 @@ #define HASH_MAP_H_ #include <stdbool.h> -#include "exports.h" +#include "celix_utils_export.h" #ifdef __cplusplus extern "C" { @@ -55,106 +55,106 @@ typedef struct hashMapKeySet *hash_map_key_set_pt; typedef struct hashMapValues *hash_map_values_pt; typedef struct hashMapEntrySet *hash_map_entry_set_pt; -UTILS_EXPORT hash_map_pt hashMap_create(unsigned int (*keyHash)(const void *), unsigned int (*valueHash)(const void *), +CELIX_UTILS_DEPRECATED_EXPORT hash_map_pt hashMap_create(unsigned int (*keyHash)(const void *), unsigned int (*valueHash)(const void *), int (*keyEquals)(const void *, const void *), int (*valueEquals)(const void *, const void *)); -UTILS_EXPORT void hashMap_destroy(hash_map_pt map, bool freeKeys, bool freeValues); +CELIX_UTILS_DEPRECATED_EXPORT void hashMap_destroy(hash_map_pt map, bool freeKeys, bool freeValues); -UTILS_EXPORT int hashMap_size(hash_map_pt map); +CELIX_UTILS_DEPRECATED_EXPORT int hashMap_size(hash_map_pt map); -UTILS_EXPORT bool hashMap_isEmpty(hash_map_pt map); +CELIX_UTILS_DEPRECATED_EXPORT bool hashMap_isEmpty(hash_map_pt map); -UTILS_EXPORT void *hashMap_get(hash_map_pt map, const void *key); +CELIX_UTILS_DEPRECATED_EXPORT void *hashMap_get(hash_map_pt map, const void *key); -UTILS_EXPORT bool hashMap_containsKey(hash_map_pt map, const void *key); +CELIX_UTILS_DEPRECATED_EXPORT bool hashMap_containsKey(hash_map_pt map, const void *key); -UTILS_EXPORT hash_map_entry_pt hashMap_getEntry(hash_map_pt map, const void *key); +CELIX_UTILS_DEPRECATED_EXPORT hash_map_entry_pt hashMap_getEntry(hash_map_pt map, const void *key); -UTILS_EXPORT void *hashMap_put(hash_map_pt map, void *key, void *value); +CELIX_UTILS_DEPRECATED_EXPORT void *hashMap_put(hash_map_pt map, void *key, void *value); -UTILS_EXPORT void *hashMap_remove(hash_map_pt map, const void *key); +CELIX_UTILS_DEPRECATED_EXPORT void *hashMap_remove(hash_map_pt map, const void *key); -UTILS_EXPORT void *hashMap_removeFreeKey(hash_map_pt map, const void *key); +CELIX_UTILS_DEPRECATED_EXPORT void *hashMap_removeFreeKey(hash_map_pt map, const void *key); -UTILS_EXPORT void hashMap_clear(hash_map_pt map, bool freeKey, bool freeValue); +CELIX_UTILS_DEPRECATED_EXPORT void hashMap_clear(hash_map_pt map, bool freeKey, bool freeValue); -UTILS_EXPORT bool hashMap_containsValue(hash_map_pt map, const void *value); +CELIX_UTILS_DEPRECATED_EXPORT bool hashMap_containsValue(hash_map_pt map, const void *value); -UTILS_EXPORT hash_map_iterator_pt hashMapIterator_create(hash_map_pt map); +CELIX_UTILS_DEPRECATED_EXPORT hash_map_iterator_pt hashMapIterator_create(hash_map_pt map); -UTILS_EXPORT void hashMapIterator_destroy(hash_map_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT void hashMapIterator_destroy(hash_map_iterator_pt iterator); -UTILS_EXPORT hash_map_iterator_pt hashMapIterator_alloc(void); +CELIX_UTILS_DEPRECATED_EXPORT hash_map_iterator_pt hashMapIterator_alloc(void); -UTILS_EXPORT void hashMapIterator_dealloc(hash_map_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT void hashMapIterator_dealloc(hash_map_iterator_pt iterator); -UTILS_EXPORT void hashMapIterator_init(hash_map_pt map, hash_map_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT void hashMapIterator_init(hash_map_pt map, hash_map_iterator_pt iterator); -UTILS_EXPORT hash_map_iterator_t hashMapIterator_construct(hash_map_pt map); +CELIX_UTILS_DEPRECATED_EXPORT hash_map_iterator_t hashMapIterator_construct(hash_map_pt map); -UTILS_EXPORT bool hashMapIterator_hasNext(hash_map_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT bool hashMapIterator_hasNext(hash_map_iterator_pt iterator); -UTILS_EXPORT void hashMapIterator_remove(hash_map_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT void hashMapIterator_remove(hash_map_iterator_pt iterator); -UTILS_EXPORT void *hashMapIterator_nextValue(hash_map_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT void *hashMapIterator_nextValue(hash_map_iterator_pt iterator); -UTILS_EXPORT void *hashMapIterator_nextKey(hash_map_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT void *hashMapIterator_nextKey(hash_map_iterator_pt iterator); -UTILS_EXPORT hash_map_entry_pt hashMapIterator_nextEntry(hash_map_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT hash_map_entry_pt hashMapIterator_nextEntry(hash_map_iterator_pt iterator); -UTILS_EXPORT hash_map_key_set_pt hashMapKeySet_create(hash_map_pt map); +CELIX_UTILS_DEPRECATED_EXPORT hash_map_key_set_pt hashMapKeySet_create(hash_map_pt map); -UTILS_EXPORT void hashMapKeySet_destroy(hash_map_key_set_pt keySet); +CELIX_UTILS_DEPRECATED_EXPORT void hashMapKeySet_destroy(hash_map_key_set_pt keySet); -UTILS_EXPORT int hashMapKeySet_size(hash_map_key_set_pt keySet); +CELIX_UTILS_DEPRECATED_EXPORT int hashMapKeySet_size(hash_map_key_set_pt keySet); -UTILS_EXPORT bool hashMapKeySet_contains(hash_map_key_set_pt keySet, const void *key); +CELIX_UTILS_DEPRECATED_EXPORT bool hashMapKeySet_contains(hash_map_key_set_pt keySet, const void *key); -UTILS_EXPORT bool hashMapKeySet_remove(hash_map_key_set_pt keySet, const void *key); +CELIX_UTILS_DEPRECATED_EXPORT bool hashMapKeySet_remove(hash_map_key_set_pt keySet, const void *key); -UTILS_EXPORT void hashMapKeySet_clear(hash_map_key_set_pt keySet); +CELIX_UTILS_DEPRECATED_EXPORT void hashMapKeySet_clear(hash_map_key_set_pt keySet); -UTILS_EXPORT bool hashMapKeySet_isEmpty(hash_map_key_set_pt keySet); +CELIX_UTILS_DEPRECATED_EXPORT bool hashMapKeySet_isEmpty(hash_map_key_set_pt keySet); -UTILS_EXPORT hash_map_values_pt hashMapValues_create(hash_map_pt map); +CELIX_UTILS_DEPRECATED_EXPORT hash_map_values_pt hashMapValues_create(hash_map_pt map); -UTILS_EXPORT void hashMapValues_destroy(hash_map_values_pt values); +CELIX_UTILS_DEPRECATED_EXPORT void hashMapValues_destroy(hash_map_values_pt values); -UTILS_EXPORT hash_map_iterator_pt hashMapValues_iterator(hash_map_values_pt values); +CELIX_UTILS_DEPRECATED_EXPORT hash_map_iterator_pt hashMapValues_iterator(hash_map_values_pt values); -UTILS_EXPORT int hashMapValues_size(hash_map_values_pt values); +CELIX_UTILS_DEPRECATED_EXPORT int hashMapValues_size(hash_map_values_pt values); -UTILS_EXPORT bool hashMapValues_contains(hash_map_values_pt values, const void *o); +CELIX_UTILS_DEPRECATED_EXPORT bool hashMapValues_contains(hash_map_values_pt values, const void *o); -UTILS_EXPORT void hashMapValues_toArray(hash_map_values_pt values, void **array[], unsigned int *size); +CELIX_UTILS_DEPRECATED_EXPORT void hashMapValues_toArray(hash_map_values_pt values, void **array[], unsigned int *size); -UTILS_EXPORT bool hashMapValues_remove(hash_map_values_pt values, const void *o); +CELIX_UTILS_DEPRECATED_EXPORT bool hashMapValues_remove(hash_map_values_pt values, const void *o); -UTILS_EXPORT void hashMapValues_clear(hash_map_values_pt values); +CELIX_UTILS_DEPRECATED_EXPORT void hashMapValues_clear(hash_map_values_pt values); -UTILS_EXPORT bool hashMapValues_isEmpty(hash_map_values_pt values); +CELIX_UTILS_DEPRECATED_EXPORT bool hashMapValues_isEmpty(hash_map_values_pt values); -UTILS_EXPORT hash_map_entry_set_pt hashMapEntrySet_create(hash_map_pt map); +CELIX_UTILS_DEPRECATED_EXPORT hash_map_entry_set_pt hashMapEntrySet_create(hash_map_pt map); -UTILS_EXPORT void hashMapEntrySet_destroy(hash_map_entry_set_pt entrySet); +CELIX_UTILS_DEPRECATED_EXPORT void hashMapEntrySet_destroy(hash_map_entry_set_pt entrySet); -UTILS_EXPORT int hashMapEntrySet_size(hash_map_entry_set_pt entrySet); +CELIX_UTILS_DEPRECATED_EXPORT int hashMapEntrySet_size(hash_map_entry_set_pt entrySet); -UTILS_EXPORT bool hashMapEntrySet_contains(hash_map_entry_set_pt entrySet, hash_map_entry_pt entry); +CELIX_UTILS_DEPRECATED_EXPORT bool hashMapEntrySet_contains(hash_map_entry_set_pt entrySet, hash_map_entry_pt entry); -UTILS_EXPORT bool hashMapEntrySet_remove(hash_map_entry_set_pt entrySet, hash_map_entry_pt entry); +CELIX_UTILS_DEPRECATED_EXPORT bool hashMapEntrySet_remove(hash_map_entry_set_pt entrySet, hash_map_entry_pt entry); -UTILS_EXPORT void hashMapEntrySet_clear(hash_map_entry_set_pt entrySet); +CELIX_UTILS_DEPRECATED_EXPORT void hashMapEntrySet_clear(hash_map_entry_set_pt entrySet); -UTILS_EXPORT bool hashMapEntrySet_isEmpty(hash_map_entry_set_pt entrySet); +CELIX_UTILS_DEPRECATED_EXPORT bool hashMapEntrySet_isEmpty(hash_map_entry_set_pt entrySet); -UTILS_EXPORT void *hashMapEntry_getKey(hash_map_entry_pt entry); +CELIX_UTILS_DEPRECATED_EXPORT void *hashMapEntry_getKey(hash_map_entry_pt entry); -UTILS_EXPORT void *hashMapEntry_getValue(hash_map_entry_pt entry); +CELIX_UTILS_DEPRECATED_EXPORT void *hashMapEntry_getValue(hash_map_entry_pt entry); -UTILS_EXPORT void hashMapEntry_clear(hash_map_entry_pt entry, bool freeKey, bool freeValue); +CELIX_UTILS_DEPRECATED_EXPORT void hashMapEntry_clear(hash_map_entry_pt entry, bool freeKey, bool freeValue); #ifdef __cplusplus } diff --git a/libs/utils/include_deprecated/ip_utils.h b/libs/utils/include_deprecated/ip_utils.h index e113c957..75adcb59 100644 --- a/libs/utils/include_deprecated/ip_utils.h +++ b/libs/utils/include_deprecated/ip_utils.h @@ -30,21 +30,21 @@ #include <ctype.h> #include "celix_errno.h" -#include "exports.h" +#include "celix_utils_export.h" #ifdef __cplusplus extern "C" { #endif -UTILS_EXPORT unsigned int ipUtils_ipToUnsignedInt(char *ip); +CELIX_UTILS_DEPRECATED_EXPORT unsigned int ipUtils_ipToUnsignedInt(char *ip); -UTILS_EXPORT char *ipUtils_unsignedIntToIp(unsigned int ip); +CELIX_UTILS_DEPRECATED_EXPORT char *ipUtils_unsignedIntToIp(unsigned int ip); -UTILS_EXPORT unsigned int ipUtils_prefixToBitmask(unsigned int prefix); +CELIX_UTILS_DEPRECATED_EXPORT unsigned int ipUtils_prefixToBitmask(unsigned int prefix); -UTILS_EXPORT int ipUtils_netmaskToPrefix(const char *netmask); +CELIX_UTILS_DEPRECATED_EXPORT int ipUtils_netmaskToPrefix(const char *netmask); -UTILS_EXPORT char *ipUtils_findIpBySubnet(const char *ipWithPrefix); +CELIX_UTILS_DEPRECATED_EXPORT char *ipUtils_findIpBySubnet(const char *ipWithPrefix); #ifdef __cplusplus } diff --git a/libs/utils/include_deprecated/linked_list.h b/libs/utils/include_deprecated/linked_list.h index 0092d276..5e379153 100644 --- a/libs/utils/include_deprecated/linked_list.h +++ b/libs/utils/include_deprecated/linked_list.h @@ -29,7 +29,7 @@ #include "celix_errno.h" -#include "exports.h" +#include "celix_utils_export.h" #include <stdbool.h> @@ -39,51 +39,51 @@ extern "C" { typedef struct linked_list_entry *linked_list_entry_pt __attribute__((deprecated("linked_list is deprecated use celix_long_hash_map or celix_array_list instead"))); typedef struct linked_list *linked_list_pt __attribute__((deprecated("linked_list is deprecated use celix_long_hash_map or celix_array_list instead"))); -UTILS_EXPORT celix_status_t linkedList_create(linked_list_pt *list); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t linkedList_create(linked_list_pt *list); -UTILS_EXPORT celix_status_t linkedList_destroy(linked_list_pt list); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t linkedList_destroy(linked_list_pt list); -UTILS_EXPORT celix_status_t linkedList_clone(linked_list_pt list, linked_list_pt *clone); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t linkedList_clone(linked_list_pt list, linked_list_pt *clone); -UTILS_EXPORT void *linkedList_getFirst(linked_list_pt list); +CELIX_UTILS_DEPRECATED_EXPORT void *linkedList_getFirst(linked_list_pt list); -UTILS_EXPORT void *linkedList_getLast(linked_list_pt list); +CELIX_UTILS_DEPRECATED_EXPORT void *linkedList_getLast(linked_list_pt list); -UTILS_EXPORT void *linkedList_removeFirst(linked_list_pt list); +CELIX_UTILS_DEPRECATED_EXPORT void *linkedList_removeFirst(linked_list_pt list); -UTILS_EXPORT void *linkedList_removeLast(linked_list_pt list); +CELIX_UTILS_DEPRECATED_EXPORT void *linkedList_removeLast(linked_list_pt list); -UTILS_EXPORT void linkedList_addFirst(linked_list_pt list, void *element); +CELIX_UTILS_DEPRECATED_EXPORT void linkedList_addFirst(linked_list_pt list, void *element); -UTILS_EXPORT void linkedList_addLast(linked_list_pt list, void *element); +CELIX_UTILS_DEPRECATED_EXPORT void linkedList_addLast(linked_list_pt list, void *element); -UTILS_EXPORT bool linkedList_contains(linked_list_pt list, void *element); +CELIX_UTILS_DEPRECATED_EXPORT bool linkedList_contains(linked_list_pt list, void *element); -UTILS_EXPORT int linkedList_size(linked_list_pt list); +CELIX_UTILS_DEPRECATED_EXPORT int linkedList_size(linked_list_pt list); -UTILS_EXPORT bool linkedList_isEmpty(linked_list_pt list); +CELIX_UTILS_DEPRECATED_EXPORT bool linkedList_isEmpty(linked_list_pt list); -UTILS_EXPORT bool linkedList_addElement(linked_list_pt list, void *element); +CELIX_UTILS_DEPRECATED_EXPORT bool linkedList_addElement(linked_list_pt list, void *element); -UTILS_EXPORT bool linkedList_removeElement(linked_list_pt list, void *element); +CELIX_UTILS_DEPRECATED_EXPORT bool linkedList_removeElement(linked_list_pt list, void *element); -UTILS_EXPORT void linkedList_clear(linked_list_pt list); +CELIX_UTILS_DEPRECATED_EXPORT void linkedList_clear(linked_list_pt list); -UTILS_EXPORT void *linkedList_get(linked_list_pt list, int index); +CELIX_UTILS_DEPRECATED_EXPORT void *linkedList_get(linked_list_pt list, int index); -UTILS_EXPORT void *linkedList_set(linked_list_pt list, int index, void *element); +CELIX_UTILS_DEPRECATED_EXPORT void *linkedList_set(linked_list_pt list, int index, void *element); -UTILS_EXPORT void linkedList_addIndex(linked_list_pt list, int index, void *element); +CELIX_UTILS_DEPRECATED_EXPORT void linkedList_addIndex(linked_list_pt list, int index, void *element); -UTILS_EXPORT void *linkedList_removeIndex(linked_list_pt list, int index); +CELIX_UTILS_DEPRECATED_EXPORT void *linkedList_removeIndex(linked_list_pt list, int index); -UTILS_EXPORT linked_list_entry_pt linkedList_entry(linked_list_pt list, int index); +CELIX_UTILS_DEPRECATED_EXPORT linked_list_entry_pt linkedList_entry(linked_list_pt list, int index); -UTILS_EXPORT int linkedList_indexOf(linked_list_pt list, void *element); +CELIX_UTILS_DEPRECATED_EXPORT int linkedList_indexOf(linked_list_pt list, void *element); -UTILS_EXPORT linked_list_entry_pt linkedList_addBefore(linked_list_pt list, void *element, linked_list_entry_pt entry); +CELIX_UTILS_DEPRECATED_EXPORT linked_list_entry_pt linkedList_addBefore(linked_list_pt list, void *element, linked_list_entry_pt entry); -UTILS_EXPORT void *linkedList_removeEntry(linked_list_pt list, linked_list_entry_pt entry); +CELIX_UTILS_DEPRECATED_EXPORT void *linkedList_removeEntry(linked_list_pt list, linked_list_entry_pt entry); #ifdef __cplusplus } diff --git a/libs/utils/include_deprecated/linked_list_iterator.h b/libs/utils/include_deprecated/linked_list_iterator.h index 141a90b3..2de1b724 100644 --- a/libs/utils/include_deprecated/linked_list_iterator.h +++ b/libs/utils/include_deprecated/linked_list_iterator.h @@ -30,34 +30,34 @@ #include <stdbool.h> #include "linked_list.h" -#include "exports.h" +#include "celix_utils_export.h" #ifdef __cplusplus extern "C" { #endif typedef struct linkedListIterator *linked_list_iterator_pt; -UTILS_EXPORT linked_list_iterator_pt linkedListIterator_create(linked_list_pt list, unsigned int index); +CELIX_UTILS_DEPRECATED_EXPORT linked_list_iterator_pt linkedListIterator_create(linked_list_pt list, unsigned int index); -UTILS_EXPORT void linkedListIterator_destroy(linked_list_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT void linkedListIterator_destroy(linked_list_iterator_pt iterator); -UTILS_EXPORT bool linkedListIterator_hasNext(linked_list_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT bool linkedListIterator_hasNext(linked_list_iterator_pt iterator); -UTILS_EXPORT void *linkedListIterator_next(linked_list_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT void *linkedListIterator_next(linked_list_iterator_pt iterator); -UTILS_EXPORT bool linkedListIterator_hasPrevious(linked_list_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT bool linkedListIterator_hasPrevious(linked_list_iterator_pt iterator); -UTILS_EXPORT void *linkedListIterator_previous(linked_list_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT void *linkedListIterator_previous(linked_list_iterator_pt iterator); -UTILS_EXPORT int linkedListIterator_nextIndex(linked_list_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT int linkedListIterator_nextIndex(linked_list_iterator_pt iterator); -UTILS_EXPORT int linkedListIterator_previousIndex(linked_list_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT int linkedListIterator_previousIndex(linked_list_iterator_pt iterator); -UTILS_EXPORT void linkedListIterator_remove(linked_list_iterator_pt iterator); +CELIX_UTILS_DEPRECATED_EXPORT void linkedListIterator_remove(linked_list_iterator_pt iterator); -UTILS_EXPORT void linkedListIterator_set(linked_list_iterator_pt iterator, void *element); +CELIX_UTILS_DEPRECATED_EXPORT void linkedListIterator_set(linked_list_iterator_pt iterator, void *element); -UTILS_EXPORT void linkedListIterator_add(linked_list_iterator_pt iterator, void *element); +CELIX_UTILS_DEPRECATED_EXPORT void linkedListIterator_add(linked_list_iterator_pt iterator, void *element); #ifdef __cplusplus } diff --git a/libs/utils/include_deprecated/properties.h b/libs/utils/include_deprecated/properties.h index 00e9c785..05d4d5a8 100644 --- a/libs/utils/include_deprecated/properties.h +++ b/libs/utils/include_deprecated/properties.h @@ -31,7 +31,7 @@ #include "celix_properties.h" #include "hash_map.h" -#include "exports.h" +#include "celix_utils_export.h" #include "celix_errno.h" #ifdef __cplusplus extern "C" { @@ -40,27 +40,27 @@ extern "C" { typedef hash_map_pt properties_pt __attribute__((deprecated("properties is deprecated use celix_properties instead"))); typedef hash_map_t properties_t __attribute__((deprecated("properties is deprecated use celix_properties instead"))); -UTILS_EXPORT celix_properties_t* properties_create(void); +CELIX_UTILS_DEPRECATED_EXPORT celix_properties_t* properties_create(void); -UTILS_EXPORT void properties_destroy(celix_properties_t *properties); +CELIX_UTILS_DEPRECATED_EXPORT void properties_destroy(celix_properties_t *properties); -UTILS_EXPORT celix_properties_t* properties_load(const char *filename); +CELIX_UTILS_DEPRECATED_EXPORT celix_properties_t* properties_load(const char *filename); -UTILS_EXPORT celix_properties_t* properties_loadWithStream(FILE *stream); +CELIX_UTILS_DEPRECATED_EXPORT celix_properties_t* properties_loadWithStream(FILE *stream); -UTILS_EXPORT celix_properties_t* properties_loadFromString(const char *input); +CELIX_UTILS_DEPRECATED_EXPORT celix_properties_t* properties_loadFromString(const char *input); -UTILS_EXPORT void properties_store(celix_properties_t *properties, const char *file, const char *header); +CELIX_UTILS_DEPRECATED_EXPORT void properties_store(celix_properties_t *properties, const char *file, const char *header); -UTILS_EXPORT const char* properties_get(celix_properties_t *properties, const char *key); +CELIX_UTILS_DEPRECATED_EXPORT const char* properties_get(celix_properties_t *properties, const char *key); -UTILS_EXPORT const char* properties_getWithDefault(celix_properties_t *properties, const char *key, const char *defaultValue); +CELIX_UTILS_DEPRECATED_EXPORT const char* properties_getWithDefault(celix_properties_t *properties, const char *key, const char *defaultValue); -UTILS_EXPORT void properties_set(celix_properties_t *properties, const char *key, const char *value); +CELIX_UTILS_DEPRECATED_EXPORT void properties_set(celix_properties_t *properties, const char *key, const char *value); -UTILS_EXPORT void properties_unset(celix_properties_t *properties, const char *key); +CELIX_UTILS_DEPRECATED_EXPORT void properties_unset(celix_properties_t *properties, const char *key); -UTILS_EXPORT celix_status_t properties_copy(celix_properties_t *properties, celix_properties_t **copy); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t properties_copy(celix_properties_t *properties, celix_properties_t **copy); #define PROPERTIES_FOR_EACH(props, key) \ for(hash_map_iterator_t iter = hashMapIterator_construct(props); \ diff --git a/libs/utils/include_deprecated/utils.h b/libs/utils/include_deprecated/utils.h index 983d2307..c4c092a0 100644 --- a/libs/utils/include_deprecated/utils.h +++ b/libs/utils/include_deprecated/utils.h @@ -24,7 +24,7 @@ #include <stdbool.h> #include "celix_errno.h" -#include "exports.h" +#include "celix_utils_export.h" #include "celix_threads.h" #include "celix_utils.h" @@ -34,22 +34,22 @@ extern "C" { #define CELIX_UTILS_DEPRECATED_ATTR __attribute__((deprecated("functions in utils.h are deprecated use functions in celix_utils.h instead"))) -UTILS_EXPORT unsigned int utils_stringHash(const void *string) CELIX_UTILS_DEPRECATED_ATTR; +CELIX_UTILS_DEPRECATED_EXPORT unsigned int utils_stringHash(const void *string) CELIX_UTILS_DEPRECATED_ATTR; -UTILS_EXPORT int utils_stringEquals(const void *string, const void *toCompare) CELIX_UTILS_DEPRECATED_ATTR; +CELIX_UTILS_DEPRECATED_EXPORT int utils_stringEquals(const void *string, const void *toCompare) CELIX_UTILS_DEPRECATED_ATTR; -UTILS_EXPORT char *string_ndup(const char *s, size_t n) CELIX_UTILS_DEPRECATED_ATTR; +CELIX_UTILS_DEPRECATED_EXPORT char *string_ndup(const char *s, size_t n) CELIX_UTILS_DEPRECATED_ATTR; -UTILS_EXPORT char *utils_stringTrim(char *string) CELIX_UTILS_DEPRECATED_ATTR; +CELIX_UTILS_DEPRECATED_EXPORT char *utils_stringTrim(char *string) CELIX_UTILS_DEPRECATED_ATTR; -UTILS_EXPORT bool utils_isStringEmptyOrNull(const char *const str) CELIX_UTILS_DEPRECATED_ATTR; +CELIX_UTILS_DEPRECATED_EXPORT bool utils_isStringEmptyOrNull(const char *const str) CELIX_UTILS_DEPRECATED_ATTR; -UTILS_EXPORT int +CELIX_UTILS_DEPRECATED_EXPORT int utils_compareServiceIdsAndRanking(long servId, long servRank, long otherServId, long otherServRank) CELIX_UTILS_DEPRECATED_ATTR; -UTILS_EXPORT celix_status_t thread_equalsSelf(celix_thread_t thread, bool *equals) CELIX_UTILS_DEPRECATED_ATTR; +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t thread_equalsSelf(celix_thread_t thread, bool *equals) CELIX_UTILS_DEPRECATED_ATTR; -UTILS_EXPORT celix_status_t utils_isNumeric(const char *number, bool *ret) CELIX_UTILS_DEPRECATED_ATTR; +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t utils_isNumeric(const char *number, bool *ret) CELIX_UTILS_DEPRECATED_ATTR; #ifdef __cplusplus } diff --git a/libs/utils/include_deprecated/version.h b/libs/utils/include_deprecated/version.h index e42bd863..9f3be9d6 100644 --- a/libs/utils/include_deprecated/version.h +++ b/libs/utils/include_deprecated/version.h @@ -20,9 +20,11 @@ #ifndef VERSION_H_ #define VERSION_H_ -#include "celix_errno.h" #include <stdbool.h> +#include "celix_errno.h" +#include "celix_utils_export.h" + #ifdef __cplusplus extern "C" { #endif @@ -48,9 +50,9 @@ typedef struct celix_version *version_pt __attribute__((deprecated("version is d * - CELIX_ILLEGAL_ARGUMENT If the numerical components are negative * or the qualifier string is invalid. */ -celix_status_t version_createVersion(int major, int minor, int micro, const char *qualifier, version_pt *version); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t version_createVersion(int major, int minor, int micro, const char *qualifier, version_pt *version); -celix_status_t version_destroy(version_pt version); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t version_destroy(version_pt version); /** * Creates a clone of <code>version</code>. @@ -63,7 +65,7 @@ celix_status_t version_destroy(version_pt version); * - CELIX_ILLEGAL_ARGUMENT If the numerical components are negative * or the qualifier string is invalid. */ -celix_status_t version_clone(version_pt version, version_pt *clone); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t version_clone(version_pt version, version_pt *clone); /** * Creates a version identifier from the specified string. @@ -91,7 +93,7 @@ celix_status_t version_clone(version_pt version, version_pt *clone); * - CELIX_ILLEGAL_ARGUMENT If the numerical components are negative, * the qualifier string is invalid or <code>versionStr</code> is improperly formatted. */ -celix_status_t version_createVersionFromString(const char *versionStr, version_pt *version); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t version_createVersionFromString(const char *versionStr, version_pt *version); /** * The empty version "0.0.0". @@ -103,15 +105,15 @@ celix_status_t version_createVersionFromString(const char *versionStr, version_p * - CELIX_ILLEGAL_ARGUMENT If the numerical components are negative, * the qualifier string is invalid or <code>versionStr</code> is improperly formatted. */ -celix_status_t version_createEmptyVersion(version_pt *version); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t version_createEmptyVersion(version_pt *version); -celix_status_t version_getMajor(version_pt version, int *major); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t version_getMajor(version_pt version, int *major); -celix_status_t version_getMinor(version_pt version, int *minor); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t version_getMinor(version_pt version, int *minor); -celix_status_t version_getMicro(version_pt version, int *micro); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t version_getMicro(version_pt version, int *micro); -celix_status_t version_getQualifier(version_pt version, const char **qualifier); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t version_getQualifier(version_pt version, const char **qualifier); /** * Compares this <code>Version</code> object to another object. @@ -138,7 +140,7 @@ celix_status_t version_getQualifier(version_pt version, const char **qualifier); * @return Status code indication failure or success: * - CELIX_SUCCESS when no errors are encountered. */ -celix_status_t version_compareTo(version_pt version, version_pt compare, int *result); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t version_compareTo(version_pt version, version_pt compare, int *result); /** * Returns the string representation of <code>version</code> identifier. @@ -154,7 +156,7 @@ celix_status_t version_compareTo(version_pt version, version_pt compare, int *re * @return Status code indication failure or success: * - CELIX_SUCCESS when no errors are encountered. */ -celix_status_t version_toString(version_pt version, char **string); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t version_toString(version_pt version, char **string); /** * Check if two versions are semantically compatible. @@ -170,7 +172,7 @@ celix_status_t version_toString(version_pt version, char **string); * @return Status code indication failure or success: * - CELIX_SUCCESS when no errors are encountered. */ -celix_status_t version_isCompatible(version_pt user, version_pt provider, bool *isCompatible); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t version_isCompatible(version_pt user, version_pt provider, bool *isCompatible); #ifdef __cplusplus } diff --git a/libs/utils/include_deprecated/version_range.h b/libs/utils/include_deprecated/version_range.h index bae3e856..1f6853da 100644 --- a/libs/utils/include_deprecated/version_range.h +++ b/libs/utils/include_deprecated/version_range.h @@ -30,6 +30,7 @@ #include <stdbool.h> #include "celix_errno.h" #include "version.h" +#include "celix_utils_export.h" #ifdef __cplusplus extern "C" { @@ -52,7 +53,7 @@ typedef struct celix_version_range *version_range_pt __attribute__((deprecated(" * - CELIX_SUCCESS when no errors are encountered. * - CELIX_ENOMEM If allocating memory for <code>versionRange</code> failed. */ -celix_status_t +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t versionRange_createVersionRange(version_pt low, bool isLowInclusive, version_pt high, bool isHighInclusive, version_range_pt *versionRange); @@ -65,9 +66,9 @@ versionRange_createVersionRange(version_pt low, bool isLowInclusive, version_pt * - CELIX_SUCCESS when no errors are encountered. * - CELIX_ENOMEM If allocating memory for <code>range</code> failed. */ -celix_status_t versionRange_createInfiniteVersionRange(version_range_pt *range); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t versionRange_createInfiniteVersionRange(version_range_pt *range); -celix_status_t versionRange_destroy(version_range_pt range); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t versionRange_destroy(version_range_pt range); /** * Determine if the specified version is part of the version range or not. @@ -78,7 +79,7 @@ celix_status_t versionRange_destroy(version_range_pt range); * @return Status code indication failure or success: * - CELIX_SUCCESS when no errors are encountered. */ -celix_status_t versionRange_isInRange(version_range_pt versionRange, version_pt version, bool *inRange); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t versionRange_isInRange(version_range_pt versionRange, version_pt version, bool *inRange); /** * Determines whether the lower bound is included in the given range @@ -89,7 +90,7 @@ celix_status_t versionRange_isInRange(version_range_pt versionRange, version_pt * - CELIX_SUCCESS when no errors are encountered. * - CELIX_ILLEGAL_ARGUMENT in case the versionRange is NULL */ -celix_status_t versionRange_isLowInclusive(version_range_pt versionRange, bool *isLowInclusive); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t versionRange_isLowInclusive(version_range_pt versionRange, bool *isLowInclusive); /** * Determines whether the higher bound is included in the given range @@ -100,7 +101,7 @@ celix_status_t versionRange_isLowInclusive(version_range_pt versionRange, bool * * - CELIX_SUCCESS when no errors are encountered. * - CELIX_ILLEGAL_ARGUMENT in case the versionRange is NULL */ -celix_status_t versionRange_isHighInclusive(version_range_pt versionRange, bool *isHighInclusive); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t versionRange_isHighInclusive(version_range_pt versionRange, bool *isHighInclusive); /** * Retrieves whether the lower bound version from the given range @@ -111,7 +112,7 @@ celix_status_t versionRange_isHighInclusive(version_range_pt versionRange, bool * - CELIX_SUCCESS when no errors are encountered. * - CELIX_ILLEGAL_ARGUMENT in case the versionRange is NULL */ -celix_status_t versionRange_getLowVersion(version_range_pt versionRange, version_pt *lowVersion); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t versionRange_getLowVersion(version_range_pt versionRange, version_pt *lowVersion); /** * Retrieves whether the upper bound version from the given range @@ -122,7 +123,7 @@ celix_status_t versionRange_getLowVersion(version_range_pt versionRange, version * - CELIX_SUCCESS when no errors are encountered. * - CELIX_ILLEGAL_ARGUMENT in case the versionRange is NULL */ -celix_status_t versionRange_getHighVersion(version_range_pt versionRange, version_pt *highVersion); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t versionRange_getHighVersion(version_range_pt versionRange, version_pt *highVersion); /** * Parses a version range from the specified string. @@ -146,7 +147,7 @@ celix_status_t versionRange_getHighVersion(version_range_pt versionRange, versio * - CELIX_ILLEGAL_ARGUMENT If the numerical components are negative, * the qualifier string is invalid or <code>versionStr</code> is impropertly formatted. */ -celix_status_t versionRange_parse(const char *rangeStr, version_range_pt *range); +CELIX_UTILS_DEPRECATED_EXPORT celix_status_t versionRange_parse(const char *rangeStr, version_range_pt *range); /** * Returns the LDAP filter for a version range. Caller is owner of the returned string. @@ -155,7 +156,7 @@ celix_status_t versionRange_parse(const char *rangeStr, version_range_pt *range) * @param serviceVersionPropertyName The service version name to be used in the filter (i.e. service.version) * @return LDAP filter string if valid, NULL otherwise */ -char* versionRange_createLDAPFilter(version_range_pt range, const char *serviceVersionAttributeName); +CELIX_UTILS_DEPRECATED_EXPORT char* versionRange_createLDAPFilter(version_range_pt range, const char *serviceVersionAttributeName); /** * construct a LDAP filter for the provided version range. @@ -163,7 +164,7 @@ char* versionRange_createLDAPFilter(version_range_pt range, const char *serviceV * * @return True if parse successful, False otherwise. */ -bool versionRange_createLDAPFilterInPlace(version_range_pt range, const char *serviceVersionAttributeName, char* buffer, size_t bufferLength); +CELIX_UTILS_DEPRECATED_EXPORT bool versionRange_createLDAPFilterInPlace(version_range_pt range, const char *serviceVersionAttributeName, char* buffer, size_t bufferLength); #ifdef __cplusplus diff --git a/libs/utils/src/array_list_private.h b/libs/utils/src/array_list_private.h index ae9ed481..7219387d 100644 --- a/libs/utils/src/array_list_private.h +++ b/libs/utils/src/array_list_private.h @@ -28,6 +28,7 @@ #define array_list_t_PRIVATE_H_ #include "array_list.h" +#include "celix_utils_export.h" struct celix_array_list { celix_array_list_entry_t* elementData; @@ -51,7 +52,5 @@ struct celix_array_list_iterator { unsigned int expectedModificationCount; }; -void * arrayList_remove(array_list_pt list, unsigned int index); - #endif /* array_list_t_PRIVATE_H_ */ diff --git a/libs/utils/src/hash_map.c b/libs/utils/src/hash_map.c index 20a7df3e..40bcb0ed 100644 --- a/libs/utils/src/hash_map.c +++ b/libs/utils/src/hash_map.c @@ -359,7 +359,7 @@ hash_map_iterator_pt hashMapIterator_create(hash_map_pt map) { return iterator; } -UTILS_EXPORT hash_map_iterator_t hashMapIterator_construct(hash_map_pt map) { +hash_map_iterator_t hashMapIterator_construct(hash_map_pt map) { hash_map_iterator_t iter; memset(&iter, 0, sizeof(iter)); hashMapIterator_init(map, &iter); diff --git a/libs/utils/src/hash_map_private.h b/libs/utils/src/hash_map_private.h index be447113..da859e76 100644 --- a/libs/utils/src/hash_map_private.h +++ b/libs/utils/src/hash_map_private.h @@ -27,16 +27,17 @@ #ifndef HASH_MAP_PRIVATE_H_ #define HASH_MAP_PRIVATE_H_ -#include "exports.h" +#include "celix_utils_export.h" #include "hash_map.h" -UTILS_EXPORT unsigned int hashMap_hashCode(const void* toHash); -UTILS_EXPORT int hashMap_equals(const void* toCompare, const void* compare); +//note functions used for testing, so export is needed +CELIX_UTILS_EXPORT unsigned int hashMap_hashCode(const void* toHash); +CELIX_UTILS_EXPORT int hashMap_equals(const void* toCompare, const void* compare); -void hashMap_resize(hash_map_pt map, int newCapacity); -hash_map_entry_pt hashMap_removeEntryForKey(hash_map_pt map, const void* key); -UTILS_EXPORT hash_map_entry_pt hashMap_removeMapping(hash_map_pt map, hash_map_entry_pt entry); -void hashMap_addEntry(hash_map_pt map, int hash, void* key, void* value, int bucketIndex); +CELIX_UTILS_EXPORT void hashMap_resize(hash_map_pt map, int newCapacity); +CELIX_UTILS_EXPORT hash_map_entry_pt hashMap_removeEntryForKey(hash_map_pt map, const void* key); +CELIX_UTILS_EXPORT hash_map_entry_pt hashMap_removeMapping(hash_map_pt map, hash_map_entry_pt entry); +CELIX_UTILS_EXPORT void hashMap_addEntry(hash_map_pt map, int hash, void* key, void* value, int bucketIndex); struct hashMapEntry { void* key; diff --git a/libs/utils/src/linked_list.c b/libs/utils/src/linked_list.c index 3b16b56c..3bb0db8f 100644 --- a/libs/utils/src/linked_list.c +++ b/libs/utils/src/linked_list.c @@ -51,7 +51,7 @@ celix_status_t linkedList_create(linked_list_pt *list) { return CELIX_ENOMEM; } -UTILS_EXPORT celix_status_t linkedList_destroy(linked_list_pt list) { +celix_status_t linkedList_destroy(linked_list_pt list) { celix_status_t status = CELIX_SUCCESS; linked_list_entry_pt current = NULL;
