This document describes the architecture of Libcox. The information here is useful to those who want to understand or modify the inner workings of Libcox. A block diagram showing the main components of Libcox and how they interrelate is shown above. The text that follows will provide a quick overview of each of these components. Like most modern software, Libcox is built-up on layers, The upper-layers hence the command executions layers are presented to the host application via a set of exported interfaces (The Libcox API).
The Libcox API is rich, yet relatively simple and easy to code to. the API is fully documented here and the article An Introduction to the libcox API is a good starting point on how to start programming with Libcox.
The command processor is the heart of Libcox. Think of this as a mini-compiler under the hood. The processor is composed of a tokenizer which split the user textual commands into a set of token. The stream of token is then analysed and assembled into a set of libcox_values which is then executed by the callback implementing the command logic. All of this is invoked only from a tiny set of interfaces: libcox_exec() and libcox_exec_fmt().
Libcox is designed to run on multitude of platforms. In order to provide cross platform systems calls between these platforms, Libcox uses an abstraction layer to interface with the operating system. Each supported operating system has its own implementation. An instance of the libcox_vfs object defines the interface between the Libcox core and the underlying operating system. The "vfs" in the name of the object stands for "Virtual File System".
Libcox is very easy to learn, even for new programmer. Here is some useful links to start with: