1/* 2This program is free software; you can redistribute it and/or modify 3it under the terms of the GNU General Public License as published by 4the Free Software Foundation; either version 2 of the License, or 5(at your option) any later version. 6 7This program is distributed in the hope that it will be useful, 8but WITHOUT ANY WARRANTY; without even the implied warranty of 9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10GNU General Public License for more details. 11 12You should have received a copy of the GNU General Public License 13along with this program; if not, write to the Free Software 14Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 15USA. */ 16 17#include "foo.h" 18 19int 20main(int argc, char **argv) 21{ 22 int arg,cres,fres; 23 24 printf ("Welcome to GNU libtool mixed C/Fortran demo!\n"); 25 26 arg=2; 27 28 cres=csub(arg); 29 30 printf ("The C subroutine returned, claiming that 2*%d = %d\n",arg,cres); 31 32 if(cres==2*arg) 33 printf ("The C subroutine is ok!\n"); 34 35 printf("\nCalling the C wrapper routine...\n"); 36 fres=fwrapper(arg); 37 38 printf ("The C wrapper to the fortran subroutine returned,\n" 39 "claiming that 2*%d = %d\n",arg,fres); 40 41 if(fres==2*arg) 42 printf ("The Fortran 77 subroutine is ok!\n"); 43 44 return 0; 45} 46 47