Extract util function to build a local file path

Finding a local file in the scrcpy directory may be useful for files
other than scrcpy-server in the future.
This commit is contained in:
Romain Vimont
2021-10-22 18:51:20 +02:00
parent a7e41b0f85
commit 7229e3cce0
3 changed files with 49 additions and 38 deletions

View File

@@ -74,6 +74,11 @@ search_executable(const char *file);
char *
get_executable_path(void);
// Return the absolute path of a file in the same directory as he executable.
// May be NULL on error. To be freed by free().
char *
get_local_file_path(const char *name);
// returns true if the file exists and is not a directory
bool
is_regular_file(const char *path);