From 6c2d044286ca502854640f41eeaed62e16354fc9 Mon Sep 17 00:00:00 2001 From: lifeng68 Date: Fri, 17 Jul 2020 17:19:16 +0800 Subject: [PATCH] refact: move buffer.c to utils directory Signed-off-by: lifeng68 --- src/utils/CMakeLists.txt | 3 +++ src/utils/buffer/CMakeLists.txt | 13 +++++++++++++ src/utils/{http => buffer}/buffer.c | 0 src/utils/{http => buffer}/buffer.h | 0 src/utils/http/CMakeLists.txt | 1 + src/utils/http/rest_common.h | 3 +-- test/image/oci/registry/CMakeLists.txt | 2 +- test/image/oci/storage/layers/CMakeLists.txt | 2 +- 8 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 src/utils/buffer/CMakeLists.txt rename src/utils/{http => buffer}/buffer.c (100%) rename src/utils/{http => buffer}/buffer.h (100%) diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index dc6d29b..6123712 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -6,6 +6,7 @@ add_subdirectory(cutils) add_subdirectory(sha256) add_subdirectory(tar) add_subdirectory(http) +add_subdirectory(buffer) set(local_utils_srcs ${utils_top_srcs} @@ -13,6 +14,7 @@ set(local_utils_srcs ${SHA256_SRCS} ${CUTILS_SRCS} ${CONSOLE_SRCS} + ${BUFFER_SRCS} ) set(local_utils_incs @@ -21,6 +23,7 @@ set(local_utils_incs ${SHA256_INCS} ${CUTILS_INCS} ${CONSOLE_INCS} + ${BUFFER_INCS} ) if (GRPC_CONNECTOR) diff --git a/src/utils/buffer/CMakeLists.txt b/src/utils/buffer/CMakeLists.txt new file mode 100644 index 0000000..6e9245e --- /dev/null +++ b/src/utils/buffer/CMakeLists.txt @@ -0,0 +1,13 @@ +# get current directory sources files +aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} local_buffer_srcs) + +set(BUFFER_SRCS + ${local_buffer_srcs} + PARENT_SCOPE + ) + +set(BUFFER_INCS + ${CMAKE_CURRENT_SOURCE_DIR} + PARENT_SCOPE + ) + diff --git a/src/utils/http/buffer.c b/src/utils/buffer/buffer.c similarity index 100% rename from src/utils/http/buffer.c rename to src/utils/buffer/buffer.c diff --git a/src/utils/http/buffer.h b/src/utils/buffer/buffer.h similarity index 100% rename from src/utils/http/buffer.h rename to src/utils/buffer/buffer.h diff --git a/src/utils/http/CMakeLists.txt b/src/utils/http/CMakeLists.txt index c444e77..741cb34 100644 --- a/src/utils/http/CMakeLists.txt +++ b/src/utils/http/CMakeLists.txt @@ -12,6 +12,7 @@ target_include_directories(libhttpclient PUBLIC ${CMAKE_SOURCE_DIR}/src/utils ${CMAKE_SOURCE_DIR}/src/utils/cutils ${CMAKE_SOURCE_DIR}/src/utils/http + ${CMAKE_SOURCE_DIR}/src/utils/buffer ${CHECKED_INCLUDE_DIRS} ) diff --git a/src/utils/http/rest_common.h b/src/utils/http/rest_common.h index bcade2c..61187aa 100644 --- a/src/utils/http/rest_common.h +++ b/src/utils/http/rest_common.h @@ -17,7 +17,7 @@ #include -#include "http/buffer.h" +#include "buffer.h" #include "http/http.h" #include "parser.h" @@ -49,4 +49,3 @@ void put_body(char *body); #endif #endif // UTILS_HTTP_REST_COMMON_H - diff --git a/test/image/oci/registry/CMakeLists.txt b/test/image/oci/registry/CMakeLists.txt index 4506c2f..1d2c7a4 100644 --- a/test/image/oci/registry/CMakeLists.txt +++ b/test/image/oci/registry/CMakeLists.txt @@ -21,7 +21,7 @@ add_executable(${EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/common/err_msg.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/config/daemon_arguments.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/utils/http/parser.c - ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/utils/http/buffer.c + ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/utils/buffer/buffer.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/utils/cutils/utils_aes.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/modules/image/oci/storage/image_store/image_type.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/daemon/config/isulad_config.c diff --git a/test/image/oci/storage/layers/CMakeLists.txt b/test/image/oci/storage/layers/CMakeLists.txt index c56bd32..e41060c 100644 --- a/test/image/oci/storage/layers/CMakeLists.txt +++ b/test/image/oci/storage/layers/CMakeLists.txt @@ -84,7 +84,7 @@ add_executable(${LAYER_EXE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/utils/cutils/path.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/utils/cutils/map/map.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/utils/cutils/map/rb_tree.c - ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/utils/http/buffer.c + ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/utils/buffer/buffer.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/utils/tar/util_archive.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/utils/tar/util_gzip.c ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../src/utils/sha256/sha256.c -- GitLab