#ifndef __SCC_PATH_H__ #define __SCC_PATH_H__ /** * @brief 检查路径是否为绝对路径 * @param path 要检查的路径 * @return 1 是绝对路径, 0 不是 */ int scc_path_is_absolute(const char *path); /** * @brief 检查路径是否包含 .. 路径穿越组件 * @param path 要检查的路径 * @return 1 包含 .., 0 不包含 */ int scc_path_has_dotdot(const char *path); /** * @brief 检查路径是否安全用作 #include 文件名 * * 拒绝条件: * - 绝对路径(以 / \ 开头,或 Windows 驱动符如 C:\) * - 包含 .. 路径穿越组件 * * @param path 要检查的路径 * @return 0 安全, -1 不安全 */ int scc_path_check_include_safe(const char *path); #endif /* __SCC_PATH_H__ */