project_files/hwc/rtl/pas2c.h
author koda
Fri, 09 Nov 2012 23:11:53 +0100
branchwebgl
changeset 8006 7ca007615b88
parent 7989 7ef4ace6335f
child 9962 97ed501accc5
permissions -rw-r--r--
no globs, sources not yet generated
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 {
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    14
            char s[257];
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;
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    18
            char str[256];
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
    {
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    23
        char s[193];
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
    {
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    27
        char s[32];
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
    {
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    31
        char s[16];
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);
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    70
string255 _strappend(string255 s, char c);
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    71
string255 _strprepend(char c, string255 s);
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    72
string255 _chrconcat(char a, char b);
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    73
bool _strcompare(string255 a, string255 b);
7ef4ace6335f add xymeng's pas2c header
koda
parents:
diff changeset
    74
bool _strcomparec(string255 a, char b);
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