2017-04-06 22:21:20 +00:00
|
|
|
/* util.h - Header for all utility functions
|
|
|
|
*/
|
|
|
|
|
2017-04-04 19:44:13 +00:00
|
|
|
#ifndef _UTILS_H_
|
|
|
|
#define _UTILS_H_
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <stdio.h>
|
2017-04-06 22:21:20 +00:00
|
|
|
#include <dirent.h>
|
2017-04-04 19:44:13 +00:00
|
|
|
|
|
|
|
#include "magisk.h"
|
|
|
|
|
|
|
|
// xwrap.c
|
|
|
|
|
|
|
|
FILE *xfopen(const char *pathname, const char *mode);
|
2017-04-05 22:12:29 +00:00
|
|
|
int xopen(const char *pathname, int flags);
|
|
|
|
ssize_t xwrite(int fd, const void *buf, size_t count);
|
|
|
|
ssize_t xread(int fd, void *buf, size_t count);
|
|
|
|
ssize_t xxread(int fd, void *buf, size_t count);
|
|
|
|
int xpipe(int pipefd[2]);
|
|
|
|
int xsetns(int fd, int nstype);
|
2017-04-06 22:21:20 +00:00
|
|
|
DIR *xopendir(const char *name);
|
|
|
|
struct dirent *xreaddir(DIR *dirp);
|
2017-04-04 19:44:13 +00:00
|
|
|
|
|
|
|
// vector.c
|
|
|
|
|
|
|
|
#include "vector.h"
|
|
|
|
|
|
|
|
// log_monitor.c
|
|
|
|
|
|
|
|
void monitor_logs();
|
|
|
|
|
2017-04-05 22:12:29 +00:00
|
|
|
// misc.c
|
|
|
|
|
|
|
|
int check_data();
|
|
|
|
void file_to_vector(struct vector *v, FILE *fp);
|
2017-04-06 22:21:20 +00:00
|
|
|
int isNum(const char *s);
|
|
|
|
ssize_t fdreadline(int fd, char *buf, size_t size);
|
|
|
|
void ps(void (*func)(int));
|
|
|
|
void ps_filter_proc_name(const char *filter, void (*func)(int));
|
2017-04-05 22:12:29 +00:00
|
|
|
|
2017-04-04 19:44:13 +00:00
|
|
|
#endif
|