Loading Makefile +28 −13 Original line number Diff line number Diff line Loading @@ -7,6 +7,13 @@ OUT_DIR = ./obj BIN_DIR = ./bin PUB_INC = ./include #------------------------------------------------------------------------------- # SSL/TLS Library Options #------------------------------------------------------------------------------- # FIXME: Currently OSX/homebrew specific, rework before integration. OPENSSL_PATH ?= . #=============================================================================== # Shared Build Variables #=============================================================================== Loading @@ -18,7 +25,7 @@ SESSION_PIN ?= \"1234\" WARN = -Wall -Wextra -Wstrict-prototypes -Wcast-align -pedantic -Wno-missing-field-initializers -Werror=strict-prototypes CDEFS += -D_POSIX_C_SOURCE=199309L -D_C99_SOURCE=1 -DSYSTEM_TEST_HOST=\"${SYSTEM_TEST_HOST}\" -DCLUSTER_VERSION=${CLUSTER_VERSION} CFLAGS += -std=c99 -fPIC -g $(WARN) $(CDEFS) $(OPTIMIZE) LDFLAGS += -lm -lcrypto -lssl -lpthread LDFLAGS += -lm -L${OPENSSL_PATH}/lib -lcrypto -lssl -lpthread #=============================================================================== # Kinetic-C Library Build Support Loading @@ -35,10 +42,11 @@ VERSION_FILE = ./config/VERSION VERSION = ${shell head -n1 $(VERSION_FILE)} THREADPOOL_PATH = ${LIB_DIR}/threadpool BUS_PATH = ${LIB_DIR}/bus KINETIC_LIB_NAME = $(PROJECT).$(VERSION) KINETIC_LIB = $(BIN_DIR)/lib$(KINETIC_LIB_NAME).a LIB_INCS = -I$(LIB_DIR) -I$(PUB_INC) -I$(PROTOBUFC) -I$(SOCKET99) -I$(VENDOR) \ -I$(THREADPOOL_PATH) -I$(BUS_PATH) -I$(THREADPOOL_PATH) -I$(BUS_PATH) -I${OPENSSL_PATH}/include C_SRC=${LIB_DIR}/*.[ch] $(SOCKET99)/socket99.[ch] $(PROTOBUFC)/protobuf-c/protobuf-c.[ch] Loading @@ -50,6 +58,7 @@ LIB_OBJS = \ $(OUT_DIR)/kinetic_operation.o \ $(OUT_DIR)/kinetic_pdu.o \ $(OUT_DIR)/kinetic_auth.o \ $(OUT_DIR)/kinetic_pdu_unpack.o \ $(OUT_DIR)/kinetic_proto.o \ $(OUT_DIR)/kinetic_socket.o \ $(OUT_DIR)/kinetic_message.o \ Loading @@ -66,6 +75,7 @@ LIB_OBJS = \ $(OUT_DIR)/kinetic_admin_client.o \ $(OUT_DIR)/threadpool.o \ $(OUT_DIR)/bus.o \ $(OUT_DIR)/bus_ssl.o \ $(OUT_DIR)/casq.o \ $(OUT_DIR)/listener.o \ $(OUT_DIR)/sender.o \ Loading @@ -73,6 +83,7 @@ LIB_OBJS = \ $(OUT_DIR)/yacht.o \ KINETIC_LIB_OTHER_DEPS = Makefile Rakefile $(VERSION_FILE) Loading @@ -84,7 +95,8 @@ makedirs: all: default test system_tests test_internals run examples clean: makedirs update_git_submodules rm -rf ./bin/** rm -rf ./bin/**/* rm ./bin/*.* rm -f $(OUT_DIR)/*.o $(OUT_DIR)/*.a *.core *.log bundle exec rake clobber -./vendor/kinetic-simulator/stopSimulator.sh &> /dev/null; Loading Loading @@ -122,7 +134,7 @@ $(OUT_DIR)/threadpool.o: ${LIB_DIR}/threadpool/threadpool.c ${LIB_DIR}/threadpoo $(CC) -o $@ -c $< $(CFLAGS) $(OUT_DIR)/%.o: ${LIB_DIR}/bus/%.c ${LIB_DIR}/bus/%.h $(CC) -o $@ -c $< $(CFLAGS) -I${THREADPOOL_PATH} -I${BUS_PATH} $(CC) -o $@ -c $< $(CFLAGS) -I${THREADPOOL_PATH} -I${BUS_PATH} ${LIB_INCS} ${OUT_DIR}/*.o: src/lib/kinetic_types_internal.h Loading Loading @@ -166,7 +178,7 @@ test_bus: test_threadpool ${OUT_DIR}/libsocket99.a ${OUT_DIR}/libthreadpool.a #------------------------------------------------------------------------------- ${OUT_DIR}/libsocket99.a: ${SOCKET99}/*.[ch] cd ${SOCKET99} && make CDEFS=-D_C99_SOURCE=1 all cd ${SOCKET99} && make all cp ${SOCKET99}/libsocket99.a $@ ${OUT_DIR}/libthreadpool.a: ${LIB_DIR}/threadpool/*.[ch] Loading Loading @@ -214,8 +226,10 @@ install: $(KINETIC_LIB) $(KINETIC_SO_DEV) $(INSTALL) -d $(PREFIX)${LIBDIR} $(INSTALL) -c $(KINETIC_LIB) $(PREFIX)${LIBDIR}/ $(INSTALL) -d $(PREFIX)/include/ $(INSTALL) -c $(PUB_INC)/$(API_NAME).h $(PREFIX)/include/ $(INSTALL) -c $(PUB_INC)/kinetic_client.h $(PREFIX)/include/ $(INSTALL) -c $(PUB_INC)/kinetic_admin_client.h $(PREFIX)/include/ $(INSTALL) -c $(PUB_INC)/kinetic_types.h $(PREFIX)/include/ $(INSTALL) -c $(PUB_INC)/byte_array.h $(PREFIX)/include/ uninstall: @echo Loading @@ -225,12 +239,10 @@ uninstall: @echo $(RM) -f $(PREFIX)${LIBDIR}/lib$(PROJECT)*.a $(RM) -f $(PREFIX)${LIBDIR}/lib$(PROJECT)*.so $(RM) -f $(PREFIX)/include/${API_NAME}.h $(RM) -f $(PREFIX)/include/kinetic_admin_api.h $(RM) -f $(PREFIX)/include/kinetic_client.h $(RM) -f $(PREFIX)/include/kinetic_admin_client.h $(RM) -f $(PREFIX)/include/kinetic_types.h $(RM) -f $(PREFIX)/include/kinetic_proto.h $(RM) -f $(PREFIX)/include/protobuf-c/protobuf-c.h $(RM) -f $(PREFIX)/include/protobuf-c.h $(RM) -f $(PREFIX)/include/byte_array.h .PHONY: install uninstall Loading Loading @@ -308,9 +320,10 @@ unit_tests: start_simulator $(unit_passfiles) # System Tests #=============================================================================== SYSTEST_SRC = ./test/system SYSTEST_OUT = $(BIN_DIR)/systest SYSTEST_LDFLAGS += -lm -l ssl $(KINETIC_LIB) -l crypto -l pthread SYSTEST_LDFLAGS += -lm -L${OPENSSL_PATH}/lib -lssl -lcrypto $(KINETIC_LIB) -l pthread SYSTEST_WARN = -Wall -Wextra -Wstrict-prototypes -pedantic -Wno-missing-field-initializers -Werror=strict-prototypes -Wno-nonnull SYSTEST_CFLAGS += -std=c99 -fPIC -g $(SYSTEST_WARN) $(CDEFS) $(OPTIMIZE) -DTEST Loading @@ -320,6 +333,8 @@ systest_results = $(patsubst $(SYSTEST_OUT)/run_%,$(SYSTEST_OUT)/%.log,$(systest systest_passfiles = $(patsubst $(SYSTEST_OUT)/run_%,$(SYSTEST_OUT)/%.testpass,$(systest_executables)) systest_names = $(patsubst $(SYSTEST_OUT)/run_%,%,$(systest_executables)) .SECONDARY: $(systest_executables) list_system_tests: echo $(systest_names) Loading Loading @@ -360,7 +375,7 @@ UTILITY = kinetic-c-util UTIL_DIR = ./src/utility UTIL_EXEC = $(BIN_DIR)/$(UTILITY) UTIL_OBJ = $(OUT_DIR)/main.o UTIL_LDFLAGS += -lm -lssl $(KINETIC_LIB) -lcrypto -lpthread UTIL_LDFLAGS += -lm -L${OPENSSL_PATH}/lib -lssl $(KINETIC_LIB) -lcrypto -lpthread $(UTIL_OBJ): $(UTIL_DIR)/main.c $(CC) -c -o $@ $< $(CFLAGS) -I$(PUB_INC) -I$(UTIL_DIR) Loading include/kinetic_admin_client.h +2 −2 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ void KineticAdminClient_Init(const char* log_file, int log_level); /** * @brief Performs shutdown/cleanup of the kinetic-c client lib */ void KineticAdminClient_Shutdown(void); void KineticAdminClient_Shutdown(KineticClient * const client); /** * @brief Initializes the Kinetic API, configures logging destination, establishes a Loading @@ -58,7 +58,7 @@ void KineticAdminClient_Shutdown(void); * order to shutdown a connection and cleanup resources when * done using a KineticSession. */ KineticStatus KineticAdminClient_CreateConnection(KineticSession * const session); KineticStatus KineticAdminClient_CreateConnection(KineticSession * const session, KineticClient * const client); /** * @brief Closes the connection to a host. Loading include/kinetic_client.h +7 −3 Original line number Diff line number Diff line Loading @@ -29,12 +29,12 @@ * @param log_file (path to log file, 'stdout' to log to STDOUT, NULL to disable logging) * @param log_level Logging level (-1:none, 0:error, 1:info, 2:verbose, 3:full) */ void KineticClient_Init(const char* log_file, int log_level); KineticClient * KineticClient_Init(const char* log_file, int log_level); /** * @brief Performs shutdown/cleanup of the kinetic-c client lib */ void KineticClient_Shutdown(void); void KineticClient_Shutdown(KineticClient * const client); /** * @brief Initializes the Kinetic API, configures logging destination, establishes a Loading @@ -57,7 +57,7 @@ void KineticClient_Shutdown(void); * order to shutdown a connection and cleanup resources when * done using a KineticSession. */ KineticStatus KineticClient_CreateConnection(KineticSession * const session); KineticStatus KineticClient_CreateConnection(KineticSession * const session, KineticClient * const client); /** * @brief Closes the connection to a host. Loading Loading @@ -223,4 +223,8 @@ KineticStatus KineticClient_P2POperation(KineticSession const * const session, KineticP2P_Operation* const p2pOp, KineticCompletionClosure* closure); #ifdef TEST #include "kinetic_types_internal.h" #endif #endif // _KINETIC_CLIENT_H include/kinetic_types.h +4 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,10 @@ typedef enum _KineticSynchronization { } KineticSynchronization; struct _KineticClient; typedef struct _KineticClient KineticClient; /** * @brief Kinetic Connection Instance */ Loading kinetic-c.sublime-project +181 −144 Original line number Diff line number Diff line { "build_systems": [ { "cmd": "make", "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Default Build", "working_dir": "${project_path}" }, { "cmd": [ "make", "test" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Run all tests (full)", "working_dir": "${project_path}" }, { "cmd": [ "rake", "CC=/usr/bin/CC", "test:${file_name}" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Test current module w/Clang", "selector": [ "source.c", "source.c++" ], "working_dir": "${project_path}" }, { "cmd": [ "rake", "CC=gcc-4.9", "test:${file_name}" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Test current module w/GCC", "selector": [ "source.c", "source.c++" ], "working_dir": "${project_path}" }, { "cmd": [ "make", "utility" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build test utility", "working_dir": "${project_path}" }, { "cmd": [ "make", "${file_base_name}" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build and run system test", "working_dir": "${project_path}" }, { "cmd": [ "make", "run" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build and run test utility", "working_dir": "${project_path}" }, { "cmd": [ "make", "examples" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build and run examples", "working_dir": "${project_path}" }, { "cmd": [ "make", "all" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Full CI build", "working_dir": "${project_path}" } ], "folders": [ { "follow_symlinks": true, "path": ".", "folder_exclude_patterns": ["build", "vendor/bundle"], "binary_file_patterns": ["build"] "folder_exclude_patterns": [ "build", "vendor/bundle" ], "path": "." } ], "settings": Loading Loading @@ -73,16 +176,6 @@ "build" ], "index_files": true, // "rulers": // [ // 80, // 100 // ], "tab_size": 4, "translate_tabs_to_spaces": true, "trim_automatic_white_space": true, "word_wrap": "true", "wrap_width": 0, "sublimeclang_dont_prepend_clang_includes": true, "sublimeclang_options": [ Loading @@ -105,80 +198,24 @@ "-Wno-missing-field-initializers", "-O", "-xc", "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/", // "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1", // "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1/tr1", "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers", "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/", "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers", "-I${folder:${project_path:kinetic-c.sublime-project}}/src/**", "-I${folder:${project_path:kinetic-c.sublime-project}}/include", "-I${folder:${project_path:kinetic-c.sublime-project}}/test/**", // "-I${folder:${project_path:kinetic-c.sublime-project}}/vendor/**", "-I${folder:${project_path:kinetic-c.sublime-project}}/vendor/protobuf-c", "-I${folder:${project_path:kinetic-c.sublime-project}}/vendor/socket99", "-I${folder:${project_path:kinetic-c.sublime-project}}/vendor/bundle/ruby/2.0.0/gems/ceedling-0.15.6/vendor/unity/src", "-I${folder:${project_path:kinetic-c.sublime-project}}/build/test/mocks", "-I${folder:${project_path:kinetic-c.sublime-project}}/test/support/stubs", "-I${folder:${project_path:kinetic-c.sublime-project}}/test/support" ] }, "build_systems": [ { "cmd": "make", "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Default Build", "working_dir": "${project_path}" }, { "cmd": ["make", "test"], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Run all tests (full)", "working_dir": "${project_path}" }, { "cmd": ["rake", "CC=/usr/bin/CC", "test:${file_name}"], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Test current module w/Clang", "selector": ["source.c", "source.c++"], "working_dir": "${project_path}" }, { "cmd": ["rake", "CC=gcc-4.9", "test:${file_name}"], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Test current module w/GCC", "selector": ["source.c", "source.c++"], "working_dir": "${project_path}" }, { "cmd": ["make", "utility"], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build test utility", "working_dir": "${project_path}" }, { "cmd": ["make", "${file_base_name}"], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build and run system test", "working_dir": "${project_path}" }, { "cmd": ["make", "run"], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build and run test utility", "working_dir": "${project_path}" }, { "cmd": ["make", "examples"], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build and run examples", "working_dir": "${project_path}" }, { "cmd": ["make", "all"], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Full CI build", "working_dir": "${project_path}" ], "tab_size": 4, "translate_tabs_to_spaces": true, "trim_automatic_white_space": true, "word_wrap": "true", "wrap_width": 0 } ] } Loading
Makefile +28 −13 Original line number Diff line number Diff line Loading @@ -7,6 +7,13 @@ OUT_DIR = ./obj BIN_DIR = ./bin PUB_INC = ./include #------------------------------------------------------------------------------- # SSL/TLS Library Options #------------------------------------------------------------------------------- # FIXME: Currently OSX/homebrew specific, rework before integration. OPENSSL_PATH ?= . #=============================================================================== # Shared Build Variables #=============================================================================== Loading @@ -18,7 +25,7 @@ SESSION_PIN ?= \"1234\" WARN = -Wall -Wextra -Wstrict-prototypes -Wcast-align -pedantic -Wno-missing-field-initializers -Werror=strict-prototypes CDEFS += -D_POSIX_C_SOURCE=199309L -D_C99_SOURCE=1 -DSYSTEM_TEST_HOST=\"${SYSTEM_TEST_HOST}\" -DCLUSTER_VERSION=${CLUSTER_VERSION} CFLAGS += -std=c99 -fPIC -g $(WARN) $(CDEFS) $(OPTIMIZE) LDFLAGS += -lm -lcrypto -lssl -lpthread LDFLAGS += -lm -L${OPENSSL_PATH}/lib -lcrypto -lssl -lpthread #=============================================================================== # Kinetic-C Library Build Support Loading @@ -35,10 +42,11 @@ VERSION_FILE = ./config/VERSION VERSION = ${shell head -n1 $(VERSION_FILE)} THREADPOOL_PATH = ${LIB_DIR}/threadpool BUS_PATH = ${LIB_DIR}/bus KINETIC_LIB_NAME = $(PROJECT).$(VERSION) KINETIC_LIB = $(BIN_DIR)/lib$(KINETIC_LIB_NAME).a LIB_INCS = -I$(LIB_DIR) -I$(PUB_INC) -I$(PROTOBUFC) -I$(SOCKET99) -I$(VENDOR) \ -I$(THREADPOOL_PATH) -I$(BUS_PATH) -I$(THREADPOOL_PATH) -I$(BUS_PATH) -I${OPENSSL_PATH}/include C_SRC=${LIB_DIR}/*.[ch] $(SOCKET99)/socket99.[ch] $(PROTOBUFC)/protobuf-c/protobuf-c.[ch] Loading @@ -50,6 +58,7 @@ LIB_OBJS = \ $(OUT_DIR)/kinetic_operation.o \ $(OUT_DIR)/kinetic_pdu.o \ $(OUT_DIR)/kinetic_auth.o \ $(OUT_DIR)/kinetic_pdu_unpack.o \ $(OUT_DIR)/kinetic_proto.o \ $(OUT_DIR)/kinetic_socket.o \ $(OUT_DIR)/kinetic_message.o \ Loading @@ -66,6 +75,7 @@ LIB_OBJS = \ $(OUT_DIR)/kinetic_admin_client.o \ $(OUT_DIR)/threadpool.o \ $(OUT_DIR)/bus.o \ $(OUT_DIR)/bus_ssl.o \ $(OUT_DIR)/casq.o \ $(OUT_DIR)/listener.o \ $(OUT_DIR)/sender.o \ Loading @@ -73,6 +83,7 @@ LIB_OBJS = \ $(OUT_DIR)/yacht.o \ KINETIC_LIB_OTHER_DEPS = Makefile Rakefile $(VERSION_FILE) Loading @@ -84,7 +95,8 @@ makedirs: all: default test system_tests test_internals run examples clean: makedirs update_git_submodules rm -rf ./bin/** rm -rf ./bin/**/* rm ./bin/*.* rm -f $(OUT_DIR)/*.o $(OUT_DIR)/*.a *.core *.log bundle exec rake clobber -./vendor/kinetic-simulator/stopSimulator.sh &> /dev/null; Loading Loading @@ -122,7 +134,7 @@ $(OUT_DIR)/threadpool.o: ${LIB_DIR}/threadpool/threadpool.c ${LIB_DIR}/threadpoo $(CC) -o $@ -c $< $(CFLAGS) $(OUT_DIR)/%.o: ${LIB_DIR}/bus/%.c ${LIB_DIR}/bus/%.h $(CC) -o $@ -c $< $(CFLAGS) -I${THREADPOOL_PATH} -I${BUS_PATH} $(CC) -o $@ -c $< $(CFLAGS) -I${THREADPOOL_PATH} -I${BUS_PATH} ${LIB_INCS} ${OUT_DIR}/*.o: src/lib/kinetic_types_internal.h Loading Loading @@ -166,7 +178,7 @@ test_bus: test_threadpool ${OUT_DIR}/libsocket99.a ${OUT_DIR}/libthreadpool.a #------------------------------------------------------------------------------- ${OUT_DIR}/libsocket99.a: ${SOCKET99}/*.[ch] cd ${SOCKET99} && make CDEFS=-D_C99_SOURCE=1 all cd ${SOCKET99} && make all cp ${SOCKET99}/libsocket99.a $@ ${OUT_DIR}/libthreadpool.a: ${LIB_DIR}/threadpool/*.[ch] Loading Loading @@ -214,8 +226,10 @@ install: $(KINETIC_LIB) $(KINETIC_SO_DEV) $(INSTALL) -d $(PREFIX)${LIBDIR} $(INSTALL) -c $(KINETIC_LIB) $(PREFIX)${LIBDIR}/ $(INSTALL) -d $(PREFIX)/include/ $(INSTALL) -c $(PUB_INC)/$(API_NAME).h $(PREFIX)/include/ $(INSTALL) -c $(PUB_INC)/kinetic_client.h $(PREFIX)/include/ $(INSTALL) -c $(PUB_INC)/kinetic_admin_client.h $(PREFIX)/include/ $(INSTALL) -c $(PUB_INC)/kinetic_types.h $(PREFIX)/include/ $(INSTALL) -c $(PUB_INC)/byte_array.h $(PREFIX)/include/ uninstall: @echo Loading @@ -225,12 +239,10 @@ uninstall: @echo $(RM) -f $(PREFIX)${LIBDIR}/lib$(PROJECT)*.a $(RM) -f $(PREFIX)${LIBDIR}/lib$(PROJECT)*.so $(RM) -f $(PREFIX)/include/${API_NAME}.h $(RM) -f $(PREFIX)/include/kinetic_admin_api.h $(RM) -f $(PREFIX)/include/kinetic_client.h $(RM) -f $(PREFIX)/include/kinetic_admin_client.h $(RM) -f $(PREFIX)/include/kinetic_types.h $(RM) -f $(PREFIX)/include/kinetic_proto.h $(RM) -f $(PREFIX)/include/protobuf-c/protobuf-c.h $(RM) -f $(PREFIX)/include/protobuf-c.h $(RM) -f $(PREFIX)/include/byte_array.h .PHONY: install uninstall Loading Loading @@ -308,9 +320,10 @@ unit_tests: start_simulator $(unit_passfiles) # System Tests #=============================================================================== SYSTEST_SRC = ./test/system SYSTEST_OUT = $(BIN_DIR)/systest SYSTEST_LDFLAGS += -lm -l ssl $(KINETIC_LIB) -l crypto -l pthread SYSTEST_LDFLAGS += -lm -L${OPENSSL_PATH}/lib -lssl -lcrypto $(KINETIC_LIB) -l pthread SYSTEST_WARN = -Wall -Wextra -Wstrict-prototypes -pedantic -Wno-missing-field-initializers -Werror=strict-prototypes -Wno-nonnull SYSTEST_CFLAGS += -std=c99 -fPIC -g $(SYSTEST_WARN) $(CDEFS) $(OPTIMIZE) -DTEST Loading @@ -320,6 +333,8 @@ systest_results = $(patsubst $(SYSTEST_OUT)/run_%,$(SYSTEST_OUT)/%.log,$(systest systest_passfiles = $(patsubst $(SYSTEST_OUT)/run_%,$(SYSTEST_OUT)/%.testpass,$(systest_executables)) systest_names = $(patsubst $(SYSTEST_OUT)/run_%,%,$(systest_executables)) .SECONDARY: $(systest_executables) list_system_tests: echo $(systest_names) Loading Loading @@ -360,7 +375,7 @@ UTILITY = kinetic-c-util UTIL_DIR = ./src/utility UTIL_EXEC = $(BIN_DIR)/$(UTILITY) UTIL_OBJ = $(OUT_DIR)/main.o UTIL_LDFLAGS += -lm -lssl $(KINETIC_LIB) -lcrypto -lpthread UTIL_LDFLAGS += -lm -L${OPENSSL_PATH}/lib -lssl $(KINETIC_LIB) -lcrypto -lpthread $(UTIL_OBJ): $(UTIL_DIR)/main.c $(CC) -c -o $@ $< $(CFLAGS) -I$(PUB_INC) -I$(UTIL_DIR) Loading
include/kinetic_admin_client.h +2 −2 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ void KineticAdminClient_Init(const char* log_file, int log_level); /** * @brief Performs shutdown/cleanup of the kinetic-c client lib */ void KineticAdminClient_Shutdown(void); void KineticAdminClient_Shutdown(KineticClient * const client); /** * @brief Initializes the Kinetic API, configures logging destination, establishes a Loading @@ -58,7 +58,7 @@ void KineticAdminClient_Shutdown(void); * order to shutdown a connection and cleanup resources when * done using a KineticSession. */ KineticStatus KineticAdminClient_CreateConnection(KineticSession * const session); KineticStatus KineticAdminClient_CreateConnection(KineticSession * const session, KineticClient * const client); /** * @brief Closes the connection to a host. Loading
include/kinetic_client.h +7 −3 Original line number Diff line number Diff line Loading @@ -29,12 +29,12 @@ * @param log_file (path to log file, 'stdout' to log to STDOUT, NULL to disable logging) * @param log_level Logging level (-1:none, 0:error, 1:info, 2:verbose, 3:full) */ void KineticClient_Init(const char* log_file, int log_level); KineticClient * KineticClient_Init(const char* log_file, int log_level); /** * @brief Performs shutdown/cleanup of the kinetic-c client lib */ void KineticClient_Shutdown(void); void KineticClient_Shutdown(KineticClient * const client); /** * @brief Initializes the Kinetic API, configures logging destination, establishes a Loading @@ -57,7 +57,7 @@ void KineticClient_Shutdown(void); * order to shutdown a connection and cleanup resources when * done using a KineticSession. */ KineticStatus KineticClient_CreateConnection(KineticSession * const session); KineticStatus KineticClient_CreateConnection(KineticSession * const session, KineticClient * const client); /** * @brief Closes the connection to a host. Loading Loading @@ -223,4 +223,8 @@ KineticStatus KineticClient_P2POperation(KineticSession const * const session, KineticP2P_Operation* const p2pOp, KineticCompletionClosure* closure); #ifdef TEST #include "kinetic_types_internal.h" #endif #endif // _KINETIC_CLIENT_H
include/kinetic_types.h +4 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,10 @@ typedef enum _KineticSynchronization { } KineticSynchronization; struct _KineticClient; typedef struct _KineticClient KineticClient; /** * @brief Kinetic Connection Instance */ Loading
kinetic-c.sublime-project +181 −144 Original line number Diff line number Diff line { "build_systems": [ { "cmd": "make", "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Default Build", "working_dir": "${project_path}" }, { "cmd": [ "make", "test" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Run all tests (full)", "working_dir": "${project_path}" }, { "cmd": [ "rake", "CC=/usr/bin/CC", "test:${file_name}" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Test current module w/Clang", "selector": [ "source.c", "source.c++" ], "working_dir": "${project_path}" }, { "cmd": [ "rake", "CC=gcc-4.9", "test:${file_name}" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Test current module w/GCC", "selector": [ "source.c", "source.c++" ], "working_dir": "${project_path}" }, { "cmd": [ "make", "utility" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build test utility", "working_dir": "${project_path}" }, { "cmd": [ "make", "${file_base_name}" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build and run system test", "working_dir": "${project_path}" }, { "cmd": [ "make", "run" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build and run test utility", "working_dir": "${project_path}" }, { "cmd": [ "make", "examples" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build and run examples", "working_dir": "${project_path}" }, { "cmd": [ "make", "all" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Full CI build", "working_dir": "${project_path}" } ], "folders": [ { "follow_symlinks": true, "path": ".", "folder_exclude_patterns": ["build", "vendor/bundle"], "binary_file_patterns": ["build"] "folder_exclude_patterns": [ "build", "vendor/bundle" ], "path": "." } ], "settings": Loading Loading @@ -73,16 +176,6 @@ "build" ], "index_files": true, // "rulers": // [ // 80, // 100 // ], "tab_size": 4, "translate_tabs_to_spaces": true, "trim_automatic_white_space": true, "word_wrap": "true", "wrap_width": 0, "sublimeclang_dont_prepend_clang_includes": true, "sublimeclang_options": [ Loading @@ -105,80 +198,24 @@ "-Wno-missing-field-initializers", "-O", "-xc", "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/", // "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1", // "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1/tr1", "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers", "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/", "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers", "-I${folder:${project_path:kinetic-c.sublime-project}}/src/**", "-I${folder:${project_path:kinetic-c.sublime-project}}/include", "-I${folder:${project_path:kinetic-c.sublime-project}}/test/**", // "-I${folder:${project_path:kinetic-c.sublime-project}}/vendor/**", "-I${folder:${project_path:kinetic-c.sublime-project}}/vendor/protobuf-c", "-I${folder:${project_path:kinetic-c.sublime-project}}/vendor/socket99", "-I${folder:${project_path:kinetic-c.sublime-project}}/vendor/bundle/ruby/2.0.0/gems/ceedling-0.15.6/vendor/unity/src", "-I${folder:${project_path:kinetic-c.sublime-project}}/build/test/mocks", "-I${folder:${project_path:kinetic-c.sublime-project}}/test/support/stubs", "-I${folder:${project_path:kinetic-c.sublime-project}}/test/support" ] }, "build_systems": [ { "cmd": "make", "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Default Build", "working_dir": "${project_path}" }, { "cmd": ["make", "test"], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Run all tests (full)", "working_dir": "${project_path}" }, { "cmd": ["rake", "CC=/usr/bin/CC", "test:${file_name}"], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Test current module w/Clang", "selector": ["source.c", "source.c++"], "working_dir": "${project_path}" }, { "cmd": ["rake", "CC=gcc-4.9", "test:${file_name}"], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Test current module w/GCC", "selector": ["source.c", "source.c++"], "working_dir": "${project_path}" }, { "cmd": ["make", "utility"], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build test utility", "working_dir": "${project_path}" }, { "cmd": ["make", "${file_base_name}"], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build and run system test", "working_dir": "${project_path}" }, { "cmd": ["make", "run"], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build and run test utility", "working_dir": "${project_path}" }, { "cmd": ["make", "examples"], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build and run examples", "working_dir": "${project_path}" }, { "cmd": ["make", "all"], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Full CI build", "working_dir": "${project_path}" ], "tab_size": 4, "translate_tabs_to_spaces": true, "trim_automatic_white_space": true, "word_wrap": "true", "wrap_width": 0 } ] }