This is an automated email from the ASF dual-hosted git repository.
pengzheng pushed a commit to branch feature/527-manifest-improvement
in repository https://gitbox.apache.org/repos/asf/celix.git
The following commit(s) were added to
refs/heads/feature/527-manifest-improvement by this push:
new 844f3254 Remove dead code.
844f3254 is described below
commit 844f325404bfec3785c5a38a5b3cecf0d12eb21a
Author: PengZheng <[email protected]>
AuthorDate: Wed Aug 16 11:31:13 2023 +0800
Remove dead code.
---
libs/framework/CMakeLists.txt | 2 +-
libs/framework/src/attribute.c | 65 ----------------------------------
libs/framework/src/attribute.h | 40 ---------------------
libs/framework/src/attribute_private.h | 38 --------------------
libs/framework/src/capability.c | 1 -
libs/framework/src/manifest_parser.c | 1 -
libs/framework/src/requirement.c | 8 ++---
7 files changed, 4 insertions(+), 151 deletions(-)
diff --git a/libs/framework/CMakeLists.txt b/libs/framework/CMakeLists.txt
index 4eb80e9c..d6fd2177 100644
--- a/libs/framework/CMakeLists.txt
+++ b/libs/framework/CMakeLists.txt
@@ -23,7 +23,7 @@ if (FRAMEWORK)
find_package(CURL REQUIRED)
endif ()
set(FRAMEWORK_SRC
- src/attribute.c src/bundle.c src/bundle_archive.c
src/celix_bundle_cache.c
+ src/bundle.c src/bundle_archive.c src/celix_bundle_cache.c
src/bundle_context.c src/bundle_revision.c
src/framework.c src/manifest.c
src/manifest_parser.c src/module.c
diff --git a/libs/framework/src/attribute.c b/libs/framework/src/attribute.c
deleted file mode 100644
index 5a4313ea..00000000
--- a/libs/framework/src/attribute.c
+++ /dev/null
@@ -1,65 +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.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "attribute_private.h"
-#include "celix_log.h"
-
-celix_status_t attribute_create(char * key, char * value, attribute_pt
*attribute) {
- celix_status_t status = CELIX_SUCCESS;
- char *error = NULL;
-
- if (key == NULL || value == NULL || *attribute != NULL) {
- status = CELIX_ILLEGAL_ARGUMENT;
- error = "Missing required arguments and/or values";
- } else {
- attribute_pt attr = malloc(sizeof(*attr));
- if (!attr) {
- status = CELIX_ENOMEM;
- } else {
- attr->key = key;
- attr->value = value;
-
- *attribute = attr;
- }
- }
-
- framework_logIfError(celix_frameworkLogger_globalLogger(), status,
error, "Could not create attribute: [key=%s;value=%s]", key, value);
-
- return status;
-}
-
-celix_status_t attribute_destroy(attribute_pt attribute) {
- free(attribute->key);
- free(attribute->value);
- free(attribute);
- return CELIX_SUCCESS;
-}
-
-celix_status_t attribute_getKey(attribute_pt attribute, char **key) {
- *key = attribute->key;
- return CELIX_SUCCESS;
-}
-
-celix_status_t attribute_getValue(attribute_pt attribute, char **value) {
- *value = attribute->value;
- return CELIX_SUCCESS;
-}
diff --git a/libs/framework/src/attribute.h b/libs/framework/src/attribute.h
deleted file mode 100644
index 9e55fc5a..00000000
--- a/libs/framework/src/attribute.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.
- */
-/**
- * attribute.h
- *
- * \date Jul 27, 2010
- * \author <a href="mailto:[email protected]">Apache Celix
Project Team</a>
- * \copyright Apache License, Version 2.0
- */
-
-#ifndef ATTRIBUTE_H_
-#define ATTRIBUTE_H_
-
-#include "celix_errno.h"
-
-typedef struct attribute *attribute_pt;
-
-celix_status_t attribute_create(char * key, char * value, attribute_pt
*attribute);
-celix_status_t attribute_destroy(attribute_pt attribute);
-
-celix_status_t attribute_getKey(attribute_pt attribute, char **key);
-celix_status_t attribute_getValue(attribute_pt attribute, char **value);
-
-#endif /* ATTRIBUTE_H_ */
diff --git a/libs/framework/src/attribute_private.h
b/libs/framework/src/attribute_private.h
deleted file mode 100644
index 1bb903d8..00000000
--- a/libs/framework/src/attribute_private.h
+++ /dev/null
@@ -1,38 +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.
- */
-/**
- * attribute_private.h
- *
- * \date Feb 11, 2013
- * \author <a href="mailto:[email protected]">Apache Celix Project
Team</a>
- * \copyright Apache License, Version 2.0
- */
-
-#ifndef ATTRIBUTE_PRIVATE_H_
-#define ATTRIBUTE_PRIVATE_H_
-
-#include "attribute.h"
-
-struct attribute {
- char * key;
- char * value;
-};
-
-
-#endif /* ATTRIBUTE_PRIVATE_H_ */
diff --git a/libs/framework/src/capability.c b/libs/framework/src/capability.c
index dcf0acd2..333a141b 100644
--- a/libs/framework/src/capability.c
+++ b/libs/framework/src/capability.c
@@ -27,7 +27,6 @@
#include <stdlib.h>
#include "capability_private.h"
-#include "attribute.h"
#include "celix_log.h"
//LCOV_EXCL_START
diff --git a/libs/framework/src/manifest_parser.c
b/libs/framework/src/manifest_parser.c
index 51ff5379..af311374 100644
--- a/libs/framework/src/manifest_parser.c
+++ b/libs/framework/src/manifest_parser.c
@@ -33,7 +33,6 @@
#include "manifest_parser.h"
#include "capability.h"
#include "requirement.h"
-#include "attribute.h"
#include "hash_map.h"
#include "celix_errno.h"
#include "linked_list_iterator.h"
diff --git a/libs/framework/src/requirement.c b/libs/framework/src/requirement.c
index 032fed40..537fe3c7 100644
--- a/libs/framework/src/requirement.c
+++ b/libs/framework/src/requirement.c
@@ -24,12 +24,10 @@
* \copyright Apache License, Version 2.0
*/
-#include <stdlib.h>
-
-#include "requirement_private.h"
-#include "version_range.h"
-#include "attribute.h"
+#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) {