/*-------------------------------------------------------------------+
|                Copyright (c) 1995, SAS Institute Inc.              |
|                  Unpublished - All Rights Reserved                 |
|                    S A S / C   S A M P L E                         |
|                                                                    |
|       NAME: C2PASCC                                                |
|   LANGUAGE: C                                                      |
|    PURPOSE: THIS EXAMPLE DEMONSTRATES A C MAIN CALLING A           |
|             PASCAL ROUTINE.                                        |
|             IT CONSISTS OF SAMPLE LIBRARY MEMBERS                  |
|             C2PASCC, C2PASCP, AND C2PASCAL.                        |
| MVS -                                                              |
|    COMPILE: USE JCL PROVIDED IN SAMPLE.AUX(C2PASCAL).              |
|       LINK: USE JCL PROVIDED IN SAMPLE.AUX(C2PASCAL).              |
|    EXECUTE: USE JCL PROVIDED IN SAMPLE.AUX(C2PASCAL).              |
| TSO -                                                              |
|    COMPILE: PASCAL - USE PASCAL COMPILER.                          |
|             C - LC370C C2PASCC                                     |
|       LINK: ILCLINK, USING CONTROL CARDS IN SAMPLE.AUX(C2PASCAL).  |
|    EXECUTE: CALL .LOAD(C2PASCAL)                           |
| CMS -                                                              |
|    COMPILE: PASCAL - USE PASCAL COMPILER.                          |
|             C - LC370 C2PASCC                                      |
|        LINK: ILCLINK, USING CONTROL CARDS IN SAMPLE.AUX(C2PASCAL). |
|     EXECUTE: CALL C2PASCAL                                         |
|  MISC NOTES: THE FOLLOWING LSCL102 MESSAGES CAN BE IGNORED:        |
|    WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(AMPXRETC)  |
|    WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(AMPXHALT)  |
|    WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(AMPXSEGE)  |
|    WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(AMPXSTRT)  |
|    WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(AMPXPARM)  |
|    WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(PASCPROC)  |
+-------------------------------------------------------------------*/
#include 
#include 

 void __pascal pascproc();

void main(void)
  {
   void *token;
   printf("Hello, from the C program!\n");
  /* token = mkfmwk("PASCAL",""); */
   token = mkfmwk("PASCAL","NOCHECK,NOSPIE");
   if (!token)
    {
     printf("Can't create the Pascal framework!\n");
     exit(12);
    }

   printf("Calling PASCAL routine!\n");
   pascproc();
   printf("Returned back from PASCAL fine!\n");
   dlfmwk(token);
  }