Merge branch 'dhewg'
[libogc.git] / gc / gctypes.h
blobd5f5f53beefddf36f5087fc3a27bdf6f46fe86c4
1 #ifndef __GCTYPES_H__
2 #define __GCTYPES_H__
4 /*! \file gctypes.h
5 \brief Data type definitions
7 */
10 #ifdef __cplusplus
11 extern "C" {
12 #endif /* __cplusplus */
14 /*+----------------------------------------------------------------------------------------------+*/
15 typedef unsigned char u8; ///< 8bit unsigned integer
16 typedef unsigned short u16; ///< 16bit unsigned integer
17 typedef unsigned int u32; ///< 32bit unsigned integer
18 typedef unsigned long long u64; ///< 64bit unsigned integer
19 /*+----------------------------------------------------------------------------------------------+*/
20 typedef signed char s8; ///< 8bit signed integer
21 typedef signed short s16; ///< 16bit signed integer
22 typedef signed int s32; ///< 32bit signed integer
23 typedef signed long long s64; ///< 64bit signed integer
24 /*+----------------------------------------------------------------------------------------------+*/
25 typedef volatile unsigned char vu8; ///< 8bit unsigned volatile integer
26 typedef volatile unsigned short vu16; ///< 16bit unsigned volatile integer
27 typedef volatile unsigned int vu32; ///< 32bit unsigned volatile integer
28 typedef volatile unsigned long long vu64; ///< 64bit unsigned volatile integer
29 /*+----------------------------------------------------------------------------------------------+*/
30 typedef volatile signed char vs8; ///< 8bit signed volatile integer
31 typedef volatile signed short vs16; ///< 16bit signed volatile integer
32 typedef volatile signed int vs32; ///< 32bit signed volatile integer
33 typedef volatile signed long long vs64; ///< 64bit signed volatile integer
34 /*+----------------------------------------------------------------------------------------------+*/
35 // fixed point math typedefs
36 typedef s16 sfp16; ///< 1:7:8 fixed point
37 typedef s32 sfp32; ///< 1:19:8 fixed point
38 typedef u16 ufp16; ///< 8:8 fixed point
39 typedef u32 ufp32; ///< 24:8 fixed point
40 /*+----------------------------------------------------------------------------------------------+*/
41 typedef float f32;
42 typedef double f64;
43 /*+----------------------------------------------------------------------------------------------+*/
44 typedef volatile float vf32;
45 typedef volatile double vf64;
46 /*+----------------------------------------------------------------------------------------------+*/
48 // bool is a standard type in cplusplus, but not in c.
49 #ifndef __cplusplus
50 /** C++ compatible bool for C
53 typedef u8 bool;
54 enum { false, true };
55 #endif
57 typedef unsigned int BOOL;
58 /*+----------------------------------------------------------------------------------------------+*/
59 // alias type typedefs
60 #define FIXED s32 ///< Alias type for sfp32
61 /*+----------------------------------------------------------------------------------------------+*/
62 // boolean defines
63 #ifndef boolean
64 #define boolean u8
65 #endif
66 /*+----------------------------------------------------------------------------------------------+*/
67 #ifndef TRUE
68 #define TRUE 1 ///< True
69 #endif
70 /*+----------------------------------------------------------------------------------------------+*/
71 #ifndef FALSE
72 #define FALSE 0 ///< False
73 #endif
74 /*+----------------------------------------------------------------------------------------------+*/
75 #ifndef NULL
76 #define NULL 0 ///< Pointer to 0
77 #endif
78 /*+----------------------------------------------------------------------------------------------+*/
79 #ifndef LITTLE_ENDIAN
80 #define LITTLE_ENDIAN 3412
81 #endif /* LITTLE_ENDIAN */
82 /*+----------------------------------------------------------------------------------------------+*/
83 #ifndef BIG_ENDIAN
84 #define BIG_ENDIAN 1234
85 #endif /* BIGE_ENDIAN */
86 /*+----------------------------------------------------------------------------------------------+*/
87 #ifndef BYTE_ORDER
88 #define BYTE_ORDER BIG_ENDIAN
89 #endif /* BYTE_ORDER */
90 /*+----------------------------------------------------------------------------------------------+*/
93 //! argv structure
94 /*! \struct __argv
96 structure used to set up argc/argv
99 struct __argv {
100 int argvMagic; //!< argv magic number, set to 0x5f617267 ('_arg') if valid
101 char *commandLine; //!< base address of command line, set of null terminated strings
102 int length;//!< total length of command line
103 int argc;
104 char **argv;
105 char **endARGV;
108 //! Default location for the system argv structure.
109 extern struct __argv *__system_argv;
111 // argv struct magic number
112 #define ARGV_MAGIC 0x5f617267
114 #ifdef __cplusplus
116 #endif /* __cplusplus */
118 #endif /* TYPES_H */
121 /* END OF FILE */