Rise
The Vieneo Province
Toggle main menu visibility
Loading...
Searching...
No Matches
steamtypes.h
Go to the documentation of this file.
1
//========= Copyright 1996-2022, Valve LLC, All rights reserved. ============
2
3
#ifndef STEAMTYPES_H
4
#define STEAMTYPES_H
5
6
#define S_CALLTYPE __cdecl
7
// WARNING: __cdecl is potentially #defined away in steam_api_common.h
8
9
// Steam-specific types. Defined here so this header file can be included in other code bases.
10
#ifndef WCHARTYPES_H
11
typedef
unsigned
char
uint8
;
12
#endif
13
14
#ifdef __GNUC__
15
#if __GNUC__ < 4
16
#error "Steamworks requires GCC 4.X (4.2 or 4.4 have been tested)"
17
#endif
18
#endif
19
20
#if defined(__LP64__) || defined(__x86_64__) || defined(_WIN64) || defined(__aarch64__) || defined(__s390x__)
21
#define X64BITS
22
#endif
23
24
#if !defined(VALVE_BIG_ENDIAN)
25
#if defined( __GNUC__ ) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
26
#define VALVE_BIG_ENDIAN 1
27
#endif
28
#endif
29
30
typedef
unsigned
char
uint8
;
31
typedef
signed
char
int8
;
32
33
#if defined( _WIN32 ) && !defined( __GNUC__ )
34
35
typedef
__int16
int16
;
36
typedef
unsigned
__int16
uint16
;
37
typedef
__int32
int32
;
38
typedef
unsigned
__int32
uint32
;
39
typedef
__int64
int64
;
40
typedef
unsigned
__int64
uint64
;
41
42
typedef
int64
lint64
;
43
typedef
uint64
ulint64
;
44
45
#ifdef X64BITS
46
typedef
__int64
intp
;
// intp is an integer that can accomodate a pointer
47
typedef
unsigned
__int64
uintp
;
// (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *)
48
#else
49
typedef
__int32
intp
;
50
typedef
unsigned
__int32
uintp
;
51
#endif
52
53
#else
// _WIN32
54
55
typedef
short
int16
;
56
typedef
unsigned
short
uint16
;
57
typedef
int
int32
;
58
typedef
unsigned
int
uint32
;
59
typedef
long
long
int64
;
60
typedef
unsigned
long
long
uint64
;
61
62
// [u]int64 are actually defined as 'long long' and gcc 64-bit
63
// doesn't automatically consider them the same as 'long int'.
64
// Changing the types for [u]int64 is complicated by
65
// there being many definitions, so we just
66
// define a 'long int' here and use it in places that would
67
// otherwise confuse the compiler.
68
typedef
long
int
lint64
;
69
typedef
unsigned
long
int
ulint64
;
70
71
#ifdef X64BITS
72
typedef
long
long
intp
;
73
typedef
unsigned
long
long
uintp
;
74
#else
75
typedef
int
intp
;
76
typedef
unsigned
int
uintp
;
77
#endif
78
79
#endif
// else _WIN32
80
81
typedef
uint32
AppId_t
;
82
const
AppId_t
k_uAppIdInvalid
= 0x0;
83
84
// AppIds and DepotIDs also presently share the same namespace
85
typedef
uint32
DepotId_t
;
86
const
DepotId_t
k_uDepotIdInvalid
= 0x0;
87
88
// RTime32. Seconds elapsed since Jan 1 1970, i.e. unix timestamp.
89
// It's the same as time_t, but it is always 32-bit and unsigned.
90
typedef
uint32
RTime32
;
91
92
// handle to a Steam API call
93
typedef
uint64
SteamAPICall_t
;
94
const
SteamAPICall_t
k_uAPICallInvalid
= 0x0;
95
96
typedef
uint32
AccountID_t
;
97
const
AccountID_t
k_uAccountIdInvalid
= 0;
98
99
// Party Beacon ID
100
typedef
uint64
PartyBeaconID_t
;
101
const
PartyBeaconID_t
k_ulPartyBeaconIdInvalid
= 0;
102
103
enum
ESteamIPType
104
{
105
k_ESteamIPTypeIPv4
= 0,
106
k_ESteamIPTypeIPv6
= 1,
107
};
108
109
#pragma pack( push, 1 )
110
111
struct
SteamIPAddress_t
112
{
113
union
{
114
115
uint32
m_unIPv4
;
// Host order
116
uint8
m_rgubIPv6
[16];
// Network order! Same as inaddr_in6. (0011:2233:4455:6677:8899:aabb:ccdd:eeff)
117
118
// Internal use only
119
uint64
m_ipv6Qword
[2];
// big endian
120
};
121
122
ESteamIPType
m_eType
;
123
124
bool
IsSet
()
const
125
{
126
if
(
k_ESteamIPTypeIPv4
==
m_eType
)
127
{
128
return
m_unIPv4 != 0;
129
}
130
else
131
{
132
return
m_ipv6Qword[0] !=0 || m_ipv6Qword[1] != 0;
133
}
134
}
135
136
static
SteamIPAddress_t
IPv4Any
()
137
{
138
SteamIPAddress_t
ipOut;
139
ipOut.
m_eType
=
k_ESteamIPTypeIPv4
;
140
ipOut.m_unIPv4 = 0;
141
142
return
ipOut;
143
}
144
145
static
SteamIPAddress_t
IPv6Any
()
146
{
147
SteamIPAddress_t
ipOut;
148
ipOut.
m_eType
=
k_ESteamIPTypeIPv6
;
149
ipOut.m_ipv6Qword[0] = 0;
150
ipOut.m_ipv6Qword[1] = 0;
151
152
return
ipOut;
153
}
154
155
static
SteamIPAddress_t
IPv4Loopback
()
156
{
157
SteamIPAddress_t
ipOut;
158
ipOut.
m_eType
=
k_ESteamIPTypeIPv4
;
159
ipOut.m_unIPv4 = 0x7f000001;
160
161
return
ipOut;
162
}
163
164
static
SteamIPAddress_t
IPv6Loopback
()
165
{
166
SteamIPAddress_t
ipOut;
167
ipOut.
m_eType
=
k_ESteamIPTypeIPv6
;
168
ipOut.m_ipv6Qword[0] = 0;
169
ipOut.m_ipv6Qword[1] = 0;
170
ipOut.m_rgubIPv6[15] = 1;
171
172
return
ipOut;
173
}
174
};
175
176
#pragma pack( pop )
177
178
#endif
// STEAMTYPES_H
uint32
const char *typedef uint32(S_CALLTYPE *SteamAPI_CheckCallbackRegistered_t)(int iCallbackNum)
Definition
steam_api_common.h:73
lint64
long int lint64
Definition
steamtypes.h:68
AppId_t
uint32 AppId_t
Definition
steamtypes.h:81
uint16
unsigned short uint16
Definition
steamtypes.h:56
k_ulPartyBeaconIdInvalid
const PartyBeaconID_t k_ulPartyBeaconIdInvalid
Definition
steamtypes.h:101
uint32
unsigned int uint32
Definition
steamtypes.h:58
int8
signed char int8
Definition
steamtypes.h:31
RTime32
uint32 RTime32
Definition
steamtypes.h:90
uint64
unsigned long long uint64
Definition
steamtypes.h:60
k_uAppIdInvalid
const AppId_t k_uAppIdInvalid
Definition
steamtypes.h:82
ulint64
unsigned long int ulint64
Definition
steamtypes.h:69
int16
short int16
Definition
steamtypes.h:55
intp
int intp
Definition
steamtypes.h:75
int32
int int32
Definition
steamtypes.h:57
ESteamIPType
ESteamIPType
Definition
steamtypes.h:104
k_ESteamIPTypeIPv4
@ k_ESteamIPTypeIPv4
Definition
steamtypes.h:105
k_ESteamIPTypeIPv6
@ k_ESteamIPTypeIPv6
Definition
steamtypes.h:106
uintp
unsigned int uintp
Definition
steamtypes.h:76
SteamAPICall_t
uint64 SteamAPICall_t
Definition
steamtypes.h:93
k_uAPICallInvalid
const SteamAPICall_t k_uAPICallInvalid
Definition
steamtypes.h:94
k_uAccountIdInvalid
const AccountID_t k_uAccountIdInvalid
Definition
steamtypes.h:97
k_uDepotIdInvalid
const DepotId_t k_uDepotIdInvalid
Definition
steamtypes.h:86
AccountID_t
uint32 AccountID_t
Definition
steamtypes.h:96
DepotId_t
uint32 DepotId_t
Definition
steamtypes.h:85
uint8
unsigned char uint8
Definition
steamtypes.h:11
PartyBeaconID_t
uint64 PartyBeaconID_t
Definition
steamtypes.h:100
int64
long long int64
Definition
steamtypes.h:59
SteamIPAddress_t
Definition
steamtypes.h:112
SteamIPAddress_t::IPv6Any
static SteamIPAddress_t IPv6Any()
Definition
steamtypes.h:145
SteamIPAddress_t::IPv4Any
static SteamIPAddress_t IPv4Any()
Definition
steamtypes.h:136
SteamIPAddress_t::IPv4Loopback
static SteamIPAddress_t IPv4Loopback()
Definition
steamtypes.h:155
SteamIPAddress_t::m_eType
ESteamIPType m_eType
Definition
steamtypes.h:122
SteamIPAddress_t::IsSet
bool IsSet() const
Definition
steamtypes.h:124
SteamIPAddress_t::IPv6Loopback
static SteamIPAddress_t IPv6Loopback()
Definition
steamtypes.h:164
SteamIPAddress_t::[union].__unnamed0__::m_unIPv4
uint32 m_unIPv4
SteamIPAddress_t::[union].__unnamed0__::m_rgubIPv6
uint8 m_rgubIPv6[16]
SteamIPAddress_t::[union].__unnamed0__::m_ipv6Qword
uint64 m_ipv6Qword[2]
ThirdParty
SteamworksSDK
include
steam
steamtypes.h
Generated on
for Rise by
1.18.0