summaryrefslogtreecommitdiff
path: root/gnu/lib/libf2c/f2cext.c
blob: 56f9490c6f5191f0078e2d3ed0ce1953b2b88986 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
/* Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of GNU Fortran run-time library.

This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
by the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

GNU Fortran is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Library General Public License for more details.

You should have received a copy of the GNU Library General Public
License along with GNU Fortran; see the file COPYING.LIB.  If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.  */

#include <math.h>		/* for j0 et al */
#include <f2c.h>
typedef void *sig_proc;	/* For now, this will have to do. */

#ifdef Labort
int abort_ (void) {
    extern int G77_abort_0 (void);
    return G77_abort_0 ();
}
#endif

#ifdef Lderf
double derf_ (doublereal *x) {
    extern double G77_derf_0 (doublereal *x);
    return G77_derf_0 (x);
}
#endif

#ifdef Lderfc
double derfc_ (doublereal *x) {
    extern double G77_derfc_0 (doublereal *x);
    return G77_derfc_0 (x);
}
#endif

#ifdef Lef1asc
int ef1asc_ (ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb) {
    extern int G77_ef1asc_0 (ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb);
    return G77_ef1asc_0 (a, la, b, lb);
}
#endif

#ifdef Lef1cmc
integer ef1cmc_ (ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb) {
    extern integer G77_ef1cmc_0 (ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb);
    return G77_ef1cmc_0 (a, la, b, lb);
}
#endif

#ifdef Lerf
double erf_ (real *x) {
    extern double G77_erf_0 (real *x);
    return G77_erf_0 (x);
}
#endif

#ifdef Lerfc
double erfc_ (real *x) {
    extern double G77_erfc_0 (real *x);
    return G77_erfc_0 (x);
}
#endif

#ifdef Lexit
void exit_ (integer *rc) {
    extern void G77_exit_0 (integer *rc);
    G77_exit_0 (rc);
}
#endif

#ifdef Lgetarg
void getarg_ (ftnint *n, char *s, ftnlen ls) {
    extern void G77_getarg_0 (ftnint *n, char *s, ftnlen ls);
    G77_getarg_0 (n, s, ls);
}
#endif

#ifdef Lgetenv
void getenv_ (char *fname, char *value, ftnlen flen, ftnlen vlen) {
    extern void G77_getenv_0 (char *fname, char *value, ftnlen flen, ftnlen vlen);
    G77_getenv_0 (fname, value, flen, vlen);
}
#endif

#ifdef Liargc
ftnint iargc_ (void) {
    extern ftnint G77_iargc_0 (void);
    return G77_iargc_0 ();
}
#endif

#ifdef Lsignal
void *signal_ (integer *sigp, sig_proc proc) {
    extern void *G77_signal_0 (integer *sigp, sig_proc proc);
    return G77_signal_0 (sigp, proc);
}
#endif

#ifdef Lsystem
integer system_ (char *s, ftnlen n) {
    extern integer G77_system_0 (char *s, ftnlen n);
    return G77_system_0 (s, n);
}
#endif

#ifdef Lflush
int flush_ (void) {
    extern int G77_flush_0 (void);
    return G77_flush_0 ();
}
#endif

#ifdef Lftell
integer ftell_ (integer *Unit) {
    extern integer G77_ftell_0 (integer *Unit);
    return G77_ftell_0 (Unit);
}
#endif

#ifdef Lfseek
integer fseek_ (integer *Unit, integer *offset, integer *xwhence) {
    extern integer G77_fseek_0 (integer *Unit, integer *offset, integer *xwhence);
    return G77_fseek_0 (Unit, offset, xwhence);
}
#endif

#ifdef Laccess
integer access_ (const char *name, const char *mode, ftnlen Lname, ftnlen Lmode) {
    extern integer G77_access_0 (const char *name, const char *mode, ftnlen Lname, ftnlen Lmode);
    return G77_access_0 (name, mode, Lname, Lmode);
}
#endif

#ifdef Lalarm
integer alarm_ (integer *seconds, sig_proc proc, integer *status) {
    extern integer G77_alarm_0 (integer *seconds, sig_proc proc);
    return G77_alarm_0 (seconds, proc);
}
#endif

#ifdef Lbesj0
double besj0_ (const real *x) {
    return j0 (*x);
}
#endif

