Achieved output of different format types && Modified some functions
This commit is contained in:
+5
-1
@@ -5,6 +5,10 @@
|
||||
#define PROGRESS_LENGTH 29
|
||||
|
||||
// 默认数值类型
|
||||
#define DEFAULT_VALUE_TYPE "uint64_t"
|
||||
#define DEFAULT_VALUE_TYPE "uint64_t (DEF)"
|
||||
// 名称字符串最大长度
|
||||
#define VARIABLE_NAME_STR_LENGTH_MAX 100
|
||||
// 段缓冲区长度
|
||||
#define SEGMENT_BUFF_LENGTH 5000
|
||||
|
||||
#endif
|
||||
@@ -7,6 +7,8 @@
|
||||
extern file_node *file_list_head;
|
||||
// 值列表
|
||||
extern value_node *value_list_head;
|
||||
// 类型列表
|
||||
extern format_list_node *format_list_head;
|
||||
// 起始时间戳
|
||||
extern double time_begin;
|
||||
|
||||
|
||||
@@ -19,7 +19,13 @@ 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);
|
||||
// 16进制字符串转有效无符号整数(8字节)
|
||||
uint64_t hex_to_value(const char *str);
|
||||
|
||||
// 判定字符串是否全部为有效数字
|
||||
bool is_full_num(const char *str);
|
||||
|
||||
// 十进制字符串转有效无符号整数(8字节)
|
||||
uint64_t str_to_value(const char *str);
|
||||
|
||||
#endif
|
||||
@@ -18,11 +18,20 @@ typedef struct file_node_struct
|
||||
// 数据列表
|
||||
typedef struct value_node_struct
|
||||
{
|
||||
char value_name_str[100] = {'\0'};
|
||||
const char *value_type_str = "uint64_t";
|
||||
char value_name_str[VARIABLE_NAME_STR_LENGTH_MAX] = {'\0'};
|
||||
const char *value_type_str = DEFAULT_VALUE_TYPE;
|
||||
uint64_t raw_value = 0x0000000000000000;
|
||||
value_node_struct *p_next;
|
||||
} value_node;
|
||||
|
||||
// 格式定义列表
|
||||
typedef struct format_list_node_struct
|
||||
{
|
||||
char target_value_name_str[VARIABLE_NAME_STR_LENGTH_MAX] = {'\0'}; // 目标变量名
|
||||
int target_numID = -1; // 目标数字ID
|
||||
const char *value_type_str = nullptr; // 目标类型
|
||||
format_list_node_struct *p_next;
|
||||
} format_list_node;
|
||||
|
||||
// 数据类型
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user