From 8aed9ed59218d7d5c145b8ccbfa91167b8af17c6 Mon Sep 17 00:00:00 2001 From: whaffman Date: Sat, 1 Feb 2025 00:41:21 +0100 Subject: [PATCH] added inc/minishell.h --- inc/minishell.h | 166 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 inc/minishell.h diff --git a/inc/minishell.h b/inc/minishell.h new file mode 100644 index 0000000..c5f4d5d --- /dev/null +++ b/inc/minishell.h @@ -0,0 +1,166 @@ +/** + * @file minishell.h + * + * @brief Header file for the Minishell project. + * + * This header file includes all necessary libraries and headers required for the Minishell project. + * The following is a list of included headers and the functions or system calls they provide: + * + * @headerfile + * - printf(const char *format, ...); + * - Prints formatted data to stdout. + * - perror(const char *s); + * - Prints a descriptive error message to stderr. + * + * @headerfile + * - malloc(size_t size); + * - Allocates memory dynamically. + * - free(void *ptr); + * - Frees dynamically allocated memory. + * - exit(int status); + * - Terminates the calling process. + * - getenv(const char *name); + * - Retrieves the value of an environment variable. + * + * @headerfile + * - write(int fd, const void *buf, size_t count); + * - Writes data to a file descriptor. + * - access(const char *pathname, int mode); + * - Checks user's permissions for a file. + * - read(int fd, void *buf, size_t count); + * - Reads data from a file descriptor. + * - close(int fd); + * - Closes a file descriptor. + * - fork(void); + * - Creates a new process. + * - getcwd(char *buf, size_t size); + * - Gets the current working directory. + * - chdir(const char *path); + * - Changes the current working directory. + * - unlink(const char *pathname); + * - Deletes a name from the filesystem. + * - execve(const char *pathname, char *const argv[], char *const envp[]); + * - Executes a program. + * - dup(int oldfd); + * - Duplicates a file descriptor. + * - dup2(int oldfd, int newfd); + * - Duplicates a file descriptor to a specific descriptor number. + * - pipe(int pipefd[2]); + * - Creates a pipe. + * - isatty(int fd); + * - Checks if a file descriptor refers to a terminal. + * - ttyname(int fd); + * - Returns the name of the terminal associated with a file descriptor. + * - ttyslot(void); + * - Returns the index of the current terminal. + * + * @headerfile + * - strerror(int errnum); + * - Returns a string describing the error number. + * + * @headerfile + * - Required for various system calls and data types. + * + * @headerfile + * - wait(int *wstatus); + * - Waits for a child process to change state. + * - waitpid(pid_t pid, int *wstatus, int options); + * - Waits for a specific child process to change state. + * - wait3(int *wstatus, int options, struct rusage *rusage); + * - Waits for a child process to change state with resource usage information. + * - wait4(pid_t pid, int *wstatus, int options, struct rusage *rusage); + * - Waits for a specific child process to change state with resource usage information. + * + * @headerfile + * - open(const char *pathname, int flags, ...); + * - Opens a file. + * + * @headerfile + * - Provides access to the errno variable. + * + * @headerfile + * - signal(int signum, void (*handler)(int)); + * - Sets a signal handler. + * - sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); + * - Examines and changes a signal action. + * - sigemptyset(sigset_t *set); + * - Initializes a signal set to empty. + * - sigaddset(sigset_t *set, int signum); + * - Adds a signal to a signal set. + * - kill(pid_t pid, int sig); + * - Sends a signal to a process. + * + * @headerfile + * - readline(const char *prompt); + * - Reads a line of input from the user. + * - rl_clear_history(void); + * - Clears the history list. + * - rl_on_new_line(void); + * - Informs the readline library that the cursor is on a new line. + * - rl_replace_line(const char *text, int clear_undo); + * - Replaces the contents of the current line. + * - rl_redisplay(void); + * - Redisplays the current line. + * - add_history(const char *line); + * - Adds a line to the history list. + * + * @headerfile + * - opendir(const char *name); + * - Opens a directory stream. + * - readdir(DIR *dirp); + * - Reads a directory entry. + * - closedir(DIR *dirp); + * - Closes a directory stream. + * + * @headerfile + * - stat(const char *pathname, struct stat *statbuf); + * - Gets file status. + * - lstat(const char *pathname, struct stat *statbuf); + * - Gets file status, not following symbolic links. + * - fstat(int fd, struct stat *statbuf); + * - Gets file status for an open file descriptor. + * + * @headerfile + * - ioctl(int fd, unsigned long request, ...); + * - Manipulates the underlying device parameters of special files. + * + * @headerfile + * - tcsetattr(int fd, int optional_actions, const struct termios *termios_p); + * - Sets the parameters associated with the terminal. + * - tcgetattr(int fd, struct termios *termios_p); + * - Gets the parameters associated with the terminal. + * + * @headerfile + * - tgetent(char *bp, const char *name); + * - Loads the terminal entry for a given terminal name. + * - tgetflag(const char *id); + * - Gets the boolean value of a terminal capability. + * - tgetnum(const char *id); + * - Gets the numeric value of a terminal capability. + * - tgetstr(const char *id, char **area); + * - Gets the string value of a terminal capability. + * - tgoto(const char *cap, int col, int row); + * - Computes a cursor movement string. + * - tputs(const char *str, int affcnt, int (*putc)(int)); + * - Outputs a string with padding. + */ +#ifndef MINISHELL_H +# define MINISHELL_H + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +#endif // MINISHELL_H \ No newline at end of file