Removed unused makefiles.
[vlp.git] / src / int / depend.h
1 /*     Loglan82 Compiler&Interpreter
2      Copyright (C) 1993 Institute of Informatics, University of Warsaw
3      Copyright (C)  1993, 1994 LITA, Pau
4      
5      This program is free software; you can redistribute it and/or modify
6      it under the terms of the GNU General Public License as published by
7      the Free Software Foundation; either version 2 of the License, or
8      (at your option) any later version.
9      
10      This program is distributed in the hope that it will be useful,
11      but WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13      GNU General Public License for more details.
14      
15              You should have received a copy of the GNU General Public License
16              along with this program; if not, write to the Free Software
17              Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19  contacts:  Andrzej.Salwicki@univ-pau.fr
20
21 or             Andrzej Salwicki
22                 LITA   Departement d'Informatique
23                 Universite de Pau
24                 Avenue de l'Universite
25                 64000 Pau   FRANCE
26                  tel.  ++33 59923154    fax. ++33 59841696
27
28 =======================================================================
29 */
30
31 #if MSDOS
32 #undef UNIX
33 #undef OS2
34 #elif UNIX
35 #undef OS2
36 #elif OS2
37 #undef UNIX
38 #else
39 #error Define one of MSDOS/OS2/UNIX
40 #endif
41
42 #if WORD_16BIT
43 #undef DWORD_16BIT
44 #undef WORD_32BIT
45 #elif DWORD_16BIT
46 #undef WORD_32BIT
47 #elif WORD_32BIT
48 #undef DWORD_16BIT
49 #else
50 #error Define one of WORD_16BIT/DWORD_16BIT/WORD_32BIT
51 #endif
52
53
54 #include <stdio.h>
55 #include <malloc.h>
56 #include <setjmp.h>
57 #include <stdlib.h>
58 #include <string.h>
59
60
61 typedef struct {
62                 char opcode;
63                 char args[ 3 ];
64                } extopcode;
65
66 typedef char *lword;    /* max(word, char *) but in every case was char* */
67
68 #define BINARYREAD      "rb"
69 #define BINARYWRITE     "wb"
70 #define DIRECTOLD       "r+b"
71 #define DIRECTNEW       "w+b"
72
73
74 #if WORD_16BIT
75
76 typedef int word;
77 typedef float real;
78 typedef word *memory;
79
80 #if UNIX
81 extern char *calloc(int,int);
82 #endif
83
84 #define mallocate(n)    ((memory) (char /*|||huge*/ *) calloc((n),sizeof(word)))
85 #define ballocate(n)    ((char /*|||huge*/ *) calloc((n),1))
86
87 #define MAXINTEGER   0x7FFF
88 #define DEFMEMSIZE   0x7FF0             /* 32K words = 64K bytes */
89 #define MAXMEMSIZE   0x7FF0             /* 32K words = 64K bytes */
90
91 #endif
92
93
94
95 #if DWORD_16BIT
96
97 typedef long word;
98 typedef double real;
99 typedef word huge *memory;
100
101 #if UNIX
102
103 extern char *calloc(int,int);
104
105 #define mallocate(n)   (((n)<60000)?(memory) calloc((n),sizeof(word)):abort())
106 #define ballocate(n)   (calloc((n),1))
107
108 #define MAXINTEGER   0x7FFFFFFFL
109 #define DEFMEMSIZE   0x13C00L   /* 79K words = 316K bytes */
110 #define MAXMEMSIZE   0x400000L  /*  4M words =  16M bytes */
111
112 #elif OS2
113
114 extern char huge *halloc();
115
116 #define mallocate(n)    ((memory) halloc((long) (n), sizeof(word)))
117 #define ballocate(n)    (halloc((long) (n),1L))
118
119 #define MAXINTEGER   0x7FFFFFFFL
120 #define DEFMEMSIZE   0x13C00L   /* 79K words = 316K bytes */
121 #define MAXMEMSIZE   0x400000L  /*  4M words =  16M bytes */
122
123 #define INCL_DOSINFOSEG
124
125 #include <os2.h>        
126
127 #elif MSDOS && TURBOC
128
129 extern char far *farcalloc();
130
131 #define mallocate(n)    ((memory) farcalloc((long) (n), (long) sizeof(word)))
132 #define ballocate(n)    (farcalloc((long) (n),1L))
133
134 #define MAXINTEGER   0x7FFFFFFFL
135 #define DEFMEMSIZE   0x14000L   /* 80K words = 320K bytes */
136 #define MAXMEMSIZE   0x28000L   /* 160K words = 640K bytes */
137
138 #elif MSDOS
139
140 extern void huge *halloc();
141 #define mallocate(n)   ((memory) halloc((long) (n), sizeof(word)))
142 #define ballocate(n)   (halloc((long) (n),1))
143
144 #define MAXINTEGER   0x7FFFFFFFL
145 #define DEFMEMSIZE   0xF000L    /* 60K words = 120K bytes */
146 #define MAXMEMSIZE   0x28000L   /* 160K words = 640K bytes */
147
148 #else
149 #error Allocation macros not defined.
150 #endif
151
152 #endif
153
154
155
156 #if WORD_32BIT
157
158 typedef int word;
159 typedef float real;
160 typedef word *memory;
161
162 #define mallocate(n)    ((memory) (char *) calloc((n),sizeof(word)))
163 #define ballocate(n)    ((char *) calloc((n),1))
164
165 /* printf("|%d*4|",(n)),getchar(),\ */
166
167 #define MAXINTEGER   0x7FFFFFFFL
168 #define DEFMEMSIZE   0x13C00L   /* 79K words = 316K bytes */
169 #define MAXMEMSIZE   0x400000L  /*  4M words =  16M bytes */
170
171 #endif
172
173