Move functions from process to file

Move filesystem-related functions from process.[ch] to file.[ch].
This commit is contained in:
Romain Vimont
2021-11-11 16:12:17 +01:00
parent be55e250ca
commit d4c262301f
12 changed files with 212 additions and 172 deletions

34
app/src/util/file.h Normal file
View File

@@ -0,0 +1,34 @@
#ifndef SC_FILE_H
#define SC_FILE_H
#include "common.h"
#include <stdbool.h>
#ifdef _WIN32
# define PATH_SEPARATOR '\\'
#else
# define PATH_SEPARATOR '/'
#endif
#ifndef _WIN32
// only used to find package manager, not implemented for Windows
bool
search_executable(const char *file);
#endif
// return the absolute path of the executable (the scrcpy binary)
// may be NULL on error; to be freed by free()
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);
#endif