From 085b4ffc27807b01aaf989a771cf3779fbf98cad Mon Sep 17 00:00:00 2001 From: Pepijn Noltes Date: Sun, 15 Oct 2023 14:05:07 +0200 Subject: [PATCH] #509: Remove deprecated wire.c, requirement.c and capability.c --- libs/framework/CMakeLists.txt | 1 - libs/framework/include_deprecated/bundle.h | 1 - .../framework/include_deprecated/capability.h | 55 -------- libs/framework/include_deprecated/module.h | 2 - .../include_deprecated/requirement.h | 48 ------- libs/framework/include_deprecated/wire.h | 121 ------------------ libs/framework/src/capability.c | 54 -------- libs/framework/src/capability_private.h | 40 ------ libs/framework/src/framework_private.h | 1 - libs/framework/src/manifest_parser.c | 5 - libs/framework/src/module.c | 4 - libs/framework/src/requirement.c | 56 -------- libs/framework/src/requirement_private.h | 39 ------ libs/framework/src/wire.c | 67 ---------- 14 files changed, 494 deletions(-) delete mode 100644 libs/framework/include_deprecated/capability.h delete mode 100644 libs/framework/include_deprecated/requirement.h delete mode 100644 libs/framework/include_deprecated/wire.h delete mode 100644 libs/framework/src/capability.c delete mode 100644 libs/framework/src/capability_private.h delete mode 100644 libs/framework/src/requirement.c delete mode 100644 libs/framework/src/requirement_private.h delete mode 100644 libs/framework/src/wire.c diff --git a/libs/framework/CMakeLists.txt b/libs/framework/CMakeLists.txt index 7faa89c64..a1c749050 100644 --- a/libs/framework/CMakeLists.txt +++ b/libs/framework/CMakeLists.txt @@ -27,7 +27,6 @@ if (FRAMEWORK) src/bundle_context.c src/bundle_revision.c src/framework.c src/manifest.c src/manifest_parser.c src/module.c - src/requirement.c src/capability.c src/wire.c src/service_reference.c src/service_registration.c src/service_registry.c src/service_tracker.c src/service_tracker_customizer.c src/celix_log.c src/celix_launcher.c diff --git a/libs/framework/include_deprecated/bundle.h b/libs/framework/include_deprecated/bundle.h index cdc463dd4..c1d8cc445 100644 --- a/libs/framework/include_deprecated/bundle.h +++ b/libs/framework/include_deprecated/bundle.h @@ -26,7 +26,6 @@ #include "celix_bundle_state.h" #include "bundle_archive.h" #include "framework.h" -#include "wire.h" #include "module.h" #include "service_reference.h" #include "celix_log.h" diff --git a/libs/framework/include_deprecated/capability.h b/libs/framework/include_deprecated/capability.h deleted file mode 100644 index ada46bc36..000000000 --- a/libs/framework/include_deprecated/capability.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/** - * capability.h - * - * \date Jul 12, 2010 - * \author Apache Celix Project Team - * \copyright Apache License, Version 2.0 - */ - -#ifndef CAPABILITY_H_ -#define CAPABILITY_H_ - -typedef struct capability *capability_pt; - -#include "hash_map.h" -#include "module.h" -#include "celix_framework_export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t -capability_create(module_pt module, hash_map_pt directives, hash_map_pt attributes, capability_pt *capability); - -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t capability_destroy(capability_pt capability); - -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t capability_getServiceName(capability_pt capability, const char **serviceName); - -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t capability_getVersion(capability_pt capability, version_pt *version); - -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t capability_getModule(capability_pt capability, module_pt *module); - -#ifdef __cplusplus -} -#endif - -#endif /* CAPABILITY_H_ */ diff --git a/libs/framework/include_deprecated/module.h b/libs/framework/include_deprecated/module.h index 6bd94f8c6..3c09f666e 100644 --- a/libs/framework/include_deprecated/module.h +++ b/libs/framework/include_deprecated/module.h @@ -53,8 +53,6 @@ CELIX_FRAMEWORK_DEPRECATED_EXPORT unsigned int module_hash(void *module); CELIX_FRAMEWORK_DEPRECATED_EXPORT int module_equals(void *module, void *compare); -CELIX_FRAMEWORK_DEPRECATED_EXPORT wire_pt module_getWire(module_pt module, const char *serviceName); - CELIX_FRAMEWORK_DEPRECATED_EXPORT version_pt module_getVersion(module_pt module); CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t module_getSymbolicName(module_pt module, const char **symbolicName); diff --git a/libs/framework/include_deprecated/requirement.h b/libs/framework/include_deprecated/requirement.h deleted file mode 100644 index 186797888..000000000 --- a/libs/framework/include_deprecated/requirement.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#ifndef REQUIREMENT_H_ -#define REQUIREMENT_H_ - -typedef struct requirement *requirement_pt; - -#include "capability.h" -#include "hash_map.h" -#include "celix_version_range.h" -#include "celix_framework_export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t requirement_create(hash_map_pt directives, hash_map_pt attributes, requirement_pt *requirement); - -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t requirement_destroy(requirement_pt requirement); - -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t requirement_getVersionRange(requirement_pt requirement, celix_version_range_t **range); - -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t requirement_getTargetName(requirement_pt requirement, const char **targetName); - -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t requirement_isSatisfied(requirement_pt requirement, capability_pt capability, bool *inRange); - -#ifdef __cplusplus -} -#endif - -#endif /* REQUIREMENT_H_ */ diff --git a/libs/framework/include_deprecated/wire.h b/libs/framework/include_deprecated/wire.h deleted file mode 100644 index 29c41d9ef..000000000 --- a/libs/framework/include_deprecated/wire.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/** - * wire.h - * - * \date Jul 12, 2010 - * \author Apache Celix Project Team - * \copyright Apache License, Version 2.0 - */ - -#ifndef WIRE_H_ -#define WIRE_H_ - -typedef struct wire *wire_pt; - -#include "requirement.h" -#include "capability.h" -#include "module.h" -#include "linked_list.h" -#include "module.h" -#include "celix_framework_export.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup Version Version - * @ingroup framework - * @{ - */ - -/** - * Create a wire between two modules using a requirement and capability. - * - * @param importer The importer module of the wire. - * @param requirement The requirement of the importer. - * @param exporter The exporter module of the wire. - * @param capability The capability of the wire. - * @param wire The created wire. - * @return Status code indication failure or success: - * - CELIX_SUCCESS when no errors are encountered. - * - CELIX_ENOMEM If allocating memory for wire failed. - */ -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t wire_create(module_pt importer, requirement_pt requirement, - module_pt exporter, capability_pt capability, wire_pt *wire); - -/** - * Getter for the capability of the exporting module. - * - * @param wire The wire to get the capability from. - * @param capability The capability - * @return Status code indication failure or success: - * - CELIX_SUCCESS when no errors are encountered. - */ -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t wire_destroy(wire_pt wire); - -/** - * Getter for the capability of the exporting module. - * - * @param wire The wire to get the capability from. - * @param capability The capability - * @return Status code indication failure or success: - * - CELIX_SUCCESS when no errors are encountered. - */ -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t wire_getCapability(wire_pt wire, capability_pt *capability); - -/** - * Getter for the requirement of the importing module. - * - * @param wire The wire to get the requirement from. - * @param requirement The requirement - * @return Status code indication failure or success: - * - CELIX_SUCCESS when no errors are encountered. - */ -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t wire_getRequirement(wire_pt wire, requirement_pt *requirement); - -/** - * Getter for the importer of the wire. - * - * @param wire The wire to get the importer from. - * @param importer The importing module. - * @return Status code indication failure or success: - * - CELIX_SUCCESS when no errors are encountered. - */ -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t wire_getImporter(wire_pt wire, module_pt *importer); - -/** - * Getter for the exporter of the wire. - * - * @param wire The wire to get the exporter from. - * @param exporter The exporting module. - * @return Status code indication failure or success: - * - CELIX_SUCCESS when no errors are encountered. - */ -CELIX_FRAMEWORK_DEPRECATED_EXPORT celix_status_t wire_getExporter(wire_pt wire, module_pt *exporter); - -/** - * @} - */ -#ifdef __cplusplus -} -#endif - -#endif /* WIRE_H_ */ diff --git a/libs/framework/src/capability.c b/libs/framework/src/capability.c deleted file mode 100644 index 333a141b5..000000000 --- a/libs/framework/src/capability.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/** - * capability.c - * - * \date Jul 12, 2010 - * \author Apache Celix Project Team - * \copyright Apache License, Version 2.0 - */ - -#include - -#include "capability_private.h" -#include "celix_log.h" - -//LCOV_EXCL_START -celix_status_t capability_create(module_pt module, hash_map_pt directives, hash_map_pt attributes, capability_pt *capability) { - celix_status_t status = CELIX_FRAMEWORK_EXCEPTION; - framework_logIfError(celix_frameworkLogger_globalLogger(), status, NULL, "Failed to create capability"); - return status; -} - -celix_status_t capability_destroy(capability_pt capability) { - return CELIX_FRAMEWORK_EXCEPTION; -} - -celix_status_t capability_getServiceName(capability_pt capability, const char **serviceName) { - return CELIX_FRAMEWORK_EXCEPTION; -} - -celix_status_t capability_getVersion(capability_pt capability, version_pt *version) { - return CELIX_FRAMEWORK_EXCEPTION; -} - -celix_status_t capability_getModule(capability_pt capability, module_pt *module) { - return CELIX_FRAMEWORK_EXCEPTION; -} -//LCOV_EXCL_STOP diff --git a/libs/framework/src/capability_private.h b/libs/framework/src/capability_private.h deleted file mode 100644 index d226bb36d..000000000 --- a/libs/framework/src/capability_private.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/** - * capability_private.h - * - * \date Feb 11, 2013 - * \author Apache Celix Project Team - * \copyright Apache License, Version 2.0 - */ - -#ifndef CAPABILITY_PRIVATE_H_ -#define CAPABILITY_PRIVATE_H_ - -#include "capability.h" - -struct capability { - char * serviceName; - module_pt module; - version_pt version; - hash_map_pt attributes; - hash_map_pt directives; -}; - -#endif /* CAPABILITY_PRIVATE_H_ */ diff --git a/libs/framework/src/framework_private.h b/libs/framework/src/framework_private.h index 0b1a9a78b..6e6cd7a2f 100644 --- a/libs/framework/src/framework_private.h +++ b/libs/framework/src/framework_private.h @@ -25,7 +25,6 @@ #include "celix_framework.h" #include "framework.h" #include "manifest.h" -#include "wire.h" #include "hash_map.h" #include "array_list.h" #include "celix_errno.h" diff --git a/libs/framework/src/manifest_parser.c b/libs/framework/src/manifest_parser.c index af3113741..479f094c8 100644 --- a/libs/framework/src/manifest_parser.c +++ b/libs/framework/src/manifest_parser.c @@ -27,15 +27,10 @@ #include #include -#include "utils.h" #include "celix_utils.h" #include "celix_constants.h" #include "manifest_parser.h" -#include "capability.h" -#include "requirement.h" -#include "hash_map.h" #include "celix_errno.h" -#include "linked_list_iterator.h" #include "celix_log.h" struct manifestParser { diff --git a/libs/framework/src/module.c b/libs/framework/src/module.c index 78d2641b7..0ff490574 100644 --- a/libs/framework/src/module.c +++ b/libs/framework/src/module.c @@ -139,10 +139,6 @@ void module_destroy(module_pt module) { free(module); } -wire_pt module_getWire(module_pt module, const char * serviceName) { - return NULL; -} - version_pt module_getVersion(module_pt module) { return module->version; } diff --git a/libs/framework/src/requirement.c b/libs/framework/src/requirement.c deleted file mode 100644 index 537fe3c7b..000000000 --- a/libs/framework/src/requirement.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/** - * requirement.c - * - * \date Jul 12, 2010 - * \author Apache Celix Project Team - * \copyright Apache License, Version 2.0 - */ - -#include "celix_errno.h" -#include "celix_log.h" -#include "requirement_private.h" -#include "hash_map.h" - -//LCOV_EXCL_START -celix_status_t requirement_create(hash_map_pt directives, hash_map_pt attributes, requirement_pt *requirement) { - celix_status_t status = CELIX_FRAMEWORK_EXCEPTION; - framework_logIfError(celix_frameworkLogger_globalLogger(), status, NULL, "Cannot create requirement"); - return status; -} - -celix_status_t requirement_destroy(requirement_pt requirement) { - return CELIX_FRAMEWORK_EXCEPTION; -} - -celix_status_t requirement_getVersionRange(requirement_pt requirement, celix_version_range_t **range) { - return CELIX_FRAMEWORK_EXCEPTION; -} - -celix_status_t requirement_getTargetName(requirement_pt requirement, const char **targetName) { - return CELIX_FRAMEWORK_EXCEPTION; -} - -celix_status_t requirement_isSatisfied(requirement_pt requirement, capability_pt capability, bool *inRange) { - celix_status_t status = CELIX_FRAMEWORK_EXCEPTION; - framework_logIfError(celix_frameworkLogger_globalLogger(), status, NULL, "Cannot check if requirement is satisfied"); - return status; -} -//LCOV_EXCL_STOP diff --git a/libs/framework/src/requirement_private.h b/libs/framework/src/requirement_private.h deleted file mode 100644 index 3ac8d5114..000000000 --- a/libs/framework/src/requirement_private.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/** - * requirement_private.h - * - * \date Feb 11, 2013 - * \author Apache Celix Project Team - * \copyright Apache License, Version 2.0 - */ - -#ifndef REQUIREMENT_PRIVATE_H_ -#define REQUIREMENT_PRIVATE_H_ - -#include "requirement.h" - -struct requirement { - char * targetName; - celix_version_range_t* versionRange; - hash_map_pt attributes; - hash_map_pt directives; -}; - -#endif /* REQUIREMENT_PRIVATE_H_ */ diff --git a/libs/framework/src/wire.c b/libs/framework/src/wire.c deleted file mode 100644 index ae13dd8f6..000000000 --- a/libs/framework/src/wire.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/** - * wire.c - * - * \date Jul 19, 2010 - * \author Apache Celix Project Team - * \copyright Apache License, Version 2.0 - */ - -#include - -#include "wire.h" - -struct wire { - module_pt importer; - requirement_pt requirement; - module_pt exporter; - capability_pt capability; -}; - -//LCOV_EXCL_START -celix_status_t wire_create( - module_pt importer, requirement_pt requirement, module_pt exporter, capability_pt capability, wire_pt* wire) { - celix_status_t status = CELIX_FRAMEWORK_EXCEPTION; - - framework_logIfError(celix_frameworkLogger_globalLogger(), status, NULL, "Cannot create wire"); - - return status; -} - -celix_status_t wire_destroy(wire_pt wire) { - return CELIX_FRAMEWORK_EXCEPTION; -} - -celix_status_t wire_getCapability(wire_pt wire, capability_pt *capability) { - return CELIX_FRAMEWORK_EXCEPTION; -} - -celix_status_t wire_getRequirement(wire_pt wire, requirement_pt *requirement) { - return CELIX_FRAMEWORK_EXCEPTION; -} - -celix_status_t wire_getImporter(wire_pt wire, module_pt *importer) { - return CELIX_FRAMEWORK_EXCEPTION; -} - -celix_status_t wire_getExporter(wire_pt wire, module_pt *exporter) { - return CELIX_FRAMEWORK_EXCEPTION; -} -//LCOV_EXCL_STOP