hedgewars/pas2c.h
changeset 7134 beb16926ae5c
parent 7074 3f23bd0f2af2
child 7151 ec15d9e1a7e3
equal deleted inserted replaced
7132:baf3351646f4 7134:beb16926ae5c
     1 #pragma once
     1 #pragma once
     2 
     2 
       
     3 #include <stddef.h>
     3 #include <stdint.h>
     4 #include <stdint.h>
     4 #include <stdbool.h>
     5 #include <stdbool.h>
     5 #include <wchar.h>
     6 #include <wchar.h>
     6 
     7 
     7 typedef union string255_
     8 typedef union string255_
    54 typedef LongWord * PLongWord;
    55 typedef LongWord * PLongWord;
    55 typedef Integer * PInteger;
    56 typedef Integer * PInteger;
    56 typedef int PtrInt;
    57 typedef int PtrInt;
    57 typedef wchar_t widechar;
    58 typedef wchar_t widechar;
    58 
    59 
    59 #ifdef __GNUG__
       
    60 #define NULL __null
       
    61 #else   /* G++ */
       
    62 /* shield NULL definition for non-gnu parsers */
       
    63 #ifndef __cplusplus
       
    64 #define NULL ((void *)0)
       
    65 #else
       
    66 #define NULL 0
       
    67 #endif  /* __cplusplus */
       
    68 #endif  /* G++ */
       
    69 
       
    70 #define new(a) __new((void **)&a, sizeof(*(a)))
    60 #define new(a) __new((void **)&a, sizeof(*(a)))
    71 void __new(void ** p, int size);
    61 void __new(void ** p, int size);
    72 #define dispose(a) __dispose(a, sizeof(*(a)))
    62 #define dispose(a) __dispose(a, sizeof(*(a)))
    73 void __dispose(pointer p, int size);
    63 void __dispose(pointer p, int size);
    74 
    64 
    83 string255 _strprepend(char c, string255 s);
    73 string255 _strprepend(char c, string255 s);
    84 bool _strcompare(string255 a, string255 b);
    74 bool _strcompare(string255 a, string255 b);
    85 bool _strcomparec(string255 a, char b);
    75 bool _strcomparec(string255 a, char b);
    86 bool _strncompare(string255 a, string255 b);
    76 bool _strncompare(string255 a, string255 b);
    87 char * _pchar(string255 s);
    77 char * _pchar(string255 s);
       
    78 string255 pchar2str(char * s);
    88 
    79 
    89 int Length(string255 a);
    80 int Length(string255 a);
    90 string255 copy(string255 a, int s, int l);
    81 string255 copy(string255 a, int s, int l);
    91 string255 delete(string255 a, int s, int l);
    82 string255 delete(string255 a, int s, int l);
    92 string255 trim(string255 a);
    83 string255 trim(string255 a);
   111 #define BlockWrite(a, b, c) BlockWrite_(a, &(b), c)
   102 #define BlockWrite(a, b, c) BlockWrite_(a, &(b), c)
   112 void BlockWrite_(int f, void * p, int size);
   103 void BlockWrite_(int f, void * p, int size);
   113 void close(int f);
   104 void close(int f);
   114 
   105 
   115 void write(string255 s);
   106 void write(string255 s);
       
   107 void writeLn(string255 s);
   116 
   108 
   117 bool DirectoryExists(string255 dir);
   109 bool DirectoryExists(string255 dir);
   118 bool FileExists(string255 filename);
   110 bool FileExists(string255 filename);
   119 
   111 
   120 bool odd(int i);
   112 bool odd(int i);