pnoltes commented on code in PR #765: URL: https://github.com/apache/celix/pull/765#discussion_r1835724017
########## libs/framework/src/celix_bundle_manifest.h: ########## @@ -0,0 +1,191 @@ +/* + * 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 CELIX_MANIFEST_H_ +#define CELIX_MANIFEST_H_ + +#include "celix_array_list.h" +#include "celix_cleanup.h" +#include "celix_errno.h" +#include "celix_properties_type.h" +#include "celix_version_type.h" +#include "celix_array_list_type.h" +#include "celix_bundle_manifest_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file celix_bundle_manifest.h + * @brief Header file for celix_bundle_manifest_t. + * + * + * The bundle manifest consists of a set of attributes, including a set of mandatory attributes. + * A bundle manifest is used to describe the contents of a bundle. + * + * A bundle manifest must contain the following attributes: + * - CELIX_BUNDLE_MANIFEST_VERSION, type celix_version_t, the version of the manifest. + * - CELIX_BUNDLE_SYMBOLIC_NAME, type string, the symbolic name of the bundle. + * - CELIX_BUNDLE_VERSION, type celix_version_t, the version of the bundle. + * - CELIX_BUNDLE_NAME, type string, the name of the bundle. + * + * The bundle manifest may contain the following attributes: + * - CELIX_BUNDLE_ACTIVATOR_LIBRARY, type string, the activator library of the bundle. + * - CELIX_BUNDLE_PRIVATE_LIBRARIES, type string array, the private libraries of the bundle. + * - CELIX_BUNDLE_GROUP, type string, the group of the bundle. Helps in grouping sets of bundles. + * + * And a manifest may contain any other attributes of any type, this can be retrieved using + * celix_bundleManifest_getAttributes. + * + * A bundle symbolic name can only contain the following characters: [a-zA-Z0-9_-:] + */ + +/** + * Create a new manifest using the provided properties. + * + * If an error occurs, an error message is logged on celix_err and in case of an CELIX_ILLEGAL_ARGUMENT error, there + * can be multiple error messages. + * + * @param[in] properties The properties to use for the manifest. Takes ownership of the properties. + * @param[out] manifest The created manifest. + * @return CELIX_SUCCESS if no errors occurred, ENOMEM if memory allocation failed and CELIX_ILLEGAL_ARGUMENT if the + * provided attributes is incorrect. In case of an error, the provided attributes are destroyed. + */ +celix_status_t celix_bundleManifest_create(celix_properties_t* attributes, celix_bundle_manifest_t** manifest); + +/** + * Create a new manifest by reading the manifest from the provided file. + * + * If an error occurs, an error message is logged on celix_err. + * + * @param[in] filename The file to read the manifest from. + * @param[out] manifest The created manifest. + * @return CELIX_SUCCESS if no errors occurred, ENOMEM if memory allocation failed, CELIX_FILE_IO_EXCEPTION if the file + * could not be read and CELIX_ILLEGAL_ARGUMENT if the manifest file is invalid. Review Comment: Updated to CELIX_INVALID_SYNTAX. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org