#ifdef Lbesj1
double besj1_ (const real *x) {
    return j1 (*x);
}
#endif

#ifdef Lbesjn
double besjn_ (const integer *n, real *x) {
    return jn (*n, *x);
}
#endif

#ifdef Lbesy0
double besy0_ (const real *x) {
    return y0 (*x);
}
#endif

#ifdef Lbesy1
double besy1_ (const real *x) {
    return y1 (*x);
}
#endif

#ifdef Lbesyn
double besyn_ (const integer *n, real *x) {
    return yn (*n, *x);
}
#endif

#ifdef Lchdir
integer chdir_ (const char *name, const ftnlen Lname) {
    extern integer G77_chdir_0 (const char *name, const ftnlen Lname);
    return G77_chdir_0 (name, Lname);
}
#endif

#ifdef Lchmod
integer chmod_ (const char *name, const char *mode, const ftnlen Lname, const ftnlen Lmode) {
    extern integer G77_chmod_0 (const char *name, const char *mode, const ftnlen Lname, const ftnlen Lmode);
    return G77_chmod_0 (name, mode, Lname, Lmode);
}
#endif

#ifdef Lctime
void ctime_ (char *chtime, const ftnlen Lchtime, longint *xstime) {
    extern void G77_ctime_0 (char *chtime, const ftnlen Lchtime, longint *xstime);
    G77_ctime_0 (chtime, Lchtime, xstime);
}
#endif

#ifdef Ldate_y2kbuggy
int date_ (char *buf, ftnlen buf_len) {
  /* Fail to link, so user sees attempt to invoke non-Y2K-compliant
     routine.  */
    extern int G77_date_y2kbuggy_0 (char *buf, ftnlen buf_len);
    return G77_date_y2kbuggy_0 (buf, buf_len);
}
#endif

#ifdef Ldate_y2kbug
int date_y2kbug__ (char *buf, ftnlen buf_len) {
  /* If user wants to invoke the non-Y2K-compliant routine via
     an `EXTERNAL' interface, avoiding the warning via g77's
     `INTRINSIC' interface, force coding of "y2kbug" string in
     user's program.  */
    extern int G77_date_y2kbug_0 (char *buf, ftnlen buf_len);
    return G77_date_y2kbug_0 (buf, buf_len);
}
#endif

#ifdef Ldbesj0
double dbesj0_ (const double *x) {
    return j0 (*x);
}
#endif

#ifdef Ldbesj1
double dbesj1_ (const double *x) {
    return j1 (*x);
}
#endif

#ifdef Ldbesjn
double dbesjn_ (const integer *n, double *x) {
    return jn (*n, *x);
}
#endif

#ifdef Ldbesy0
double dbesy0_ (const double *x) {
    return y0 (*x);
}
#endif

#ifdef Ldbesy1
double dbesy1_ (const double *x) {
    return y1 (*x);
}
#endif

#ifdef Ldbesyn
double dbesyn_ (const integer *n, double *x) {
    return yn (*n, *x);
}
#endif

#ifdef Ldtime
double dtime_ (real tarray[2]) {
    extern double G77_dtime_0 (real tarray[2]);
    return G77_dtime_0 (tarray);
}
#endif

#ifdef Letime
double etime_ (real tarray[2]) {
    extern double G77_etime_0 (real tarray[2]);
    return G77_etime_0 (tarray);
}
#endif

#ifdef Lfdate
void fdate_ (char *ret_val, ftnlen ret_val_len) {
    extern void G77_fdate_0 (char *ret_val, ftnlen ret_val_len);
    G77_fdate_0 (ret_val, ret_val_len);
}
#endif

#ifdef Lfgetc
integer fgetc_ (const integer *lunit, char *c, ftnlen Lc) {
    extern integer G77_fgetc_0 (const integer *lunit, char *c, ftnlen Lc);
    return G77_fgetc_0 (lunit, c, Lc);
}
#endif

#ifdef Lfget
integer fget_ (char *c, const ftnlen Lc) {
    extern integer G77_fget_0 (char *c, const ftnlen Lc);
    return G77_fget_0 (c, Lc);
}
#endif

#ifdef Lflush1
int flush1_ (const integer *lunit) {
    extern int G77_flush1_0 (const integer *lunit);
    return G77_flush1_0 (lunit);
}
#endif

