From fa6075030a41d50574f3aa3e5621851075c1636e Mon Sep 17 00:00:00 2001 From: zzy <2450266535@qq.com> Date: Tue, 31 Oct 2023 20:06:44 +0800 Subject: [PATCH] dev ini init --- include/bkfifo.h | 2 +- include/iini.h | 6 ++++++ include/llog.h | 2 +- test/ini/CMakeLists.txt | 16 ++++++++++++++++ test/ini/ini.c | 22 ++++++++++++++++++++++ 5 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 include/iini.h create mode 100644 test/ini/CMakeLists.txt create mode 100644 test/ini/ini.c diff --git a/include/bkfifo.h b/include/bkfifo.h index 25d4ee3..097e6ca 100644 --- a/include/bkfifo.h +++ b/include/bkfifo.h @@ -20,7 +20,7 @@ struct __bkfifo { type buf[((size < 2) || (size & (size - 1))) ? -1 : size]; \ } - +//static inline void __alloc_ #endif // _BKFIFO_H_ \ No newline at end of file diff --git a/include/iini.h b/include/iini.h new file mode 100644 index 0000000..1a207c7 --- /dev/null +++ b/include/iini.h @@ -0,0 +1,6 @@ +#ifndef _IINI_H_ +#define _IINI_H_ + + + +#endif /* _IINI_H_ */ \ No newline at end of file diff --git a/include/llog.h b/include/llog.h index 2d068f1..c4d8f87 100644 --- a/include/llog.h +++ b/include/llog.h @@ -233,4 +233,4 @@ extern void log_buf(void); } #endif -#endif /*_LLOG_H_*/ \ No newline at end of file +#endif /* _LLOG_H_ */ \ No newline at end of file diff --git a/test/ini/CMakeLists.txt b/test/ini/CMakeLists.txt new file mode 100644 index 0000000..2561132 --- /dev/null +++ b/test/ini/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.22.1) + +project(ini) + +set(EXECUTABLE_OUTPUT_PATH ../) +set(CMAKE_C_STANDARD 99) +set(SRC_FILE ini.c) + +include_directories(../../include) +add_executable(${PROJECT_NAME} ${SRC_FILE}) + +if(WIN32) + target_link_libraries(${PROJECT_NAME} wsock32 ws2_32) +endif() +# cmake .. +# cmake --build . \ No newline at end of file diff --git a/test/ini/ini.c b/test/ini/ini.c new file mode 100644 index 0000000..4dc8845 --- /dev/null +++ b/test/ini/ini.c @@ -0,0 +1,22 @@ +#include +#include +int main() { + char log[128] = { 0 }; + size_t szlog = sizeof(log); + log_head_trace(log, szlog); + printf("%s\n", log); + log_head_debug(log, szlog); + printf("%s\n", log); + log_head_info(log, szlog); + printf("%s\n", log); + log_head_warn(log, szlog); + printf("%s\n", log); + log_head_error(log, szlog); + printf("%s\n", log); + log_head_fatal(log, szlog); + printf("%s\n", log); + getchar(); + + //LOG_COLOR(23); + return 0; + } \ No newline at end of file