refactor(registry): 使用ErrorCode类型替换int作为错误返回值

- 将registry_service.h/c中的函数返回值从int改为ErrorCode枚举
- 更新callbacks.c中的错误检查逻辑,使用ERR_OK常量进行比较
- 在内部辅助函数中返回具体的错误码(ERR_REGISTRY_FAILED等)
- 提高代码类型安全性和错误处理可读性
This commit is contained in:
2026-03-26 13:02:14 +08:00
parent 9aa1e208ba
commit 6ba7e702f2
3 changed files with 27 additions and 23 deletions
+5 -4
View File
@@ -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