mirror of
https://github.com/github/codeql.git
synced 2026-08-01 16:02:57 +02:00
- Add shared/canonicalize/ C++ DLL that resolves Windows paths via GetFinalPathNameByHandleW with a full-path cache (matching C#'s CanonicalPathCache strategy). - Add JNI interface (canonicalize_jni.cpp) for Kotlin/Java consumers. - Add NativeCanonicalizer.java to kotlin-extractor for loading the DLL and exposing a resolve() method. - Call NativeCanonicalizer.resolve() in FileUtil.tryMakeCanonical(). - Add go/extractor/canonicalize package (Windows + non-Windows impls). - Use canonicalize.CanonicalizePath() in go extractor normalizedPath(). - Update Bazel build files for all new targets and deps.
32 lines
666 B
C
32 lines
666 B
C
#ifndef CODEQL_CANONICALIZE_H
|
|
#define CODEQL_CANONICALIZE_H
|
|
|
|
#ifdef _WIN32
|
|
|
|
#ifdef CODEQL_CANONICALIZE_EXPORTS
|
|
#define CODEQL_API __declspec(dllexport)
|
|
#else
|
|
#define CODEQL_API __declspec(dllimport)
|
|
#endif
|
|
|
|
#include <wchar.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
// UTF-16 interface (for JNI / Java / Kotlin)
|
|
CODEQL_API const wchar_t* canonicalize_path_w(const wchar_t* path);
|
|
CODEQL_API void canonicalize_free_w(const wchar_t* path);
|
|
|
|
// UTF-8 interface (for Go)
|
|
CODEQL_API const char* canonicalize_path_u8(const char* path);
|
|
CODEQL_API void canonicalize_free_u8(const char* path);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // _WIN32
|
|
#endif // CODEQL_CANONICALIZE_H
|