Skip to content

Commit 63d5302

Browse files
committed
gh-509: Remove deprecated utils, celixbool, export and celix_utils_api header
Also refactor code using the removed depecrated headers
1 parent 78dadfa commit 63d5302

File tree

32 files changed

+96
-276
lines changed

32 files changed

+96
-276
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ limitations under the License.
5858
- linked_list.h is removed and no longer supported. Use celix_array_list.h instead.
5959
- ip_utils.h is removed and no longer supported.
6060
- array_list.h is removed and no longer supported. Use celix_array_list.h instead.
61+
- utils.h is removed and no longer supported. Use celix_utils.h instead.
62+
- export.h is removed and no longer supported.
63+
- celix_utils_api.h is removed and no longer supported.
6164
- the celix_arrayList_add function no longer accepts a NULL value.
6265
- version.h and version_range.h are removed and no longer supported. Use celix_version.h and celix_version_range.h
6366
instead.

bundles/remote_services/discovery_common/src/endpoint_discovery_poller.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include "bundle_context.h"
3636
#include "celix_log_helper.h"
3737
#include "celix_utils.h"
38-
#include "utils.h"
3938

4039
#include "endpoint_descriptor_reader.h"
4140
#include "discovery.h"
@@ -95,7 +94,11 @@ celix_status_t endpointDiscoveryPoller_create(discovery_t *discovery, celix_bund
9594
(*poller)->poll_timeout = atoi(timeout);
9695
(*poller)->discovery = discovery;
9796
(*poller)->running = false;
98-
(*poller)->entries = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL);
97+
(*poller)->entries = hashMap_create(
98+
(unsigned int (*)(const void*))celix_utils_stringHash,
99+
NULL,
100+
(int (*)(const void*, const void*))celix_utils_stringEquals,
101+
NULL);
99102

100103
const char* sep = ",";
101104
char *save_ptr = NULL;

bundles/remote_services/discovery_common/src/endpoint_discovery_server.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "civetweb.h"
2828
#include "celix_errno.h"
2929
#include "celix_utils.h"
30-
#include "utils.h"
3130
#include "celix_log_helper.h"
3231
#include "discovery.h"
3332
#include "endpoint_descriptor_writer.h"
@@ -87,7 +86,11 @@ celix_status_t endpointDiscoveryServer_create(discovery_t *discovery,
8786
}
8887

8988
(*server)->loghelper = &discovery->loghelper;
90-
(*server)->entries = hashMap_create(&utils_stringHash, NULL, &utils_stringEquals, NULL);
89+
(*server)->entries = hashMap_create(
90+
(unsigned int (*)(const void*))celix_utils_stringHash,
91+
NULL,
92+
(int (*)(const void*, const void*))celix_utils_stringEquals,
93+
NULL);
9194
if (!(*server)->entries) {
9295
return CELIX_ENOMEM;
9396
}

bundles/remote_services/discovery_configured/src/discovery_impl.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#include "celix_threads.h"
3333
#include "bundle_context.h"
34-
#include "utils.h"
34+
#include "celix_utils.h"
3535
#include "celix_log_helper.h"
3636

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

5454
(*discovery)->listenerReferences = hashMap_create(serviceReference_hashCode, NULL, serviceReference_equals2, NULL);
55-
(*discovery)->discoveredServices = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL);
55+
(*discovery)->discoveredServices = hashMap_create(
56+
(unsigned int (*)(const void*))celix_utils_stringHash,
57+
NULL,
58+
(int (*)(const void*, const void*))celix_utils_stringEquals,
59+
NULL);
5660

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

