Files
fastfetch/src/common/path.h
T

22 lines
815 B
C
Raw Normal View History

#pragma once
2026-01-06 09:48:38 +08:00
#include "common/FFstrbuf.h"
2026-05-28 15:58:08 +08:00
#include "common/strutil.h"
const char* ffFindExecutableInPath(const char* name, FFstrbuf* result);
2026-03-29 09:28:49 +08:00
static inline bool ffIsAbsolutePath(const char* path) {
#ifdef _WIN32
2025-11-25 10:32:42 +08:00
return (ffCharIsEnglishAlphabet(path[0]) && path[1] == ':' && (path[2] == '\\' || path[2] == '/')) // drive letter path
2026-03-29 09:28:49 +08:00
|| (path[0] == '\\' && path[1] == '\\'); // UNC path
#else
2025-11-25 10:32:42 +08:00
return path[0] == '/';
2026-03-29 09:28:49 +08:00
#endif
2025-11-25 10:32:42 +08:00
}
#if _WIN32
char* frealpath(void* __restrict hFile, char* __restrict resolved_name /*MAX_PATH*/);
2026-03-29 09:28:49 +08:00
char* realpath(const char* __restrict file_name, char* __restrict resolved_name /*MAX_PATH*/);
ssize_t freadlink(void* hFile, char* buf, size_t bufsiz);
ssize_t readlink(const char* path, char* buf, size_t bufsiz);
#endif