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