/* basic_types.h -- basic data types * * AUTHOR(S) Jean-Francois Bignolles (jfb) * * 2003-04-01 jfb * creation */ #ifndef FLIP_TYPES_H_INCLUDED #define FLIP_TYPES_H_INCLUDED #ifndef __KERNEL__ #include "stdlib.h" /* These are the standard C99 integer types (should come from ) */ #include //#include #if 0 typedef signed char int8_t; typedef signed short int16_t; typedef signed int int32_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; typedef unsigned int uintptr_t; #endif /* This is the standard C99 boolean type (should come from ) */ //#include #if 1 #define false 0 #define true 1 #ifndef __cplusplus typedef int bool; #endif #endif /* These are derived, qualified types */ // TODO rework this #define DEFINE_SIGNED_INT_VARIANTS( b) \ typedef const int##b##_t INT##b##_C; \ typedef int##b##_t INT##b##_S; \ typedef const int##b##_t INT##b##_SC; \ typedef volatile int##b##_t INT##b##_V; #define DEFINE_UNSIGNED_INT_VARIANTS( b) \ typedef const uint##b##_t UINT##b##_C; \ typedef uint##b##_t UINT##b##_S; \ typedef const uint##b##_t UINT##b##_SC; \ typedef volatile uint##b##_t UINT##b##_V; DEFINE_SIGNED_INT_VARIANTS (8) DEFINE_SIGNED_INT_VARIANTS (16) DEFINE_SIGNED_INT_VARIANTS (32) DEFINE_UNSIGNED_INT_VARIANTS (8) DEFINE_UNSIGNED_INT_VARIANTS (16) DEFINE_UNSIGNED_INT_VARIANTS (32) /* A constant string */ typedef const char *cstr; #ifndef __BORLAND__ /* slices sur 64 bits */ typedef uint64_t slice_t; // TODO: PUT THIS SOMEWHERE ELSE #endif // __BORLAND__ #else #include "linux/types.h" #endif /* __KERNEL__ */ /* Array index/size in words from index/size in bytes */ #define TO_W8( offset) (offset) #define TO_W16( offset) ((offset) >> 1) #define TO_W32( offset) ((offset) >> 2) #define EOLS "\n" #endif /* ! FLIP_TYPES_H_INCLUDED */