# Minishell ## Allowed Functions /* * This file lists the functions and system calls used in the minishell project. * * Functions and system calls: * `char *readline(const char *prompt);` - Reads a line from the terminal. (Header: ``) * `void rl_clear_history(void);` - Clears the history of lines read. (Header: ``) * `int rl_on_new_line(void);` - Prepares for a new line of input. (Header: ``) * `int rl_replace_line(const char *text, int clear_undo);` - Replaces the current line with a new one. (Header: ``) * `int rl_redisplay(void);` - Redisplays the current input line. (Header: ``) * `void add_history(const char *line);` - Adds a line to the history. (Header: ``) * `int printf(const char *format, ...);` - Prints formatted output to stdout. (Header: ``) * `void *malloc(size_t size);` - Allocates memory dynamically. (Header: ``) * `void free(void *ptr);` - Frees dynamically allocated memory. (Header: ``) * `ssize_t write(int fd, const void *buf, size_t count);` - Writes data to a file descriptor. (Header: ``) * `int access(const char *pathname, int mode);` - Checks a file's accessibility. (Header: ``) * `int open(const char *pathname, int flags, ...);` - Opens a file. (Header: ``) * `ssize_t read(int fd, void *buf, size_t count);` - Reads data from a file descriptor. (Header: ``) * `int close(int fd);` - Closes a file descriptor. (Header: ``) * `pid_t fork(void);` - Creates a new process. (Header: ``) * `pid_t wait(int *wstatus);` - Waits for a child process to change state. (Header: ``) * `pid_t waitpid(pid_t pid, int *wstatus, int options);` - Waits for a specific child process to change state. (Header: ``) * `pid_t wait3(int *wstatus, int options, struct rusage *rusage);` - Waits for a child process to change state with resource usage statistics. (Header: ``) * `pid_t wait4(pid_t pid, int *wstatus, int options, struct rusage *rusage);` - Waits for a specific child process to change state with resource usage statistics. (Header: ``) * `void (*signal(int signum, void (*handler)(int)))(int);` - Sets a signal handler. (Header: ``) * `int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact);` - Examines and changes a signal action. (Header: ``) * `int sigemptyset(sigset_t *set);` - Initializes an empty signal set. (Header: ``) * `int sigaddset(sigset_t *set, int signum);` - Adds a signal to a signal set. (Header: ``) * `int kill(pid_t pid, int sig);` - Sends a signal to a process. (Header: ``) * `void exit(int status);` - Terminates the calling process. (Header: ``) * `char *getcwd(char *buf, size_t size);` - Gets the current working directory. (Header: ``) * `int chdir(const char *path);` - Changes the current working directory. (Header: ``) * `int stat(const char *pathname, struct stat *statbuf);` - Gets file status. (Header: ``) * `int lstat(const char *pathname, struct stat *statbuf);` - Gets file status, not following symbolic links. (Header: ``) * `int fstat(int fd, struct stat *statbuf);` - Gets file status of an open file descriptor. (Header: ``) * `int unlink(const char *pathname);` - Deletes a name from the filesystem. (Header: ``) * `int execve(const char *pathname, char *const argv[], char *const envp[]);` - Executes a program. (Header: ``) * `int dup(int oldfd);` - Duplicates a file descriptor. (Header: ``) * `int dup2(int oldfd, int newfd);` - Duplicates a file descriptor to a specific value. (Header: ``) * `int pipe(int pipefd[2]);` - Creates a pipe. (Header: ``) * `DIR *opendir(const char *name);` - Opens a directory stream. (Header: ``) * `struct dirent *readdir(DIR *dirp);` - Reads a directory entry. (Header: ``) * `int closedir(DIR *dirp);` - Closes a directory stream. (Header: ``) * `char *strerror(int errnum);` - Returns a string describing an error number. (Header: ``) * `void perror(const char *s);` - Prints a description of the last error. (Header: ``) * `int isatty(int fd);` - Tests if a file descriptor refers to a terminal. (Header: ``) * `char *ttyname(int fd);` - Returns the name of the terminal associated with a file descriptor. (Header: ``) * `int ttyslot(void);` - Returns the index of the current user's terminal. (Header: ``) * `int ioctl(int fd, unsigned long request, ...);` - Manipulates the underlying device parameters of special files. (Header: ``) * `char *getenv(const char *name);` - Gets an environment variable. (Header: ``) * `int tcsetattr(int fd, int optional_actions, const struct termios *termios_p);` - Sets the parameters associated with the terminal. (Header: ``) * `int tcgetattr(int fd, struct termios *termios_p);` - Gets the parameters associated with the terminal. (Header: ``) * `int tgetent(char *bp, const char *name);` - Loads a terminal entry from the termcap database. (Header: ``) * `int tgetflag(const char *id);` - Gets a boolean entry from the termcap database. (Header: ``) * `int tgetnum(const char *id);` - Gets a numeric entry from the termcap database. (Header: ``) * `char *tgetstr(const char *id, char **area);` - Gets a string entry from the termcap database. (Header: ``) * `char *tgoto(const char *cap, int col, int row);` - Computes a cursor movement string. (Header: ``) * `int tputs(const char *str, int affcnt, int (*putc)(int));` - Outputs a string with padding. (Header: ``)