libMVRgdtf 40bc00a
A library for GDTF and MVR
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GSTypes.h
Go to the documentation of this file.
1//
2// Copyright Nemetschek Vectorworks, Inc.
3// Use of this file is governed by the Nemetschek Vectorworks SDK License Agreement
4// http://developer.vectorworks.net/index.php?title=Vectorworks_SDK_License
5//
6//
7// This file contains the type definitions for the Graphsoft core.
8//
9
10#ifndef _GS_TYPES_
11#define _GS_TYPES_
12
13#pragma once
14
15#include <stdint.h>
16#include <cstdio>
17
18#if GS_LIN
19#include <cstddef>
20#endif
21
23// Fixed-width unsigned integer types.
24
25typedef uint8_t Uint8;
26typedef uint16_t Uint16;
27typedef uint32_t Uint32;
28typedef uint64_t Uint64;
29
30
32// Fixed-width signed integer types.
33
34typedef int8_t Sint8;
35typedef int16_t Sint16;
36typedef int32_t Sint32;
37typedef int64_t Sint64;
38
39
41// Interger type maximums and minimums.
42
43#define kGSMaxUint8 255
44#define kGSMaxUint16 65535
45#define kGSMaxUint32 4294967295UL
46#define kGSMaxUint64 18446744073709551615ULL
47#define kGSMaxSint8 127
48#define kGSMaxSint16 32767
49#define kGSMaxSint32 2147483647L
50#define kGSMaxSint64 9223372036854775807LL
51
52#define kGSMinUint8 0
53#define kGSMinUint16 0
54#define kGSMinUint32 0UL
55#define kGSMinUint64 0ULL
56#define kGSMinSint8 (-128)
57#define kGSMinSint16 (-32768)
58#define kGSMinSint32 (-2147483647-1)
59#define kGSMinSint64 (-9223372036854775808LL)
60
61
63// Floating point types.
64
65typedef float Real32;
66typedef double Real64;
67
68#ifndef CGFLOAT_EPSILON
69 #if CGFLOAT_IS_DOUBLE
70 #define CGFLOAT_EPSILON DBL_EPSILON
71 #else
72 #define CGFLOAT_EPSILON FLT_EPSILON
73 #endif
74#endif
75
77// Boolean types.
78
79typedef unsigned char Bool8;
80
81#if __cplusplus
82 const Bool8 kFalse = 0;
83 const Bool8 kTrue = 1;
84#else
85 enum EBool {
86 kFalse = 0,
87 kTrue = 1
88 };
89#endif
90
91#if GS_LIN
92 const bool FALSE = 0;
93 const bool TRUE = 1;
94#endif
95
97// Integer pointer types. (guaranteed to have the same size as a pointer regardless of the platform.)
98typedef intptr_t SintptrT;
99typedef uintptr_t UintptrT;
100
101#if GS_LIN || GS_MAC
102typedef __SIZE_TYPE__ size_t;
103#endif
104
105typedef size_t GSSize;
106
107
109// XXXKIS : Put this type definition back in temporarily until
110// I find out why it was removed to being with.
111typedef unsigned char Boolean;
112
113
115// Character types.
116
117// Non-Unicode
118typedef unsigned char Uchar;
119
120// Unicode (Encoding format is UTF-16 in platform-native byte order)
122typedef UCChar* UCCharPtr; // Pointer to one or an array of UCCChars
123typedef UCChar** UCCharHandle; // Handle to one or an array of UCCChars
124typedef UCChar* UCStrPtr; // Pointer to NULL-word terminated UCChars
125typedef UCChar** UCStrHandle; // Handle to NULL-word terminated UCChars
126typedef const UCChar* ConstUCCharPtr; // Pointer to one or an array of constant UCCChars
127typedef const UCChar* ConstUCStrPtr; // Pointer to NULL-word terminated constant UCChars
129
130#ifdef GS_LIN
131typedef Uint16 UniChar;
132#else
134#endif
135
136#endif //_GS_TYPES_
unsigned char Bool8
Definition GSTypes.h:79
const UCChar * ConstUCStrPtr
Definition GSTypes.h:127
uint8_t Uint8
Definition GSTypes.h:25
UCChar * UCCharPtr
Definition GSTypes.h:122
int64_t Sint64
Definition GSTypes.h:37
Uint16 UniChar
Definition GSTypes.h:133
uint16_t Uint16
Definition GSTypes.h:26
size_t GSSize
Definition GSTypes.h:105
intptr_t SintptrT
Definition GSTypes.h:98
const UCChar * ConstUCCharPtr
Definition GSTypes.h:126
UCChar ** UCStrHandle
Definition GSTypes.h:125
unsigned char Uchar
Definition GSTypes.h:118
int8_t Sint8
Definition GSTypes.h:34
UCChar * UCStrPtr
Definition GSTypes.h:124
uintptr_t UintptrT
Definition GSTypes.h:99
int32_t Sint32
Definition GSTypes.h:36
UCChar ** UCCharHandle
Definition GSTypes.h:123
int16_t Sint16
Definition GSTypes.h:35
uint64_t Uint64
Definition GSTypes.h:28
Uint32 UCCharCnt
Definition GSTypes.h:128
float Real32
Definition GSTypes.h:65
double Real64
Definition GSTypes.h:66
unsigned char Boolean
Definition GSTypes.h:111
uint32_t Uint32
Definition GSTypes.h:27
EBool
Definition GSTypes.h:85
@ kTrue
Definition GSTypes.h:87
@ kFalse
Definition GSTypes.h:86
Uint16 UCChar
Definition GSTypes.h:121