WallShell
An easy-to-use, highly portable, CLI using C99.
|
You must define
CUSTOM_THREADS
if you wish to do this.
If you are in a freestanding environment, or you wish to use your own wrapper on an already supported system, you must define the following functions:
The function declarations are already provided for you. You do have to retype the entire typedef for
ws_mutex_t
andws_thread_id_t
.
These are further explanations:
ws_mutex_t
is simply expected to be whatever handle your threads have.ws_thread_id_t
should be a unique identifier for each thread.getThreadID()
, this can be anything.unsigned long
void ws_lockMutex(ws_mutex_t* mut);
void ws_unlockMutex(ws_mutex_t* mut);
ws_mutex_t* ws_createMutex();
NULL
if one couldn't be created.void ws_destroyMutex(ws_mutex_t* mut);
NULL
, and ideally should be locked before destruction.ws_thread_id_t getThreadID();
void ws_printThreadID(FILE* stream);
fprintf
requires a format, and not all systems have the same thread identifiers.void ws_sleep(size_t ms);
ms
milliseconds.