Rise
The Vieneo Province
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
11typedef 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
30typedef unsigned char uint8;
31typedef signed char int8;
32
33#if defined( _WIN32 ) && !defined( __GNUC__ )
34
35typedef __int16 int16;
36typedef unsigned __int16 uint16;
37typedef __int32 int32;
38typedef unsigned __int32 uint32;
39typedef __int64 int64;
40typedef unsigned __int64 uint64;
41
42typedef int64 lint64;
43typedef uint64 ulint64;
44
45#ifdef X64BITS
46typedef __int64 intp; // intp is an integer that can accomodate a pointer
47typedef unsigned __int64 uintp; // (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *)
48#else
49typedef __int32 intp;
50typedef unsigned __int32 uintp;
51#endif
52
53#else // _WIN32
54
55typedef short int16;
56typedef unsigned short uint16;
57typedef int int32;
58typedef unsigned int uint32;
59typedef long long int64;
60typedef 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.
68typedef long int lint64;
69typedef unsigned long int ulint64;
70
71#ifdef X64BITS
72typedef long long intp;
73typedef unsigned long long uintp;
74#else
75typedef int intp;
76typedef unsigned int uintp;
77#endif
78
79#endif // else _WIN32
80
83
84// AppIds and DepotIDs also presently share the same namespace
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.
91
92// handle to a Steam API call
95
98
99// Party Beacon ID
102
108
109#pragma pack( push, 1 )
110
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
123
124 bool IsSet() const
125 {
127 {
128 return m_unIPv4 != 0;
129 }
130 else
131 {
132 return m_ipv6Qword[0] !=0 || m_ipv6Qword[1] != 0;
133 }
134 }
135
137 {
138 SteamIPAddress_t ipOut;
140 ipOut.m_unIPv4 = 0;
141
142 return ipOut;
143 }
144
146 {
147 SteamIPAddress_t ipOut;
149 ipOut.m_ipv6Qword[0] = 0;
150 ipOut.m_ipv6Qword[1] = 0;
151
152 return ipOut;
153 }
154
156 {
157 SteamIPAddress_t ipOut;
159 ipOut.m_unIPv4 = 0x7f000001;
160
161 return ipOut;
162 }
163
165 {
166 SteamIPAddress_t ipOut;
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
const char *typedef uint32(S_CALLTYPE *SteamAPI_CheckCallbackRegistered_t)(int iCallbackNum)
long int lint64
Definition steamtypes.h:68
uint32 AppId_t
Definition steamtypes.h:81
unsigned short uint16
Definition steamtypes.h:56
const PartyBeaconID_t k_ulPartyBeaconIdInvalid
Definition steamtypes.h:101
unsigned int uint32
Definition steamtypes.h:58
signed char int8
Definition steamtypes.h:31
uint32 RTime32
Definition steamtypes.h:90
unsigned long long uint64
Definition steamtypes.h:60
const AppId_t k_uAppIdInvalid
Definition steamtypes.h:82
unsigned long int ulint64
Definition steamtypes.h:69
short int16
Definition steamtypes.h:55
int intp
Definition steamtypes.h:75
int int32
Definition steamtypes.h:57
ESteamIPType
Definition steamtypes.h:104
@ k_ESteamIPTypeIPv4
Definition steamtypes.h:105
@ k_ESteamIPTypeIPv6
Definition steamtypes.h:106
unsigned int uintp
Definition steamtypes.h:76
uint64 SteamAPICall_t
Definition steamtypes.h:93
const SteamAPICall_t k_uAPICallInvalid
Definition steamtypes.h:94
const AccountID_t k_uAccountIdInvalid
Definition steamtypes.h:97
const DepotId_t k_uDepotIdInvalid
Definition steamtypes.h:86
uint32 AccountID_t
Definition steamtypes.h:96
uint32 DepotId_t
Definition steamtypes.h:85
unsigned char uint8
Definition steamtypes.h:11
uint64 PartyBeaconID_t
Definition steamtypes.h:100
long long int64
Definition steamtypes.h:59
static SteamIPAddress_t IPv6Any()
Definition steamtypes.h:145
static SteamIPAddress_t IPv4Any()
Definition steamtypes.h:136
static SteamIPAddress_t IPv4Loopback()
Definition steamtypes.h:155
ESteamIPType m_eType
Definition steamtypes.h:122
bool IsSet() const
Definition steamtypes.h:124
static SteamIPAddress_t IPv6Loopback()
Definition steamtypes.h:164