generated from 3lsy/template-42-C
-
Notifications
You must be signed in to change notification settings - Fork 0
Minishell functions
3lsy edited this page Aug 5, 2023
·
2 revisions
| C Function | Description |
|---|---|
<function> |
| C Function | Description | Required Headers |
|---|---|---|
readline |
Read a line from the user input with editing support. |
#include <readline/readline.h>#include <readline/history.h>
|
rl_clear_history |
Clear the history of previously entered lines in readline. | #include <readline/history.h> |
rl_on_new_line |
Signal readline that the cursor is on a new line. |
#include <readline/readline.h>#include <readline/history.h>
|
rl_replace_line |
Replace the current input line in readline. |
#include <readline/readline.h>#include <readline/history.h>
|
rl_redisplay |
Redisplay the current input line in readline. |
#include <readline/readline.h>#include <readline/history.h>
|
add_history |
Add a line to the history list in readline. | #include <readline/history.h> |
printf |
Print formatted data to the standard output. | #include <stdio.h> |
malloc |
Allocate memory dynamically. | #include <stdlib.h> |
free |
Deallocate dynamically allocated memory. | #include <stdlib.h> |
write |
Write data to a file descriptor. | #include <unistd.h> |
access |
Check user's permissions for a file. | #include <unistd.h> |
open |
Open a file or create it if it doesn't exist. | #include <fcntl.h> |
read |
Read data from a file descriptor. | #include <unistd.h> |
close |
Close a file descriptor. | #include <unistd.h> |
fork |
Create a new process by duplicating the current process. | #include <unistd.h> |
wait |
Wait for any child process to terminate. | #include <sys/wait.h> |
waitpid |
Wait for a specific child process to terminate. | #include <sys/wait.h> |
wait3 |
Wait for child process termination with resource usage information. | #include <sys/wait.h> |
wait4 |
Wait for child process termination with additional options. | #include <sys/wait.h> |
signal |
Set a signal handler for a specific signal. | #include <signal.h> |
sigaction |
Set or get signal action. | #include <signal.h> |
sigemptyset |
Initialize an empty signal set. | #include <signal.h> |
sigaddset |
Add a signal to a signal set. | #include <signal.h> |
kill |
Send a signal to a process. | #include <signal.h> |
exit |
Terminate the current process. | #include <stdlib.h> |
getcwd |
Get the current working directory. | #include <unistd.h> |
chdir |
Change the current working directory. | #include <unistd.h> |
stat |
Get file status. | #include <sys/stat.h> |
lstat |
Get symbolic link status. | #include <sys/stat.h> |
fstat |
Get file status from file descriptor. | #include <sys/stat.h> |
unlink |
Delete a name from the file system. | #include <unistd.h> |
execve |
Execute a program. | #include <unistd.h> |
dup |
Duplicate a file descriptor. | #include <unistd.h> |
dup2 |
Duplicate a file descriptor to a specific file descriptor number. | #include <unistd.h> |
pipe |
Create a pipe (interprocess communication). | #include <unistd.h> |
opendir |
Open a directory for reading. | #include <dirent.h> |
readdir |
Read a directory entry. | #include <dirent.h> |
closedir |
Close a directory stream. | #include <dirent.h> |
strerror |
Get string representation of error number. | #include <string.h> |
perror |
Print error message to standard error. | #include <stdio.h> |
isatty |
Check if a file descriptor refers to a terminal. | #include <unistd.h> |
ttyname |
Get the name of the terminal. | #include <unistd.h> |
ttyslot |
Get the slot number of the current terminal in the tty database. | #include <curses.h> |
ioctl |
Control device (input/output) operations. | #include <termios.h> |
getenv |
Get the value of an environment variable. | #include <stdlib.h> |
tcsetattr |
Set terminal attributes. | #include <termios.h> |
tcgetattr |
Get terminal attributes. | #include <termios.h> |
tgetent |
Initialize the terminfo database. | #include <curses.h> |
tgetflag |
Get boolean terminfo capability. | #include <curses.h> |
tgetnum |
Get numeric terminfo capability. | #include <curses.h> |
tgetstr |
Get string terminfo capability. | #include <curses.h> |
tgoto |
Generate a cursor motion string. | #include <curses.h> |
tputs |
Output a string with terminal capabilities. | #include <curses.h> |