#ifndef _PROTOTYPE
#define _PROTOTYPE

#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdbool.h>

#include "./type.h"

// public functions
// 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);

// error.c
void error(const char *sys_msg, ...);
void last_error(const char *sys_msg, ...);

// system.c
int run_subprocess_async(int argc, char *const *argv);
int run_subprocess(char *const *argv);
int pivot_root(char *mount_dir);
int clean_pivot_root(char *a);
void remount();
bool is_interactive(char *str);
bool is_not_interactive(char *str);
bool contain_interactive(int argc, char *const *argv);

// data.c
char *new_array(size_t size);
void init_array(char *arr, size_t size);
char *read_infinite_fd(int fd);
void write_infinite_fd(int fd);
int filter_char_array(int src_length, char **src, char **dst, char_predicate filter_func);

#endif
