CELIX-282: Removes unused folders, updates release notes and adds missing license
Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/5a8109d6 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/5a8109d6 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/5a8109d6 Branch: refs/heads/master Commit: 5a8109d698cca4dc65a10fc0d2350b9266fc6366 Parents: 28ef94a Author: Pepijn Noltes <pepijnnol...@gmail.com> Authored: Mon Oct 10 13:09:18 2016 +0200 Committer: Pepijn Noltes <pepijnnol...@gmail.com> Committed: Mon Oct 10 13:09:18 2016 +0200 ---------------------------------------------------------------------- RELEASE_NOTES | 10 +- cmake/cmake_celix/RunConfig.in.cmake | 17 + hessian/cmake/modules/FindCUnit.cmake | 65 --- hessian/source/CMakeLists.txt | 87 ---- hessian/source/private/src/hessian_in.c | 502 ------------------- hessian/source/private/src/hessian_out.c | 401 --------------- hessian/source/private/test/test_hessian_out.c | 108 ---- hessian/source/private/test/test_service.h | 35 -- .../source/private/test/test_service_proxy.c | 35 -- .../source/private/test/test_service_skeleton.c | 52 -- hessian/source/public/include/hessian_2.0.h | 46 -- hessian/source/public/include/hessian_2.0_in.h | 50 -- hessian/source/public/include/hessian_2.0_out.h | 61 --- .../source/public/include/hessian_constants.h | 85 ---- hessian/source/test.c | 93 ---- rat-excludes.txt | 4 - scr/CMakeLists.txt | 27 - scr/scr/CMakeLists.txt | 31 -- scr/scr/META-INF/MANIFEST.MF | 20 - scr/scr/private/include/component_metadata.h | 80 --- scr/scr/private/include/reference_metadata.h | 64 --- scr/scr/private/include/service_metadata.h | 44 -- scr/scr/private/include/xml_parser_impl.h | 36 -- scr/scr/private/src/component_metadata.c | 188 ------- scr/scr/private/src/component_registry.c | 30 -- scr/scr/private/src/reference_metadata.c | 128 ----- scr/scr/private/src/service_metadata.c | 72 --- scr/scr/private/src/xml_parser.c | 220 -------- scr/scr/scr.c | 165 ------ scr/test/CMakeLists.txt | 27 - scr/test/META-INF/MANIFEST.MF | 21 - scr/test/test.c | 54 -- scr/test/test.xml | 60 --- shell/CMakeLists.txt | 2 +- 34 files changed, 25 insertions(+), 2895 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/RELEASE_NOTES ---------------------------------------------------------------------- diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 0bc86e9..002260c 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -1,10 +1,14 @@ -Release Notes for 1.0.0.incubating +Release Notes for 2.0.0 Remarks: - * Components that are 1.0.0 are + * Components that are 2.0.0 are - Framework - Utils - Shell + +* Components that are 1.0.0 - Shell TUI - Log Service - Log Writer - - Launcher \ No newline at end of file + - Launcher + - C Dependency Manager + - C++ Dependency Manager http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/cmake/cmake_celix/RunConfig.in.cmake ---------------------------------------------------------------------- diff --git a/cmake/cmake_celix/RunConfig.in.cmake b/cmake/cmake_celix/RunConfig.in.cmake index 5825f2a..3c62ab9 100644 --- a/cmake/cmake_celix/RunConfig.in.cmake +++ b/cmake/cmake_celix/RunConfig.in.cmake @@ -1,3 +1,20 @@ +# 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. + set(RUN_CONFIG_IN "\ <?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?> \n\ <launchConfiguration type=\"org.eclipse.cdt.launch.applicationLaunchType\"> \n\ http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/hessian/cmake/modules/FindCUnit.cmake ---------------------------------------------------------------------- diff --git a/hessian/cmake/modules/FindCUnit.cmake b/hessian/cmake/modules/FindCUnit.cmake deleted file mode 100644 index 3fce1b8..0000000 --- a/hessian/cmake/modules/FindCUnit.cmake +++ /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. - -if (NOT WIN32) - include(FindCurses) -endif (NOT WIN32) - -FIND_PATH(CUNIT_INCLUDE_DIR Basic.h - /usr/local/include/CUnit - /usr/include/CUnit - /opt/local/include/CUnit -) - -FIND_PATH(CUNIT_SHARE_DIR CUnit-List.dtd - /usr/local/share/CUnit - /usr/share/CUnit - /opt/local/share/CUnit -) - -# On unix system, debug and release have the same name -FIND_LIBRARY(CUNIT_LIBRARY cunit - ${CUNIT_INCLUDE_DIR}/../../lib - /usr/local/lib - /usr/lib - ) -FIND_LIBRARY(CUNIT_DEBUG_LIBRARY cunit - ${CUNIT_INCLUDE_DIR}/../../lib - /usr/local/lib - /usr/lib - ) - -IF(CUNIT_INCLUDE_DIR) - IF(CUNIT_LIBRARY) - SET(CUNIT_FOUND "YES") - if (WIN32) - SET(CUNIT_LIBRARIES ${CUNIT_LIBRARY}) - SET(CUNIT_DEBUG_LIBRARIES ${CUNIT_DEBUG_LIBRARY}) - else (WIN32) - SET(CUNIT_LIBRARIES ${CUNIT_LIBRARY} ${CURSES_LIBRARY}) - SET(CUNIT_DEBUG_LIBRARIES ${CUNIT_DEBUG_LIBRARY} ${CURSES_DEBUG_LIBRARY}) - endif (WIN32) - ENDIF(CUNIT_LIBRARY) - IF(CUNIT_INCLUDE_DIR) - if (WIN32) - SET(CUNIT_INCLUDE_DIRS ${CUNIT_INCLUDE_DIR}) - else (WIN32) - MESSAGE(STATUS "Found CUNIT: ${CUNIT_INCLUDE_DIR}") - SET(CUNIT_INCLUDE_DIRS ${CUNIT_INCLUDE_DIR} ${CURSES_INCLUDE_DIR}) - endif (WIN32) - ENDIF(CUNIT_INCLUDE_DIR) -ENDIF(CUNIT_INCLUDE_DIR) http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/hessian/source/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/hessian/source/CMakeLists.txt b/hessian/source/CMakeLists.txt deleted file mode 100644 index d6b0bcc..0000000 --- a/hessian/source/CMakeLists.txt +++ /dev/null @@ -1,87 +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. - -cmake_minimum_required (VERSION 2.6) -project (HessianC C) - -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../cmake/modules/") - -SET(CMAKE_BUILD_TYPE "Debug") -SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 ${CMAKE_C_FLAGS}") - -MACRO(PARSE_ARGUMENTS prefix arg_names option_names) - SET(DEFAULT_ARGS) - FOREACH(arg_name ${arg_names}) - SET(${prefix}_${arg_name}) - ENDFOREACH(arg_name) - FOREACH(option ${option_names}) - SET(${prefix}_${option} FALSE) - ENDFOREACH(option) - - SET(current_arg_name DEFAULT_ARGS) - SET(current_arg_list) - FOREACH(arg ${ARGN}) - SET(larg_names ${arg_names}) - LIST(FIND larg_names "${arg}" is_arg_name) - IF (is_arg_name GREATER -1) - SET(${prefix}_${current_arg_name} ${current_arg_list}) - SET(current_arg_name ${arg}) - SET(current_arg_list) - ELSE (is_arg_name GREATER -1) - SET(loption_names ${option_names}) - LIST(FIND loption_names "${arg}" is_option) - IF (is_option GREATER -1) - SET(${prefix}_${arg} TRUE) - ELSE (is_option GREATER -1) - SET(current_arg_list ${current_arg_list} ${arg}) - ENDIF (is_option GREATER -1) - ENDIF (is_arg_name GREATER -1) - ENDFOREACH(arg) - SET(${prefix}_${current_arg_name} ${current_arg_list}) -ENDMACRO(PARSE_ARGUMENTS) - -ADD_CUSTOM_TARGET(test) -MACRO(run_test) - PARSE_ARGUMENTS(TEST "" "" ${ARGN}) - LIST(GET TEST_DEFAULT_ARGS 0 EXEC) - - SET(__testTarget test_${EXEC}) - - file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/test_results) - - add_custom_target(${__testTarget} - ${EXEC} ${EXEC} - COMMAND xsltproc --path ${CUNIT_SHARE_DIR} ${CUNIT_SHARE_DIR}/CUnit-Run.xsl ${PROJECT_BINARY_DIR}/test_results/${EXEC}-Results.xml > ${EXEC}-Results.html - COMMAND xsltproc --path ${CUNIT_SHARE_DIR} ${CUNIT_SHARE_DIR}/CUnit-List.xsl ${PROJECT_BINARY_DIR}/test_results/${EXEC}-Listing.xml > ${EXEC}-Listing.html - - WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/test_results - ) - ADD_DEPENDENCIES(test ${__testTarget}) -ENDMACRO(run_test) - -include_directories("private/include") -include_directories("public/include") - -add_library(hessian STATIC private/src/hessian_out private/src/hessian_in) - -include(FindCUnit) - -include_directories(${CUNIT_INCLUDE_DIRS}) -add_executable(test_hessian_out private/test/test_hessian_out.c) -target_link_libraries(test_hessian_out hessian ${CUNIT_LIBRARIES}) - -run_test(test_hessian_out) http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/hessian/source/private/src/hessian_in.c ---------------------------------------------------------------------- diff --git a/hessian/source/private/src/hessian_in.c b/hessian/source/private/src/hessian_in.c deleted file mode 100644 index 6a5f99c..0000000 --- a/hessian/source/private/src/hessian_in.c +++ /dev/null @@ -1,502 +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. - */ -/* - * hessian_in.c - * - * \date Aug 1, 2011 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#include <stdlib.h> -#include <string.h> - -#include "hessian_2.0.h" - -static int END_OF_DATA = -2; - -int hessian_parseChar(hessian_in_pt in, char *c); -int hessian_parseLong(hessian_in_pt in, long *value); -int hessian_parseInt16(hessian_in_pt in, int *value); -int hessian_parseInt(hessian_in_pt in, int *value); - -char hessian_read(hessian_in_pt in) { - return (in->buffer[in->offset++] & 0xFF); -} - -int hessian_readBoolean(hessian_in_pt in, bool *value) { - char tag = hessian_read(in); - - switch (tag) { - case 'T': - *value = true; - break; - case 'F': - default: - *value = false; - break; - } - - return 0; -} - -int hessian_readInt(hessian_in_pt in, int *value) { - unsigned char tag = hessian_read(in); - - switch (tag) { - // direct integer - case 0x80: case 0x81: case 0x82: case 0x83: - case 0x84: case 0x85: case 0x86: case 0x87: - case 0x88: case 0x89: case 0x8a: case 0x8b: - case 0x8c: case 0x8d: case 0x8e: case 0x8f: - - case 0x90: case 0x91: case 0x92: case 0x93: - case 0x94: case 0x95: case 0x96: case 0x97: - case 0x98: case 0x99: case 0x9a: case 0x9b: - case 0x9c: case 0x9d: case 0x9e: case 0x9f: - - case 0xa0: case 0xa1: case 0xa2: case 0xa3: - case 0xa4: case 0xa5: case 0xa6: case 0xa7: - case 0xa8: case 0xa9: case 0xaa: case 0xab: - case 0xac: case 0xad: case 0xae: case 0xaf: - - case 0xb0: case 0xb1: case 0xb2: case 0xb3: - case 0xb4: case 0xb5: case 0xb6: case 0xb7: - case 0xb8: case 0xb9: case 0xba: case 0xbb: - case 0xbc: case 0xbd: case 0xbe: case 0xbf: - *value = tag - INT_ZERO; - break; - - /* byte int */ - case 0xc0: case 0xc1: case 0xc2: case 0xc3: - case 0xc4: case 0xc5: case 0xc6: case 0xc7: - case 0xc8: case 0xc9: case 0xca: case 0xcb: - case 0xcc: case 0xcd: case 0xce: case 0xcf: - *value = ((tag - INT_BYTE_ZERO) << 8) + hessian_read(in); - break; - - /* short int */ - case 0xd0: case 0xd1: case 0xd2: case 0xd3: - case 0xd4: case 0xd5: case 0xd6: case 0xd7: - *value = ((tag - INT_SHORT_ZERO) << 16) + 256 * hessian_read(in) + hessian_read(in); - break; - - case 'I': - hessian_readInt(in, value); - break; - - default: - *value = 0; - break; - } - - return 1; -} - -int hessian_readLong(hessian_in_pt in, long *value) { - unsigned char tag = hessian_read(in); - - switch (tag) { - // direct long - case 0xd8: case 0xd9: case 0xda: case 0xdb: - case 0xdc: case 0xdd: case 0xde: case 0xdf: - - case 0xe0: case 0xe1: case 0xe2: case 0xe3: - case 0xe4: case 0xe5: case 0xe6: case 0xe7: - case 0xe8: case 0xe9: case 0xea: case 0xeb: - case 0xec: case 0xed: case 0xee: case 0xef: - *value = tag - LONG_ZERO; - break; - - /* byte long */ - case 0xf0: case 0xf1: case 0xf2: case 0xf3: - case 0xf4: case 0xf5: case 0xf6: case 0xf7: - case 0xf8: case 0xf9: case 0xfa: case 0xfb: - case 0xfc: case 0xfd: case 0xfe: case 0xff: - *value = ((tag - LONG_BYTE_ZERO) << 8) + hessian_read(in); - break; - - /* short long */ - case 0x38: case 0x39: case 0x3a: case 0x3b: - case 0x3c: case 0x3d: case 0x3e: case 0x3f: - *value = ((tag - LONG_SHORT_ZERO) << 16) + 256 - * hessian_read(in) + hessian_read(in); - break; - - case 'L': - hessian_parseLong(in, value); - break; - default: - return 0l; - } - - return 0; -} - -int hessian_readDouble(hessian_in_pt in, double *value) { - unsigned char tag = hessian_read(in); - - long l; - int i; - double *d; - switch (tag) { - case 0x67: - *value = 0; - break; - case 0x68: - *value = 1; - break; - case 0x69: - *value = (double) hessian_read(in); - break; - case 0x6a: - *value = (short) (256 * hessian_read(in) + hessian_read(in)); - break; - case 0x6b: - hessian_parseInt(in, &i); - - *value = (double) *((float *) &i); - break; - case 'D': - hessian_parseLong(in, &l); - - d = (double *) &l; - - *value = *d; - break; - } - - return 0; -} - -int hessian_readUTCDate(hessian_in_pt in, long *value) { - unsigned char tag = hessian_read(in); - - if (tag == 'd') { - hessian_parseLong(in, value); - } - - return 0; -} - -int hessian_readNull(hessian_in_pt in) { - unsigned char tag = hessian_read(in); - - switch (tag) { - case 'N': - break; - default: - break; - } - - return 0; -} - -int hessian_readChar(hessian_in_pt in, char *value) { - char *readC; - unsigned int read; - hessian_readNString(in, 0, 1, &readC, &read); - *value = readC[0]; - - return 0; -} - -int hessian_readString(hessian_in_pt in, char **value, unsigned int *readLength) { - return hessian_readNString(in, 0, -1, value, readLength); -} - -int hessian_readNString(hessian_in_pt in, int offset, int length, char **value, unsigned int *readLength) { - *readLength = 0; - - bool done = false; - if (in->chunkLength == END_OF_DATA) { - done = true; - } else if (in->chunkLength == 0) { - unsigned char tag = hessian_read(in); - - switch (tag) { - case 'N': - in->chunkLength = 0; - in->lastChunk = true; - break; - case 'S': - case 's': - in->lastChunk = tag == 'S'; - hessian_parseInt16(in, &(in->chunkLength)); - break; - - case 0x00: case 0x01: case 0x02: case 0x03: - case 0x04: case 0x05: case 0x06: case 0x07: - case 0x08: case 0x09: case 0x0a: case 0x0b: - case 0x0c: case 0x0d: case 0x0e: case 0x0f: - - case 0x10: case 0x11: case 0x12: case 0x13: - case 0x14: case 0x15: case 0x16: case 0x17: - case 0x18: case 0x19: case 0x1a: case 0x1b: - case 0x1c: case 0x1d: case 0x1e: case 0x1f: - in->chunkLength = tag - 0x00; - in->lastChunk = true; - break; - - case 0x30: case 0x31: case 0x32: case 0x33: - in->chunkLength = (tag - 0x30) * 256 + hessian_read(in); - in->lastChunk = true; - break; - - default: - in->chunkLength = 0; - in->lastChunk = true; - break; - } - } - - while (!done) { - unsigned int newSize = *readLength + in->chunkLength + 1; - *value = realloc(*value, sizeof(char) * (*readLength + in->chunkLength + 1)); - - if (in->chunkLength > 0) { - char c; - hessian_parseChar(in, &c); - (*value)[(*readLength) + offset] = c; - (*value)[(*readLength) + offset + 1] = '\0'; - in->chunkLength--; - (*readLength)++; - length--; - - if (length == 0) { - done = true; - } - - } else if (in->lastChunk) { - done = true; - if (*readLength != 0) { - in->chunkLength = END_OF_DATA; - } - } else { - unsigned char tag = hessian_read(in); - switch (tag) { - case 'S': - case 's': - done = tag == 'S'; - - hessian_parseInt16(in, &in->chunkLength); - break; - - case 0x00: case 0x01: case 0x02: case 0x03: - case 0x04: case 0x05: case 0x06: case 0x07: - case 0x08: case 0x09: case 0x0a: case 0x0b: - case 0x0c: case 0x0d: case 0x0e: case 0x0f: - - case 0x10: case 0x11: case 0x12: case 0x13: - case 0x14: case 0x15: case 0x16: case 0x17: - case 0x18: case 0x19: case 0x1a: case 0x1b: - case 0x1c: case 0x1d: case 0x1e: case 0x1f: - in->chunkLength = tag - 0x00; - in->lastChunk = true; - break; - - case 0x30: case 0x31: case 0x32: case 0x33: - in->chunkLength = (tag - 0x30) * 256 + hessian_read(in); - in->lastChunk = true; - break; - - default: - in->chunkLength = 0; - in->lastChunk = true; - break; - } - } - } - - if (in->lastChunk && in->chunkLength == 0) { - in->chunkLength = END_OF_DATA; - } - - return 0; -} - -int hessian_readByte(hessian_in_pt in, unsigned char *value) { - unsigned char *readC; - unsigned int read; - hessian_readNBytes(in, 0, 1, &readC, &read); - *value = readC[0]; - - return 0; -} - -int hessian_readBytes(hessian_in_pt in, unsigned char **value, unsigned int *readLength) { - return hessian_readNBytes(in, 0, -1, value, readLength); -} - -int hessian_readNBytes(hessian_in_pt in, int offset, int length, unsigned char **value, unsigned int *readLength) { - *readLength = 0; - - bool done = false; - if (in->chunkLength == END_OF_DATA) { - done = true; - } else if (in->chunkLength == 0) { - unsigned char tag = hessian_read(in); - - switch (tag) { - case 'N': - in->chunkLength = 0; - in->lastChunk = true; - break; - case 'B': - case 'b': - in->lastChunk = tag == 'B'; - hessian_parseInt16(in, &(in->chunkLength)); - break; - - case 0x20: case 0x21: case 0x22: case 0x23: - case 0x24: case 0x25: case 0x26: case 0x27: - case 0x28: case 0x29: case 0x2a: case 0x2b: - case 0x2c: case 0x2d: case 0x2e: case 0x2f: - in->chunkLength = tag - 0x20; - in->lastChunk = true; - break; - - default: - in->chunkLength = 0; - in->lastChunk = true; - break; - } - } - - while (!done) { - unsigned int newSize = *readLength + in->chunkLength; - *value = realloc(*value, sizeof(char) * (*readLength + in->chunkLength)); - - if (in->chunkLength > 0) { - unsigned char c = hessian_read(in); - (*value)[(*readLength) + offset] = c; - in->chunkLength--; - (*readLength)++; - length--; - - if (length == 0) { - done = true; - } - - } else if (in->lastChunk) { - done = true; - if (*readLength != 0) { - in->chunkLength = END_OF_DATA; - } - } else { - unsigned char tag = hessian_read(in); - switch (tag) { - case 'B': - case 'b': - done = tag == 'S'; - - hessian_parseInt16(in, &in->chunkLength); - break; - - case 0x20: case 0x21: case 0x22: case 0x23: - case 0x24: case 0x25: case 0x26: case 0x27: - case 0x28: case 0x29: case 0x2a: case 0x2b: - case 0x2c: case 0x2d: case 0x2e: case 0x2f: - in->chunkLength = tag - 0x20; - in->lastChunk = true; - break; - - default: - in->chunkLength = 0; - in->lastChunk = true; - break; - } - } - } - - if (in->lastChunk && in->chunkLength == 0) { - in->chunkLength = END_OF_DATA; - } - - return 0; -} - -int hessian_parseChar(hessian_in_pt in, char *c) { - unsigned char ch = hessian_read(in); - - if (ch < 0x80) { - *c = ch; - } else if ((ch & 0xe0) == 0xc0) { - char ch1 = hessian_read(in); - - *c = ((ch & 0x1f) << 6) + (ch1 & 0x3f); - } else if ((ch & 0xf0) == 0xe0) { - char ch1 = hessian_read(in); - char ch2 = hessian_read(in); - - *c = ((ch & 0x0f) << 12) + ((ch1 & 0x3f) << 6) + (ch2 & 0x3f); - } else { - *c = '\0'; - } - - return 0; -} - -int hessian_parseInt16(hessian_in_pt in, int *value) { - int b16 = hessian_read(in) & 0xFF; - int b8 = hessian_read(in) & 0xFF; - - *value = (b16 << 8) - + b8; - - return 0; -} - -int hessian_parseInt(hessian_in_pt in, int *value) { - int b32 = hessian_read(in) & 0xFF; - int b24 = hessian_read(in) & 0xFF; - int b16 = hessian_read(in) & 0xFF; - int b8 = hessian_read(in) & 0xFF; - - *value = (b32 << 24) - + (b24 << 16) - + (b16 << 8) - + b8; - - return 0; -} - -int hessian_parseLong(hessian_in_pt in, long *value) { - long b64 = hessian_read(in) & 0xFF; - long b56 = hessian_read(in) & 0xFF; - long b48 = hessian_read(in) & 0xFF; - long b40 = hessian_read(in) & 0xFF; - long b32 = hessian_read(in) & 0xFF; - long b24 = hessian_read(in) & 0xFF; - long b16 = hessian_read(in) & 0xFF; - long b8 = hessian_read(in) & 0xFF; - - long v = (b64 << 56) - + (b56 << 48) - + (b48 << 40) - + (b40 << 32) - + (b32 << 24) - + (b24 << 16) - + (b16 << 8) - + b8; - - *value = v; - - return 0; -} http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/hessian/source/private/src/hessian_out.c ---------------------------------------------------------------------- diff --git a/hessian/source/private/src/hessian_out.c b/hessian/source/private/src/hessian_out.c deleted file mode 100644 index ab044ff..0000000 --- a/hessian/source/private/src/hessian_out.c +++ /dev/null @@ -1,401 +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. - */ -/* - * hessian_out.c - * - * \date Jul 31, 2011 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#include <stdlib.h> -#include <string.h> - -#include "hessian_2.0.h" - -void hessian_ensureCapacity(hessian_out_pt obj, int capacity); - -int hessian_printString(hessian_out_pt out, char *value); -int hessian_printNString(hessian_out_pt out, char *value, int offset, int length); - -int hessian_writeType(hessian_out_pt out, char *type); - -int hessian_write(hessian_out_pt out, unsigned char byte); -int hessian_writeP(hessian_out_pt out, unsigned char *byte); - -int hessian_writeBoolean(hessian_out_pt out, bool value) { - hessian_ensureCapacity(out, out->offset + 1); - - if (value) { - char c = 'T'; - hessian_writeP(out, &c); - } else { - out->buffer[out->offset++] = 'F'; - out->length++; - } - - return 0; -} - -int hessian_writeInt(hessian_out_pt out, int value) { - hessian_ensureCapacity(out, out->offset + 5); - - if (INT_DIRECT_MIN <= value && value <= INT_DIRECT_MAX) - hessian_write(out, (char) (value + INT_ZERO)); - else if (INT_BYTE_MIN <= value && value <= INT_BYTE_MAX) { - hessian_write(out, (char) (INT_BYTE_ZERO + (value >> 8))); - hessian_write(out, (char) (value)); - } else if (INT_SHORT_MIN <= value && value <= INT_SHORT_MAX) { - hessian_write(out, (char)(INT_SHORT_ZERO + (value >> 16))); - hessian_write(out, (char)(value >> 8)); - hessian_write(out, (char)(value)); - } else { - hessian_write(out, (char)('I')); - hessian_write(out, (char)(value >> 24)); - hessian_write(out, (char)(value >> 16)); - hessian_write(out, (char)(value >> 8)); - hessian_write(out, (char)(value)); - } - - return 0; -} - -int hessian_writeLong(hessian_out_pt out, long value) { - hessian_ensureCapacity(out, out->offset + 9); - - if (LONG_DIRECT_MIN <= value && value <= LONG_DIRECT_MAX) { - hessian_write(out, (char)(value + LONG_ZERO)); - } else if (LONG_BYTE_MIN <= value && value <= LONG_BYTE_MAX) { - hessian_write(out, (char)(LONG_BYTE_ZERO + (value >> 8))); - hessian_write(out, (char)(value)); - } else if (LONG_SHORT_MIN <= value && value <= LONG_SHORT_MAX) { - hessian_write(out, (char)(LONG_SHORT_ZERO + (value >> 16))); - hessian_write(out, (char)(value >> 8)); - hessian_write(out, (char)(value)); - } else if (-0x80000000L <= value && value <= 0x7fffffffL) { - hessian_write(out, (char) LONG_INT); - hessian_write(out, (char)(value >> 24)); - hessian_write(out, (char)(value >> 16)); - hessian_write(out, (char)(value >> 8)); - hessian_write(out, (char)(value)); - } else { - hessian_write(out, (char) 'L'); - hessian_write(out, (char)(value >> 56)); - hessian_write(out, (char)(value >> 48)); - hessian_write(out, (char)(value >> 40)); - hessian_write(out, (char)(value >> 32)); - hessian_write(out, (char)(value >> 24)); - hessian_write(out, (char)(value >> 16)); - hessian_write(out, (char)(value >> 8)); - hessian_write(out, (char)(value)); - } - - return 0; -} - -int hessian_writeDouble(hessian_out_pt out, double value) { - hessian_ensureCapacity(out, out->offset + 9); - - int intValue = (int) value; - - if (intValue == value) { - if (intValue == 0) { - hessian_write(out, (char) DOUBLE_ZERO); - } else if (intValue == 1) { - hessian_write(out, (char) DOUBLE_ONE); - } else if (-0x80 <= intValue && intValue < 0x80) { - hessian_write(out, (char) DOUBLE_BYTE); - hessian_write(out, (char) intValue); - } else if (-0x8000 <= intValue && intValue < 0x8000) { - hessian_write(out, (char) DOUBLE_SHORT); - hessian_write(out, (char) ((intValue >> 8) & 0xFF)); - hessian_write(out, (char) (intValue & 0xFF)); - } - } else { - float f = (float) value; - - if (f == value) { - float f = value; - int bits = *((int *) &f); - - hessian_write(out, (char)(DOUBLE_FLOAT)); - hessian_write(out, (char)(bits >> 24)); - hessian_write(out, (char)(bits >> 16)); - hessian_write(out, (char)(bits >> 8)); - hessian_write(out, (char)(bits)); - } else { - long bits = *((long *) &value); - - hessian_write(out, (char) 'D'); - hessian_write(out, (char)(bits >> 56) & 0x00000000000000FF); - hessian_write(out, (char)(bits >> 48) & 0x00000000000000FF); - hessian_write(out, (char)(bits >> 40) & 0x00000000000000FF); - hessian_write(out, (char)(bits >> 32) & 0x00000000000000FF); - hessian_write(out, (char)(bits >> 24) & 0x00000000000000FF); - hessian_write(out, (char)(bits >> 16) & 0x00000000000000FF); - hessian_write(out, (char)(bits >> 8) & 0x00000000000000FF); - hessian_write(out, (char)(bits) & 0x00000000000000FF); - } - } - - return 0; -} - -int hessian_writeUTCDate(hessian_out_pt out, long value) { - hessian_ensureCapacity(out, out->offset + 9); - - hessian_write(out, (int) ('d')); - hessian_write(out, ((int) (value >> 56))); - hessian_write(out, ((int) (value >> 48))); - hessian_write(out, ((int) (value >> 40))); - hessian_write(out, ((int) (value >> 32))); - hessian_write(out, ((int) (value >> 24))); - hessian_write(out, ((int) (value >> 16))); - hessian_write(out, ((int) (value >> 8))); - hessian_write(out, ((int) (value))); - - return 0; -} - -int hessian_writeNull(hessian_out_pt out) { - hessian_ensureCapacity(out, out->offset + 1); - - hessian_write(out, (int) ('N')); - - return 0; -} - -int hessian_writeString(hessian_out_pt out, char *value) { - int length = strlen(value); - return hessian_writeNString(out, value, 0, length); -} - -int hessian_writeNString(hessian_out_pt out, char *value, int offset, int length) { - if (value == NULL) { - hessian_writeNull(out); - } else { - while (length > 0x8000) { - int sublen = 0x8000; - - // chunk can't end in high surrogate - int tail = value[offset + sublen - 1]; - - if (0xd800 <= tail && tail <= 0xdbff) - sublen--; - - hessian_ensureCapacity(out, out->offset + 3); - - hessian_write(out, (int) 's'); - hessian_write(out, (int)(sublen >> 8)); - hessian_write(out, (int)(sublen)); - - hessian_printNString(out, value, offset, sublen); - - length -= sublen; - offset += sublen; - } - - if (length <= STRING_DIRECT_MAX) { - hessian_ensureCapacity(out, out->offset + 2); - - hessian_write(out, (int)(STRING_DIRECT + length)); - } else { - hessian_ensureCapacity(out, out->offset + 3); - - hessian_write(out, (int)('S')); - hessian_write(out, (int)(length >> 8)); - hessian_write(out, (int)(length)); - } - - hessian_printNString(out, value, offset, length); - } - - return 0; -} - -int hessian_writeBytes(hessian_out_pt out, unsigned char value[], int length) { - return hessian_writeNBytes(out, value, 0, length); -} - -int hessian_writeNBytes(hessian_out_pt out, unsigned char value[], int offset, int length) { - if (value == NULL) { - hessian_writeNull(out); - } else { - while (length > 0x8000) { - int sublen = 0x8000; - - hessian_ensureCapacity(out, out->offset + 3); - - hessian_write(out, (int) 'b'); - hessian_write(out, (int)(sublen >> 8)); - hessian_write(out, (int) sublen); - - hessian_ensureCapacity(out, out->offset + sublen); - memcpy(out->buffer+out->offset, value+offset, sublen); - out->offset += sublen; - - length -= sublen; - offset += sublen; - } - - if (length < 0x10) { - hessian_ensureCapacity(out, out->offset + 1); - hessian_write(out, (int)(BYTES_DIRECT + length)); - } else { - hessian_ensureCapacity(out, out->offset + 3); - hessian_write(out, (int) 'B'); - hessian_write(out, (int)(length >> 8)); - hessian_write(out, (int)(length)); - } - - hessian_ensureCapacity(out, out->offset + length); - memcpy(out->buffer+out->offset, value+offset, length); - - out->offset += length; - } - - return 0; -} - -int hessian_writeListBegin(hessian_out_pt out, int length, char *type) { - hessian_ensureCapacity(out, out->offset + 1); - if (length < 0) { - if (type != NULL) { - hessian_write(out, (char) BC_LIST_VARIABLE); - hessian_writeType(out, type); - } else { - hessian_write(out, (char) BC_LIST_VARIABLE_UNTYPED); - } - - return true; - } else if (length <= LIST_DIRECT_MAX) { - if (type != NULL) { - hessian_write(out, (char)(BC_LIST_DIRECT + length)); - hessian_writeType(out, type); - } else { - hessian_write(out, (char)(BC_LIST_DIRECT_UNTYPED + length)); - } - - return false; - } else { - if (type != NULL) { - hessian_write(out, (char) BC_LIST_FIXED); - hessian_writeType(out, type); - } else { - hessian_write(out, (char) BC_LIST_FIXED_UNTYPED); - } - - hessian_writeInt(out, length); - - return false; - } - - return 0; -} - -int hessian_writeListEnd(hessian_out_pt out) { - hessian_ensureCapacity(out, out->offset + 1); - hessian_write(out, (char) BC_END); - - return 0; -} - -int hessian_writeType(hessian_out_pt out, char *type) { - int len = strlen(type); - if (len == 0) { - return 1; - } - - // Do something with refs here - return hessian_writeString(out, type); -} - -int hessian_startCall(hessian_out_pt out, char *method, int length) { - hessian_ensureCapacity(out, out->offset + 1); - hessian_write(out, 'C'); - - hessian_writeString(out, method); - hessian_writeInt(out, length); - - return 0; -} - -int hessian_completeCall(hessian_out_pt out) { - return 0; -} - -int hessian_printString(hessian_out_pt out, char *value) { - return hessian_printNString(out, value, 0, strlen(value)); -} - -int hessian_printNString(hessian_out_pt out, char *value, int offset, int length) { - hessian_ensureCapacity(out, out->offset + length); - - for (int i = 0; i < length; i++) { - int ch = value[i + offset]; - - if (ch < 0x80) { - hessian_write(out, (int)(ch)); - out->length++; - } else if (ch < 0x800) { - hessian_write(out, (int)(0xc0 + ((ch >> 6) & 0x1f))); - out->length++; - hessian_write(out, (int)(0x80 + (ch & 0x3f))); - out->length++; - } else { - hessian_write(out, (int)(0xe0 + ((ch >> 12) & 0xf))); - out->length++; - hessian_write(out, (int)(0x80 + ((ch >> 6) & 0x3f))); - out->length++; - hessian_write(out, (int)(0x80 + (ch & 0x3f))); - out->length++; - } - } - - return 0; -} - -void hessian_ensureCapacity(hessian_out_pt obj, int capacity) { - char *newArray; - int oldCapacity; - oldCapacity = obj->capacity; - if (capacity > oldCapacity) { - int newCapacity = (oldCapacity * 3) / 2 + 1; - if (newCapacity < capacity) { - newCapacity = capacity; - } - newArray = (char *) realloc(obj->buffer, sizeof(char *) * newCapacity); - obj->capacity = newCapacity; - obj->buffer = newArray; - } -} - -int hessian_write(hessian_out_pt out, unsigned char byte) { - out->buffer[out->offset++] = byte; - out->length++; - - return 0; -} - -int hessian_writeP(hessian_out_pt out, unsigned char *byte) { - out->buffer[out->offset++] = *byte; - out->length++; - - return 0; -} http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/hessian/source/private/test/test_hessian_out.c ---------------------------------------------------------------------- diff --git a/hessian/source/private/test/test_hessian_out.c b/hessian/source/private/test/test_hessian_out.c deleted file mode 100644 index 0c07401..0000000 --- a/hessian/source/private/test/test_hessian_out.c +++ /dev/null @@ -1,108 +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. - */ -/* - * test_hessian_out.c - * - * \date Aug 4, 2011 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#include <stdio.h> -#include <stdlib.h> -#include <Automated.h> - -#include "hessian_2.0_out.h" - -hessian_out_pt out; - -int setup() { - out = malloc(sizeof(*out)); - - return 0; -} - -void test_hessian_writeBoolean() { - out = malloc(sizeof(*out)); - out->offset = 0; - out->buffer = NULL; - out->capacity = 0; - out->chunkLength = 0; - out->lastChunk = false; - out->length = 0; - - hessian_writeBoolean(out, true); - - CU_ASSERT_EQUAL(out->length, 1); - CU_ASSERT_EQUAL(out->buffer[0], 'T'); -} - -void test_hessian_writeInt() { - out = malloc(sizeof(*out)); - out->offset = 0; - out->buffer = NULL; - out->capacity = 0; - out->chunkLength = 0; - out->lastChunk = false; - out->length = 0; - - hessian_writeInt(out, 0); - - unsigned char c1 = out->buffer[0]; - unsigned char expect = 0x90; - CU_ASSERT_EQUAL(out->length, 1); - CU_ASSERT_EQUAL(c1, expect); - - hessian_writeInt(out, -256); - - unsigned char c2[] = { out->buffer[1], out->buffer[2] }; - unsigned char expect2[] = { 0xC7, 0x00 }; - CU_ASSERT_EQUAL(out->length, 3); - // CU_ASSERT_EQUAL(c2, expect2); -} - -int main (int argc, char** argv) { - CU_pSuite pSuite = NULL; - - /* initialize the CUnit test registry */ - if (CUE_SUCCESS != CU_initialize_registry()) - return CU_get_error(); - - /* add a suite to the registry */ - pSuite = CU_add_suite("Hessian output", setup, NULL); - if (NULL == pSuite) { - CU_cleanup_registry(); - return CU_get_error(); - } - - /* add the tests to the suite */ - if ( - NULL == CU_add_test(pSuite, "test boolean", test_hessian_writeBoolean) - || NULL == CU_add_test(pSuite, "test int", test_hessian_writeInt) - ) { - CU_cleanup_registry(); - return CU_get_error(); - } - - CU_set_output_filename(argv[1]); - CU_list_tests_to_file(); - CU_automated_run_tests(); - CU_cleanup_registry(); - return CU_get_error(); -} http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/hessian/source/private/test/test_service.h ---------------------------------------------------------------------- diff --git a/hessian/source/private/test/test_service.h b/hessian/source/private/test/test_service.h deleted file mode 100644 index e1967e1..0000000 --- a/hessian/source/private/test/test_service.h +++ /dev/null @@ -1,35 +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. - */ -/* - * test_service.h - * - * \date Aug 5, 2011 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#ifndef TEST_SERVICE_H_ -#define TEST_SERVICE_H_ - -typedef struct test_service *test_service_pt; - -void testService_sayHello(test_service_pt testService, char *message); - - -#endif /* TEST_SERVICE_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/hessian/source/private/test/test_service_proxy.c ---------------------------------------------------------------------- diff --git a/hessian/source/private/test/test_service_proxy.c b/hessian/source/private/test/test_service_proxy.c deleted file mode 100644 index 75a609a..0000000 --- a/hessian/source/private/test/test_service_proxy.c +++ /dev/null @@ -1,35 +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. - */ -/* - * test_service_proxy.c - * - * \date Aug 5, 2011 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#include "hessian_2.0_out.h" - -void testServiceProxy_sayHello(char *message) { - hessian_out_pt out = malloc(sizeof(*out)); - - hessian_writeString(out, message); - - // tcp send out->buffer; -} http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/hessian/source/private/test/test_service_skeleton.c ---------------------------------------------------------------------- diff --git a/hessian/source/private/test/test_service_skeleton.c b/hessian/source/private/test/test_service_skeleton.c deleted file mode 100644 index 736fbd4..0000000 --- a/hessian/source/private/test/test_service_skeleton.c +++ /dev/null @@ -1,52 +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. - */ -/* - * test_service_skeleton.c - * - * \date Aug 5, 2011 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ -#include <stddef.h> -#include <stdio.h> - -#include "hessian_2.0_in.h" - -void testServiceSkeleton_sayHello(hessian_in_pt in); - -void testServiceSkeleton_handleData(hessian_in_pt in) { - char *method = NULL; - hessian_readCall(in, &method); - - switch (method) { - case "sayHello": - testServiceSkeleton_sayHello(in); - break; - default: - break; - } -} - -void testServiceSkeleton_sayHello(hessian_in_pt in) { - char *message = NULL; - int read; - hessian_readString(in, &message, &read); - - testService_sayHello(NULL, message); -} http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/hessian/source/public/include/hessian_2.0.h ---------------------------------------------------------------------- diff --git a/hessian/source/public/include/hessian_2.0.h b/hessian/source/public/include/hessian_2.0.h deleted file mode 100644 index 29dc052..0000000 --- a/hessian/source/public/include/hessian_2.0.h +++ /dev/null @@ -1,46 +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. - */ -/* - * hessian_2.0.h - * - * \date Aug 1, 2011 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#ifndef HESSIAN_2_0_H_ -#define HESSIAN_2_0_H_ - -#include "hessian_2.0_in.h" -#include "hessian_2.0_out.h" - -#include "hessian_constants.h" - -struct hessian { - long offset; - long length; - long capacity; - - unsigned char *buffer; - - bool lastChunk; - unsigned int chunkLength; -}; - -#endif /* HESSIAN_2_0_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/hessian/source/public/include/hessian_2.0_in.h ---------------------------------------------------------------------- diff --git a/hessian/source/public/include/hessian_2.0_in.h b/hessian/source/public/include/hessian_2.0_in.h deleted file mode 100644 index f39a1f6..0000000 --- a/hessian/source/public/include/hessian_2.0_in.h +++ /dev/null @@ -1,50 +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. - */ -/* - * hessian_2.0_in.h - * - * \date Aug 1, 2011 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#ifndef HESSIAN_2_0_IN_H_ -#define HESSIAN_2_0_IN_H_ - -#include <stdbool.h> - -#include "hessian_2.0.h" - -typedef struct hessian * hessian_in_pt; - -int hessian_readBoolean(hessian_in_pt in, bool *value); -int hessian_readInt(hessian_in_pt in, int *value); -int hessian_readLong(hessian_in_pt in, long *value); -int hessian_readDouble(hessian_in_pt in, double *value); -int hessian_readUTCDate(hessian_in_pt in, long *value); -int hessian_readNull(hessian_in_pt in); -int hessian_readChar(hessian_in_pt in, char *value); -int hessian_readString(hessian_in_pt in, char **value, unsigned int *readLength); -int hessian_readNString(hessian_in_pt in, int offset, int length, char **value, unsigned int *readLength); -int hessian_readByte(hessian_in_pt in, unsigned char *value); -int hessian_readBytes(hessian_in_pt in, unsigned char **value, unsigned int *readLength); -int hessian_readNBytes(hessian_in_pt in, int offset, int length, unsigned char **value, unsigned int *readLength); - - -#endif /* HESSIAN_2_0_IN_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/hessian/source/public/include/hessian_2.0_out.h ---------------------------------------------------------------------- diff --git a/hessian/source/public/include/hessian_2.0_out.h b/hessian/source/public/include/hessian_2.0_out.h deleted file mode 100644 index c1ccba5..0000000 --- a/hessian/source/public/include/hessian_2.0_out.h +++ /dev/null @@ -1,61 +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. - */ -/* - * hessian_2.0_out.h - * - * \date Jul 31, 2011 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#ifndef HESSIAN_2_0_OUT_H_ -#define HESSIAN_2_0_OUT_H_ - -#include <stdbool.h> - -//#include "linked_list.h" -//#include "array_list.h" -#include "hessian_2.0.h" - -typedef struct hessian * hessian_out_pt; - -int hessian_writeBoolean(hessian_out_pt out, bool value); -int hessian_writeInt(hessian_out_pt out, int value); -int hessian_writeLong(hessian_out_pt out, long value); -int hessian_writeDouble(hessian_out_pt out, double value); -int hessian_writeUTCDate(hessian_out_pt out, long value); -int hessian_writeNull(hessian_out_pt out); -int hessian_writeString(hessian_out_pt out, char *value); -int hessian_writeNString(hessian_out_pt out, char *value, int offset, int length); -int hessian_writeBytes(hessian_out_pt out, unsigned char value[], int length); -int hessian_writeNBytes(hessian_out_pt out, unsigned char value[], int offset, int length); - -int hessian_writeListBegin(hessian_out_pt out, int size, char *type); -int hessian_writeListEnd(hessian_out_pt out); - -int hessian_writeObjectBegin(hessian_out_pt out, char *type); -int hessian_writeObjectDefinition(hessian_out_pt out, char **fieldNames, int fields); -int hessian_writeObjectEnd(hessian_out_pt out); - -int hessian_startCall(hessian_out_pt out, char *method, int length); -int hessian_completeCall(hessian_out_pt out); - - - -#endif /* HESSIAN_2_0_OUT_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/hessian/source/public/include/hessian_constants.h ---------------------------------------------------------------------- diff --git a/hessian/source/public/include/hessian_constants.h b/hessian/source/public/include/hessian_constants.h deleted file mode 100644 index cf29fee..0000000 --- a/hessian/source/public/include/hessian_constants.h +++ /dev/null @@ -1,85 +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. - */ -/* - * hessian_constants.h - * - * \date Jul 31, 2011 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#ifndef HESSIAN_CONSTANTS_H_ -#define HESSIAN_CONSTANTS_H_ - -static int INT_DIRECT_MIN = -0x10; -static int INT_DIRECT_MAX = 0x2f; -static int INT_ZERO = 0x90; - -static int INT_BYTE_MIN = -0x800; -static int INT_BYTE_MAX = 0x7ff; -static int INT_BYTE_ZERO = 0xc8; - -static int INT_SHORT_MIN = -0x40000; -static int INT_SHORT_MAX = 0x3ffff; -static int INT_SHORT_ZERO = 0xd4; - -static long LONG_DIRECT_MIN = -0x08; -static long LONG_DIRECT_MAX = 0x0f; -static int LONG_ZERO = 0xe0; - -static long LONG_BYTE_MIN = -0x800; -static long LONG_BYTE_MAX = 0x7ff; -static int LONG_BYTE_ZERO = 0xf8; - -static int LONG_SHORT_MIN = -0x40000; -static int LONG_SHORT_MAX = 0x3ffff; -static int LONG_SHORT_ZERO = 0x3c; - -static int STRING_DIRECT_MAX = 0x1f; -static int STRING_DIRECT = 0x00; - -static int BYTES_DIRECT_MAX = 0x0f; -static int BYTES_DIRECT = 0x20; - // 0x30-0x37 is reserved - -static int LONG_INT = 0x77; - -static int DOUBLE_ZERO = 0x67; -static int DOUBLE_ONE = 0x68; -static int DOUBLE_BYTE = 0x69; -static int DOUBLE_SHORT = 0x6a; -static int DOUBLE_FLOAT = 0x6b; - -static int BC_END = 'Z'; - -static int BC_LIST_VARIABLE = 0x55; -static int BC_LIST_FIXED = 'V'; -static int BC_LIST_VARIABLE_UNTYPED = 0x57; -static int BC_LIST_FIXED_UNTYPED = 0x58; - -static int BC_LIST_DIRECT = 0x70; -static int BC_LIST_DIRECT_UNTYPED = 0x78; -static int LIST_DIRECT_MAX = 0x7; - -static int REF_BYTE = 0x4a; -static int REF_SHORT = 0x4b; - -static int TYPE_REF = 0x75; - -#endif /* HESSIAN_CONSTANTS_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/hessian/source/test.c ---------------------------------------------------------------------- diff --git a/hessian/source/test.c b/hessian/source/test.c deleted file mode 100644 index c19e4f7..0000000 --- a/hessian/source/test.c +++ /dev/null @@ -1,93 +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. - */ -/* - * test.c - * - * \date Jul 31, 2011 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ -#include <stdio.h> -#include <stdlib.h> - -#include "hessian_2.0_out.h" -#include "hessian_2.0_in.h" - -int main(int argc, char **argv) { - hessian_out_pt out = malloc(sizeof(*out)); - -// hessian_writeDouble(out, 12.25); -// hessian_writeUTCDate(out, 894621091000l); -// hessian_writeLong(out, 1324123l); -// hessian_writeString(out, "hello"); - unsigned char b[22]; - int i = 0; - b[i++] = 'a';b[i++] = 'b';b[i++] = 'c';b[i++] = 'd';b[i++] = 'e';b[i++] = 'f';b[i++] = 'g';b[i++] = 'h';b[i++] = 'i';b[i++] = 'j';b[i++] = 'k'; - b[i++] = 'l';b[i++] = 'm';b[i++] = 'n';b[i++] = 'o';b[i++] = 'p';b[i++] = 'q';b[i++] = 'r';b[i++] = 's';b[i++] = 't';b[i++] = 'u';b[i++] = 'v'; - - hessian_writeBytes(out, b, 22); -// hessian_writeListBegin(out, 1, "string"); -// hessian_writeString(out, "test"); -// hessian_writeListEnd(out); - - //4832798725635008448 - - double d = 81273459184.123; - char *langeString = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" - "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; - -// printf("Stringl: %d\n", strlen(langeString)); - -// hessian_writeString(out, langeString); - - - for (i = 0; i < out->offset; i++) { - printf("%X ", out->buffer[i]); - } - printf("\n"); - - - FILE *fp = fopen("mybinfile.ttt", "wb"); - - //the string length + 1 for the null terminator - fwrite(out->buffer, sizeof(char), out->offset, fp); - - fclose(fp); - - out->offset = 0; - unsigned char *rb = NULL; - int read; - rb = NULL; - hessian_readNBytes(out, 0, 10, &rb, &read); - printf("Read: %s\n", rb); - char ch; - hessian_readByte(out, &ch); - printf("Read: %c\n", ch); - hessian_readByte(out, &ch); - printf("Read: %c\n", ch); - hessian_readByte(out, &ch); - printf("Read: %c\n", ch); - hessian_readByte(out, &ch); - printf("Read: %c\n", ch); - rb = NULL; - hessian_readNBytes(out, 0, 10, &rb, &read); - printf("Read: %s\n", rb); - printf("Read: %d\n", read); -} - http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/rat-excludes.txt ---------------------------------------------------------------------- diff --git a/rat-excludes.txt b/rat-excludes.txt index b9109e8..45c1e75 100644 --- a/rat-excludes.txt +++ b/rat-excludes.txt @@ -30,10 +30,6 @@ Todo: Why doesn't RAT exclude these files when using a full path? -cmake/config.properties.in -cmake/run.sh.in -cmake/RunConfig.in - Doxyfile.in Workaround to exclude .in files. http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/scr/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/scr/CMakeLists.txt b/scr/CMakeLists.txt deleted file mode 100644 index 88c95a7..0000000 --- a/scr/CMakeLists.txt +++ /dev/null @@ -1,27 +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. -celix_subproject(SCR "Option to build the SCR static library" OFF DEPS LAUNCHER FRAMEWORK SHELL SHELL_TUI) -if (SCR) - if(NOT ${WITH_APR}) - message(FATAL_ERROR "SCR requires APR, enable WITH_APR option.") - endif() - add_subdirectory(scr) - add_subdirectory(test) - - deploy(scr-test BUNDLES shell shell_tui scr_test scr) -endif (SCR) - http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/scr/scr/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/scr/scr/CMakeLists.txt b/scr/scr/CMakeLists.txt deleted file mode 100644 index c236832..0000000 --- a/scr/scr/CMakeLists.txt +++ /dev/null @@ -1,31 +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(FindLibXml2) -include_directories(${LIBXML2_INCLUDE_DIR}) - -add_bundle(scr SOURCES - scr.c - private/src/xml_parser.c - private/src/component_metadata.c - private/src/service_metadata.c - private/src/reference_metadata.c - ) -include_directories("public/include") -include_directories("private/include") -include_directories("${PROJECT_SOURCE_DIR}/utils/public/include") -target_link_libraries(scr celix_framework ${LIBXML2_LIBRARIES}) http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/scr/scr/META-INF/MANIFEST.MF ---------------------------------------------------------------------- diff --git a/scr/scr/META-INF/MANIFEST.MF b/scr/scr/META-INF/MANIFEST.MF deleted file mode 100644 index 2e59cfb..0000000 --- a/scr/scr/META-INF/MANIFEST.MF +++ /dev/null @@ -1,20 +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. - -Bundle-SymbolicName: scr -Bundle-Version: 1.0.0 -library: scr http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/scr/scr/private/include/component_metadata.h ---------------------------------------------------------------------- diff --git a/scr/scr/private/include/component_metadata.h b/scr/scr/private/include/component_metadata.h deleted file mode 100644 index 8c00c8f..0000000 --- a/scr/scr/private/include/component_metadata.h +++ /dev/null @@ -1,80 +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. - */ -/* - * component_metadata.h - * - * \date Nov 3, 2015 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - -#ifndef COMPONENT_METADATA_H_ -#define COMPONENT_METADATA_H_ - -#include <stdbool.h> - -#include <celix_errno.h> - -#include "service_metadata.h" -#include "reference_metadata.h" - -typedef struct component *component_t; - -celix_status_t component_create(apr_pool_t *pool, component_t *component); - -celix_status_t component_getName(component_t component, char **name); -celix_status_t component_setName(component_t component, char *name); - -celix_status_t component_isEnabled(component_t component, bool *enabled); -celix_status_t component_setEnabled(component_t component, bool enabled); - -celix_status_t component_isImmediate(component_t component, bool *immediate); -celix_status_t component_setImmediate(component_t component, bool immediate); - -celix_status_t component_getFactoryIdentifier(component_t component, char **factoryIdentifier); -celix_status_t component_setFactoryIdentifier(component_t component, char *factoryIdentifier); - -celix_status_t component_getConfigurationPolicy(component_t component, char **configurationPolicy); -celix_status_t component_setConfigurationPolicy(component_t component, char *configurationPolicy); - -celix_status_t component_getActivate(component_t component, char **activate); -celix_status_t component_setActivate(component_t component, char *activate); - -celix_status_t component_getActivate(component_t component, char **activate); -celix_status_t component_setActivate(component_t component, char *activate); - -celix_status_t component_getActivate(component_t component, char **activate); -celix_status_t component_setActivate(component_t component, char *activate); - -celix_status_t component_getDeactivate(component_t component, char **deactivate); -celix_status_t component_setDeactivate(component_t component, char *deactivate); - -celix_status_t component_getModified(component_t component, char **modified); -celix_status_t component_setModified(component_t component, char *modified); - -celix_status_t component_getImplementationClassName(component_t component, char **implementationClassName); -celix_status_t component_setImplementationClassName(component_t component, char *implementationClassName); - -celix_status_t componentMetadata_getService(component_t component, service_t *service); -celix_status_t componentMetadata_setService(component_t component, service_t service); - -celix_status_t componentMetadata_getDependencies(component_t component, reference_metadata_t *reference[], int *size); -celix_status_t componentMetadata_addDependency(component_t component, reference_metadata_t reference); - -#endif /* COMPONENT_METADATA_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/scr/scr/private/include/reference_metadata.h ---------------------------------------------------------------------- diff --git a/scr/scr/private/include/reference_metadata.h b/scr/scr/private/include/reference_metadata.h deleted file mode 100644 index cf2db48..0000000 --- a/scr/scr/private/include/reference_metadata.h +++ /dev/null @@ -1,64 +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. - */ -/* - * reference_metadata.h - * - * \date Nov 3, 2015 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ -#ifndef REFERENCE_METADATA_H_ -#define REFERENCE_METADATA_H_ - -#include <stdbool.h> -#include <apr_general.h> - -#include <celix_errno.h> - -typedef struct reference_metadata *reference_metadata_t; - -celix_status_t referenceMetadata_create(apr_pool_t *pool, reference_metadata_t *reference); - -celix_status_t referenceMetadata_setName(reference_metadata_t reference, char *name); -celix_status_t referenceMetadata_getName(reference_metadata_t reference, char **name); - -celix_status_t referenceMetadata_setInterface(reference_metadata_t reference, char *interface); -celix_status_t referenceMetadata_getInterface(reference_metadata_t reference, char **interface); - -celix_status_t referenceMetadata_setCardinality(reference_metadata_t reference, char *cardinality); -celix_status_t referenceMetadata_getCardinality(reference_metadata_t reference, char **cardinality); - -celix_status_t referenceMetadata_setPolicy(reference_metadata_t reference, char *policy); -celix_status_t referenceMetadata_getPolicy(reference_metadata_t reference, char **policy); - -celix_status_t referenceMetadata_setTarget(reference_metadata_t reference, char *target); -celix_status_t referenceMetadata_getTarget(reference_metadata_t reference, char **target); - -celix_status_t referenceMetadata_setBind(reference_metadata_t reference, char *bind); -celix_status_t referenceMetadata_getBind(reference_metadata_t reference, char **bind); - -celix_status_t referenceMetadata_setUpdated(reference_metadata_t reference, char *updated); -celix_status_t referenceMetadata_getUpdated(reference_metadata_t reference, char **updated); - -celix_status_t referenceMetadata_setUnbind(reference_metadata_t reference, char *unbind); -celix_status_t referenceMetadata_getUnbind(reference_metadata_t reference, char **unbind); - - - -#endif /* REFERENCE_METADATA_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/scr/scr/private/include/service_metadata.h ---------------------------------------------------------------------- diff --git a/scr/scr/private/include/service_metadata.h b/scr/scr/private/include/service_metadata.h deleted file mode 100644 index fe46863..0000000 --- a/scr/scr/private/include/service_metadata.h +++ /dev/null @@ -1,44 +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. - */ -/* - * service_metadata.h - * - * \date Nov 3, 2015 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ -#ifndef SERVICE_METADATA_H_ -#define SERVICE_METADATA_H_ - -#include <stdbool.h> -#include <apr_general.h> - -#include <celix_errno.h> - -typedef struct service *service_t; - -celix_status_t service_create(apr_pool_t *pool, service_t *component); - -celix_status_t serviceMetadata_setServiceFactory(service_t currentService, bool serviceFactory); -celix_status_t serviceMetadata_isServiceFactory(service_t currentService, bool *serviceFactory); - -celix_status_t serviceMetadata_addProvide(service_t service, char *provide); -celix_status_t serviceMetadata_getProvides(service_t service, char **provides[], int *size); - -#endif /* SERVICE_METADATA_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/scr/scr/private/include/xml_parser_impl.h ---------------------------------------------------------------------- diff --git a/scr/scr/private/include/xml_parser_impl.h b/scr/scr/private/include/xml_parser_impl.h deleted file mode 100644 index 5465606..0000000 --- a/scr/scr/private/include/xml_parser_impl.h +++ /dev/null @@ -1,36 +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. - */ -/* - * xml_parser_impl.h - * - * \date Nov 3, 2015 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ -#ifndef XML_PARSER_IMPL_H_ -#define XML_PARSER_IMPL_H_ - -#include "component_metadata.h" - -typedef struct xml_parser *xml_parser_t; - -celix_status_t xmlParser_create(apr_pool_t *pool, xml_parser_t *parser); -celix_status_t xmlParser_parseComponent(xml_parser_t parser, char *componentEntry, component_t *component); - -#endif /* XML_PARSER_IMPL_H_ */ http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/scr/scr/private/src/component_metadata.c ---------------------------------------------------------------------- diff --git a/scr/scr/private/src/component_metadata.c b/scr/scr/private/src/component_metadata.c deleted file mode 100644 index f55788f..0000000 --- a/scr/scr/private/src/component_metadata.c +++ /dev/null @@ -1,188 +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. - */ -/* - * comopnent_metadata.c - * - * \date Nov 3, 2015 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ -#include <stdlib.h> - -#include <array_list.h> - -#include "component_metadata.h" - -struct component { - apr_pool_t *pool; - - char *name; - bool enabled; - bool immediate; - char *factoryIdentifier; - char *configurationPolicy; - char *activate; - char *deactivate; - char *modified; - - char *implementationClassName; - - service_t service; - - ARRAY_LIST references; -}; - -celix_status_t component_create(apr_pool_t *pool, component_t *component) { - *component = malloc(sizeof(**component)); - (*component)->pool = pool; - - (*component)->name = NULL; - (*component)->enabled = true; - (*component)->immediate = false; - (*component)->factoryIdentifier = NULL; - (*component)->configurationPolicy = NULL; - (*component)->activate = NULL; - (*component)->deactivate = NULL; - (*component)->modified = NULL; - - (*component)->implementationClassName = NULL; - - (*component)->service = NULL; - - arrayList_create(pool, &(*component)->references); - - return CELIX_SUCCESS; -} - -celix_status_t component_getName(component_t component, char **name) { - *name = component->name; - return CELIX_SUCCESS; -} - -celix_status_t component_setName(component_t component, char *name) { - component->name = name; - return CELIX_SUCCESS; -} - -celix_status_t component_isEnabled(component_t component, bool *enabled) { - *enabled = component->enabled; - return CELIX_SUCCESS; -} - -celix_status_t component_setEnabled(component_t component, bool enabled) { - component->enabled = enabled; - return CELIX_SUCCESS; -} - -celix_status_t component_isImmediate(component_t component, bool *immediate) { - *immediate = component->immediate; - return CELIX_SUCCESS; -} - -celix_status_t component_setImmediate(component_t component, bool immediate) { - component->enabled = immediate; - return CELIX_SUCCESS; -} - -celix_status_t component_getFactoryIdentifier(component_t component, char **factoryIdentifier) { - *factoryIdentifier = component->factoryIdentifier; - return CELIX_SUCCESS; -} - -celix_status_t component_setFactoryIdentifier(component_t component, char *factoryIdentifier) { - component->factoryIdentifier = factoryIdentifier; - return CELIX_SUCCESS; -} - -celix_status_t component_getConfigurationPolicy(component_t component, char **configurationPolicy) { - *configurationPolicy = component->configurationPolicy; - return CELIX_SUCCESS; -} - -celix_status_t component_setConfigurationPolicy(component_t component, char *configurationPolicy) { - component->configurationPolicy = configurationPolicy; - return CELIX_SUCCESS; -} - -celix_status_t component_getActivate(component_t component, char **activate) { - *activate = component->activate; - return CELIX_SUCCESS; -} - -celix_status_t component_setActivate(component_t component, char *activate) { - component->activate = activate; - return CELIX_SUCCESS; -} - -celix_status_t component_getDeactivate(component_t component, char **deactivate) { - *deactivate = component->deactivate; - return CELIX_SUCCESS; -} - -celix_status_t component_setDeactivate(component_t component, char *deactivate) { - component->deactivate = deactivate; - return CELIX_SUCCESS; -} - -celix_status_t component_getModified(component_t component, char **modified) { - *modified = component->modified; - return CELIX_SUCCESS; -} - -celix_status_t component_setModified(component_t component, char *modified) { - component->modified = modified; - return CELIX_SUCCESS; -} - -celix_status_t component_getImplementationClassName(component_t component, char **implementationClassName) { - *implementationClassName = component->implementationClassName; - return CELIX_SUCCESS; -} - -celix_status_t component_setImplementationClassName(component_t component, char *implementationClassName) { - component->implementationClassName = implementationClassName; - return CELIX_SUCCESS; -} - -celix_status_t componentMetadata_getService(component_t component, service_t *service) { - *service = component->service; - return CELIX_SUCCESS; -} - -celix_status_t componentMetadata_setService(component_t component, service_t service) { - component->service = service; - return CELIX_SUCCESS; -} - -celix_status_t componentMetadata_getDependencies(component_t component, reference_metadata_t *references[], int *size) { - *size = arrayList_size(component->references); - reference_metadata_t *referencesA = malloc(*size * sizeof(*referencesA)); - int i; - for (i = 0; i < *size; i++) { - reference_metadata_t ref = arrayList_get(component->references, i); - referencesA[i] = ref; - } - *references = referencesA; - return CELIX_SUCCESS; -} - -celix_status_t componentMetadata_addDependency(component_t component, reference_metadata_t reference) { - arrayList_add(component->references, reference); - return CELIX_SUCCESS; -} http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/scr/scr/private/src/component_registry.c ---------------------------------------------------------------------- diff --git a/scr/scr/private/src/component_registry.c b/scr/scr/private/src/component_registry.c deleted file mode 100644 index b09254f..0000000 --- a/scr/scr/private/src/component_registry.c +++ /dev/null @@ -1,30 +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. - */ -/* - * component_registry.c - * - * \date Nov 15, 2012 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ - - - - - http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/scr/scr/private/src/reference_metadata.c ---------------------------------------------------------------------- diff --git a/scr/scr/private/src/reference_metadata.c b/scr/scr/private/src/reference_metadata.c deleted file mode 100644 index 8545eb1..0000000 --- a/scr/scr/private/src/reference_metadata.c +++ /dev/null @@ -1,128 +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. - */ -/* - * reference_metadata.c - * - * \date Nov 3, 2015 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ -#include <stdlib.h> - -#include "reference_metadata.h" - -struct reference_metadata { - char *name; - char *interface; - char *cardinality; - char *policy; - char *target; - char *bind; - char *updated; - char *unbind; -}; - -celix_status_t referenceMetadata_create(apr_pool_t *pool, reference_metadata_t *reference) { - *reference = apr_palloc(pool, sizeof(**reference)); - (*reference)->name = NULL; - - return CELIX_SUCCESS; -} - -celix_status_t referenceMetadata_setName(reference_metadata_t reference, char *name) { - reference->name = name; - return CELIX_SUCCESS; -} - -celix_status_t referenceMetadata_getName(reference_metadata_t reference, char **name) { - *name = reference->name; - return CELIX_SUCCESS; -} - -celix_status_t referenceMetadata_setInterface(reference_metadata_t reference, char *interface) { - reference->interface = interface; - return CELIX_SUCCESS; -} - -celix_status_t referenceMetadata_getInterface(reference_metadata_t reference, char **interface) { - *interface = reference->interface; - return CELIX_SUCCESS; -} - -celix_status_t referenceMetadata_setCardinality(reference_metadata_t reference, char *cardinality) { - reference->cardinality = cardinality; - return CELIX_SUCCESS; -} - -celix_status_t referenceMetadata_getCardinality(reference_metadata_t reference, char **cardinality) { - *cardinality = reference->cardinality; - return CELIX_SUCCESS; -} - -celix_status_t referenceMetadata_setPolicy(reference_metadata_t reference, char *policy) { - reference->policy = policy; - return CELIX_SUCCESS; -} - -celix_status_t referenceMetadata_getPolicy(reference_metadata_t reference, char **policy) { - *policy = reference->policy; - return CELIX_SUCCESS; -} - -celix_status_t referenceMetadata_setTarget(reference_metadata_t reference, char *target) { - reference->target = target; - return CELIX_SUCCESS; -} - -celix_status_t referenceMetadata_getTarget(reference_metadata_t reference, char **target) { - *target = reference->target; - return CELIX_SUCCESS; -} - -celix_status_t referenceMetadata_setBind(reference_metadata_t reference, char *bind) { - reference->bind = bind; - return CELIX_SUCCESS; -} - -celix_status_t referenceMetadata_getBind(reference_metadata_t reference, char **bind) { - *bind = reference->bind; - return CELIX_SUCCESS; -} - -celix_status_t referenceMetadata_setUpdated(reference_metadata_t reference, char *updated) { - reference->updated = updated; - return CELIX_SUCCESS; -} - -celix_status_t referenceMetadata_getUpdated(reference_metadata_t reference, char **updated) { - *updated = reference->updated; - return CELIX_SUCCESS; -} - -celix_status_t referenceMetadata_setUnbind(reference_metadata_t reference, char *unbind) { - reference->unbind = unbind; - return CELIX_SUCCESS; -} - -celix_status_t referenceMetadata_getUnbind(reference_metadata_t reference, char **unbind) { - *unbind = reference->unbind; - return CELIX_SUCCESS; -} - - http://git-wip-us.apache.org/repos/asf/celix/blob/5a8109d6/scr/scr/private/src/service_metadata.c ---------------------------------------------------------------------- diff --git a/scr/scr/private/src/service_metadata.c b/scr/scr/private/src/service_metadata.c deleted file mode 100644 index e935cfe..0000000 --- a/scr/scr/private/src/service_metadata.c +++ /dev/null @@ -1,72 +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. - */ -/* - * service_metadata.c - * - * \date Nov 3, 2015 - * \author <a href="mailto:d...@celix.apache.org">Apache Celix Project Team</a> - * \copyright Apache License, Version 2.0 - */ -#include <stdlib.h> - -#include "array_list.h" - -#include "service_metadata.h" - -struct service { - bool serviceFactory; - - ARRAY_LIST provides; - -}; - -celix_status_t service_create(apr_pool_t *pool, service_t *service) { - *service = malloc(sizeof(**service)); - (*service)->serviceFactory = false; - arrayList_create(pool, &(*service)->provides); - - return CELIX_SUCCESS; -} - -celix_status_t serviceMetadata_setServiceFactory(service_t currentService, bool serviceFactory) { - currentService->serviceFactory = serviceFactory; - return CELIX_SUCCESS; -} - -celix_status_t serviceMetadata_isServiceFactory(service_t currentService, bool *serviceFactory) { - *serviceFactory = currentService->serviceFactory; - return CELIX_SUCCESS; -} - -celix_status_t serviceMetadata_addProvide(service_t service, char *provide) { - arrayList_add(service->provides, provide); - return CELIX_SUCCESS; -} - -celix_status_t serviceMetadata_getProvides(service_t service, char **provides[], int *size) { - *size = arrayList_size(service->provides); - char **providesA = malloc(*size * sizeof(*providesA)); - int i; - for (i = 0; i < *size; i++) { - providesA[i] = arrayList_get(service->provides, i); - } - - *provides = providesA; - return CELIX_SUCCESS; -}