/*-------------------------------------------------------------------+
|                Copyright (c) 1995, SAS Institute Inc.              |
|                  Unpublished - All Rights Reserved                 |
|                    S A S / C   S A M P L E                         |
|                                                                    |
|       NAME: C2FORTPC                                               |
|   LANGUAGE: C                                                      |
|    PURPOSE: THIS EXAMPLE DEMONSTRATES A C MAIN CALLING A           |
|             FORTRAN ROUTINE, WHICH TAKES A PARAMETER LIST.         |
|             IT CONSISTS OF SAMPLE LIBRARY MEMBERS                  |
|             C2FORTPC, C2FORTPF, AND C2FORTPM.                      |
| MVS -                                                              |
|    COMPILE: USE JCL PROVIDED IN SAMPLE.AUX(C2FORTPM).              |
|       LINK: USE JCL PROVIDED IN SAMPLE.AUX(C2FORTPM).              |
|    EXECUTE: USE JCL PROVIDED IN SAMPLE.AUX(C2FORTPM).              |
| TSO -                                                              |
|    COMPILE: FORTRAN - USE FORTRAN COMPILER.                        |
|             C - LC370C C2FORTPC                                    |
|       LINK: ILCLINK, USING CONTROL CARDS IN SAMPLE.AUX(C2FORTPM).  |
|    EXECUTE: CALL .LOAD(C2FORTPM)                           |
| CMS -                                                              |
|    COMPILE: FORTRAN - USE FORTRAN COMPILER.                        |
|             C - LC370 C2FORTPC                                     |
|        LINK: ILCLINK, USING CONTROL CARDS IN SAMPLE.AUX(C2FORTPM). |
|     EXECUTE: CALL C2FORTPM                                         |
| MISC NOTES: THE FOLLOWING LSCL102 MESSAGES CAN BE IGNORED:         |
|    WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(IFYVINTE)  |
|    WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(VFEE#)     |
|    WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(VFES#)     |
|    WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(VFEIM#)    |
|    WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(FORPGM)    |
+-------------------------------------------------------------------*/
#include 
#include 
#include 
#include 
#include 

main()
{

   __fortran void forpgm();
   void *token;
   char *comment = " Fortran parameter passed...";

   if(!(token = mkfmwk("fortran","")))
     exit(16);

   else
     {
     printf("before calling forpgm\n");
     printf("%s\n",comment);
     forpgm(comment);
     printf("after calling forpgm\n");
     if (dlfmwk(token))
        exit(8);
     else
        exit(0);
     }

 return 1;
}