Commit | Line | Data |
---|---|---|
973c2be1 | 1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
7fd59977 | 2 | // |
973c2be1 | 3 | // This file is part of Open CASCADE Technology software library. |
b311480e | 4 | // |
d5f74e42 | 5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published | |
973c2be1 | 7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT | |
9 | // distribution for complete text of the license and disclaimer of any warranty. | |
7fd59977 | 10 | // |
973c2be1 | 11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. | |
b311480e | 13 | |
14 | // AdvApp2Var_Data_f2c.hxx | |
7fd59977 | 15 | #ifndef Data_f2c_HeaderFile |
16 | #define Data_f2c_HeaderFile | |
17 | ||
18 | #ifndef F2CTYPE_DEFINED | |
19 | typedef int integer; | |
20 | typedef double doublereal; | |
21 | #define F2CTYPE_DEFINED | |
22 | #endif | |
23 | ||
24 | typedef unsigned long uinteger; | |
25 | typedef char *address; | |
26 | typedef short int shortint; | |
27 | typedef float real; | |
28 | typedef struct { real r, i; } complex; | |
29 | typedef struct { doublereal r, i; } doublecomplex; | |
30 | typedef long int logical; | |
31 | typedef short int shortlogical; | |
32 | typedef char logical1; | |
33 | typedef char integer1; | |
34 | #if 0 /* Adjust for integer*8. */ | |
35 | typedef long long longint; /* system-dependent */ | |
36 | typedef unsigned long long ulongint; /* system-dependent */ | |
37 | #define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b))) | |
38 | #define qbit_set(a,b) ((a) | ((ulongint)1 << (b))) | |
39 | #endif | |
40 | ||
41 | #define TRUE_ (1) | |
42 | #define FALSE_ (0) | |
43 | ||
44 | /* Extern is for use with -E */ | |
45 | #ifndef Extern | |
46 | #define Extern extern | |
47 | #endif | |
48 | ||
49 | /* I/O stuff */ | |
50 | ||
51 | #ifdef f2c_i2 | |
52 | /* for -i2 */ | |
53 | typedef short flag; | |
54 | typedef short ftnlen; | |
55 | typedef short ftnint; | |
56 | #else | |
57 | typedef long int flag; | |
58 | typedef long int ftnlen; | |
59 | typedef long int ftnint; | |
60 | #endif | |
61 | ||
62 | /*external read, write*/ | |
63 | typedef struct | |
64 | { flag cierr; | |
65 | ftnint ciunit; | |
66 | flag ciend; | |
67 | char *cifmt; | |
68 | ftnint cirec; | |
69 | } cilist; | |
70 | ||
71 | /*internal read, write*/ | |
72 | typedef struct | |
73 | { flag icierr; | |
74 | char *iciunit; | |
75 | flag iciend; | |
76 | char *icifmt; | |
77 | ftnint icirlen; | |
78 | ftnint icirnum; | |
79 | } icilist; | |
80 | ||
81 | /*open*/ | |
82 | typedef struct | |
83 | { flag oerr; | |
84 | ftnint ounit; | |
85 | char *ofnm; | |
86 | ftnlen ofnmlen; | |
87 | char *osta; | |
88 | char *oacc; | |
89 | char *ofm; | |
90 | ftnint orl; | |
91 | char *oblnk; | |
92 | } olist; | |
93 | ||
94 | /*close*/ | |
95 | typedef struct | |
96 | { flag cerr; | |
97 | ftnint cunit; | |
98 | char *csta; | |
99 | } cllist; | |
100 | ||
101 | /*rewind, backspace, endfile*/ | |
102 | typedef struct | |
103 | { flag aerr; | |
104 | ftnint aunit; | |
105 | } alist; | |
106 | ||
107 | /* inquire */ | |
108 | typedef struct | |
109 | { flag inerr; | |
110 | ftnint inunit; | |
111 | char *infile; | |
112 | ftnlen infilen; | |
113 | ftnint *inex; /*parameters in standard's order*/ | |
114 | ftnint *inopen; | |
115 | ftnint *innum; | |
116 | ftnint *innamed; | |
117 | char *inname; | |
118 | ftnlen innamlen; | |
119 | char *inacc; | |
120 | ftnlen inacclen; | |
121 | char *inseq; | |
122 | ftnlen inseqlen; | |
123 | char *indir; | |
124 | ftnlen indirlen; | |
125 | char *infmt; | |
126 | ftnlen infmtlen; | |
127 | char *inform; | |
128 | ftnint informlen; | |
129 | char *inunf; | |
130 | ftnlen inunflen; | |
131 | ftnint *inrecl; | |
132 | ftnint *innrec; | |
133 | char *inblank; | |
134 | ftnlen inblanklen; | |
135 | } inlist; | |
136 | ||
137 | #define VOID void | |
138 | ||
139 | union Multitype { /* for multiple entry points */ | |
140 | integer1 g; | |
141 | shortint h; | |
142 | integer i; | |
143 | /* longint j; */ | |
144 | real r; | |
145 | doublereal d; | |
146 | complex c; | |
147 | doublecomplex z; | |
148 | }; | |
149 | ||
150 | typedef union Multitype Multitype; | |
151 | ||
152 | /*typedef long int Long;*/ /* No longer used; formerly in Namelist */ | |
153 | ||
154 | struct Vardesc { /* for Namelist */ | |
155 | char *name; | |
156 | char *addr; | |
157 | ftnlen *dims; | |
158 | int type; | |
159 | }; | |
160 | typedef struct Vardesc Vardesc; | |
161 | ||
162 | struct Namelist { | |
163 | char *name; | |
164 | Vardesc **vars; | |
165 | int nvars; | |
166 | }; | |
167 | typedef struct Namelist Namelist; | |
168 | ||
41194117 K |
169 | #define advapp_abs(x) ((x) >= 0 ? (x) : -(x)) |
170 | #define dabs(x) (doublereal)advapp_abs(x) | |
171 | #define advapp_min(a,b) ((a) <= (b) ? (a) : (b)) | |
172 | #define advapp_max(a,b) ((a) >= (b) ? (a) : (b)) | |
173 | #define dmin(a,b) (doublereal)advapp_min(a,b) | |
174 | #define dmax(a,b) (doublereal)advapp_max(a,b) | |
7fd59977 | 175 | #define bit_test(a,b) ((a) >> (b) & 1) |
176 | #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) | |
177 | #define bit_set(a,b) ((a) | ((uinteger)1 << (b))) | |
178 | ||
179 | /* procedure parameter types for -A and -C++ */ | |
180 | ||
181 | #define F2C_proc_par_types 1 | |
182 | #ifdef __cplusplus | |
183 | typedef int /* Unknown procedure type */ (*U_fp)(...); | |
184 | typedef shortint (*J_fp)(...); | |
185 | typedef integer (*I_fp)(...); | |
186 | typedef real (*R_fp)(...); | |
187 | typedef doublereal (*D_fp)(...), (*E_fp)(...); | |
188 | typedef /* Complex */ VOID (*C_fp)(...); | |
189 | typedef /* Double Complex */ VOID (*Z_fp)(...); | |
190 | typedef logical (*L_fp)(...); | |
191 | typedef shortlogical (*K_fp)(...); | |
192 | typedef /* Character */ VOID (*H_fp)(...); | |
193 | typedef /* Subroutine */ int (*S_fp)(...); | |
194 | #else | |
195 | typedef int /* Unknown procedure type */ (*U_fp)(); | |
196 | typedef shortint (*J_fp)(); | |
197 | typedef integer (*I_fp)(); | |
198 | typedef real (*R_fp)(); | |
199 | typedef doublereal (*D_fp)(), (*E_fp)(); | |
200 | typedef /* Complex */ VOID (*C_fp)(); | |
201 | typedef /* Double Complex */ VOID (*Z_fp)(); | |
202 | typedef logical (*L_fp)(); | |
203 | typedef shortlogical (*K_fp)(); | |
204 | typedef /* Character */ VOID (*H_fp)(); | |
205 | typedef /* Subroutine */ int (*S_fp)(); | |
206 | #endif | |
207 | /* E_fp is for real functions when -R is not specified */ | |
208 | typedef VOID C_f; /* complex function */ | |
209 | typedef VOID H_f; /* character function */ | |
210 | typedef VOID Z_f; /* double complex function */ | |
211 | typedef doublereal E_f; /* real function with -R not specified */ | |
212 | ||
213 | /* undef any lower-case symbols that your C compiler predefines, e.g.: */ | |
214 | ||
215 | #ifndef Skip_f2c_Undefs | |
216 | #undef cray | |
217 | #undef gcos | |
218 | #undef mc68010 | |
219 | #undef mc68020 | |
220 | #undef mips | |
221 | #undef pdp11 | |
222 | #undef sgi | |
223 | #undef sparc | |
224 | #undef sun | |
225 | #undef sun2 | |
226 | #undef sun3 | |
227 | #undef sun4 | |
228 | #undef u370 | |
229 | #undef u3b | |
230 | #undef u3b2 | |
231 | #undef u3b5 | |
232 | #undef unix | |
233 | #undef vax | |
234 | #endif | |
235 | //#endif | |
236 | #endif |