project_files/hwc/rtl/pas2c.h
author koda
Tue, 21 Jan 2014 22:38:13 +0100
changeset 10015 4feced261c68
parent 9962 97ed501accc5
child 10121 8b65699beb56
permissions -rw-r--r--
partial merge of the webgl branch This commit contains the new pas2c conversion tool, the pascal to c build structure and the opengl2 rendering backend. Patch reviewed by unC0Rr.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7989
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
     1
#pragma once
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
     2
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
     3
#include <stddef.h>
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
     4
#include <stdint.h>
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
     5
#include <stdbool.h>
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
     6
#include <wchar.h>
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
     7
#include <math.h>
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
     8
8006
7ca007615b88 no globs, sources not yet generated
koda
parents: 7989
diff changeset
     9
#define MAX_PARAMS 64
7989
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    10
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    11
typedef union string255_
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    12
    {
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    13
        struct {
9962
97ed501accc5 oh those signed chars
unc0rr
parents: 8006
diff changeset
    14
            unsigned char s[257];
7989
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    15
        };
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    16
        struct {
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    17
            unsigned char len;
9962
97ed501accc5 oh those signed chars
unc0rr
parents: 8006
diff changeset
    18
            unsigned char str[256];
7989
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    19
        };
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    20
    } string255;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    21
typedef struct string192_
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    22
    {
9962
97ed501accc5 oh those signed chars
unc0rr
parents: 8006
diff changeset
    23
        unsigned char s[193];
7989
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    24
    } string192;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    25
typedef struct string31_
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    26
    {
9962
97ed501accc5 oh those signed chars
unc0rr
parents: 8006
diff changeset
    27
        unsigned char s[32];
7989
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    28
    } string31;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    29
typedef struct string15_
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    30
    {
9962
97ed501accc5 oh those signed chars
unc0rr
parents: 8006
diff changeset
    31
        unsigned char s[16];
7989
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    32
    } string15;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    33
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    34
typedef string255 shortstring;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    35
typedef string255 ansistring;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    36
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    37
typedef uint8_t Byte;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    38
typedef int8_t ShortInt;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    39
typedef uint16_t Word;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    40
typedef int16_t SmallInt;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    41
typedef uint32_t LongWord;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    42
typedef int32_t LongInt;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    43
typedef uint64_t QWord;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    44
typedef int64_t Int64;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    45
typedef LongWord Cardinal;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    46
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    47
typedef LongInt Integer;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    48
typedef float extended;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    49
typedef float real;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    50
typedef float single;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    51
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    52
typedef bool boolean;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    53
typedef int LongBool;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    54
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    55
typedef void * pointer;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    56
typedef Byte * PByte;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    57
typedef char * PChar;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    58
typedef LongInt * PLongInt;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    59
typedef LongWord * PLongWord;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    60
typedef Integer * PInteger;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    61
typedef int PtrInt;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    62
typedef wchar_t widechar;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    63
typedef wchar_t* PWideChar;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    64
typedef char Char;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    65
typedef LongInt SizeInt;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    66
typedef char ** PPChar;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    67
typedef Word* PWord;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    68
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    69
string255 _strconcat(string255 a, string255 b);
9962
97ed501accc5 oh those signed chars
unc0rr
parents: 8006
diff changeset
    70
string255 _strappend(string255 s, unsigned char c);
97ed501accc5 oh those signed chars
unc0rr
parents: 8006
diff changeset
    71
string255 _strprepend(unsigned char c, string255 s);
97ed501accc5 oh those signed chars
unc0rr
parents: 8006
diff changeset
    72
string255 _chrconcat(unsigned char a, unsigned char b);
7989
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    73
bool _strcompare(string255 a, string255 b);
9962
97ed501accc5 oh those signed chars
unc0rr
parents: 8006
diff changeset
    74
bool _strcomparec(string255 a, unsigned char b);
7989
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    75
bool _strncompare(string255 a, string255 b);
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    76
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    77
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    78
#define STRINIT(a) {.len = sizeof(a) - 1, .str = a}
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    79
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    80