Skip to content
Open
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: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ limitations under the License.
- linked_list.h is removed and no longer supported. Use celix_array_list.h instead.
- ip_utils.h is removed and no longer supported.
- array_list.h is removed and no longer supported. Use celix_array_list.h instead.
- utils.h is removed and no longer supported. Use celix_utils.h instead.
- export.h is removed and no longer supported.
- celix_utils_api.h is removed and no longer supported.
- the celix_arrayList_add function no longer accepts a NULL value.
- version.h and version_range.h are removed and no longer supported. Use celix_version.h and celix_version_range.h
instead.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "bundle_context.h"
#include "celix_log_helper.h"
#include "celix_utils.h"
#include "utils.h"

#include "endpoint_descriptor_reader.h"
#include "discovery.h"
Expand Down Expand Up @@ -95,7 +94,11 @@ celix_status_t endpointDiscoveryPoller_create(discovery_t *discovery, celix_bund
(*poller)->poll_timeout = atoi(timeout);
(*poller)->discovery = discovery;
(*poller)->running = false;
(*poller)->entries = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL);
(*poller)->entries = hashMap_create(
(unsigned int (*)(const void*))celix_utils_stringHash,
NULL,
(int (*)(const void*, const void*))celix_utils_stringEquals,
NULL);

const char* sep = ",";
char *save_ptr = NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "civetweb.h"
#include "celix_errno.h"
#include "celix_utils.h"
#include "utils.h"
#include "celix_log_helper.h"
#include "discovery.h"
#include "endpoint_descriptor_writer.h"
Expand Down Expand Up @@ -87,7 +86,11 @@ celix_status_t endpointDiscoveryServer_create(discovery_t *discovery,
}

