tkernel_2/include/typedef.h | bare source | permlink (0.00 seconds) |
1: /* 2: *---------------------------------------------------------------------- 3: * T-Kernel 2.0 Software Package 4: * 5: * Copyright 2011 by Ken Sakamura. 6: * This software is distributed under the latest version of T-License 2.x. 7: *---------------------------------------------------------------------- 8: * 9: * Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17. 10: * Modified by T-Engine Forum at 2014/07/14. 11: * Modified by TRON Forum(http://www.tron.org/) at 2015/06/01. 12: * 13: *---------------------------------------------------------------------- 14: */ 15: 16: /* 17: * @(#)typedef.h 18: * 19: * Standard data type definitions 20: */ 21: 22: #ifndef __TYPEDEF_H__ 23: #define __TYPEDEF_H__ 24: 25: #ifdef __cplusplus 26: extern "C" { 27: #endif 28: 29: #ifdef TKERNEL_CHECK_CONST 30: #define CONST const 31: #else 32: #define CONST 33: #endif 34: 35: /* 36: * General-purpose data type 37: */ 38: typedef signed char B; /* Signed 8 bit integer */ 39: typedef signed short H; /* Signed 16 bit integer */ 40: typedef signed long W; /* Signed 32 bit integer */ 41: typedef signed long long D; /* Signed 64 bit integer */ 42: typedef unsigned char UB; /* Unsigned 8 bit integer */ 43: typedef unsigned short UH; /* Unsigned 16 bit integer */ 44: typedef unsigned long UW; /* Unsigned 32 bit integer */ 45: typedef unsigned long long UD; /* Unsigned 64 bit integer */ 46: 47: typedef char VB; /* Nonuniform type 8 bit data */ 48: typedef short VH; /* Nonuniform type 16 bit data */ 49: typedef long VW; /* Nonuniform type 32 bit data */ 50: typedef long long VD; /* Nonuniform type 64 bit data */ 51: typedef void *VP; /* Nonuniform type data pointer */ 52: 53: typedef volatile B _B; /* Volatile statement attached */ 54: typedef volatile H _H; 55: typedef volatile W _W; 56: typedef volatile D _D; 57: typedef volatile UB _UB; 58: typedef volatile UH _UH; 59: typedef volatile UW _UW; 60: typedef volatile UD _UD; 61: 62: typedef signed int INT; /* Processor bit width signed integer */ 63: typedef unsigned int UINT; /* Processor bit width unsigned integer */ 64: 65: typedef INT ID; /* ID general */ 66: typedef W MSEC; /* Time general (millisecond) */ 67: 68: typedef void (*FP)(); /* Function address general */ 69: typedef INT (*FUNCP)(); /* Function address general */ 70: 71: #define LOCAL static /* Local symbol definition */ 72: #define EXPORT /* Global symbol definition */ 73: #define IMPORT extern /* Global symbol reference */ 74: 75: /* 76: * Boolean value 77: * Defined as TRUE = 1, but it is always true when not 0. 78: * Thus, comparison such as bool = TRUE are not permitted. 79: * Should be as per bool !=FALSE. 80: */ 81: typedef UINT BOOL; 82: #define TRUE 1 /* True */ 83: #define FALSE 0 /* False */ 84: 85: /* 86: * TRON character code 87: */ 88: typedef UH TC; /* TRON character code */ 89: #define TNULL ((TC)0) /* End of TRON code character string */ 90: 91: #ifdef __cplusplus 92: } 93: #endif 94: #endif /* __TYPEDEF_H__ */