From cf40f8e42e9f52edf4daa49745fc88ab4c7cce8f Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Tue, 23 Jun 2026 15:39:50 +0800 Subject: [PATCH] add function fc_version --- HISTORY | 3 ++- src/Makefile.in | 8 +++++--- src/fc_version.c | 23 +++++++++++++++++++++++ src/fc_version.h | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 src/fc_version.c create mode 100644 src/fc_version.h diff --git a/HISTORY b/HISTORY index a59615d..c38d713 100644 --- a/HISTORY +++ b/HISTORY @@ -1,7 +1,8 @@ -Version 1.85 2026-06-22 +Version 1.85 2026-06-23 * add functions fc_safe_srand and fc_safe_rand for more security under Linux * add function seconds_to_human_str + * add function fc_version by new files fc_version.h and fc_version.c Version 1.84 2026-01-16 * fast_task_queue.h: add function free_queue_task_arg_offset diff --git a/src/Makefile.in b/src/Makefile.in index 2d38f38..bce97da 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -17,7 +17,8 @@ FAST_SHARED_OBJS = hash.lo chain.lo shared_func.lo ini_file_reader.lo \ multi_socket_client.lo skiplist_set.lo uniq_skiplist.lo \ json_parser.lo buffered_file_writer.lo server_id_func.lo \ fc_queue.lo sorted_queue.lo fc_memory.lo shared_buffer.lo \ - thread_pool.lo array_allocator.lo sorted_array.lo spinlock.lo + thread_pool.lo array_allocator.lo sorted_array.lo spinlock.lo \ + fc_version.lo FAST_STATIC_OBJS = hash.o chain.o shared_func.o ini_file_reader.o \ logger.o sockopt.o base64.o sched_thread.o \ @@ -31,7 +32,8 @@ FAST_STATIC_OBJS = hash.o chain.o shared_func.o ini_file_reader.o \ multi_socket_client.o skiplist_set.o uniq_skiplist.o \ json_parser.o buffered_file_writer.o server_id_func.o \ fc_queue.o sorted_queue.o fc_memory.o shared_buffer.o \ - thread_pool.o array_allocator.o sorted_array.o spinlock.o + thread_pool.o array_allocator.o sorted_array.o spinlock.o \ + fc_version.o HEADER_FILES = common_define.h hash.h chain.h logger.h base64.h \ shared_func.h pthread_func.h ini_file_reader.h _os_define.h \ @@ -47,7 +49,7 @@ HEADER_FILES = common_define.h hash.h chain.h logger.h base64.h \ fc_list.h locked_list.h json_parser.h buffered_file_writer.h \ server_id_func.h fc_queue.h sorted_queue.h fc_memory.h \ shared_buffer.h thread_pool.h fc_atomic.h array_allocator.h \ - sorted_array.h spinlock.h + sorted_array.h spinlock.h fc_version.h ALL_OBJS = $(FAST_STATIC_OBJS) $(FAST_SHARED_OBJS) diff --git a/src/fc_version.c b/src/fc_version.c new file mode 100644 index 0000000..676e570 --- /dev/null +++ b/src/fc_version.c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2026 YuQing <384681@qq.com> + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the Lesser GNU General Public License, version 3 + * or later ("LGPL"), as published by the Free Software Foundation. + * + * 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. + * + * You should have received a copy of the Lesser GNU General Public License + * along with this program. If not, see . + */ + +#include "fc_version.h" + +void fc_version(Version *version) +{ + version->major = FC_MAJOR_VERSION; + version->minor = FC_MINOR_VERSION; + version->patch = FC_PATCH_VERSION; +} diff --git a/src/fc_version.h b/src/fc_version.h new file mode 100644 index 0000000..87bdec5 --- /dev/null +++ b/src/fc_version.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2026 YuQing <384681@qq.com> + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the Lesser GNU General Public License, version 3 + * or later ("LGPL"), as published by the Free Software Foundation. + * + * 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. + * + * You should have received a copy of the Lesser GNU General Public License + * along with this program. If not, see . + */ + +//fc_version.h + +#ifndef _FC_VERSION_H +#define _FC_VERSION_H + +#include "common_define.h" + +#define FC_MAJOR_VERSION 1 +#define FC_MINOR_VERSION 0 +#define FC_PATCH_VERSION 85 + +#ifdef __cplusplus +extern "C" { +#endif + + void fc_version(Version *version); + +#ifdef __cplusplus +} +#endif + +#endif