Closed Devessier closed 3 years ago
REPL internals:
./ft_ssl
binary we launch the REPL\n
character or EOF
3.1. If we encounter EOF, we exit the repl
3.2. We fill a buffer of 4096 bytes length (the same value as openssl) ; we can't exceed this size.char**
buffer of 4096 / sizeof(char **)
4.3. We split the buffer on white spaces and handle quotingargv
When no arguments are provided to the command, that is, launching it like this
./ft_ssl
, an interactive shell shall be started.Also, it means that when writing such command
echo "md5 -s lol" | ./ft_ssl
we should parsestdin
but not launch an interactive shell. For thatisatty
may help us to discern ifstdin
is a tty in which we can write and wait for user input, or simply a redirection.Be careful that the user can execute a command in the interactive shell such as
md5
, which shall read fromstdin
too.OpenSSL interactive shell understands single quotes and double quotes.
The commands available in the interactive shell shall be easily extendable and directly mapped to those usable from command line.