General Data Types
typedef signed char B; /* signed 8-bit integer */
typedef signed short H; /* signed 16-bit integer */
typedef signed long W; /* signed 32-bit integer */
typedef unsigned char UB; /* unsigned 8-bit integer */
typedef unsigned short UH; /* unsigned 16-bit integer */
typedef unsigned long UW; /* unsigned 32-bit integer */
typedef signed char VB; /* 8-bit data without a fixed type */
typedef signed short VH; /* 16-bit data without a fixed type */
typedef signed long VW; /* 32-bit data without a fixed type */
typedef void *VP; /* pointer to data without a fixed type */
typedef volatile B _B; /* volatile declaration */
typedef volatile H _H;
typedef volatile W _W;
typedef volatile UB _UB;
typedef volatile UH _UH;
typedef volatile UW _UW;
typedef signed int INT; /* signed integer of processor bit width*/
typedef unsigned int UINT; /* unsigned integer of processor bit width*/
typedef INT ID; /* general ID */
typedef W MSEC; /* general time (milliseconds)*/
typedef void (*FP)(); /* general function address */
typedef INT (*FUNCP)(); /* general function address */
#define LOCAL static /* local symbol definition */
#define EXPORT /* global symbol definition */
#define IMPORT extern /* global symbol reference */
/*
*Boolean values
* TRUE = 1 is defined, but any value other than 0 is TRUE.
* A decision such as bool == TRUE must be avoided for this reason.
* Instead use bool != FALSE.
*/
typedef UINT BOOL;
#define TRUE 1 /* True */
#define FALSE 0 /* False */
/*
* TRON character codes
*/
typedef UH TC; /* TRON character code */
#define TNULL ((TC)0) /* TRON code string termination */
VB, VH, and VW differ from B, H, and W in that the former mean only the bit width is known, not the contents of the data type, whereas the latter clearly indicate integer type.
Parameters such as stksz, wupcnt, and message size that clearly do not take negative values are also in principle signed integer (INT, W) data type. This is in keeping with the overall TRON rule that integers should be treated as signed numbers to the extent possible. As for the timeout (TMO tmout) parameter, its being a signed integer enables the use of TMO_FEVR (= -1) having special meaning. Parameters with unsigned data type are those treated as bit patterns (object attribute, event flag, etc.).

Comments
Click here to Post a Comment