summaryrefslogtreecommitdiff
path: root/Ganlib/src/clepil.c
diff options
context:
space:
mode:
authorstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
committerstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
commit7dfcc480ba1e19bd3232349fc733caef94034292 (patch)
tree03ee104eb8846d5cc1a981d267687a729185d3f3 /Ganlib/src/clepil.c
Initial commit from Polytechnique Montreal
Diffstat (limited to 'Ganlib/src/clepil.c')
-rw-r--r--Ganlib/src/clepil.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/Ganlib/src/clepil.c b/Ganlib/src/clepil.c
new file mode 100644
index 0000000..7aeeb54
--- /dev/null
+++ b/Ganlib/src/clepil.c
@@ -0,0 +1,60 @@
+
+/*****************************************/
+/* CLE-2000 API */
+/* AUTHOR OF FORTRAN VERSION: R. Roy */
+/* AUTHOR: A. Hebert ; 15/05/09 */
+/*****************************************/
+
+#include <string.h>
+#include "cle2000.h"
+
+int_32 clepil(FILE *iredin, FILE *iwrite, kdi_file *iunito,
+ int_32 (*dumcst)(char *, int_32 *, int_32 *, float_32 *, char *, double_64 *))
+{
+
+/* CLE-2000 SYSTEM: R.ROY (03/1999), VERSION 2.1 */
+
+/* *CLEPIL* WILL PERFORM A SYNTACTICAL ANALYSIS */
+/* AND COMPILE THE INPUT UNIT *IREDIN*. */
+/* RESULT IS THE OBJECT D.A. UNIT *IUNITO* */
+/* COMPILER COMMENTS ARE WRITTEN ON UNIT *IWRITE* */
+/* WORDS ARE SEPARATED AND CLASSIFIED BY TYPES. */
+/* EVERYTHING IS CHECKED FOR CORRECT EXECUTION. */
+
+/* INPUT: *IREDIN* IS THE INPUT UNIT */
+/* *IWRITE* IS THE OUTPUT UNIT FOR COMPILER COMMENTS */
+/* *IUNITO* IS THE DIRECT ACCESS UNIT FOR OBJECT CODE */
+/* *DUMCST* IS THE EXTERNAL FUNCTION FOR *CLE-2000* CONSTANTS */
+
+/* NOTE: *CLEPIL* = 0 IF NO PROBLEM WAS ENCOUNTERED WHILE COMPILING */
+
+ char *nomsub = "clepil";
+ char *clistc[] = {"clelog", "clestk", "clexrf"};
+ int_32 iretcd, istepc;
+ int_32 ret_val = 0;
+
+/* CONSTRUCT OBJECT FILE AND ANALYSE LOGIC */
+ istepc = 0;
+ iretcd = clelog(iredin, iwrite, iunito);
+ if (iretcd != 0) goto L9002;
+
+/* ADD CLE-2000 VARIABLES */
+ istepc = 1;
+ iretcd = clestk(iunito, iwrite, dumcst);
+ if (iretcd != 0) goto L9002;
+ istepc = 3;
+
+/* X-REF CLE-2000 VARIABLES */
+ istepc = 2;
+ iretcd = clexrf(iunito, iwrite);
+ if (iretcd != 0) goto L9002;
+
+L666:
+ return ret_val;
+
+L9002:
+ printf("! %s: ERROR CODE IN >>%s<< ERROR NUMBER (%d)\n", nomsub, clistc[istepc], (int)iretcd);
+ ret_val = iretcd;
+ goto L666;
+
+} /* clepil */