#ifdef Lfnum
integer fnum_ (integer *lunit) {
    extern integer G77_fnum_0 (integer *lunit);
    return G77_fnum_0 (lunit);
}
#endif

#ifdef Lfputc
integer fputc_ (const integer *lunit, const char *c, const ftnlen Lc) {
    extern integer G77_fputc_0 (const integer *lunit, const char *c, const ftnlen Lc);
    return G77_fputc_0 (lunit, c, Lc);
}
#endif

#ifdef Lfput
integer fput_ (const char *c, const ftnlen Lc) {
    extern integer G77_fput_0 (const char *c, const ftnlen Lc);
    return G77_fput_0 (c, Lc);
}
#endif

#ifdef Lfstat
integer fstat_ (const integer *lunit, integer statb[13]) {
    extern integer G77_fstat_0 (const integer *lunit, integer statb[13]);
    return G77_fstat_0 (lunit, statb);
}
#endif

#ifdef Lgerror
int gerror_ (char *str, ftnlen Lstr) {
    extern int G77_gerror_0 (char *str, ftnlen Lstr);
    return G77_gerror_0 (str,  Lstr);
}
#endif

#ifdef Lgetcwd
integer getcwd_ (char *str, const ftnlen Lstr) {
    extern integer G77_getcwd_0 (char *str, const ftnlen Lstr);
    return G77_getcwd_0 (str, Lstr);
}
#endif

#ifdef Lgetgid
integer getgid_ (void) {
    extern integer G77_getgid_0 (void);
    return G77_getgid_0 ();
}
#endif

#ifdef Lgetlog
int getlog_ (char *str, const ftnlen Lstr) {
    extern int G77_getlog_0 (char *str, const ftnlen Lstr);
    return G77_getlog_0 (str, Lstr);
}
#endif

#ifdef Lgetpid
integer getpid_ (void) {
    extern integer G77_getpid_0 (void);
    return G77_getpid_0 ();
}
#endif

#ifdef Lgetuid
integer getuid_ (void) {
    extern integer G77_getuid_0 (void);
    return G77_getuid_0 ();
}
#endif

#ifdef Lgmtime
int gmtime_ (const integer *stime, integer tarray[9]) {
    extern int G77_gmtime_0 (const integer *stime, integer tarray[9]);
    return G77_gmtime_0 (stime, tarray);
}
#endif

#ifdef Lhostnm
integer hostnm_ (char *name, ftnlen Lname) {
    extern integer G77_hostnm_0 (char *name, ftnlen Lname);
    return G77_hostnm_0 (name, Lname);
}
#endif

#ifdef Lidate
int idate_ (int iarray[3]) {
    extern int G77_idate_0 (int iarray[3]);
    return G77_idate_0 (iarray);
}
#endif

#ifdef Lierrno
integer ierrno_ (void) {
    extern integer G77_ierrno_0 (void);
    return G77_ierrno_0 ();
}
#endif

#ifdef Lirand
integer irand_ (integer *flag) {
    extern integer G77_irand_0 (integer *flag);
    return G77_irand_0 (flag);
}
#endif

#ifdef Lisatty
logical isatty_ (integer *lunit) {
    extern logical G77_isatty_0 (integer *lunit);
    return G77_isatty_0 (lunit);
}
#endif

#ifdef Litime
int itime_ (integer tarray[3]) {
    extern int G77_itime_0 (integer tarray[3]);
    return G77_itime_0 (tarray);
}
#endif

#ifdef Lkill
integer kill_ (const integer *pid, const integer *signum) {
    extern integer G77_kill_0 (const integer *pid, const integer *signum);
    return G77_kill_0 (pid, signum);
}
#endif

#ifdef Llink
integer link_ (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2) {
    extern integer G77_link_0 (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2);
    return G77_link_0 (path1, path2, Lpath1, Lpath2);
}
#endif

#ifdef Llnblnk
integer lnblnk_ (char *str, ftnlen str_len) {
    extern integer G77_lnblnk_0 (char *str, ftnlen str_len);
    return G77_lnblnk_0 (str, str_len);
}
#endif

