ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
f2c.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Author: David Fournier
5  * Copyright (c) 2008-2012 Regents of the University of California
6  *
7  * ADModelbuilder and associated libraries and documentations are
8  * provided under the general terms of the "BSD" license.
9  *
10  * License:
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions are
14  * met:
15  *
16  * 1. Redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer.
18  *
19  * 2. Redistributions in binary form must reproduce the above copyright
20  * notice, this list of conditions and the following disclaimer in the
21  * documentation and/or other materials provided with the distribution.
22  *
23  * 3. Neither the name of the University of California, Otter Research,
24  * nor the ADMB Foundation nor the names of its contributors may be used
25  * to endorse or promote products derived from this software without
26  * specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39  *
40  */
45 /* f2c.h -- Standard Fortran to C header file */
46 
51 #ifndef F2C_INCLUDE
52 #define F2C_INCLUDE
53 
54 typedef long int integer;
55 //typedef char *address;
56 typedef short int shortint;
57 typedef float real;
58 typedef double doublereal;
59 typedef struct { real r, i; } complex;
60 typedef struct { doublereal r, i; } doublecomplex;
61 typedef long int logical;
62 typedef short int shortlogical;
63 typedef char logical1;
64 typedef char integer1;
65 /* typedef long long longint; */ /* system-dependent */
66 
67 #define TRUE_ (1)
68 #define FALSE_ (0)
69 
70 /* Extern is for use with -E */
71 #ifndef Extern
72 #define Extern extern
73 #endif
74 
75 /* I/O stuff */
76 
77 #ifdef f2c_i2
78 /* for -i2 */
79 typedef short flag;
80 typedef short ftnlen;
81 typedef short ftnint;
82 #else
83 typedef long int flag;
84 typedef long int ftnlen;
85 typedef long int ftnint;
86 #endif
87 
88 /*external read, write*/
89 typedef struct
90 {
91  flag cierr;
92  ftnint ciunit;
93  flag ciend;
94  char *cifmt;
95  ftnint cirec;
96 } cilist;
97 
98 /*internal read, write*/
99 typedef struct
100 {
101  flag icierr;
102  char *iciunit;
103  flag iciend;
104  char *icifmt;
105  ftnint icirlen;
106  ftnint icirnum;
107 } icilist;
108 
109 /*open*/
110 typedef struct
111 {
112  flag oerr;
113  ftnint ounit;
114  char *ofnm;
115  ftnlen ofnmlen;
116  char *osta;
117  char *oacc;
118  char *ofm;
119  ftnint orl;
120  char *oblnk;
121 } olist;
122 
123 /*close*/
124 typedef struct
125 {
126  flag cerr;
127  ftnint cunit;
128  char *csta;
129 } cllist;
130 
131 /*rewind, backspace, endfile*/
132 typedef struct
133 {
134  flag aerr;
135 ftnint aunit;
136 } alist;
137 
138 /* inquire */
139 typedef struct
140 {
141  flag inerr;
142  ftnint inunit;
143  char *infile;
144  ftnlen infilen;
145  ftnint *inex;/*parameters in standard's order*/
146  ftnint *inopen;
147  ftnint *innum;
148  ftnint *innamed;
149  char *inname;
150  ftnlen innamlen;
151  char *inacc;
152  ftnlen inacclen;
153  char *inseq;
154  ftnlen inseqlen;
155  char *indir;
156  ftnlen indirlen;
157  char *infmt;
158  ftnlen infmtlen;
159  char *inform;
160  ftnint informlen;
161  char *inunf;
162  ftnlen inunflen;
163  ftnint *inrecl;
164  ftnint *innrec;
165  char *inblank;
166  ftnlen inblanklen;
167 } inlist;
168 
169 #define VOID void
170  //
171  // union Multitype {/* for multiple entry points */
172  // integer1 g;
173  // shortint h;
174  // integer i;
175  // /* longint j; */
176  // real r;
177  // doublereal d;
178  // complex c;
179  // doublecomplex z;
180  // };
181  //
182  // typedef union Multitype Multitype;
183  //
184 /*typedef long int Long;*//* No longer used; formerly in Namelist */
185 
186 struct Vardesc {/* for Namelist */
187  char *name;
188  char *addr;
189  ftnlen *dims;
190  int type;
191 };
192 typedef struct Vardesc Vardesc;
193 
194 struct Namelist {
195  char *name;
196  Vardesc **vars;
197  int nvars;
198 };
199 typedef struct Namelist Namelist;
200 
201 #define abs(x) ((x) >= 0 ? (x) : -(x))
202 #define dabs(x) (doublereal)abs(x)
203 #define min(a,b) ((a) <= (b) ? (a) : (b))
204 #define max(a,b) ((a) >= (b) ? (a) : (b))
205 #define dmin(a,b) (doublereal)min(a,b)
206 #define dmax(a,b) (doublereal)max(a,b)
207 
208 /* procedure parameter types for -A and -C++ */
209 
210 #define F2C_proc_par_types 1
211 #ifdef __cplusplus
212 typedef int /* Unknown procedure type */ (*U_fp)(...);
213 typedef shortint (*J_fp)(...);
214 typedef integer (*I_fp)(...);
215 typedef real (*R_fp)(...);
216 typedef doublereal (*D_fp)(...), (*E_fp)(...);
217 typedef /* Complex */ VOID (*C_fp)(...);
218 typedef /* Double Complex */ VOID (*Z_fp)(...);
219 typedef logical (*L_fp)(...);
220 typedef shortlogical (*K_fp)(...);
221 typedef /* Character */ VOID (*H_fp)(...);
222 typedef /* Subroutine */ int (*S_fp)(...);
223 #else
224 typedef int /* Unknown procedure type */ (*U_fp)();
225 typedef shortint (*J_fp)();
226 typedef integer (*I_fp)();
227 typedef real (*R_fp)();
228 typedef doublereal (*D_fp)(), (*E_fp)();
229 typedef /* Complex */ VOID (*C_fp)();
230 typedef /* Double Complex */ VOID (*Z_fp)();
231 typedef logical (*L_fp)();
232 typedef shortlogical (*K_fp)();
233 typedef /* Character */ VOID (*H_fp)();
234 typedef /* Subroutine */ int (*S_fp)();
235 #endif
236 /* E_fp is for real functions when -R is not specified */
237 typedef VOID C_f;/* complex function */
238 typedef VOID H_f;/* character function */
239 typedef VOID Z_f;/* double complex function */
240 typedef doublereal E_f;/* real function with -R not specified */
241 
242 /* undef any lower-case symbols that your C compiler predefines, e.g.: */
243 
244 #ifndef Skip_f2c_Undefs
245 #undef cray
246 #undef gcos
247 #undef mc68010
248 #undef mc68020
249 #undef mips
250 #undef pdp11
251 #undef sgi
252 #undef sparc
253 #undef sun
254 #undef sun2
255 #undef sun3
256 #undef sun4
257 #undef u370
258 #undef u3b
259 #undef u3b2
260 #undef u3b5
261 #undef unix
262 #undef vax
263 #endif
264 #endif
long int ftnlen
Definition: cbivnorm.cpp:67
int type
Definition: cbivnorm.cpp:175
char * name
Definition: cbivnorm.cpp:180
float real
Definition: cbivnorm.cpp:35
char logical1
Definition: cbivnorm.cpp:41
char * name
Definition: cbivnorm.cpp:172
int(* S_fp)()
Definition: cbivnorm.cpp:222
shortint(* J_fp)()
Definition: cbivnorm.cpp:213
short int shortlogical
Definition: cbivnorm.cpp:40
char * addr
Definition: cbivnorm.cpp:173
VOID(* Z_fp)()
Definition: cbivnorm.cpp:218
integer(* I_fp)()
Definition: cbivnorm.cpp:214
doublereal E_f
Definition: cbivnorm.cpp:228
char integer1
Definition: cbivnorm.cpp:42
long int ftnint
Definition: cbivnorm.cpp:68
real(* R_fp)()
Definition: cbivnorm.cpp:215
Vardesc ** vars
Definition: cbivnorm.cpp:181
#define VOID
Definition: f2c.h:169
long int flag
Definition: cbivnorm.cpp:66
shortlogical(* K_fp)()
Definition: cbivnorm.cpp:220
doublereal(* D_fp)()
Definition: cbivnorm.cpp:216
VOID C_f
Definition: cbivnorm.cpp:225
VOID(* C_fp)()
Definition: cbivnorm.cpp:217
doublereal(*)(* E_fp)()
Definition: cbivnorm.cpp:216
long int integer
Definition: cbivnorm.cpp:31
long int logical
Definition: cbivnorm.cpp:39
VOID H_f
Definition: cbivnorm.cpp:226
VOID(* H_fp)()
Definition: cbivnorm.cpp:221
double doublereal
Definition: cbivnorm.cpp:36
int nvars
Definition: cbivnorm.cpp:182
logical(* L_fp)()
Definition: cbivnorm.cpp:219
VOID Z_f
Definition: cbivnorm.cpp:227
short int shortint
Definition: cbivnorm.cpp:34
ftnlen * dims
Definition: cbivnorm.cpp:174