Chapter 1
Basics

We are going to need these basic definitions:

typedef void            kVoid;

#define kNil            (kVoid*)0

typedef bool            kBool;

#define kFalse          false
#define kTrue           true

Besides kVoid and kBool, throughout this project we are going to use the following types:

typedef uint8_t         kUByte;
typedef uint16_t        kUShort;
typedef uint32_t        kULong;
typedef uint64_t        kULLong;

typedef int8_t          kSByte;
typedef int16_t         kSShort;
typedef int32_t         kSLong;
typedef int64_t         kSLLong;

typedef unsigned int    kUInt;
typedef int             kSInt;

typedef float           kSingle;
typedef double          kDouble;
typedef long double     kExtended;

typedef uint8_t         kByte;

There are four unsigned numbers, four signed numbers, and three floating-point numbers, each with their own size. There are also two ints, kUInt and kSInt, and a kByte. Next come the variable sized types.

#ifdef kBit32
typedef uint32_t        kNatural;
typedef int32_t         kInteger;
typedef float           kReal;
typedef float _Complex  kComplex;
typedef uint32_t        kSize;
typedef uint32_t        kFlags;
#endif

#ifdef kBit64
typedef uint64_t        kNatural;
typedef int64_t         kInteger;
typedef double          kReal;
typedef double _Complex kComplex;
typedef uint64_t        kSize;
typedef uint64_t        kFlags;
#endif

These represent either 32- or 64-bits data, depending upon the CPU. There are the naturals (kNatural), or unsigned numbers, the integers (kInteger), or signed numbers, and the reals (kReal). There is also the variable arguments type (kArgs).

typedef va_list         kArgs;

Finally, kError is a variable to store error numbers:

extern kInteger         kError;