Files
seer/tests/hellocobol/hellocobol_if.c
T
2025-08-14 18:43:29 -05:00

453 lines
12 KiB
C

/* Generated by cobc 3.1.2.0 */
/* Generated from hellocobol_if.cob */
/* Generated at Aug 04 2025 19:27:10 */
/* GnuCOBOL build date Jul 15 2023 12:00:00 */
/* GnuCOBOL package date Dec 23 2020 12:04:58 UTC */
/* Compile command cobc -x -g -o hellocobol_if hellocobol_if.cob */
#include <stdio.h>
#include <string.h>
#define COB_KEYWORD_INLINE __inline
#include <libcob.h>
#define COB_SOURCE_FILE "hellocobol_if.cob"
#define COB_PACKAGE_VERSION "3.1.2"
#define COB_PATCH_LEVEL 0
#define COB_MODULE_FORMATTED_DATE "Aug 04 2025 19:27:10"
#define COB_MODULE_DATE 20250804
#define COB_MODULE_TIME 192710
/* Global variables */
#include "hellocobol_if.c.h"
/* Function prototypes */
static int _01_IF ();
static int _01_IF_ (const int);
static void _01_IF_module_init (cob_module *module);
/* Main function */
int
main (int argc, char **argv)
{
cob_init (argc, argv);
cob_stop_run (_01_IF ());
}
/* Functions */
/* PROGRAM-ID '01_IF' */
/* ENTRY '_01_IF' */
static int
_01_IF ()
{
return _01_IF_ (0);
}
static int
_01_IF_ (const int entry)
{
/* Program local variables */
#include "hellocobol_if.c.l.h"
/* Start of function code */
/* CANCEL callback */
if (unlikely(entry < 0)) {
if (entry == -10)
goto P_dump;
if (entry == -20)
goto P_clear_decimal;
goto P_cancel;
}
/* Check initialized, check module allocated, */
/* set global pointer, */
/* push module stack, save call parameter count */
if (cob_module_global_enter (&module, &cob_glob_ptr, 0, entry, 0))
return -1;
/* Set address of module parameter list */
module->cob_procedure_params = cob_procedure_params;
/* Set frame stack pointer */
frame_ptr = frame_stack;
frame_ptr->perform_through = 0;
frame_ptr->return_address_ptr = &&P_cgerror;
frame_overflow = frame_ptr + 255 - 1;
/* Initialize rest of program */
if (unlikely(initialized == 0)) {
goto P_initialize;
}
P_ret_initialize:
/* Increment module active */
module->module_active++;
/* Entry dispatch */
goto l_2;
/* PROCEDURE DIVISION */
/* Line: 13 : Entry 01_IF : hellocobol_if.cob */
l_2:;
#line 13 "hellocobol_if.cob"
ENTRY_01_IF:;
#line 100 "hellocobol_if.c"
#line 15 "hellocobol_if.cob"
SECTION_MAIN_20SECTION:;
#line 103 "hellocobol_if.c"
#line 15 "hellocobol_if.cob"
cob_nop ();
#line 106 "hellocobol_if.c"
/* Line: 15 : DISPLAY : hellocobol_if.cob */
module->module_stmt = 0x0010000F;
#line 15 "hellocobol_if.cob"
cob_trace_stmt (st_1);
#line 112 "hellocobol_if.c"
cob_display (0, 1, 1, &c_1);
/* Line: 16 : ACCEPT : hellocobol_if.cob */
module->module_stmt = 0x00100010;
#line 16 "hellocobol_if.cob"
cob_trace_stmt (st_2);
#line 119 "hellocobol_if.c"
cob_accept (&f_8);
/* Line: 18 : DISPLAY : hellocobol_if.cob */
module->module_stmt = 0x00100012;
#line 18 "hellocobol_if.cob"
cob_trace_stmt (st_1);
#line 126 "hellocobol_if.c"
cob_display (0, 1, 1, &c_2);
/* Line: 19 : ACCEPT : hellocobol_if.cob */
module->module_stmt = 0x00100013;
#line 19 "hellocobol_if.cob"
cob_trace_stmt (st_2);
#line 133 "hellocobol_if.c"
cob_accept (&f_10);
/* Line: 21 : DISPLAY : hellocobol_if.cob */
module->module_stmt = 0x00100015;
#line 21 "hellocobol_if.cob"
cob_trace_stmt (st_1);
#line 140 "hellocobol_if.c"
cob_display (0, 1, 1, &c_3);
/* Line: 22 : ACCEPT : hellocobol_if.cob */
module->module_stmt = 0x00100016;
#line 22 "hellocobol_if.cob"
cob_trace_stmt (st_2);
#line 147 "hellocobol_if.c"
cob_accept (&f_12);
/* Line: 24 : IF : hellocobol_if.cob */
module->module_stmt = 0x00100018;
#line 24 "hellocobol_if.cob"
cob_trace_stmt (st_3);
#line 154 "hellocobol_if.c"
if (((int)cob_cmp_numdisp (b_8, 9, cob_get_llint (&f_10), 1) > 0))
{
/* Line: 25 : DISPLAY : hellocobol_if.cob */
module->module_stmt = 0x00100019;
#line 25 "hellocobol_if.cob"
cob_trace_stmt (st_1);
#line 162 "hellocobol_if.c"
cob_display (0, 1, 1, &c_4);
}
else
{
/* ELSE */
/* Line: 27 : IF : hellocobol_if.cob */
module->module_stmt = 0x0010001B;
#line 27 "hellocobol_if.cob"
cob_trace_stmt (st_3);
#line 173 "hellocobol_if.c"
if (((int)cob_cmp_numdisp (b_8, 9, cob_get_llint (&f_10), 1) == 0))
{
/* Line: 28 : DISPLAY : hellocobol_if.cob */
module->module_stmt = 0x0010001C;
#line 28 "hellocobol_if.cob"
cob_trace_stmt (st_1);
#line 181 "hellocobol_if.c"
cob_display (0, 1, 1, &c_5);
}
else
{
/* ELSE */
/* Line: 30 : DISPLAY : hellocobol_if.cob */
module->module_stmt = 0x0010001E;
#line 30 "hellocobol_if.cob"
cob_trace_stmt (st_1);
#line 192 "hellocobol_if.c"
cob_display (0, 1, 1, &c_6);
}
}
/* Line: 35 : IF : hellocobol_if.cob */
module->module_stmt = 0x00100023;
#line 35 "hellocobol_if.cob"
cob_trace_stmt (st_3);
#line 201 "hellocobol_if.c"
if (((int)cob_cmp_numdisp (b_8, 9, 0, 1) > 0))
{
/* Line: 36 : DISPLAY : hellocobol_if.cob */
module->module_stmt = 0x00100024;
#line 36 "hellocobol_if.cob"
cob_trace_stmt (st_1);
#line 209 "hellocobol_if.c"
cob_display (0, 1, 1, &c_7);
}
/* Line: 39 : IF : hellocobol_if.cob */
module->module_stmt = 0x00100027;
#line 39 "hellocobol_if.cob"
cob_trace_stmt (st_3);
#line 217 "hellocobol_if.c"
if (((int)cob_cmp_numdisp (b_8, 9, 0, 1) < 0))
{
/* Line: 40 : DISPLAY : hellocobol_if.cob */
module->module_stmt = 0x00100028;
#line 40 "hellocobol_if.cob"
cob_trace_stmt (st_1);
#line 225 "hellocobol_if.c"
cob_display (0, 1, 1, &c_8);
}
/* Line: 44 : IF : hellocobol_if.cob */
module->module_stmt = 0x0010002C;
#line 44 "hellocobol_if.cob"
cob_trace_stmt (st_3);
#line 233 "hellocobol_if.c"
if (cob_is_numeric (&f_12))
{
/* Line: 46 : DISPLAY : hellocobol_if.cob */
module->module_stmt = 0x0010002E;
#line 46 "hellocobol_if.cob"
cob_trace_stmt (st_1);
#line 241 "hellocobol_if.c"
cob_display (0, 1, 1, &c_9);
}
/* Line: 49 : IF : hellocobol_if.cob */
module->module_stmt = 0x00100031;
#line 49 "hellocobol_if.cob"
cob_trace_stmt (st_3);
#line 249 "hellocobol_if.c"
if (cob_is_alpha (&f_12))
{
/* Line: 50 : DISPLAY : hellocobol_if.cob */
module->module_stmt = 0x00100032;
#line 50 "hellocobol_if.cob"
cob_trace_stmt (st_1);
#line 257 "hellocobol_if.c"
cob_display (0, 1, 1, &c_10);
}
/* Line: 55 : IF : hellocobol_if.cob */
module->module_stmt = 0x00100037;
#line 55 "hellocobol_if.cob"
cob_trace_stmt (st_3);
#line 265 "hellocobol_if.c"
if ((((int)cob_cmp_numdisp (b_8, 9, 100LL, 1) >= 0) &&
((int)cob_cmp_numdisp (b_8, 9, 9999LL, 1) <= 0)))
{
/* Line: 56 : DISPLAY : hellocobol_if.cob */
module->module_stmt = 0x00100038;
#line 56 "hellocobol_if.cob"
cob_trace_stmt (st_1);
#line 274 "hellocobol_if.c"
cob_display (0, 1, 1, &c_11);
}
/* Line: 59 : IF : hellocobol_if.cob */
module->module_stmt = 0x0010003B;
#line 59 "hellocobol_if.cob"
cob_trace_stmt (st_3);
#line 282 "hellocobol_if.c"
if (!(((int)cob_cmp_numdisp (b_8, 9, 100LL, 1) >= 0) &&
((int)cob_cmp_numdisp (b_8, 9, 9999LL, 1) <= 0)))
{
/* Line: 60 : DISPLAY : hellocobol_if.cob */
module->module_stmt = 0x0010003C;
#line 60 "hellocobol_if.cob"
cob_trace_stmt (st_1);
#line 291 "hellocobol_if.c"
cob_display (0, 1, 1, &c_12);
}
/* Line: 63 : IF : hellocobol_if.cob */
module->module_stmt = 0x0010003F;
#line 63 "hellocobol_if.cob"
cob_trace_stmt (st_3);
#line 299 "hellocobol_if.c"
if ((((int)cob_cmp_numdisp (b_10, 9, 100LL, 1) >= 0) &&
((int)cob_cmp_numdisp (b_10, 9, 9999LL, 1) <= 0)))
{
/* Line: 64 : DISPLAY : hellocobol_if.cob */
module->module_stmt = 0x00100040;
#line 64 "hellocobol_if.cob"
cob_trace_stmt (st_1);
#line 308 "hellocobol_if.c"
cob_display (0, 1, 1, &c_13);
}
/* Line: 67 : IF : hellocobol_if.cob */
module->module_stmt = 0x00100043;
#line 67 "hellocobol_if.cob"
cob_trace_stmt (st_3);
#line 316 "hellocobol_if.c"
if (!(((int)cob_cmp_numdisp (b_10, 9, 100LL, 1) >= 0) &&
((int)cob_cmp_numdisp (b_10, 9, 9999LL, 1) <= 0)))
{
/* Line: 68 : DISPLAY : hellocobol_if.cob */
module->module_stmt = 0x00100044;
#line 68 "hellocobol_if.cob"
cob_trace_stmt (st_1);
#line 325 "hellocobol_if.c"
cob_display (0, 1, 1, &c_14);
}
/* Line: 72 : IF : hellocobol_if.cob */
module->module_stmt = 0x00100048;
#line 72 "hellocobol_if.cob"
cob_trace_stmt (st_3);
#line 333 "hellocobol_if.c"
if (((((int)cob_cmp_numdisp (b_8, 9, 100LL, 1) >= 0) &&
((int)cob_cmp_numdisp (b_8, 9, 9999LL, 1) <= 0)) &&
(((int)cob_cmp_numdisp (b_10, 9, 100LL, 1) >= 0) &&
((int)cob_cmp_numdisp (b_10, 9, 9999LL, 1) <= 0))))
{
/* Line: 73 : DISPLAY : hellocobol_if.cob */
module->module_stmt = 0x00100049;
#line 73 "hellocobol_if.cob"
cob_trace_stmt (st_1);
#line 344 "hellocobol_if.c"
cob_display (0, 1, 1, &c_15);
}
/* Line: 76 : STOP RUN : hellocobol_if.cob */
module->module_stmt = 0x0010004C;
#line 76 "hellocobol_if.cob"
cob_trace_stmt (st_4);
#line 352 "hellocobol_if.c"
cob_stop_run (b_2);
module->module_stmt = 0x00100050;
/* Program exit */
/* Decrement module active count */
if (module->module_active) {
module->module_active--;
}
/* Pop module stack */
cob_module_leave (module);
/* Program return */
return b_2;
P_cgerror:
cob_fatal_error (COB_FERROR_CODEGEN);
/* Program initialization */
P_initialize:
cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL);
cob_module_path = cob_glob_ptr->cob_main_argv0;
_01_IF_module_init (module);
module->crt_status = NULL;
/* Initialize cancel callback */
cob_set_cancel (module);
/* Initialize WORKING-STORAGE */
b_2 = 0;
memset (b_8, 48, 9);
memcpy (b_10, "000000001", 9);
memset (b_12, 32, 1);
memset (b_12 + 1, ' ', 8);
if (0 == 1) goto P_cgerror;
initialized = 1;
goto P_ret_initialize;
P_dump:
return 0;
/* CANCEL callback handling */
P_cancel:
if (!initialized)
return 0;
if (module && module->module_active)
cob_fatal_error (COB_FERROR_CANCEL);
initialized = 0;
P_clear_decimal:
return 0;
}
/* End PROGRAM-ID '01_IF' */
/* Initialize module structure for 01_IF */
static void _01_IF_module_init (cob_module *module)
{
module->module_name = "01_IF";
module->module_formatted_date = COB_MODULE_FORMATTED_DATE;
module->module_source = COB_SOURCE_FILE;
module->module_entry.funcptr = (void *(*)())_01_IF;
module->module_cancel.funcptr = (void *(*)())_01_IF_;
module->module_ref_count = NULL;
module->module_path = &cob_module_path;
module->module_active = 0;
module->module_date = COB_MODULE_DATE;
module->module_time = COB_MODULE_TIME;
module->module_type = 0;
module->module_param_cnt = 0;
module->ebcdic_sign = 0;
module->decimal_point = '.';
module->currency_symbol = '$';
module->numeric_separator = ',';
module->flag_filename_mapping = 1;
module->flag_binary_truncate = 1;
module->flag_pretty_display = 1;
module->flag_host_sign = 0;
module->flag_no_phys_canc = 1;
module->flag_main = 1;
module->flag_fold_call = 0;
module->flag_exit_program = 0;
module->flag_debug_trace = 0;
module->flag_dump_ready = 0;
module->module_stmt = 0;
module->module_sources = st_source_files;
}
/* End functions */