mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-05-09 18:02:52 +08:00
refactor(registry): 使用ErrorCode类型替换int作为错误返回值
- 将registry_service.h/c中的函数返回值从int改为ErrorCode枚举 - 更新callbacks.c中的错误检查逻辑,使用ERR_OK常量进行比较 - 在内部辅助函数中返回具体的错误码(ERR_REGISTRY_FAILED等) - 提高代码类型安全性和错误处理可读性
This commit is contained in:
@@ -2,13 +2,14 @@
|
||||
#define REGISTRY_SERVICE_H
|
||||
|
||||
#include "utils/string_ext.h"
|
||||
#include "utils/error_code.h"
|
||||
|
||||
// 加载系统变量和用户变量到字符串列表
|
||||
int load_system_paths(StringList *list);
|
||||
int load_user_paths(StringList *list);
|
||||
ErrorCode load_system_paths(StringList *list);
|
||||
ErrorCode load_user_paths(StringList *list);
|
||||
|
||||
// 从字符串列表保存系统变量和用户变量
|
||||
int save_system_paths(const StringList *list);
|
||||
int save_user_paths(const StringList *list);
|
||||
ErrorCode save_system_paths(const StringList *list);
|
||||
ErrorCode save_user_paths(const StringList *list);
|
||||
|
||||
#endif // REGISTRY_SERVICE_H
|
||||
|
||||
Reference in New Issue
Block a user