KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1/* KallistiOS ##version##
2
3 arch/dreamcast/include/types.h
4 (c)2000-2001 Megan Potter
5
6*/
7
8/** \file arch/types.h
9 \brief Common integer types.
10 \ingroup system_types
11
12 This file contains typedefs for some common/useful integer types. These
13 types include ones that tell you exactly how long they are, as well as some
14 BSD-isms.
15
16 \author Megan Potter
17*/
18
19#ifndef __ARCH_TYPES_H
20#define __ARCH_TYPES_H
21
22#include <sys/cdefs.h>
23__BEGIN_DECLS
24
25#include <stddef.h>
26
27/** \addtogroup system_types
28 @{
29*/
30
31/* Generic types */
32typedef unsigned long long uint64; /**< \brief 64-bit unsigned integer */
33typedef unsigned long uint32; /**< \brief 32-bit unsigned integer */
34typedef unsigned short uint16; /**< \brief 16-bit unsigned integer */
35typedef unsigned char uint8; /**< \brief 8-bit unsigned integer */
36typedef long long int64; /**< \brief 64-bit signed integer */
37typedef long int32; /**< \brief 32-bit signed integer */
38typedef short int16; /**< \brief 16-bit signed integer */
39typedef char int8; /**< \brief 8-bit signed integer */
40
41/* Volatile types */
42typedef volatile uint64 vuint64; /**< \brief 64-bit volatile unsigned type */
43typedef volatile uint32 vuint32; /**< \brief 32-bit volatile unsigned type */
44typedef volatile uint16 vuint16; /**< \brief 16-bit volatile unsigned type */
45typedef volatile uint8 vuint8; /**< \brief 8-bit volatile unsigned type */
46typedef volatile int64 vint64; /**< \brief 64-bit volatile signed type */
47typedef volatile int32 vint32; /**< \brief 32-bit volatile signed type */
48typedef volatile int16 vint16; /**< \brief 16-bit volatile signed type */
49typedef volatile int8 vint8; /**< \brief 8-bit volatile signed type */
50
51/* Pointer arithmetic types */
52typedef uint32 ptr_t; /**< \brief Pointer arithmetic type */
53
54/* another format for type names */
55#ifndef _BSDTYPES_DEFINED
56
57/* \cond */
58#define __u_char_defined
59#define __u_short_defined
60#define __u_int_defined
61#define __u_long_defined
62#define __ushort_defined
63#define __uint_defined
64/* \endcond */
65
66typedef unsigned char u_char; /**< \brief BSD-style unsigned char */
67typedef unsigned short u_short; /**< \brief BSD-style unsigned short */
68typedef unsigned int u_int; /**< \brief BSD-style unsigned integer */
69typedef unsigned long u_long; /**< \brief BSD-style unsigned long */
70typedef unsigned short ushort; /**< \brief BSD-style unsigned short */
71typedef unsigned int uint; /**< \brief BSD-style unsigned integer */
72
73/* \cond */
74#define _BSDTYPES_DEFINED
75/* \endcond */
76
77#endif /* _BSDTYPES_DEFINED */
78
79/* This type may be used for any generic handle type that is allowed
80 to be negative (for errors) and has no specific bit count
81 restraints. */
82typedef int handle_t; /**< \brief Generic "handle" type */
83
84/* Thread and priority types */
85typedef handle_t tid_t; /**< \brief Thread ID type */
86typedef handle_t prio_t; /**< \brief Priority value type */
87
88#ifndef BYTE_ORDER
89/* Make sure to pull in the base endianness defines... */
90#ifndef LITTLE_ENDIAN
91#include <sys/_types.h>
92#endif
93
94/** \brief Endianness definition -- Little Endian */
95#define BYTE_ORDER LITTLE_ENDIAN
96#endif
97
98/** @} */
99
100__END_DECLS
101
102#endif /* __ARCH_TYPES_H */
Internal typedefs.
unsigned short uint16
16-bit unsigned integer
Definition types.h:34
unsigned long long uint64
64-bit unsigned integer
Definition types.h:32
handle_t prio_t
Priority value type.
Definition types.h:86
short int16
16-bit signed integer
Definition types.h:38
unsigned long uint32
32-bit unsigned integer
Definition types.h:33
long int32
32-bit signed integer
Definition types.h:37
int handle_t
Generic "handle" type.
Definition types.h:82
uint32 ptr_t
Pointer arithmetic type.
Definition types.h:52
volatile int64 vint64
64-bit volatile signed type
Definition types.h:46
volatile uint16 vuint16
16-bit volatile unsigned type
Definition types.h:44
volatile int8 vint8
8-bit volatile signed type
Definition types.h:49
unsigned long u_long
BSD-style unsigned long.
Definition types.h:69
unsigned int uint
BSD-style unsigned integer.
Definition types.h:71
volatile uint32 vuint32
32-bit volatile unsigned type
Definition types.h:43
unsigned short u_short
BSD-style unsigned short.
Definition types.h:67
volatile uint8 vuint8
8-bit volatile unsigned type
Definition types.h:45
unsigned short ushort
BSD-style unsigned short.
Definition types.h:70
volatile uint64 vuint64
64-bit volatile unsigned type
Definition types.h:42
unsigned int u_int
BSD-style unsigned integer.
Definition types.h:68
unsigned char uint8
8-bit unsigned integer
Definition types.h:35
volatile int32 vint32
32-bit volatile signed type
Definition types.h:47
handle_t tid_t
Thread ID type.
Definition types.h:85
unsigned char u_char
BSD-style unsigned char.
Definition types.h:66
char int8
8-bit signed integer
Definition types.h:39
long long int64
64-bit signed integer
Definition types.h:36
volatile int16 vint16
16-bit volatile signed type
Definition types.h:48