diff --git a/CMakeLists.txt b/CMakeLists.txt index 65dc9a52..57ef32f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,14 @@ set(PIP_BUILD 1) include(CheckFunctionExists) include(PIPMacros.cmake) +set(_ICU_DEFAULT OFF) +if((NOT DEFINED WIN32) AND (NOT DEFINED ANDROID_PLATFORM) AND (NOT DEFINED APPLE)) + set(_ICU_DEFAULT ON) +endif() + + # Options -option(ICU "ICU support for convert codepages" OFF) +option(ICU "ICU support for convert codepages" ${_ICU_DEFAULT}) option(STD_IOSTREAM "Building with std iostream operators support" OFF) option(INTROSPECTION "Build with introspection" OFF) option(LIB "System install" ON) @@ -43,7 +49,8 @@ set(PIP_SRC_FFTW "src_fftw") set(PIP_SRC_OPENCL "src_opencl") set(PIP_SRC_IO_UTILS "src_io_utils") set(PIP_SRC_CONCURRENT "src_concurrent") -set(PIP_SRC_DIRS "src_main" "src_crypt" "src_compress" "src_usb" "src_fftw" "src_opencl" "src_io_utils" "src_concurrent") +set(PIP_SRC_CLOUD "src_cloud") +set(PIP_SRC_DIRS "src_main" "src_crypt" "src_compress" "src_usb" "src_fftw" "src_opencl" "src_io_utils" "src_concurrent" "src_cloud") set(PIP_LIBS_TARGETS pip) set(LIBS_MAIN) set(LIBS_STATUS) @@ -132,7 +139,7 @@ get_filename_component(C_COMPILER "${CMAKE_C_COMPILER}" NAME) # Sources # Main lib -set(PIP_FOLDERS "." "core" "containers" "thread" "system" "io_devices" "io_utils" "console" "math" "code" "geo" "resources" "opencl" "crypt" "introspection" "concurrent") +set(PIP_FOLDERS "." "core" "containers" "thread" "system" "io_devices" "io_utils" "console" "math" "code" "geo" "resources" "opencl" "crypt" "introspection" "concurrent" "cloud") if(PIP_FREERTOS) #list(REMOVE_ITEM PIP_FOLDERS "console") #include_directories("${PIP_SRC_MAIN}/console") @@ -167,6 +174,9 @@ gather_src("${PIP_SRC_CONCURRENT}" CPP_LIB_CONCURRENT HDRS PHDRS) gather_src("${PIP_SRC_CONCURRENT_TEST}" CPP_CONCURRENT_TEST HDRS PHDRS) +# Cloud lib +gather_src("${PIP_SRC_CLOUD}" CPP_LIB_CLOUD HDRS PHDRS) + if(PIP_FREERTOS) add_definitions(-DPIP_FREERTOS) set(ICU OFF) @@ -488,6 +498,7 @@ if (NOT PIP_FREERTOS) target_link_libraries(pip_io_utils ${IO_UTILS_LIBS}) list(APPEND PIP_LIBS_TARGETS pip_io_utils) + # Concurrent module set(CONCURRENT_LIBS pip) add_library(pip_concurrent ${PIP_LIB_TYPE} ${CPP_LIB_CONCURRENT}) @@ -503,6 +514,17 @@ if (NOT PIP_FREERTOS) add_custom_target(pip_concurrent_test_perform ALL COMMAND pip_concurrent_test) endif() + + # Build cloud library if crypt enabled + if(sodium_FOUND) + message(STATUS "Building PICloud support") + add_definitions(-DPIP_CLOUD) + add_library(pip_cloud ${PIP_LIB_TYPE} ${CPP_LIB_CLOUD}) + target_link_libraries(pip_cloud pip pip_crypt) + list(APPEND PIP_LIBS_TARGETS pip_cloud) + endif() + + # Test program if(PIP_UTILS) add_executable(pip_test "main.cpp") @@ -581,6 +603,7 @@ if(NOT PIP_FREERTOS) if(sodium_FOUND) add_subdirectory("utils/system_daemon") add_subdirectory("utils/crypt_tool") + add_subdirectory("utils/cloud_dispatcher") endif() endif() diff --git a/src_cloud/piccloudtcp.cpp b/src_cloud/piccloudtcp.cpp new file mode 100644 index 00000000..b18b9616 --- /dev/null +++ b/src_cloud/piccloudtcp.cpp @@ -0,0 +1,28 @@ +/* + PIP - Platform Independent Primitives + PICloud TCP transport + Copyright (C) 2020 Ivan Pelipenko peri4ko@yandex.ru + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "piccloudtcp.h" +#include "picrypt.h" + +const char hash_def_key[] = "_picrypt_"; + + +PICloudTCP::PICloudTCP() { +} + diff --git a/src_main/cloud/piccloudmodule.h b/src_main/cloud/piccloudmodule.h new file mode 100644 index 00000000..52279b00 --- /dev/null +++ b/src_main/cloud/piccloudmodule.h @@ -0,0 +1,25 @@ +/* + PIP - Platform Independent Primitives + Module includes + Copyright (C) 2019 Andrey Bychkov work.a.b@yandex.ru + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef PICLOUDMODULE_H +#define PICLOUDMODULE_H + +#include "piccloudtcp.h" + +#endif // PICLOUDMODULE_H diff --git a/src_main/cloud/piccloudtcp.h b/src_main/cloud/piccloudtcp.h new file mode 100644 index 00000000..2130eb39 --- /dev/null +++ b/src_main/cloud/piccloudtcp.h @@ -0,0 +1,38 @@ +/*! \file piccloudtcp.h + * \brief PICloud TCP transport +*/ +/* + PIP - Platform Independent Primitives + PICloud TCP transport + Copyright (C) 2020 Ivan Pelipenko peri4ko@yandex.ru + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef PICCLOUDTCP_H +#define PICCLOUDTCP_H + +#include "pistring.h" + +class PIP_EXPORT PICloudTCP { +public: + //! + PICloudTCP(); + + +private: + +}; + +#endif // PICCLOUDTCP_H diff --git a/src_main/crypt/picryptmodule.h b/src_main/crypt/picryptmodule.h index 26d2a55a..3bc814bb 100644 --- a/src_main/crypt/picryptmodule.h +++ b/src_main/crypt/picryptmodule.h @@ -17,10 +17,10 @@ along with this program. If not, see . */ -#ifndef PIMATHMODULE_H -#define PIMATHMODULE_H +#ifndef PICRYPTMODULE_H +#define PICRYPTMODULE_H #include "picrypt.h" #include "piauth.h" -#endif // PIMATHMODULE_H +#endif // PICRYPTMODULE_H