liberpal-skeleton.h 758 字节
Newer Older
1 2 3
#ifndef LIBERPAL_SKELETON_H
#define LIBERPAL_SKELETON_H

4 5 6 7
#include <stdbool.h>

extern bool is_oot_driver;

8 9 10 11 12 13 14 15 16
typedef struct {
        const char *args;
        const char *log_level;
} pal_attr_t;

typedef struct {
        int stdin, stdout, stderr;
} pal_stdio_fds;

17 18 19 20 21 22 23 24 25 26 27 28 29
typedef struct {
        char *path;
        char **argv;
        char **env;
        pal_stdio_fds *stdio;
        int *pid;
} pal_create_process_args;

typedef struct {
	int pid;
	int *exit_value;
} pal_exec_args;

30 31
int __pal_init(pal_attr_t *attr);
int __pal_exec(char *path, char *argv[], pal_stdio_fds *stdio, int *exit_code);
32 33 34
int __pal_create_process(pal_create_process_args *args);
int wait4child(pal_exec_args *attr);
int __pal_kill(int pid, int sig);
35 36 37
int __pal_destory(void);

#endif