#ifdef Llstat
integer lstat_ (const char *name, integer statb[13], const ftnlen Lname) {
    extern integer G77_lstat_0 (const char *name, integer statb[13], const ftnlen Lname);
    return G77_lstat_0 (name, statb, Lname);
}
#endif

#ifdef Lltime
int ltime_ (const integer *stime, integer tarray[9]) {
    extern int G77_ltime_0 (const integer *stime, integer tarray[9]);
    return G77_ltime_0 (stime, tarray);
}
#endif

#ifdef Lmclock
longint mclock_ (void) {
    extern longint G77_mclock_0 (void);
    return G77_mclock_0 ();
}
#endif

#ifdef Lperror
int perror_ (const char *str, const ftnlen Lstr) {
    extern int G77_perror_0 (const char *str, const ftnlen Lstr);
    return G77_perror_0 (str, Lstr);
}
#endif

#ifdef Lrand
double rand_ (integer *flag) {
    extern double G77_rand_0 (integer *flag);
    return G77_rand_0 (flag);
}
#endif

#ifdef Lrename
integer rename_ (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2) {
    extern integer G77_rename_0 (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2);
    return G77_rename_0 (path1, path2, Lpath1, Lpath2);
}
#endif

#ifdef Lsecnds
double secnds_ (real *r) {
    extern double G77_secnds_0 (real *r);
    return G77_secnds_0 (r);
}
#endif

#ifdef Lsecond
double second_ () {
    extern double G77_second_0 ();
    return G77_second_0 ();
}
#endif

#ifdef Lsleep
int sleep_ (const integer *seconds) {
    extern int G77_sleep_0 (const integer *seconds);
    return G77_sleep_0 (seconds);
}
#endif

#ifdef Lsrand
int srand_ (const integer *seed) {
    extern int G77_srand_0 (const integer *seed);
    return G77_srand_0 (seed);
}
#endif

#ifdef Lstat
integer stat_ (const char *name, integer statb[13], const ftnlen Lname) {
    extern integer G77_stat_0 (const char *name, integer statb[13], const ftnlen Lname);
    return G77_stat_0 (name, statb, Lname);
}
#endif

#ifdef Lsymlnk
integer symlnk_ (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2) {
    extern integer G77_symlnk_0 (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2);
    return G77_symlnk_0 (path1, path2, Lpath1, Lpath2);
}
#endif

#ifdef Ltime
longint time_ (void) {
    extern longint G77_time_0 (void);
    return G77_time_0 ();
}
#endif

#ifdef Lttynam
void ttynam_ (char *ret_val, ftnlen ret_val_len, integer *lunit) {
    extern void G77_ttynam_0 (char *ret_val, ftnlen ret_val_len, integer *lunit);
    G77_ttynam_0 (ret_val, ret_val_len, lunit);
}
#endif

#ifdef Lumask
integer umask_ (integer *mask) {
    extern integer G77_umask_0 (integer *mask);
    return G77_umask_0 (mask);
}
#endif

#ifdef Lunlink
integer unlink_ (const char *str, const ftnlen Lstr) {
    extern integer G77_unlink_0 (const char *str, const ftnlen Lstr);
    return G77_unlink_0 (str, Lstr);
}
#endif

#ifdef Lvxtidt_y2kbuggy
int vxtidate_ (integer *m, integer *d, integer *y) {
  /* Fail to link, so user sees attempt to invoke non-Y2K-compliant
     routine.  */
    extern int G77_vxtidate_y2kbuggy_0 (integer *m, integer *d, integer *y);
    return G77_vxtidate_y2kbuggy_0 (m, d, y);
}
#endif

#ifdef Lvxtidt_y2kbug
int vxtidate_y2kbug__ (integer *m, integer *d, integer *y) {
  /* If user wants to invoke the non-Y2K-compliant routine via
     an `EXTERNAL' interface, avoiding the warning via g77's
     `INTRINSIC' interface, force coding of "y2kbug" string in
     user's program.  */
    extern int G77_vxtidate_y2kbug_0 (integer *m, integer *d, integer *y);
    return G77_vxtidate_y2kbug_0 (m, d, y);
}
#endif

#ifdef Lvxttim
void vxttime_ (char chtime[8], const ftnlen Lchtime) {
    extern void G77_vxttime_0 (char chtime[8], const ftnlen Lchtime);
    G77_vxttime_0 (chtime, Lchtime);
}
#endif