File: sub.c

package info (click to toggle)
cfortran 20110621-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 1,120 kB
  • sloc: ansic: 3,390; fortran: 959; makefile: 112; sh: 14
file content (29 lines) | stat: -rw-r--r-- 828 bytes parent folder | download | duplicates (2)
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
/* sub.c == sub.C */           /* anonymous ftp@zebra.desy.de */
/* An example from cfortran.h package. Requires sub_f.f       */
/* Burkhard Burow  burow@desy.de                 1990 - 1997. */

#include <stdio.h>
#include <stdlib.h>    /* EXIT_SUCCESS */
#include "cfortran.h"

   PROTOCCALLSFSUB4(FUNARG,funarg, ROUTINE, INT, INT, PINT)
#define FUNARG(F,A,B,C) \
        CCALLSFSUB4(FUNARG,funarg, ROUTINE, INT, INT, PINT, F, A, B, C)

#ifdef __cplusplus
#define Ellipsis ...
#else
#define Ellipsis
#endif

int Cfun(int (*f)(Ellipsis), int a, int b) {int c; f(&a,&b,&c); return c;}
#undef  ROUTINE_1
#define ROUTINE_1  (int (*)(Ellipsis))
FCALLSCFUN3(INT,Cfun,CFUN,cfun, ROUTINE, INT, INT)

int main() {
int c;
FUNARG(C_FUNCTION(CFUN,cfun),1,2,c);
printf("\nFUNARG(CFUN,1,2,c) returns with c=%d\n",c);
return EXIT_SUCCESS;
}