(*server)->loghelper = &discovery->loghelper;
(*server)->entries = hashMap_create(&utils_stringHash, NULL, &utils_stringEquals, NULL);
(*server)->entries = hashMap_create(
(unsigned int (*)(const void*))celix_utils_stringHash,
NULL,
(int (*)(const void*, const void*))celix_utils_stringEquals,
NULL);
if (!(*server)->entries) {
return CELIX_ENOMEM;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include "celix_threads.h"
#include "bundle_context.h"
#include "utils.h"
#include "celix_utils.h"
#include "celix_log_helper.h"

#include "discovery.h"
Expand All @@ -52,7 +52,11 @@ celix_status_t discovery_create(celix_bundle_context_t *context, discovery_t **d
(*discovery)->stopped = false;

(*discovery)->listenerReferences = hashMap_create(serviceReference_hashCode, NULL, serviceReference_equals2, NULL);
(*discovery)->discoveredServices = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL);
(*discovery)->discoveredServices = hashMap_create(
(unsigned int (*)(const void*))celix_utils_stringHash,
NULL,
(int (*)(const void*, const void*))celix_utils_stringEquals,
NULL);

celixThreadMutex_create(&(*discovery)->mutex, NULL);

Expand Down
9 changes: 6 additions & 3 deletions bundles/remote_services/discovery_etcd/src/discovery_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include "celix_threads.h"
#include "bundle_context.h"
#include "utils.h"
#include "celix_utils.h"
#include "celix_errno.h"
#include "filter.h"
#include "service_reference.h"
Expand Down Expand Up @@ -56,7 +56,11 @@ celix_status_t discovery_create(celix_bundle_context_t *context, discovery_t** o

discovery->listenerReferences = hashMap_create(serviceReference_hashCode, NULL, serviceReference_equals2,
NULL);
discovery->discoveredServices = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL);
discovery->discoveredServices = hashMap_create(
(unsigned int (*)(const void*))celix_utils_stringHash,
NULL,
(int (*)(const void*, const void*))celix_utils_stringEquals,
NULL);

celixThreadMutex_create(&discovery->mutex, NULL);

Expand Down Expand Up @@ -175,4 +179,3 @@ celix_status_t discovery_stop(discovery_t *discovery) {
}



9 changes: 6 additions & 3 deletions bundles/remote_services/discovery_etcd/src/etcd_watcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "celix_api.h"
#include "celix_log_helper.h"
#include "utils.h"
#include "celix_utils.h"
#include "discovery.h"
#include "discovery_impl.h"

Expand Down Expand Up @@ -293,7 +293,11 @@ celix_status_t etcdWatcher_create(discovery_t *discovery, celix_bundle_context_t
{
(*watcher)->discovery = discovery;
(*watcher)->loghelper = &discovery->loghelper;
(*watcher)->entries = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL);
(*watcher)->entries = hashMap_create(
(unsigned int (*)(const void*))celix_utils_stringHash,
NULL,
(int (*)(const void*, const void*))celix_utils_stringEquals,
NULL);
(*watcher)->ttl = DEFAULT_ETCD_TTL;
}

Expand Down Expand Up @@ -352,4 +356,3 @@ celix_status_t etcdWatcher_destroy(etcd_watcher_t *watcher) {

return status;
}

Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

#include <jansson.h>
#include "json_serializer.h"
#include "utils.h"
#include "celix_utils.h"
#include "celix_threads.h"
#include "celix_ref.h"
#include "hash_map.h"

Expand Down Expand Up @@ -1159,4 +1159,3 @@ static size_t remoteServiceAdmin_write(void *contents, size_t size, size_t nmemb
fwrite(contents, size, nmemb, get->stream);
return size * nmemb;
}

8 changes: 6 additions & 2 deletions bundles/remote_services/topology_manager/src/scope.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "scope.h"
#include "tm_scope.h"
#include "topology_manager.h"
#include "utils.h"
#include "celix_utils.h"
#include "filter.h"

static bool import_equal(celix_array_list_entry_t src, celix_array_list_entry_t dest);
Expand Down Expand Up @@ -198,7 +198,11 @@ celix_status_t scope_scopeCreate(void *handle, scope_pt *scope) {
celixThreadMutex_create(&(*scope)->exportScopeLock, NULL);
celixThreadMutex_create(&(*scope)->importScopeLock, NULL);

(*scope)->exportScopes = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL);
(*scope)->exportScopes = hashMap_create(
(unsigned int (*)(const void*))celix_utils_stringHash,
NULL,
(int (*)(const void*, const void*))celix_utils_stringEquals,
NULL);
celix_array_list_create_options_t opts = CELIX_EMPTY_ARRAY_LIST_CREATE_OPTIONS;
opts.equalsCallback = import_equal;
(*scope)->importScopes = celix_arrayList_createWithOptions(&opts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include "remote_constants.h"
#include "filter.h"
#include "listener_hook_service.h"
#include "utils.h"
#include "celix_utils.h"
#include "service_reference.h"
#include "service_registration.h"
#include "celix_log_helper.h"
Expand Down
7 changes: 5 additions & 2 deletions bundles/shell/shell/src/c_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "celix_utils.h"
#include "celix_errno.h"
#include "shell_private.h"
#include "utils.h"

shell_t* shell_create(celix_bundle_context_t *ctx) {
shell_t *shell = calloc(1, sizeof(*shell));
Expand All @@ -35,7 +34,11 @@ shell_t* shell_create(celix_bundle_context_t *ctx) {
shell->logHelper = celix_logHelper_create(ctx, "celix_shell");

celixThreadRwlock_create(&shell->lock, NULL);
shell->commandServices = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL);
shell->commandServices = hashMap_create(
(unsigned int (*)(const void*))celix_utils_stringHash,
NULL,
(int (*)(const void*, const void*))celix_utils_stringEquals,
NULL);

return shell;
}
Expand Down
13 changes: 5 additions & 8 deletions libs/framework/include/celix_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,14 @@
#ifndef CELIX_CELIX_API_H_
#define CELIX_CELIX_API_H_

#include "celix_properties.h"
#include "celix_array_list.h"

#include "celix_bundle.h"
#include "celix_bundle_context.h"
#include "celix_framework.h"

#include "celix_properties.h"
#include "celix_array_list.h"
#include "celix_constants.h"
#include "celix_utils_api.h"
#include "celix_errno.h"
#include "celix_threads.h"
#include "celix_utils.h"
#include "celix_version.h"
#include "celix_version_range.h"
#include "celix_bundle.h"
#include "celix_bundle_context.h"

Expand Down
1 change: 1 addition & 0 deletions libs/framework/include_deprecated/service_registration.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <stdbool.h>

#include "celix_errno.h"
#include "celix_types.h"
#include "celix_properties_type.h"
#include "celix_framework_export.h"
Expand Down
2 changes: 1 addition & 1 deletion libs/framework/src/bundle.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#include "celix_properties.h"
#include "celix_properties_type.h"
#include "framework_private.h"
#include "utils.h"
#include "celix_file_utils.h"
#include "bundle_context_private.h"
#include "service_tracker_private.h"
#include "celix_utils.h"

#include <stdlib.h>
#include <string.h>
Expand Down
3 changes: 1 addition & 2 deletions libs/framework/src/bundle_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <utils.h>
#include <assert.h>
#include <unistd.h>
#include <stdarg.h>
Expand Down Expand Up @@ -1779,4 +1778,4 @@ void celix_bundleContext_vlog(const celix_bundle_context_t *ctx, celix_log_level

void celix_bundleContext_logTssErrors(const celix_bundle_context_t *ctx, celix_log_level_e level) {
celix_framework_logTssErrors(ctx->framework->logger, level);
}
}
9 changes: 6 additions & 3 deletions libs/framework/src/framework.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#include "framework_private.h"
#include "service_reference_private.h"
#include "service_registration_private.h"
#include "utils.h"
#include "celix_utils.h"
#include "celix_bundle_archive.h"

struct celix_bundle_activator {
Expand Down Expand Up @@ -243,7 +243,11 @@ celix_status_t framework_create(framework_pt *out, celix_properties_t* config) {
celixThreadCondition_init(&framework->dispatcher.cond, NULL);
framework->dispatcher.active = true;
framework->currentBundleId = CELIX_FRAMEWORK_BUNDLE_ID;
framework->installRequestMap = hashMap_create(utils_stringHash, utils_stringHash, utils_stringEquals, utils_stringEquals);
framework->installRequestMap = hashMap_create(
(unsigned int (*)(const void*))celix_utils_stringHash,
(unsigned int (*)(const void*))celix_utils_stringHash,
(int (*)(const void*, const void*))celix_utils_stringEquals,
(int (*)(const void*, const void*))celix_utils_stringEquals);
framework->installedBundles.entries = celix_arrayList_create();
framework->configurationMap = config; //note form now on celix_framework_getConfigProperty* can be used
framework->bundleListeners = celix_arrayList_create();
Expand Down Expand Up @@ -2717,4 +2721,3 @@ void celix_framework_waitForStop(celix_framework_t *framework) {

celixThreadMutex_unlock(&framework->shutdown.mutex);
}

1 change: 0 additions & 1 deletion libs/framework/src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "celix_module.h"
#include "celix_utils.h"
#include "framework_private.h"
#include "utils.h"
#include "celix_bundle_private.h"

#ifdef __linux__
Expand Down
2 changes: 1 addition & 1 deletion libs/framework/src/service_reference.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <utils.h>
#include <celix_utils.h>
#include <assert.h>

#include "service_reference.h"
Expand Down
12 changes: 10 additions & 2 deletions libs/utils/benchmark/src/StringHashmapBenchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,20 @@
#include "celix_string_hash_map.h"
#include "celix_hash_map_internal.h"
#include "celix_properties_internal.h"
#include "utils.h"
#include "celix_utils.h"

class StringHashmapBenchmark {
public:
explicit StringHashmapBenchmark(int64_t _nrOfEntries) : testVectorsMap{createRandomMap(_nrOfEntries)} {
deprecatedHashMap = hashMap_create(utils_stringHash, nullptr, utils_stringEquals, nullptr);
deprecatedHashMap = hashMap_create(
reinterpret_cast<unsigned int (*)(const void*)>(celix_utils_stringHash),
nullptr,
[](const void* keyA, const void* keyB) -> int
{
auto equal = celix_utils_stringEquals(static_cast<const char*>(keyA), static_cast<const char*>(keyB));
return equal ? 1 : 0;
},
nullptr);
celix_string_hash_map_create_options_t opts{};
opts.storeKeysWeakly = true; //ensure that the celix hash map does not copy strings (we don't want to measure that).
celixHashMap = celix_stringHashMap_createWithOptions(&opts);
Expand Down
Loading
Loading