author | Wuzzy <almikes@aol.com> |
Thu, 17 Nov 2016 14:59:20 +0100 | |
changeset 11909 | 1d2e89be3eb6 |
parent 10660 | 79fa79c77c38 |
child 12103 | 22bd1099d51f |
permissions | -rw-r--r-- |
7989 | 1 |
#pragma once |
2 |
||
3 |
#include <stddef.h> |
|
4 |
#include <stdint.h> |
|
5 |
#include <stdbool.h> |
|
6 |
#include <wchar.h> |
|
7 |
#include <math.h> |
|
8 |
||
8006 | 9 |
#define MAX_PARAMS 64 |
10128 | 10 |
#define MAX_ANSISTRING_LENGTH 16383 |
7989 | 11 |
|
12 |
typedef union string255_ |
|
13 |
{ |
|
14 |
struct { |
|
10121 | 15 |
unsigned char s[256]; |
7989 | 16 |
}; |
17 |
struct { |
|
18 |
unsigned char len; |
|
10121 | 19 |
unsigned char str[255]; |
7989 | 20 |
}; |
21 |
} string255; |
|
10121 | 22 |
|
23 |
typedef union astring_ |
|
7989 | 24 |
{ |
10121 | 25 |
struct { |
10131
4b4a043111f4
- pas2c recognizes typecasts in initialization expressions
unc0rr
parents:
10128
diff
changeset
|
26 |
uint16_t len; |
10121 | 27 |
}; |
28 |
struct { |
|
29 |
unsigned char _dummy2; |
|
10128 | 30 |
unsigned char s[MAX_ANSISTRING_LENGTH + 1]; |
10121 | 31 |
}; |
32 |
struct { |
|
10131
4b4a043111f4
- pas2c recognizes typecasts in initialization expressions
unc0rr
parents:
10128
diff
changeset
|
33 |
unsigned char _dummy1; |
4b4a043111f4
- pas2c recognizes typecasts in initialization expressions
unc0rr
parents:
10128
diff
changeset
|
34 |
string255 str255; |
10121 | 35 |
}; |
36 |
} astring; |
|
7989 | 37 |
|
38 |
typedef string255 shortstring; |
|
39 |
||
40 |
typedef uint8_t Byte; |
|
41 |
typedef int8_t ShortInt; |
|
42 |
typedef uint16_t Word; |
|
43 |
typedef int16_t SmallInt; |
|
44 |
typedef uint32_t LongWord; |
|
45 |
typedef int32_t LongInt; |
|
46 |
typedef uint64_t QWord; |
|
47 |
typedef int64_t Int64; |
|
48 |
typedef LongWord Cardinal; |
|
49 |
||
50 |
typedef LongInt Integer; |
|
51 |
typedef float extended; |
|
52 |
typedef float real; |
|
53 |
typedef float single; |
|
54 |
||
55 |
typedef bool boolean; |
|
56 |
typedef int LongBool; |
|
57 |
||
58 |
typedef void * pointer; |
|
59 |
typedef Byte * PByte; |
|
60 |
typedef char * PChar; |
|
61 |
typedef LongInt * PLongInt; |
|
62 |
typedef LongWord * PLongWord; |
|
63 |
typedef Integer * PInteger; |
|
10660
79fa79c77c38
fix size of PtrInt. enable tests for pas2c (all passing now)
sheepluva
parents:
10142
diff
changeset
|
64 |
typedef ptrdiff_t PtrInt; |
7989 | 65 |
typedef wchar_t widechar; |
66 |
typedef wchar_t* PWideChar; |
|
67 |
typedef char Char; |
|
68 |
typedef LongInt SizeInt; |
|
69 |
typedef char ** PPChar; |
|
70 |
typedef Word* PWord; |
|
71 |
||
72 |
string255 _strconcat(string255 a, string255 b); |
|
9962 | 73 |
string255 _strappend(string255 s, unsigned char c); |
74 |
string255 _strprepend(unsigned char c, string255 s); |
|
75 |
string255 _chrconcat(unsigned char a, unsigned char b); |
|
7989 | 76 |
bool _strcompare(string255 a, string255 b); |
9962 | 77 |
bool _strcomparec(string255 a, unsigned char b); |
7989 | 78 |
bool _strncompare(string255 a, string255 b); |
10127 | 79 |
bool _strncompareA(astring a, astring b); |
7989 | 80 |
|
81 |
||
82 |
#define STRINIT(a) {.len = sizeof(a) - 1, .str = a} |
|
10142 | 83 |
#define UNUSED(x) (void)(x) |
7989 | 84 |