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

216 lines
4.8 KiB
C

/* Generated by cobc 3.1.2.0 */
/* Generated from hellocobol.cob */
/* Generated at Aug 04 2025 19:08:23 */
/* 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 hellocobol.cob */
#include <stdio.h>
#include <string.h>
#define COB_KEYWORD_INLINE __inline
#include <libcob.h>
#define COB_SOURCE_FILE "hellocobol.cob"
#define COB_PACKAGE_VERSION "3.1.2"
#define COB_PATCH_LEVEL 0
#define COB_MODULE_FORMATTED_DATE "Aug 04 2025 19:08:23"
#define COB_MODULE_DATE 20250804
#define COB_MODULE_TIME 190823
/* Global variables */
#include "hellocobol.c.h"
/* Function prototypes */
static int hello ();
static int hello_ (const int);
static void hello_module_init (cob_module *module);
/* Main function */
int
main (int argc, char **argv)
{
cob_init (argc, argv);
cob_stop_run (hello ());
}
/* Functions */
/* PROGRAM-ID 'hello' */
/* ENTRY 'hello' */
static int
hello ()
{
return hello_ (0);
}
static int
hello_ (const int entry)
{
/* Program local variables */
#include "hellocobol.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: 4 : Entry hello : hellocobol.cob */
l_2:;
#line 4 "hellocobol.cob"
ENTRY_HELLO:;
#line 100 "hellocobol.c"
#line 5 "hellocobol.cob"
SECTION_MAIN_20SECTION:;
#line 103 "hellocobol.c"
#line 5 "hellocobol.cob"
cob_nop ();
#line 106 "hellocobol.c"
/* Line: 5 : DISPLAY : hellocobol.cob */
module->module_stmt = 0x00100005;
#line 5 "hellocobol.cob"
cob_trace_stmt (st_1);
#line 112 "hellocobol.c"
cob_display (0, 1, 1, &c_1);
/* Line: 6 : STOP RUN : hellocobol.cob */
module->module_stmt = 0x00100006;
#line 6 "hellocobol.cob"
cob_trace_stmt (st_2);
#line 119 "hellocobol.c"
cob_stop_run (b_2);
module->module_stmt = 0x00100007;
/* 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;
hello_module_init (module);
module->crt_status = NULL;
/* Initialize cancel callback */
cob_set_cancel (module);
/* Initialize WORKING-STORAGE */
b_2 = 0;
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 'hello' */
/* Initialize module structure for hello */
static void hello_module_init (cob_module *module)
{
module->module_name = "hello";
module->module_formatted_date = COB_MODULE_FORMATTED_DATE;
module->module_source = COB_SOURCE_FILE;
module->module_entry.funcptr = (void *(*)())hello;
module->module_cancel.funcptr = (void *(*)())hello_;
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 */