bundles/remote_services/discovery_etcd/src/discovery_impl.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#include "celix_threads.h"
2929
#include "bundle_context.h"
30-
#include "utils.h"
30+
#include "celix_utils.h"
3131
#include "celix_errno.h"
3232
#include "filter.h"
3333
#include "service_reference.h"
@@ -56,7 +56,11 @@ celix_status_t discovery_create(celix_bundle_context_t *context, discovery_t** o
5656

5757
discovery->listenerReferences = hashMap_create(serviceReference_hashCode, NULL, serviceReference_equals2,
5858
NULL);
59-
discovery->discoveredServices = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL);
59+
discovery->discoveredServices = hashMap_create(
60+
(unsigned int (*)(const void*))celix_utils_stringHash,
61+
NULL,
62+
(int (*)(const void*, const void*))celix_utils_stringEquals,
63+
NULL);
6064

6165
celixThreadMutex_create(&discovery->mutex, NULL);
6266

@@ -175,4 +179,3 @@ celix_status_t discovery_stop(discovery_t *discovery) {
175179
}
176180

177181

178-

bundles/remote_services/discovery_etcd/src/etcd_watcher.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include "celix_api.h"
2626
#include "celix_log_helper.h"
27-
#include "utils.h"
27+
#include "celix_utils.h"
2828
#include "discovery.h"
2929
#include "discovery_impl.h"
3030

@@ -293,7 +293,11 @@ celix_status_t etcdWatcher_create(discovery_t *discovery, celix_bundle_context_t
293293
{
294294
(*watcher)->discovery = discovery;
295295
(*watcher)->loghelper = &discovery->loghelper;
296-
(*watcher)->entries = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL);
296+
(*watcher)->entries = hashMap_create(
297+
(unsigned int (*)(const void*))celix_utils_stringHash,
298+
NULL,
299+
(int (*)(const void*, const void*))celix_utils_stringEquals,
300+
NULL);
297301
(*watcher)->ttl = DEFAULT_ETCD_TTL;
298302
}
299303

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

353357
return status;
354358
}
355-

bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232

3333
#include <jansson.h>
3434
#include "json_serializer.h"
35-
#include "utils.h"
3635
#include "celix_utils.h"
36+
#include "celix_threads.h"
3737
#include "celix_ref.h"
3838
#include "hash_map.h"
3939

@@ -1159,4 +1159,3 @@ static size_t remoteServiceAdmin_write(void *contents, size_t size, size_t nmemb
11591159
fwrite(contents, size, nmemb, get->stream);
11601160
return size * nmemb;
11611161
}
1162-

bundles/remote_services/topology_manager/src/scope.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "scope.h"
2424
#include "tm_scope.h"
2525
#include "topology_manager.h"
26-
#include "utils.h"
26+
#include "celix_utils.h"
2727
#include "filter.h"
2828

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

201-
(*scope)->exportScopes = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL);
201+
(*scope)->exportScopes = hashMap_create(
202+
(unsigned int (*)(const void*))celix_utils_stringHash,
203+
NULL,
204+
(int (*)(const void*, const void*))celix_utils_stringEquals,
205+
NULL);
202206
celix_array_list_create_options_t opts = CELIX_EMPTY_ARRAY_LIST_CREATE_OPTIONS;
203207
opts.equalsCallback = import_equal;
204208
(*scope)->importScopes = celix_arrayList_createWithOptions(&opts);

bundles/remote_services/topology_manager/src/topology_manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#include "remote_constants.h"
4444
#include "filter.h"
4545
#include "listener_hook_service.h"
46-
#include "utils.h"
46+
#include "celix_utils.h"
4747
#include "service_reference.h"
4848
#include "service_registration.h"
4949
#include "celix_log_helper.h"

bundles/shell/shell/src/c_shell.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "celix_utils.h"
2727
#include "celix_errno.h"
2828
#include "shell_private.h"
29-
#include "utils.h"
3029

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

3736
celixThreadRwlock_create(&shell->lock, NULL);
38-
shell->commandServices = hashMap_create(utils_stringHash, NULL, utils_stringEquals, NULL);
37+
shell->commandServices = hashMap_create(
38+
(unsigned int (*)(const void*))celix_utils_stringHash,
39+
NULL,
40+
(int (*)(const void*, const void*))celix_utils_stringEquals,
41+
NULL);
3942

4043
return shell;
4144
}

0 commit comments

Comments
 (0)