Skip to content

Commit

Permalink
Merge branch 'master' into feature/509-remove-deprecated-version
Browse files Browse the repository at this point in the history
# Conflicts:
#	libs/framework/include_deprecated/module.h
#	libs/utils/include_deprecated/celix_utils_api.h
  • Loading branch information
pnoltes committed Jan 4, 2024
2 parents 63fa8b1 + 7259275 commit 65f53a1
Show file tree
Hide file tree
Showing 92 changed files with 1,122 additions and 4,063 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
-o celix:enable_testing_on_ci=True
-o celix:enable_ccache=True
run: |
conan install . celix/ci -pr:b default -pr:h default -if build ${CONAN_BUILD_OPTIONS} -b missing -b cpputest --require-override=openssl/1.1.1s
conan install . celix/ci -pr:b default -pr:h default -if build ${CONAN_BUILD_OPTIONS} -b missing --require-override=openssl/1.1.1s
- name: Build
run: |
conan build . -bf build
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/coverity-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
cmake \
libffi-dev \
libxml2-dev \
libcpputest-dev \
rapidjson-dev \
libavahi-compat-libdnssd-dev \
libcivetweb-dev \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
-o celix/*:framework_curlinit=False
-o celix/*:enable_ccache=True
run: |
conan build . -c tools.cmake.cmaketoolchain:generator=Ninja -pr:b default -pr:h default -s:b build_type=Release -s:h build_type=Release -of build ${CONAN_BUILD_OPTIONS} -b missing -b cpputest
conan build . -c tools.cmake.cmaketoolchain:generator=Ninja -pr:b default -pr:h default -s:b build_type=Release -s:h build_type=Release -of build ${CONAN_BUILD_OPTIONS} -b missing
- name: Test
run: |
cd build
Expand All @@ -75,7 +75,7 @@ jobs:
uses: actions/[email protected]
- name: Install dependencies
run: |
brew install lcov cpputest jansson rapidjson libzip ccache ninja
brew install lcov jansson rapidjson libzip ccache ninja
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
run: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
-o celix:framework_curlinit=False
-o celix:enable_ccache=True
run: |
conan install . celix/ci -c tools.cmake.cmaketoolchain:generator=Ninja -pr:b release -pr:h default -if build ${CONAN_BUILD_OPTIONS} -b missing -b cpputest --require-override=openssl/1.1.1s
conan install . celix/ci -c tools.cmake.cmaketoolchain:generator=Ninja -pr:b release -pr:h default -if build ${CONAN_BUILD_OPTIONS} -b missing --require-override=openssl/1.1.1s
- name: Build
env:
CC: ${{ matrix.compiler[0] }}
Expand Down Expand Up @@ -119,7 +119,6 @@ jobs:
cmake \
libffi-dev \
libxml2-dev \
libcpputest-dev \
rapidjson-dev \
libavahi-compat-libdnssd-dev \
libcivetweb-dev \
Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ limitations under the License.
THe celix_status_t is used to indicate an ENOMEM error.
- Embedded bundles are no longer supported.
- properties.h is removed and no longer supported. Use celix_properties.h instead.
- 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.

## New Features

Expand Down
17 changes: 9 additions & 8 deletions bundles/http_admin/http_admin/src/http_admin.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
* under the License.
*/

#include <stdlib.h>
#include <memory.h>
#include <ctype.h>
#include <limits.h>
#include <memory.h>
#include <stdlib.h>
#include <unistd.h>

