WallShell
An easy-to-use, highly portable, CLI using C99.
|
A big goal of WallShell is to use as little of the standard library (libc) as possible, while still providing a feature-rich command line interface.
Compiling for POSIX or Windows based systems require the usage of some system specific headers. If this is a problem, you'll have to manually do
CUSTOM_CONSOLE_SETUP
(andCUSTOM_THREAD_WRAPPER
if using threads). See this for more details.
MSVC (the Microsoft C Compiler) "deprecates" many of the libc functions used, stating that they are not safe. This is irrelevent in WallShell. The contexts in which these functions are used ensure memory safety, including buffer bounds checks. WallShell disables warning 4996
(which tells you the functions are deprecated and prevents you from compiling), only for the wall_shell.c
source file.
NOTE: The rest of this file is meant for freestanding environments. If you are not compiling for a freestanding environment, or rolling your own libc, ignore the rest of this file.
All functions and expected behavior can be found in at cppreference. Please note that WallShell expects the C99 versions of these functions. Listed below are the required headers & functions that are used from them.
These headers should be provided by your compiler, and don't need to be manually created or added by your standard library:
stdint.h
stdbool.h
stddef.h
stdarg.h
These headers/functions typically have to be defined by your standard library (or you) themselves.
strtok
DISABLE_MALLOC
is not defined. It typically uses malloc()
internally.strlen
strcmp
strcpy
memcpy
memset
malloc
realloc
fprintf
printf
, and define the following:FILE
stdin
stdout
stderr
EOF