hedgewars/pas2c.h
changeset 7151 ec15d9e1a7e3
parent 7134 beb16926ae5c
equal deleted inserted replaced
7148:c7ee9592c9a1 7151:ec15d9e1a7e3
    27     {
    27     {
    28         char s[16];
    28         char s[16];
    29     } string15;
    29     } string15;
    30 
    30 
    31 typedef string255 shortstring;
    31 typedef string255 shortstring;
       
    32 typedef string255 ansistring;
    32     
    33     
    33 typedef uint8_t Byte;
    34 typedef uint8_t Byte;
    34 typedef int8_t ShortInt;
    35 typedef int8_t ShortInt;
    35 typedef uint16_t Word;
    36 typedef uint16_t Word;
    36 typedef int16_t SmallInt;
    37 typedef int16_t SmallInt;
    69 
    70 
    70 void __FillChar(pointer p, int size, char fill);
    71 void __FillChar(pointer p, int size, char fill);
    71 string255 _strconcat(string255 a, string255 b);
    72 string255 _strconcat(string255 a, string255 b);
    72 string255 _strappend(string255 s, char c);
    73 string255 _strappend(string255 s, char c);
    73 string255 _strprepend(char c, string255 s);
    74 string255 _strprepend(char c, string255 s);
       
    75 string255 _chrconcat(char a, char b);
    74 bool _strcompare(string255 a, string255 b);
    76 bool _strcompare(string255 a, string255 b);
    75 bool _strcomparec(string255 a, char b);
    77 bool _strcomparec(string255 a, char b);
    76 bool _strncompare(string255 a, string255 b);
    78 bool _strncompare(string255 a, string255 b);
    77 char * _pchar(string255 s);
    79 char * _pchar(string255 s);
    78 string255 pchar2str(char * s);
    80 string255 pchar2str(char * s);
    89 
    91 
    90 typedef int file;
    92 typedef int file;
    91 typedef int TextFile;
    93 typedef int TextFile;
    92 extern int FileMode;
    94 extern int FileMode;
    93 extern int IOResult;
    95 extern int IOResult;
       
    96 extern int stdout;
    94 extern int stderr;
    97 extern int stderr;
    95 
    98 
    96 #define assign(a, b) assign_(&(a), b)
    99 #define assign(a, b) assign_(&(a), b)
    97 void assign_(int * f, string255 fileName);
   100 void assign_(int * f, string255 fileName);
    98 void reset_1(int f, int size);
   101 void reset_1(int f, int size);
   101 void BlockRead_(int f, void * p, int size, int * sizeRead);
   104 void BlockRead_(int f, void * p, int size, int * sizeRead);
   102 #define BlockWrite(a, b, c) BlockWrite_(a, &(b), c)
   105 #define BlockWrite(a, b, c) BlockWrite_(a, &(b), c)
   103 void BlockWrite_(int f, void * p, int size);
   106 void BlockWrite_(int f, void * p, int size);
   104 void close(int f);
   107 void close(int f);
   105 
   108 
   106 void write(string255 s);
   109 void write(int f, string255 s);
   107 void writeLn(string255 s);
   110 void writeLn(int f, string255 s);
   108 
   111 
   109 bool DirectoryExists(string255 dir);
   112 bool DirectoryExists(string255 dir);
   110 bool FileExists(string255 filename);
   113 bool FileExists(string255 filename);
   111 
   114 
   112 bool odd(int i);
   115 bool odd(int i);
   130 int round(double n);
   133 int round(double n);
   131 
   134 
   132 string255 ParamStr(int n);
   135 string255 ParamStr(int n);
   133 int ParamCount();
   136 int ParamCount();
   134 
   137 
   135 #define val(a, b) _val(a, (LongInt*)&(b))
   138 #define val(a, b, c) _val(a, (LongInt*)&(b), (LongInt*)&(c))
   136 void _val(string255 str, LongInt * a);
   139 void _val(string255 str, LongInt * a, LongInt * c);
   137 
   140 
   138 extern double pi;
   141 extern double pi;
   139 
   142 
   140 string255 EnumToStr(int a);
   143 string255 EnumToStr(int a);
   141 string255 ExtractFileName(string255 f);
   144 string255 ExtractFileName(string255 f);