#include "http_admin.h"
Expand Down Expand Up @@ -355,9 +356,9 @@ static void httpAdmin_updateInfoSvc(http_admin_manager_t *admin) {
size_t resources_urls_size;
FILE *stream = open_memstream(&resources_urls, &resources_urls_size);

unsigned int size = arrayList_size(admin->aliasList);
unsigned int size = celix_arrayList_size(admin->aliasList);
for (unsigned int i = 0; i < size; ++i) {
http_alias_t *alias = arrayList_get(admin->aliasList, i);
http_alias_t *alias = celix_arrayList_get(admin->aliasList, i);
bool isLast = (i == size-1);
const char *separator = isLast ? "" : ",";
fprintf(stream, "%s%s", alias->url, separator);
Expand Down Expand Up @@ -456,9 +457,9 @@ static void createAliasesSymlink(const char *aliases, const char *admin_root, co
* @return true if alias is already in the list, false if not.
*/
static bool aliasList_containsAlias(celix_array_list_t *alias_list, const char *alias) {
unsigned int size = arrayList_size(alias_list);
unsigned int size = celix_arrayList_size(alias_list);
for(unsigned int i = 0; i < size; i++) {
http_alias_t *http_alias = arrayList_get(alias_list, i);
http_alias_t *http_alias = celix_arrayList_get(alias_list, i);
if(strcmp(http_alias->alias_path, alias) == 0) {
return true;
}
Expand Down Expand Up @@ -492,9 +493,9 @@ void http_admin_stopBundle(void *data, const celix_bundle_t *bundle) {
long bundle_id = celix_bundle_getId(bundle);

//Remove all aliases which are connected to this bundle
unsigned int size = arrayList_size(admin->aliasList);
unsigned int size = celix_arrayList_size(admin->aliasList);
for (unsigned int i = (size - 1); i < size; i--) {
http_alias_t *alias = arrayList_get(admin->aliasList, i);
http_alias_t *alias = celix_arrayList_get(admin->aliasList, i);
if(alias->bundle_id == bundle_id) {
remove(alias->alias_path); //Delete alias in cache directory
free(alias->url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@

#include "endpoint_discovery_poller.h"
#include "celix_errno.h"
#include "array_list.h"
#include "celix_array_list.h"

typedef struct endpoint_descriptor_reader endpoint_descriptor_reader_t;

celix_status_t endpointDescriptorReader_create(endpoint_discovery_poller_t *poller, endpoint_descriptor_reader_t * *reader);
celix_status_t endpointDescriptorReader_destroy(endpoint_descriptor_reader_t * reader);

celix_status_t endpointDescriptorReader_parseDocument(endpoint_descriptor_reader_t * reader, char *document, array_list_pt *endpoints);
celix_status_t endpointDescriptorReader_parseDocument(endpoint_descriptor_reader_t * reader, char *document, celix_array_list_t** endpoints);


#endif /* ENDPOINT_DESCRIPTOR_READER_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
#define ENDPOINT_DESCRIPTOR_WRITER_H_

#include "celix_errno.h"
#include "array_list.h"
#include "celix_array_list.h"

typedef struct endpoint_descriptor_writer endpoint_descriptor_writer_t;

celix_status_t endpointDescriptorWriter_create(endpoint_descriptor_writer_t **writer);
celix_status_t endpointDescriptorWriter_destroy(endpoint_descriptor_writer_t *writer);
celix_status_t endpointDescriptorWriter_writeDocument(endpoint_descriptor_writer_t *writer, array_list_pt endpoints, char **document);
celix_status_t endpointDescriptorWriter_writeDocument(endpoint_descriptor_writer_t *writer, celix_array_list_t* endpoints, char **document);

#endif /* ENDPOINT_DESCRIPTOR_WRITER_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "celix_log_helper.h"
#include "celix_threads.h"
#include "hash_map.h"
#include "celix_array_list.h"

typedef struct endpoint_discovery_poller endpoint_discovery_poller_t;

Expand All @@ -55,6 +56,6 @@ celix_status_t endpointDiscoveryPoller_destroy(endpoint_discovery_poller_t *poll
celix_status_t endpointDiscoveryPoller_addDiscoveryEndpoint(endpoint_discovery_poller_t *poller, char *url);
celix_status_t endpointDiscoveryPoller_removeDiscoveryEndpoint(endpoint_discovery_poller_t *poller, char *url);

celix_status_t endpointDiscoveryPoller_getDiscoveryEndpoints(endpoint_discovery_poller_t *poller, array_list_pt urls);
celix_status_t endpointDiscoveryPoller_getDiscoveryEndpoints(endpoint_discovery_poller_t *poller, celix_array_list_t* urls);

#endif /* ENDPOINT_DISCOVERY_POLLER_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ void endpointDescriptorReader_addSingleValuedProperty(celix_properties_t *proper
celix_properties_set(properties, (char *) name, (char*) value);
}

void endpointDescriptorReader_addMultiValuedProperty(celix_properties_t *properties, const xmlChar* name, array_list_pt values) {
void endpointDescriptorReader_addMultiValuedProperty(celix_properties_t *properties, const xmlChar* name, celix_array_list_t* values) {
char *value = calloc(256, sizeof(*value));
if (value) {
unsigned int size = arrayList_size(values);
unsigned int size = celix_arrayList_size(values);
unsigned int i;
for (i = 0; i < size; i++) {
char* item = (char*) arrayList_get(values, i);
char* item = (char*) celix_arrayList_get(values, i);
if (i > 0) {
value = strcat(value, ",");
}
Expand All @@ -89,7 +89,7 @@ void endpointDescriptorReader_addMultiValuedProperty(celix_properties_t *propert
}
}

celix_status_t endpointDescriptorReader_parseDocument(endpoint_descriptor_reader_t *reader, char *document, array_list_pt *endpoints) {
celix_status_t endpointDescriptorReader_parseDocument(endpoint_descriptor_reader_t *reader, char *document, celix_array_list_t** endpoints) {
celix_status_t status = CELIX_SUCCESS;

reader->reader = xmlReaderForMemory(document, (int) strlen(document), NULL, "UTF-8", 0);
Expand All @@ -109,15 +109,14 @@ celix_status_t endpointDescriptorReader_parseDocument(endpoint_descriptor_reader
xmlChar *valueBuffer = xmlMalloc(256);
valueBuffer[0] = '\0';

array_list_pt propertyValues = NULL;
arrayList_create(&propertyValues);
celix_array_list_t* propertyValues = celix_arrayList_create();

array_list_pt endpointDescriptions = NULL;
celix_array_list_t* endpointDescriptions = NULL;
if (*endpoints) {
// use the given arraylist...
endpointDescriptions = *endpoints;
} else {
arrayList_create(&endpointDescriptions);
endpointDescriptions = celix_arrayList_create();
// return the read endpoints...
*endpoints = endpointDescriptions;
}
Expand Down Expand Up @@ -163,7 +162,7 @@ celix_status_t endpointDescriptorReader_parseDocument(endpoint_descriptor_reader
propertyValue = xmlTextReaderGetAttribute(reader->reader, VALUE);
xmlChar *vtype = xmlTextReaderGetAttribute(reader->reader, VALUE_TYPE);
propertyType = valueTypeFromString((char*) vtype);
arrayList_clear(propertyValues);
celix_arrayList_clear(propertyValues);

if (xmlTextReaderIsEmptyElement(reader->reader)) {
inProperty = false;
Expand Down Expand Up @@ -200,7 +199,7 @@ celix_status_t endpointDescriptorReader_parseDocument(endpoint_descriptor_reader
endpoint_description_t *endpointDescription = NULL;
// Completely parsed endpoint description, add it to our list of results...
if(endpointDescription_create(endpointProperties, &endpointDescription) == CELIX_SUCCESS){
arrayList_add(endpointDescriptions, endpointDescription);
celix_arrayList_add(endpointDescriptions, endpointDescription);
}

endpointProperties = celix_properties_create();
Expand All @@ -224,18 +223,18 @@ celix_status_t endpointDescriptorReader_parseDocument(endpoint_descriptor_reader

xmlFree((void *) propertyName);
unsigned int k=0;
for(;k<arrayList_size(propertyValues);k++){
free(arrayList_get(propertyValues,k));
for(;k<celix_arrayList_size(propertyValues);k++){
free(celix_arrayList_get(propertyValues,k));
}
arrayList_clear(propertyValues);
celix_arrayList_clear(propertyValues);

propertyType = VALUE_TYPE_STRING;
inArray = false;
inList = false;
inSet = false;
inXml = false;
} else if (xmlStrcmp(localname, VALUE) == 0) {
arrayList_add(propertyValues, strdup((char*) valueBuffer));
celix_arrayList_add(propertyValues, strdup((char*) valueBuffer));
valueBuffer[0] = 0;
inValue = false;
}
Expand All @@ -255,10 +254,10 @@ celix_status_t endpointDescriptorReader_parseDocument(endpoint_descriptor_reader
}

unsigned int k=0;
for(;k<arrayList_size(propertyValues);k++){
free(arrayList_get(propertyValues,k));
for(;k<celix_arrayList_size(propertyValues);k++){
free(celix_arrayList_get(propertyValues,k));
}
arrayList_destroy(propertyValues);
celix_arrayList_destroy(propertyValues);
xmlFree(valueBuffer);

xmlFreeTextReader(reader->reader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ celix_status_t endpointDescriptorWriter_destroy(endpoint_descriptor_writer_t *wr
return CELIX_SUCCESS;
}

celix_status_t endpointDescriptorWriter_writeDocument(endpoint_descriptor_writer_t *writer, array_list_pt endpoints, char **document) {
celix_status_t endpointDescriptorWriter_writeDocument(endpoint_descriptor_writer_t *writer, celix_array_list_t* endpoints, char **document) {
celix_status_t status = CELIX_SUCCESS;
int rc;

Expand All @@ -85,8 +85,8 @@ celix_status_t endpointDescriptorWriter_writeDocument(endpoint_descriptor_writer
status = CELIX_BUNDLE_EXCEPTION;
} else {
unsigned int i;
for (i = 0; i < arrayList_size(endpoints); i++) {
endpoint_description_t *endpoint = arrayList_get(endpoints, i);
for (i = 0; i < celix_arrayList_size(endpoints); i++) {
endpoint_description_t *endpoint = celix_arrayList_get(endpoints, i);
status = endpointDescriptorWriter_writeEndpoint(writer, endpoint);
}
if (status == CELIX_SUCCESS) {
Expand Down
Loading

0 comments on commit 65f53a1

Please sign in to comment.