2020-06-28 23:59:32 +00:00
|
|
|
#ifndef _PROTOTYPE
|
|
|
|
#define _PROTOTYPE
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
2020-07-19 21:17:39 +00:00
|
|
|
#include <stdbool.h>
|
2020-06-28 23:59:32 +00:00
|
|
|
|
|
|
|
#include "./type.h"
|
|
|
|
|
|
|
|
// public functions
|
2020-07-14 21:09:52 +00:00
|
|
|
// container.c
|
|
|
|
container_t *initialize_container(struct clone_args);
|
|
|
|
pid_t run_container(container_t *c);
|
|
|
|
void error_handler_container(container_t *c, const char *error_msg, ...);
|
|
|
|
void destroy_container(container_t *c);
|
2020-06-28 23:59:32 +00:00
|
|
|
|
2020-07-14 21:09:52 +00:00
|
|
|
// error.c
|
2020-06-28 23:59:32 +00:00
|
|
|
void error(const char *sys_msg, ...);
|
2020-07-14 21:09:52 +00:00
|
|
|
void last_error(const char *sys_msg, ...);
|
2020-06-28 23:59:32 +00:00
|
|
|
|
2020-07-14 21:09:52 +00:00
|
|
|
// system.c
|
2020-07-19 21:17:39 +00:00
|
|
|
int run_subprocess_async(int argc, char *const *argv);
|
2020-07-14 21:09:52 +00:00
|
|
|
int run_subprocess(char *const *argv);
|
|
|
|
int pivot_root(char *mount_dir);
|
|
|
|
int clean_pivot_root(char *a);
|
|
|
|
void remount();
|
2020-07-19 21:17:39 +00:00
|
|
|
bool is_interactive(char *str);
|
|
|
|
bool is_not_interactive(char *str);
|
|
|
|
bool contain_interactive(int argc, char *const *argv);
|
2020-07-14 21:09:52 +00:00
|
|
|
|
|
|
|
// data.c
|
|
|
|
char *new_array(size_t size);
|
|
|
|
void init_array(char *arr, size_t size);
|
|
|
|
char *read_infinite_fd(int fd);
|
2020-07-19 21:17:39 +00:00
|
|
|
void write_infinite_fd(int fd);
|
|
|
|
int filter_char_array(int src_length, char **src, char **dst, char_predicate filter_func);
|
2020-06-28 23:59:32 +00:00
|
|
|
|
|
|
|
#endif
|