Project reconstructed && Fix speed issue caused by excessive IO frequency && New information and progress bar output

This commit is contained in:
2025-09-17 09:55:13 +08:00
parent 2b17809d07
commit e3571db925
12 changed files with 579 additions and 120 deletions
+10
View File
@@ -0,0 +1,10 @@
#ifndef __CONFIG_HPP__
#define __CONFIG_HPP__
// 进度条长度
#define PROGRESS_LENGTH 29
// 默认数值类型
#define DEFAULT_VALUE_TYPE "uint64_t"
#endif
+13
View File
@@ -0,0 +1,13 @@
#ifndef __GLOBAL_VARIABLES_HPP__
#define __GLOBAL_VARIABLES_HPP__
#include "Type_Descriptions.hpp"
// 文件列表
extern file_node *file_list_head;
// 值列表
extern value_node *value_list_head;
// 起始时间戳
extern double time_begin;
#endif
+25
View File
@@ -0,0 +1,25 @@
#ifndef __TOOL_FUNCTIONS_HPP__
#define __TOOL_FUNCTIONS_HPP__
#include "Config.hpp"
extern "C"
{
#include "stdint.h"
#include "stdio.h"
#include "stdbool.h"
}
// 行进到上一行起始位置
size_t f_seek_pre_line_begin(FILE *file);
// 读取文件一行
size_t f_getline(FILE *file, char *buffer, const size_t buffer_len);
// 进度条打印
void progress_print(size_t completed, size_t total, bool reflush);
// 16进制字符串转十进制数值(8字节)
uint64_t hex_to_decimal(const char *str);
#endif
+28
View File
@@ -0,0 +1,28 @@
#ifndef __TYPE_DESCRIPTIONS_HPP__
#define __TYPE_DESCRIPTIONS_HPP__
#include "Config.hpp"
extern "C"
{
#include "stdint.h"
}
// 文件链表节点
typedef struct file_node_struct
{
const char *file_name_str = nullptr;
file_node_struct *p_next = nullptr;
} file_node;
// 数据列表
typedef struct value_node_struct
{
char value_name_str[100] = {'\0'};
const char *value_type_str = "uint64_t";
uint64_t raw_value = 0x0000000000000000;
value_node_struct *p_next;
} value_node;
// 数据类型
#endif