mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-11-06 07:20:57 +00:00
Re-organize functions
This commit is contained in:
@@ -12,19 +12,6 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#define str_contains(s, ss) ((ss) != nullptr && (s).find(ss) != string::npos)
|
||||
#define str_starts(s, ss) ((ss) != nullptr && (s).compare(0, strlen(ss), ss) == 0)
|
||||
|
||||
std::vector<std::string> file_to_vector(const char *filename);
|
||||
char *strdup2(const char *s, size_t *size = nullptr);
|
||||
|
||||
int exec_array(bool err, int *fd, void (*pre_exec)(), const char **argv);
|
||||
int exec_command(bool err, int *fd, void (*cb)(), const char *argv0, ...);
|
||||
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -94,7 +81,6 @@ int xpoll(struct pollfd *fds, nfds_t nfds, int timeout);
|
||||
unsigned get_shell_uid();
|
||||
unsigned get_system_uid();
|
||||
unsigned get_radio_uid();
|
||||
int exec_command_sync(const char *argv0, ...);
|
||||
int fork_dont_care();
|
||||
void gen_rand_str(char *buf, int len);
|
||||
int strend(const char *s1, const char *s2);
|
||||
@@ -109,8 +95,8 @@ int __fsetxattr(int fd, const char *name, const void *value, size_t size, int fl
|
||||
|
||||
// file.cpp
|
||||
|
||||
#define align(p, a) (((p) + (a) - 1) / (a) * (a))
|
||||
#define align_off(p, a) (align(p, a) - (p))
|
||||
#define do_align(p, a) (((p) + (a) - 1) / (a) * (a))
|
||||
#define align_off(p, a) (do_align(p, a) - (p))
|
||||
|
||||
extern const char **excl_list;
|
||||
|
||||
@@ -148,6 +134,20 @@ void write_zero(int fd, size_t size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#define str_contains(s, ss) ((ss) != nullptr && (s).find(ss) != string::npos)
|
||||
#define str_starts(s, ss) ((ss) != nullptr && (s).compare(0, strlen(ss), ss) == 0)
|
||||
|
||||
std::vector<std::string> file_to_vector(const char *filename);
|
||||
char *strdup2(const char *s, size_t *size = nullptr);
|
||||
|
||||
int exec_command(bool err, int *fd, void (*pre_exec)(), const char **argv);
|
||||
int exec_command(bool err, int *fd, void (*cb)(), const char *argv0, ...);
|
||||
int exec_command_sync(const char *argv0, ...);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user