Ioto Safe Runtime (R)
Ioto is built upon a safe portable runtime (R). This layer insulates the rest of Ioto from the underlying platform and allows it to be highly portable to new operating systems or hardware.
The safe runtime provides a suite of services that facilitate the creation of high performance, non-blocking management applications by providing: fiber coroutines, lists, hashing, safe strings, buffering, timers, events, networking, buffer management and JSON parsing.
The safe runtime provides a more secure environment in which to program as it replaces 'C' APIs that are prone to buffer overflows and other similar security exploits. The safe runtime includes a fast, safe string library that supports a secure programming style.
Ioto Types
The Ioto Agent uses an operating system dependent layer called "osdep".
By including "osdep.h", you gain access to these cross-platform types. Some types are implemented natively on some platforms and others are provided by "osdep".
Quick Tour
Here are some primitive data types:
Other useful types:
For a full list of the osdep types, see: OSDEP API
Return Values
Many Ioto APIs return an integer value that is zero for success and otherwise set to a negative error code.
Here are the return codes used by the Ioto runtime:
NULL Tolerance
Ioto adopts a technique call NULL tolerance where APIs, wherever possible, tolerate NULL arguments and attempt to do something reasonable with their arguments, rather than crashing the applications.
The standard C library is not NULL tolerant. If you pass a NULL pointer to routines such as as free() or strlen() your program will crash.
The Ioto memory allocator is NULL tolerant when calling rFree. Similarly, Ioto provides a safe string library that will accept NULL arguments wherever possible. In the case of strlen, Ioto provides slen() which will return zero if passed a NULL pointer.