Update to 2.0.0 tree from current Fremantle build
[opencv] / 3rdparty / include / f2c.h
1 /* f2c.h  --  Standard Fortran to C header file */
2
3 /**  barf  [ba:rf]  2.  "He suggested using FORTRAN, and everybody barfed."
4
5         - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
6
7 #ifndef F2C_INCLUDE
8 #define F2C_INCLUDE
9
10 #include <math.h>
11 #include <ctype.h>
12 #include <stdlib.h>
13 /* needed for Windows Mobile */
14 #ifdef WINCE
15 #undef complex; 
16 #endif
17 #include <string.h>
18 #include <stdio.h>
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 typedef long int integer;
25 typedef unsigned long int uinteger;
26 typedef char *address;
27 typedef short int shortint;
28 typedef float real;
29 typedef double doublereal;
30 typedef struct { real r, i; } complex;
31 typedef struct { doublereal r, i; } doublecomplex;
32 typedef long int logical;
33 typedef short int shortlogical;
34 typedef char logical1;
35 typedef char integer1;
36 #ifdef INTEGER_STAR_8   /* Adjust for integer*8. */
37 typedef long long longint;              /* system-dependent */
38 typedef unsigned long long ulongint;    /* system-dependent */
39 #define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b)))
40 #define qbit_set(a,b)   ((a) |  ((ulongint)1 << (b)))
41 #endif
42
43 #define TRUE_ (1)
44 #define FALSE_ (0)
45
46 /* Extern is for use with -E */
47 #ifndef Extern
48 #define Extern extern
49 #endif
50
51 /* I/O stuff */
52
53 #ifdef f2c_i2
54 /* for -i2 */
55 typedef short flag;
56 typedef short ftnlen;
57 typedef short ftnint;
58 #else
59 typedef long int flag;
60 typedef long int ftnlen;
61 typedef long int ftnint;
62 #endif
63
64 /*external read, write*/
65 typedef struct
66 {       flag cierr;
67         ftnint ciunit;
68         flag ciend;
69         char *cifmt;
70         ftnint cirec;
71 } cilist;
72
73 /*internal read, write*/
74 typedef struct
75 {       flag icierr;
76         char *iciunit;
77         flag iciend;
78         char *icifmt;
79         ftnint icirlen;
80         ftnint icirnum;
81 } icilist;
82
83 /*open*/
84 typedef struct
85 {       flag oerr;
86         ftnint ounit;
87         char *ofnm;
88         ftnlen ofnmlen;
89         char *osta;
90         char *oacc;
91         char *ofm;
92         ftnint orl;
93         char *oblnk;
94 } olist;
95
96 /*close*/
97 typedef struct
98 {       flag cerr;
99         ftnint cunit;
100         char *csta;
101 } cllist;
102
103 /*rewind, backspace, endfile*/
104 typedef struct
105 {       flag aerr;
106         ftnint aunit;
107 } alist;
108
109 /* inquire */
110 typedef struct
111 {       flag inerr;
112         ftnint inunit;
113         char *infile;
114         ftnlen infilen;
115         ftnint  *inex;  /*parameters in standard's order*/
116         ftnint  *inopen;
117         ftnint  *innum;
118         ftnint  *innamed;
119         char    *inname;
120         ftnlen  innamlen;
121         char    *inacc;
122         ftnlen  inacclen;
123         char    *inseq;
124         ftnlen  inseqlen;
125         char    *indir;
126         ftnlen  indirlen;
127         char    *infmt;
128         ftnlen  infmtlen;
129         char    *inform;
130         ftnint  informlen;
131         char    *inunf;
132         ftnlen  inunflen;
133         ftnint  *inrecl;
134         ftnint  *innrec;
135         char    *inblank;
136         ftnlen  inblanklen;
137 } inlist;
138
139 #define VOID void
140
141 union Multitype {       /* for multiple entry points */
142         integer1 g;
143         shortint h;
144         integer i;
145         /* longint j; */
146         real r;
147         doublereal d;
148         complex c;
149         doublecomplex z;
150         };
151
152 typedef union Multitype Multitype;
153
154 /*typedef long int Long;*/      /* No longer used; formerly in Namelist */
155
156 struct Vardesc {        /* for Namelist */
157         char *name;
158         char *addr;
159         ftnlen *dims;
160         int  type;
161         };
162 typedef struct Vardesc Vardesc;
163
164 struct Namelist {
165         char *name;
166         Vardesc **vars;
167         int nvars;
168         };
169 typedef struct Namelist Namelist;
170
171 #ifndef abs
172 #define abs(x) ((x) >= 0 ? (x) : -(x))
173 #endif
174 #define dabs(x) (doublereal)abs(x)
175 #ifndef min
176 #define min(a,b) ((a) <= (b) ? (a) : (b))
177 #endif
178 #ifndef max
179 #define max(a,b) ((a) >= (b) ? (a) : (b))
180 #endif
181 #define dmin(a,b) (doublereal)min(a,b)
182 #define dmax(a,b) (doublereal)max(a,b)
183 #define bit_test(a,b)   ((a) >> (b) & 1)
184 #define bit_clear(a,b)  ((a) & ~((uinteger)1 << (b)))
185 #define bit_set(a,b)    ((a) |  ((uinteger)1 << (b)))
186
187 /* procedure parameter types for -A and -C++ */
188
189 #define F2C_proc_par_types 1
190 #ifdef __cplusplus
191 typedef int /* Unknown procedure type */ (*U_fp)(...);
192 typedef shortint (*J_fp)(...);
193 typedef integer (*I_fp)(...);
194 typedef real (*R_fp)(...);
195 typedef doublereal (*D_fp)(...), (*E_fp)(...);
196 typedef /* Complex */ VOID (*C_fp)(...);
197 typedef /* Double Complex */ VOID (*Z_fp)(...);
198 typedef logical (*L_fp)(...);
199 typedef shortlogical (*K_fp)(...);
200 typedef /* Character */ VOID (*H_fp)(...);
201 typedef /* Subroutine */ int (*S_fp)(...);
202 #else
203 typedef int /* Unknown procedure type */ (*U_fp)();
204 typedef shortint (*J_fp)();
205 typedef integer (*I_fp)();
206 typedef real (*R_fp)();
207 typedef doublereal (*D_fp)(), (*E_fp)();
208 typedef /* Complex */ VOID (*C_fp)();
209 typedef /* Double Complex */ VOID (*Z_fp)();
210 typedef logical (*L_fp)();
211 typedef shortlogical (*K_fp)();
212 typedef /* Character */ VOID (*H_fp)();
213 typedef /* Subroutine */ int (*S_fp)();
214 #endif
215 /* E_fp is for real functions when -R is not specified */
216 typedef VOID C_f;       /* complex function */
217 typedef VOID H_f;       /* character function */
218 typedef VOID Z_f;       /* double complex function */
219 typedef doublereal E_f; /* real function with -R not specified */
220
221 /* undef any lower-case symbols that your C compiler predefines, e.g.: */
222
223 #ifndef Skip_f2c_Undefs
224 #undef cray
225 #undef gcos
226 #undef mc68010
227 #undef mc68020
228 #undef mips
229 #undef pdp11
230 #undef sgi
231 #undef sparc
232 #undef sun
233 #undef sun2
234 #undef sun3
235 #undef sun4
236 #undef u370
237 #undef u3b
238 #undef u3b2
239 #undef u3b5
240 #undef unix
241 #undef vax
242 #endif
243
244 #ifdef __cplusplus
245 }
246 #endif
247
248 #endif